com_cpl module reference

Common MPI initialization and communication routines and data.

More…

Data Types

cpl_vinfo_t

A derived type used to hold information associated with a variable that is passed via MPI at run time.

event_t

A derived type used to hold details of a data transfer between two component modules, sent through the coupler.

regrid_info_t

Hold information about the type of remapping that should be done for a particular variable.

uniq_names_t

Specifies the properties of a ‘field’.

Functions/Subroutines

init_common_coupler_parameters()

initialize common coupler parameters

err_exit()

lowerc()

Convert all upper case A-Z characters in the input string to lower case This function is also in the strings module but is included here to minimize dependencies for this module.

upperc()

Convert all lower case a-z characters in the input string to upper case This function is also in the strings module but is included here to minimize dependencies for this module.

overlap()

Determine the number of overlap longitudes given the x and y grid dimension (nx,ny) sizes as well as the total size of the transfer (sz)

idx2d_from_1d()

Calculate the x and y indicies of a 2D array in column-major order using nx …the size of the first dimension of the 2D array addr …the index in a 1D array corresponding with the sequential layout in memory of the 2D array.

sprint_var_stats_data_nwrds()

Return a string with min,max,avg (and possibly other stats) for a subset of an array.

sprint_var_stats_data()

Return a string with min,max,avg (and possibly other stats) over the entire array.

print_var_stats_data()

Print min, max, and avg of an entire array to standard out.

print_var_stats_data_nwrds()

Print min, max, and avg over a subset of an array to standard out.

is_special_op()

Identify non-transfer events by their name.

filter_group_id()

Reset the group ID for certain variable names that must always belong to a particular group.

copy_event_t()

Copy data between 2 event_t() data types.

print_event_t()

Print data from an event_t() data type.

copy_cpl_vinfo_t()

Copy data between 2 cpl_vinfo_t() data types.

print_cpl_vinfo_t()

Print data from a cpl_vinfo_t() data type.

define_cpl_var_list()

Define the list of all fields that may be coupled.

add_cpl_var()

Add an new entry to cpl_var_list.

cpl_var_name_exists()

Determine if a given variable name exists in cpl_var_list.

cpl_var_new_tag()

Find a tag value that is not currently used in cpl_var_list.

define_cpl_var_by_name()

Define a cpl_vinfo_t() variable on a particular grid given the name of the field and the name of the grid.

add_events_cpl_to_nemo()

Add fields to the event list that are sent coupler to NEMO.

add_events_cpl_to_agcm()

Add fields to the event list that are sent coupler to AGCM.

add_events_nemo_to_cpl()

Add fields to the event list that are sent NEMO to coupler.

add_events_agcm_to_cpl()

Add fields to the event list that are sent AGCM to coupler.

init_events_part1()

Initialize the default event list.

is_coupled()

Determine if a given name is to be coupled (ie is on the event stack)

find_cpl_vinfo()

Return a cpl_vinfo_t() record from cpl_var_list that matches either the “name” or the “tag” element.

Detailed Description

Common MPI initialization and communication routines and data.

Type Documentation

type com_cpl/cpl_vinfo_t

A derived type used to hold information associated with a variable that is passed via MPI at run time.

Type fields
  • % name [character(len=32),private] :: A unique name used to identify this record.

  • % grid [character(len=128),private] :: A string to identify the horizontal grid associated with this variable.

  • % tag [integer(kind= impi ),private] :: Integer tag used in mpi calls (tags must be unique for all records)

  • % size [integer,private] :: The number of words passed during each MPI send or receive The size is defined in terms of nlon, nlat and olap as follows size == (nlon+olap) * nlat.

  • % nlon [integer,private] :: The number of longitudes in the associated grid This will NOT include any overlap (cyclic) longitude.

  • % nlat [integer,private] :: The number of latitudes in the associated grid.

  • % olap [integer,private] :: The number of overlapping longitudes.

  • % ncopy [integer,private] :: The number of instances of this field to be passed sequentially.

  • % freq [integer,private] :: The coupling frequency in seconds.

  • % ccc_name [character(len=4),private] :: The 4 character CCCma variable name (ie ibuf3 as char)

  • % regrid [type( regrid_info_t ),private] :: Infomation about regridding this variable.

type com_cpl/event_t

A derived type used to hold details of a data transfer between two component modules, sent through the coupler.

