Compiling Roms with Linux and g95

Discussion on computers, ROMS installation and compiling

Moderators: arango, robertson

Post Reply
Message
Author
michele
Posts: 13
Joined: Fri Apr 27, 2007 9:40 pm
Location: Università di Bologna

Compiling Roms with Linux and g95

#1 Unread post by michele »

Hi to all!
I 'm novice! i'm trying to compile Roms on my linux with g95 compiler,I would confirm if i did it well!After Netcfd's installation (in /usr/local/lib and /usr/local/include), after changing FORT=g95 in Makefile, I go in roms/trunk directory and type :
export NETCDF_LIBDIR=/usr/local/lib
export NETCDF_INCDIR=/usr/local/include
export FORT=g95
make

it compiles and no errors appear!So executable oceanS is created in roms/trunk directory!That's fine! :D
So i launch Upwelling test as follow:
./oceanS < ROMS/External/ocean_upwelling.in
It works!and ends as follow:

Elapsed CPU time (seconds):

Thread # 0 CPU: 559.259
Total: 559.259

Nonlinear model elapsed time profile:

Initialization ................................... 0.036 ( 0.0064 %)
Processing of input data ......................... 0.332 ( 0.0594 %)
Computation of vertical boundary conditions ...... 0.132 ( 0.0236 %)
Computation of global information integrals ...... 3.120 ( 0.5579 %)
Writing of output data ........................... 1.256 ( 0.2246 %)
Model 2D kernel .................................. 238.471 (42.6405 %)
2D/3D coupling, vertical metrics ................. 2.232 ( 0.3991 %)
Omega vertical velocity .......................... 4.684 ( 0.8376 %)
Equation of state for seawater ................... 2.528 ( 0.4521 %)
Biological module, source/sink terms ............. 71.284 (12.7462 %)
3D equations right-side terms .................... 14.773 ( 2.6415 %)
3D equations predictor step ...................... 82.501 (14.7519 %)
Pressure gradient ................................ 18.493 ( 3.3067 %)
Harmonic mixing of tracers, S-surfaces ........... 14.077 ( 2.5171 %)
Harmonic stress tensor, S-surfaces ............... 7.820 ( 1.3984 %)
Corrector time-step for 3D momentum .............. 20.657 ( 3.6937 %)
Corrector time-step for tracers .................. 63.180 (11.2971 %)
Total: 545.578 97.5538

All percentages are with respect to total time = 559.259

ROMS/TOMS - Output NetCDF summary for Grid 01:
number of time records written in HISTORY file = 00000021
number of time records written in RESTART file = 00000002

Analytical header files used:

ROMS/Functionals/ana_biology.h
ROMS/Functionals/ana_btflux.h
ROMS/Functionals/ana_grid.h
ROMS/Functionals/ana_initial.h
ROMS/Functionals/ana_smflux.h
ROMS/Functionals/ana_srflux.h
ROMS/Functionals/ana_stflux.h
ROMS/Functionals/ana_vmix.h

ROMS/TOMS: DONE... Saturday - May 19, 2007 - 11:55:12 AM
Remaining memory: 136 bytes allocated at line 790 of mod_scalars.f90
Remaining memory: 128 bytes allocated at line 784 of mod_scalars.f90
Remaining memory: 24 bytes allocated at line 491 of mod_ncparam.f90
Remaining memory: 4 bytes allocated at line 963 of inp_par.f90
Remaining memory: 16 bytes allocated at line 809 of mod_scalars.f90
Remaining memory: 8 bytes allocated at line 516 of mod_ncparam.f90
Remaining memory: 44 bytes allocated at line 780 of mod_scalars.f90
Remaining memory: 168 bytes allocated at line 778 of mod_scalars.f90
Remaining memory: 32 bytes allocated at line 782 of mod_scalars.f90
Remaining memory: 128 bytes allocated at line 788 of mod_scalars.f90
Remaining memory: 136 bytes allocated at line 786 of mod_scalars.f90
Remaining memory: 24 bytes allocated at line 495 of mod_ncparam.f90
Remaining memory: 48 bytes allocated at line 810 of mod_scalars.f90
Remaining memory: 192 bytes allocated at line 807 of mod_scalars.f90
Remaining memory: 48 bytes allocated at line 800 of mod_scalars.f90
Remaining memory: 48 bytes allocated at line 799 of mod_scalars.f90
Remaining memory: 48 bytes allocated at line 804 of mod_scalars.f90
Remaining memory: 64 bytes allocated at line 801 of mod_scalars.f90
Remaining memory: 48 bytes allocated at line 802 of mod_scalars.f90
Remaining memory: 48 bytes allocated at line 803 of mod_scalars.f90
Remaining memory: 192 bytes allocated at line 805 of mod_scalars.f90
Remaining memory: 48 bytes allocated at line 811 of mod_scalars.f90
Remaining memory: 24 bytes allocated at line 493 of mod_ncparam.f90
Remaining memory: 24 bytes allocated at line 492 of mod_ncparam.f90
Remaining memory: 96 bytes allocated at line 494 of mod_ncparam.f90
... More segments remain

That's all? Is everything all right?

But i don't understand a thing about what roms 'finds' netcdf library:i should not modify Linux-g95.mk ,is it true?In fact in this file i look that remains (after i compile as above):
# NETCDF_INCDIR ?= /opt/gnusoft/netcdf/include
# NETCDF_LIBDIR ?= /opt/gnusoft/netcdf/lib
NETCDF_INCDIR ?= /opt/g95soft/netcdf/include
NETCDF_LIBDIR ?= /opt/g95soft/netcdf/lib

but my netcdf is in /usr/local/lib or /include. Is it ok?

Thanks for reply and be patience for this novice user.... :oops:

skbhate

#2 Unread post by skbhate »

Looks like you are already setting the environmental variables NETCDF_LIBDIR and NETCDF_INCDIR via export, which overrides anything which is set in Linux.g95.mk, so you are ok? As far as ROMS run goes ROMS expert needs to answer that for you.

-sachin

michele
Posts: 13
Joined: Fri Apr 27, 2007 9:40 pm
Location: Università di Bologna

#3 Unread post by michele »

Ok Sachin and thanks for reply!

To run other test, i type:

make ROMS_APPLICATION=BENCHMARK
make: Nothing to be done for `all'

so i type :

export ROMS_APPLICATION=BENCHMARK
export FORT=g95
make
make: Nothing to be done for `all'

:roll: ...an error?

skbhate

#4 Unread post by skbhate »

do ...

make clean

then, run make... this will get rid of your 'nothing to do ..' error

btw..
If you are using ROMS3.0..then you can use ROMS/Bin/build.sh to
specify your environment and applications. It takes care of cleaning
up the old object code and rebuilds the code.

-sachin

michele
Posts: 13
Joined: Fri Apr 27, 2007 9:40 pm
Location: Università di Bologna

#5 Unread post by michele »

thanks Sachin!
It works.
I tested many applications.But in some of them the following error messages appeared:

1)in test_head:

In file ocean_coupler.f90:18

USE m_MCTWorld, ONLY : MCTWorld_init => init
1
Fatal Error: Can't open module file 'm_mctworld.mod' at (1) for reading: Nessun file o directory
make: *** [Build/ocean_coupler.o] Error 1

2)in benchmark:

In file included from ROMS/Adjoint/ad_bc_2d.F:2:
ROMS/Include/cppdefs.h:664: error: benchmark1.h: Nessun file o directory
make: *** [Build/ad_bc_2d.f90] Error 1

3)in coupling test

In file main3d.f90:25

USE ocean_coupler_mod, ONLY : atmos_coupling
1
Error: Symbol 'atmos_coupling' referenced at (1) not found in module 'ocean_coupler_mod'
make: *** [Build/main3d.o] Error 1

But more applications worked fine!

Then some applications didn't work when i launched ocean_*.in.For example with adria02:

Output/Input Files:

Output Restart File: adria02_rst.nc
Prefix for History Files: adria02_his
Output Averages File: adria02_avg.nc
Output Stations File: adria02_sta.nc
Output Floats File: adria02_flt.nc

READ_PHYPAR - could not find input file: adria02_grid2.nc

thanks!
michele

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

#6 Unread post by m.hadfield »

Re your experience with various test cases:

1) TEST_HEAD: yeah, I get this error too. I think it's a bug.

