trans_surf_tab Subroutine

private subroutine trans_surf_tab(surf, tab)

Write the heights of an OBJ_SURF object into a 2D array

Arguments

Type IntentOptional Attributes Name
type(OBJ_SURF), intent(inout) :: surf

object OBJ_SURF that contains the heights

real(kind=R8), intent(out), dimension(:, :), allocatable :: tab

height array


Calls

proc~~trans_surf_tab~~CallsGraph proc~trans_surf_tab trans_surf_tab proc~unit2iuc unit2IUc proc~trans_surf_tab->proc~unit2iuc proc~unit2iuf unit2IUf proc~unit2iuc->proc~unit2iuf

Called by

proc~~trans_surf_tab~~CalledByGraph proc~trans_surf_tab trans_surf_tab proc~read_surf~2 read_surf proc~read_surf~2->proc~trans_surf_tab program~test_surfile test_surfile program~test_surfile->proc~read_surf~2

Source Code

   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