ESMF_GridAddItemNoValues Subroutine

private subroutine ESMF_GridAddItemNoValues(grid, itemflag, keywordEnforcer, staggerloc, itemTypeKind, staggerEdgeLWidth, staggerEdgeUWidth, staggerAlign, staggerLBound, rc)

Arguments

Type IntentOptional Attributes Name
type(ESMF_Grid), intent(in) :: grid
type(ESMF_GridItem_Flag), intent(in) :: itemflag
type(ESMF_KeywordEnforcer), optional :: keywordEnforcer
type(ESMF_StaggerLoc), intent(in), optional :: staggerloc
type(ESMF_TypeKind_Flag), intent(in), optional :: itemTypeKind
integer, intent(in), optional :: staggerEdgeLWidth(:)
integer, intent(in), optional :: staggerEdgeUWidth(:)
integer, intent(in), optional :: staggerAlign(:)
integer, intent(in), optional :: staggerLBound(:)
integer, intent(out), optional :: rc

Calls

proc~~esmf_gridadditemnovalues~~CallsGraph proc~esmf_gridadditemnovalues ESMF_GridAddItemNoValues c_esmc_gridadditem c_esmc_gridadditem proc~esmf_gridadditemnovalues->c_esmc_gridadditem c_esmc_gridadditemarb c_esmc_gridadditemarb proc~esmf_gridadditemnovalues->c_esmc_gridadditemarb interface~esmf_interarraycreate ESMF_InterArrayCreate proc~esmf_gridadditemnovalues->interface~esmf_interarraycreate proc~esmf_gridgetdecomptype ESMF_GridGetDecompType proc~esmf_gridadditemnovalues->proc~esmf_gridgetdecomptype proc~esmf_gridgetinit ESMF_GridGetInit proc~esmf_gridadditemnovalues->proc~esmf_gridgetinit proc~esmf_imerr ESMF_IMErr proc~esmf_gridadditemnovalues->proc~esmf_imerr proc~esmf_interarraydestroy ESMF_InterArrayDestroy proc~esmf_gridadditemnovalues->proc~esmf_interarraydestroy proc~esmf_logfounderror ESMF_LogFoundError proc~esmf_gridadditemnovalues->proc~esmf_logfounderror proc~esmf_logseterror ESMF_LogSetError proc~esmf_gridadditemnovalues->proc~esmf_logseterror proc~esmf_interarraycreateptr ESMF_InterArrayCreatePtr interface~esmf_interarraycreate->proc~esmf_interarraycreateptr proc~esmf_interarraycreatetrg ESMF_InterArrayCreateTrg interface~esmf_interarraycreate->proc~esmf_interarraycreatetrg proc~esmf_gridgetdecomptype->proc~esmf_logfounderror c_esmc_gridgetdecomptype c_esmc_gridgetdecomptype proc~esmf_gridgetdecomptype->c_esmc_gridgetdecomptype proc~esmf_imerr->proc~esmf_logfounderror proc~esmf_initcheckdeep ESMF_InitCheckDeep proc~esmf_imerr->proc~esmf_initcheckdeep proc~esmf_logfounddeallocerror ESMF_LogFoundDeallocError proc~esmf_interarraydestroy->proc~esmf_logfounddeallocerror esmf_breakpoint esmf_breakpoint proc~esmf_logfounderror->esmf_breakpoint proc~esmf_logrc2msg ESMF_LogRc2Msg proc~esmf_logfounderror->proc~esmf_logrc2msg proc~esmf_logwrite ESMF_LogWrite proc~esmf_logfounderror->proc~esmf_logwrite proc~esmf_logseterror->esmf_breakpoint proc~esmf_logseterror->proc~esmf_logrc2msg proc~esmf_logseterror->proc~esmf_logwrite

Called by

proc~~esmf_gridadditemnovalues~~CalledByGraph proc~esmf_gridadditemnovalues ESMF_GridAddItemNoValues interface~esmf_gridadditem ESMF_GridAddItem interface~esmf_gridadditem->proc~esmf_gridadditemnovalues proc~esmf_gridcreatecopyfromnewdg ESMF_GridCreateCopyFromNewDG proc~esmf_gridcreatecopyfromnewdg->interface~esmf_gridadditem proc~make_grid make_grid proc~make_grid->interface~esmf_gridadditem proc~make_grid_sph make_grid_sph proc~make_grid_sph->interface~esmf_gridadditem proc~make_grid_sph~2 make_grid_sph proc~make_grid_sph~2->interface~esmf_gridadditem proc~make_grid_sph~3 make_grid_sph proc~make_grid_sph~3->interface~esmf_gridadditem proc~make_grid_sph~4 make_grid_sph proc~make_grid_sph~4->interface~esmf_gridadditem proc~make_grid_sph~5 make_grid_sph proc~make_grid_sph~5->interface~esmf_gridadditem proc~test_3dcartcsrvregridwmasks test_3Dcartcsrvregridwmasks proc~test_3dcartcsrvregridwmasks->interface~esmf_gridadditem proc~test_cartcsrvregridwmasks test_cartcsrvregridwmasks proc~test_cartcsrvregridwmasks->interface~esmf_gridadditem proc~test_cartcsrvregridwmasks~2 test_cartcsrvregridwmasks proc~test_cartcsrvregridwmasks~2->interface~esmf_gridadditem proc~test_csrvregridwmasks test_csrvregridwmasks proc~test_csrvregridwmasks->interface~esmf_gridadditem proc~test_csrvregridwmasksuserarea test_csrvregridwmasksUserArea proc~test_csrvregridwmasksuserarea->interface~esmf_gridadditem proc~test_extrap_creep_nrst_d test_extrap_creep_nrst_d proc~test_extrap_creep_nrst_d->interface~esmf_gridadditem proc~test_extrap_nrst_d test_extrap_nrst_d proc~test_extrap_nrst_d->interface~esmf_gridadditem proc~test_masksanduserarea test_MasksAndUserArea proc~test_masksanduserarea->interface~esmf_gridadditem proc~test_pointlist_from_grid_wmask test_pointlist_from_grid_wmask proc~test_pointlist_from_grid_wmask->interface~esmf_gridadditem proc~test_regrid_extrap_creep test_regrid_extrap_creep proc~test_regrid_extrap_creep->interface~esmf_gridadditem proc~test_regridalldstmask test_regridAllDstMask proc~test_regridalldstmask->interface~esmf_gridadditem proc~test_regriddstmask test_regridDstMask proc~test_regriddstmask->interface~esmf_gridadditem proc~test_regridsphdstmask test_regridSphDstMask proc~test_regridsphdstmask->interface~esmf_gridadditem proc~test_regridsphsrcmask test_regridSphSrcMask proc~test_regridsphsrcmask->interface~esmf_gridadditem proc~test_regridsrcmask test_regridSrcMask proc~test_regridsrcmask->interface~esmf_gridadditem proc~test_sph_csrv_w_frac_norm test_sph_csrv_w_frac_norm proc~test_sph_csrv_w_frac_norm->interface~esmf_gridadditem proc~test_sph_vec_blnr_csg_to_llg_p test_sph_vec_blnr_csG_to_llG_p proc~test_sph_vec_blnr_csg_to_llg_p->interface~esmf_gridadditem proc~test_unmappeddstlist test_unmappedDstList proc~test_unmappeddstlist->interface~esmf_gridadditem program~esmf_fieldregridex~2 ESMF_FieldRegridEx program~esmf_fieldregridex~2->interface~esmf_gridadditem program~esmf_gridarbitraryutest ESMF_GridArbitraryUTest program~esmf_gridarbitraryutest->interface~esmf_gridadditem program~esmf_gridcreateex ESMF_GridCreateEx program~esmf_gridcreateex->interface~esmf_gridadditem program~esmf_gridcreateutest ESMF_GridCreateUTest program~esmf_gridcreateutest->interface~esmf_gridadditem program~esmf_griditemutest ESMF_GridItemUTest program~esmf_griditemutest->interface~esmf_gridadditem

