write_surffile Subroutine

private subroutine write_surffile(fichier, surf)

Write an object OBJ_SURF in a file

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: fichier

file to be written

type(OBJ_SURF), intent(inout) :: surf

object OBJ_SURF to write


Calls

proc~~write_surffile~~CallsGraph proc~write_surffile write_surffile proc~get_unit~2 get_unit proc~write_surffile->proc~get_unit~2

Called by

proc~~write_surffile~~CalledByGraph proc~write_surffile write_surffile proc~write_surf write_surf proc~write_surf->proc~write_surffile program~test_surfile test_surfile program~test_surfile->proc~write_surf

Source Code

   subroutine write_surffile(fichier, surf)
   !! Write an object [[OBJ_SURF]] in a file
   implicit none
   character(len=*), intent(in)  :: fichier  !! *file to be written*
   type(OBJ_SURF), intent(inout) :: surf     !! *object ```OBJ_SURF``` to write*

      integer(kind=I4) :: i, k

      call get_unit(k)
      open(k,  file=trim(fichier),     & !
               form='unformatted',     & !
               access="stream",        & ! beware the "frecord-marker" in other modes
               action="write",         & !
               position="rewind",      & !
               status="replace",       & !
               convert='little_endian')

         write(k) surf%signature, surf%format, surf%nobjects, surf%version, surf%type, surf%object_name,                &
                  surf%operator_name, surf%material_code, surf%acquisition, surf%range, surf%special_points,            &
                  surf%absolute, surf%reserved, surf%pointsize, surf%zmin, surf%zmax, surf%xres, surf%yres,             &
                  surf%nofpoints, surf%dx, surf%dy, surf%dz, surf%xaxis, surf%yaxis, surf%zaxis, surf%dx_unit,          &
                  surf%dy_unit, surf%dz_unit, surf%xlength_unit, surf%ylength_unit, surf%zlength_unit,                  &
                  surf%xunit_ratio, surf%yunit_ratio, surf%zunit_ratio, surf%imprint, surf%inversion, surf%leveling,    &
                  surf%obsolete, surf%seconds, surf%minutes, surf%hours, surf%day, surf%month, surf%year, surf%dayof,   &
                  surf%measurement_duration, surf%obsolete2, surf%comment_size, surf%private_size, surf%client_zone,    &
                  surf%XOffset, surf%YOffset, surf%ZOffset, surf%reservedzone,                                          &
                  (surf%val(i), i=1, surf%nofpoints)
      close(k)

   return
   endsubroutine write_surffile