Problem on running Hydrus-1D-UNSATCHEM module- using python

A discussion forum for Hydrus-1D users.
Post Reply
meisam.rezaei
Posts: 3
Joined: Sun May 10, 2020 9:02 am
Location: Belgium
Contact:

Problem on running Hydrus-1D-UNSATCHEM module- using python

Post by meisam.rezaei » Sun May 10, 2020 9:53 am

Dear all

I have got a big problem running hydrus 1D -unsatchem in python. I have scrips to run Hydrus in Python (2.7). It imports hydrus funky (functions) and should run hydrus model. It can run the project for multiple locations if soil hydraulic properties of each location are specified. But after all it is not working and executing hydrus project. Enclosed you can find the hydrus project and python script.
------------------
It seems the hydrus script is not running at all with the python script. However without solute transport option it is working well, as I did in my PhD. But when using UNSATCHEM, It has a problem with reading profile.dat. Note: I do not see this error when running python scripts but no results are generated (it is not running hydrus project in destination folder). This problem only occurs when hydrus is executed in the terminal, not when it is run from within the hydrus program itself (running manually with each soil profile properties)! I don't know what causes this, perhaps this is a bug in hydrus.

In any case: some further testing showed that this error occurs when I am using the "major ion chemistry" option. When I am not using this option, everything works fine.

I really appreciate to help me to solve this problem/bug.


Thanks in advance and best wishes,

Meisam
Attachments
model sistan.zip
hydrus project and python script with input data
(20.13 KiB) Downloaded 3 times

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

Re: Problem on running Hydrus-1D-UNSATCHEM module- using python

Post by Jirka » Sun May 10, 2020 6:45 pm

Meisam,

Contrary to the standard computational modules (e.g., h1d_calc.exe), the UnsatChem module (h1d_unsc.exe) needs not only input files from the working project folder, but also four files with inputs for Pitzer's model, i.e., BINARYP.dat, COMP.dat, LAMBDA.dat, and TERNARYP.dat. These files need to be located in the same folder as the (h1d_unsc) exe file. If I run the Fortran debugger, I need to place them in the same folder as the Level_01.dir file.

Jirka

meisam.rezaei
Posts: 3
Joined: Sun May 10, 2020 9:02 am
Location: Belgium
Contact:

Re: Problem on running Hydrus-1D-UNSATCHEM module- using python

Post by meisam.rezaei » Mon May 11, 2020 5:29 am

Hi Jirka,

Many thanks. Based on your explain I noticed that I should change 'H1D_CALC.EXE' to 'H1D_UNSC.EXE' in my Hydrus.Funky.py to run UnsatChem module. However, all those files were already in the same directory/folder (installation directory of Hydrus). I tried to run the model using the modified script but unfortunately the problem is not solved (still not running Hydrus project from within the python script)!

Thanks in advance
Meisam

meisam.rezaei
Posts: 3
Joined: Sun May 10, 2020 9:02 am
Location: Belgium
Contact:

Re: Problem on running Hydrus-1D-UNSATCHEM module- using python

Post by meisam.rezaei » Mon May 11, 2020 10:27 am

Hi Jirka

It is solved. Some small things were changed in the script and it is working well. Thanks for your information that solved the problem.
Meisam

Post Reply