$ @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))
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