Subroutine that saves a surface file .dat
Type | Intent | Optional | 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 |
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