River biology

Report or discuss software problems and other woes

Moderators: arango, robertson

Post Reply
Message
Author
dbergondo
Posts: 5
Joined: Mon May 05, 2003 6:34 pm
Location: URI - GSO

River biology

#1 Unread post by dbergondo »

In ROMS 2.1 I added a river nitrate source (based on sediment-laden river plume discussion). In ROMS 2.2 I've defined RIVER_BIOLOGY and added NO3 and NH4 to my netcdf river input file. However, when I run ROMS I get the following error:

GET_NGFLD - unable to find requested variable:
in input NetCDF file: frc_bulk30.nc

ROMS/TOMS - Input error ............. exit_flag: 2

but no indication of what variable is missing. Any suggestions would be appreciated.
Thanks,
Deanna

dobbins

River Biology

#2 Unread post by dobbins »

Hi;

You didn't say whether you added these variables to varinfo.dat. If infomation on those fields is missing from that file, that would explain why no variable name is listed in the error message.

User avatar
hetland
Posts: 81
Joined: Thu Jul 03, 2003 3:39 pm
Location: TAMU,USA

#3 Unread post by hetland »

You also need to make sure that you specify *all* of the other tracer variables in your river inflow values. Like, if you are running an NPZD model, you need to specify phytoplankton (et al.) as well.

There may be a way to make ROMS default to a zero tracer value, but this is not the way it is set up in ROMS 2.1.

lluiscal

Problems with RIVER_BIOLOGY

#4 Unread post by lluiscal »

I'm having a similar problem. With roms 3.0 I added NO3, NH4 and oxygen to my forcing file. With these biological flags defined:

#define BIO_FASHAM
#if defined BIO_FASHAM

# define ANA_SPFLUX
# define ANA_BPFLUX
# define OXYGEN
# undef DENITRIFICATION
# define UV_PSOURCE
# define TS_PSOURCE
# define RIVER_BIOLOGY

# undef CARBON
# undef BIO_SEDIMENT
# undef DIAGNOSTICS_BIO

After reading the two previous responses, i've added also, all river variables I've found at varinfo.dat to my forcing file. No errors at compilation, when I run the model, I get this problem:

GET_NGFLD - river runoff XI-positions at RHO-points
(Min = 1.00000000E+00 Max = 1.00000000E+00)
GET_NGFLD - river runoff ETA-positions at RHO-points
(Min = 8.70000000E+01 Max = 8.70000000E+01)
GET_NGFLD - river runoff direction
(Min = 0.00000000E+00 Max = 0.00000000E+00)
GET_NGFLD - river runoff mass transport vertical profile
(Min = 0.00000000E+00 Max = 8.00000000E-02)
GET_NGFLD - river runoff flag
(Min = 5.00000000E+00 Max = 5.00000000E+00)
GET_NGFLD - river runoff mass transport, t = 0.0000
(File: forcing16a31juliol_river.nc, Rec=0001, Index=1)
(Tmin= 0.0000 Tmax= 15.9583)
(Min = 1.99074074E+01 Max = 1.99074074E+01)
GET_NGFLD - river runoff potential temperature, t = 0.0000
(File: forcing16a31juliol_river.nc, Rec=0001, Index=1)
(Tmin= 0.0000 Tmax= 15.9583)
(Min = 2.20666700E+01 Max = 2.20666700E+01)
GET_NGFLD - river runoff salinity, t = 0.0000
(File: forcing16a31juliol_river.nc, Rec=0001, Index=1)
(Tmin= 0.0000 Tmax= 15.9583)
(Min = 0.00000000E+00 Max = 0.00000000E+00)
GET_NGFLD - river runoff NO3, t = 0.0000
(File: forcing16a31juliol_river.nc, Rec=0001, Index=1)
(Tmin= 0.0000 Tmax= 15.9583)
(Min = 0.00000000E+00 Max = 0.00000000E+00)
GET_NGFLD - river runoff NH4, t = 0.0000
(File: forcing16a31juliol_river.nc, Rec=0001, Index=1)
(Tmin= 0.0000 Tmax= 15.9583)
(Min = 0.00000000E+00 Max = 5.33333333E-01)

GET_NGFLD - unable to find requested variable:
in input NetCDF file: /home/Lluis/ROMS.d/forcing16a31juliol_river.nc

ROMS/TOMS - Input error ............. exit_flag: 2


Elapsed CPU time (seconds):

Thread # 0 CPU: 2.104
Total: 2.104

Nonlinear model elapsed time profile:

Reading of input data ............................ 0.005 ( 0.2377 %)
2D/3D coupling, vertical metrics ................. 0.047 ( 2.2338 %)
Omega vertical velocity .......................... 0.043 ( 2.0437 %)
Equation of state for seawater ................... 0.097 ( 4.6103 %)
Total: 0.192 9.1255

All percentages are with respect to total time = 2.104

ROMS/TOMS - Output NetCDF summary for Grid 01:

Analytical header files used:

ROMS/Functionals/ana_hmixcoef.h

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


If i “undefine” the flag “RIVER_BIOLOGY” the model runs with no problem.

Any idea what could be the problem?

Thanks in advance

Lluís Calderer.

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

#5 Unread post by wilkin »

You added NO3, NH4 and oxygen to your forcing file but what do you expect ROMS to do to set the other biology variables in the river? See Rob Hetland's post of 25 Jul 2005 09:53 to this thread. I think you need to specify *all* variables in the river.

You can create a simple minded set of values for biology state variables (like a constant or a fixed factor applied to some other variables in the forcing file) using the "A nifty varinfo.dat trick" approach I describe in this posting: viewtopic.php?t=191

John.
John Wilkin: DMCS Rutgers University
71 Dudley Rd, New Brunswick, NJ 08901-8521, USA. ph: 609-630-0559 jwilkin@rutgers.edu

lluiscal

Problems with RIVER_BIOLOGY

#6 Unread post by lluiscal »

Hi John, thanks for the quick responding
I did what Rob Hetland posted, I took all river variables of varinfo.dat and made a forcing file with all variables. Here a ncdump of the file (it includes meteorological variables as well):

%% Dimensions:

nc('xi_rho') = 150;
nc('xi_u') = 149;
nc('xi_v') = 150;
nc('eta_rho') = 100;
nc('eta_u') = 100;
nc('eta_v') = 99;
nc('s_rho') = 25;
nc('s_w') = 26;
nc('wind_time') = 768;
nc('srf_time') = 768;
nc('tair_time') = 768;
nc('pair_time') = 768;
nc('qair_time') = 768;
nc('river_time') = 384;
nc('river') = 1;

%% Variables and attributes:

nc{'theta_b'} = ncdouble; %% 1 element.
nc{'theta_b'}.long_name = ncchar('S-coordinate bottom control parameter');
nc{'theta_b'}.units = ncchar('1');

nc{'theta_s'} = ncdouble; %% 1 element.
nc{'theta_s'}.long_name = ncchar('S-coordinate surface control parameter');
nc{'theta_s'}.units = ncchar('1');

nc{'Tcline'} = ncdouble; %% 1 element.
nc{'Tcline'}.long_name = ncchar('S-coordinate surface/bottom layer width');
nc{'Tcline'}.units = ncchar('meter');

nc{'hc'} = ncdouble; %% 1 element.
nc{'hc'}.long_name = ncchar('S-coordinate parameter, critical depth');
nc{'hc'}.units = ncchar('meter');

nc{'Cs_r'} = ncdouble('s_rho'); %% 25 elements.
nc{'Cs_r'}.long_name = ncchar('S-coordinate stretching curves at RHO-points');
nc{'Cs_r'}.units = ncchar('1');
nc{'Cs_r'}.valid_min = ncdouble(-1);
nc{'Cs_r'}.valid_max = ncdouble(0);
nc{'Cs_r'}.field = ncchar('Cs_r, scalar');

nc{'Cs_w'} = ncdouble('s_w'); %% 26 elements.
nc{'Cs_w'}.long_name = ncchar('S-coordinate stretching curves at W-points');
nc{'Cs_w'}.units = ncchar('1');
nc{'Cs_w'}.valid_min = ncdouble(-1);
nc{'Cs_w'}.valid_max = ncdouble(0);
nc{'Cs_w'}.field = ncchar('Cs_w, scalar');

