Routines to handle Digital Surf binary format (.sur)
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer(kind=4), | private, | parameter | :: | SURF_DAT | = | 1 |
‘.dat’ format, txt |
integer(kind=4), | private, | parameter | :: | SURF_SUR | = | 2 |
‘.sur’ format, binary |
C like surface object: header and heights
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
real(kind=C_FLOAT), | public | :: | XOffset | ||||
real(kind=C_FLOAT), | public | :: | YOffset | ||||
real(kind=C_FLOAT), | public | :: | ZOffset | ||||
integer(kind=C_SHORT), | public | :: | absolute | ||||
integer(kind=C_SHORT), | public | :: | acquisition | ||||
character(kind=C_CHAR, len=1), | public, | dimension(128) | :: | client_zone | |||
integer(kind=C_SHORT), | public | :: | comment_size | ||||
integer(kind=C_SHORT), | public | :: | day | ||||
integer(kind=C_SHORT), | public | :: | dayof | ||||
real(kind=C_FLOAT), | public | :: | dx | ||||
character(kind=C_CHAR, len=1), | public, | dimension( 16) | :: | dx_unit | |||
real(kind=C_FLOAT), | public | :: | dy | ||||
character(kind=C_CHAR, len=1), | public, | dimension( 16) | :: | dy_unit | |||
real(kind=C_FLOAT), | public | :: | dz | ||||
character(kind=C_CHAR, len=1), | public, | dimension( 16) | :: | dz_unit | |||
integer(kind=C_SHORT), | public | :: | format | ||||
integer(kind=C_SHORT), | public | :: | hours | ||||
integer(kind=C_SHORT), | public | :: | imprint | ||||
integer(kind=C_SHORT), | public | :: | inversion | ||||
integer(kind=C_SHORT), | public | :: | leveling | ||||
integer(kind=C_SHORT), | public | :: | material_code | ||||
real(kind=C_FLOAT), | public | :: | measurement_duration | ||||
integer(kind=C_SHORT), | public | :: | minutes | ||||
integer(kind=C_SHORT), | public | :: | month | ||||
integer(kind=C_SHORT), | public | :: | nobjects | ||||
integer(kind=C_INT), | public | :: | nofpoints | ||||
character(kind=C_CHAR, len=1), | public, | dimension( 30) | :: | object_name | |||
character(kind=C_CHAR, len=1), | public, | dimension( 12) | :: | obsolete | |||
character(kind=C_CHAR, len=1), | public, | dimension( 10) | :: | obsolete2 | |||
character(kind=C_CHAR, len=1), | public, | dimension( 30) | :: | operator_name | |||
integer(kind=C_SHORT), | public | :: | pointsize | ||||
integer(kind=C_SHORT), | public | :: | private_size | ||||
integer(kind=C_SHORT), | public | :: | range | ||||
character(kind=C_CHAR, len=1), | public, | dimension( 8) | :: | reserved | |||
character(kind=C_CHAR, len=1), | public, | dimension( 34) | :: | reservedzone | |||
integer(kind=C_SHORT), | public | :: | seconds | ||||
character(kind=C_CHAR, len=1), | public, | dimension( 12) | :: | signature | |||
integer(kind=C_SHORT), | public | :: | special_points | ||||
integer(kind=C_SHORT), | public | :: | type | ||||
integer(kind=C_INT), | public, | allocatable | :: | val(:) |
heights |
||
integer(kind=C_SHORT), | public | :: | version | ||||
character(kind=C_CHAR, len=1), | public, | dimension( 16) | :: | xaxis | |||
character(kind=C_CHAR, len=1), | public, | dimension( 16) | :: | xlength_unit | |||
integer(kind=C_INT), | public | :: | xres | ||||
real(kind=C_FLOAT), | public | :: | xunit_ratio | ||||
character(kind=C_CHAR, len=1), | public, | dimension( 16) | :: | yaxis | |||
integer(kind=C_SHORT), | public | :: | year | ||||
character(kind=C_CHAR, len=1), | public, | dimension( 16) | :: | ylength_unit | |||
integer(kind=C_INT), | public | :: | yres | ||||
real(kind=C_FLOAT), | public | :: | yunit_ratio | ||||
character(kind=C_CHAR, len=1), | public, | dimension( 16) | :: | zaxis | |||
character(kind=C_CHAR, len=1), | public, | dimension( 16) | :: | zlength_unit | |||
integer(kind=C_INT), | public | :: | zmax | ||||
integer(kind=C_INT), | public | :: | zmin | ||||
real(kind=C_FLOAT), | public | :: | zunit_ratio |
Fortran typed surface object: header, dimensions, mean and std
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
real(kind=R4), | public | :: | XOffset | ||||
real(kind=R4), | public | :: | YOffset | ||||
real(kind=R4), | public | :: | ZOffset | ||||
integer(kind=2), | public | :: | absolute | ||||
integer(kind=2), | public | :: | acquisition | ||||
character(len=128), | public | :: | client_zone | ||||
integer(kind=2), | public | :: | comment_size | ||||
integer(kind=2), | public | :: | day | ||||
integer(kind=2), | public | :: | dayof | ||||
real(kind=R4), | public | :: | dx | ||||
character(len=16), | public | :: | dx_unit | ||||
real(kind=R4), | public | :: | dy | ||||
character(len=16), | public | :: | dy_unit | ||||
real(kind=R4), | public | :: | dz | ||||
character(len=16), | public | :: | dz_unit | ||||
integer(kind=2), | public | :: | format | ||||
integer(kind=2), | public | :: | hours | ||||
integer(kind=2), | public | :: | imprint | ||||
integer(kind=2), | public | :: | inversion | ||||
integer(kind=2), | public | :: | leveling | ||||
real(kind=R8), | public | :: | lx |
surface length |
|||
real(kind=R8), | public | :: | ly |
surface width |
|||
real(kind=R8), | public | :: | lz |
surface height (max -min) |
|||
integer(kind=2), | public | :: | material_code | ||||
real(kind=R4), | public | :: | measurement_duration | ||||
integer(kind=2), | public | :: | minutes | ||||
integer(kind=2), | public | :: | month | ||||
real(kind=R8), | public | :: | mu |
surface mean height |
|||
integer(kind=2), | public | :: | nobjects | ||||
integer(kind=I4), | public | :: | nofpoints | ||||
character(len=30), | public | :: | object_name | ||||
character(len=12), | public | :: | obsolete | ||||
character(len=10), | public | :: | obsolete2 | ||||
character(len=30), | public | :: | operator_name | ||||
integer(kind=2), | public | :: | pointsize | ||||
integer(kind=2), | public | :: | private_size | ||||
integer(kind=2), | public | :: | range | ||||
character(len=8), | public | :: | reserved | ||||
character(len=34), | public | :: | reservedzone | ||||
integer(kind=2), | public | :: | seconds | ||||
real(kind=R8), | public | :: | si |
surface mean height |
|||
character(len=12), | public | :: | signature | ||||
integer(kind=2), | public | :: | special_points | ||||
integer(kind=2), | public | :: | type | ||||
integer(kind=2), | public | :: | version | ||||
character(len=16), | public | :: | xaxis | ||||
character(len=16), | public | :: | xlength_unit | ||||
integer(kind=I4), | public | :: | xres | ||||
real(kind=R4), | public | :: | xunit_ratio | ||||
character(len=16), | public | :: | yaxis | ||||
integer(kind=2), | public | :: | year | ||||
character(len=16), | public | :: | ylength_unit | ||||
integer(kind=I4), | public | :: | yres | ||||
real(kind=R4), | public | :: | yunit_ratio | ||||
character(len=16), | public | :: | zaxis | ||||
character(len=16), | public | :: | zlength_unit | ||||
integer(kind=I4), | public | :: | zmax | ||||
integer(kind=I4), | public | :: | zmin | ||||
real(kind=R4), | public | :: | zunit_ratio |
Converts uppercase to lowercase, adapted from here
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | s1 |
string to transform to lower case |
result: same string but each character is lower case
Convert a C type unit string into value (m)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(kind=C_CHAR, len=1), | intent(in), | dimension(:) | :: | string |
Convert a unit string into value (m)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | string |
Converts a C string to a Fortran string
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(kind=C_CHAR, len=1), | intent(in), | dimension(:) | :: | cs |
C string |
|
character(len=*), | intent(out) | :: | fs |
Fortran string |
||
integer(kind=I4), | intent(out) | :: | lngth_s |
resulting Fortran string length |
Just empties a string
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(inout) | :: | charinout |
Converts a Fortran string to a C string
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | fs |
fortran string |
||
character(kind=C_CHAR, len=1), | intent(out), | dimension(:) | :: | cs |
resulting C string |
OBJ_SURF initialization, every unit is m
Type | Intent | Optional | 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 |
Subroutine that opens a .sur
file and transfers it contents into an object OBJ_SURF
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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 |
Subroutine that opens a surface file .sur
or .dat
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | nom_fic |
file name |
||
real(kind=R8), | intent(in), | optional | :: | mu |
desired mean |
|
real(kind=R8), | intent(in), | optional | :: | 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 |
Transform a SCALE_SURF object into a OBJ_SURF object
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(SCALE_SURF), | intent(in) | :: | scal |
object SCALE_SURF |
||
type(OBJ_SURF), | intent(out) | :: | surf |
object OBJ_SURF |
Transform a OBJ_SURF object into a SCALE_SURF object
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(OBJ_SURF), | intent(in) | :: | surf |
object OBJ_SURF |
||
type(SCALE_SURF), | intent(out) | :: | scal |
object SCALE_SURF |
Writes an OBJ_SURF object in a text file
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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) |
Writes a height array into a surface file .sur
or .dat
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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 |