FMS 2025.01.02-dev
Flexible Modeling System
Loading...
Searching...
No Matches
gex_mod

Simple generic exchange (gex) interface to pass (non-tracer) fields across components. More...

Data Types

interface  check_gex
 check that gex field was accessed by the sending component More...
 
type  gex_type
 This type represents the entries for a specific exchanged field. More...
 
type  gex_type_r
 This type stores information about all the exchanged fields. More...
 

Functions/Subroutines

logical function check_gex_index (model_src, model_rec, index)
 Function to check if gex index is properly set.
 
logical function check_gex_name (model_src, model_rec, name)
 Function to return the value of exchanged field and check that it was set.
 
subroutine gex_assert_valid_index (indx, name, lb, ub)
 Check that an index falls within a range of valid values.
 
integer function, public gex_get_index (model_src, model_rec, name, record)
 Function to return index of exchanged field.
 
integer function, public gex_get_n_ex (model_src, model_rec)
 Function to return number of fields exchanged.
 
character(len=64) function, public gex_get_property (model_src, model_rec, gex_index, property)
 Function to return property value (string)
 
subroutine, public gex_init ()
 Subroutine to initialize generic exchange between model components.
 
subroutine gex_read_field_table (listroot, model_src, model_rec)
 Subroutine to fields for a given exchange.
 

Detailed Description

Simple generic exchange (gex) interface to pass (non-tracer) fields across components.

File for gex_mod.

Author
Fabien Paulot (Fabie.nosp@m.n.Pa.nosp@m.ulot@.nosp@m.noaa.nosp@m..gov)

1. Introduction

gex provides a generic interface to pass diagnostic fields across components. This interface is not meant to pass tracers across components.

2. Setup

2.1. Field table

Each exchanged field needs to be specified in the coupler_mod field table as:

‍SENDING_COMPONENT_to_RECEIVING_COMPONENT_ex, "coupler_mod", GEX_NAME

SENDING_COMPONENT and RECEIVING_COMPONENT can be lnd, atm and ocn GEX_NAME is the name under which the exchanged field is stored within gex

Additional information can be provided regarding the field units.

Example

"atm_to_lnd_ex","coupler_mod","dryoa"
                "units","kg/m2/s"
/

2.2 Sending routine

Two things need to happen:

2.3 Receiving routine

Receiving is very similar to sending.


Data Type Documentation

◆ gex_mod::check_gex

interface gex_mod::check_gex

check that gex field was accessed by the sending component

Definition at line 144 of file gex.F90.

Public Member Functions

logical function check_gex_index (model_src, model_rec, index)
 Function to check if gex index is properly set.
 
logical function check_gex_name (model_src, model_rec, name)
 Function to return the value of exchanged field and check that it was set.
 

Member Function/Subroutine Documentation

◆ check_gex_index()

logical function check_gex_index ( integer, intent(in)  model_src,
integer, intent(in)  model_rec,
integer, intent(in)  index 
)

Function to check if gex index is properly set.

Parameters
[in]model_srcindex of the model where the field comes FROM
[in]model_recindex of the model where the filed goes TO
[in]indexgex index

Definition at line 326 of file gex.F90.

◆ check_gex_name()

logical function check_gex_name ( integer, intent(in)  model_src,
integer, intent(in)  model_rec,
character(len=*), intent(in)  name 
)

Function to return the value of exchanged field and check that it was set.

Parameters
[in]model_srcindex of the model where the field comes FROM
[in]model_recindex of the model where the filed goes TO
[in]namename of the tracer

Definition at line 297 of file gex.F90.

◆ gex_mod::gex_type

type gex_mod::gex_type

This type represents the entries for a specific exchanged field.

Definition at line 127 of file gex.F90.

Collaboration diagram for gex_type:
[legend]

Public Attributes

character(fm_field_name_len) name = ''
 gex name
 
logical set = .FALSE.
 
