diff --git a/Inst_eddies/Tests/test_nearby_extr.f90 b/Inst_eddies/Tests/test_nearby_extr.f90
index 46019b8a61bc565a1f122c5910cdf0301129ab39..6fedeb86eeffd07a8e09939835ebd092d2d8d1f9 100644
--- a/Inst_eddies/Tests/test_nearby_extr.f90
+++ b/Inst_eddies/Tests/test_nearby_extr.f90
@@ -43,13 +43,12 @@ program test_nearby_extr
   read(unit, nml = grid_nml)
   close(unit)
 
+  call shpc_open(hshp, trim(shpc_dir), pszaccess = "rb")
+  call dbf_read_attribute_03(d_init, hshp%extremum, hshp%extr_date, ishape = 0)
   open(unit, file = shpc_dir // "/ishape_last.txt", status = "old", &
        action = "read", position = "rewind")
   read(unit, fmt = *) ishape_last ! first date
   close(unit)
-
-  call shpc_open(hshp, trim(shpc_dir), pszaccess = "rb")
-  call dbf_read_attribute_03(d_init, hshp%extremum, hshp%extr_date, ishape = 0)
   call read_snapshot(s, hshp, nlon, nlat, d_init, k = d_init, &
        corner = corner_deg * deg_to_rad, step = step_deg * deg_to_rad, &
        copy = 0, ishape_last = [ishape_last])
diff --git a/Overlap/Tests/test_read_snapshot.f90 b/Overlap/Tests/test_read_snapshot.f90
index edb1be690d396e5d040bce0dd48368af78b25e63..a2b8ba54207d2189ae5320538890da78be03ed22 100644
--- a/Overlap/Tests/test_read_snapshot.f90
+++ b/Overlap/Tests/test_read_snapshot.f90
@@ -61,13 +61,12 @@ program test_read_snapshot
        "test_read_snapshot dist_lim")
   copy = merge(dist_lim, 0, periodic)
 
+  call shpc_open(hshp, trim(shpc_dir), pszaccess = "rb")
+  call dbf_read_attribute_03(d_init, hshp%extremum, hshp%extr_date, ishape = 0)
   open(unit, file = shpc_dir // "/ishape_last.txt", status = "old", &
        action = "read", position = "rewind")
   read(unit, fmt = *) ishape_last ! first date
   close(unit)
-
-  call shpc_open(hshp, trim(shpc_dir), pszaccess = "rb")
-  call dbf_read_attribute_03(d_init, hshp%extremum, hshp%extr_date, ishape = 0)
   call read_snapshot(s, hshp, nlon, nlat, d_init, k = d_init, &
        corner = corner_deg * deg_to_rad, step = step_deg * deg_to_rad, &
        copy = copy, ishape_last = [ishape_last])