nc{'sc_r'} = ncdouble('s_rho'); %% 25 elements.
nc{'sc_r'}.long_name = ncchar('S-coordinate at RHO-points');
nc{'sc_r'}.units = ncchar('1');
nc{'sc_r'}.valid_min = ncdouble(-1);
nc{'sc_r'}.valid_max = ncdouble(0);
nc{'sc_r'}.field = ncchar('sc_r, scalar');

nc{'sc_w'} = ncdouble('s_w'); %% 26 elements.
nc{'sc_w'}.long_name = ncchar('S-coordinate at W-points');
nc{'sc_w'}.units = ncchar('1');
nc{'sc_w'}.valid_min = ncdouble(-1);
nc{'sc_w'}.valid_max = ncdouble(0);
nc{'sc_w'}.field = ncchar('sc_w, scalar');

nc{'wind_time'} = ncdouble('wind_time'); %% 768 elements.
nc{'wind_time'}.long_name = ncchar('wind time');
nc{'wind_time'}.units = ncchar('day');
nc{'wind_time'}.field = ncchar('wind_time, scalar, series');

nc{'srf_time'} = ncdouble('srf_time'); %% 768 elements.
nc{'srf_time'}.long_name = ncchar('solar shortwave radiation time');
nc{'srf_time'}.units = ncchar('day');
nc{'srf_time'}.field = ncchar('srf_time, scalar, series');

nc{'tair_time'} = ncdouble('tair_time'); %% 768 elements.
nc{'tair_time'}.long_name = ncchar('Air temperature time');
nc{'tair_time'}.units = ncchar('day');
nc{'tair_time'}.field = ncchar('tair_time, scalar, series');

nc{'pair_time'} = ncdouble('pair_time'); %% 768 elements.
nc{'pair_time'}.long_name = ncchar('Air presure time');
nc{'pair_time'}.units = ncchar('day');
nc{'pair_time'}.field = ncchar('pair_time, scalar, series');

nc{'qair_time'} = ncdouble('qair_time'); %% 768 elements.
nc{'qair_time'}.long_name = ncchar('Air humidity time');
nc{'qair_time'}.units = ncchar('day');
nc{'qair_time'}.field = ncchar('qair_time, scalar, series');

nc{'river_time'} = ncdouble('river_time'); %% 384 elements.
nc{'river_time'}.long_name = ncchar('river_time');
nc{'river_time'}.units = ncchar('days');
nc{'river_time'}.field = ncchar('river_time, scalar, series');

nc{'river'} = ncdouble('river'); %% 1 element.
nc{'river'}.long_name = ncchar('river_runoff identification number');
nc{'river'}.units = ncchar('nondimensional');
nc{'river'}.field = ncchar('num_rivers, scalar');

nc{'river_Xposition'} = ncdouble('river'); %% 1 element.
nc{'river_Xposition'}.long_name = ncchar('river runoff XI-positions at RHO-points');
nc{'river_Xposition'}.units = ncchar('scalar');
nc{'river_Xposition'}.field = ncchar('river runoff XI position, scalar, series');

nc{'river_Eposition'} = ncdouble('river'); %% 1 element.
nc{'river_Eposition'}.long_name = ncchar('river runoff ETA-positions at RHO-points');
nc{'river_Eposition'}.units = ncchar('scalar');
nc{'river_Eposition'}.field = ncchar('river runoff ETA position, scalar, series');

nc{'river_direction'} = ncdouble('river'); %% 1 element.
nc{'river_direction'}.long_name = ncchar('river runoff direction, XI=0, ETA>0');
nc{'river_direction'}.units = ncchar('scalar');
nc{'river_direction'}.field = ncchar('river runoff direction, scalar, series');

nc{'river_Vshape'} = ncdouble('s_rho', 'river'); %% 25 elements.
nc{'river_Vshape'}.long_name = ncchar('river runoff mass transport vertical profile');
nc{'river_Vshape'}.units = ncchar('scalar');
nc{'river_Vshape'}.field = ncchar('river runoff vertical profile, scalar, series');

