Recommended Compilers

A discussion forum for Hydrus-1D users.
Post Reply
User_NA14

Recommended Compilers

Post by User_NA14 » Tue Jul 12, 2011 5:03 pm

Hello,
I wanted to check a couple of things regarding the source code and compilers for Hydrus-1D.
I downloaded the source code from the webpage and in the code it says that it was last modified in October, 2009. Is that the source code I should be using?
I tried using gfortran on linux to run the code and commented out the first few lines in hydrus.for as was recommended, however, time.for won't compile because getdat and gettim functions weren't recognized.
I also tried using openwatcom but it doesn't seem to be compatible.
What compilers do you recommend?
Thanks!

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

Post by Jirka » Tue Jul 12, 2011 6:38 pm

You can use pretty much any compiler you want. However, you need to follow the instructions, given on the page from which you downloaded the source code, which instruct you what to do with the GetDat and GetTim functions (see below). Jirka

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.

peterdsteinberg@gmail.com
Posts: 1
Joined: Tue Jan 31, 2012 4:47 pm

Post by peterdsteinberg@gmail.com » Tue Jan 31, 2012 4:48 pm

I am trying to compile the code with gfortran on Windows and Mac, after making the edits to the code described in the instructions. I have commented out all references to getTim, getDat, MSFlib, and signal handling. It will not compile because of some sort of dialect difference in gfortran. It complains about the use of GETARG with three arguments. When I delete the third argument to GETARG (status), it compiles to .o objects, but when linking cannot find the symbol for NARGS. Gfortran also does not like the PAUSE statements.

Obviously there is some sort of fortran dialect being used that is not readily recognized by gfortran. Has anyone had any luck with gfortran and hydrus1d? Can you offer any suggestions?

Here's the output of my compile script:




HYDRUS.FOR:115.72:

call GETARG(i2, cDataPath, status)
1
Error: Too many arguments in call to 'getarg' at (1)
MATERIAL.FOR:656.72:

PAUSE 'xMualem: h is equal to zero!'
1
Warning: Deleted feature: PAUSE statement at (1)
MATERIAL.FOR:740.72:

IF(FB*FA.GT.0.) PAUSE 'Root must be bracketed for ZBRENT.'
1
Warning: Deleted feature: PAUSE statement at (1)
MATERIAL.FOR:796.72:

PAUSE 'ZBRENT exceeding maximum iterations.'
1
Warning: Deleted feature: PAUSE statement at (1)
MATERIAL.FOR:874.72:

pause 'too many steps in qromb'
1
Warning: Deleted feature: PAUSE statement at (1)
MATERIAL.FOR:930.72:

if(den.eq.0.)pause 'failure in polint'
1
Warning: Deleted feature: PAUSE statement at (1)
SOLUTE.FOR:2043.72:

IF(FB*FA.GT.0.) PAUSE 'Root must be bracketed for ZBRENT1.'
1
Warning: Deleted feature: PAUSE statement at (1)
SOLUTE.FOR:2099.72:

PAUSE 'ZBRENT1 exceeding maximum iterations.'
1
Warning: Deleted feature: PAUSE statement at (1)

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

Re: Recommended Compilers

Post by hhfang » Fri Aug 09, 2019 1:57 pm

Hi all,
I have a question about compiling the source code. I am new to FORTRAN.
I read the document 'comment out) in the main file calls to functions GetDat and GeTim',
I saw the code

Code: Select all

 call getdat(iYear,iMonth,iDay)  

Code: Select all

  call gettim(iHours,iMins,iSecs,i100th)'  
But there is another line

Code: Select all

Rtime1=RTime(iMonth,iDay,iHours,iMins,iSecs,i100th)
Does it mean that I should also command out this line?
Thanks a lot!

Julia

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

Re: Recommended Compilers

Post by Jirka » Fri Aug 09, 2019 7:03 pm

Getdat and Gettime are compiler-specific functions, which should be replaced. The Function RTime() uses data provided by these two function. You can find it in the file Time.for. J.

Post Reply