Run Hydrus-1D on Linux

A discussion forum for Hydrus-1D users.
Post Reply
sam
Posts: 10
Joined: Fri Jul 11, 2014 5:37 pm
Location: USA

Run Hydrus-1D on Linux

Post by sam » Fri Feb 20, 2015 5:26 pm

Hello, I have a question to run Hydrus-1D on Linux. I downloaded the source code and compiled it according to the instructions attached at the end. Then I run the h1d_calc.exe and get error messages:"
Open file error in file : LEVEL_01.DIR ". The instructions say we should "placed h1d_calc.exe directly into the folder with the HYDRUS-1D installation and executed directly from the HYDRUS-1D GUI." Does it mean I can only run Hydrus-1D on Windows machine using the GUI? How can I run it on Linux by telling it the needed input information such as domain, soil parameters, boundary conditions and so on? :( Thank you.

Sam,

Attached instructions:
"This source code can be compiled and linked using a FORTRAN compiler. The resulting executable code should be named h1d_calc.exe. It can then be placed directly into the folder with the HYDRUS-1D installation and executed directly from the HYDRUS-1D GUI.
Note that when compiling this source code using compilers not descending from Microsoft PowerStation (e.g., on workstations), you need to delete (or comment out) in the main file calls to functions GetDat and GeTim (get date and get time) and perhaps replace them with corresponding functions. Additionally, you need to delete the calls to the MSFLIB library (use MSFLIB, code between "interface" and "end interface" (including), and Signal handler routines h_sig and hand_fpe). This part of the code has no effect on the rest of the program. It only catches the exceptions, such as division by zero, and closes the programs and the output files in such case."

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

Re: Run Hydrus-1D on Linux

Post by Jirka » Fri Feb 20, 2015 8:34 pm

Only the GUI is limited to Windows OS. The computational module can be run on any OS (and without GUI), on which you compile it. The code is written in a way so that it reads the "Level_01.dir" file, which contains the path to where the input and output files are (e.g., c:\ Users\HYDRUS1D\Test1). This file (Level_01.dir) must be located in the same folder as the compiled program. The folder with input/output files (e.g., Test1) can be located anywhere. J.

sam
Posts: 10
Joined: Fri Jul 11, 2014 5:37 pm
Location: USA

Re: Run Hydrus-1D on Linux

Post by sam » Wed Feb 25, 2015 4:22 pm

Hi J., Thanks for your reply. I added the Level_01.dir where h1d_calc.exe is locaged, and have the one line message telling where is the input/output folder:
/home/infilt

Inside the /infilt folder, I copied input file from Hydrus-1D examples/Direct/1INFILTR, including DESCRIPT.TXT, Hydrus1d.dat, PROFILE.DAT, Selector.in.

Then I run the program on linux ./h1d_calc.exe,
It run this time very fast without any error messages, but nothing is produced in the output folder. It looks like it was not doing anything? Any idea what is wrong? Thanks !

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

Re: Run Hydrus-1D on Linux

Post by Jirka » Wed Feb 25, 2015 7:43 pm

No, I have no experience with Linux. J.

Green_roof54
Posts: 13
Joined: Mon Oct 14, 2013 10:00 pm
Location: France

Re: Run Hydrus-1D on Linux

Post by Green_roof54 » Thu Feb 26, 2015 1:11 pm

Hi sam,

I used Hydrus 1D with linux but using Wine 1.6 (please find link : https://www.winehq.org/). It's an alternative solution.

have a nice day.

sam
Posts: 10
Joined: Fri Jul 11, 2014 5:37 pm
Location: USA

Re: Run Hydrus-1D on Linux

Post by sam » Thu Feb 26, 2015 6:37 pm

Problem solved. :D
In the HYDRUS.FOR file, beside the instruction given online, we need to correct the file path as well. For example,

cFileName = cDataPath(1:iLengthPath)//'\Selector.in'

need to change to

cFileName = cDataPath(1:iLengthPath)//'/Selector.in'

where, forward slash should be used instead of backward slash.

Then it runs successfully.

emilie
Posts: 2
Joined: Thu Dec 08, 2016 7:51 am
Location: France

Re: Run Hydrus-1D on Linux

Post by emilie » Thu Dec 08, 2016 8:21 am

Hi everyone,

I am new on Hydrus forum and and trying to run Hydrus 1D on Linux as Sam related in this post.
I downloaded the source codes and would like to follow Sam instructions as mentioned above but I cannot find the file LEVEL_01.DIR. When could I find it?
Actually when I downloaded the code, I didn't even get the TEST1 file but just 10 fortran files. Is something missing or am I just misunderstanding ?

Thanks a lot,

Emilie

Mirek
Posts: 408
Joined: Sat Mar 16, 2002 4:00 pm
Location: Czech Republic
Contact:

Re: Run Hydrus-1D on Linux

Post by Mirek » Thu Dec 08, 2016 12:30 pm

Emilie,

you can create this file, its format is very simple - it contains just the path to a directory where the input and output files are (e.g., C:\Users\Public\Documents\PC-Progress\HYDRUS-1D 4.16\Examples\Direct\TEST1). See the attached example.
Mirek
Attachments
level_01.dir
(76 Bytes) Downloaded 254 times

hhfang
Posts: 4
Joined: Thu Mar 14, 2019 1:51 pm
Location: Germany

Re: Run Hydrus-1D on Linux

Post by hhfang » Thu Aug 15, 2019 2:19 pm

Dear all,
I compiled HYDRUS 1D on an Unix system and tried to run a simple case
(only with precipitation as upper BD and free dranage for bottom BD). But
in the end there showed some error message 'Floating Point exception' like
the picture below.
Image

I was calculating the moisture profile for 20 days, but the ouput was stopped
on the last day. But when I tried same conditions with less simulation days
(10 days), it stopped again on the last day. I am not sure whether it is a
problem that I should fix and how I can fix. Any ideas is appreciated. Excuse
me if I miss some information. If more information should be provided, I am
glad to add it.
Thank you very much.
Attachments
Hydrus.PNG
Hydrus.PNG (34.81 KiB) Viewed 966 times

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

Re: Run Hydrus-1D on Linux

Post by Jirka » Thu Aug 15, 2019 4:00 pm

I have never worked, and hopefully never will, withLinux, and thus cannot help.

You should first try to run the test examples that come with the HYDRUS-1D installation to see whether the problem is with your input or with your compiled program.

J.

Post Reply