nc{'Uwind'} = ncfloat('wind_time', 'eta_rho', 'xi_rho'); %% 11520000 elements.
nc{'Uwind'}.long_name = ncchar('surface u-wind component');
nc{'Uwind'}.units = ncchar('meter second-1');
nc{'Uwind'}.field = ncchar('u-wind, scalar, series');
nc{'Uwind'}.time = ncchar('wind_time');
nc{'Uwind'}.coordinates = ncchar('xi_rho eta_rho');

nc{'Vwind'} = ncfloat('wind_time', 'eta_rho', 'xi_rho'); %% 11520000 elements.
nc{'Vwind'}.long_name = ncchar('surface v-wind component');
nc{'Vwind'}.units = ncchar('meter second-1');
nc{'Vwind'}.field = ncchar('v-wind, scalar, series');
nc{'Vwind'}.time = ncchar('wind_time');
nc{'Vwind'}.coordinates = ncchar('xi_rho eta_rho');

nc{'swrad'} = ncfloat('srf_time', 'eta_rho', 'xi_rho'); %% 11520000 elements.
nc{'swrad'}.long_name = ncchar('solar shortwave radiation flux');
nc{'swrad'}.units = ncchar('Watts meter-2');
nc{'swrad'}.negative = ncchar('downward flux, heating');
nc{'swrad'}.positive = ncchar('upward flux, cooling');
nc{'swrad'}.field = ncchar('shortwave radiation, scalar, series');
nc{'swrad'}.time = ncchar('srf_time');
nc{'swrad'}.coordinates = ncchar('xi_rho eta_rho');

nc{'Qair'} = ncfloat('qair_time', 'eta_rho', 'xi_rho'); %% 11520000 elements.
nc{'Qair'}.long_name = ncchar('surface air relative humidity');
nc{'Qair'}.units = ncchar('percentage');
nc{'Qair'}.field = ncchar('Qair, scalar, series');
nc{'Qair'}.time = ncchar('qair_time');
nc{'Qair'}.coordinates = ncchar('xi_rho eta_rho');

nc{'Pair'} = ncfloat('pair_time', 'eta_rho', 'xi_rho'); %% 11520000 elements.
nc{'Pair'}.long_name = ncchar('surface air pressure');
nc{'Pair'}.units = ncchar('millibar');
nc{'Pair'}.field = ncchar('Pair, scalar, series');
nc{'Pair'}.time = ncchar('pair_time');
nc{'Pair'}.coordinates = ncchar('xi_rho eta_rho');

nc{'Tair'} = ncfloat('tair_time', 'eta_rho', 'xi_rho'); %% 11520000 elements.
nc{'Tair'}.long_name = ncchar('surface air temperature');
nc{'Tair'}.units = ncchar('Celsius');
nc{'Tair'}.field = ncchar('Tair, scalar, series');
nc{'Tair'}.time = ncchar('tair_time');
nc{'Tair'}.coordinates = ncchar('xi_rho eta_rho');

nc{'river_transport'} = ncdouble('river_time', 'river'); %% 384 elements.
nc{'river_transport'}.long_name = ncchar('river runoff mass transport');
nc{'river_transport'}.units = ncchar('meter^3/s');
nc{'river_transport'}.field = ncchar('river runoff mass transport, scalar, series');

nc{'river_flag'} = ncdouble('river'); %% 1 element.
nc{'river_flag'}.long_name = ncchar('river flag, 1=temp, 2=salt, 3=temp+salt, 4=temp+salt+sed, 5=temp+salt+sed+bio');
nc{'river_flag'}.units = ncchar('nondimensional');
nc{'river_flag'}.field = ncchar('river flag, scalar, series');

nc{'river_temp'} = ncdouble('river_time', 's_rho', 'river'); %% 9600 elements.
nc{'river_temp'}.long_name = ncchar('river runoff potential temperature');
nc{'river_temp'}.units = ncchar('Celsius');
nc{'river_temp'}.field = ncchar('river temperature, scalar, series');

nc{'river_salt'} = ncdouble('river_time', 's_rho', 'river'); %% 9600 elements.
nc{'river_salt'}.long_name = ncchar('river runoff salinity');
nc{'river_salt'}.units = ncchar('PSU');
nc{'river_salt'}.field = ncchar('river salinity, scalar, series');

nc{'river_mud_'} = ncdouble('river_time', 's_rho', 'river'); %% 9600 elements.
nc{'river_mud_'}.long_name = ncchar('river runoff suspended sediment concentration');
nc{'river_mud_'}.units = ncchar('kilogram meter-3');
nc{'river_mud_'}.field = ncchar('river_sediment, scalar, series');

nc{'river_sand_'} = ncdouble('river_time', 's_rho', 'river'); %% 9600 elements.
nc{'river_sand_'}.long_name = ncchar('river runoff suspended sediment concentration');
nc{'river_sand_'}.units = ncchar('kilogram meter-3');
nc{'river_sand_'}.field = ncchar('river_sediment, scalar, series');

nc{'river_nutrient'} = ncdouble('river_time', 's_rho', 'river'); %% 9600 elements.
nc{'river_nutrient'}.long_name = ncchar('river runoff nutrient');
nc{'river_nutrient'}.units = ncchar('millimole_nitrogen meter-3');
nc{'river_nutrient'}.field = ncchar('river_nutrient, scalar, series');

nc{'river_NO3'} = ncdouble('river_time', 's_rho', 'river'); %% 9600 elements.
nc{'river_NO3'}.long_name = ncchar('river runoff NO3');
nc{'river_NO3'}.units = ncchar('millimole_nitrogen meter-3');
nc{'river_NO3'}.field = ncchar('river_NO3, scalar, series');

nc{'river_NH4'} = ncdouble('river_time', 's_rho', 'river'); %% 9600 elements.
nc{'river_NH4'}.long_name = ncchar('river runoff NH4');
nc{'river_NH4'}.units = ncchar('millimole_nitrogen meter-3');
nc{'river_NH4'}.field = ncchar('river_NH4, scalar, series');

nc{'river_DON'} = ncdouble('river_time', 's_rho', 'river'); %% 9600 elements.
nc{'river_DON'}.long_name = ncchar('river runoff dissolved organic nitrogen');
nc{'river_DON'}.units = ncchar('millimole_nitrogen meter-3');
nc{'river_DON'}.field = ncchar('river_DON, scalar, series');

nc{'river_PON'} = ncdouble('river_time', 's_rho', 'river'); %% 9600 elements.
nc{'river_PON'}.long_name = ncchar('river runoff dissolved organic nitrogen');
nc{'river_PON'}.units = ncchar('millimole_nitrogen meter-3');
nc{'river_PON'}.field = ncchar('river_DON, scalar, series');

nc{'river_detritus'} = ncdouble('river_time', 's_rho', 'river'); %% 9600 elements.
nc{'river_detritus'}.long_name = ncchar('river runoff detritus');
nc{'river_detritus'}.units = ncchar('millimole_nitrogen meter-3');
nc{'river_detritus'}.field = ncchar('river_detritus, scalar, series');

nc{'river_SDeN'} = ncdouble('river_time', 's_rho', 'river'); %% 9600 elements.
nc{'river_SDeN'}.long_name = ncchar('river runoff SDeNs');
nc{'river_SDeN'}.units = ncchar('millimole_nitrogen meter-3');
nc{'river_SDeN'}.field = ncchar('river_SDeN, scalar, series');

nc{'river_SDeC'} = ncdouble('river_time', 's_rho', 'river'); %% 9600 elements.
nc{'river_SDeC'}.long_name = ncchar('river runoff SDeC');
nc{'river_SDeC'}.units = ncchar('millimole meter-3');
nc{'river_SDeC'}.field = ncchar('river_SDeC, scalar, series');

nc{'river_TIC'} = ncdouble('river_time', 's_rho', 'river'); %% 9600 elements.
nc{'river_TIC'}.long_name = ncchar('river runoff TIC');
nc{'river_TIC'}.units = ncchar('millimole_carbon meter-3');
nc{'river_TIC'}.field = ncchar('river_TIC, scalar, series');

nc{'river_alkalinity'} = ncdouble('river_time', 's_rho', 'river'); %% 9600 elements.
nc{'river_alkalinity'}.long_name = ncchar('river runoff alkalinity');
nc{'river_alkalinity'}.units = ncchar('milliequivalents meter-3');
nc{'river_alkalinity'}.field = ncchar('river_alkalinity, scalar, series');

