Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(ESMF_TestMethod), | intent(inout) | :: | this |
subroutine test_same_n_levels_do_not_reallocate(this) class(ESMF_TestMethod), intent(inout) :: this type(ESMF_Field) :: f type(ESMF_Grid) :: grid type(ESMF_Geom) :: geom, other_geom integer :: status type(ESMF_FieldStatus_Flag) :: field_status real(ESMF_KIND_R4), pointer :: x(:,:,:,:) type(ESMF_TypeKind_Flag) :: typekind type(FieldDelta) :: delta type(UngriddedDims) :: ungridded_dims grid = ESMF_GridCreateNoPeriDim(maxIndex=[4,4], name='I_AM_GROOT', _RC) geom = ESMF_GeomCreate(grid, _RC) call ungridded_dims%add_dim(UngriddedDim(3)) f = MAPL_FieldCreate(geom=geom, typekind=ESMF_TYPEKIND_R4, & num_levels=ORIG_VGRID_LEVELS, ungridded_dims=ungridded_dims, & vert_staggerloc=VERTICAL_STAGGER_CENTER, _RC) call ESMF_FieldGet(f, fArrayPtr=x, _RC) x = FILL_VALUE delta = FieldDelta(num_levels=ORIG_VGRID_LEVELS) call delta%reallocate_field(f, _RC) call ESMF_FieldGet(f, status=field_status, typekind=typekind, geom=other_geom, _RC) @assert_that(field_status == ESMF_FIELDSTATUS_COMPLETE, is(true())) @assert_that(typekind == ESMF_TYPEKIND_R4, is(true())) @assert_that(other_geom == geom, is(true())) ! Check that Field data is unchanged call ESMF_FieldGet(f, fArrayPtr=x, _RC) @assert_that(all(x == FILL_VALUE), is(true())) call ESMF_FieldDestroy(f, _RC) call ESMF_GridDestroy(grid, _RC) call ESMF_GeomDestroy(geom, _RC) _UNUSED_DUMMY(this) end subroutine test_same_n_levels_do_not_reallocate