Source Code

     subroutine ESMF_GridAddItemNoValues(grid, itemflag,  &
       keywordEnforcer, staggerloc, itemTypeKind, staggerEdgeLWidth, staggerEdgeUWidth, &
       staggerAlign, staggerLBound,rc)
!
! !ARGUMENTS:
      type(ESMF_Grid),          intent(in)           :: grid
      type (ESMF_GridItem_Flag),intent(in)           :: itemflag
type(ESMF_KeywordEnforcer), optional:: keywordEnforcer ! must use keywords below
      type (ESMF_StaggerLoc)  , intent(in), optional :: staggerloc
      type (ESMF_TypeKind_Flag),intent(in), optional :: itemTypeKind
      integer,                  intent(in), optional :: staggerEdgeLWidth(:)
      integer,                  intent(in), optional :: staggerEdgeUWidth(:)
      integer,                  intent(in), optional :: staggerAlign(:)
      integer,                  intent(in), optional :: staggerLBound(:)
      integer,                  intent(out),optional :: rc
!
! !STATUS:
! \begin{itemize}
! \item\apiStatusCompatibleVersion{5.2.0r}
! \end{itemize}
!
! !DESCRIPTION:
!
!  When a Grid is created all of its potential stagger locations can hold item
!  data, but none of them have storage allocated. This call allocates item
!  storage (creates an internal ESMF\_Array and associated memory) for  a particular
!  stagger location. Note that this
!  call doesn't assign any values to the storage, it only allocates it. The
!  remaining options {\tt staggerEdgeLWidth}, etc. allow the user to adjust the
!  padding on the item array.
!
! The arguments are:
! \begin{description}
!     \item[grid]
!       Grid to allocate coordinate storage in.
! \item[itemflag]
!      The grid item to add. Please see Section~\ref{const:griditem} for a list of valid items.
! \item[{[staggerloc]}]
!      The stagger location to add. Please see Section~\ref{const:staggerloc} for a list
!      of predefined stagger locations. If not present, defaults to ESMF\_STAGGERLOC\_CENTER.
! \item[{[itemTypeKind]}]
!      The typekind of the  item to add.
! \item[{[staggerEdgeLWidth]}]
!      This array should be the same dimCount as the grid. It specifies the lower corner of the stagger
!      region with respect to the lower corner of the exclusive region.
! \item[{[staggerEdgeUWidth]}]
!      This array should be the same dimCount as the grid. It specifies the upper corner of the stagger
!      region with respect to the upper corner of the exclusive region.
! \item[{[staggerAlign]}]
!      This array is of size  grid dimCount.
!      For this stagger location, it specifies which element
!      has the same index value as the center. For example,
!      for a 2D cell with corner stagger it specifies which
!      of the 4 corners has the same index as the center.
!      If this is set and either staggerEdgeUWidth or staggerEdgeLWidth is not,
!      this determines the default array padding for a stagger.
!      If not set, then this defaults to all negative. (e.g.
!      The most negative part of the stagger in a cell is aligned with the
!      center and the padding is all on the positive side.)
! \item[{[staggerLBound]}]
!      Specifies the lower index range of the memory of every DE in this staggerloc in this Grid.
!      Only used when Grid indexflag is {\tt ESMF\_INDEX\_USER}.
! \item[{[rc]}]
!      Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
! \end{description}
!
!EOP

    integer :: tmp_staggerloc
    integer :: localrc ! local error status
    type(ESMF_InterArray) :: staggerEdgeLWidthArg  ! Language Interface Helper Var
    type(ESMF_InterArray) :: staggerEdgeUWidthArg  ! Language Interface Helper Var
    type(ESMF_InterArray) :: staggerAlignArg  ! Language Interface Helper Var
    type(ESMF_InterArray) :: staggerLBoundArg  ! Language Interface Helper Var
    type(ESMF_GridDecompType) :: decompType     ! decompose type: arbitrary or non-arbitrary

    ! 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)

    ! Get Grid decomposition type
    call ESMF_GridGetDecompType(grid, decompType, rc=localrc)
    if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, &
      ESMF_CONTEXT, rcToReturn=rc)) return
        
    ! handle staggerloc
    if (present(staggerloc)) then
       tmp_staggerloc=staggerloc%staggerloc
    else
       tmp_staggerloc=ESMF_STAGGERLOC_CENTER%staggerloc
    endif

    ! Check if the grid is arbitrary
    if (decompType == ESMF_GRID_ARBITRARY) then
       if (present(staggerEdgeLWidth) .or. present(staggerEdgeUWidth)) then
          call ESMF_LogSetError(rcToCheck=ESMF_RC_ARG_WRONG, &
                 msg="- staggerEdgeLWidth and staggerEdigeUWidth are not allowed for arbitrary grid", &
                 ESMF_CONTEXT, rcToReturn=rc)
          return
       endif
       if (present(staggerAlign)) then
          call ESMF_LogSetError(rcToCheck=ESMF_RC_ARG_WRONG, &
                 msg="- staggerAlign is not allowed for arbitrarily distributed grid", &
                 ESMF_CONTEXT, rcToReturn=rc)
          return
       endif
       if (present(staggerloc)) then
         if (staggerloc /= ESMF_STAGGERLOC_CENTER) then
           call ESMF_LogSetError(rcToCheck=ESMF_RC_ARG_WRONG, &
                 msg="- staggerloc has to be ESMF_STAGGERLOC_CENTER for arbitrary grid", &
                 ESMF_CONTEXT, rcToReturn=rc)
           return
         endif
       endif

       ! Call C++ Subroutine to do the create
       call c_ESMC_gridadditemarb(grid%this,tmp_staggerloc, itemflag,  itemTypeKind, localrc)
       if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, &
          ESMF_CONTEXT, rcToReturn=rc)) return

    else

       !! staggerEdgeLWidth
       staggerEdgeLWidthArg = ESMF_InterArrayCreate(staggerEdgeLWidth, rc=localrc)
       if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, &
          ESMF_CONTEXT, rcToReturn=rc)) return

       !! staggerEdgeUWidth
       staggerEdgeUWidthArg = ESMF_InterArrayCreate(staggerEdgeUWidth, rc=localrc)
       if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, &
          ESMF_CONTEXT, rcToReturn=rc)) return

       !! staggerAlign
       staggerAlignArg = ESMF_InterArrayCreate(staggerAlign, rc=localrc)
       if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, &
          ESMF_CONTEXT, rcToReturn=rc)) return

       !! staggerLBound
       staggerLBoundArg = ESMF_InterArrayCreate(staggerLBound, rc=localrc)
       if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, &
          ESMF_CONTEXT, rcToReturn=rc)) return

       ! Call C++ Subroutine to do the create
       call c_ESMC_gridadditem(grid%this,tmp_staggerloc, itemflag,  itemTypeKind, &
          staggerEdgeLWidthArg, staggerEdgeUWidthArg, staggerAlignArg, &
          staggerLBoundArg,  localrc)
       if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, &
          ESMF_CONTEXT, rcToReturn=rc)) return

       ! Deallocate helper variables
       call ESMF_InterArrayDestroy(staggerEdgeLWidthArg, rc=localrc)
       if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, &
          ESMF_CONTEXT, rcToReturn=rc)) return

       call ESMF_InterArrayDestroy(staggerEdgeUWidthArg, rc=localrc)
       if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, &
          ESMF_CONTEXT, rcToReturn=rc)) return

       call ESMF_InterArrayDestroy(staggerAlignArg, rc=localrc)
          if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, &
          ESMF_CONTEXT, rcToReturn=rc)) return

       call ESMF_InterArrayDestroy(staggerLBoundArg, rc=localrc)
          if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, &
          ESMF_CONTEXT, rcToReturn=rc)) return

    endif

    if (present(rc)) rc = ESMF_SUCCESS

      end subroutine ESMF_GridAddItemNoValues