Simple generic exchange (gex) interface to pass (non-tracer) fields across components.
More...
|
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...
|
|
|
logical function | check_gex_index (MODEL_SRC, MODEL_REC, index) |
| Function to check if gex index is properly set. More...
|
|
logical function | check_gex_name (MODEL_SRC, MODEL_REC, name) |
| Function to return the value of exchanged field and check that it was set. More...
|
|
subroutine | gex_assert_valid_index (indx, name, lb, ub) |
| Check that an index falls within a range of valid values. More...
|
|
integer function, public | gex_get_index (MODEL_SRC, MODEL_REC, name, record) |
| Function to return index of exchanged field. More...
|
|
integer function, public | gex_get_n_ex (MODEL_SRC, MODEL_REC) |
| Function to return number of fields exchanged. More...
|
|
character(len=64) function, public | gex_get_property (MODEL_SRC, MODEL_REC, gex_index, property) |
| Function to return property value (string) More...
|
|
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. More...
|
|
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:
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
2.3 Receiving routine
Receiving is very similar to sending.
◆ 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.
Private Member Functions |
logical function | check_gex_index (MODEL_SRC, MODEL_REC, index) |
| Function to check if gex index is properly set. More...
|
|
logical function | check_gex_name (MODEL_SRC, MODEL_REC, name) |
| Function to return the value of exchanged field and check that it was set. More...
|
|
◆ 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_src | index of the model where the field comes FROM |
[in] | model_rec | index of the model where the filed goes TO |
[in] | index | gex 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_src | index of the model where the field comes FROM |
[in] | model_rec | index of the model where the filed goes TO |
[in] | name | name of the tracer |
Definition at line 297 of file gex.F90.
◆ gex_mod::gex_type
This type represents the entries for a specific exchanged field.
Definition at line 127 of file gex.F90.
Private Attributes |
character(fm_field_name_len) | name = '' |
| gex name
|
|
logical | set = .FALSE. |
|
character(fm_string_len) | units = '' |
| units (optional)
|
|
◆ gex_mod::gex_type_r
This type stores information about all the exchanged fields.
Definition at line 135 of file gex.F90.
Private Attributes |
type(gex_type), dimension(:), allocatable | field |
|
◆ check_gex_index()
logical function gex_mod::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_src | index of the model where the field comes FROM |
[in] | model_rec | index of the model where the filed goes TO |
[in] | index | gex index |
Definition at line 326 of file gex.F90.
◆ check_gex_name()
logical function gex_mod::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_src | index of the model where the field comes FROM |
[in] | model_rec | index of the model where the filed goes TO |
[in] | name | name of the tracer |
Definition at line 297 of file gex.F90.
◆ gex_assert_valid_index()
subroutine gex_mod::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] | indx | Index to check |
[in] | lb | Lower bound of valid indices |
[in] | ub | Upper bound of valid indices |
[in] | name | Name of the index |
Definition at line 350 of file gex.F90.
◆ gex_get_index()
integer function, public gex_mod::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] | name | name of the tracer |
[in] | model_src | index of the model where the field comes FROM |
[in] | model_rec | index of the model where the filed goes TO |
[in] | record | register that the field was accessed |
Definition at line 270 of file gex.F90.
◆ gex_get_n_ex()
integer function, public gex_mod::gex_get_n_ex |
( |
integer, intent(in) |
MODEL_SRC, |
|
|
integer, intent(in) |
MODEL_REC |
|
) |
| |
Function to return number of fields exchanged.
- Parameters
-
[in] | model_src | index of the model where the field comes FROM |
[in] | model_rec | index 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_mod::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_src | index of the model where the field comes FROM |
[in] | model_rec | index of the model where the filed goes TO |
[in] | gex_index | gex index |
[in] | property | requested property |
Definition at line 245 of file gex.F90.
◆ gex_read_field_table()
subroutine gex_mod::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] | listroot | name of the field manager list |
[in] | model_src | index of the model where the field comes FROM |
[in] | model_rec | index of the model where the field goes TO |
Definition at line 188 of file gex.F90.