Type fields
  • % get_model [character(32),private]

  • % put_model [character(32),private]

  • % get_var [character(32),private]

  • % put_var [character(32),private]

  • % regrid_method [character(32),private]

  • % regrid_norm_opt [character(32),private]

  • % action [character(64),private]

  • % freq [integer,private]

  • % tag [integer,private]

  • % ncopy [integer,private]

  • % get_master [integer,private]

  • % put_master [integer,private]

  • % regrid_id [integer,private]

  • % alarm_index [integer,private]

  • % is_msg [logical,private]

type com_cpl/regrid_info_t

Hold information about the type of remapping that should be done for a particular variable.

Type fields
  • % method [character(64),private] :: The type of interpolation to be done Possible values are: cv, conservative bl, bilinear bc, bicubic nn, distwgt.

  • % norm_opt [character(64),private] :: The type of normalization to be done for a conservative remap Possible values are (case insensitive): fracArea destArea.

  • % masked [logical,private] :: Logical flag to indicate whether or not land/ocean masks supplied in the grid description file will be used during the creation of interpolation weights and associated map info masked = T means mask found in the grid desc file will be used masked = F means mask will not be used (ie all grid points will participate in the weights calculation)

type com_cpl/uniq_names_t

Specifies the properties of a ‘field’.

Type fields
  • % name [character(32),private]

  • % grid [character(128),private]

Function/Subroutine Documentation

subroutine com_cpl/init_common_coupler_parameters()

initialize common coupler parameters

Call to

a_flnd a_mask err_exit nlat_a nlat_canom nlat_i nlat_o nlon_a nlon_a_with_olap nlon_canom nlon_i nlon_o nlon_o_with_olap olap_a olap_canom olap_i olap_o size_atm_grid size_canom_grid size_ice_grid size_ocn_grid

Called from

cpl_init cpl_main

subroutine com_cpl/err_exit(name, n)
Call to

model_group_comm

Called from

add_cpl_var add_events_agcm_to_cpl add_events_cpl_to_agcm add_events_cpl_to_nemo add_events_nemo_to_cpl cpl_var_new_tag define_cpl_var_by_name define_cpl_var_list find_cpl_vinfo init_common_coupler_parameters init_events_part1 is_coupled lowerc print_var_stats_data_nwrds upperc

function com_cpl/lowerc(strng) [)]

Convert all upper case A-Z characters in the input string to lower case This function is also in the strings module but is included here to minimize dependencies for this module.

Call to

err_exit

Called from

ccc_esmf::define_events find_cpl_vinfo ccc_esmf::get_grid_coord_2dr8 ccc_esmf::get_grid_item regrid_mod::process_clg

function com_cpl/upperc(strng) [)]

Convert all lower case a-z characters in the input string to upper case This function is also in the strings module but is included here to minimize dependencies for this module.

Call to

err_exit

function com_cpl/overlap(nx, ny, sz) [integer]

Determine the number of overlap longitudes given the x and y grid dimension (nx,ny) sizes as well as the total size of the transfer (sz)

Called from

ccc_esmf::find_regrid_id history::history_open restart::restart_create

subroutine com_cpl/idx2d_from_1d(ix, iy, addr, nx)

Calculate the x and y indicies of a 2D array in column-major order using nx …the size of the first dimension of the 2D array addr …the index in a 1D array corresponding with the sequential layout in memory of the 2D array.

Called from

print_var_stats_data_nwrds

function com_cpl/sprint_var_stats_data_nwrds(var_data, nwrds, name, pfx) [character(512)]

Return a string with min,max,avg (and possibly other stats) for a subset of an array.

Parameters
  • var_data :: Variable data to operate on

  • nwrds :: Number of elements to operate over

  • name :: The name of the variable

  • pfx :: String to prefix the output

Return

undefined :: Output string with statistics

Call to

print_var_stats_data_nwrds

function com_cpl/sprint_var_stats_data(var_data, name, pfx) [character(512)]

Return a string with min,max,avg (and possibly other stats) over the entire array.

Parameters
  • var_data :: Variable data to operate on

  • name :: The name of the variable

  • pfx :: String to prefix the output

Return

undefined :: Output string with statistics

Call to

print_var_stats_data_nwrds

subroutine com_cpl/print_var_stats_data(var_data, name, pfx, gavg)

Print min, max, and avg of an entire array to standard out.

Call to

print_var_stats_data_nwrds

subroutine com_cpl/print_var_stats_data_nwrds(var_data, nwrds, name, pfx, gavg, str_out)

