ESMF_FieldRegrid Subroutine

public subroutine ESMF_FieldRegrid(srcField, dstField, routehandle, keywordEnforcer, zeroregion, termorderflag, checkflag, dynamicMask, rc)

Arguments

Type IntentOptional Attributes Name
type(ESMF_Field), intent(in), optional :: srcField
type(ESMF_Field), intent(inout), optional :: dstField
type(ESMF_RouteHandle), intent(inout) :: routehandle
type(ESMF_KeywordEnforcer), optional :: keywordEnforcer
type(ESMF_Region_Flag), intent(in), optional :: zeroregion
type(ESMF_TermOrder_Flag), intent(in), optional :: termorderflag
logical, intent(in), optional :: checkflag
type(ESMF_DynamicMask), intent(in), optional, target :: dynamicMask
integer, intent(out), optional :: rc

Calls

proc~~esmf_fieldregrid~~CallsGraph proc~esmf_fieldregrid ESMF_FieldRegrid esmf_fieldget esmf_fieldget proc~esmf_fieldregrid->esmf_fieldget proc~esmf_arraysmm ESMF_ArraySMM proc~esmf_fieldregrid->proc~esmf_arraysmm proc~esmf_logfounderror ESMF_LogFoundError proc~esmf_fieldregrid->proc~esmf_logfounderror proc~esmf_logseterror ESMF_LogSetError proc~esmf_fieldregrid->proc~esmf_logseterror proc~esmf_arraysmm->proc~esmf_logfounderror proc~esmf_arraysmm->proc~esmf_logseterror c_esmc_arraysmm c_esmc_arraysmm proc~esmf_arraysmm->c_esmc_arraysmm c_esmc_routehandlesetasr4r4r4 c_esmc_routehandlesetasr4r4r4 proc~esmf_arraysmm->c_esmc_routehandlesetasr4r4r4 c_esmc_routehandlesetasr4r4r4v c_esmc_routehandlesetasr4r4r4v proc~esmf_arraysmm->c_esmc_routehandlesetasr4r4r4v c_esmc_routehandlesetasr4r8r4 c_esmc_routehandlesetasr4r8r4 proc~esmf_arraysmm->c_esmc_routehandlesetasr4r8r4 c_esmc_routehandlesetasr4r8r4v c_esmc_routehandlesetasr4r8r4v proc~esmf_arraysmm->c_esmc_routehandlesetasr4r8r4v c_esmc_routehandlesetasr8r8r8 c_esmc_routehandlesetasr8r8r8 proc~esmf_arraysmm->c_esmc_routehandlesetasr8r8r8 c_esmc_routehandlesetasr8r8r8v c_esmc_routehandlesetasr8r8r8v proc~esmf_arraysmm->c_esmc_routehandlesetasr8r8r8v c_esmc_routehandlesethandleall c_esmc_routehandlesethandleall proc~esmf_arraysmm->c_esmc_routehandlesethandleall esmf_arraygetinit esmf_arraygetinit proc~esmf_arraysmm->esmf_arraygetinit esmf_arraygetthis esmf_arraygetthis proc~esmf_arraysmm->esmf_arraygetthis esmf_arraysetthisnull esmf_arraysetthisnull proc~esmf_arraysmm->esmf_arraysetthisnull interface~c_esmc_routehandlesetdyndstmask c_ESMC_RouteHandleSetDynDstMask proc~esmf_arraysmm->interface~c_esmc_routehandlesetdyndstmask interface~c_esmc_routehandlesetdynsrcmask c_ESMC_RouteHandleSetDynSrcMask proc~esmf_arraysmm->interface~c_esmc_routehandlesetdynsrcmask proc~esmf_dynamicmaskgetinit ESMF_DynamicMaskGetInit proc~esmf_arraysmm->proc~esmf_dynamicmaskgetinit proc~esmf_imerr ESMF_IMErr proc~esmf_arraysmm->proc~esmf_imerr proc~esmf_imerrs ESMF_IMErrS proc~esmf_arraysmm->proc~esmf_imerrs proc~esmf_routehandlegetinit ESMF_RouteHandleGetInit proc~esmf_arraysmm->proc~esmf_routehandlegetinit 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

