From 1c3673a69456280d2f21e04b887c366ff7298354 Mon Sep 17 00:00:00 2001 From: Micael Oliveira Date: Wed, 18 Sep 2024 09:32:39 +1000 Subject: [PATCH] Check if number of points in MOM5 vertical grid is odd, stop otherwise. --- src/vgrid.f90 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/vgrid.f90 b/src/vgrid.f90 index 8627706..129dd02 100644 --- a/src/vgrid.f90 +++ b/src/vgrid.f90 @@ -74,6 +74,10 @@ type(vgrid_t) function vgrid_constructor(filename, type) result(vgrid) ! Handle the different types of grids select case (type) case ("mom5") + if (mod(zeta_len, 2) == 0) then + write(error_unit,'(a)') "ERROR: MOM5 vertical grid has an even number of points, which should never happen." + error stop + end if vgrid%nlevels = zeta_len/2 allocate(vgrid%zeta_super(zeta_len)) allocate(vgrid%zeta(0:vgrid%nlevels))