ROMS 2.1 successfully built with g95

Facts, news, and guidance about ROMS software

Moderators: arango, robertson

Post Reply
Message
Author
User avatar
m.hadfield
Posts: 521
Joined: Tue Jul 01, 2003 4:12 am
Location: NIWA

ROMS 2.1 successfully built with g95

#1 Post by m.hadfield » Mon Oct 18, 2004 2:28 am

In case anyone's interested, I would like to report that I have successfully built and run ROMS 2.1 using g95, a free (as in speech and beer) Fortran 95 compiler based on gcc and g77: http://www.g95.org/

I did this on Windows 2000 using Cygwin (a Unix-like emulation layer). Run-time performance with optimisation is about 45% slower than with Compaq Fortran, my usual compiler on this platform. Results appear to be very similar, but I haven't checked thoroughly.

Based on my experience, it should be straightforward to install g95 and build ROMS on other platforms.

User avatar
shchepet
Posts: 185
Joined: Fri Nov 14, 2003 4:57 pm

#2 Post by shchepet » Wed Oct 27, 2004 1:38 am

I found it successful and easy to install too (I am using Mandrake Linux 9.2 and 10.0). However performance is significantly lower that that of Intel IFC compiler. For a test problem I am getting 45 seconds run time while the same test, but using Intel compiler takes only 28 seconds and 36, if PGF compiler is used. ...still it finally happened, this is the first truly free (like speech and beer) F90 compiler.

...Upon reading instructions, I found that there are no -O3 or something like that optimization flags available for g95. I use -O3 anyway, but it looks that there is no effect, thought it does not complain either.

User avatar
m.hadfield
Posts: 521
Joined: Tue Jul 01, 2003 4:12 am
Location: NIWA

#3 Post by m.hadfield » Wed Oct 27, 2004 4:08 am

I found it successful and easy to install too (I am using Mandrake Linux 9.2 and 10.0). However performance is significantly lower that that of Intel IFC compiler. For a test problem I am getting 45 seconds run time while the same test, but using Intel compiler takes only 28 seconds and 36, if PGF compiler is used
Yes, g95 does seem to be slower than the best commercial compilers. I think it will be of most interest to people using Windows, where Intel Fortran is not available for free (as in beer).
Upon reading instructions I found that there are no -O3 or something like that optimization flags available for g95. I use -O3 anyway, but it looks that there is no effect, thought it does not complain either.
That's odd. In my experience, g95 gives much faster code with the "-O3" switch than with "-O2" or lower.

User avatar
arango
Site Admin
Posts: 1114
Joined: Wed Feb 26, 2003 4:41 pm
Location: IMCS, Rutgers University
Contact:

#4 Post by arango » Thu Nov 04, 2004 8:43 pm

I was also able to build, compile, and run ROMS/TOMS using g95 on both my desktop and labtop. Both computers support Windows and Linux enviroments. The code compiled and ran fine in the Linux enviroment. The code also ran fine when compiled under Widows using the cygwin interface. The only thing that I have to do was to upgrade my installed cygwin interface, install g95, and re-install a newer NetCDF library compiled with g95. The code didn't run with my old NetCDF library compiled with g77. It failed when creating the model output NetCDF files.

I didn't find any instructions to compile the NetCDF file with g95 under cygwin. However, I got everything to work when I executed the following command during the configuration step:

CC=gcc F90=g95 F90FLAGS='-O -Wno-globals' CPPFLAGS='-Df2cFortran' ./configure

Good luck, H

michelesimioli

#5 Post by michelesimioli » Fri Nov 05, 2004 5:30 pm

I am using an Acer laptop with a 1.8 GHz Pentium 4, about 1800 bogoMIPS. Compiling a reduced version of the BENCHMARK1 with an 80x50x15 grid and 100 time steps only. My linux is a mixture of several distribution pieces, but all newer than 3 months.
Compiler g95 seems to require the option '-fno-second-underscore' or else it does not resolve hundreds of symbols at link time. And, lo!, appears to have an option '--optimize' with a nice overall effect.
Without this option compile time is 49s (user CPU time), run time is 1338.5 CPU seconds, executable file size is 2273100. With the option, compile time is 1m06s, run time is 193s and file size is 1297950. In both cases system resources at run time are about 22MB of Virtual and 20MB real memory, during compile time they vary but never exceed about 280MB virtual memory.
This is to be compared with my Intel Fortran, with options '-O3 -ip -tpp7 -xN' which has a compilation time of 16m30s, a run time of 290s and a file size of 1946660 bytes.
I had no problems compiling NetCDF with g95, same options, as well as oa.
I am now having a go at WRF version 2.0.2 and I find that you need a few new compilation flags, like '-ffree-form' or else g95 requires xxx.f files to have a label at columns 1-5.
Have we found a diamond in the rough? - Happy coding - mich

Post Reply