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

Append to shapefiles if they exist

Instead of creating them. Motivation: avoid time spent concatenating
shapefiles in `inst_eddies.py`. This concatenation time, on Ciclad, is
of the same order of magnitude as the time spent by the Fortran
executable.
parent 5ff9e1d2
No related branches found
No related tags found
No related merge requests found
...@@ -7,7 +7,8 @@ add_executable(inst_eddies inst_eddies.f90 ...@@ -7,7 +7,8 @@ add_executable(inst_eddies inst_eddies.f90
${PROJECT_SOURCE_DIR}/Common/derived_types.f90 ${PROJECT_SOURCE_DIR}/Common/derived_types.f90
${PROJECT_SOURCE_DIR}/Common/shpc_create.f90 nearby_extr.f90 ${PROJECT_SOURCE_DIR}/Common/shpc_create.f90 nearby_extr.f90
get_var.f90 ${PROJECT_SOURCE_DIR}/Common/shpc_close.f90 get_var.f90 ${PROJECT_SOURCE_DIR}/Common/shpc_close.f90
write_aux.f90 config.f90) write_aux.f90 config.f90 ${PROJECT_SOURCE_DIR}/Common/shpc_open.F90
${PROJECT_SOURCE_DIR}/Common/read_field_indices.F90)
target_include_directories(inst_eddies PRIVATE ${fortrangis_INCLUDE_DIR}) target_include_directories(inst_eddies PRIVATE ${fortrangis_INCLUDE_DIR})
......
...@@ -18,6 +18,7 @@ program inst_eddies ...@@ -18,6 +18,7 @@ program inst_eddies
use set_max_speed_m, only: set_max_speed use set_max_speed_m, only: set_max_speed
use shpc_close_m, only: shpc_close use shpc_close_m, only: shpc_close
use shpc_create_m, only: shpc_create use shpc_create_m, only: shpc_create
use shpc_open_m, only: shpc_open
use write_aux_m, only: write_aux use write_aux_m, only: write_aux
use write_eddy_m, only: write_eddy use write_eddy_m, only: write_eddy
...@@ -67,6 +68,7 @@ program inst_eddies ...@@ -67,6 +68,7 @@ program inst_eddies
! target extremum ! target extremum
character(len = 30) time_unit character(len = 30) time_unit
logical exist
!-------------------------------------------------------------- !--------------------------------------------------------------
...@@ -177,8 +179,16 @@ program inst_eddies ...@@ -177,8 +179,16 @@ program inst_eddies
! Write snapshot: ! Write snapshot:
call shpc_create(hshp_cyclo, shpc_dir = "SHPC_cyclo", cyclone = .true.) inquire(file = "SHPC_cyclo/extremum.shp", exist = exist)
call shpc_create(hshp_anti, shpc_dir = "SHPC_anti", cyclone = .false.)
if (exist) then
call shpc_open(hshp_cyclo, shpc_dir = "SHPC_cyclo", rank = 0)
call shpc_open(hshp_anti, shpc_dir = "SHPC_anti", rank = 0)
else
call shpc_create(hshp_cyclo, shpc_dir = "SHPC_cyclo", cyclone = .true.)
call shpc_create(hshp_anti, shpc_dir = "SHPC_anti", cyclone = .false.)
end if
n_cyclo = 0 n_cyclo = 0
n_anti = 0 n_anti = 0
......
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