Difference between revisions of "River Runoff"

From WikiROMS
Jump to navigationJump to search
Line 17: Line 17:
To provide this information analytically, you need to activate [[ANA_PSOURCE]] '''and''' set the following values in [[ana_psource.h]]:  
To provide this information analytically, you need to activate [[ANA_PSOURCE]] '''and''' set the following values in [[ana_psource.h]]:  


:<div class="box">[[Variables#Nsrc|Nsrc]]                    ! Number of sources.<br /><br />[[Variables#Dsrc|Dsrc]]([[Variables#Nsrc|Nsrc]])              ! direction. (0 for along xi-axis, 1 for eta-axis).<br /><br />[[Variables#Isrc|Isrc]]([[Variables#Nsrc|Nsrc]])              ! location of i index (u or v point)<br />[[Variables#Jsrc|Jsrc]]([[Variables#Nsrc|Nsrc]])              ! location of j index (u or v point)<br /><br />[[Variables#Lsrc|Lsrc]]([[Variables#Nsrc|Nsrc]],[[Variables#itemp|itemp]])       ! T or F if temp information will be provided. If not, then the model<br/>                          uses the value at the inflowing rho point.<br />[[Variables#Lsrc|Lsrc]]([[Variables#Nsrc|Nsrc]],[[Variables#isalt|isalt]])       ! T or F if salt information will be provided. If not, then the model<br />                          uses the value at the inflowing rho point.<br />[[Variables#Lsrc|Lsrc]]([[Variables#Nsrc|Nsrc]],[[Variables#ised|ised]])        ! T or F if sediment information will be provided. If not, then the<br />                          model uses the value at the inflowing rho point.<br /><br />[[Variables#Qshape|Qshape]]([[Variables#Nsrc|Nsrc]],[[Variables#N|N]])          ! vertical distribution of the flow.<br /><br />[[Variables#Qbar|Qbar]]([[Variables#Nsrc|Nsrc]])              ! depth-integrated mass flow.<br /><br />[[Variables#Tsrc|Tsrc]]([[Variables#Nsrc|Nsrc]],[[Variables#N|N]],[[Variables#itemp|itemp]])      ! actual vertical distribution of the temperature values.<br />[[Variables#Tsrc|Tsrc]]([[Variables#Nsrc|Nsrc]],[[Variables#N|N]],[[Variables#isalt|isalt]])      ! actual vertical distribution of the salinity values.<br />[[Variables#Tsrc|Tsrc]]([[Variables#Nsrc|Nsrc]],[[Variables#N|N]],[[Variables#ised|ised]])      ! actual vertical distribution of the sediment values.</div>
:<div class="box">[[Variables#Nsrc|Nsrc]]                    ! Number of sources.<br /><br />[[Variables#Dsrc|Dsrc]]([[Variables#Nsrc|Nsrc]])              ! direction. (0 for along xi-axis, 1 for eta-axis).<br /><br />[[Variables#Isrc|Isrc]]([[Variables#Nsrc|Nsrc]])              ! location of i index (u or v point)<br />[[Variables#Jsrc|Jsrc]]([[Variables#Nsrc|Nsrc]])              ! location of j index (u or v point)<br /><br />[[Variables#LTracerSrc|LtracerSrc]]([[Variables#itemp|itemp]],[[Variables#Ngrids|ng]])   ! T or F if temp information will be provided. If not, then<br/>                          the model uses the value at the inflowing rho point.<br />[[Variables#LtracerSrc|LtracerSrc]]([[Variables#isalt|isalt]],[[Variables#Ngrids|ng]])   ! T or F if salt information will be provided. If not, then<br />                          the model uses the value at the inflowing rho point.<br /><br />[[Variables#Qshape|Qshape]]([[Variables#Nsrc|Nsrc]],[[Variables#N|N]])          ! vertical distribution of the flow.<br /><br />[[Variables#Qbar|Qbar]]([[Variables#Nsrc|Nsrc]])              ! depth-integrated mass flow.<br /><br />[[Variables#Tsrc|Tsrc]]([[Variables#Nsrc|Nsrc]],[[Variables#N|N]],[[Variables#itemp|itemp]])      ! actual vertical distribution of the temperature values.<br />[[Variables#Tsrc|Tsrc]]([[Variables#Nsrc|Nsrc]],[[Variables#N|N]],[[Variables#isalt|isalt]])      ! actual vertical distribution of the salinity values.<br />[[Variables#Tsrc|Tsrc]]([[Variables#Nsrc|Nsrc]],[[Variables#N|N]],[[Variables#ised|ised]])      ! actual vertical distribution of the sediment values.</div>




To provide this information in a NetCDF file, do '''NOT''' define the [[ANA_PSOURCE]]. Instead, create the NetCDF file and add the file name to <span class="blue">FRCNAME</span> in [[ocean.in#Output_NetCDF_Files|ocean.in]].
To provide this information in a NetCDF file, do '''NOT''' define the [[ANA_PSOURCE]]. Instead, create the NetCDF file and add the file name to <span class="blue">FRCNAME</span> in [[ocean.in#Output_NetCDF_Files|ocean.in]].


You can find examples on how to write such a river forcing file with the "'''matlab'''" package  
The [[Variables#LtracerSrc|LtracerSrc]] logical switches set in the [[ocean.in]] file specify which tracer variables to consider when the option [[Options#TS_PSOURCE|TS_PSOURCE]] is activated. These T/F switches correspond to the [[Variables#LTracerSrc|LtracerSrc]](:,[[Variables#Ngrids|ng]]) variables set in [[ana_psource.h]] or the forcing file.
 
:<div class="box">[[Variables#LTracerSrc|LtracerSrc]]([[Variables#itemp|itemp]],[[Variables#Ngrids|ng]])    for temperature (itemp=1)<br />[[Variables#LTracerSrc|LtracerSrc]]([[Variables#isalt|isalt]]),[[Variables#Ngrids|ng]]    for salinity    (isalt=2)<br />[[Variables#LTracerSrc|LtracerSrc]]([[Variables#NAT|NAT]]+1,[[Variables#Ngrids|ng]])    for inert tracer 1<br />...                    ...<br />[[Variables#LTracerSrc|LtracerSrc]]([[Variables#NAT|NAT]]+[[Variables#NPT|NPT]],[[Variables#Ngrids|ng]])  for inert tracer NPT</div>
 
Other biological and sediment tracer switches are specified in their respective input scripts ([[biology.in]], [[sediment.in]], etc.).
 
[[Options#TS_PSOURCE|TS_PSOURCE]] is usually activated to add river runoff as a point source. At minimum, it is necessary to specify both temperature and salinity for all rivers.  The other tracers are optional.
 
The [[Variables#LtracerSrc|LtracerSrc]] logical switches '''replace''' and '''eliminate''' the need to read the variable "<span class="red">river_flag(river)</span>" in the input rivers forcing NetCDF file:
 
:<div class="box">double river_flag(river)<br />        river_flag:long_name = "river runoff tracer flag"<br />        river_flag:option_0 = "all tracers are off"<br />        river_flag:option_1 = "only temperature"<br />        river_flag:option_2 = "only salinity"<br />        river_flag:option_3 = "both temperature and salinity"<br />        river_flag:units = "nondimensional"</div>
 
This logic was too cumbersome and complicated when additional tracers are considered. However, this change is backward compatible.
 
The [[Variables#LtracerSrc|LtracerSrc]] switch activates the reading of the respective tracer variable from the input river forcing NetCDF file. If you want to add other tracer variables (other than temperature and salinity) as a source for a particular river(s), you just need to specify such values on those river(s). Then, set the values to '''ZERO''' on the other river(s) that do '''NOT''' require such river forcing for that tracer. <span class="red">You must specify the tracer values for all rivers, even if their values are zero.</span>
 
<!--You can find examples on how to write such a river forcing file with the "'''matlab'''" package  
[https://www.myroms.org/index.php?page=Processing here]. You may also be interested in  
[https://www.myroms.org/index.php?page=Processing here]. You may also be interested in  
[https://www.myroms.org/forum/viewtopic.php?t=63 this] forum post.
[https://www.myroms.org/forum/viewtopic.php?t=63 this] forum post.-->


Here are some forum discussions about the vertical profile of the flow.<br />
Here are some forum discussions about the vertical profile of the flow.
#[https://www.myroms.org/forum/viewtopic.php?t=60 Treatment of rivers]
#[https://www.myroms.org/forum/viewtopic.php?t=60 Treatment of rivers]
#[https://www.myroms.org/forum/viewtopic.php?t=79 More on rivers, ROMS2.0 to 2.1?]
#[https://www.myroms.org/forum/viewtopic.php?t=79 More on rivers, ROMS2.0 to 2.1?]
{{note}} Note that there may be information in theses posts that is no longer relevant.

Revision as of 18:55, 8 January 2010

Description of River Input


River Input

First you need to set the appropriate CPP options. Typically, this would be:

  • TS_PSOURCE: for salinity and/or temperature sources/sinks

and/or

  • UV_PSOURCE: for mass sources/sinks due to river runoff.

Then you need to decide how to provide the information of river flow, vertical distribution of flow, direction, location, and tracer (temp, salt, sed, etc) values. You can provide the data analytically or by providing the data in a NetCDF forcing file.

To provide this information analytically, you need to activate ANA_PSOURCE and set the following values in ana_psource.h:

Nsrc  ! Number of sources.

Dsrc(Nsrc)  ! direction. (0 for along xi-axis, 1 for eta-axis).

Isrc(Nsrc)  ! location of i index (u or v point)
Jsrc(Nsrc)  ! location of j index (u or v point)

LtracerSrc(itemp,ng)  ! T or F if temp information will be provided. If not, then
the model uses the value at the inflowing rho point.
LtracerSrc(isalt,ng)  ! T or F if salt information will be provided. If not, then
the model uses the value at the inflowing rho point.

Qshape(Nsrc,N)  ! vertical distribution of the flow.

Qbar(Nsrc)  ! depth-integrated mass flow.

Tsrc(Nsrc,N,itemp)  ! actual vertical distribution of the temperature values.
Tsrc(Nsrc,N,isalt)  ! actual vertical distribution of the salinity values.
Tsrc(Nsrc,N,ised)  ! actual vertical distribution of the sediment values.


To provide this information in a NetCDF file, do NOT define the ANA_PSOURCE. Instead, create the NetCDF file and add the file name to FRCNAME in ocean.in.

The LtracerSrc logical switches set in the ocean.in file specify which tracer variables to consider when the option TS_PSOURCE is activated. These T/F switches correspond to the LtracerSrc(:,ng) variables set in ana_psource.h or the forcing file.

LtracerSrc(itemp,ng) for temperature (itemp=1)
LtracerSrc(isalt),ng for salinity (isalt=2)
LtracerSrc(NAT+1,ng) for inert tracer 1
... ...
LtracerSrc(NAT+NPT,ng) for inert tracer NPT

Other biological and sediment tracer switches are specified in their respective input scripts (biology.in, sediment.in, etc.).

TS_PSOURCE is usually activated to add river runoff as a point source. At minimum, it is necessary to specify both temperature and salinity for all rivers. The other tracers are optional.

The LtracerSrc logical switches replace and eliminate the need to read the variable "river_flag(river)" in the input rivers forcing NetCDF file:

double river_flag(river)
river_flag:long_name = "river runoff tracer flag"
river_flag:option_0 = "all tracers are off"
river_flag:option_1 = "only temperature"
river_flag:option_2 = "only salinity"
river_flag:option_3 = "both temperature and salinity"
river_flag:units = "nondimensional"

This logic was too cumbersome and complicated when additional tracers are considered. However, this change is backward compatible.

The LtracerSrc switch activates the reading of the respective tracer variable from the input river forcing NetCDF file. If you want to add other tracer variables (other than temperature and salinity) as a source for a particular river(s), you just need to specify such values on those river(s). Then, set the values to ZERO on the other river(s) that do NOT require such river forcing for that tracer. You must specify the tracer values for all rivers, even if their values are zero.


Here are some forum discussions about the vertical profile of the flow.

  1. Treatment of rivers
  2. More on rivers, ROMS2.0 to 2.1?

Note Note that there may be information in theses posts that is no longer relevant.