From ec3e91173eb76cb668a6c358ae655ce04ca20249 Mon Sep 17 00:00:00 2001 From: David Mocko Date: Mon, 20 Nov 2023 15:25:53 -0500 Subject: [PATCH 1/2] Fixing Noah-MP-4.0.1 LSM restart and model alarms for multiple nests in LIS This bug fix corrects the alarms for the Noah-MP-4.0.1 LSM in LIS when running multiple nests. The restart alarm and the model alarm are both corrected. Resolves: #1457 --- lis/surfacemodels/land/noahmp.4.0.1/NoahMP401_lsmMod.F90 | 6 +++--- lis/surfacemodels/land/noahmp.4.0.1/NoahMP401_main.F90 | 3 ++- lis/surfacemodels/land/noahmp.4.0.1/NoahMP401_writerst.F90 | 4 +++- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/lis/surfacemodels/land/noahmp.4.0.1/NoahMP401_lsmMod.F90 b/lis/surfacemodels/land/noahmp.4.0.1/NoahMP401_lsmMod.F90 index e1b94f570..cf1078f06 100644 --- a/lis/surfacemodels/land/noahmp.4.0.1/NoahMP401_lsmMod.F90 +++ b/lis/surfacemodels/land/noahmp.4.0.1/NoahMP401_lsmMod.F90 @@ -304,18 +304,18 @@ subroutine NoahMP401_ini() call LIS_update_timestep(LIS_rc, n, NOAHMP401_struc(n)%ts) - call LIS_registerAlarm("NoahMP401 model alarm",& + write(fnest,'(i3.3)') n + call LIS_registerAlarm("NoahMP401 model alarm "//trim(fnest),& NOAHMP401_struc(n)%ts, & NOAHMP401_struc(n)%ts) - call LIS_registerAlarm("NoahMP401 restart alarm", & + call LIS_registerAlarm("NoahMP401 restart alarm "//trim(fnest), & NOAHMP401_struc(n)%ts,& NOAHMP401_struc(n)%rstInterval) ! EMK Add alarm to reset tair_agl_min for RHMin. This should ! match the output interval, since that is used for calculating ! Tair_F_min. - write(fnest,'(i3.3)') n call LIS_registerAlarm("NoahMP401 RHMin alarm "//trim(fnest),& NOAHMP401_struc(n)%ts,& LIS_sfmodel_struc(n)%outInterval) diff --git a/lis/surfacemodels/land/noahmp.4.0.1/NoahMP401_main.F90 b/lis/surfacemodels/land/noahmp.4.0.1/NoahMP401_main.F90 index 87c42073b..dce98f1ea 100644 --- a/lis/surfacemodels/land/noahmp.4.0.1/NoahMP401_main.F90 +++ b/lis/surfacemodels/land/noahmp.4.0.1/NoahMP401_main.F90 @@ -272,7 +272,8 @@ subroutine NoahMP401_main(n) ! check NoahMP401 alarm. If alarm is ring, run model. - alarmCheck = LIS_isAlarmRinging(LIS_rc, "NoahMP401 model alarm") + write(fnest,'(i3.3)') n + alarmCheck = LIS_isAlarmRinging(LIS_rc, "NoahMP401 model alarm "//trim(fnest)) if (alarmCheck) Then do t = 1, LIS_rc%npatch(n, LIS_rc%lsm_index) diff --git a/lis/surfacemodels/land/noahmp.4.0.1/NoahMP401_writerst.F90 b/lis/surfacemodels/land/noahmp.4.0.1/NoahMP401_writerst.F90 index 5e0cd5a59..4b02f64db 100644 --- a/lis/surfacemodels/land/noahmp.4.0.1/NoahMP401_writerst.F90 +++ b/lis/surfacemodels/land/noahmp.4.0.1/NoahMP401_writerst.F90 @@ -60,9 +60,11 @@ subroutine NoahMP401_writerst(n) logical :: alarmCheck integer :: ftn integer :: status + character*3 :: fnest ! set restart alarm - alarmCheck = LIS_isAlarmRinging(LIS_rc, "NoahMP401 restart alarm") + write(fnest,'(i3.3)') n + alarmCheck = LIS_isAlarmRinging(LIS_rc, "NoahMP401 restart alarm "//trim(fnest)) ! set restart file format (read from LIS configration file_ wformat = trim(NOAHMP401_struc(n)%rformat) From 69a8aa40770e0d2db6920751ba99cb1954eb839e Mon Sep 17 00:00:00 2001 From: "James V. Geiger" Date: Tue, 21 Nov 2023 08:59:31 -0500 Subject: [PATCH 2/2] Remove extra "write(fnest)" --- lis/surfacemodels/land/noahmp.4.0.1/NoahMP401_main.F90 | 1 - 1 file changed, 1 deletion(-) diff --git a/lis/surfacemodels/land/noahmp.4.0.1/NoahMP401_main.F90 b/lis/surfacemodels/land/noahmp.4.0.1/NoahMP401_main.F90 index dce98f1ea..73579e51f 100644 --- a/lis/surfacemodels/land/noahmp.4.0.1/NoahMP401_main.F90 +++ b/lis/surfacemodels/land/noahmp.4.0.1/NoahMP401_main.F90 @@ -1434,7 +1434,6 @@ subroutine NoahMP401_main(n) ! EMK...See if noahmp401_struc(n)%noahmp401(t)%tair_agl_min needs to be ! reset for calculating RHMin. - write(fnest,'(i3.3)') n alarmCheck = LIS_isAlarmRinging(LIS_rc, & "NoahMP401 RHMin alarm "//trim(fnest)) if (alarmCheck) then