save_surf Subroutine

subroutine save_surf(nom_fic, tab_s, nx, ny)

Subroutine that saves a surface file .dat

Arguments

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

file name

real(kind=R8), intent(in), dimension(1:nx, 1:ny) :: tab_s

height array

integer(kind=I4), intent(in) :: nx

number of pixels along x

integer(kind=I4), intent(in) :: ny

number of pixels along y


Calls

proc~~save_surf~~CallsGraph proc~save_surf save_surf proc~get_unit~2 get_unit proc~save_surf->proc~get_unit~2

Called by

proc~~save_surf~~CalledByGraph proc~save_surf save_surf program~test_fftw3 test_fftw3 program~test_fftw3->proc~save_surf

Source Code

   subroutine save_surf(nom_fic, tab_s, nx, ny)
   !! Subroutine that saves a surface file ```.dat```
   implicit none
   character(len=*), intent(in)                          :: nom_fic  !! *file name*
   integer(kind=I4), intent(in)                          :: nx       !! *number of pixels along x*
   integer(kind=I4), intent(in)                          :: ny       !! *number of pixels along y*
   real   (kind=R8), intent(in), dimension(1:nx, 1:ny)   :: tab_s    !! *height array*

      integer(kind=I4) :: i, j, k

      call get_unit(k)

      open( unit = k, file = trim(nom_fic), status = 'unknown')

         do i = 1, nx
            do j = 1, ny
               write(k, *) i, j, tab_s(i, j)
            enddo
         enddo

      close(k)

   return
   endsubroutine save_surf