diff --git a/Inst_eddies/inst_eddies.f90 b/Inst_eddies/inst_eddies.f90
index 3467b8049bc440922f38c88b44830429670856e5..c6e24b96f52412b48c99889441c600a4c9574677 100644
--- a/Inst_eddies/inst_eddies.f90
+++ b/Inst_eddies/inst_eddies.f90
@@ -204,13 +204,13 @@ program inst_eddies
      end if
   end do
 
-  CALL shpc_close(hshpc_cyclo)
-  CALL shpc_close(hshpc_anti)
-  print *, 'inst_eddies: Created shapefile collections in SHPC_cyclo and ', &
-       'SHPC_anti.'
   call write_aux(corner_deg, step_deg, nlon, nlat, n_cyclo, &
        shpc_dir = "SHPC_cyclo")
   call write_aux(corner_deg, step_deg, nlon, nlat, n_anti, &
        shpc_dir = "SHPC_anti")
+  CALL shpc_close(hshpc_cyclo)
+  CALL shpc_close(hshpc_anti)
+  print *, 'inst_eddies: Created shapefile collections in SHPC_cyclo and ', &
+       'SHPC_anti.'
 
 end program inst_eddies