ESMF_FieldRegridExwESMF_FieldRegrid
w
ESMF_FieldRegridExw
w
ESMF_FieldSphereRegridExw
w
ESMF_LocStreamExw
w
ESMF_MeshExw
w
ESMF_RegridExw
w
ESMF_RHandleDynamicMaskingExw
w
ESMF_RHandleReusabilityExw
w
ESMF_XGridExw
w
ESMF_XGridSparseMatExw
w
f_esmf_regridw
w
field_regrid_testw
w
flux_exchangew
w
flux_exchangew
w
flux_exchange_sphw
w
flux_exchange_sphw
w
flux_exchange_sph_meshw
w
test_3Dcartcsrvregridwmasksw
w
test_bilinear_regrid_csgridw
w
test_bilinear_regrid_csgrid_sph_radw
w
test_bilinear_regrid_csmeshw
w
test_bilinear_regrid_csmosaicw
w
test_cart_bilinear_xgridw
w
test_cartcsrvregridwmasksw
w
test_cartcsrvregridwmasksw
w
test_CartMeshToMesh_2ndw
w
test_conserve_regrid_csgridw
w
test_conserve_regrid_csmeshw
w
test_conserve_regrid_csmosaicw
w
test_CSGridToGridw
w
test_CSGridToGrid_2ndw
w
test_CSGridToGridWMasksw
w
test_csrvregridw
w
test_csrvregridwmasksw
w
test_csrvregridwmasksUserAreaw
w
test_DTOS_3DCartMeshToMeshw
w
test_DTOSGridToGridSph3Dw
w
test_extrap_creep_nrst_dw
w
test_extrap_nrst_dw
w
test_GridToGridw
w
test_MasksAndUserAreaw
w
test_mesh_dual_w_bilinearw
w
test_MeshEasyElemsw
w
test_MeshToMeshw
w
test_MeshToMesh_2ndw
w
test_MeshToMeshCartw
w
test_MeshToMeshWMasksw
w
test_Nearest2DCartLSToLSw
w
test_Nearest3DCartLSToLSw
w
test_nearest_regrid_csgridw
w
test_nearest_regrid_csmeshw
w
test_patch_regrid_csgridw
w
test_patch_regrid_csmeshw
w
test_PatchMeshToLocStreamMaskw
w
test_regrid0WidthDEsw
w
test_regrid180vs360w
w
test_regrid2TileDGw
w
test_regrid2TileDGw
w
test_regrid2xgw
w
test_regrid2xg_clipw
w
test_regrid2xg_containw
w
test_regrid2xg_halfw
w
test_regrid2xg_onlinew
w
test_regrid2xgSphw
w
test_regrid3Dw
w
test_regrid3D_DTOSw
w
test_regrid3D_STODw
w
test_regrid3DCartMeshToMeshw
w
test_regrid_extrap_creepw
w
test_regrid_extrap_near_npntsw
w
test_regrid_extrap_nearstodw
w
test_regrid_gridufrmw
w
test_regrid_nanw
w
test_regrid_snanw
w
test_regrid_store_from_filew
w
test_regrid_transposew
w
test_regrid_w_gtomw
w
test_regridAllDstMaskw
w
test_RegridCart4ConcaveMeshw
w
test_RegridCart4ConcaveMeshw
w
test_regridCnrw
w
test_regridCollapsedQuadsw
w
test_RegridCsrv3DCartMeshw
w
test_RegridCsrvCartMeshw
w
test_RegridCsrvCartMultiPolyw
w
test_RegridCsrvCartPHFracNormw
w
test_RegridCsrvCartPHMeshw
w
test_regridDELOCALw
w
test_regridDGSphw
w
test_regridDstMaskw
w
test_regridEdgew
w
test_regridExtraFieldDimw
w
test_regridGridToGMLw
w
test_regridGridToGridSph3Dw
w
test_regridGridToLocStream3dw
w
test_regridGridToLocStreamLocCntw
w
test_regridGridToLocStreamRegDistw
w
test_regridGridToMeshw
w
test_regridIrregw
w
test_regridMeshSph3x3ToGridw
w
test_regridMeshToGridw
w
test_regridMeshToGrid3Dw
w
test_regridMeshToGridSph3Dw
w
test_regridMeshToLocStreamMaskw
w
test_regridMeshToMeshw
w
test_regridMeshToMeshCenterw
w
test_regridMeshToMeshMaskw
w
test_regridMeshToMeshPatchw
w
test_regridMeshToMeshPHw
w
test_regridNearestDTOSMeshToMeshw
w
test_regridNearestLocStream_wClusterToMeshw
w
test_regridNearestLocStreamToGridw
w
test_regridNearestLocStreamToLocStreamw
w
test_regridNearestMeshToMeshw
w
test_regridPartialVMw
w
test_regridPHMeshToGridw
w
test_regridR4w
w
test_RegridSph4ConcaveMeshw
w
test_RegridSph4ConcaveMeshw
w
test_regridSphDstMaskw
w
test_regridSphGCw
w
test_regridSphNearestw
w
test_regridSphNearestDToSw
w
test_regridSphPoleAllAvgw
w
test_regridSphPoleNonew
w
test_regridSphPoleNpntAvgw
w
test_regridSphPoleTeethw
w
test_regridSphSrcMaskw
w
test_regridSrcMaskw
w
test_regridSwitchedIndicesw
w
test_regridSwitchedIndicesIIw
w
test_regridTetMeshToGrid3Dw
w
test_regridxgw
w
test_regridxg_constw
w
test_SmallNumNbrsw
w
test_sph_bilinear_xgridw
w
test_sph_csrv_w_frac_normw
w
test_sph_vec_blnr_csG_to_llGw
w
test_sph_vec_blnr_csG_to_llG_pw
w
test_sph_vec_blnr_identicalw
w
test_STOD_3DCartMeshToMeshw
w
test_STODGridToGridSph3Dw
w
test_unmappedDstListw
w
user_runw
w
user_runw
w
user_runw
w
user_runw
w
user_runw
w
user_runw
w
user_runw
w
user_runw
w
user_runw
w
user_runw
w
user_runw
w
user_runw
w

