Monday, 1 December 2014

compilling modpath6 modflow-nwt modflow2005 in linux(makefile change)

The list of files are as follows:
MOD_GLOBAL.for  MOD_PARTICLEDATA.for    MP6Flowdata.for  MP6ParticleMgr.for     Writpts0.for    MOD_MPBAS.for   MOD_PrecisionCheck.for  MP6.for          MP6TrackParticles.for  MOD_MPDATA.for  MP6Budgetrd.for         MP6MPBAS1.for    MP6Util.for
Note that MP6PrecisionCheck.for has been changed into MOD_precisionCheck.for as it contains a module. Also fortran is independent from file names.
 By first start, I have used:

gfortran *.for *.inc -o a.out
there are errors reported.

Then I dicided to make the step-by-step compiling
gfortran -c MOD*.for
gfortran -c PM6*.for
gfortran *.o -o def
The binary file has been created, but it runs with errors.
So I dicided to use ifort for compilling:
ifort -c MOD*.for
ifort -c PM6*.for
ifort *.o -o def
Everything works perfectly.

Learned:
  1. if dirct compilling is not working, it is necessary to create the object files first and then do the compilling work. 
  2. the *.inc file may not be needed in the command that conduct the compilling work.
  3. some programs are depended on the compiller (either gfortran or ifort)

The same trick may also need to be used for SUTRA-MS

Modflow2005 is almost working out of the box, except that one needs to change the inc file.

modflow-nwt it is found that gfortran lack of ieee_arithmatic library. ifort has no problem in finding that library. question has been raised in stackoverflow. the other trick i made



No comments:

Post a Comment