Initialization for Fasham and EcoSim BioToys applications

Discussion about coupled ecosystem models

Moderators: arango, robertson

Post Reply
Message
Author
bronwyn
Posts: 26
Joined: Sun Nov 27, 2005 10:54 pm
Location: Free University Berlin

Initialization for Fasham and EcoSim BioToys applications

#1 Unread post by bronwyn »

I have some initialization files for Fasham and EcoSim BioToys applications which I want to make available for general use. Is there somewhere I can post these on the ROMS site or do I need to post elsewhere on an ftp server?

Thanks
- Bronwyn

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

#2 Unread post by arango »

Please send the files to David so we can put them on ROMS website datasets menu.

Thank you :)

robertson
Site Admin
Posts: 227
Joined: Wed Feb 26, 2003 3:12 pm
Location: IMCS, Rutgers University

#3 Unread post by robertson »

The initialization files for the BIO_TOY application are now on the datasets page.

FengZhou
Posts: 52
Joined: Wed Apr 07, 2004 10:48 pm
Location: 2nd Institute of Oceanography,SOA

Re: Initialization for Fasham and EcoSim BioToys applications

#4 Unread post by FengZhou »

Hi, bronwyn,

I have just tested the EcoSim case, but met trouble whiling running 1 step. The messages are:

STEP time[DAYS] KINETIC_ENRG POTEN_ENRG TOTAL_ENRG NET_VOLUME trd

0 0.00000 0.000000E+00 1.034867E+03 1.034867E+03 2.764606E+11 0
DEF_HIS - creating history file: ocean_his.nc

WRT_HIS - error while writing variable: Bac_F1
into history NetCDF file for time record: 1

ROMS/TOMS - Output error ............ exit_flag: 3
...
REASON: NetCDF: Numeric conversion not representable

I have googled the NetCDF error. The var Bac_F1 is Inf which might break the HIS file.

What can I do to solve this problem?

Thank you!

zhou

zhang
Posts: 27
Joined: Fri Mar 11, 2005 9:17 pm
Location: Woods Hole Oceanographic Institution

Re: Initialization for Fasham and EcoSim BioToys applications

#5 Unread post by zhang »

Is Bac_F1 part of the initial condition? If it is, you must have bad data in your initial condition since model encounter that problem while writing the initial record.

bronwyn
Posts: 26
Joined: Sun Nov 27, 2005 10:54 pm
Location: Free University Berlin

Re: Initialization for Fasham and EcoSim BioToys applications

#6 Unread post by bronwyn »

Hi Zhou,

That's curious. I've used this initial condition file without problems ... can you tell me what version of NetCdf and ROMS you are using?

Thanks,
Bronwyn

krinchy
Posts: 1
Joined: Thu Jul 08, 2004 8:16 pm
Location: METEOGALICIA

Re: Initialization for Fasham and EcoSim BioToys applications

#7 Unread post by krinchy »

Hi:

This may not help, but I have the same problem. I compiled the 3 versions of last revision of ROMS, serial, OpenMP and MPI. With my problem, serial version works ok! but with parallel versions OpenMP and MPI the model stops and raises an error:

STEP Day HH:MM:SS KINETIC_ENRG POTEN_ENRG TOTAL_ENRG NET_VOLUME

0 0 00:00:00 0.000000E+00 2.466303E+04 2.466303E+04 1.107566E+15
DEF_HIS - creating history file: ocean_his.nc

WRT_HIS - error while writing variable: w
into history NetCDF file for time record: 1

and after that:

ERROR: Abnormal termination: NetCDF OUTPUT.
REASON: NetCDF: Numeric conversion not representable

I tested versions 3.6.2 and 3.6.3 of NetCDF libraries and two different machines (Linux - Intel Itanium2 at HP Finisterrae - Centro de Supercomputación de Galicia, and Linux 2 QuadCores Intel Xeon). I use intel compilers (10 series for Finisterrae and 9.1 for QuadCores).

Any idea?

Best regards.

twainwright

Re: Initialization for Fasham and EcoSim BioToys applications

#8 Unread post by twainwright »

Hi!

