ESMF_GeomCreateGrid Function

private function ESMF_GeomCreateGrid(grid, staggerloc, rc)

Arguments

Type IntentOptional Attributes Name
type(ESMF_Grid), intent(in) :: grid
type(ESMF_StaggerLoc), intent(in), optional :: staggerloc
integer, intent(out), optional :: rc

Return Value type(ESMF_Geom)


Calls

proc~~esmf_geomcreategrid~~CallsGraph proc~esmf_geomcreategrid ESMF_GeomCreateGrid proc~esmf_gridgetinit ESMF_GridGetInit proc~esmf_geomcreategrid->proc~esmf_gridgetinit proc~esmf_imerr ESMF_IMErr proc~esmf_geomcreategrid->proc~esmf_imerr proc~esmf_logfoundallocerror ESMF_LogFoundAllocError proc~esmf_geomcreategrid->proc~esmf_logfoundallocerror proc~esmf_initcheckdeep ESMF_InitCheckDeep proc~esmf_imerr->proc~esmf_initcheckdeep proc~esmf_logfounderror ESMF_LogFoundError proc~esmf_imerr->proc~esmf_logfounderror esmf_breakpoint esmf_breakpoint proc~esmf_logfoundallocerror->esmf_breakpoint proc~esmf_logrc2msg ESMF_LogRc2Msg proc~esmf_logfoundallocerror->proc~esmf_logrc2msg proc~esmf_logwrite ESMF_LogWrite proc~esmf_logfoundallocerror->proc~esmf_logwrite proc~esmf_logfounderror->esmf_breakpoint proc~esmf_logfounderror->proc~esmf_logrc2msg proc~esmf_logfounderror->proc~esmf_logwrite c_esmc_loggeterrormsg c_esmc_loggeterrormsg proc~esmf_logrc2msg->c_esmc_loggeterrormsg c_esmc_vmwtime c_esmc_vmwtime proc~esmf_logwrite->c_esmc_vmwtime proc~esmf_logclose ESMF_LogClose proc~esmf_logwrite->proc~esmf_logclose proc~esmf_logflush ESMF_LogFlush proc~esmf_logwrite->proc~esmf_logflush proc~esmf_logopenfile ESMF_LogOpenFile proc~esmf_logwrite->proc~esmf_logopenfile proc~esmf_utiliounitflush ESMF_UtilIOUnitFlush proc~esmf_logwrite->proc~esmf_utiliounitflush proc~esmf_utilstring2array ESMF_UtilString2Array proc~esmf_logwrite->proc~esmf_utilstring2array proc~esmf_logclose->proc~esmf_logflush proc~esmf_logflush->proc~esmf_utiliounitflush proc~esmf_utilarray2string ESMF_UtilArray2String proc~esmf_logflush->proc~esmf_utilarray2string proc~esmf_logopenfile->proc~esmf_utiliounitflush proc~esmf_utiliounitget ESMF_UtilIOUnitGet proc~esmf_logopenfile->proc~esmf_utiliounitget

Called by

proc~~esmf_geomcreategrid~~CalledByGraph proc~esmf_geomcreategrid ESMF_GeomCreateGrid interface~esmf_geomcreate ESMF_GeomCreate interface~esmf_geomcreate->proc~esmf_geomcreategrid proc~esmf_gridgetfieldbounds ESMF_GridGetFieldBounds proc~esmf_gridgetfieldbounds->interface~esmf_geomcreate proc~esmf_locstreamgetfieldbounds ESMF_LocStreamGetFieldBounds proc~esmf_locstreamgetfieldbounds->interface~esmf_geomcreate proc~esmf_meshgetfieldbounds ESMF_MeshGetFieldBounds proc~esmf_meshgetfieldbounds->interface~esmf_geomcreate proc~esmf_xgridgetfieldbounds ESMF_XGridGetFieldBounds proc~esmf_xgridgetfieldbounds->interface~esmf_geomcreate proc~test_comp_geom test_comp_geom proc~test_comp_geom->interface~esmf_geomcreate proc~test_geom test_geom proc~test_geom->interface~esmf_geomcreate proc~test_geom_comp_tkr test_geom_comp_tkr proc~test_geom_comp_tkr->interface~esmf_geomcreate proc~test_geom_tkr test_geom_tkr proc~test_geom_tkr->interface~esmf_geomcreate program~esmf_geomutest ESMF_GeomUTest program~esmf_geomutest->interface~esmf_geomcreate program~esmf_infodescribeutest ESMF_InfoDescribeUTest program~esmf_infodescribeutest->interface~esmf_geomcreate

Source Code

      function ESMF_GeomCreateGrid(grid,staggerloc, rc)
!
! !RETURN VALUE:
      type(ESMF_Geom) :: ESMF_GeomCreateGrid
!
! !ARGUMENTS:
       type(ESMF_Grid),       intent(in)             :: grid
       type(ESMF_StaggerLoc), intent(in), optional   :: staggerloc
       integer,               intent(out), optional  :: rc
!
! !DESCRIPTION:
! Create an {\tt ESMF\_Geom} object from an {\tt ESMF\_Grid} object.
!
! The arguments are:
! \begin{description}
! \item[grid]
!      {\tt ESMF\_Grid} object from which to create the Geom.
! \item [{[staggerloc]}]
!       Stagger location of data in grid cells.  For valid
!       predefined values see section \ref{const:staggerloc}.
!       If not specified, defaults to {\tt ESMF\_STAGGERLOC\_CENTER}.
! \item[{[rc]}]
!      Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
! \end{description}
!
!EOP
    type(ESMF_GeomClass),pointer :: gbcp
    type(ESMF_StaggerLoc)  :: localStaggerLoc
    integer :: localrc ! local error status

    ! Initialize return code; assume failure until success is certain
    localrc = ESMF_RC_NOT_IMPL
    if (present(rc)) rc = ESMF_RC_NOT_IMPL
       
    ! Check init status of arguments
    ESMF_INIT_CHECK_DEEP_SHORT(ESMF_GridGetInit, grid, rc)

    ! Set default staggerloc
    if (present(staggerloc)) then   
       localStaggerloc=staggerloc
    else
       localStaggerLoc = ESMF_STAGGERLOC_CENTER
    endif


    ! initialize pointers
    nullify(gbcp)
    nullify(ESMF_GeomCreateGrid%gbcp)

    ! allocate Geom type
    allocate(gbcp, stat=localrc)
    if (ESMF_LogFoundAllocError(localrc, msg="Allocating Geom type object", &
                                     ESMF_CONTEXT, rcToReturn=rc)) return

    ! Set values in Geom
    gbcp%type = ESMF_GEOMTYPE_GRID
    gbcp%grid = grid
    gbcp%staggerloc = localStaggerloc

    ! Set Geom Type into Geom
     ESMF_GeomCreateGrid%gbcp=>gbcp

    ! Set init status
    ESMF_INIT_SET_CREATED(ESMF_GeomCreateGrid)

    ! Return successfully
    if (present(rc)) rc = ESMF_SUCCESS

    end function ESMF_GeomCreateGrid