2) BENCMARK: you appear to have set ROMS_APPLICATION to BENCHMARK1. It should be BENCHMARK, and you can run the 3 different sub-cases by selecting the appropriate input file.

3) COUPLING_TEST: I can't build this one either.

4) ADRIA02: well, it looks like the file isn't there!

Though it can be fun, in a limited way, on a rainy day, to try to build and run all the ROMS test cases, there are a few of them that are currently broken. So for the time being I suggest you stick to the ones that are relevant to what you're trying to do and work without too much effort on your part.

jcwarner
Posts: 1204
Joined: Wed Dec 31, 2003 6:16 pm
Location: USGS, USA

#7 Unread post by jcwarner »

I have run many of the test cases before release of roms 3.0. I did not run them all, but I did run about 14 of them. TEST_HEAD was one of them, and it worked fine for me. This is an application that requires model coupling, so the user needs to make sure that they activated
SWAN_COUPLING ?= on in the makefile or build.sh.

The error:
"Fatal Error: Can't open module file 'm_mctworld.mod' ..."

probably has to deal with path issues trying to find the module files built for MCT. If you look in the Compilers/'OS-fortran'.mk files, we added FFLAGS for MCT. During the build, there will be "mct inc dirs and mct lib dirs " that need to be added. Check to see if these dirs are correct.

Also, as with the netcdf libraries, users need to build MCT in a corresponding fashion so that all the libs have the same number of trailing underscores, etc. (this is not your problem, at least not yet. I think your problem has to deal with paths.)

Please post more info as to the reason for failure of the TEST_HEAD app and i can help with the build.

-john

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

#8 Unread post by m.hadfield »

Hi John

Here's a list of all the test cases I've managed to build (but not necessarily run):

BASIN, BENCHMARK, BIO_TOY, BL_TEST, CANYON (2D & 3D), CHANNEL_NECK, DOUBLE_GYRE, ESTUARY_TEST, FLT_TEST (2D & 3D), GRAV_ADJ, KELVIN, LAB_CANYON, LAKE_SIGNELL, LMD_TEST, OVERFLOW, RIVERPLUME1, RIVERPLUME2, SEAMOUNT, SED_TEST1, SED_TOY, SHOREFACE, SOLITON, TEST_CHAN, TRENCH, UPWELLING, WEDDELL, WINDBASIN

and here's a list of the one's I couldn't build:

A4DVAR_TOY, COUPLING_TEST, INLET_TEST, RIP_CURRENT, TEST_HEAD

With at least one (RIP_CURRENT) this is because the corresponding header does not exist, and I think Hernan has now removed any references to this one from cppdefs.h. With TEST_HEAD (and COUPLING_TEST?) it's presumably because I didn't know how to build and link with the MCT stuff.

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

#9 Unread post by m.hadfield »

and here's a list of the one's I couldn't build
Oh, the shame! :oops:

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

#10 Unread post by arango »

We are working on the documentation of ROMS test cases in wikiROMS. I don't think that the user need to run all the test cases. Some of them are complicated and require additional libraries (MCT, ARPACK).

* A4DVAR_TOY is for weak constraint variational data assimilation using the 4D-PSAS and representer-based algorithms. There is not reason to run this test if you don't know what weak constraint 4DVAR is. The problem here is that several NetCDF files are nedeed to run this test case. I need to put such files on the ROMS website Datasets menu.

* COUPLING_TEST is for coupling ROMS to an atmospheric model. This has been done in the past with COAMPS and WRF. Therefore, you need to know both atmosphere and ocean models. This requires advanced knowledge and expertise.

* INLET_TEST and TEST_HEAD couples ROMS and SWAN. These are sediment applications. They required the MCT library for the coupling. Again, you need to know both models and sediment processes.

Documentation always takes time so be patient with us. I have a heavy workload with an extensive priority list. Unfortunately, cloning is illegal around here :wink:

michele
Posts: 13
Joined: Fri Apr 27, 2007 9:40 pm
Location: Università di Bologna

#11 Unread post by michele »

Hi to all!
i have run various test cases today with ROMS 3.0:

1) COUPLING_TEST, TEST_HEAD and maybe A4DVAR_TOY, and INLET_TEST require
SWAN_COUPLING ?= on in the makefile.But this isn't my problem:they require Mct and I don't have it at all! Do i install it?And can i install now? I didnt know nothing about Mct :?

