surfile Module

Routines to handle Digital Surf binary format (.sur)


Uses

  • module~~surfile~~UsesGraph module~surfile surfile iso_c_binding iso_c_binding module~surfile->iso_c_binding module~sort_arrays sort_arrays module~surfile->module~sort_arrays module~data_arch data_arch module~surfile->module~data_arch module~sort_arrays->module~data_arch iso_fortran_env iso_fortran_env module~data_arch->iso_fortran_env

Used by

  • module~~surfile~~UsedByGraph module~surfile surfile module~film film module~film->module~surfile module~ms_film ms_film module~ms_film->module~surfile module~ms_film->module~film module~test_musst test_musst module~test_musst->module~surfile module~test_musst->module~film module~test_musst->module~ms_film module~inout_files inout_files module~test_musst->module~inout_files module~inout_files->module~surfile module~inout_files->module~film module~inout_files->module~ms_film program~main main program~main->module~test_musst

Contents


Variables

TypeVisibility AttributesNameInitial
integer(kind=4), private, parameter:: SURF_DAT =1

'.dat' format, txt

integer(kind=4), private, parameter:: SURF_SUR =2

'.sur' format, binary


Derived Types

type, public :: SCALE_SURF

Surface object: header and heights

Read more…

Components

TypeVisibility AttributesNameInitial
character(len=12), public :: signature
character(len=16), public :: xlength_unit
character(len=16), public :: ylength_unit
character(len=16), public :: zlength_unit
character(len=16), public :: xaxis
character(len=16), public :: yaxis
character(len=16), public :: zaxis
character(len=16), public :: dx_unit
character(len=16), public :: dy_unit
character(len=16), public :: dz_unit
character(len=30), public :: object_name
character(len=30), public :: operator_name
character(len=128), public :: client_zone
character(len=8), public :: reserved
character(len=34), public :: reservedzone
character(len=12), public :: obsolete
character(len=10), public :: obsolete2
real(kind=R4), public :: dx
real(kind=R4), public :: dy
real(kind=R4), public :: dz
real(kind=R4), public :: xunit_ratio
real(kind=R4), public :: yunit_ratio
real(kind=R4), public :: zunit_ratio
real(kind=R4), public :: XOffset
real(kind=R4), public :: YOffset
real(kind=R4), public :: ZOffset
real(kind=R4), public :: measurement_duration
integer(kind=I4), public :: zmin
integer(kind=I4), public :: zmax
integer(kind=I4), public :: xres
integer(kind=I4), public :: yres
integer(kind=I4), public :: nofpoints
integer(kind=2), public :: format
integer(kind=2), public :: version
integer(kind=2), public :: material_code
integer(kind=2), public :: type
integer(kind=2), public :: range
integer(kind=2), public :: special_points
integer(kind=2), public :: absolute
integer(kind=2), public :: pointsize
integer(kind=2), public :: imprint
integer(kind=2), public :: inversion
integer(kind=2), public :: leveling
integer(kind=2), public :: seconds
integer(kind=2), public :: minutes
integer(kind=2), public :: hours
integer(kind=2), public :: day
integer(kind=2), public :: month
integer(kind=2), public :: year
integer(kind=2), public :: dayof
integer(kind=2), public :: comment_size
integer(kind=2), public :: private_size
integer(kind=2), public :: nobjects
integer(kind=2), public :: acquisition
real(kind=R8), public :: lx

surface length

real(kind=R8), public :: ly

surface width

real(kind=R8), public :: lz

surface height (max -min)

real(kind=R8), public :: mu

surface mean height

real(kind=R8), public :: si

surface mean height

type, public :: OBJ_SURF

Components

TypeVisibility AttributesNameInitial
character(kind=C_CHAR), public, dimension( 12):: signature
character(kind=C_CHAR), public, dimension( 16):: xlength_unit
character(kind=C_CHAR), public, dimension( 16):: ylength_unit
character(kind=C_CHAR), public, dimension( 16):: zlength_unit
character(kind=C_CHAR), public, dimension( 16):: xaxis
character(kind=C_CHAR), public, dimension( 16):: yaxis
character(kind=C_CHAR), public, dimension( 16):: zaxis
character(kind=C_CHAR), public, dimension( 16):: dx_unit
character(kind=C_CHAR), public, dimension( 16):: dy_unit
character(kind=C_CHAR), public, dimension( 16):: dz_unit
character(kind=C_CHAR), public, dimension( 30):: object_name
character(kind=C_CHAR), public, dimension( 30):: operator_name
character(kind=C_CHAR), public, dimension(128):: client_zone
character(kind=C_CHAR), public, dimension( 8):: reserved
character(kind=C_CHAR), public, dimension( 34):: reservedzone
character(kind=C_CHAR), public, dimension( 12):: obsolete
character(kind=C_CHAR), public, dimension( 10):: obsolete2
real(kind=C_FLOAT), public :: dx
real(kind=C_FLOAT), public :: dy
real(kind=C_FLOAT), public :: dz
real(kind=C_FLOAT), public :: xunit_ratio
real(kind=C_FLOAT), public :: yunit_ratio
real(kind=C_FLOAT), public :: zunit_ratio
real(kind=C_FLOAT), public :: XOffset
real(kind=C_FLOAT), public :: YOffset
real(kind=C_FLOAT), public :: ZOffset
real(kind=C_FLOAT), public :: measurement_duration
integer(kind=C_INT), public :: zmin
integer(kind=C_INT), public :: zmax
integer(kind=C_INT), public :: xres
integer(kind=C_INT), public :: yres
integer(kind=C_INT), public :: nofpoints
integer(kind=C_SHORT), public :: format
integer(kind=C_SHORT), public :: version
integer(kind=C_SHORT), public :: material_code
integer(kind=C_SHORT), public :: type
integer(kind=C_SHORT), public :: range
integer(kind=C_SHORT), public :: special_points
integer(kind=C_SHORT), public :: absolute
integer(kind=C_SHORT), public :: pointsize
integer(kind=C_SHORT), public :: imprint
integer(kind=C_SHORT), public :: inversion
integer(kind=C_SHORT), public :: leveling
integer(kind=C_SHORT), public :: seconds
integer(kind=C_SHORT), public :: minutes
integer(kind=C_SHORT), public :: hours
integer(kind=C_SHORT), public :: day
integer(kind=C_SHORT), public :: month
integer(kind=C_SHORT), public :: year
integer(kind=C_SHORT), public :: dayof
integer(kind=C_SHORT), public :: comment_size
integer(kind=C_SHORT), public :: private_size
integer(kind=C_SHORT), public :: nobjects
integer(kind=C_SHORT), public :: acquisition
integer(kind=C_INT), public, allocatable:: val(:)

