Skip to content
rmontuoro edited this page Apr 17, 2020 · 3 revisions

The SWPC I/O component (SWIO) is a NUOPC component in charge of performing dedicated disk I/O and online remapping of exported/imported fields to regular 2D and 3D grids. Only the output capability is currently implemented.

Introduction

SWIO was designed to fulfill operational requirements for the SWPC WAM-IPE forecast system. These requirements include the ability to:

  • specify which fields need to be written to disk from each coupled component at initialization time, without rebuilding the component. The number of fields may change during the forecast workflow as well as the output frequency
  • perform online regridding to generate output over native grids/meshes and regular 2D/3D grids
  • modify the output frequency for each forecast cycle

SWIO retrieves fields from other NUOPC components through standard NUOPC connectors, which are in charge of performing the actual field remapping to the output grid (see Run Sequence below). SWIO can be executed concurrently or sequentially with the connected model component. If executed sequentially on the same PETs as the other component, SWIO attempts to access the memory location of each connected field by reference (if allowed by the other component) to minimize its memory footprint.

Note that SWIO can only access fields that are being exported by a component. Unavailable fields will not be included in SWIO output files.

SWIO uses the COMmon I/O layer (COMIO) library to perform parallel disk I/O. This library was developed to simplify common I/O operations in SWPC models and currently supports both NetCDF and HDF5 file formats.

File output is performed in 'snapshots`, i.e. at each output frequency a file is generated with a name that includes the current time stamp. Output to files including a time (record) dimension is not supported.

Run Sequence

A sample run sequence is reported below. Note that you can use as many independent SWIO components as you need to output fields at the required frequency. The name of the resource file corresponding to each of the SWIO components can be provided via the ConfigFile attribute.

#############################################
####  NEMS Run-Time Configuration File  #####
#############################################

# EARTH #
EARTH_component_list: MED ATM IPM AIO IO
EARTH_attributes::
  Verbosity = max
::

# MED #
MED_model:                      swpc
MED_petlist_bounds:             72 111
MED_attributes::
  Verbosity = max
  DumpFields = false
  DumpRHs = false
::

# ATM #
ATM_model:                      wam
ATM_petlist_bounds:             0 31
ATM_attributes::
  Verbosity = max
::

# IPM #
IPM_model:                      ipe
IPM_petlist_bounds:             32 71
IPM_attributes::
  Verbosity = max
  Diagnostic = 131072
::

# AIO #
AIO_model:                      swio
AIO_petlist_bounds:             0 31
AIO_attributes::
  Verbosity = max
  ConfigFile = swio.wam.rc
::

# IO #
IO_model:                       swio
IO_petlist_bounds:              32 71
IO_attributes::
  Verbosity = max
  ConfigFile = swio.ipe.rc
::

# Run Sequence #
runSeq::
  @180.0
    ATM -> MED :remapMethod=redist
    MED
    MED -> IPM :remapMethod=redist
    @60.0
      ATM
    @
    IPM
    AIO
    ATM -> AIO
    IO
    IPM -> IO
  @
::

Resource File

SWIO can be configured at runtime by editing SWIO's resource file. A sample including descriptions for each of SWIO's settings is provided below.

#############################################
####  SWIO Run-Time Configuration File  #####
#############################################
#
#  Imported fields
#
import_fields::
    temp_neutral
    eastward_wind_neutral
    northward_wind_neutral
    upward_wind_neutral
    O_Density
    O2_Density
    N2_Density
::

#
# Output file format.
#
# Choose from:
# - hdf5
# - pnetcdf or parallel-netcdf
#
output_format: pnetcdf

#
# Output file prefix.
#
# Output file names are created as:
#   <prefix>.<datetime>.<suffix>
# where:
#   <prefix>   : is the string provided via
#                output_file_prefix keyword
#   <datetime> : inported field timestamp,
#                formatted as: YYYYMMDD_hhmmss
#   <suffix>   : determined from output format:
#                'hd5' for hdf5, 'nc' for pnetcdf
#
output_file_prefix: data

#
# Output grid type.
# 
# Supported types are:
# - latlon: 2D/3D regular lat/lon spherical grid
# - none  : native (imported) grid/mesh
#
output_grid_type: latlon
#
# The following keywords are read only if grid
# type is 'latlon'
#
# Output grid size.
#
# Provides the lat/lon grid resolution as
#   #longitudes #latitudes [#levels]

# If #levels is missing, a 2D lat/lon grid will be built
#
# If #levels > 0, the minimum and maximum value of the
# vertical coordinate (km) will be read via the 
# 'output_grid_level_range' keyword below.
#
# If #levels = 0, the grid's vertical levels are read
# from the 'output_grid_level_values' table (km)
#
# If #levels < 0, ungridded #nlevels will be added
#
output_grid_size: 360 180 25

#
# Minimin and maximum values of vertical coordinate (km)
# Used if #levels > 0
#
output_grid_level_range: 90. 800.

#
# List of vertical levels (km)
# Used if #levels <= 0
#
output_grid_level_values::
   90.
  150.
  300.
  400.
  500.
  600.
  700.
  800.
::

#
# If true, this flag transforms the vertical coordinate (v),
# assumed in km, to heights (h) relative to the average
# Earth's radius (R=6,371.2 km), accordina to the formula:
#   h = 1 + v/R
#
output_grid_level_relative: false
Clone this wiki locally