The subroutine ESMFL_FieldGetDims
returns some grid information associated from an ESMF field.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(ESMF_Field), | intent(inout) | :: | FLD | |||
integer, | intent(out), | optional | :: | gCPD(3) | ||
integer, | intent(out), | optional | :: | lCPD(3) | ||
integer, | intent(out), | optional | :: | lm | ||
integer, | intent(out), | optional | :: | ar |
subroutine ESMFL_FieldGetDims(FLD, gCPD, lCPD, lm, ar) ! implicit NONE ! !ARGUMENTS: type(ESMF_Field), intent(inout) :: FLD !ALT: intent(in) integer, optional, intent(out) :: gCPD(3) integer, optional, intent(out) :: lCPD(3) integer, optional, intent(out) :: lm integer, optional, intent(out) :: ar ! !------------------------------------------------------------------------- ! locals type(ESMF_VM) :: vm type(ESMF_Grid) :: GRID type(ESMF_Array) :: ARR integer :: globalCPD(3) integer :: localCPD(3) integer :: status, thisrank, mype character(len=ESMF_MAXSTR), parameter :: IAm = 'ESMFL_FieldGetDims' ! start call ESMF_VMGetCurrent(vm) call ESMF_VMGet(vm, localPet=mype, rc=status) if (status /= ESMF_SUCCESS) call ESMFL_FailedRC(mype,Iam) call ESMF_FieldGet(FLD, grid=GRID, rc=status) if (status /= ESMF_SUCCESS) call ESMFL_FailedRC(mype,Iam) call MAPL_GridGet(GRID, & globalCellCountPerDim=globalCPD, & localCellCountPerDim=localCPD, & rc=status) if (status /= ESMF_SUCCESS) call ESMFL_FailedRC(mype,Iam) if (present(gCPD)) gCPD = globalCPD if (present(lCPD)) lCPD = localCPD call ESMF_FieldGet(FLD, Array=ARR, rc=status) if (status /= ESMF_SUCCESS) call ESMFL_FailedRC(mype,Iam) call ESMF_ArrayGet(ARR, RANK=thisrank, rc=status) if (status /= ESMF_SUCCESS) call ESMFL_FailedRC(mype,Iam) if (present(lm)) then if ( thisrank >= 3 ) then lm = globalCPD(3) else lm = 1 end if end if if (present(ar)) ar = thisrank end subroutine ESMFL_FieldGetDims