From 5514b8d49b54cf8f1c59e521ce8b42d7e98c902e Mon Sep 17 00:00:00 2001 From: Philippe WAUTELET <philippe.wautelet@aero.obs-mip.fr> Date: Fri, 17 Jan 2020 14:55:19 +0100 Subject: [PATCH] Philippe 17/01/2020: budgets: add 'BUD' category for Print_msg + corresponding namelist variables --- src/LIB/SURCOUCHE/src/modd_io.f90 | 5 ++++- src/LIB/SURCOUCHE/src/mode_msg.f90 | 9 +++++++-- src/LIB/SURCOUCHE/src/modn_confio.f90 | 10 ++++++---- src/MNH/budget.f90 | 6 +++--- src/MNH/ch_init_budgetn.f90 | 4 ++-- src/MNH/ini_budget.f90 | 4 ++-- src/MNH/write_budget.f90 | 12 ++++++------ 7 files changed, 30 insertions(+), 20 deletions(-) diff --git a/src/LIB/SURCOUCHE/src/modd_io.f90 b/src/LIB/SURCOUCHE/src/modd_io.f90 index a27528eeb..45afb9732 100644 --- a/src/LIB/SURCOUCHE/src/modd_io.f90 +++ b/src/LIB/SURCOUCHE/src/modd_io.f90 @@ -1,4 +1,4 @@ -!MNH_LIC Copyright 1994-2019 CNRS, Meteo-France and Universite Paul Sabatier +!MNH_LIC Copyright 1994-2020 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. @@ -9,6 +9,7 @@ ! P. Wautelet 21/01/2019: add LIO_ALLOW_NO_BACKUP and LIO_NO_WRITE to modd_io_ll to allow to disable writes (for bench purposes) ! P. Wautelet 07/02/2019: force TYPE to a known value for IO_File_add2list ! P. Wautelet 12/03/2019: add TMAINFILE field in TFILEDATA +! P. Wautelet 17/01/2020: add 'BUD' category for Print_msg + corresponding namelist variables !----------------------------------------------------------------- MODULE MODD_IO @@ -41,6 +42,8 @@ LOGICAL, SAVE :: LLFIREAD = .FALSE. ! TRUE will force LFI read (instead of Net LOGICAL, SAVE :: LVERB_OUTLST = .TRUE. ! TRUE will PRINT_MSG in OUTPUT_LISTINGn files LOGICAL, SAVE :: LVERB_STDOUT = .FALSE. ! TRUE will also PRINT_MSG on standard output LOGICAL, SAVE :: LVERB_ALLPRC = .FALSE. ! FALSE: only process 0 do PRINT_MSG, TRUE: all processes +INTEGER, SAVE :: NBUD_VERB = NVERB_WARNING ! Verbosity level for budgets +INTEGER, SAVE :: NBUD_ABORT_LEVEL = NVERB_ERROR ! Level of budget error necessary to force stop of application INTEGER, SAVE :: NIO_VERB = NVERB_WARNING ! Verbosity level for IO INTEGER, SAVE :: NIO_ABORT_LEVEL = NVERB_ERROR ! Level of IO error necessary to force stop of application diff --git a/src/LIB/SURCOUCHE/src/mode_msg.f90 b/src/LIB/SURCOUCHE/src/mode_msg.f90 index 6532afab8..77d09b149 100644 --- a/src/LIB/SURCOUCHE/src/mode_msg.f90 +++ b/src/LIB/SURCOUCHE/src/mode_msg.f90 @@ -1,4 +1,4 @@ -!MNH_LIC Copyright 2017-2019 CNRS, Meteo-France and Universite Paul Sabatier +!MNH_LIC Copyright 2017-2020 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. @@ -9,6 +9,7 @@ ! P. Wautelet 27/02/2019: module extracted from mode_io.f90 ! P. Wautelet 04/04/2019: force write on stderr for all processes in print_msg if abort ! P. Wautelet 02/07/2019: flush messages also for files opened with newunit (logical unit can be negative) +! P. Wautelet 17/01/2020: add 'BUD' category for Print_msg !----------------------------------------------------------------- MODULE MODE_MSG ! @@ -23,7 +24,7 @@ SUBROUTINE PRINT_MSG(KVERB,HDOMAIN,HSUBR,HMSG) USE ISO_FORTRAN_ENV, ONLY: ERROR_UNIT, OUTPUT_UNIT ! USE MODD_CONF, ONLY: CPROGRAM -USE MODD_IO, ONLY: NIO_VERB, NIO_ABORT_LEVEL, NGEN_VERB, NGEN_ABORT_LEVEL, & +USE MODD_IO, ONLY: NBUD_VERB, NBUD_ABORT_LEVEL, NIO_VERB, NIO_ABORT_LEVEL, NGEN_VERB, NGEN_ABORT_LEVEL, & LVERB_OUTLST, LVERB_STDOUT, LVERB_ALLPRC, TFILE_OUTPUTLISTING USE MODD_LUNIT, ONLY: TLUOUT0 USE MODD_VAR_ll, ONLY: IP, NMNH_COMM_WORLD @@ -67,6 +68,10 @@ ELSE END IF ! SELECT CASE(HDOMAIN) + CASE('BUD') + !Budget messages + IMAXVERB = NBUD_VERB + IABORTLEVEL = NBUD_ABORT_LEVEL CASE('IO') IMAXVERB = NIO_VERB IABORTLEVEL = NIO_ABORT_LEVEL diff --git a/src/LIB/SURCOUCHE/src/modn_confio.f90 b/src/LIB/SURCOUCHE/src/modn_confio.f90 index 8505a61f9..7c89947c1 100644 --- a/src/LIB/SURCOUCHE/src/modn_confio.f90 +++ b/src/LIB/SURCOUCHE/src/modn_confio.f90 @@ -1,4 +1,4 @@ -!MNH_LIC Copyright 2014-2019 CNRS, Meteo-France and Universite Paul Sabatier +!MNH_LIC Copyright 2014-2020 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. @@ -29,15 +29,16 @@ !! MODIFICATIONS !! ------------- !! Original 31/03/2014 -!! Philippe Wautelet: 05/2016-04/2018: new data structures and calls for I/O -!! Philippe Wautelet: 21/01/2019: add LIO_ALLOW_NO_BACKUP and LIO_NO_WRITE to modd_io_ll to allow to disable writes (for bench purposes) +! P. Wautelet 05/2016-04/2018: new data structures and calls for I/O +! P. Wautelet 21/01/2019: add LIO_ALLOW_NO_BACKUP and LIO_NO_WRITE to modd_io_ll to allow to disable writes (for bench purposes) +! P. Wautelet 17/01/2020: add 'BUD' category for Print_msg + corresponding namelist variables !------------------------------------------------------------------------------- ! !* 0. DECLARATIONS ! ------------ ! USE MODD_IO, ONLY : LVERB_OUTLST, LVERB_STDOUT, LVERB_ALLPRC, & - NIO_VERB, NIO_ABORT_LEVEL, NGEN_VERB, NGEN_ABORT_LEVEL, & + NBUD_VERB, NBUD_ABORT_LEVEL, NIO_VERB, NIO_ABORT_LEVEL, NGEN_VERB, NGEN_ABORT_LEVEL, & CIO_DIR, LIO_ALLOW_NO_BACKUP, LIO_NO_WRITE ! IMPLICIT NONE @@ -49,6 +50,7 @@ LOGICAL,SAVE :: LLFIREAD = .FALSE. ! TRUE : enable LFI reading (disable NetCDF4 NAMELIST/NAM_CONFIO/LCDF4, LLFIOUT, LLFIREAD, & LVERB_OUTLST, LVERB_STDOUT, LVERB_ALLPRC, & + NBUD_VERB, NBUD_ABORT_LEVEL, & NIO_VERB, NIO_ABORT_LEVEL, & NGEN_VERB, NGEN_ABORT_LEVEL, CIO_DIR, & LIO_ALLOW_NO_BACKUP, LIO_NO_WRITE diff --git a/src/MNH/budget.f90 b/src/MNH/budget.f90 index c68bd5fb7..fcb659224 100644 --- a/src/MNH/budget.f90 +++ b/src/MNH/budget.f90 @@ -1,4 +1,4 @@ -!MNH_LIC Copyright 1994-2019 CNRS, Meteo-France and Universite Paul Sabatier +!MNH_LIC Copyright 1994-2020 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. @@ -219,7 +219,7 @@ SELECT CASE (KBUDN) IBUSV WRITE(UNIT=ILUOUT0,FMT='("CHECK FOR THE CALL BUDGET OF THAT VARIABLE")') !callabortstop - CALL PRINT_MSG(NVERB_FATAL,'GEN','BUDGET','') + CALL PRINT_MSG(NVERB_FATAL,'BUD','BUDGET','') END IF END SELECT ! @@ -329,7 +329,7 @@ CONTAINS WRITE(UNIT=ILUOUT0,FMT='("PLEASE CHECK THE CALL BUDGET OF THE VARIABLE")') WRITE(UNIT=ILUOUT0,FMT='("AND THE BUDGET PROCESS ORDER IN INI_BUDGET !")') !callabortstop - CALL PRINT_MSG(NVERB_FATAL,'GEN','BUDGET','') + CALL PRINT_MSG(NVERB_FATAL,'BUD','BUDGET','') END IF END IF ! diff --git a/src/MNH/ch_init_budgetn.f90 b/src/MNH/ch_init_budgetn.f90 index d84ff1f75..5f6449041 100644 --- a/src/MNH/ch_init_budgetn.f90 +++ b/src/MNH/ch_init_budgetn.f90 @@ -1,4 +1,4 @@ -!MNH_LIC Copyright 2016-2019 CNRS, Meteo-France and Universite Paul Sabatier +!MNH_LIC Copyright 2016-2020 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. @@ -120,7 +120,7 @@ IF (YWORKSTR /= '') THEN END IF END DO IF (GCHECKFAILED) THEN - call Print_msg( NVERB_FATAL, 'GEN', 'CH_INIT_BUDGET_n', 'wrong (misspelled) CSPEC_BUDGET encountered' ) + call Print_msg( NVERB_FATAL, 'BUD', 'CH_INIT_BUDGET_n', 'wrong (misspelled) CSPEC_BUDGET encountered' ) END IF ELSE DEALLOCATE(CNAMES_BUDGET) diff --git a/src/MNH/ini_budget.f90 b/src/MNH/ini_budget.f90 index e41784b01..dda75ce4b 100644 --- a/src/MNH/ini_budget.f90 +++ b/src/MNH/ini_budget.f90 @@ -1,4 +1,4 @@ -!MNH_LIC Copyright 1995-2019 CNRS, Meteo-France and Universite Paul Sabatier +!MNH_LIC Copyright 1995-2020 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. @@ -2736,7 +2736,7 @@ IF (CBUTYPE=='MASK') THEN WRITE(UNIT=KLUOUT, FMT= '("BUMASK = ",I4.4)' ) NBUMASK END IF IF (GERROR) THEN - call Print_msg( NVERB_FATAL, 'GEN', 'INI_BUDGET', '' ) + call Print_msg( NVERB_FATAL, 'BUD', 'INI_BUDGET', '' ) ENDIF !------------------------------------------------------------------------------- !* 5. ALLOCATE MEMORY FOR BUDGET STORAGE ARRAYS diff --git a/src/MNH/write_budget.f90 b/src/MNH/write_budget.f90 index 5f6ab614a..0d7caf60d 100644 --- a/src/MNH/write_budget.f90 +++ b/src/MNH/write_budget.f90 @@ -1,4 +1,4 @@ -!MNH_LIC Copyright 1995-2019 CNRS, Meteo-France and Universite Paul Sabatier +!MNH_LIC Copyright 1995-2020 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. @@ -417,7 +417,7 @@ subroutine Store_one_budget_rho( tpdiafile, tpdates, pburhodj, kp, knocompress, end where case default - call Print_msg( NVERB_ERROR, 'GEN', 'Store_one_budget_rho', 'unknown CBUTYPE' ) + call Print_msg( NVERB_ERROR, 'BUD', 'Store_one_budget_rho', 'unknown CBUTYPE' ) end select allocate( ybucomment(1 ) ) @@ -455,7 +455,7 @@ subroutine Store_one_budget_rho( tpdiafile, tpdates, pburhodj, kp, knocompress, write( ygroup_name, fmt = "('RJZ__',I4.4)" ) nbutshift case default - call Print_msg( NVERB_ERROR, 'GEN', 'Store_one_budget_rho', 'unknown budget type' ) + call Print_msg( NVERB_ERROR, 'BUD', 'Store_one_budget_rho', 'unknown budget type' ) end select call Write_diachro( tpdiafile, tluout, ygroup_name, ybutype, iworkgrid, & @@ -507,7 +507,7 @@ subroutine Store_one_budget( tpdiafile, tpdates, pbudarray, prhodjn, kp, knocomp real, dimension(:,:,:,:,:,:), allocatable :: zworkt if( .not. allocated( prhodjn ) ) then - call Print_msg( NVERB_ERROR, 'GEN', 'Store_one_budget', 'prhodjn not allocated' ) + call Print_msg( NVERB_ERROR, 'BUD', 'Store_one_budget', 'prhodjn not allocated' ) return end if @@ -542,7 +542,7 @@ subroutine Store_one_budget( tpdiafile, tpdates, pbudarray, prhodjn, kp, knocomp end do case default - call Print_msg( NVERB_ERROR, 'GEN', 'Store_one_budget', 'unknown CBUTYPE' ) + call Print_msg( NVERB_ERROR, 'BUD', 'Store_one_budget', 'unknown CBUTYPE' ) end select deallocate(zconvert) @@ -635,7 +635,7 @@ subroutine Store_one_budget( tpdiafile, tpdates, pbudarray, prhodjn, kp, knocomp write( ygroup_name, fmt = "('SV',I3.3,I4.4)") jsv, nbutshift case default - call Print_msg( NVERB_ERROR, 'GEN', 'Store_one_budget', 'unknown budget type' ) + call Print_msg( NVERB_ERROR, 'BUD', 'Store_one_budget', 'unknown budget type' ) end select CALL Write_diachro( tpdiafile, tluout, ygroup_name, ybutype, iworkgrid, & -- GitLab