Biological Tracer from River

Discussion about coupled ecosystem models

Moderators: arango, robertson

Post Reply
Message
Author
subin0531
Posts: 2
Joined: Tue Nov 28, 2017 5:40 pm
Location: Jeju National University

Biological Tracer from River

#1 Unread post by subin0531 »

Hi, I have one question about the tracer from the river.
I set the model considering river transport with the FENNEL biological system.
If I set the LtracerSrc (in the bio_Fennel.in file) as 'F' for TIC or alkalinity, fresh water shows the low value of TIC or alkalinity
I wonder which value for TIC or alkalinity comes with river runoff.
And, where can I check the value from the river?

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

Re: Biological Tracer from River

#2 Unread post by wilkin »

If you want to set the concentration of biology tracers in the rivers, i.e. use LtracerSrc = T for some variables, then those concentrations are determined by:

Default is to read the file specified by SSFNAME in roms .in

Code: Select all

! Input Sources/Sinks forcing (like river runoff) file name.

     SSFNAME == roms_rivers.nc
The variables names should be e.g. river_NO3 etc. appending the Fennel variable name to river_. There is a template for the file in Data/ROMS/CDL/frc_rivers.cdl . Create the biology variables in the same format as temp and salt.

Alternatively, you can #define ANA_PSOURCE and set the source details in Functionals/ana_psource.h. Be very careful about getting Isrc, Jsrc, Dsrc etc. correct (remember ROMS tracer index i,j counts from 0, not 1). Deep in ana_psource.h you will where all point source tracers are initially set to zero, then updated for individual cases. You need to refer to the correct biology tracer index for each variable

Code: Select all

!-----------------------------------------------------------------------
!  Set tracers point Sources and/or Sinks.
!-----------------------------------------------------------------------
!
      TRACERS : IF (ANY(LtracerSrc(:,ng))) THEN
        SOURCES(ng)%Tsrc=0.0_r8                      ! initialize
!
!  Set-up tracer (tracer units) point Sources/Sinks.
John Wilkin: DMCS Rutgers University
71 Dudley Rd, New Brunswick, NJ 08901-8521, USA. ph: 609-630-0559 jwilkin@rutgers.edu

pmaccc
Posts: 74
Joined: Wed Oct 22, 2003 6:59 pm
Location: U. Wash., USA

Re: Biological Tracer from River

#3 Unread post by pmaccc »

Related to this, I found I had to make some edits to varinfo.yaml in order to get it to work with the fennel.h code. Specifically here is the diff between my edited version and the original version:

Code: Select all

(loenv) MacBook-Pro-6:varinfo pm8$ diff varinfo.yaml ORIG_varinfo.yaml 
44c44
< #svn_repository: $URL: https://www.myroms.org/svn/src/trunk/ROMS/External/varinfo.yaml $
---
> svn_repository: $URL: https://www.myroms.org/svn/src/trunk/ROMS/External/varinfo.yaml $
1947,1980c1947
<     
<   - variable:       river_Phyt                                        # Input
<     standard_name:  mole_concentration_of_phytoplankton_transport_expressed_as_nitrogen_into_sea_water_from_rivers
<     long_name:      river runoff phytoplankton
<     units:          millimole_nitrogen meter-3                       # [millimole/m3]
<     field:          river Phyt
<     time:           river_time
<     index_code:     idRtrc(iPhyt)
<     type:           nulvar
<     add_offset:     0.0d0
<     scale:          1.0d0
<         
<   - variable:       river_Zoop                                        # Input
<     standard_name:  mole_concentration_of_zooplankton_transport_expressed_as_nitrogen_into_sea_water_from_rivers
<     long_name:      river runoff zooplankton
<     units:          millimole_nitrogen meter-3                       # [millimole/m3]
<     field:          river Zoop
<     time:           river_time
<     index_code:     idRtrc(iZoop)
<     type:           nulvar
<     add_offset:     0.0d0
<     scale:          1.0d0
<     
<   - variable:       river_Chlo                                        # Input
<     standard_name:  mole_concentration_of_chlorophyll_transport_into_sea_water_from_rivers
<     long_name:      river runoff chlorophyll
<     units:          milligrams_chlorophyll meter-3                   # [milligrams/m3]
<     field:          river Chlo
<     time:           river_time
<     index_code:     idRtrc(iChlo)
<     type:           nulvar
<     add_offset:     0.0d0
<     scale:          1.0d0
<     
---
> 
2102c2069
<   - variable:       river_TAlk                                 # Input
---
>   - variable:       river_alkalinity                                 # Input
6964c6931
<     long_name:      4D-Var increment, analysis minus background, dx_a = H(x_a) - H(x_b)
---
>     long_name:      4D-Var increment: analysis minus background, dx_a = H(x_a) - H(x_b)
6975c6942
<     long_name:      4D-Var innovation, observation minus background, d_b = y - H(x_b)
---
>     long_name:      4D-Var innovation: observation minus background, d_b = y - H(x_b)
7008c6975
<     long_name:      4D-Var residual, observation minus analysis, d_a = y - H(x_b + dx_a)
---
>     long_name:      4D-Var residual: observation minus analysis, d_a = y - H(x_b + dx_a)
Some of these edits were adding variables like river_Phyt. The other changes I had to make were replacing extra ":" in lines because this confused the python yaml parser I am using. Here is the function I use for that, for reference:

