diff --git a/Inst_eddies/CMakeLists.txt b/Inst_eddies/CMakeLists.txt index fc55d63b7332c710cbe1c7f7f7dcd52ad5aaad90..cfdf15d11ec16887ac1dd94a2509b4ce1913d16f 100644 --- a/Inst_eddies/CMakeLists.txt +++ b/Inst_eddies/CMakeLists.txt @@ -7,7 +7,8 @@ add_executable(inst_eddies inst_eddies.f90 ${PROJECT_SOURCE_DIR}/Common/derived_types.f90 ${PROJECT_SOURCE_DIR}/Common/shpc_create.f90 nearby_extr.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}) diff --git a/Inst_eddies/inst_eddies.f90 b/Inst_eddies/inst_eddies.f90 index d2bc8a7874908bbbe0355bded7a9e1326580c26a..37b57c62d302b9e69f61f6ce045c5b0fd88edc63 100644 --- a/Inst_eddies/inst_eddies.f90 +++ b/Inst_eddies/inst_eddies.f90 @@ -18,6 +18,7 @@ program inst_eddies use set_max_speed_m, only: set_max_speed use shpc_close_m, only: shpc_close use shpc_create_m, only: shpc_create + use shpc_open_m, only: shpc_open use write_aux_m, only: write_aux use write_eddy_m, only: write_eddy @@ -67,6 +68,7 @@ program inst_eddies ! target extremum character(len = 30) time_unit + logical exist !-------------------------------------------------------------- @@ -177,8 +179,16 @@ program inst_eddies ! Write snapshot: - call shpc_create(hshp_cyclo, shpc_dir = "SHPC_cyclo", cyclone = .true.) - call shpc_create(hshp_anti, shpc_dir = "SHPC_anti", cyclone = .false.) + inquire(file = "SHPC_cyclo/extremum.shp", exist = exist) + + 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_anti = 0