I'm having a slightly different problem with the biotoy initialization files. I can build the model fine, but when I run it, it runs, but produces no output files. In the log, I find the following after the "Initial Basin Volumes" section:
NL ROMS/TOMS: started time-stepping: (Grid: 01 TimeSteps: 00058561 - 00001600)

Elapsed CPU time (seconds):

Thread # 0 CPU: 0.036
Total: 0.036
It seems that the initial timestep has been set to a high number, so the time loop exits instantly. I get the same problem building with mpi on or off.

Any suggestions as to how this might happen? I'm new to ROMS, and have only run the standard upwelling test before.

System info:
ROMS svn Revision: 232 (yesterday)
Linux (Fedora 9)
gfortran 4.3.0

--Tom

User avatar
kate
Posts: 4091
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: Initialization for Fasham and EcoSim BioToys applications

#9 Unread post by kate »

Tom, you need to check your DSTART and the time in your initialization file. You can change DSTART to match whatever time is in the file, so that NTIMES gives the number of steps to run. Or change NTIMES to run beyond your starting time, in this case 58561+1600. A third option is to change the time in the netcdf file.

twainwright

Re: Initialization for Fasham and EcoSim BioToys applications

#10 Unread post by twainwright »

Thanks Kate!

Your answer came just after I had spent a morning learning the ways of ROMS through gdb, where I had tracked down the problem to the call to "get_state" in initial.F. Your response clarifies the problem.

It turns out there's a slight inconsistency between Bronwyn's files for the Fasham model and the ROMS distribution. In the current distribution, ocean_bio_toy.in is set to use biotoy_ini_fasham.nc, and sets dstart=0. However, Bronwyn's biotoy_ini_fasham.nc has ocean_time=366. When I edited ocean_bio_toy.in to use ecosim initializations (where ocean_time=0), the model runs.

twainwright

Re: Initialization for Fasham and EcoSim BioToys applications

#11 Unread post by twainwright »

Next question:
I've gotten the ecosim model to run in biotoy. How do I change to the Fasham model?? Here's what I tried:

1) Edited ocean_bio_toy.in to read bioFasham.in and biotoy_ini_fasham.nc (with ocean_time changed to 0).
2) Edited build.bash to export MY_CPP_FLAGS="-DBIO_FASHAM".
3) Rebuilt the model and started run.

