Write the heights of an OBJ_SURF object into a 2D array
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(OBJ_SURF), | intent(inout) | :: | surf |
object |
||
real(kind=R8), | intent(out), | dimension(:, :), allocatable | :: | tab |
height array |
subroutine trans_surf_tab(surf, tab) !! Write the heights of an [[OBJ_SURF]] object into a 2D array implicit none type(OBJ_SURF), intent(inout) :: surf !! *object ```OBJ_SURF``` that contains the heights* real(kind=R8), dimension(:, :), allocatable, intent(out) :: tab !! *height array* integer(kind=I4) :: long, larg, i, j, k real(kind=R8) :: unit_z long = surf%xres larg = surf%yres allocate( tab(1:long, 1:larg) ) unit_z = unit2IUc(surf%dz_unit) do j = 1, larg do i = 1, long k = (j-1)*long +i tab(i, j) = ( surf%val(k)*surf%dz + surf%Zoffset ) * unit_z enddo enddo deallocate(surf%val) return endsubroutine trans_surf_tab