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

Polish

parent 102616e3
No related branches found
No related tags found
No related merge requests found
......@@ -30,13 +30,14 @@ contains
!----------------------------------------------------------------------
call new_unit(unit)
if (exist) then
open(unit, file = "SHPC_cyclo/used_nml.txt", status = "old", &
action = "read", position = "rewind")
read(unit, nml = config_nml)
close(unit)
else
print *, "config: Reading config_nml.txt..."
open(unit, file = "config_nml.txt", status = "old", action = "read", &
position = "rewind")
read(unit, nml = config_nml)
......
......@@ -76,9 +76,9 @@ contains
! As we are requiring the grid spacing to be uniform, the value of
! "periodic" may be deduced from the values of step(1) and nlon:
periodic = nint(twopi / step(1)) == nlon
print *, "inst_eddies: periodic = ", periodic
print *, "input_ssh: periodic = ", periodic
call assert(2 * max_radius_deg(1) < 180., "inst_eddies max_radius_deg")
call assert(2 * max_radius_deg(1) < 180., "input_ssh: max_radius_deg")
! (Let us require this even if not periodic. This is clearer.)
max_radius = nint(max_radius_deg / step_deg)
......
......@@ -28,9 +28,9 @@ def loop_inst_eddies(files, bbox, d):
sys.exit(inst_eddies_exe + " not found or not executable")
if os.access("config_nml.txt", os.R_OK):
print("Will use config_nml.txt.")
print("inst_eddies.loop_inst_eddies: Will use config_nml.txt.")
else:
sys.exit('inst_eddies.py: "config_nml.txt" not found')
sys.exit('"config_nml.txt" not found')
nco_instance = nco.Nco()
......@@ -45,8 +45,9 @@ def loop_inst_eddies(files, bbox, d):
writer.writerow(["date", "elapsed_NCO", "elapsed_Fortran"])
for nc_file in files:
print("inst_eddies.py: Date:", d)
print("Input file:", nc_file)
print("inst_eddies.loop_inst_eddies: Date:", d)
print("inst_eddies.loop_inst_eddies: Input file:", nc_file,
flush = True)
if os.access(nc_file, os.F_OK):
my_pc = time.perf_counter()
......@@ -73,7 +74,7 @@ def loop_inst_eddies(files, bbox, d):
os.remove("uv.nc")
writer.writerow([d, elapsed_NCO, elapsed_Fortran])
else:
print("inst_eddies.py: Missing file:", nc_file)
print("inst_eddies.loop_inst_eddies: Missing file:", nc_file)
for orient in ["cyclo", "anti"]:
with open(f"SHPC_{orient}/ishape_last.txt", "a") \
......@@ -98,6 +99,6 @@ if __name__ == "__main__":
argparser.add_argument("-b", "--bbox", nargs=4, type = float,
metavar = ("xmin", "xmax", "ymin", "ymax"))
args = argparser.parse_args()
d = input("Enter first date index (integer value):")
d = input("Enter first date index (integer value): ")
d = int(d)
loop_inst_eddies(args.file, args.bbox, d)
......@@ -16,7 +16,7 @@ contains
use write_extr_map_m, only: write_extr_map
type(snapshot), intent(in):: s
real, intent(in):: corner(:) ! (2)
! longitude and latitude of the corner of the whole grid in input
! NetCDF, in degrees
......
......@@ -3,8 +3,8 @@ program test_overlap
use, intrinsic:: ISO_FORTRAN_ENV
! Libraries:
use jumble, only: get_command_arg_dyn, read_opcol, new_unit, ediff1d
use jumble, only: deg_to_rad, assert
use jumble, only: get_command_arg_dyn, read_opcol, new_unit, ediff1d, &
deg_to_rad, assert
use shapelib_03, only: dbf_read_attribute_03
use derived_types, only: snapshot, shpc_slice_handler, shpc_slice_meta
......
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