2)In other test cases, Roms doesn't find some input files:
In ADRIA02
READ_PHYPAR - could not find input file: adria02_grid2.nc

in LMD_TEST
READ_PHYPAR - could not find input file: ROMS/External/stations.in
:shock:

In WEDDELL
READ_PHYPAR - could not find input file: ocean_clm.nc

In CHANNEL NECK 1 and 3
READ_PHYPAR - could not find input file: ../Data/cneck_grd_bath01.nc

Where are these files?

3)In TRENCH,an error in compiling appears,as follow:
ROMS/Include/cppdefs.h:664: error: trench.h: Nessun file o directory
make: *** [Build/ad_bc_2d.f90] Error 1

4)In SED_TEST1,it compiles fine but the application doesn't run (i think).It stops after only 21 timesteps :
MAIN: Abnormal termination: BLOWUP.
Is this an error?


What do you think about my ROMS?Why Roms doesn't find some input files?

Michele

jcwarner
Posts: 1204
Joined: Wed Dec 31, 2003 6:16 pm
Location: USGS, USA

#12 Unread post by jcwarner »

To test the release of roms 3.0, the test cases that I ran were:

BENCHMARK
ESTUARY_TEST
GRAV_ADJ
INLET_TEST
LAKE_SIGNELL
MIXED_LAYER
SED_TEST1
SED_TOY
SHOREFACE
TEST_CHAN
TEST_HEAD
UPWELLING

and a few test case that are not released including:
BEVANO, Breakwater, INFLOW_BASIN, Mud_toy, Rip_current, sand_wave, and Visser. The bevano case has wet_dry, river flow, tides, wind, swan coupling, nearshore wave driven flows, bedload, susp load, morphology, etc. It is a good test case for me to turn on all the switches and it ran fine.

I have had others ask for example output from the test cases that are included in the release, so that they know if it ran ok. What would be good information to provide to the users? Plots of the computed variables, should we provide the whole netcdf output file ??? history avg diags, etc etc ?? That could get a little out of hand, but i am not sure the best route to take.

liangliang
Posts: 61
Joined: Mon Jul 20, 2009 2:41 pm
Location: Port And Costal Engineering Laboratory

Re:

#13 Unread post by liangliang »

jcwarner wrote:I have run many of the test cases before release of roms 3.0. I did not run them all, but I did run about 14 of them. TEST_HEAD was one of them, and it worked fine for me. This is an application that requires model coupling, so the user needs to make sure that they activated
SWAN_COUPLING ?= on in the makefile or build.sh.

The error:
"Fatal Error: Can't open module file 'm_mctworld.mod' ..."

probably has to deal with path issues trying to find the module files built for MCT. If you look in the Compilers/'OS-fortran'.mk files, we added FFLAGS for MCT. During the build, there will be "mct inc dirs and mct lib dirs " that need to be added. Check to see if these dirs are correct.

Also, as with the netcdf libraries, users need to build MCT in a corresponding fashion so that all the libs have the same number of trailing underscores, etc. (this is not your problem, at least not yet. I think your problem has to deal with paths.)

Please post more info as to the reason for failure of the TEST_HEAD app and i can help with the build.

-john
Dear jcwarner:
In the makefile or build.sh,i couldn't find the line 'SWAN_COUPLING ?= on'.So,i couldn't active the option.I have succeeded in compling without the option,but i couldn't run.It may be the reason ?

jcwarner
Posts: 1204
Joined: Wed Dec 31, 2003 6:16 pm
Location: USGS, USA

Re: Compiling Roms with Linux and g95

#14 Unread post by jcwarner »

the swan_coupling is a definition in the *.h file, not in the build scrip.
So you need
#define SWAN_COUPLING
in your project.h file.

p.heidary

Re: Compiling Roms with Linux and g95

#15 Unread post by p.heidary »

Hello all
I am interested in COUPLING_TEST and want to do some MCT development. I am familiar with ROMS and WRF. where can i start?
There are some import/export.F files in MCT folder, how can i use them?
Shall I install WRF in wrf folder under atmosphere folder?

Thanks in advance.

Post Reply