adding a new variable to hypoxia_srm

Discussion about coupled ecosystem models

Moderators: arango, robertson

Post Reply
Message
Author
fagundesmo
Posts: 51
Joined: Wed Dec 03, 2014 1:46 am
Location: University of Georgia

adding a new variable to hypoxia_srm

#1 Unread post by fagundesmo »

Hi everyone,

I am working on adding some processes into biofennel, in order to do that I wanted to practice in something simple like hypoxia_srm. The hypoxia_srm requires 3 names respiration, idResR, ResRate.

The respiration is in ana_respiration.h, get_data.F, hypoxia_srm.h, set_data.F, varinfo.dat, mod_ocean.F
The idResR is in hypoxia_srm_mod.h, hypoxia_srm_var.h, set_data.F, and varinfo.dat
The ResRate in the following files: ana_respiration.h, hypoxia_srw_wrt.h, hypoxia_srm_mod.h, hypoxia_srm.in, hypoxia_srm_inp.h, and hypoxia_srm_def.h


Let's say I wanted to add a variable called kProduction, idProd, ProRate to those respective files. ROMS compiles that no problem but then when I try to run it I get the following:

NLM: GET_STATE - Reading state initial conditions, 2015-05-01 00:00:00.00
(Grid 01, t = 5599.0000, File: ini_newHypoxia.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)
- 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 = 1.50000000E+01 Max = 1.50000000E+01)
- salinity
(Min = 3.40000000E+01 Max = 3.40000000E+01)
- dissolved oxygen concentration
(Min = 2.00000000E+02 Max = 2.00000000E+02)
- plant density
(Min = 9.00000000E-01 Max = 9.00000000E-01)
- plant height
(Min = 1.30000000E+01 Max = 1.30000000E+01)
- plant diameter
(Min = 3.00000000E-01 Max = 3.00000000E-01)
- plant thickness
(Min = 3.00000000E-01 Max = 3.00000000E-01)
GET_3DFLD - total respiration rate, 2015-05-01 00:00:00.00
(Grid=01, Rec=0000001, Index=1, File: prod_forcing.nc)
(Tmin= 5599.0000 Tmax= 5690.0000) t = 5599.0000
(Min = 7.62675007E-01 Max = 7.92000000E+02)

INQUIRY - unable to find requested variable:
in file:

/home/mf99274/COAWST_sap2test/Projects/datasets/forcing/prod_forcing.nc
Found Error: 02 Line: 404 Source: ROMS/Utility/inquiry.F
Found Error: 02 Line: 130 Source: ROMS/Utility/get_3dfld.F
Found Error: 02 Line: 1006 Source: ROMS/Nonlinear/get_data.F
Found Error: 02 Line: 856 Source: ROMS/Nonlinear/initial.F
Found Error: 02 Line: 200 Source: ROMS/Drivers/nl_ocean.h
...
ROMS/TOMS - Input error ............. exit_flag: 2


ERROR: Abnormal termination: NetCDF INPUT.
REASON: No error

The first thing I notice is that INQUIRY does not show the variable kProduction as a variable not found. My question is: Is there any other thing that I should have done? For example, adding +1 somewhere because of this variable addition such as in hypoxia_srm_mod.h? I have checked lowercase and uppercases for the new variable so it matches everywhere. I also literally copied the same thing as it has been done for the respiration variable.

Any help is welcome!!

Best,
Matheus

User avatar
wilkin
Posts: 922
Joined: Mon Apr 28, 2003 5:44 pm
Location: Rutgers University
Contact:

Re: adding a new variable to hypoxia_srm

#2 Unread post by wilkin »

Often, compiling with debug option leads to more informative error messages. Try that first.
John Wilkin: DMCS Rutgers University
71 Dudley Rd, New Brunswick, NJ 08901-8521, USA. ph: 609-630-0559 jwilkin@rutgers.edu

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

Re: adding a new variable to hypoxia_srm

#3 Unread post by arango »

Perhaps, you didn't add the appropriate metadata and logic for the new variables. Nowadays, our version of ROMS uses varinfo.yaml instead of varinfo.dat. I don't know if that change was incorporated into COAWST or the version you are using. But it may explain the issues that you are having.

User avatar
wilkin
Posts: 922
Joined: Mon Apr 28, 2003 5:44 pm
Location: Rutgers University
Contact:

Re: adding a new variable to hypoxia_srm

#4 Unread post by wilkin »

Found Error: 02 Line: 1006 Source: ROMS/Nonlinear/get_data.F
Look at line 1006 in your get_data and see what variable it is trying to read.

In mine (not COAWST) it's reading boundary conditions so yours must be quite different. Presumably, it's related to your modified setup.
John Wilkin: DMCS Rutgers University
71 Dudley Rd, New Brunswick, NJ 08901-8521, USA. ph: 609-630-0559 jwilkin@rutgers.edu

fagundesmo
Posts: 51
Joined: Wed Dec 03, 2014 1:46 am
Location: University of Georgia

Re: adding a new variable to hypoxia_srm

#5 Unread post by fagundesmo »

Hi everyone,

Thank you!! I realized my mistake after you mentioned that it was related to metadata and get_data.F.

Best,
Matheus

Post Reply