diff --git a/Common/shpc_open.F90 b/Common/shpc_open.F90 index 01da636c27e857bd6e7291aad11d8bb74330c8f1..b943c2d7a616d82489380a8eb5bcbfd5bb5d87de 100644 --- a/Common/shpc_open.F90 +++ b/Common/shpc_open.F90 @@ -7,8 +7,8 @@ contains subroutine shpc_open(hshp, shpc_dir, pszaccess) ! Libraries: - USE jumble, only: new_unit - use shapelib_03, only: shp_open_03 + USE jumble, only: new_unit, read_column + use shapelib_03, only: shp_open_03, dbf_read_attribute_03 use derived_types, only: shpc use read_field_indices_m, only: read_field_indices @@ -36,6 +36,10 @@ contains close(unit) hshp%cyclone = trim(adjustl(orientation)) == "cyclones" hshp%dir = shpc_dir + call dbf_read_attribute_03(hshp%d0, hshp%extremum, hshp%extr_date, & + ishape = 0) + call read_column(hshp%ishape_last, file = shpc_dir // "/ishape_last.txt", & + my_lbound = hshp%d0) end subroutine shpc_open diff --git a/Inst_eddies/Tests/test_nearby_extr.f90 b/Inst_eddies/Tests/test_nearby_extr.f90 index 183e7405fd107bea9ad14f740a000db30498a8c3..d48d5dfb0225ee6abae3502be2cfebc0f65a48d7 100644 --- a/Inst_eddies/Tests/test_nearby_extr.f90 +++ b/Inst_eddies/Tests/test_nearby_extr.f90 @@ -44,12 +44,6 @@ program test_nearby_extr close(unit) call shpc_open(hshp, trim(shpc_dir), pszaccess = "rb") - call dbf_read_attribute_03(hshp%d0, hshp%extremum, hshp%extr_date, ishape = 0) - open(unit, file = shpc_dir // "/ishape_last.txt", status = "old", & - action = "read", position = "rewind") - allocate(hshp%ishape_last(hshp%d0:hshp%d0)) - read(unit, fmt = *) hshp%ishape_last ! first date - close(unit) call read_snapshot(s, hshp, nlon, nlat, k = hshp%d0, & corner = corner_deg * deg_to_rad, step = step_deg * deg_to_rad, & copy = 0) diff --git a/Overlap/Tests/test_get_dispatch_snap.f90 b/Overlap/Tests/test_get_dispatch_snap.f90 index 4681a548b092787890a3d5cef5fcef67039de1e7..2d018663107e26851e89afd5f3a91bf91a3e1d51 100644 --- a/Overlap/Tests/test_get_dispatch_snap.f90 +++ b/Overlap/Tests/test_get_dispatch_snap.f90 @@ -75,10 +75,6 @@ program test_get_dispatch_snap call shpc_open(hshp, trim(shpc_dir), pszaccess = "rb") if (rank == 0) then - call dbf_read_attribute_03(hshp%d0, hshp%extremum, hshp%extr_date, & - ishape = 0) - call read_column(hshp%ishape_last, & - file = trim(shpc_dir) // "/ishape_last.txt", my_lbound = hshp%d0) n_dates = size(hshp%ishape_last) call new_unit(unit_isolated) open(unit_isolated, file = "isolated_nodes.txt", status = "replace", & @@ -92,9 +88,6 @@ program test_get_dispatch_snap call ezmpi_bcast(k, root = 0) call ezmpi_bcast(copy, root = 0) call ezmpi_bcast(n_dates, root = 0) - call ezmpi_bcast(hshp%d0, root = 0) - if (rank /= 0) allocate(hshp%ishape_last(hshp%d0:hshp%d0 + n_dates - 1)) - call ezmpi_bcast(hshp%ishape_last, root = 0) k_begin = hshp%d0 + (rank * n_dates) / n_proc if (rank < n_proc - 1) then diff --git a/Overlap/Tests/test_overlap.f90 b/Overlap/Tests/test_overlap.f90 index 689b9b828ce6efb0244b9d60f413ba08629617d1..a120d40727c4f97a79f1e69b65068a8f05b1664b 100644 --- a/Overlap/Tests/test_overlap.f90 +++ b/Overlap/Tests/test_overlap.f90 @@ -65,9 +65,6 @@ program test_overlap step = step_deg * deg_to_rad allocate(flow(max_delta + 1)) call shpc_open(hshp, trim(shpc_dir), pszaccess = "rb") - call dbf_read_attribute_03(hshp%d0, hshp%extremum, hshp%extr_date, ishape = 0) - call read_column(hshp%ishape_last, & - file = trim(shpc_dir) // "/ishape_last.txt", my_lbound = hshp%d0) n_dates = size(hshp%ishape_last) call assert(hshp%d0 <= [k_test_1, k_test_2] .and. [k_test_1, k_test_2] & < hshp%d0 + n_dates, "test_overlap k_test_1, k_test_2") diff --git a/Overlap/Tests/test_read_snapshot.f90 b/Overlap/Tests/test_read_snapshot.f90 index 1eb2481cf1a7700c2898616f598f99e18753cc0e..f3959b166a4637127cf5c4bc46b4e3553339e401 100644 --- a/Overlap/Tests/test_read_snapshot.f90 +++ b/Overlap/Tests/test_read_snapshot.f90 @@ -62,12 +62,6 @@ program test_read_snapshot copy = merge(dist_lim, 0, periodic) call shpc_open(hshp, trim(shpc_dir), pszaccess = "rb") - call dbf_read_attribute_03(hshp%d0, hshp%extremum, hshp%extr_date, ishape = 0) - open(unit, file = shpc_dir // "/ishape_last.txt", status = "old", & - action = "read", position = "rewind") - allocate(hshp%ishape_last(hshp%d0:hshp%d0)) - read(unit, fmt = *) hshp%ishape_last ! first date - close(unit) call read_snapshot(s, hshp, nlon, nlat, k = hshp%d0, & corner = corner_deg * deg_to_rad, step = step_deg * deg_to_rad, & copy = copy) diff --git a/Overlap/Tests/test_send_recv.f90 b/Overlap/Tests/test_send_recv.f90 index 2125fd183f70dffc804ccc6abb854c33a554e2ac..d7550728b010c54ac4bd2845d96b745bd425c30e 100644 --- a/Overlap/Tests/test_send_recv.f90 +++ b/Overlap/Tests/test_send_recv.f90 @@ -85,10 +85,6 @@ program test_send_recv call shpc_open(hshp, trim(shpc_dir), pszaccess = "rb") if (rank == 0) then - call dbf_read_attribute_03(hshp%d0, hshp%extremum, hshp%extr_date, & - ishape = 0) - call read_column(hshp%ishape_last, & - file = trim(shpc_dir) // "/ishape_last.txt", my_lbound = hshp%d0) n_dates = size(hshp%ishape_last) end if @@ -98,9 +94,6 @@ program test_send_recv call ezmpi_bcast(nlat, root = 0) call ezmpi_bcast(copy, root = 0) call ezmpi_bcast(n_dates, root = 0) - call ezmpi_bcast(hshp%d0, root = 0) - if (rank == 1) allocate(hshp%ishape_last(hshp%d0:hshp%d0 + n_dates - 1)) - call ezmpi_bcast(hshp%ishape_last, root = 0) if (rank == 1) call read_snapshot(s, hshp, nlon, nlat, k = hshp%d0, & corner = corner_deg * deg_to_rad, step = step_deg * deg_to_rad, & diff --git a/Overlap/eddy_graph.f90 b/Overlap/eddy_graph.f90 index dce1a72c71d210a0fbdf6ce1cd5bb1033b11b25e..cc5b78c935c9b12f48cf37a84a5a24eccc6b3801 100644 --- a/Overlap/eddy_graph.f90 +++ b/Overlap/eddy_graph.f90 @@ -4,11 +4,10 @@ program eddy_graph ! Libraries: use ezmpi, only: ezmpi_bcast - use jumble, only: get_command_arg_dyn, read_column, new_unit, ediff1d + use jumble, only: get_command_arg_dyn, new_unit, ediff1d use mpi_f08, only: mpi_init, mpi_finalize, MPI_Comm_rank, MPI_Comm_world, & MPI_Comm_size use nr_util, only: assert, deg_to_rad - use shapelib_03, only: dbf_read_attribute_03 use derived_types, only: snapshot, shpc use dispatch_snapshot_m, only: dispatch_snapshot @@ -88,11 +87,6 @@ program eddy_graph "eddy_graph dist_lim") copy = merge(dist_lim, 0, periodic) - call dbf_read_attribute_03(hshp%d0, hshp%extremum, hshp%extr_date, & - ishape = 0) - call read_column(hshp%ishape_last, & - file = trim(shpc_dir) // "/ishape_last.txt", last = n_dates, & - my_lbound = hshp%d0) if (n_dates == huge(0)) n_dates = size(hshp%ishape_last) call assert(n_dates >= max_delta + 1, & "eddy_graph: n_dates should be >= max_delta + 1") @@ -113,9 +107,6 @@ program eddy_graph call ezmpi_bcast(periodic, root = 0) call ezmpi_bcast(copy, root = 0) call ezmpi_bcast(n_dates, root = 0) - call ezmpi_bcast(hshp%d0, root = 0) - if (rank /= 0) allocate(hshp%ishape_last(hshp%d0:hshp%d0 + n_dates - 1)) - call ezmpi_bcast(hshp%ishape_last, root = 0) call ezmpi_bcast(e_overestim, root = 0) if (rank == 0) then