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

Move reading of `d_init` up

Before reading `ishape_last`, because we are going to use `d_init` as
lower bound of `ishape_last`.
parent 8d1e52e0
No related branches found
No related tags found
No related merge requests found
...@@ -75,6 +75,13 @@ program test_get_dispatch_snap ...@@ -75,6 +75,13 @@ program test_get_dispatch_snap
if (periodic) call assert(2 * dist_lim * step(1) < 180., & if (periodic) call assert(2 * dist_lim * step(1) < 180., &
"test_get_dispatch_snap dist_lim") "test_get_dispatch_snap dist_lim")
copy = merge(dist_lim, 0, periodic) copy = merge(dist_lim, 0, periodic)
end if
call shpc_open(hshp, trim(shpc_dir), rank, pszaccess = "rb")
if (rank == 0) then
call dbf_read_attribute_03(d_init, hshp%extremum, hshp%extr_date, &
ishape = 0)
call read_column(ishape_last, & call read_column(ishape_last, &
file = trim(shpc_dir) // "/ishape_last.txt") file = trim(shpc_dir) // "/ishape_last.txt")
n_dates = size(ishape_last) n_dates = size(ishape_last)
...@@ -92,9 +99,6 @@ program test_get_dispatch_snap ...@@ -92,9 +99,6 @@ program test_get_dispatch_snap
call ezmpi_bcast(n_dates, root = 0) call ezmpi_bcast(n_dates, root = 0)
if (rank /= 0) allocate(ishape_last(n_dates)) if (rank /= 0) allocate(ishape_last(n_dates))
call ezmpi_bcast(ishape_last, root = 0) call ezmpi_bcast(ishape_last, root = 0)
call shpc_open(hshp, trim(shpc_dir), rank, pszaccess = "rb")
if (rank == 0) call dbf_read_attribute_03(d_init, hshp%extremum, &
hshp%extr_date, ishape = 0)
call ezmpi_bcast(d_init, root = 0) call ezmpi_bcast(d_init, root = 0)
k_begin = d_init + (rank * n_dates) / n_proc k_begin = d_init + (rank * n_dates) / n_proc
......
...@@ -66,13 +66,13 @@ program test_overlap ...@@ -66,13 +66,13 @@ program test_overlap
corner = corner_deg * deg_to_rad corner = corner_deg * deg_to_rad
step = step_deg * deg_to_rad step = step_deg * deg_to_rad
allocate(flow(max_delta + 1)) allocate(flow(max_delta + 1))
call shpc_open(hshp, trim(shpc_dir), rank = 0, pszaccess = "rb")
call dbf_read_attribute_03(d_init, hshp%extremum, hshp%extr_date, ishape = 0)
call read_column(ishape_last, file = trim(shpc_dir) // "/ishape_last.txt") call read_column(ishape_last, file = trim(shpc_dir) // "/ishape_last.txt")
n_dates = size(ishape_last) n_dates = size(ishape_last)
call assert(d_init <= [k_test_1, k_test_2] .and. [k_test_1, k_test_2] & call assert(d_init <= [k_test_1, k_test_2] .and. [k_test_1, k_test_2] &
< d_init + n_dates, "test_overlap k_test_1, k_test_2") < d_init + n_dates, "test_overlap k_test_1, k_test_2")
e_overestim = maxval([ishape_last(1) + 1, ediff1d(ishape_last)]) e_overestim = maxval([ishape_last(1) + 1, ediff1d(ishape_last)])
call shpc_open(hshp, trim(shpc_dir), rank = 0, pszaccess = "rb")
call dbf_read_attribute_03(d_init, hshp%extremum, hshp%extr_date, ishape = 0)
open(unit, file = "node_id_param.json", status = "replace", & open(unit, file = "node_id_param.json", status = "replace", &
action = "write") action = "write")
write(unit, fmt = *) '{"e_overestim": ', e_overestim, '}' write(unit, fmt = *) '{"e_overestim": ', e_overestim, '}'
......
...@@ -84,6 +84,13 @@ program test_send_recv ...@@ -84,6 +84,13 @@ program test_send_recv
if (periodic) call assert(2 * dist_lim * step_deg(1) < 180., & if (periodic) call assert(2 * dist_lim * step_deg(1) < 180., &
"test_send_recv dist_lim") "test_send_recv dist_lim")
copy = merge(dist_lim, 0, periodic) copy = merge(dist_lim, 0, periodic)
end if
call shpc_open(hshp, trim(shpc_dir), rank, pszaccess = "rb")
if (rank == 0) then
call dbf_read_attribute_03(d_init, hshp%extremum, hshp%extr_date, &
ishape = 0)
call read_column(ishape_last, & call read_column(ishape_last, &
file = trim(shpc_dir) // "/ishape_last.txt") file = trim(shpc_dir) // "/ishape_last.txt")
n_dates = size(ishape_last) n_dates = size(ishape_last)
...@@ -98,9 +105,6 @@ program test_send_recv ...@@ -98,9 +105,6 @@ program test_send_recv
if (rank == 1) allocate(ishape_last(n_dates)) if (rank == 1) allocate(ishape_last(n_dates))
call ezmpi_bcast(ishape_last, root = 0) call ezmpi_bcast(ishape_last, root = 0)
call shpc_open(hshp, trim(shpc_dir), rank, pszaccess = "rb")
if (rank == 0) call dbf_read_attribute_03(d_init, hshp%extremum, &
hshp%extr_date, ishape = 0)
call ezmpi_bcast(d_init, root = 0) call ezmpi_bcast(d_init, root = 0)
if (rank == 1) call read_snapshot(s, hshp, nlon, nlat, d_init, k = d_init, & if (rank == 1) call read_snapshot(s, hshp, nlon, nlat, d_init, k = d_init, &
corner = corner_deg * deg_to_rad, step = step_deg * deg_to_rad, & corner = corner_deg * deg_to_rad, step = step_deg * deg_to_rad, &
......
...@@ -91,6 +91,13 @@ program eddy_graph ...@@ -91,6 +91,13 @@ program eddy_graph
if (periodic) call assert(2 * dist_lim * step_deg(1) < 180., & if (periodic) call assert(2 * dist_lim * step_deg(1) < 180., &
"eddy_graph dist_lim") "eddy_graph dist_lim")
copy = merge(dist_lim, 0, periodic) copy = merge(dist_lim, 0, periodic)
end if
call shpc_open(hshp, trim(shpc_dir), rank, pszaccess = "rb")
if (rank == 0) then
call dbf_read_attribute_03(d_init, hshp%extremum, hshp%extr_date, &
ishape = 0)
call read_column(ishape_last, & call read_column(ishape_last, &
file = trim(shpc_dir) // "/ishape_last.txt", last = n_dates) file = trim(shpc_dir) // "/ishape_last.txt", last = n_dates)
if (n_dates == huge(0)) n_dates = size(ishape_last) if (n_dates == huge(0)) n_dates = size(ishape_last)
...@@ -115,10 +122,6 @@ program eddy_graph ...@@ -115,10 +122,6 @@ program eddy_graph
if (rank /= 0) allocate(ishape_last(n_dates)) if (rank /= 0) allocate(ishape_last(n_dates))
call ezmpi_bcast(ishape_last, root = 0) call ezmpi_bcast(ishape_last, root = 0)
call ezmpi_bcast(e_overestim, root = 0) call ezmpi_bcast(e_overestim, root = 0)
call shpc_open(hshp, trim(shpc_dir), rank, pszaccess = "rb")
if (rank == 0) call dbf_read_attribute_03(d_init, hshp%extremum, &
hshp%extr_date, ishape = 0)
call ezmpi_bcast(d_init, root = 0) call ezmpi_bcast(d_init, root = 0)
if (rank == 0) then if (rank == 0) then
......
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