Difference between revisions of "coupling esmf atm.yaml"

From WikiROMS
Jump to navigationJump to search
(Created page with "<div class="title">coupling_esmf_atm.yaml</div> __TOC__ The '''coupling_esmf_<atm>.yaml''' (where <atm> is the model name) file specifies the ROMS Coupling ESMF/NUOPC System...")   (change visibility)
 
 
(16 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<div class="title">coupling_esmf_atm.yaml</div>
<div class="title">ROMS ESMF/NUOPC Metadata File: coupling_esmf_atm.yaml</div>


__TOC__
__TOC__


The '''coupling_esmf_<atm>.yaml''' (where <atm> is the model name) file specifies the ROMS Coupling ESMF/NUOPC System Import/Export Metadata Dictionary. Starting '''svn''' revision '''-r 1902''' released on March 1, 2022, the ROMS coupling metadata is managed with a YAML file, and the regular text file '''coupling_esmf_<atm>.dat''' is deprecated. The YAML files are simple, easy to follow, elegant, portable, and expandable. ROMS can now process YAML files with its parser module, '''yaml_parser.F'''. Therefore, there is no need to use third-party YAML parsers. Basically, '''coupling_esmf_<atm>.yaml''' has the following structure:
The <span class="blue">coupling_esmf_<atm>.yaml</span> (where <<span class="blue">atm</span>> is the model name) file specifies the native ROMS Coupling '''ESMF/NUOPC''' System Import/Export Metadata Dictionary. Starting '''svn''' revision '''-r 1902''' released on March 1, 2022, the ROMS coupling metadata is managed with a '''YAML''' file, and the regular text file <span class="blue">coupling_esmf_<atm>.dat</span> is deprecated. The '''YAML''' files are simple, easy to follow, elegant, portable, and expandable. ROMS can now process '''YAML''' files with its parser module, <span class="blue">yaml_parser.F</span>. Therefore, there is no need to use third-party '''YAML''' parsers. Basically, <span class="blue">coupling_esmf_<atm>.yaml</span> has the following structure:


<div class="box"><span class="violet">ATM_component</span>:  <span class="green">&ATM</span> <span class="twilightBlue">WRF</span><br /><br /><span class="violet">DATA_component</span>:  <span class="twilightBlue">data.nc</span><br /><br /><span class="violet">ROMS_component</span>:  <span class="green">&OCN</span> <span class="twilightBlue">ROMS</span><br /><br /><span class="violet">metadata</span>:<br /><br />  - <span class="violet">standard_name</span>:      <span class="twilightBlue">sea_surface_temperature</span><br />    <span class="violet">long_name</span>:          <span class="twilightBlue">sea surface potential temperature</span><br />    <span class="violet">short_name</span>:          <span class="twilightBlue">SST</span><br />    <span class="violet">data_variables</span>:      <span class="red">[<span class="twilightBlue">temperature</span>, <span class="twilightBlue">time</span>]</span><br />    <span class="violet">source_units</span>:        <span class="twilightBlue">C</span><br />    <span class="violet">destination_units</span>:  <span class="twilightBlue">K</span><br />    <span class="violet">source_grid</span>:        <span class="twilightBlue">cell_center</span><br />    <span class="violet">destination_grid</span>:    <span class="twilightBlue">cell_center</span><br />    <span class="violet">add_offset</span>:          <span class="twilightBlue">273.15d0</span><br />    <span class="violet">scale</span>:              <span class="twilightBlue">1.0d0</span><br />    <span class="violet">debug_write</span>:        <span class="twilightBlue">false</span><br />    <span class="violet">connected_to</span>:        <span class="salmon">*ATM</span><br />    <span class="violet">regrid_method</span>:      <span class="twilightBlue">bilinear</span><br />    <span class="violet">extrapolate_method</span>:  <span class="twilightBlue">nearest</span><br /><br />  - <span class="violet">standard_name</span>:      <span class="twilightBlue">sea_surface_temperature_data</span><br />    <span class="violet">long_name</span>:          <span class="twilightBlue">sea surface temperature data</span><br />    <span class="violet">short_name</span>:          <span class="twilightBlue">dSST</span><br />    <span class="violet">data_variables</span>:      <span class="red">[<span class="twilightBlue">temperature</span>, <span class="twilightBlue">time</span>]</span><br />    <span class="violet">source_units</span>:        <span class="twilightBlue">C</span><br />    <span class="violet">destination_units</span>:  <span class="twilightBlue">K</span><br />    <span class="violet">source_grid</span>:        <span class="twilightBlue">cell_center</span><br />    <span class="violet">destination_grid</span>:    <span class="twilightBlue">cell_center</span><br />    <span class="violet">add_offset</span>:          <span class="twilightBlue">273.15d0</span><br />    <span class="violet">scale</span>:              <span class="twilightBlue">1.0d0</span><br />    <span class="violet">debug_write</span>:        <span class="twilightBlue">false</span><br />    <span class="violet">connected_to</span>:        <span class="salmon">*ATM</span><br />    <span class="violet">regrid_method</span>:      <span class="twilightBlue">bilinear</span><br />    <span class="violet">extrapolate_method</span>:  <span class="twilightBlue">nearest</span></div>
<div class="code"><span class="violet">ATM_component</span>:  <span class="green">&ATM</span> <span class="twilightBlue">WRF</span><br /><br /><span class="violet">DATA_component</span>:  <span class="twilightBlue">data.nc                 <span class="red">#</span> NetCDF data model</span><br /><br /><span class="violet">ROMS_component</span>:  <span class="green">&OCN</span> <span class="twilightBlue">ROMS</span><br /><br /><span class="violet">metadata</span>:                               <span class="red">#</span> <span class="twilightBlue">Export and Import fields</span><br /><br />  <span class="red">-</span> <span class="violet">standard_name</span>:      <span class="twilightBlue">sea_surface_temperature</span><br />    <span class="violet">long_name</span>:          <span class="twilightBlue">sea surface temperature</span><br />    <span class="violet">short_name</span>:          <span class="twilightBlue">SST</span><br />    <span class="violet">data_variables</span>:      <span class="red">[<span class="twilightBlue">temperature</span>, <span class="twilightBlue">time</span>]</span><br />    <span class="violet">source_units</span>:        <span class="twilightBlue">C</span><br />    <span class="violet">destination_units</span>:  <span class="twilightBlue">K</span><br />    <span class="violet">source_grid</span>:        <span class="twilightBlue">cell_center</span><br />    <span class="violet">destination_grid</span>:    <span class="twilightBlue">cell_center</span><br />    <span class="violet">add_offset</span>:          <span class="twilightBlue">273.15d0</span><br />    <span class="violet">scale</span>:              <span class="twilightBlue">1.0d0</span><br />    <span class="violet">debug_write</span>:        <span class="twilightBlue">false</span><br />    <span class="violet">connected_to</span>:        <span class="salmon">*OCN</span><br />    <span class="violet">regrid_method</span>:      <span class="twilightBlue">bilinear</span><br />    <span class="violet">extrapolate_method</span>:  <span class="twilightBlue">nearest</span><br /><br />  <span class="red">-</span> <span class="violet">standard_name</span>:      <span class="twilightBlue">sea_surface_temperature_data</span><br />    <span class="violet">long_name</span>:          <span class="twilightBlue">sea surface temperature data</span><br />    <span class="violet">short_name</span>:          <span class="twilightBlue">dSST</span><br />    <span class="violet">data_variables</span>:      <span class="red">[<span class="twilightBlue">temperature</span>, <span class="twilightBlue">time</span>]</span><br />    <span class="violet">source_units</span>:        <span class="twilightBlue">C</span><br />    <span class="violet">destination_units</span>:  <span class="twilightBlue">K</span><br />    <span class="violet">source_grid</span>:        <span class="twilightBlue">cell_center</span><br />    <span class="violet">destination_grid</span>:    <span class="twilightBlue">cell_center</span><br />    <span class="violet">add_offset</span>:          <span class="twilightBlue">273.15d0</span><br />    <span class="violet">scale</span>:              <span class="twilightBlue">1.0d0</span><br />    <span class="violet">debug_write</span>:        <span class="twilightBlue">false</span><br />    <span class="violet">connected_to</span>:        <span class="salmon">*ATM</span><br />    <span class="violet">regrid_method</span>:      <span class="twilightBlue">bilinear</span><br />    <span class="violet">extrapolate_method</span>:  <span class="twilightBlue">nearest</span><br /><br />  <span class="red"><span class="red">#</span> <span class="twilightBlue">And so on. It is an expandable blocking list ...</span></span></div>


The field key and value pair in the YAML blocking list is as follows:
The description <span class="violet">key</span> for each pair member of the '''YAML''' blocking list is as follows:


* <span class="violet">standard_name</span>: CF conventions standard name for variable. A list of applicable '''standard_name''' attributes are shown below.
 
* <span class="violet">long_name</span>: The field's long descriptive name.
{| border="1" cellspacing="0" cellpadding="5" align="left"
* <span class="violet">short_name</span>: The field's short name private to the '''NUOPC''' cap module
!'''Key'''
* <span class="violet">data_variables</span>: The <span class="green">DATA</span> component NetCDF field and time variable names.
!'''Description'''
* <span class="violet">source_units</span>: The field's source units.
* <span class="violet">destination_units</span>: The field's destination units.
* <span class="violet">source_grid</span>: The field's source grid-cell location.
* <span class="violet">destination_grid</span>: The field's destination grid-cell location.
* <span class="violet">add_offset</span>: The value to add to the exchanged field.
* <span class="violet">scale</span>: The scale to use to convert data from source to destination.
* <span class="violet">debug_write</span>: A switch indicating whether or not to write out exchanged field, if DebugLevel>2.
* <span class="violet">connected_to</span>: The source component to which the field is connected.
* <span class="violet">regrid_method</span>: The field regridding method from source to destination:
{|style="margin-left: 100px;" border="1" cellspacing="0" cellpadding="5" align="left"
|<span class="twilightBlue">bilinear</span>
|bilinear interpolation
|-
|-
|<span class="twilightBlue">patch</span>
|<span class="violet">standard_name</span>
|high-order patch recovery
|The field's standard name. A list of all exchanged '''standard_name''' field are shown below.
|-
|-
|<span class="twilightBlue">conservative1</span>
|<span class="violet">long_name</span>
|first-order conservative
|The field's long descriptive name.
|-
|-
|<span class="twilightBlue">conservative2</span>
|<span class="violet">short_name</span>
|second-order conservative
|The field's short name private to the '''ESMF/NUOPC''' cap module
|-
|-
|<span class="twilightBlue">nearest</span>
|<span class="violet">data_variables</span>
|nearest neighbor interpolation
|The <span class="green">DATA</span> component NetCDF field and associated time variable names.
|-
|-
|}
|<span class="violet">source_units</span>
<div style="clear: both"></div>
|The field's source units.
* <span class="violet">extrapolate_method</span>: The field extrapolation method for unmapped points:
|-
{|style="margin-left: 100px;" border="1" cellspacing="0" cellpadding="5" align="left"
|<span class="violet">destination_units</span>
|<span class="twilightBlue">none</span>
|The field's destination units.
|no extrapolation
|-
|<span class="violet">source_grid</span>
|The field's source grid-cell location.
|-
|<span class="violet">destination_grid</span>
|The field's destination grid-cell location.
|-
|<span class="violet">add_offset</span>
|The value to add to the exchanged field.
|-
|<span class="violet">scale</span>
|The scale to use to convert data from source to destination units.
|-
|-
|<span class="twilightBlue">nearest</span>
|<span class="violet">debug_write</span>
|nearest source to destination
|A switch indicating whether or not to write out exchanged field, if '''DebugLevel'''>2.
|-
|-
|<span class="twilightBlue">idavg</span>
|<span class="violet">connected_to</span>
|nearest inverse distance average
|The source component to which the field is connected.
|-
|-
|<span class="twilightBlue">creep</span>
|valign="top"|<span class="violet">regrid_method</span>
|creep fill at specified level
|The field regridding method from source to destination:<br /><br />
  {|style="margin-left: 100px;" border="1" cellspacing="0" cellpadding="5" align="left"
  !'''Value'''
  !'''Description'''
  |-
  |<span class="twilightBlue">bilinear</span>
  |bilinear interpolation
  |-
  |<span class="twilightBlue">patch</span>
  |high-order patch recovery
  |-
  |<span class="twilightBlue">conservative1</span>
  |first-order conservative
  |-
  |<span class="twilightBlue">conservative2</span>
  |second-order conservative
  |-
  |<span class="twilightBlue">nearest</span>
  |nearest neighbor interpolation
  |-
  |}
|-
|-
|<span class="twilightBlue">2steps</span>
|valign="top"|<span class="violet">extrapolate_method</span>
|Turuncoglu's 2 steps extrapolation
|The field extrapolation method for unmapped points:<br /><br />
  {|style="margin-left: 100px;" border="1" cellspacing="0" cellpadding="5" align="left"
  !'''Value'''
  !'''Description'''
  |-
  |<span class="twilightBlue">none</span>
  |no extrapolation
  |-
  |<span class="twilightBlue">nearest</span>
  |nearest source to destination
  |-
  |<span class="twilightBlue">idavg</span>
  |nearest inverse distance average
  |-
  |<span class="twilightBlue">creep</span>
  |creep fill at specified level
  |-
  |<span class="twilightBlue">2steps</span>
  |Turuncoglu's 2 steps extrapolation
  |-
  |}
|-
|-
|}
|}
<div style="clear: both"></div>
<div style="clear: both"></div>
The ESM imported fields are processed as:
The ESM imported fields are processed as:
:<span class="twilightBlue">field</span> (<span class="violet">destination_units</span>) = <span class="twilightBlue">field</span> (<span class="violet">source_units</span>) * <span class="violet">scale</span> + <span class="violet">add_offset</span>
:<span class="twilightBlue">field</span> (<span class="violet">destination_units</span>) = <span class="twilightBlue">field</span> (<span class="violet">source_units</span>) * <span class="violet">scale</span> + <span class="violet">add_offset</span>
YAML allows '''alias''' and '''anchor''' to avoid repetition. In YAML, single or multiple line comments start with a hash <span class="twilightBlue">#</span>. Also, comment after a key/value pair is allowed. All comments are skipped during processing.
'''YAML''' allows <span class="forestGreen">Anchors</span> and <span class="salmon">Aliases</span> to avoid repetition. In '''YAML''', single or multiple line comments start with a hash <span class="red">#</span>. Also, comment after a key/value pair is allowed. All comments are skipped during processing.
 
=== Exchanged Fields Metadata: short_name and standard_name ===
 
The following table shows the coupling metadata <span class="violet">short_name</span> and <span class="violet">standard_name</span> for the '''ESMF/NUOPC''' Export and Import states.  They follow '''CF''' conventions closely.  However, we needed to create lots of them because are not available in the '''CF''' tables but followed their established syntax. The list of exchanged fields is application dependent and '''YAML''' files are expandable and easy to modify.
 
 
{| border="1" cellspacing="0" cellpadding="5" align="left"
| align="center" | <span class="violet">short_name</span>
|style="width: 350px;" align="center" | <span class="violet">standard_name</span>
|-
| <span class="twilightBlue">dLWrad</span>
| <span class="twilightBlue">surface_net_downward_longwave_flux</span>
|-
| <span class="twilightBlue">dSWrad</span>
| <span class="twilightBlue">net_downward_shortwave_flux_at_sea_water_surface</span>
|-
| <span class="twilightBlue">dSST</span>
| <span class="twilightBlue">sea_surface_temperature_data</span>
|-
| <span class="twilightBlue">Hair</span>
| <span class="twilightBlue">surface_specific_humidity</span>
|-
| <span class="twilightBlue">LHfx</span>
| <span class="twilightBlue">surface_latent_heat_flux</span>
|-
| <span class="twilightBlue">LWrad</span>
| <span class="twilightBlue">surface_net_downward_longwave_flux</span>
|-
| <span class="twilightBlue">Pair</span>
| <span class="twilightBlue">surface_air_pressure</span>
|-
| <span class="twilightBlue">Pmsl</span>
| <span class="twilightBlue">mean_sea_level_pressure</span>
|-
| <span class="twilightBlue">Qair</span>
| <span class="twilightBlue">surface_relative_humidity</span>
|-
| <span class="twilightBlue">rain</span>
| <span class="twilightBlue">precipitation_flux</span>
|-
| <span class="twilightBlue">shflux</span>
| <span class="twilightBlue">surface_downward_heat_flux_in_sea_water</span>
|-
| <span class="twilightBlue">SHfx</span>
| <span class="twilightBlue">surface_sensible_heat_flux</span>
|-
| <span class="twilightBlue">SST</span>
| <span class="twilightBlue">sea_surface_temperature</span>
|-
| <span class="twilightBlue">sustr</span>
| <span class="twilightBlue">surface_downward_x_stress</span>
|-
| <span class="twilightBlue">svstr</span>
| <span class="twilightBlue">surface_downward_y_stress</span>
|-
| <span class="twilightBlue">swflux</span>
| <span class="twilightBlue">surface_upward_water_flux</span>
|-
| <span class="twilightBlue">SWrad</span>
| <span class="twilightBlue">net_shortwave_flux_at_sea_water_surface</span>
|-
| <span class="twilightBlue">Tair</span>
| <span class="twilightBlue">surface_air_temperature</span>
|-
| <span class="twilightBlue">Uwind</span>
| <span class="twilightBlue">surface_eastward_wind</span>
|-
| <span class="twilightBlue">Vwind</span>
| <span class="twilightBlue">surface_northward_wind</span>
|-
|}

Latest revision as of 15:31, 4 May 2022

ROMS ESMF/NUOPC Metadata File: coupling_esmf_atm.yaml

The coupling_esmf_<atm>.yaml (where <atm> is the model name) file specifies the native ROMS Coupling ESMF/NUOPC System Import/Export Metadata Dictionary. Starting svn revision -r 1902 released on March 1, 2022, the ROMS coupling metadata is managed with a YAML file, and the regular text file coupling_esmf_<atm>.dat is deprecated. The YAML files are simple, easy to follow, elegant, portable, and expandable. ROMS can now process YAML files with its parser module, yaml_parser.F. Therefore, there is no need to use third-party YAML parsers. Basically, coupling_esmf_<atm>.yaml has the following structure:

ATM_component: &ATM WRF

DATA_component: data.nc # NetCDF data model

ROMS_component: &OCN ROMS

metadata: # Export and Import fields

- standard_name: sea_surface_temperature
long_name: sea surface temperature
short_name: SST
data_variables: [temperature, time]
source_units: C
destination_units: K
source_grid: cell_center
destination_grid: cell_center
add_offset: 273.15d0
scale: 1.0d0
debug_write: false
connected_to: *OCN
regrid_method: bilinear
extrapolate_method: nearest

- standard_name: sea_surface_temperature_data
long_name: sea surface temperature data
short_name: dSST
data_variables: [temperature, time]
source_units: C
destination_units: K
source_grid: cell_center
destination_grid: cell_center
add_offset: 273.15d0
scale: 1.0d0
debug_write: false
connected_to: *ATM
regrid_method: bilinear
extrapolate_method: nearest

# And so on. It is an expandable blocking list ...

The description key for each pair member of the YAML blocking list is as follows:


Key Description
standard_name The field's standard name. A list of all exchanged standard_name field are shown below.
long_name The field's long descriptive name.
short_name The field's short name private to the ESMF/NUOPC cap module
data_variables The DATA component NetCDF field and associated time variable names.
source_units The field's source units.
destination_units The field's destination units.
source_grid The field's source grid-cell location.
destination_grid The field's destination grid-cell location.
add_offset The value to add to the exchanged field.
scale The scale to use to convert data from source to destination units.
debug_write A switch indicating whether or not to write out exchanged field, if DebugLevel>2.
connected_to The source component to which the field is connected.
regrid_method The field regridding method from source to destination:

Value Description
bilinear bilinear interpolation
patch high-order patch recovery
conservative1 first-order conservative
conservative2 second-order conservative
nearest nearest neighbor interpolation
extrapolate_method The field extrapolation method for unmapped points:

Value Description
none no extrapolation
nearest nearest source to destination
idavg nearest inverse distance average
creep creep fill at specified level
2steps Turuncoglu's 2 steps extrapolation


The ESM imported fields are processed as:

field (destination_units) = field (source_units) * scale + add_offset

YAML allows Anchors and Aliases to avoid repetition. In YAML, single or multiple line comments start with a hash #. Also, comment after a key/value pair is allowed. All comments are skipped during processing.

Exchanged Fields Metadata: short_name and standard_name

The following table shows the coupling metadata short_name and standard_name for the ESMF/NUOPC Export and Import states. They follow CF conventions closely. However, we needed to create lots of them because are not available in the CF tables but followed their established syntax. The list of exchanged fields is application dependent and YAML files are expandable and easy to modify.


short_name standard_name
dLWrad surface_net_downward_longwave_flux
dSWrad net_downward_shortwave_flux_at_sea_water_surface
dSST sea_surface_temperature_data
Hair surface_specific_humidity
LHfx surface_latent_heat_flux
LWrad surface_net_downward_longwave_flux
Pair surface_air_pressure
Pmsl mean_sea_level_pressure
Qair surface_relative_humidity
rain precipitation_flux
shflux surface_downward_heat_flux_in_sea_water
SHfx surface_sensible_heat_flux
SST sea_surface_temperature
sustr surface_downward_x_stress
svstr surface_downward_y_stress
swflux surface_upward_water_flux
SWrad net_shortwave_flux_at_sea_water_surface
Tair surface_air_temperature
Uwind surface_eastward_wind
Vwind surface_northward_wind