test_FieldClone3D Subroutine

public subroutine test_FieldClone3D(this)

Arguments

Type IntentOptional Attributes Name
class(MpiTestMethod), intent(inout) :: this

Calls

proc~~test_fieldclone3d~~CallsGraph proc~test_fieldclone3d test_FieldClone3D ESMF_GridGet ESMF_GridGet proc~test_fieldclone3d->ESMF_GridGet assertequal assertequal proc~test_fieldclone3d->assertequal asserttrue asserttrue proc~test_fieldclone3d->asserttrue esmf_fieldget esmf_fieldget proc~test_fieldclone3d->esmf_fieldget interface~fieldclone FieldClone proc~test_fieldclone3d->interface~fieldclone proc~mapl_verify MAPL_Verify proc~test_fieldclone3d->proc~mapl_verify proc~mapl_throw_exception MAPL_throw_exception proc~mapl_verify->proc~mapl_throw_exception

Source Code

   subroutine test_FieldClone3D(this)
      class(MpiTestMethod), intent(inout) :: this
      type(ESMF_Field) :: x, y
      integer :: status, rc

      type(ESMF_TypeKind_Flag) :: tk_x,tk_y
      type(ESMF_Grid) :: grid
      integer, allocatable :: ungriddedLBound_x(:),ungriddedLBound_y(:)
      integer, allocatable :: ungriddedUBound_x(:),ungriddedUBound_y(:)
      integer :: grid_rank_x, grid_rank_y
      integer :: field_rank_x, field_rank_y
      integer :: ungrid_x,ungrid_y

      x = XR4_3D

      call ESMF_FieldGet(x,rank=field_rank_x,grid=grid,typekind=tk_x,_RC)
      call ESMF_GridGet(grid,dimCount=grid_rank_x)
      ungrid_x = field_rank_x - grid_rank_x
      allocate(ungriddedLBound_x(ungrid_x),ungriddedUBound_x(ungrid_x))
      call ESMF_FieldGet(x,ungriddedLBound=UngriddedLBound_x,ungriddedUBound=UngriddedUBound_x,_RC)

      call FieldClone(x, y, _RC)

      call ESMF_FieldGet(y,rank=field_rank_y,grid=grid,typekind=tk_y,_RC)
      call ESMF_GridGet(grid,dimCount=grid_rank_y)
      ungrid_y = field_rank_y - grid_rank_y
      allocate(ungriddedLBound_y(ungrid_y),ungriddedUBound_y(ungrid_y))
      call ESMF_FieldGet(y,ungriddedLBound=UngriddedLBound_y,ungriddedUBound=UngriddedUBound_y,_RC)
      @assertEqual(field_rank_x,field_rank_y)
      @assertEqual(ungrid_x,ungrid_y)
      @assertTrue(tk_x==tk_y,"kinds not equal")
      @assertEqual(ungriddedLBound_x,ungriddedLBound_y)
      @assertEqual(ungriddedUBound_x,ungriddedUBound_y)

   end subroutine test_FieldClone3D