init_scal Subroutine

public subroutine init_scal(scal, nx, ny, lx, ly, unit_z)

OBJ_SURF initialization, every unit is m

Arguments

Type IntentOptional Attributes Name
type(SCALE_SURF), intent(out) :: scal

object SCALE_SURF

integer(kind=I4), intent(in), optional :: nx
integer(kind=I4), intent(in), optional :: ny
real(kind=R8), intent(in), optional :: lx
real(kind=R8), intent(in), optional :: ly
character(len=*), intent(in), optional :: unit_z

Calls

proc~~init_scal~~CallsGraph proc~init_scal init_scal proc~empty empty proc~init_scal->proc~empty

Called by

proc~~init_scal~~CalledByGraph proc~init_scal init_scal program~test_surfile test_surfile program~test_surfile->proc~init_scal

Source Code

   subroutine init_scal(scal, nx, ny, lx, ly, unit_z)
   !! [[OBJ_SURF]] initialization, every unit is m
   implicit none
   type(SCALE_SURF), intent(out) :: scal !! *object [[SCALE_SURF]]*
   integer(kind=I4), optional, intent(in) :: nx
   integer(kind=I4), optional, intent(in) :: ny
   real(kind=R8),    optional, intent(in) :: lx
   real(kind=R8),    optional, intent(in) :: ly
   character(*),     optional, intent(in) :: unit_z

      integer(kind=I4), dimension(1:8) :: time_val
      character(len=256) :: string

      call date_and_time(values=time_val)

      scal%format                = 0
      scal%nobjects              = 1
      scal%version               = 1
      scal%type                  = 2
      scal%material_code         = 1
      scal%acquisition           = 0
      scal%range                 = 0
      scal%special_points        = 0
      scal%absolute              = 1
      scal%pointsize             = 32
      scal%zmin                  = 0
      scal%zmax                  = 0
      scal%xres                  = 0
      scal%yres                  = 0
      scal%nofpoints             = 0
      scal%xunit_ratio           = 1.
      scal%yunit_ratio           = 1.
      scal%zunit_ratio           = 1.
      scal%imprint               = 0
      scal%inversion             = 0
      scal%leveling              = 0
      scal%seconds               = time_val(7)
      scal%minutes               = time_val(6)
      scal%hours                 = time_val(5)
      scal%day                   = time_val(3)
      scal%month                 = time_val(2)
      scal%year                  = time_val(1)
      scal%dayof                 = 0
      scal%measurement_duration  = 0.0
      scal%comment_size          = 0
      scal%private_size          = 0
      scal%XOffset               = 0.
      scal%YOffset               = 0.
      scal%ZOffset               = 0.

      call empty(scal%reserved)
      call empty(scal%obsolete2)
      call empty(scal%obsolete)
      call empty(scal%reservedzone)
      call empty(scal%client_zone)

      call empty(scal%object_name)
      call empty(scal%signature)
      call empty(scal%operator_name)
      scal%object_name     = 'HOME MADE'
      scal%signature       = 'DIGITAL SURF'
      scal%operator_name   = 'MOD_SURFILE'

      call empty(scal%xaxis)
      call empty(scal%yaxis)
      call empty(scal%zaxis)
      scal%xaxis  = "X"
      scal%yaxis  = "Y"
      scal%zaxis  = "Z"

      call empty(scal%xlength_unit)
      call empty(scal%ylength_unit)
      call empty(scal%zlength_unit)
      call empty(scal%dx_unit)
      call empty(scal%dy_unit)
      call empty(scal%dz_unit)
      scal%xlength_unit = "m" ; scal%dx_unit = trim(scal%xlength_unit) ; scal%dx = 1.0
      scal%ylength_unit = "m" ; scal%dy_unit = trim(scal%ylength_unit) ; scal%dy = 1.0
      scal%zlength_unit = "m" ; scal%dz_unit = trim(scal%zlength_unit) ; scal%dz = 1.0

      scal%mu = 0
      scal%si = 0

      if (present(nx)) scal%xres = nx
      if (present(ny)) scal%yres = ny

      if (present(lx)) scal%lx = lx
      if (present(ly)) scal%ly = ly

      if (present(nx).and.present(lx)) scal%dx = lx/nx
      if (present(ny).and.present(ly)) scal%dy = ly/ny

      if (present(unit_z)) then ; scal%zlength_unit = trim(unit_z)
                                  scal%dz_unit      = trim(unit_z) ; endif

   return
   endsubroutine init_scal