heights


Functions

private function lower(s1) result(s2)

Read more…

Arguments

Type IntentOptional AttributesName
character(len=*), intent(in) :: s1

string to transform to lower case

Return Value character(len=len(s1))

result: same string but each character is lower case

public function unit2IUc(string) result(met)

Arguments

Type IntentOptional AttributesName
character(kind=C_CHAR), intent(in), dimension(:):: string

Return Value real(kind=R8)

public function unit2IUf(string) result(met)

Arguments

Type IntentOptional AttributesName
character(len=*), intent(in) :: string

Return Value real(kind=R8)


Subroutines

public subroutine scal2surf(scal, surf)

Arguments

Type IntentOptional AttributesName
type(SCALE_SURF), intent(in) :: scal

object SCALE_SURF

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

object OBJ_SURF

public subroutine surf2scal(surf, scal)

Arguments

Type IntentOptional AttributesName
type(OBJ_SURF), intent(in) :: surf

object OBJ_SURF

type(SCALE_SURF), intent(out) :: scal

object SCALE_SURF

public subroutine empty(charinout)

Read more…

Arguments

Type IntentOptional AttributesName
character(len=*), intent(inout) :: charinout

private subroutine c_f_string(cs, fs, borne_s)

Read more…

Arguments

Type IntentOptional AttributesName
character(kind=C_CHAR), intent(in), dimension(:):: cs

C string

character(len=*), intent(out) :: fs

Fortran string

integer(kind=I4), intent(out) :: borne_s

resulting Fortran string length

private subroutine f_c_string(fs, cs)

Read more…

Arguments

Type IntentOptional AttributesName
character(len=*), intent(in) :: fs

fortran string

character(kind=C_CHAR), intent(out), dimension(:):: cs

resulting C string

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

Read more…

Arguments

Type IntentOptional AttributesName
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

public subroutine trans_surf_txt(surf, fichier, xyz)

Read more…

Arguments

Type IntentOptional AttributesName
type(OBJ_SURF), intent(in) :: surf

object OBJ_SURF

character(len=*), intent(in) :: fichier

text file to write

logical(kind=I4), intent(in) :: xyz

whether to also write the heights (maybe huge)

private subroutine open_surffile(fichier, surf, scal, dump)

Read more…

Arguments

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

file to be read

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

object that will contain the file infos and heights

type(SCALE_SURF), intent(out) :: scal

object SCALE_SURF

logical(kind=I4), intent(in), optional :: dump

whether to transform the data in a text file

private subroutine trans_surf_tab(surf, tab)

Read more…

Arguments

Type IntentOptional AttributesName
type(OBJ_SURF), intent(inout) :: surf

object OBJ_SURF that contains the heights

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

height array

public subroutine read_surf(nom_fic, mu, sq, tab_s, scal)

Read more…

Arguments

Type IntentOptional AttributesName
character(len=*), intent(in) :: nom_fic

file name

real(kind=R8), intent(in) :: mu

if > 0, values are centered

real(kind=R8), intent(in) :: sq

desired height standard deviation

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

height array

type(SCALE_SURF), intent(out) :: scal

object SCALE_SURF

private subroutine build_surf(surf, tab)

Read more…

Arguments

Type IntentOptional AttributesName
type(OBJ_SURF), intent(inout) :: surf

resulting object OBJ_SURF

real(kind=R8), intent(in), dimension(1:surf%xres, 1:surf%yres):: tab

private subroutine write_surffile(fichier, surf)

Read more…

Arguments

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

file to be written

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

object OBJ_SURF to write

public subroutine write_surf(nom_fic, tab_s, scal)

Read more…

Arguments

Type IntentOptional AttributesName
character(len=*), intent(in) :: nom_fic

file name

real(kind=R8), intent(in), dimension(1:scal%xres, 1:scal%yres):: tab_s
type(SCALE_SURF), intent(inout) :: scal

object SCALE_SURF