nc{'river_Oxyg'} = ncdouble('river_time', 's_rho', 'river'); %% 9600 elements.
nc{'river_Oxyg'}.long_name = ncchar('river runoff oxygen');
nc{'river_Oxyg'}.units = ncchar('millimole_oxygen meter-3');
nc{'river_Oxyg'}.field = ncchar('river_Oxyg, scalar, series');

endef(nc)
close(nc)


All river variables except Transport, NH4, NO3, Oxygen, Temperature, salinity and alkalinity are equal to zero. I've tried to run the model, but the result was the same
I've also tried to do the varinfo.dat trick, creating a river_ones variable at the forcing file and modifying varinfo.dat. Still, i had the same problem.

Any suggestion, or something missing?

Thanks again for the help

Lluís.

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

#7 Unread post by wilkin »

The stdout you post has failed to report the name of the variable that ROMS is unable to read. In my experience, this missing info tends to be absent when running in parallel with MPI, but will be reported if you recompile in serial mode and re-run. Knowing which variable ROMS is having trouble with will help debug this.

Another thing to check is the time information associated with the data. Your ncdump output shows the time attribute is not set for the river variables, so ROMS will assume the default entry in varinfo.dat:

Code: Select all

Vinfo(5)      Associated time variable name.
described at https://www.myroms.org/wiki/index.php/varinfo.dat

Make sure this entry is the time variable in the river forcing netcdf file, or name it in a "time" attribute of each river variable.

Remember, you can have the river forcing in a separate file from all the other forcing (tides, meteorology...) and specify the list of forcing files in ocean.in.

John.
John Wilkin: DMCS Rutgers University
71 Dudley Rd, New Brunswick, NJ 08901-8521, USA. ph: 609-630-0559 jwilkin@rutgers.edu

lluiscal

River biology

#8 Unread post by lluiscal »

Found the problem.
In the file /ROMS/modules/mod_param.F, if BIO_FASHAM is defined, it asks for 4 river variables (the ones in bold) that are not defined at varinfo.dat. This was the reason why the model blew up after reading river NH4 concentration runoff.

#ifdef BIO_FASHAM
CASE ('idRtrc(iNO3_)')
idRtrc(iNO3_)=varid
CASE ('idRtrc(iNH4_)')
idRtrc(iNH4_)=varid
CASE ('idRtrc(iPhyt)')
idRtrc(iPhyt)=varid
CASE ('idRtrc(iZoop)')
idRtrc(iZoop)=varid
CASE ('idRtrc(iLDeN)')
idRtrc(iLDeN)=varid

CASE ('idRtrc(iSDeN)')
idRtrc(iSDeN)=varid
CASE ('idRtrc(iChlo)')
idRtrc(iChlo)=varid



I've just added these variables to varinfo.dat:

'river_chlorophyll' ! Input/Output

'river runoff chlorophyll concentration'

'milligrams_chlorophyll meter-3' ! [millimole/m3]

'river_chlorophyll, scalar, series'

'river_time'

'idRtrc(iChlo)'

'r3dvar'

1.0d0





'river_phytoplankton' ! Input/Output

'river runoff phytoplankton concentration'

'millimole_nitrogen meter-3' ! [millimole/m3]

'river_phytoplankton, scalar, series'

'river_time'

'idRtrc(iPhyt)'

'r3dvar'

1.0d0



'river_zooplankton' ! Input/Output

'river runoff zooplankton concentration'

'millimole_nitrogen meter-3' ! [millimole/m3]

'river_zooplankton, scalar, series'

'river_time'

'idRtrc(iZoop)'

'r3dvar'

1.0d0



'river_LDeN' ! Input

'river runoff LDeN'

'millimole_nitrogen meter-3' ! [millimole/m3]

'river_LDeN, scalar, series'

'river_time'

'idRtrc(iLDeN)'

'nulvar'

1.0d0

I've also added the variables to the forcing file, and now everything goes perfectly.
I guess that's it, but as a beginner, I don't know if this problem involve worse problems.

Lluis

Post Reply