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

Replace argument `s` of `write_snapshot`

Replace argument `s` of `write_snapshot` by its component `list`.
parent 9139054d
No related branches found
No related tags found
No related merge requests found
......@@ -171,7 +171,7 @@ program inst_eddies
write(unit, fmt = *) "CPU time for computation, before output:", t1 - t0, "s"
t0 = t1
print *, "inst_eddies: s%number_extr = ", s%number_extr
call write_snapshot(s, hshpc_cyclo, hshpc_anti, date)
call write_snapshot(s%list, hshpc_cyclo, hshpc_anti, date)
CALL shpc_close(hshpc_cyclo)
CALL shpc_close(hshpc_anti)
......
......@@ -4,15 +4,19 @@ module write_snapshot_m
contains
subroutine write_snapshot(s, hshpc_cyclo, hshpc_anti, date)
subroutine write_snapshot(list, hshpc_cyclo, hshpc_anti, date)
! Libraries:
use shapelib_03, only: shp_get_info_03
use derived_types, only: snapshot, shpc_slice_handler
use derived_types, only: eddy, shpc_slice_handler
use write_eddy_m, only: write_eddy
type(snapshot), intent(in):: s
type(eddy), intent(in):: list(:)
! In general, there may be both cyclonic and anticyclonic eddies
! in the list. Eddies include "eddies" without an outermost
! contour, that is, only the extremum is defined.
TYPE(shpc_slice_handler), intent(in):: hshpc_cyclo, hshpc_anti
integer, intent(in):: date
......@@ -24,14 +28,14 @@ contains
n_cyclo = 0
n_anti = 0
do i = 1, s%number_extr
if (s%list(i)%out_cont%closed) then
if (s%list(i)%cyclone) then
do i = 1, size(list)
if (list(i)%out_cont%closed) then
if (list(i)%cyclone) then
n_cyclo = n_cyclo + 1
call write_eddy(s%list(i), hshpc_cyclo, date, n_cyclo)
call write_eddy(list(i), hshpc_cyclo, date, n_cyclo)
else
n_anti = n_anti + 1
call write_eddy(s%list(i), hshpc_anti, date, n_anti)
call write_eddy(list(i), hshpc_anti, date, n_anti)
end if
end if
end do
......
......@@ -29,7 +29,7 @@ contains
slice = 0, grid_lon_lat = .true.)
call shpc_create(hshpc_anti, shpc_dir = "SHPC", cyclone = .false., &
slice = 0, grid_lon_lat = .true.)
call write_snapshot(s, hshpc_cyclo, hshpc_anti, d)
call write_snapshot(s%list, hshpc_cyclo, hshpc_anti, d)
CALL shpc_close(hshpc_cyclo)
CALL shpc_close(hshpc_anti)
print *, 'Created a slice in SHPC.'
......
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