Automatic export of results to ASCII?

A discussion forum for users of the new HYDRUS 2D/3D. HYDRUS is a software package for simulating water, heat and solute movement in two- and three-dimensional variably saturated media. Happy Posting!
Post Reply
jeffk
Posts: 3
Joined: Thu Sep 05, 2013 3:50 pm
Location: USA

Automatic export of results to ASCII?

Post by jeffk » Wed Sep 18, 2013 11:19 pm

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

jeffk
Posts: 3
Joined: Thu Sep 05, 2013 3:50 pm
Location: USA

Re: Automatic export of results to ASCII?

Post by jeffk » Wed Sep 18, 2013 11:51 pm

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

Jirka
Posts: 4563
Joined: Sat Mar 16, 2002 3:47 pm
Location: USA
Location: Riverside, CA

Re: Automatic export of results to ASCII?

Post by Jirka » Thu Sep 19, 2013 12:41 am

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.

jeffk
Posts: 3
Joined: Thu Sep 05, 2013 3:50 pm
Location: USA

Re: Automatic export of results to ASCII?

Post by jeffk » Thu Sep 19, 2013 4:28 am

Okay, thank you. It should be an easy problem.
Jeff

Cuneyd
Posts: 4
Joined: Thu Dec 20, 2018 4:17 pm
Location: Turkey

Re: Automatic export of results to ASCII?

Post by Cuneyd » Thu Dec 20, 2018 7:54 pm

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

Jirka
Posts: 4563
Joined: Sat Mar 16, 2002 3:47 pm
Location: USA
Location: Riverside, CA

Re: Automatic export of results to ASCII?

Post by Jirka » Thu Dec 20, 2018 8:47 pm

FAQ4: How to run computational modules outside of GUI ?
https://www.pc-progress.com/en/Default. ... q-01-10#k4

Post Reply