Skip to content
Snippets Groups Projects
Commit c6042b3a authored by WAUTELET Philippe's avatar WAUTELET Philippe
Browse files

Philippe 10/07/2019: bugfix: MNH_REL_ZT3D_N0: access outside of array was possible

parent 7c9ec326
No related branches found
No related tags found
No related merge requests found
#ifdef _OPENACC
!MNH_LIC Copyright 2013-2019 CNRS, Meteo-France and Universite Paul Sabatier
!MNH_LIC This is part of the Meso-NH software governed by the CeCILL-C licence
!MNH_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt
!MNH_LIC for details. version 1.
!-----------------------------------------------------------------
! Modifications:
! P. Wautelet 10/07/2019: bugfix: MNH_REL_ZT3D_N0: access outside of array was possible
!-----------------------------------------------------------------
MODULE MODE_MNH_ZWORK
use mode_msg
......@@ -213,13 +222,14 @@ CONTAINS
IF ( ( NT3D_TOP > JPMAX_T3D ) .OR. ( NT3D_TOP < 1 ) ) THEN
call Print_msg( NVERB_FATAL, 'GEN', 'MNH_REL_ZT3D_N0', 'invalid value for NT3D_TOP' )
ELSE
NT3D_POOL(KTEMP) = KTEMP
IF (KTEMP == NT3D_TOP) THEN
NT3D_TOP = NT3D_TOP - 1
DO WHILE (NT3D_TOP > 0 .AND. NT3D_POOL(NT3D_TOP) /= -1 )
NT3D_TOP = NT3D_TOP - 1
END DO
END IF
NT3D_POOL(KTEMP) = KTEMP
IF (KTEMP == NT3D_TOP) THEN
NT3D_TOP = NT3D_TOP - 1
DO WHILE (NT3D_TOP > 0 )
if ( NT3D_POOL(NT3D_TOP) == -1 ) exit
NT3D_TOP = NT3D_TOP - 1
END DO
END IF
ENDIF
!WRITE( *, '( "MNH_REL_ZT3D: releasing ZT3D (",I4,")" )' ) KTEMP
......@@ -290,3 +300,4 @@ CONTAINS
END MODULE MODE_MNH_ZWORK
#endif
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