Code: Select all

def make_varinfo_list():
    """
    This method pre-parses varinfo.yaml into a list for faster use by get_varinfo()
    
    Configured to use the new ROMS varinfo.yaml (1/2022), but you need a few edits
    so we use our modified version in LO_roms_source/npzd_banas.
    """
    import yaml
        
    # specify which varinfo.yaml to use
    Ldir = Lfun.Lstart()
    fn = Ldir['parent'] / 'LO_roms_source_alt' / 'varinfo' / 'varinfo.yaml'
    
    # parse into a list of dicts
    with open(fn,'r') as f:
        yaml_dict = yaml.safe_load(f)
    short_list = yaml_dict['metadata'] # a list of dicts, one per item
    
    # remove some things from the list
    short_list = [item for item in short_list if 'adjoint' not in item['field']]
    short_list = [item for item in short_list if 'tangent' not in item['field']]
    short_list = [item for item in short_list if 'functional' not in item['field']]
    
    out_dir = Ldir['data'] / 'varinfo'
    Lfun.make_dir(out_dir)
    out_fn = out_dir / 'varinfo_list.p'
    pickle.dump(short_list, open(out_fn, 'wb'))
Cheers,

Parker

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

Re: Biological Tracer from River

#4 Unread post by kate »

For river tracers, you have to provide values for all of them. Otherwise your run will be unstable, maybe not today or tomorrow, but someday. It's tricky to find good values to use, but you have to use *something*.

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

Re: Biological Tracer from River

#5 Unread post by wilkin »

In my experience LtracerSrc = F is quite stable when used with Dsrc = 2, i.e. the updated LwSrc cell-centered divergence method for sources.
John Wilkin: DMCS Rutgers University
71 Dudley Rd, New Brunswick, NJ 08901-8521, USA. ph: 609-630-0559 jwilkin@rutgers.edu

jschoi
Posts: 11
Joined: Wed Apr 12, 2017 6:20 pm
Location: Chonnam National Univ.

Re: Biological Tracer from River

#6 Unread post by jschoi »

We all know, the getting biochemial dataset is very difficult, especially for smal rivers.
Perhaps the questioner does not want to use river data of high uncertainty.

I guess that questioner want to apply only physical variable such as transport and temperature in river except for biochemical variable by LtracerSrc == F in bio_fennel.in

However, as wilkin showed, LtracerSrc == F induces that Tsrc become the zero by ana_psource.h. is right that I understand?

additionaly, in ocean.in, if LtracerSrc == F for temperature and salinity, these two tracers were applied the zero by ana_psource.h?

subin0531
Posts: 2
Joined: Tue Nov 28, 2017 5:40 pm
Location: Jeju National University

Re: Biological Tracer from River

#7 Unread post by subin0531 »

jschoi wrote: Thu Apr 20, 2023 7:10 am We all know, the getting biochemial dataset is very difficult, especially for smal rivers.
Perhaps the questioner does not want to use river data of high uncertainty.

I guess that questioner want to apply only physical variable such as transport and temperature in river except for biochemical variable by LtracerSrc == F in bio_fennel.in

However, as wilkin showed, LtracerSrc == F induces that Tsrc become the zero by ana_psource.h. is right that I understand?

additionaly, in ocean.in, if LtracerSrc == F for temperature and salinity, these two tracers were applied the zero by ana_psource.h?
Thank you for all answers!
as jschoi said, I wanted to set river transport with temperature and salinity except for all biological variables.
Because I didn't defined ana_psource.h, the carbon related value from the river goes wrong (I think).
and I found the way to solve my problems!
thank you all, again!

Post Reply