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

Write periodic to `grid_nml.txt`

So that the program `eddy_graph` can read it, instead of deducing it
from the longitude coordinate.
parent 12c21b42
No related branches found
No related tags found
No related merge requests found
...@@ -48,7 +48,7 @@ contains ...@@ -48,7 +48,7 @@ contains
real:: step_deg(2) = huge(0.) ! longitude and latitude steps, in degrees real:: step_deg(2) = huge(0.) ! longitude and latitude steps, in degrees
real lon_max, lat_max ! longitude and latitude, in degrees real lon_max, lat_max ! longitude and latitude, in degrees
integer copy integer copy
namelist /grid_nml/ corner_deg, step_deg, nlon, nlat namelist /grid_nml/ corner_deg, step_deg, nlon, nlat, periodic
!---------------------------------------------------------------------- !----------------------------------------------------------------------
......
...@@ -6,7 +6,7 @@ module read_grid_m ...@@ -6,7 +6,7 @@ module read_grid_m
! size of ssh array in input NetCDF file, assuming no repeated point ! size of ssh array in input NetCDF file, assuming no repeated point
! if the grid is global ! if the grid is global
logical, protected:: periodic ! grid is periodic in longitude logical, protected:: periodic = .false. ! grid is periodic in longitude
real, protected:: corner(2) real, protected:: corner(2)
! longitude and latitude of the corner of the whole grid in input ! longitude and latitude of the corner of the whole grid in input
...@@ -38,7 +38,7 @@ contains ...@@ -38,7 +38,7 @@ contains
real:: step_deg(2) = [huge(0.), huge(0.)] real:: step_deg(2) = [huge(0.), huge(0.)]
! longitude and latitude steps, in degrees ! longitude and latitude steps, in degrees
namelist /grid_nml/ corner_deg, step_deg, nlon, nlat namelist /grid_nml/ corner_deg, step_deg, nlon, nlat, periodic
!----------------------------------------------------------------- !-----------------------------------------------------------------
...@@ -48,12 +48,6 @@ contains ...@@ -48,12 +48,6 @@ contains
action = "read", position = "rewind") action = "read", position = "rewind")
read(unit, nml = grid_nml) read(unit, nml = grid_nml)
close(unit) close(unit)
! As we are requiring the grid spacing to be uniform, the value of
! "periodic" may be deduced from the values of step_deg(1) and nlon:
periodic = nint(360. / step_deg(1)) == nlon
print *, "periodic = ", periodic
corner = corner_deg * deg_to_rad corner = corner_deg * deg_to_rad
step = step_deg * deg_to_rad step = step_deg * deg_to_rad
end if end if
......
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