Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(Test_LatLonCorners), | intent(inout) | :: | this |
subroutine test_shape(this) class (Test_LatLonCorners), intent(inout) :: this integer :: status integer, parameter :: SUCCESS = 0 real(ESMF_KIND_R8), pointer :: corners(:,:) integer :: petX, petY integer, allocatable :: imc(:), jmc(:) select type (p => this%testParameter) type is (GridCase) petX = mod(this%getLocalPET(), p%nx) petY = this%getLocalPET() / p%nx allocate(imc(size(p%ims)),jmc(size(p%jms))) imc = p%ims jmc = p%jms select type (p => this%testParameter) type is (GridCase) if (p%dateline == 'XY') then if (petX+1 == size(p%ims)) imc(petY+1)=imc(petX+1)+1 end if end select if (petY+1 == size(p%jms)) jmc(petY+1)=jmc(petY+1)+1 @mpiAssertTrue(petX >= 0) @mpiAssertTrue(petX < size(p%ims)) @mpiAssertTrue(petY >= 0) @mpiAssertTrue(petY < size(p%jms)) end select ! X call ESMF_GridGetCoord(this%grid, coordDim=1, staggerLoc=ESMF_STAGGERLOC_CORNER, & & farrayPtr=corners, rc=status) @mpiAssertTrue(status==SUCCESS, message='Failed to get grid x corners.') select type (p => this%testparameter) type is (GridCase) @mpiAssertEqual([imc(petX+1),jmc(petY+1)], shape(corners), message='Wrong shape.') end select ! Y call ESMF_GridGetCoord(this%grid, coordDim=2, staggerLoc=ESMF_STAGGERLOC_CORNER, & & farrayPtr=corners, rc=status) @mpiAssertTrue(status==SUCCESS, message='Failed to geet grid x corners.') select type (p => this%testparameter) type is (GridCase) @mpiAssertEqual([imc(petX+1),jmc(petY+1)], shape(corners), message='Wrong shape.') end select select type (p => this%testparameter) type is (GridCase) deallocate(imc,jmc) end select end subroutine test_shape