Note
Function that save an array tab as a digital surf file.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=R8), | intent(in), | dimension(:,:) | :: | tab |
a surface to save as a .sur file |
subroutine save_img(tab) !================================================================================================ !<@note Function that save an array *tab* as a digital surf file. ! !<@endnote !------------------------------------------------------------------------------------------------ implicit none real(kind=R8), intent(in), dimension(:,:) :: tab !! *a surface to save as a .sur file* integer(kind=I4) :: w ! image width integer(kind=I4) :: h ! image height integer(kind=I4), dimension(1:2) :: shape_tab character(len=512) :: nom_surf type(SCALE_SURF) :: scale_img shape_tab = shape( tab ) w = shape_tab(1) h = shape_tab(2) nom_surf = repeat (" ", len(nom_surf) ) read(JOB,*) nom_surf ; LINE_READ = LINE_READ + 1 ; write(SPY,*) "line: ", LINE_READ, trim(nom_surf) call init_scal( scal = scale_img, & ! out; creates a surface type, containing ... nx = w, & ! in; ... the number of points along x ... ny = h, & ! in; ... the number of points along y ... lx = PARAM%surf_width, & ! in; ... the length (default unit : m) ... ly = PARAM%surf_height, & ! in; ... the width ... unit_z = 'm' ) ! in; ... and the unit along z. call write_surf( nom_fic = trim(nom_surf), & ! tab_s = tab(1:w, 1:h), & ! scal = scale_img ) ! return endsubroutine save_img