MOM6
mom_cap.F90 File Reference

Go to the source code of this file.

Data Types

type  mom_cap_mod::ocean_internalstate_type
 Internal state type with pointers to three types defined by MOM. More...
 
type  mom_cap_mod::ocean_internalstate_wrapper
 Wrapper-derived type required to associate an internal state instance with the ESMF/NUOPC component. More...
 
type  mom_cap_mod::fld_list_type
 Contains field information. More...
 

Modules

module  mom_cap_mod
 This module contains a set of subroutines that are required by NUOPC.
 

Functions/Subroutines

subroutine, public mom_cap_mod::setservices (gcomp, rc)
 NUOPC SetService method is the only public entry point. SetServices registers all of the user-provided subroutines in the module with the NUOPC layer. More...
 
subroutine mom_cap_mod::initializep0 (gcomp, importState, exportState, clock, rc)
 First initialize subroutine called by NUOPC. The purpose is to set which version of the Initialize Phase Definition (IPD) to use. More...
 
subroutine mom_cap_mod::initializeadvertise (gcomp, importState, exportState, clock, rc)
 Called by NUOPC to advertise import and export fields. "Advertise" simply means that the standard names of all import and export fields are supplied. The NUOPC layer uses these to match fields between components in the coupled system. More...
 
subroutine mom_cap_mod::initializerealize (gcomp, importState, exportState, clock, rc)
 Called by NUOPC to realize import and export fields. "Realizing" a field means that its grid has been defined and an ESMF_Field object has been created and put into the import or export State. More...
 
subroutine mom_cap_mod::datainitialize (gcomp, rc)
 TODO. More...
 
subroutine mom_cap_mod::modeladvance (gcomp, rc)
 Called by NUOPC to advance the model a single timestep. More...
 
subroutine mom_cap_mod::modelsetrunclock (gcomp, rc)
 
subroutine mom_cap_mod::ocean_model_finalize (gcomp, rc)
 Called by NUOPC at the end of the run to clean up. More...
 
subroutine mom_cap_mod::state_setscalar (value, scalar_id, State, mytask, scalar_name, scalar_count, rc)
 Set scalar data from state for a particula name. More...
 
subroutine mom_cap_mod::mom_realizefields (state, nfields, field_defs, tag, grid, mesh, rc)
 Realize the import and export fields using either a grid or a mesh. More...
 
subroutine setscalarfield (field, rc)
 
subroutine mom_cap_mod::fld_list_add (num, fldlist, stdname, transferOffer, shortname)
 Set up list of field information. More...
 
subroutine mom_cap_mod::shr_file_setlogunit (nunit)
 
subroutine mom_cap_mod::shr_file_getlogunit (nunit)
 

Variables

integer, parameter mom_cap_mod::fldsmax = 100
 
integer mom_cap_mod::fldstoocn_num = 0
 
type(fld_list_type), dimension(fldsmax) mom_cap_mod::fldstoocn
 
integer mom_cap_mod::fldsfrocn_num = 0
 
type(fld_list_type), dimension(fldsmax) mom_cap_mod::fldsfrocn
 
integer mom_cap_mod::debug = 0
 
integer mom_cap_mod::import_slice = 1
 
integer mom_cap_mod::export_slice = 1
 
character(len=256) mom_cap_mod::tmpstr
 
logical mom_cap_mod::write_diagnostics = .false.
 
logical mom_cap_mod::overwrite_timeslice = .false.
 
character(len=32) mom_cap_mod::runtype
 run type More...
 
integer mom_cap_mod::logunit
 stdout logging unit number More...
 
logical mom_cap_mod::profile_memory = .true.
 
logical mom_cap_mod::grid_attach_area = .false.
 
character(len=128) mom_cap_mod::scalar_field_name = ''
 
integer mom_cap_mod::scalar_field_count = 0
 
integer mom_cap_mod::scalar_field_idx_grid_nx = 0
 
integer mom_cap_mod::scalar_field_idx_grid_ny = 0
 
character(len= *), parameter mom_cap_mod::u_file_u = __FILE__
 
logical mom_cap_mod::cesm_coupled = .false.
 
type(esmf_geomtype_flag) mom_cap_mod::geomtype = ESMF_GEOMTYPE_GRID
 

Function/Subroutine Documentation

◆ setscalarfield()

subroutine mom_realizefields::setscalarfield ( type(esmf_field), intent(inout)  field,
integer, intent(inout)  rc 
)
private

Definition at line 2251 of file mom_cap.F90.

2251 
2252  ! create a field with scalar data on the root pe
2253  type(ESMF_Field), intent(inout) :: field
2254  integer, intent(inout) :: rc
2255 
2256  ! local variables
2257  type(ESMF_Distgrid) :: distgrid
2258  type(ESMF_Grid) :: grid
2259  character(len=*), parameter :: subname='(MOM_cap:SetScalarField)'
2260 
2261  rc = esmf_success
2262 
2263  ! create a DistGrid with a single index space element, which gets mapped onto DE 0.
2264  distgrid = esmf_distgridcreate(minindex=(/1/), maxindex=(/1/), rc=rc)
2265  if (esmf_logfounderror(rctocheck=rc, msg=esmf_logerr_passthru, &
2266  line=__line__, &
2267  file=__file__)) &
2268  return ! bail out
2269 
2270  grid = esmf_gridcreate(distgrid, rc=rc)
2271  if (esmf_logfounderror(rctocheck=rc, msg=esmf_logerr_passthru, &
2272  line=__line__, &
2273  file=__file__)) &
2274  return ! bail out
2275 
2276  ! num of scalar values
2277  field = esmf_fieldcreate(name=trim(scalar_field_name), grid=grid, typekind=esmf_typekind_r8, &
2278  ungriddedlbound=(/1/), ungriddedubound=(/scalar_field_count/), gridtofieldmap=(/2/), rc=rc)
2279  if (esmf_logfounderror(rctocheck=rc, msg=esmf_logerr_passthru, &
2280  line=__line__, &
2281  file=__file__)) &
2282  return ! bail out
2283 

References mom_cap_mod::scalar_field_count, and mom_cap_mod::scalar_field_name.

Referenced by mom_cap_mod::mom_realizefields().

Here is the caller graph for this function: