f_esmf_xgridgetmesh Subroutine

subroutine f_esmf_xgridgetmesh(xgrid, meshp, parametricDim, spatialDim, coordSys, rc)

Arguments

Type IntentOptional Attributes Name
type(ESMF_XGrid), intent(inout) :: xgrid
type(ESMF_Pointer) :: meshp
integer, intent(out) :: parametricDim
integer, intent(out) :: spatialDim
type(ESMF_CoordSys_Flag), intent(out) :: coordSys
integer, intent(out) :: rc

Source Code

  subroutine f_esmf_xgridgetmesh(xgrid, meshp, &
       parametricDim, spatialDim, coordSys, rc)

    use ESMF_XGridMod
    use ESMF_XGridGetMod
    use ESMF_XGridCreateMod
    use ESMF_XGridGeomBaseMod
    use ESMF_UtilTypesMod
    use ESMF_BaseMod
    use ESMF_LogErrMod
    use ESMF_MeshMod

    implicit none

    type(ESMF_XGrid),intent(inout)        :: xgrid
    type(ESMF_Pointer)                    :: meshp
    integer, intent(out)                  :: parametricDim              
    integer, intent(out)                  :: spatialDim              
    type(ESMF_CoordSys_Flag), intent(out) :: coordSys
    integer, intent(out)                  :: rc              

    type(ESMF_Mesh)             :: mesh

    rc = ESMF_RC_NOT_IMPL

    ! Get Mesh
    call ESMF_XGridGet(xgrid, mesh=mesh, rc=rc)
    if (ESMF_LogFoundError(rc, ESMF_ERR_PASSTHRU, &
      ESMF_CONTEXT, rcToReturn=rc)) return

    ! Get internal pointer
    meshp = mesh%this

    ! Get other information
    call ESMF_MeshGet(mesh, &
                      parametricDim=parametricDim, &
                      spatialDim=spatialDim, &
                      coordSys=coordSys, &
                      rc=rc)
    if (ESMF_LogFoundError(rc, ESMF_ERR_PASSTHRU, &
      ESMF_CONTEXT, rcToReturn=rc)) return

    ! Return success
    rc = ESMF_SUCCESS
  
  end subroutine f_esmf_xgridgetmesh