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

Write to `ishape_last` by querying shapefile

So pass argument hshpc instead of `n_shapes`. Preparing to append to
`ishape_last.txt` instead of just creating `ishape_last.txt` with a
single line.
parent 9f98aa96
No related branches found
No related tags found
No related merge requests found
......@@ -204,9 +204,9 @@ program inst_eddies
end if
end do
call write_aux(corner_deg, step_deg, nlon, nlat, n_cyclo, &
call write_aux(corner_deg, step_deg, nlon, nlat, hshpc_cyclo, &
shpc_dir = "SHPC_cyclo")
call write_aux(corner_deg, step_deg, nlon, nlat, n_anti, &
call write_aux(corner_deg, step_deg, nlon, nlat, hshpc_anti, &
shpc_dir = "SHPC_anti")
CALL shpc_close(hshpc_cyclo)
CALL shpc_close(hshpc_anti)
......
......@@ -4,12 +4,15 @@ module write_aux_m
contains
subroutine write_aux(corner_deg, step_deg, nlon, nlat, n_shapes, shpc_dir)
subroutine write_aux(corner_deg, step_deg, nlon, nlat, hshpc, shpc_dir)
! Write auxiliary files "grid_nml.txt" and "ishape_last.txt".
! Libraries:
use jumble, only: new_unit
use shapelib_03, only: shp_get_info_03
use derived_types, only: shpc
! Note: we do not use assumed-shape arrays here for corner_deg and
! step_deg because of an internal compiler error of ifort
......@@ -26,15 +29,16 @@ contains
! size of ssh array in input NetCDF, assuming no repeated point if
! the grid is global
integer, intent(in):: n_shapes
TYPE(shpc), intent(in):: hshpc
character(len = *), intent(in):: shpc_dir
! Local:
namelist /grid_nml/ corner_deg, step_deg, nlon, nlat
integer unit
integer unit, n_entities
!--------------------------------------------------------------------
call shp_get_info_03(hshpc%extremum, n_entities)
call new_unit(unit)
open(unit, file = shpc_dir // "/grid_nml.txt", status = "replace", &
action = "write")
......@@ -43,7 +47,7 @@ contains
open(unit, file = shpc_dir // "/ishape_last.txt", status = "replace", &
action = "write")
write(unit, fmt = *) n_shapes - 1
write(unit, fmt = *) n_entities - 1
close(unit)
end subroutine write_aux
......
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