It now gets past the previous start-time error, but now I get the "WRT_HIS - error while writing variable: Bac_F1" error reported by FengZhou. (I don't see a resolution for that problem posted--did I miss something?)

Looking through the log file, I see in the list of CPP flags that ECOSIM is defined, not BIO_FASHAM. (I checked the build log, and -DBIO_FASHAM was definitely in the compile commands.) So, the undefined Bac_F1 is probably because I'm running ECOSIM code with BIO_FASHAM input files. But why is it running with ECOSIM defined? Looking at ROMS/Include/biotoy.h, I fined hardcoded:

Code: Select all

    #undef BIO_FASHAM
...
    #define ECOSIM
I don't understand why these would be hardcoded, especially as they are followed immediately by #ifdef's for these flags. It looks like I need to modify biotoy.h to get this to work. I'm running my tests in a project directory outside the ROMS file hierarchy. Can someone tell me where to put my modified biotoy.h so it will override the one in ROMS/Include? Or, is there another way around this?

Thanks in advance for your help!

--Tom

bronwyn
Posts: 26
Joined: Sun Nov 27, 2005 10:54 pm
Location: Free University Berlin

Re: Initialization for Fasham and EcoSim BioToys applications

#12 Unread post by bronwyn »

Hi Tom,

Yes, you are right about the inconsistency in the fasham initial conditions ocean_time and dstart in the ocean_biotoy.in file. I'll post a new fasham initial condition file with ocean_time set to 0.

As for the second question, you need to define BIO_FASHAM and undef ECOSIM in biotoys.h to run fasham but not in the ROMS/Include directory. The idea is to work with a project directory (typically it's User/...) with header (User/Include), analytical (User/Functionals) and application (User/External) sub-directories. It means that if you are working on multiple projects / applications at the same time, it makes it easier to manage changes. So, don't change what's hardcoded under ROMS/Include but copy biotoy.h from there to User/Include, modify the definitions there for your purpose, and then tell your build script where to find your project directory, header directory, etc ... In the end, where you put all these project files and how you manage them is a matter of personal preference, you just need to make sure you have put the correct path in the build script.

Hope that's helpful!
Bronwyn

twainwright

Re: Initialization for Fasham and EcoSim BioToys applications

#13 Unread post by twainwright »

Bronwyn,

Thanks for the help. Now I know where to put modified files.

Actually, that shouldn't be necessary here. I did a little test, and if those two lines ("#undef BIO_FASHAM" and "#define ECOSIM") are dropped from bio_toy.h, then the biological model can be selected in the build script and ocean*.in file, without any need to edit bio_toy.h each time. The project I'm working on is comparing different biological model versions, so the fewer the edits needed to switch, the better. Here's the diff between my modified bio_toy.h and the original:

$ diff Include/bio_toy.h ../../ROMS/ROMS/Include/bio_toy.h
2c2
< ** svn $Id: bio_toy.h 139 2008-01-10 00:17:29Z arango $ Local Modification -TW
---
> ** svn $Id: bio_toy.h 139 2008-01-10 00:17:29Z arango $
41a42
> #undef BIO_FASHAM
47a49
> #define ECOSIM

Thanks again!
--Tom

alazhar
Posts: 18
Joined: Wed Dec 03, 2008 2:06 pm
Location: PML

Re: Initialization for Fasham and EcoSim BioToys applications

#14 Unread post by alazhar »

Dear all,

I try to run bio_toy test case using this setup:
ocean_bio_toy.in:

Code: Select all

GRDNAME == /home/am/ROMS/trunk/Data/ROMS/Grid/biotoy_grd.nc
! ININAME == /home/am/ROMS/trunk/Data/ROMS/Initial/biotoy_ini_fasham.nc
ININAME == /home/am/ROMS/trunk/Data/ROMS/Initial/biotoy_ini_ecosim.nc
FRCNAME == /home/am/ROMS/trunk/Data/ROMS/Forcing/biotoy_frc.nc
BPARNAM =  ROMS/External/ecosim.in
bio_toy.h:

Code: Select all

#undef BIO_FASHAM
#define ECOSIM
but then, it resulting an error when I run it:::

Code: Select all

NLM: GET_STATE - Read state initial conditions,             t =     0 00:00:00
                   (File: biotoy_ini_ecosim.nc, Rec=0001, Index=1)
                - free-surface
                   (Min =  0.00000000E+00 Max =  0.00000000E+00)
                - vertically integrated u-momentum component
                   (Min =  0.00000000E+00 Max =  0.00000000E+00)
                - Fortran runtime error: Array reference out of bounds for array 'tval', lower bound of dimension 1 exceeded (in file 'get_cycle.f90', at line 151)
vertically integrated v-momentum component
                   (Min =  0.00000000E+00 Max =  0.00000000E+00)
                - u-momentum component
                   (Min =  0.00000000E+00 Max =  0.00000000E+00)
                - v-momentum component
                   (Min =  0.00000000E+00 Max =  0.00000000E+00)
                - potential temperature
                   (Min =  7.19653463E+00 Max =  2.20842991E+01)
                - salinity
                   (Min =  3.42398605E+01 Max =  3.52679787E+01)
Please help me how to solve this error. I really appreciate comments, directions, and/or clues regarding this error. Thank you in advance to you all.
(system: redhat, Revision: 297, compiler: gfortran)

Al

bronwyn
Posts: 26
Joined: Sun Nov 27, 2005 10:54 pm
Location: Free University Berlin

Re: Initialization for Fasham and EcoSim BioToys applications

#15 Unread post by bronwyn »

Look at this topic, your problem looks like it is related.

viewtopic.php?t=1192

I think you may need to update your code ...

alazhar
Posts: 18
Joined: Wed Dec 03, 2008 2:06 pm
Location: PML

Re: Initialization for Fasham and EcoSim BioToys applications

#16 Unread post by alazhar »

Thank you very much, bronwyn !
I manage to run it after updated the code :D

Al

Post Reply