Subroutine that writes an object OBJ_SURF in a file
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | fichier | file to be written |
||
type(OBJ_SURF), | intent(inout) | :: | surf | object |
subroutine write_surffile(fichier, surf)
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