Skip to content
Snippets Groups Projects
Commit eb979ef4 authored by Lionel GUEZ's avatar Lionel GUEZ
Browse files

Generalize `test_read_snapshot` to read any date

Use the first date of the SHPC as default date to read.
parent 627df958
No related branches found
No related tags found
No related merge requests found
......@@ -17,7 +17,7 @@ program test_read_snapshot
character(len = :), allocatable:: shpc_dir
type(snapshot) s
TYPE(shpc) hshp
integer copy, unit
integer copy, unit, k
real:: corner_deg(2) = [0.125, - 59.875]
! longitude and latitude of the corner of the whole grid in input
......@@ -34,7 +34,7 @@ program test_read_snapshot
! We look for an overlapping eddy at dist_lim (in grid points) of
! the first extremum.
namelist /main_nml/ dist_lim
namelist /main_nml/ dist_lim, k
namelist /grid_nml/ corner_deg, step_deg, nlon, nlat
!-------------------------------------------------------------------------
......@@ -56,16 +56,17 @@ program test_read_snapshot
copy = merge(dist_lim, 0, periodic)
call shpc_open(hshp, trim(shpc_dir), pszaccess = "rb")
k = hshp%d0
write(unit = error_unit, nml = main_nml)
write(unit = error_unit, fmt = *) "Enter namelist main_nml."
read(unit = *, nml = main_nml)
write(unit = *, nml = main_nml)
call read_snapshot(s, [hshp], nlon, nlat, k = hshp%d0, &
call read_snapshot(s, [hshp], nlon, nlat, k, &
corner = corner_deg * deg_to_rad, step = step_deg * deg_to_rad, &
copy = copy)
CALL shpc_close(hshp)
call write_snapshot(s, corner_deg, step_deg, nlon, nlat, copy, hshp%d0)
call write_snapshot(s, corner_deg, step_deg, nlon, nlat, copy, k)
end program test_read_snapshot
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment