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

Open or create shapefiles before computation

parent 7e171939
No related branches found
No related tags found
No related merge requests found
...@@ -24,7 +24,7 @@ program inst_eddies ...@@ -24,7 +24,7 @@ program inst_eddies
type(snapshot) s type(snapshot) s
TYPE(shpc_slice_handler) hshpc_cyclo, hshpc_anti TYPE(shpc_slice_handler) hshpc_cyclo, hshpc_anti
integer i, date integer i, date, iostat
integer unit integer unit
integer nlon, nlat integer nlon, nlat
...@@ -83,6 +83,18 @@ program inst_eddies ...@@ -83,6 +83,18 @@ program inst_eddies
call input_ssh(corner, step, nlon, nlat, periodic, ssh, u, v, corner_deg, & call input_ssh(corner, step, nlon, nlat, periodic, ssh, u, v, corner_deg, &
step_deg) step_deg)
! Open or create now so we test the existence of directories:
call shpc_open(hshpc_cyclo, shpc_dir = "SHPC_cyclo", pszaccess = "rb+", &
iostat = iostat)
if (iostat == 0) then
call shpc_open(hshpc_anti, shpc_dir = "SHPC_anti", pszaccess = "rb+")
else
call shpc_create(hshpc_cyclo, shpc_dir = "SHPC_cyclo", cyclone = .true.)
call shpc_create(hshpc_anti, shpc_dir = "SHPC_anti", cyclone = .false.)
end if
call cpu_time(t1) call cpu_time(t1)
write(unit, fmt = *) "CPU time for input, before computation:", t1 - t0, "s" write(unit, fmt = *) "CPU time for input, before computation:", t1 - t0, "s"
t0 = t1 t0 = t1
...@@ -133,15 +145,6 @@ program inst_eddies ...@@ -133,15 +145,6 @@ program inst_eddies
t0 = t1 t0 = t1
! Write snapshot: ! Write snapshot:
if (exist) then
call shpc_open(hshpc_cyclo, shpc_dir = "SHPC_cyclo", pszaccess = "rb+")
call shpc_open(hshpc_anti, shpc_dir = "SHPC_anti", pszaccess = "rb+")
else
call shpc_create(hshpc_cyclo, shpc_dir = "SHPC_cyclo", cyclone = .true.)
call shpc_create(hshpc_anti, shpc_dir = "SHPC_anti", cyclone = .false.)
end if
call write_snapshot(s, hshpc_cyclo, hshpc_anti, date) call write_snapshot(s, hshpc_cyclo, hshpc_anti, date)
call write_aux(corner_deg, step_deg, nlon, nlat, hshpc_cyclo, exist) call write_aux(corner_deg, step_deg, nlon, nlat, hshpc_cyclo, exist)
call write_aux(corner_deg, step_deg, nlon, nlat, hshpc_anti, exist) call write_aux(corner_deg, step_deg, nlon, nlat, hshpc_anti, exist)
......
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