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

Rename variable `n_shpc` to `n_slices`

parent 9cff0dd4
No related branches found
No related tags found
No related merge requests found
...@@ -50,10 +50,10 @@ program eddy_graph ...@@ -50,10 +50,10 @@ program eddy_graph
logical periodic ! grid is periodic in longitude logical periodic ! grid is periodic in longitude
integer unit_isolated, unit integer unit_isolated, unit
integer n_shpc ! number of input SHPC directories integer n_slices ! number of input SHPC directories
integer e_overestim ! over-estimation of the number of eddies at each date integer e_overestim ! over-estimation of the number of eddies at each date
TYPE(shpc_slice_handler), allocatable:: hshpc(:) ! (n_shpc) TYPE(shpc_slice_handler), allocatable:: hshpc(:) ! (n_slices)
type(shpc_slice_meta), allocatable:: ssm(:) ! (n_shpc) type(shpc_slice_meta), allocatable:: ssm(:) ! (n_slices)
type(snapshot), allocatable:: flow(:) ! (max_delta + 1) type(snapshot), allocatable:: flow(:) ! (max_delta + 1)
character(len = 30) file character(len = 30) file
...@@ -69,15 +69,15 @@ program eddy_graph ...@@ -69,15 +69,15 @@ program eddy_graph
call MPI_Comm_size(MPI_Comm_world, n_proc) call MPI_Comm_size(MPI_Comm_world, n_proc)
if (rank == 0) then if (rank == 0) then
n_shpc = COMMAND_ARGUMENT_COUNT() n_slices = COMMAND_ARGUMENT_COUNT()
call assert(n_shpc /= 0, & call assert(n_slices /= 0, &
"Required arguments: SHPC-directory [SHPC-directory] ...") "Required arguments: SHPC-directory [SHPC-directory] ...")
end if end if
call ezmpi_bcast(n_shpc, root = 0) call ezmpi_bcast(n_slices, root = 0)
allocate(hshpc(n_shpc), ssm(n_shpc)) allocate(hshpc(n_slices), ssm(n_slices))
do i = 1, n_shpc do i = 1, n_slices
call get_command_arg_dyn(i, shpc_dir) call get_command_arg_dyn(i, shpc_dir)
call shpc_open(hshpc(i), trim(shpc_dir), pszaccess = "rb") call shpc_open(hshpc(i), trim(shpc_dir), pszaccess = "rb")
call dbf_read_attribute_03(ssm(i)%d0, hshpc(i)%extremum, & call dbf_read_attribute_03(ssm(i)%d0, hshpc(i)%extremum, &
...@@ -99,7 +99,7 @@ program eddy_graph ...@@ -99,7 +99,7 @@ program eddy_graph
read(unit = *, nml = main_nml) read(unit = *, nml = main_nml)
write(unit = *, nml = main_nml) write(unit = *, nml = main_nml)
call assert(max_delta >= 1, "eddy_graph max_delta") call assert(max_delta >= 1, "eddy_graph max_delta")
call assert(n_dates == huge(0) .or. n_shpc == 1, "If we have several " & call assert(n_dates == huge(0) .or. n_slices == 1, "If we have several " &
// "SHPC directories, then we read all the dates from them") // "SHPC directories, then we read all the dates from them")
! As we are requiring the grid spacing to be uniform, the value of ! As we are requiring the grid spacing to be uniform, the value of
...@@ -111,14 +111,14 @@ program eddy_graph ...@@ -111,14 +111,14 @@ program eddy_graph
copy = merge(dist_lim, 0, periodic) copy = merge(dist_lim, 0, periodic)
if (n_dates == huge(0)) & if (n_dates == huge(0)) &
n_dates = sum([(size(ssm(i)%ishape_last), i = 1, n_shpc)]) n_dates = sum([(size(ssm(i)%ishape_last), i = 1, n_slices)])
print *, "n_dates = ", n_dates print *, "n_dates = ", n_dates
call assert(n_dates >= max_delta + 1, & call assert(n_dates >= max_delta + 1, &
"eddy_graph: n_dates should be >= max_delta + 1") "eddy_graph: n_dates should be >= max_delta + 1")
call assert(n_proc <= n_dates / (max_delta + 1), & call assert(n_proc <= n_dates / (max_delta + 1), &
"eddy_graph: n_proc should be <= n_dates / (max_delta + 1)") "eddy_graph: n_proc should be <= n_dates / (max_delta + 1)")
e_overestim = maxval([(ssm(i)%ishape_last(ssm(i)%d0) + 1, & e_overestim = maxval([(ssm(i)%ishape_last(ssm(i)%d0) + 1, &
ediff1d(ssm(i)%ishape_last), i = 1, n_shpc)]) ediff1d(ssm(i)%ishape_last), i = 1, n_slices)])
open(unit, file = "e_overestim.txt", status = "replace", action = "write") open(unit, file = "e_overestim.txt", status = "replace", action = "write")
write(unit, fmt = *) e_overestim write(unit, fmt = *) e_overestim
close(unit) close(unit)
...@@ -213,7 +213,7 @@ program eddy_graph ...@@ -213,7 +213,7 @@ program eddy_graph
! 5. Back matter ! 5. Back matter
do i = 1, n_shpc do i = 1, n_slices
CALL shpc_close(hshpc(i)) CALL shpc_close(hshpc(i))
end do end do
......
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