Source Code

  subroutine ESMF_FieldRegrid(srcField, dstField, routehandle, keywordEnforcer, &
    zeroregion, termorderflag, checkflag, dynamicMask, rc)
!
! !ARGUMENTS:
      type(ESMF_Field),               intent(in),    optional :: srcField
      type(ESMF_Field),               intent(inout), optional :: dstField
      type(ESMF_RouteHandle),         intent(inout)           :: routehandle
type(ESMF_KeywordEnforcer), optional:: keywordEnforcer ! must use keywords below
      type(ESMF_Region_Flag),         intent(in),    optional :: zeroregion
      type(ESMF_TermOrder_Flag),      intent(in),    optional :: termorderflag
      logical,                        intent(in),    optional :: checkflag
      type(ESMF_DynamicMask), target, intent(in),    optional :: dynamicMask
      integer,                        intent(out),   optional :: rc 
!
! !STATUS:
! \begin{itemize}
! \item\apiStatusCompatibleVersion{5.2.0r}
! \item\apiStatusModifiedSinceVersion{5.2.0r}
! \begin{description}
! \item[6.1.0] Added argument {\tt termorderflag}.
!              The new argument gives the user control over the order in which
!              the src terms are summed up.
! \item[7.1.0r] Added argument {\tt dynamicMask}.
!              The new argument supports the dynamic masking feature.
! \end{description}
! \end{itemize}
!
! !DESCRIPTION:
!   Execute the precomputed regrid operation stored in {\tt routehandle} to 
!   interpolate from {\tt srcField} to {\tt dstField}.  See {\tt ESMF\_FieldRegridStore()} on how to 
!   precompute the {\tt routehandle}. 
!  
!   \begin{sloppypar}
!   Both {\tt srcField} and {\tt dstField} must match the respective Fields
!   used during {\tt ESMF\_FieldRegridStore()} in {\em type}, {\em kind}, and 
!   memory layout of the {\em gridded} dimensions. However, the size, number, 
!   and index order of {\em ungridded} dimensions may be different. See section
!   \ref{RH:Reusability} for a more detailed discussion of RouteHandle 
!   reusability.
!   \end{sloppypar}
!
!   The {\tt srcField} and {\tt dstField} arguments are optional in support of
!   the situation where {\tt srcField} and/or {\tt dstField} are not defined on
!   all PETs. The {\tt srcField} and {\tt dstField} must be specified on those
!   PETs that hold source or destination DEs, respectively, but may be omitted
!   on all other PETs. PETs that hold neither source nor destination DEs may
!   omit both arguments.
!
!   It is erroneous to specify the identical Field object for {\tt srcField} and
!   {\tt dstField} arguments.
!
!   This call is {\em collective} across the current VM.
!
!   \begin{description}
!   \item [{[srcField]}]
!     {\tt ESMF\_Field} with source data.
!   \item [{[dstField]}]
!     {\tt ESMF\_Field} with destination data.
!   \item [routehandle]
!     Handle to the precomputed Route.
!   \item [{[zeroregion]}]
!     \begin{sloppypar}
!     If set to {\tt ESMF\_REGION\_TOTAL} {\em (default)} the total regions of
!     all DEs in {\tt dstField} will be initialized to zero before updating the 
!     elements with the results of the sparse matrix multiplication. If set to
!     {\tt ESMF\_REGION\_EMPTY} the elements in {\tt dstField} will not be
!     modified prior to the sparse matrix multiplication and results will be
!     added to the incoming element values. Setting {\tt zeroregion} to 
!     {\tt ESMF\_REGION\_SELECT} will only zero out those elements in the 
!     destination Array that will be updated by the sparse matrix
!     multiplication. See section \ref{const:region} for a complete list of
!     valid settings.
!     \end{sloppypar}
!   \item [{[termorderflag]}]
!     Specifies the order of the source side terms in all of the destination
!     sums. The {\tt termorderflag} only affects the order of terms during 
!     the execution of the RouteHandle. See the \ref{RH:bfb} section for an
!     in-depth discussion of {\em all} bit-for-bit reproducibility
!     aspects related to route-based communication methods.
!     See \ref{const:termorderflag} for a full list of options.
!     The default setting depends on whether the {\tt dynamicMask} argument
!     is present or not. With {\tt dynamicMask} argument present, the default
!     of {\tt termorderflag} is {\tt ESMF\_TERMORDER\_SRCSEQ}. This ensures
!     that {\tt all} source terms are present on the destination side, and 
!     the interpolation can be calculated as a single sum. When 
!     {\tt dynamicMask} is absent, the default of {\tt termorderflag} is
!     {\tt ESMF\_TERMORDER\_FREE}, allowing maximum flexibility and partial 
!     sums for optimum performance.
!   \item [{[checkflag]}]
!     If set to {\tt .TRUE.} the input Array pair will be checked for
!     consistency with the precomputed operation provided by {\tt routehandle}.
!     If set to {\tt .FALSE.} {\em (default)} only a very basic input check
!     will be performed, leaving many inconsistencies undetected. Set
!     {\tt checkflag} to {\tt .FALSE.} to achieve highest performance.
!   \item [{[dynamicMask]}]
!     Object holding dynamic masking information.
!     See section \ref{RH:DynMask} for a discussion of dynamic masking.
!   \item [{[rc]}]
!     Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
!   \end{description}
!EOP
        integer :: localrc
        type(ESMF_Array)     :: srcArray
        type(ESMF_Array)     :: dstArray

        ! Initialize return code; assume failure until success is certain
        localrc = ESMF_SUCCESS
        if (present(rc)) rc = ESMF_RC_NOT_IMPL

        ! Now we go through the painful process of extracting the data members
        ! that we need, if present.
        if (present(srcField)) then
          call ESMF_FieldGet(srcField, array=srcArray, rc=localrc)
          if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, &
            ESMF_CONTEXT, rcToReturn=rc)) return
        endif

        if (present(dstField)) then
          call ESMF_FieldGet(dstField, array=dstArray, rc=localrc)
          if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, &
            ESMF_CONTEXT, rcToReturn=rc)) return
        endif

        if (present(srcField) .and. present(dstField)) then
          call ESMF_ArraySMM(srcArray=srcArray, dstArray=dstArray, &
                 routehandle=routehandle, zeroregion=zeroregion, &
                 termorderflag=termorderflag, checkflag=checkflag, &
                 dynamicMask=dynamicMask, rc=localrc)
        else if (present(srcField) .and. .not. present(dstField)) then
          call ESMF_ArraySMM(srcArray=srcArray, &
                 routehandle=routehandle, zeroregion=zeroregion, &
                 termorderflag=termorderflag, checkflag=checkflag, &
                 dynamicMask=dynamicMask, rc=localrc)
        else if (.not. present(srcField) .and. present(dstField)) then
          call ESMF_ArraySMM(dstArray=dstArray, &
                 routehandle=routehandle, zeroregion=zeroregion, &
                 termorderflag=termorderflag, checkflag=checkflag, &
                 dynamicMask=dynamicMask, rc=localrc)
        else if (.not. present(srcField) .and. .not. present(dstField)) then
          call ESMF_ArraySMM(routehandle=routehandle, zeroregion=zeroregion, &
                 termorderflag=termorderflag, checkflag=checkflag, &
                 dynamicMask=dynamicMask, rc=localrc)
        else
          call ESMF_LogSetError(rcToCheck=ESMF_RC_ARG_WRONG, &
            msg="Supplied combination of optional Fields not supported", &
            ESMF_CONTEXT, rcToReturn=rc)
          return
        endif

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

        ! Once the compilation order is sorted out, 
        ! Should be able to call into Field SMM directly.
        !call ESMF_FieldSMM(srcField=srcField, dstField=dstField, &
        !           routehandle=routehandle, zeroregion=zeroregion, &
        !           checkflag=checkflag, rc=localrc)

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

        if(present(rc)) rc = ESMF_SUCCESS

    end subroutine ESMF_FieldRegrid