Page 1 of 1

Automatic export of results to ASCII?

Posted: Wed Sep 18, 2013 11:19 pm
by jeffk
Hi, I'm trying to set up Hydrus 2D/3D to run in an automated parameter estimation framework (e.g., PEST). I can modify the input files and run the program fine, but is there away to automatically generate ascii output of pressure head or (preferably) water content? That is, I need to perform the "Results > Convert output to ASCII..." command after every run without going through the GUI. Alternatively, is there a way to convert the th.out file, which is generated automatically, to ASCII?

I cannot run the built-in inversion tool because I'm trying to use gravity data for optimization - I need to calculate the data misfit outside of Hydrus.

Thanks,
Jeff

Re: Automatic export of results to ASCII?

Posted: Wed Sep 18, 2013 11:51 pm
by jeffk
Okay, if nothing else it looks like I can read the binary file th.out using fread in MATLAB with 'float' precision. The rest of my "wrapper" code is in MATLAB so that might work okay. I'd still be interested to know if there's a more direct approach, though.

Thanks-
Jeff

Re: Automatic export of results to ASCII?

Posted: Thu Sep 19, 2013 12:41 am
by Jirka
Jeff,

I do not think there is. The convert function is implemented only in GUI. The computational code does not have (inside) function to save this output as an ascii.

You can probably write a very simple function that can convert it. Here is the function, which is called at each print time, to write the h.out file. It is simply a sequence of real (float) numbers.

subroutine hOut(hNew,NumNP,t,ierr)

double precision t
dimension hNew(NumNP)

write(75,err=901) sngl(t)
write(75,err=901) (hNew(j),j=1,NumNP)
return

* Error when writing into an output file
901 ierr=1
return
end

However, note that nodal coordinates are given in MeshTria.txt.
J.

Re: Automatic export of results to ASCII?

Posted: Thu Sep 19, 2013 4:28 am
by jeffk
Okay, thank you. It should be an easy problem.
Jeff

Re: Automatic export of results to ASCII?

Posted: Thu Dec 20, 2018 7:54 pm
by Cuneyd
Hello Jeff,

PEST can read out files

* model command line
call_HBV.bat
* model input/output
HBV_parameters.tpl HBV_pars.txt
sm.ins obsFunc_sm.out
gwG.ins obsFunc_gwG.out
gwY.ins obsFunc_gwY.out
Qnormal.ins obsFunc_Q.out
Qln.ins obsFunc_Qln.out
* prior information


In case of ascii transformation "copy" command in bat file can work.
copy /y C:\temp\aaa.out C:\temp\aaa.asc

Hope this helps.

--------------------------

I have a question on calling Hydrus from command prompt:

We would like to calibrate "Water Flow Parameters" in Hydrus3D using PEST tool.

How shall we call HYDRUS in command prompt?

We try this one but this just opens the project gui.

./Hydrus3D 'C:/Users/Erdal/Desktop/Hydrus_R1/15+15+15_R1_vG.h3d2'

Thank you inadvance,
C├╝neyd
https://orcid.org/0000-0003-4402-906X

Re: Automatic export of results to ASCII?

Posted: Thu Dec 20, 2018 8:47 pm
by Jirka
FAQ4: How to run computational modules outside of GUI ?
https://www.pc-progress.com/en/Default. ... q-01-10#k4