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

Store SHPC directory in a component of type shpc

parent ef72de44
No related branches found
No related tags found
No related merge requests found
......@@ -73,6 +73,8 @@ module derived_types
integer out_r_eq_area, out_ssh, out_date, out_eddy_index, out_radius4
integer max_speed_r_eq_area, max_speed_ssh, max_speed_date, &
max_speed_eddy_index
character(len = :), allocatable:: dir ! directory
end type Shpc
private shpfileobject
......
......@@ -18,6 +18,7 @@ contains
CALL shpclose(hshp%extremum)
CALL shpclose(hshp%outermost)
CALL shpclose(hshp%max_speed)
deallocate(hshp%dir)
end subroutine shpc_close
......
......@@ -71,6 +71,7 @@ contains
end if
close(unit)
hshp%dir = shpc_dir
end subroutine shpc_create
......
......@@ -35,6 +35,7 @@ contains
read(unit, fmt = *) orientation
close(unit)
hshp%cyclone = trim(adjustl(orientation)) == "cyclones"
hshp%dir = shpc_dir
end subroutine shpc_open
......
......@@ -192,10 +192,8 @@ program inst_eddies
end if
end do
call write_aux(corner_deg, step_deg, nlon, nlat, hshpc_cyclo, exist, &
shpc_dir = "SHPC_cyclo")
call write_aux(corner_deg, step_deg, nlon, nlat, hshpc_anti, exist, &
shpc_dir = "SHPC_anti")
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 shpc_close(hshpc_cyclo)
CALL shpc_close(hshpc_anti)
print *, 'inst_eddies: Created or appended to shapefile collections in ', &
......
......@@ -4,7 +4,7 @@ module write_aux_m
contains
subroutine write_aux(corner_deg, step_deg, nlon, nlat, hshpc, exist, shpc_dir)
subroutine write_aux(corner_deg, step_deg, nlon, nlat, hshpc, exist)
! Write auxiliary files "grid_nml.txt" and "ishape_last.txt".
......@@ -31,7 +31,6 @@ contains
TYPE(shpc), intent(in):: hshpc
logical, intent(in):: exist
character(len = *), intent(in):: shpc_dir
! Local:
namelist /grid_nml/ corner_deg, step_deg, nlon, nlat
......@@ -43,16 +42,16 @@ contains
call new_unit(unit)
if (exist) then
open(unit, file = shpc_dir // "/ishape_last.txt", status = "old", &
open(unit, file = hshpc%dir // "/ishape_last.txt", status = "old", &
action = "write", position = "append")
write(unit, fmt = *) n_entities - 1
close(unit)
else
open(unit, file = shpc_dir // "/grid_nml.txt", status = "replace", &
open(unit, file = hshpc%dir // "/grid_nml.txt", status = "replace", &
action = "write")
write(unit, nml = grid_nml)
close(unit)
open(unit, file = shpc_dir // "/ishape_last.txt", status = "replace", &
open(unit, file = hshpc%dir // "/ishape_last.txt", status = "replace", &
action = "write")
write(unit, fmt = *) n_entities - 1
close(unit)
......
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