character(fm_string_len) units = ''
 units (optional)
 

Member Data Documentation

◆ name

character(fm_field_name_len) name = ''

gex name

Definition at line 128 of file gex.F90.

◆ set

logical set = .FALSE.

Definition at line 130 of file gex.F90.

◆ units

character(fm_string_len) units = ''

units (optional)

Definition at line 129 of file gex.F90.

◆ gex_mod::gex_type_r

type gex_mod::gex_type_r

This type stores information about all the exchanged fields.

Definition at line 135 of file gex.F90.

Collaboration diagram for gex_type_r:
[legend]

Public Attributes

type(gex_type), dimension(:), allocatable field
 

Member Data Documentation

◆ field

type(gex_type), dimension(:), allocatable field

Definition at line 136 of file gex.F90.

Function/Subroutine Documentation

◆ check_gex_index()

logical function check_gex_index ( integer, intent(in)  model_src,
integer, intent(in)  model_rec,
integer, intent(in)  index 
)
private

Function to check if gex index is properly set.

Parameters
[in]model_srcindex of the model where the field comes FROM
[in]model_recindex of the model where the filed goes TO
[in]indexgex index

Definition at line 326 of file gex.F90.

◆ check_gex_name()

logical function check_gex_name ( integer, intent(in)  model_src,
integer, intent(in)  model_rec,
character(len=*), intent(in)  name 
)
private

Function to return the value of exchanged field and check that it was set.

Parameters
[in]model_srcindex of the model where the field comes FROM
[in]model_recindex of the model where the filed goes TO
[in]namename of the tracer

Definition at line 297 of file gex.F90.

◆ gex_assert_valid_index()

subroutine gex_assert_valid_index ( integer, intent(in)  indx,
character(*), intent(in)  name,
integer, intent(in)  lb,
integer, intent(in)  ub 
)
private

Check that an index falls within a range of valid values.

Parameters
[in]indxIndex to check
[in]lbLower bound of valid indices
[in]ubUpper bound of valid indices
[in]nameName of the index

Definition at line 350 of file gex.F90.

◆ gex_get_index()

integer function, public gex_get_index ( integer, intent(in)  model_src,
integer, intent(in)  model_rec,
character(len=*), intent(in)  name,
logical, intent(in), optional  record 
)

Function to return index of exchanged field.

Parameters
[in]namename of the tracer
[in]model_srcindex of the model where the field comes FROM
[in]model_recindex of the model where the filed goes TO
[in]recordregister that the field was accessed

Definition at line 270 of file gex.F90.

◆ gex_get_n_ex()

integer function, public gex_get_n_ex ( integer, intent(in)  model_src,
integer, intent(in)  model_rec 
)

Function to return number of fields exchanged.

Parameters
[in]model_srcindex of the model where the field comes FROM
[in]model_recindex of the model where the filed goes TO

Definition at line 231 of file gex.F90.

◆ gex_get_property()

character(len=64) function, public gex_get_property ( integer, intent(in)  model_src,
integer, intent(in)  model_rec,
integer, intent(in)  gex_index,
integer, intent(in)  property 
)

Function to return property value (string)

Parameters
[in]model_srcindex of the model where the field comes FROM
[in]model_recindex of the model where the filed goes TO
[in]gex_indexgex index
[in]propertyrequested property

Definition at line 245 of file gex.F90.

◆ gex_init()

subroutine, public gex_init

Subroutine to initialize generic exchange between model components.

Definition at line 155 of file gex.F90.

◆ gex_read_field_table()

subroutine gex_read_field_table ( character(len=*), intent(in)  listroot,
integer, intent(in)  model_src,
integer, intent(in)  model_rec 
)
private

Subroutine to fields for a given exchange.

Parameters
[in]listrootname of the field manager list
[in]model_srcindex of the model where the field comes FROM
[in]model_recindex of the model where the field goes TO

Definition at line 188 of file gex.F90.