ccc_esmf module reference¶
CCCma specific routines that use ESMF procedures.
Data Types¶
Define the grid of the coupler. |
|
Hold all values needed to define a transformation from one grid to another. |
Functions/Subroutines¶
Extract 1D lon coordinate values from the atm grid definition. |
|
Extract 1D lat coordinate values from the atm grid definition. |
|
Extract the 2D lon coordinate values from the atm grid definition. |
|
Extract the 2D lat coordinate values from the atm grid definition. |
|
Extract the 2D lon coordinate values from the ocn grid definition. |
|
Extract the 2D lat coordinate values from the ocn grid definition. |
|
Extract the 2D mask values from the ocn grid definition. |
|
Extract the 2D area values from the ocn grid definition. |
|
Extract 2D integer*4 coordinate values from a defined grid. |
|
Extract 2D integer*4 coordinate values from a defined grid. |
|
Extract 2D real*4 coordinate values from a defined grid. |
|
Extract 2D real*8 coordinate values from a defined grid. |
|
Extract mask or area values from a defined grid. |
|
Create a netcdf file containing AGCM grid information. |
|
Create a netcd file containing NEMO grid information This will contain the coordinate, mask and cell area data that is available at run time. |
|
Read coordinate information from a netcdf file containing AGCM grid data that was created by create_atm_grid_file. |
|
Read coordinate information from a netcd file containing NEMO grid data that was created by create_ocn_grid_file. |
|
Copy one |
|
Error handling for ESMF routines. |
|
Return a string containing time on a given clock. |
|
Initialize ESMF. |
|
Allocate and assign the global event array. |
|
Allocate and assign the global alarm array. |
|
Append an entry to regrid_list. |
|
Copy one |
|
Print elements of |
|
Find the first regrid ID in regrid_list that matches the input. |
|
Evaluate source and destination global areas for this regrid operation. |
|
Create a route handle for a particular regrid operation. |
|
Wrapper for a conservative, fracarea remap. |
|
Regrid one field onto another field NOTE: dst_field will always be reallocated to be the size of dst_name. |
|
Regrid one field onto another field using the specifed route handle. |
|
Calculate the global integral and average for field given the regrid ID Note that ESMF_Field contains a pointer to an ESMF_FieldType class so that passing an ESMF_Field effectively passes a pointer (ie not data) |
|
Find the grid ID given a grid name and, optionally, a mask If no initialized grid is found then return grid ID = 0 unless the grid name is one of atm, ocn, canom (in which case we abort) |
|
Given a grid ID return the associated grid description file name. |
|
Create grid objects from SCRIP format grid description files. |
|
Add a grid object using info from a grid description file. |
|
Define a grid object using data read from a grid description file. |
|
Compute grid cell area using ESMF_FieldRegridGetArea. |
|
Determine if all relevant AGCM grid information is available in memory. |
|
Define a grid object using internal AGCM coordinate and mask data. |
|
Determine if all relevant NEMO grid information is available in memory. |
|
Define a grid object using internal NEMO coordinate and mask data. |
|
Print info about a particular grid. |
|
Given a storage record, return a pointer to an ESMF array containing data from the storage record. |
|
Detailed Description¶
CCCma specific routines that use ESMF procedures.
Type Documentation¶
-
type
ccc_esmf/cpl_grid_t¶ Define the grid of the coupler.
- Type fields
%title[character(128)]%file_name[character(128)]%nx[integer]%ny[integer]%size[integer]%integer(2 edges [2)%mask[integer(esmf_kind_i4)(:,:),pointer]%grid[type(esmf_grid),pointer]
-
type
ccc_esmf/regrid_t¶ Hold all values needed to define a transformation from one grid to another.
- Type fields
%regrid_id[integer]%src_grid_id[integer]%dst_grid_id[integer]%use_src_mask[logical]%use_dst_mask[logical]%regrid_method[character(32)]%norm_type[character(32)]%line_type[character(32)]%src_grid_name[character(128)]%dst_grid_name[character(128)]%src_grid_file_name[character(128)]%dst_grid_file_name[character(128)]%wgt_grid_file_name[character(128)]%src_mask_values[integer(esmf_kind_i)(:),pointer]%dst_mask_values[integer(esmf_kind_i)(:),pointer]%src_frac[real(esmf_kind_r8)(:,:),pointer]%dst_frac[real(esmf_kind_r8)(:,:),pointer]%src_area[real(esmf_kind_r8)(:,:),pointer]%dst_area[real(esmf_kind_r8)(:,:),pointer]%rh[type(esmf_routehandle),pointer]
Function/Subroutine Documentation¶
-
subroutine
ccc_esmf/get_atm_lon_1d(atm_lon, overlap)¶ Extract 1D lon coordinate values from the atm grid definition.
- Parameters
atm_lon :: Atmospheric longitudes at the T-point
overlap :: [in] How many cells overlap in the zonal directions
- Call to
id_atm_gridcom_cpl::nlon_acom_cpl::olap_a- Called from
-
subroutine
ccc_esmf/get_atm_lat_1d(atm_lat)¶ Extract 1D lat coordinate values from the atm grid definition.
- Call to
id_atm_grid- Called from
-
subroutine
ccc_esmf/get_atm_lon(atm_lon, overlap)¶ Extract the 2D lon coordinate values from the atm grid definition.
- Call to
id_atm_gridcom_cpl::nlat_acom_cpl::nlon_acom_cpl::olap_a- Called from
-
subroutine
ccc_esmf/get_atm_lat(atm_lat, overlap)¶ Extract the 2D lat coordinate values from the atm grid definition.
- Call to
id_atm_gridcom_cpl::nlat_acom_cpl::nlon_acom_cpl::olap_a- Called from
-
subroutine
ccc_esmf/get_ocn_lon(ocn_lon, overlap)¶ Extract the 2D lon coordinate values from the ocn grid definition.
- Call to
id_ocn_gridcom_cpl::nlat_ocom_cpl::nlon_o- Called from
-
subroutine
ccc_esmf/get_ocn_lat(ocn_lat, overlap)¶ Extract the 2D lat coordinate values from the ocn grid definition.
- Call to
id_ocn_gridcom_cpl::nlat_ocom_cpl::nlon_o- Called from
-
subroutine
ccc_esmf/get_ocn_mask(ocn_mask, overlap)¶ Extract the 2D mask values from the ocn grid definition.
- Call to
get_grid_itemid_ocn_gridcom_cpl::nlat_ocom_cpl::nlon_o- Called from
-
subroutine
ccc_esmf/get_ocn_area(ocn_area, overlap)¶ Extract the 2D area values from the ocn grid definition.
- Call to
get_grid_itemid_ocn_gridcom_cpl::nlat_ocom_cpl::nlon_o
-
subroutine
ccc_esmf/get_grid_coord_2di4(coord, gridID, stagger, cdim)¶ Extract 2D integer*4 coordinate values from a defined grid.
- Call to
-
subroutine
ccc_esmf/get_grid_coord_2di8(coord, gridID, stagger, cdim)¶ Extract 2D integer*4 coordinate values from a defined grid.
- Call to
-
subroutine
ccc_esmf/get_grid_coord_2dr4(coord, gridID, stagger, cdim)¶ Extract 2D real*4 coordinate values from a defined grid.
- Call to
-
subroutine
ccc_esmf/get_grid_coord_2dr8(coord, gridID, stagger, cdim)¶ Extract 2D real*8 coordinate values from a defined grid.
- Call to
grid_listhandle_esmf_errcom_cpl::lowercn_grid_listzero- Called from
-
subroutine
ccc_esmf/get_grid_item(item_data, gridID, stagger, item)¶ Extract mask or area values from a defined grid.
- Call to
grid_listhandle_esmf_errcom_cpl::lowercn_grid_list- Called from
check_remap_global_sumcreate_atm_grid_filecreate_ocn_grid_fileget_ocn_areaget_ocn_mask
-
subroutine
ccc_esmf/create_atm_grid_file(fname)¶ Create a netcdf file containing AGCM grid information. This will contain the coordinate, fractional land mask and cell area data that is available at run time.
- Call to
com_cpl::atm_earth_radiuscom_cpl::atm_flandcom_cpl::atm_grid_cell_areacom_cpl::atm_gwtcom_cpl::atm_latcom_cpl::atm_longet_grid_itemid_atm_grid- Called from
cpl_main
-
subroutine
ccc_esmf/create_ocn_grid_file(fname)¶ Create a netcd file containing NEMO grid information This will contain the coordinate, mask and cell area data that is available at run time.
- Call to
com_cpl::atm_earth_radiusget_grid_itemget_ocn_maskid_ocn_gridcom_cpl::nemo_e1tcom_cpl::nemo_e2tcom_cpl::nemo_glamfcom_cpl::nemo_glamtcom_cpl::nemo_gphifcom_cpl::nemo_gphitcom_cpl::nemo_jpiglocom_cpl::nemo_jpjglocom_cpl::nemo_tmask- Called from
cpl_main
-
subroutine
ccc_esmf/read_atm_grid_file(fname)¶ Read coordinate information from a netcdf file containing AGCM grid data that was created by create_atm_grid_file.
- Call to
com_cpl::atm_earth_radiuscom_cpl::atm_flandcom_cpl::atm_grid_cell_areacom_cpl::atm_gwtcom_cpl::atm_latcom_cpl::atm_loncom_cpl::atm_nlatcom_cpl::atm_nloncom_cpl::msg- Called from
-
subroutine
ccc_esmf/read_ocn_grid_file(fname)¶ Read coordinate information from a netcd file containing NEMO grid data that was created by create_ocn_grid_file.
- Call to
com_cpl::atm_earth_radiuscom_cpl::msgcom_cpl::nemo_e1tcom_cpl::nemo_e2tcom_cpl::nemo_glamfcom_cpl::nemo_glamtcom_cpl::nemo_gphifcom_cpl::nemo_gphitcom_cpl::nemo_jpiglocom_cpl::nemo_jpjglocom_cpl::nemo_tmask- Called from
-
subroutine
ccc_esmf/copy_cpl_grid_t(in, out)¶ Copy one
cpl_grid_t()variable to another variable to anothercpl_grid_t()variable. variable.
-
subroutine
ccc_esmf/handle_esmf_err(rc, txt, line, method)¶ Error handling for ESMF routines.
- Call to
default_log_filecom_cpl::msg- Called from
calc_global_integralcompute_grid_areacpl_maindefine_grid_from_agcm_coordsdefine_grid_from_filedefine_grid_from_nemo_coordsdefine_regridget_grid_coord_2dr8get_grid_itemget_time_stringhistory::history_writeinit_esmfprint_grid_inforegrid_fieldbyidset_alarmsregrid_mod::test_grid
-
function
ccc_esmf/get_time_string(this_clock, time_type) [character(len=32)]¶ Return a string containing time on a given clock.
- Call to
- Called from
cpl_mainexecute_event
-
subroutine
ccc_esmf/init_esmf(mpi_group, logname)¶ Initialize ESMF.
- Call to
default_log_filehandle_esmf_err- Called from
cpl_main
-
subroutine
ccc_esmf/define_events()¶ Allocate and assign the global event array. This will define the set of events the coupler will handle.
- Call to
com_cpl::atm_gidcom_cpl::atm_mastercom_cpl::canom_gidcom_cpl::cpl_mastercom_cpl::eventcom_cpl::find_cpl_vinfocom_cpl::ice_gidcom_cpl::ice_mastercom_cpl::is_special_opcom_cpl::lowerccom_cpl::msg_gidcom_cpl::neventscom_cpl::ocn_gidcom_cpl::ocn_mastercom_cpl::other_gidcom_cpl::uniq_namesverbose- Called from
cpl_main
-
subroutine
ccc_esmf/set_alarms(this_clock, start_time)¶ Allocate and assign the global alarm array. Associate alarms with events.
- Call to
alarmcom_cpl::eventhandle_esmf_errcom_cpl::neventsverbose- Called from
cpl_main
-
function
ccc_esmf/append_regrid_list(new_regrid) [integer]¶ Append an entry to regrid_list.
- Call to
copy_regrid_tmax_regrid_listn_regrid_listregrid_list- Called from
-
subroutine
ccc_esmf/copy_regrid_t(regrid_in, regrid_out)¶ Copy one
regrid_t()to another. to another.- Called from
-
subroutine
ccc_esmf/print_regrid_t(rid)¶ Print elements of
regrid_t(). .- Called from
-
subroutine
ccc_esmf/find_regrid_id(id, src_grid_name, dst_grid_name, regrid_method, use_src_mask, use_dst_mask, src_mask_values, dst_mask_values, src_grid_id, dst_grid_id, norm_type, line_type, create)¶ Find the first regrid ID in regrid_list that matches the input. Optionally generate weights for a new regrid ID if an existing regrid ID is not found.
- Call to
append_regrid_listcom_cpl::atm_flandcom_cpl::atm_latcom_cpl::atm_loncheck_remap_global_sumcpl_griddefine_regridfind_grid_idget_atm_lat_1dget_atm_lon_1dgrid_desc_file_nameid_atm_gridid_ocn_gridcom_cpl::landfrac_bugn_grid_listn_regrid_listcom_cpl::overlapprint_regrid_tregrid_list- Called from
-
subroutine
ccc_esmf/check_remap_global_sum(regridID)¶ Evaluate source and destination global areas for this regrid operation.
- Call to
compute_grid_areaget_grid_itemid_atm_gridid_ocn_gridn_regrid_listregrid_list- Called from
-
subroutine
ccc_esmf/define_regrid(id_regrid, use_src_mask, use_dst_mask, ignore_unmapped)¶ Create a route handle for a particular regrid operation. This route handle will be associated with the id_regrid index of the global array regrid_rh_list(:)
- Call to
com_cpl::add_cpl_varcpl_gridcom_cpl::cpl_var_new_tagesmf_regridmethod_conserve_2ndccc_netcdf::grid_desc_file_typegrid_listhandle_esmf_erris_conservativen_regrid_listonecom_cpl::other_gidccc_netcdf::read_nemo_mesh_mask_fileccc_netcdf::read_scrip_grid_fileregrid_listregrid_rh_liststore::store_listrecordt_esmftwoverbose- Called from
-
subroutine
ccc_esmf/regrid_field_cv(src_name, src_data, dst_name, dst_data, alt_name)¶ Wrapper for a conservative, fracarea remap.
- Call to
- Called from
-
subroutine
ccc_esmf/regrid_fieldbyname(src_name, src_data, dst_name, dst_data, regridID, src_gavg, dst_gavg, src_grid_id, dst_grid_id, src_fld_name, dst_fld_name, method, norm_type, line_type, renormalize_destarea, use_src_mask, use_dst_mask, src_mask_values, dst_mask_values, missing_value)¶ Regrid one field onto another field NOTE: dst_field will always be reallocated to be the size of dst_name.
- Call to
com_cpl::find_cpl_vinfofind_grid_idfind_regrid_idn_grid_listcom_cpl::print_cpl_vinfo_tregrid_fieldbyidverbose
-
subroutine
ccc_esmf/regrid_fieldbyid(id_regrid, src_olap, dst_olap, wrk, missing_value, renormalize_destarea, src_fld_name, dst_fld_name, src_gavg, dst_gavg)¶ Regrid one field onto another field using the specifed route handle.
- Call to
calc_global_integralcom_cpl::fillvaluegrid_listhandle_esmf_errn_regrid_listregrid_listregrid_rh_listt_esmfverbose- Called from
-
function
ccc_esmf/calc_global_integral(field_in, regridID, src_or_dst, mode, gsum) [real(esmf_kind_r8)]¶ Calculate the global integral and average for field given the regrid ID Note that ESMF_Field contains a pointer to an ESMF_FieldType class so that passing an ESMF_Field effectively passes a pointer (ie not data)
- Call to
handle_esmf_errn_regrid_listregrid_list- Called from
-
function
ccc_esmf/find_grid_id(grid_name, imask) [integer]¶ Find the grid ID given a grid name and, optionally, a mask If no initialized grid is found then return grid ID = 0 unless the grid name is one of atm, ocn, canom (in which case we abort)
- Call to
cpl_gridgrid_desc_file_nameid_atm_gridid_canom4_gridid_ocn_grid- Called from
-
function
ccc_esmf/grid_desc_file_name(grid_id, sfx, fid) [character(128)]¶ Given a grid ID return the associated grid description file name.
- Call to
cpl_gridn_grid_list- Called from
define_grid_from_agcm_coordsdefine_grid_from_filedefine_grid_from_nemo_coordsfind_grid_idfind_regrid_id
-
subroutine
ccc_esmf/init_grids()¶ Create grid objects from SCRIP format grid description files.
- Call to
com_cpl::atm_grid_desccom_cpl::canom4_grid_desccpl_griddefine_grid_from_agcm_coordsdefine_grid_from_filedefine_grid_from_nemo_coordsgrid_listcom_cpl::ice_grid_descid_atm_gridid_canom4_gridid_ice_gridid_ocn_gridmax_grid_listn_grid_listcom_cpl::ocn_grid_descprint_grid_infoverbose- Called from
cpl_main
-
subroutine
ccc_esmf/add_grid(grid_id, grid_desc_file, imask, overlap, cartesian, grid_dims, grid_edges, grid_size)¶ Add a grid object using info from a grid description file.
- Call to
cpl_griddefine_grid_from_filefind_grid_idgrid_listmax_grid_listn_grid_listprint_grid_infoverbose- Called from
-
subroutine
ccc_esmf/define_grid_from_file(grid_id, file_name, imask, use_mask, overlap, grid_dims, grid_edges, grid_size, cartesian)¶ Define a grid object using data read from a grid description file.
- Call to
com_cpl::agcm_grid_area_filecom_cpl::atm_grid_cell_areacpl_gridcpl_petcountgrid_desc_file_nameccc_netcdf::grid_desc_file_typegrid_listhandle_esmf_errid_atm_gridid_ocn_gridccc_io::locate_filen_grid_listcom_cpl::nemo_mesh_mask_filecom_cpl::ocn_grid_cell_areaoneccc_netcdf::read_agcm_grid_area_fileccc_netcdf::read_nemo_mesh_mask_fileccc_netcdf::read_scrip_grid_filetwoverbosezero- Called from
-
subroutine
ccc_esmf/compute_grid_area(gridID, area)¶ Compute grid cell area using ESMF_FieldRegridGetArea. Given a grid ID (ie index into the global grid_list (rray) compute grid cell area for the grid defined at that index.
- Call to
grid_listhandle_esmf_err- Called from
check_remap_global_sumdefine_grid_from_agcm_coordsdefine_grid_from_nemo_coords
-
function
ccc_esmf/agcm_coords_available() [logical]¶ Determine if all relevant AGCM grid information is available in memory. If the AGCM is coupled, this infomation is passed from the AGCM to the coupler at runtime. If it is not then this information is read from a file named cplrs_atm_grid.nc which is saved in the coupler restart. The following required variables are found in the module cpl_com atm_lon, atm_lat, atm_gwt, atm_grid_cell_area, atm_nlon, atm_nlat atm_earth_radius.
- Call to
com_cpl::atm_earth_radiuscom_cpl::atm_grid_cell_areacom_cpl::atm_gwtcom_cpl::atm_latcom_cpl::atm_loncom_cpl::atm_nlatcom_cpl::atm_nlon- Called from
-
subroutine
ccc_esmf/define_grid_from_agcm_coords(grid_id)¶ Define a grid object using internal AGCM coordinate and mask data. This information is passed to the coupler from the AGCM at run time.
- Call to
agcm_coords_availablecom_cpl::atm_earth_radiuscom_cpl::atm_grid_cell_areacom_cpl::atm_gwtcom_cpl::atm_latcom_cpl::atm_loncom_cpl::atm_nlatcom_cpl::atm_nloncompute_grid_areacpl_gridcpl_petcountgrid_desc_file_namegrid_listhandle_esmf_errn_grid_listonerad2degread_atm_grid_filetwoverbosezero- Called from
-
function
ccc_esmf/nemo_coords_available() [logical]¶ Determine if all relevant NEMO grid information is available in memory. If NEMO is coupled, this infomation is passed from NEMO to the coupler at runtime. If it is not then this information is read from a file named cplrs_ocn_grid.nc which is saved in the coupler restart. The following required variables are found in the module cpl_com nemo_glamt, nemo_gphit, nemo_glamf, nemo_gphif, nemo_tmask, nemo_e1t, nemo_e2t.
- Call to
com_cpl::nemo_e1tcom_cpl::nemo_e2tcom_cpl::nemo_glamfcom_cpl::nemo_glamtcom_cpl::nemo_gphifcom_cpl::nemo_gphitcom_cpl::nemo_tmask- Called from
-
subroutine
ccc_esmf/define_grid_from_nemo_coords(grid_id)¶ Define a grid object using internal NEMO coordinate and mask data. This information is passed to the coupler from NEMO at run time.
- Call to
com_cpl::atm_earth_radiuscompute_grid_areacpl_gridcpl_petcountgrid_desc_file_namegrid_listhandle_esmf_errccc_netcdf::mm_corner_latccc_netcdf::mm_corner_lonn_grid_listnemo_coords_availablecom_cpl::nemo_e1tcom_cpl::nemo_e2tcom_cpl::nemo_glamfcom_cpl::nemo_glamtcom_cpl::nemo_gphifcom_cpl::nemo_gphitcom_cpl::nemo_tmaskcom_cpl::ocn_grid_cell_areaoneread_ocn_grid_filetwoverbosezero- Called from
-
subroutine
ccc_esmf/print_grid_info(this_grid)¶ Print info about a particular grid.
- Call to
handle_esmf_erronetwoverbose- Called from
-
function
ccc_esmf/store2array(rec_ptr) [type(esmf_array)]¶ Given a storage record, return a pointer to an ESMF array containing data from the storage record.
- Call to
-
function
ccc_esmf/is_conservative(esmf_regrid_method) [logical]¶ - Parameters
esmf_regrid_method :: The regrid method to be requested in ESMF
- Call to
esmf_regridmethod_conserve_2nd- Called from