test_vertical_surface Subroutine

public subroutine test_vertical_surface()

Uses

  • proc~~test_vertical_surface~~UsesGraph proc~test_vertical_surface test_vertical_surface module~mapl3g_multistate mapl3g_MultiState proc~test_vertical_surface->module~mapl3g_multistate ESMF ESMF module~mapl3g_multistate->ESMF module~mapl3g_esmf_utilities mapl3g_ESMF_Utilities module~mapl3g_multistate->module~mapl3g_esmf_utilities module~mapl_errorhandling mapl_ErrorHandling module~mapl3g_multistate->module~mapl_errorhandling module~mapl_keywordenforcer mapl_KeywordEnforcer module~mapl3g_multistate->module~mapl_keywordenforcer module~mapl3g_esmf_utilities->ESMF module~mapl3g_esmf_utilities->module~mapl_errorhandling module~mapl_throwmod MAPL_ThrowMod module~mapl_errorhandling->module~mapl_throwmod mpi mpi module~mapl_errorhandling->mpi

$ @assert_that(all(shape(x3d) == [4,4,10]), is(true())) $ field = ESMF_FieldEmptyCreate(rc=status) $ @assert_that(status, is(0)) $ call ESMF_FieldEmptySet(field, grid, rc=status) $ @assert_that(status, is(0)) $ call ESMF_FieldEmptyComplete(field, ESMF_TYPEKIND_R4, & $ rc=status) $ @assert_that(status, is(0))

Arguments

None

Calls

proc~~test_vertical_surface~~CallsGraph proc~test_vertical_surface test_vertical_surface ESMF_GridAddCoord ESMF_GridAddCoord proc~test_vertical_surface->ESMF_GridAddCoord ESMF_GridCreateNoPeriDim ESMF_GridCreateNoPeriDim proc~test_vertical_surface->ESMF_GridCreateNoPeriDim ESMF_GridGetCoord ESMF_GridGetCoord proc~test_vertical_surface->ESMF_GridGetCoord assert_that assert_that proc~test_vertical_surface->assert_that esmf_fieldcreate esmf_fieldcreate proc~test_vertical_surface->esmf_fieldcreate esmf_fieldget esmf_fieldget proc~test_vertical_surface->esmf_fieldget true true proc~test_vertical_surface->true

Source Code

   subroutine test_vertical_surface()
      use mapl3g_MultiState
      type(FieldSpec) :: field_spec

      type(ESMF_Grid) :: grid
      type(ESMF_Field) :: field
      real(kind=ESMF_KIND_R8), pointer :: centerZ(:)
      real(kind=ESMF_KIND_R4), pointer :: x2d(:,:)
      real(kind=ESMF_KIND_R4), pointer :: x3d(:,:,:)
      integer :: k
      integer :: status

      grid = ESMF_GridCreateNoPeriDim( &
           countsPerDEDim1=[4], &
           countsPerDEDim2=[4], &
           countsPerDEDim3=[10], &
           name='I_AM_GROOT', &
           coordDep1=[1], & ! 1st coord is 1D and depends on 1st Grid dim
           coordDep2=[2], & ! 2nd coord is 1D and depends on 2nd Grid dim
           coordDep3=[3], & ! 3rd coord is 1D and depends on 3rd Grid dim
           rc=status)
      @assert_that(status, is(0))
      call ESMF_GridAddCoord(grid, staggerloc=ESMF_STAGGERLOC_CORNER_VCENTER, rc=status)
      @assert_that(status, is(0))
      call ESMF_GridGetCoord(grid, coordDim=3, &
          staggerloc=ESMF_STAGGERLOC_CORNER_VCENTER,         &
          farrayPtr=centerZ, rc=status)
      @assert_that(status, is(0))
      centerZ = [(k, k=1,10)]

      field = ESMF_FieldCreate(grid, ESMF_TYPEKIND_R4, gridToFieldMap=[1,2,0], rc=status)
      @assert_that(status, is(0))
      call ESMF_FieldGet(field, farrayptr=x2d, rc=status)
      @assert_that(status, is(0))
!!$      @assert_that(all(shape(x3d) == [4,4,10]), is(true()))
      @assert_that(all(shape(x2d) == [4,4]), is(true()))
      
!!$      field = ESMF_FieldEmptyCreate(rc=status)
!!$      @assert_that(status, is(0))
!!$      call ESMF_FieldEmptySet(field, grid, rc=status)
!!$      @assert_that(status, is(0))
!!$      call ESMF_FieldEmptyComplete(field, ESMF_TYPEKIND_R4, &
!!$           rc=status)
!!$      @assert_that(status, is(0))
      

   end subroutine test_vertical_surface