Print min, max, and avg over a subset of an array to standard out.

Call to

err_exit fillvalue find_cpl_vinfo idx2d_from_1d

Called from

print_var_stats_data sprint_var_stats_data sprint_var_stats_data_nwrds

function com_cpl/is_special_op(name) [logical]

Identify non-transfer events by their name.

Called from

ccc_esmf::define_events

function com_cpl/filter_group_id(name, gid_in) [integer]

Reset the group ID for certain variable names that must always belong to a particular group.

Call to

atm_forcing_from_file atm_gid

Called from

cpl_main history::history_init field_ops::prepare_agcm_fields field_ops::prepare_nemo_fields atm_f_data::read_atm_forcing_data restart::restart_init field_ops::special_ops

subroutine com_cpl/copy_event_t(from, to)

Copy data between 2 event_t() data types. data types.

Called from

add_events_agcm_to_cpl add_events_cpl_to_agcm add_events_cpl_to_nemo add_events_nemo_to_cpl init_events_part1

subroutine com_cpl/print_event_t(event)

Print data from an event_t() data type. data type.

Called from

init_events_part1

subroutine com_cpl/copy_cpl_vinfo_t(from, to)

Copy data between 2 cpl_vinfo_t() data types. data types.

Called from

add_cpl_var define_cpl_var_list find_cpl_vinfo

subroutine com_cpl/print_cpl_vinfo_t(vinfo)

Print data from a cpl_vinfo_t() data type. data type.

Called from

add_cpl_var ccc_esmf::regrid_fieldbyname

subroutine com_cpl/define_cpl_var_list()

Define the list of all fields that may be coupled.

Call to

copy_cpl_vinfo_t cpl_var_list default_regrid err_exit nlat_a nlat_canom nlat_i nlat_o nlon_a nlon_canom nlon_i nlon_o olap_a olap_canom olap_i olap_o size_atm_grid size_canom_grid size_char_msg size_ice_grid size_ocn_grid

Called from

find_cpl_vinfo

subroutine com_cpl/add_cpl_var(new_var, exists)

Add an new entry to cpl_var_list.

Parameters
  • new_var :: [in] The new variable to be added; must be completely defined by the user

  • exists :: [in] Provides the user control over whether the existing variable info is used (exists=0), overwritten with info supplied by the user (exists=1) or the program aborts when there is a name conflict (exists=2)

Call to

copy_cpl_vinfo_t cpl_var_list err_exit print_cpl_vinfo_t

Called from

add_events_agcm_to_cpl regrid_mod::create_fractional_land_mask define_cpl_var_by_name ccc_esmf::define_regrid history::history_open history::register_hist_var regrid regrid_mod::test_grid

function com_cpl/cpl_var_name_exists(name) [logical]

Determine if a given variable name exists in cpl_var_list.

Call to

cpl_var_list

Called from

add_events_agcm_to_cpl history::history_get_field_data field_ops::prepare_nemo_fields

function com_cpl/cpl_var_new_tag(start_tag) [integer]

Find a tag value that is not currently used in cpl_var_list.

Call to

cpl_var_list err_exit

Called from

add_events_agcm_to_cpl regrid_mod::create_fractional_land_mask define_cpl_var_by_name ccc_esmf::define_regrid history::history_open history::register_hist_var regrid regrid_mod::test_grid

subroutine com_cpl/define_cpl_var_by_name(name, grid)

Define a cpl_vinfo_t() variable on a particular grid given the name of the field and the name of the grid. variable on a particular grid given the name of the field and the name of the grid.

Parameters
  • name :: [in] Name of the field

  • grid :: [in] Name of the grid associated with the field

Call to

add_cpl_var cpl_var_new_tag err_exit nlat_a nlat_o nlon_a nlon_o olap_a olap_o

Called from

history::history_get_field_data field_ops::prepare_nemo_fields

subroutine com_cpl/add_events_cpl_to_nemo(nrec, tmp_event)

Add fields to the event list that are sent coupler to NEMO.

Parameters
  • nrec :: nrec is the current number of variables defined in tmp_event

  • tmp_event :: The event list to be appended with cpl_to_nemo variables

Call to

copy_event_t cpl_ocn_freq err_exit nemo_n_recv_var nemo_recv_var

Called from

init_events_part1

subroutine com_cpl/add_events_cpl_to_agcm(nrec, tmp_event)

