From ee14d677a8c4c3155c86000fa14e1bb7f87d7560 Mon Sep 17 00:00:00 2001 From: Wuyin Lin Date: Mon, 13 Nov 2023 18:42:12 -0800 Subject: [PATCH] Implement an adaptable index as pver in condidiag nml --- .../testdefs/testmods_dirs/eam/condidiag_dcape/user_nl_eam | 2 +- .../testdefs/testmods_dirs/eam/condidiag_rhi/user_nl_eam | 4 ++-- components/eam/src/physics/cam/conditional_diag.F90 | 4 ++++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/components/eam/cime_config/testdefs/testmods_dirs/eam/condidiag_dcape/user_nl_eam b/components/eam/cime_config/testdefs/testmods_dirs/eam/condidiag_dcape/user_nl_eam index 953394566fda..5496682ae7cc 100644 --- a/components/eam/cime_config/testdefs/testmods_dirs/eam/condidiag_dcape/user_nl_eam +++ b/components/eam/cime_config/testdefs/testmods_dirs/eam/condidiag_dcape/user_nl_eam @@ -3,7 +3,7 @@ qoi_chkpt = 'RAD', 'PACEND','DYNEND','DEEPCU', 'STCLD', qoi_name = 'CAPE','dCAPE' - qoi_nver = 1, 80, + qoi_nver = 1, -1, l_output_state = .true. l_output_incrm = .false. diff --git a/components/eam/cime_config/testdefs/testmods_dirs/eam/condidiag_rhi/user_nl_eam b/components/eam/cime_config/testdefs/testmods_dirs/eam/condidiag_rhi/user_nl_eam index 6874a7b22e9e..d943118595a8 100644 --- a/components/eam/cime_config/testdefs/testmods_dirs/eam/condidiag_rhi/user_nl_eam +++ b/components/eam/cime_config/testdefs/testmods_dirs/eam/condidiag_rhi/user_nl_eam @@ -3,7 +3,7 @@ ! - condition 2: all grid columns and time steps metric_name = 'RHI', 'RHI', - metric_nver = 80, 80 + metric_nver = -1, -1 metric_cmpr_type = 1, 1 metric_threshold = 125, -1 cnd_eval_chkpt = 'CLDMAC01', 'CLDMAC01' @@ -18,7 +18,7 @@ 'CLDMAC06','CLDMIC06' qoi_name = 'RHI', 'Q', 'QSATI' - qoi_nver = 80, 80, 80 + qoi_nver = -1, -1, -1 l_output_state = .true. l_output_incrm = .true. diff --git a/components/eam/src/physics/cam/conditional_diag.F90 b/components/eam/src/physics/cam/conditional_diag.F90 index f038211b96b2..f53a85cca727 100644 --- a/components/eam/src/physics/cam/conditional_diag.F90 +++ b/components/eam/src/physics/cam/conditional_diag.F90 @@ -316,6 +316,8 @@ subroutine cnd_diag_readnl(nlfile) end if end do + ! metric_nver = -1 read in from namelist should be interpreted as pver for flexible configuration + where ( metric_nver(1:ncnd) == -1 ) metric_nver(1:ncnd) = pver if (any( metric_nver (1:ncnd) <= 0 )) call endrun(subname//' error: need positive metric_nver for each metric_name') if (any( metric_cmpr_type(1:ncnd) == -99 )) call endrun(subname//' error: need valid metric_cmpr_type for each metric_name') @@ -335,6 +337,8 @@ subroutine cnd_diag_readnl(nlfile) end do nqoi = ii + ! qoi_nver = -1 read in from namelist should be interpreted as pver for flexible configuration + where ( qoi_nver(1:nqoi) == -1 ) qoi_nver(1:nqoi) = pver if (any(qoi_nver(1:nqoi)<=0)) call endrun(subname//'error: need positive qoi_nver for each qoi_name') !---------------------------------------------