FMS 2025.01.02-dev
Flexible Modeling System
|
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. | |
Simple generic exchange (gex) interface to pass (non-tracer) fields across components.
File for gex_mod.
gex provides a generic interface to pass diagnostic fields across components. This interface is not meant to pass tracers across components.
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" /
Two things need to happen:
At initialization, obtain index of exchanged field via:
GEX_INDEX = gex_get_index(SENDING_COMPONENT,RECEIVING_COMPONENT,GEX_NAME)
Returns NO_TRACER
if gex_name
is not found
Example
gex_dryoa = gex_get_index(MODEL_ATMOS,MODEL_LAND,'dryoa')
requests index for dryoa
field (exchanged from atmos->land) in gex.
Populate exchanged field
gex_array(:,:,GEX_INDEX) = SOME_VALUE
gex array
is an array that contains all exchanged fields in the sending component. It needs to be made available in the routine where the field of interest is calculated.
Example
gex_atm2lnd(:,:,gex_dryoa) = pwt(:,:,kd)*dsinku_lnd(:,:,nomphilic)
stores the total OA deposition
Receiving is very similar to sending.
GEX_INDEX = gex_get_index(SENDING_COMPONENT,RECEIVING_COMPONENT,GEX_NAME)
gex_array(:,:,GEX_INDEX)
gex array
is an array that contains all exchanged fields in the receiving component. It needs to be made available in the routine where the field of interest is needed interface gex_mod::check_gex |
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. | |
logical function check_gex_index | ( | integer, intent(in) | model_src, |
integer, intent(in) | model_rec, | ||
integer, intent(in) | index | ||
) |
logical function check_gex_name | ( | integer, intent(in) | model_src, |
integer, intent(in) | model_rec, | ||
character(len=*), intent(in) | name | ||
) |
type gex_mod::gex_type |
type gex_mod::gex_type_r |
|
private |
|
private |
|
private |
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 | ||
) |
integer function, public gex_get_n_ex | ( | integer, intent(in) | model_src, |
integer, intent(in) | model_rec | ||
) |
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 | ||
) |
subroutine, public gex_init |
|
private |