Add fields to the event list that are sent coupler to AGCM.

Parameters
  • nrec :: nrec is the current number of variables defined in tmp_event

  • tmp_event :: The event list to be appended with cpl_to_agcm variables

Call to

atm_n_recv_var atm_recv_var copy_event_t cpl_atm_freq err_exit

Called from

init_events_part1

subroutine com_cpl/add_events_nemo_to_cpl(nrec, tmp_event)

Add fields to the event list that are sent NEMO to coupler.

Parameters
  • nrec :: The current number of variables defined in tmp_event

  • tmp_event :: The event list to be appended with nemo to cpl variables

Call to

copy_event_t cpl_ocn_freq err_exit nemo_n_send_var nemo_send_var

Called from

init_events_part1

subroutine com_cpl/add_events_agcm_to_cpl(nrec, tmp_event)

Add fields to the event list that are sent AGCM to coupler.

Parameters
  • nrec :: nrec is the current number of variables defined in tmp_event

  • tmp_event :: The event list to be appended with agcm to cpl variables

Call to

add_cpl_var atm_n_send_var atm_send_var copy_event_t cpl_atm_freq cpl_var_name_exists cpl_var_new_tag err_exit nlat_a nlon_a olap_a size_atm_grid

Called from

init_events_part1

subroutine com_cpl/init_events_part1()

Initialize the default event list.

Call to

add_events_agcm_to_cpl add_events_cpl_to_agcm add_events_cpl_to_nemo add_events_nemo_to_cpl atm_master copy_event_t couple_serial coupler_parallel_type cpl_master cpl_var_list err_exit event find_cpl_vinfo nevents ocn_master print_event_t

Called from

find_cpl_vinfo

function com_cpl/is_coupled(name) [logical]

Determine if a given name is to be coupled (ie is on the event stack)

Parameters

name :: [in] The name of the variable (this name must be known to the coupler)

Call to

err_exit event nevents

function com_cpl/find_cpl_vinfo(name, tag, list_index, status) [type(cpl_vinfo_t)]

Return a cpl_vinfo_t() record from cpl_var_list that matches either the “name” or the “tag” element. record from cpl_var_list that matches either the “name” or the “tag” element.

Call to

atm_cv_lmask atm_delt atm_earth_radius atm_fland atm_forcing_from_file atm_grid_cell_area atm_gwt atm_kfinal atm_kount atm_kstart atm_ksteps atm_lat atm_lmask atm_lon atm_master atm_n_recv_var atm_n_send_var atm_nlat atm_nlon atm_recv_var atm_send_var com_mpi_initialized copy_cpl_vinfo_t couple_serial coupler_parallel_type cpl_atm_freq cpl_build_commit_id cpl_build_repo_path cpl_master cpl_ocn_freq cpl_runtime_commit cpl_runtime_repo_path cpl_time_string cpl_var_list curr_real_type curr_task define_cpl_var_list err_exit event group_info ice_master mpi_types_mod::id_atmosphere mpi_types_mod::id_coupler mpi_types_mod::id_ocean ierr init_events_part1 lowerc model_group_comm my_group nbuf nemo_build_cancpl_commit nemo_build_cancpl_repo_path nemo_commit nemo_config nemo_e1f nemo_e1t nemo_e1u nemo_e1v nemo_e2f nemo_e2t nemo_e2u nemo_e2v nemo_fmask nemo_glamf nemo_glamt nemo_glamu nemo_glamv nemo_gphif nemo_gphit nemo_gphiu nemo_gphiv nemo_jpiglo nemo_jpjglo nemo_n_recv_var nemo_n_send_var nemo_namsbc_cpl_cldes nemo_ncat nemo_nn_date0 nemo_nn_fsbc nemo_nn_ice nemo_nn_it000 nemo_nn_itend nemo_recv_var nemo_repo_path nemo_rn_rdt nemo_runtime_commit nemo_runtime_config nemo_runtime_repo_path nemo_send_var nemo_tmask nemo_umask nemo_vmask nevents nlat_a nlat_o nlon_a nlon_o ocn_master olap_a

Called from

cpl_main data_atm data_ice ccc_esmf::define_events init_events_part1 print_var_stats_data_nwrds history::register_hist_var ccc_esmf::regrid_field_cv ccc_esmf::regrid_fieldbyname ccc_esmf::store2array store::store_addstorage store::store_appendrecord_data store::store_appendrecord_data_and_ibuf store::store_initstorage