diff --git a/Overlap/Tests/test_overlap.f90 b/Overlap/Tests/test_overlap.f90 index a93b8c4dad512fdcbc2c71ba70ea98e50b2cbade..56278080f75c26d466cacd0cf1baa75c455d3ed9 100644 --- a/Overlap/Tests/test_overlap.f90 +++ b/Overlap/Tests/test_overlap.f90 @@ -2,7 +2,6 @@ program test_overlap ! Libraries: use jumble, only: get_command_arg_dyn, read_opcol, new_unit, ediff1d, assert - use shapelib_03, only: dbf_read_attribute_03 use config_graph_m, only: config_graph, copy, max_delta, cyclone use derived_types, only: snapshot, ori_slice_handler, shpc_slice_meta @@ -15,7 +14,7 @@ program test_overlap implicit none - character(len = :), allocatable:: shpc_dir + character(len = :), allocatable:: shpc_dir, slice_dir integer:: k_test_1 = 0, k_test_2 = 1, i_slice = 0 integer unit, i, n_dates type(snapshot), allocatable:: flow(:) ! (max_delta + 1) @@ -39,13 +38,18 @@ program test_overlap call ori_slice_open(hshp, trim(shpc_dir), cyclone, i_slice, & with_proj = .not. uniform_lon_lat, pszaccess = "rb") - call dbf_read_attribute_03(ssm%d0, hshp%extremum, hshp%extr_date, ishape = 0) + allocate(character(len(shpc_dir) + 12):: slice_dir) + write(slice_dir, fmt = '(a, "/Slice_", i0)') shpc_dir, i_slice + call new_unit(unit) + open(unit, file = trim(slice_dir) // "/date_range.txt", & + STATUS = "old", action = "read", position = "rewind") + read(unit, fmt = *) ssm%d0 + close(unit) call read_opcol(ssm%ishape_last, hshp%unit, my_lbound = ssm%d0) n_dates = size(ssm%ishape_last) call assert(ssm%d0 <= [k_test_1, k_test_2] .and. [k_test_1, k_test_2] & < ssm%d0 + n_dates, "test_overlap k_test_1, k_test_2") e_overestim = maxval([ssm%ishape_last(ssm%d0) + 1, ediff1d(ssm%ishape_last)]) - call new_unit(unit) open(unit, file = "e_overestim.txt", status = "replace", action = "write") write(unit, fmt = *) e_overestim close(unit)