From a8c0733c6002dc2ef7e03c1b684e5fdef16bf007 Mon Sep 17 00:00:00 2001 From: Hong-Yi Li Date: Thu, 1 Dec 2022 09:02:30 -0800 Subject: [PATCH 1/4] deal with uninitialized variables in MOSART_heat_mod.F90 --- .../mosart/src/riverroute/MOSART_heat_mod.F90 | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/components/mosart/src/riverroute/MOSART_heat_mod.F90 b/components/mosart/src/riverroute/MOSART_heat_mod.F90 index 78b16751efef..1663f2f87ce1 100644 --- a/components/mosart/src/riverroute/MOSART_heat_mod.F90 +++ b/components/mosart/src/riverroute/MOSART_heat_mod.F90 @@ -75,21 +75,22 @@ subroutine subnetworkHeat_simple(iunit, theDeltaT) integer, intent(in) :: iunit real(r8), intent(in) :: theDeltaT - real(r8) :: Qsur, Qsub ! flow rate of surface and subsurface runoff separately - !if(TUnit%fdir(iunit) >= 0 .and. TUnit%areaTotal(iunit) > TINYVALUE1) then - THeat%Hs_t(iunit) = 0._r8 - THeat%Hl_t(iunit) = 0._r8 - THeat%He_t(iunit) = 0._r8 - THeat%Hh_t(iunit) = 0._r8 - THeat%Hc_t(iunit) = 0._r8 + !real(r8) :: Qsur, Qsub ! flow rate of surface and subsurface runoff separately + + !!if(TUnit%fdir(iunit) >= 0 .and. TUnit%areaTotal(iunit) > TINYVALUE1) then + THeat%Hs_t(iunit) = 0._r8 + THeat%Hl_t(iunit) = 0._r8 + THeat%He_t(iunit) = 0._r8 + THeat%Hh_t(iunit) = 0._r8 + THeat%Hc_t(iunit) = 0._r8 - THeat%Ha_h2t(iunit) = 0._r8 - THeat%Ha_t2r(iunit) = -cr_advectheat(abs(TRunoff%etout(iunit,nt_nliq)+TRunoff%etout(iunit,nt_nice)), THeat%Tt(iunit)) - ! change of energy due to heat exchange with the environment - THeat%deltaH_t(iunit) = theDeltaT * (THeat%Hs_t(iunit) + THeat%Hl_t(iunit) + THeat%He_t(iunit) + THeat%Hc_t(iunit) + THeat%Hh_t(iunit)) - ! change of energy due to advective heat flux - THeat%deltaM_t(iunit) = theDeltaT * (THeat%Ha_h2t(iunit)-cr_advectheat(Qsur + Qsub, THeat%Tt(iunit))) - !end if + THeat%Ha_h2t(iunit) = 0._r8 + THeat%Ha_t2r(iunit) = -cr_advectheat(abs(TRunoff%etout(iunit,nt_nliq)+TRunoff%etout(iunit,nt_nice)), THeat%Tt(iunit)) + ! change of energy due to heat exchange with the environment + THeat%deltaH_t(iunit) = 0._r8 !theDeltaT * (THeat%Hs_t(iunit) + THeat%Hl_t(iunit) + THeat%He_t(iunit) + THeat%Hc_t(iunit) + THeat%Hh_t(iunit)) + ! change of energy due to advective heat flux + THeat%deltaM_t(iunit) = 0._r8 !theDeltaT * (THeat%Ha_h2t(iunit)-cr_advectheat(Qsur + Qsub, THeat%Tt(iunit))) + !!end if end subroutine subnetworkHeat_simple From a8d2a3a5fe0b5cdf42ed3c54d5e5f89c4f2dd437 Mon Sep 17 00:00:00 2001 From: Hong-Yi Li Date: Thu, 1 Dec 2022 13:39:24 -0800 Subject: [PATCH 2/4] Addressing a few minor formatting issues --- components/mosart/src/riverroute/MOSART_heat_mod.F90 | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/components/mosart/src/riverroute/MOSART_heat_mod.F90 b/components/mosart/src/riverroute/MOSART_heat_mod.F90 index 1663f2f87ce1..05e5d527255a 100644 --- a/components/mosart/src/riverroute/MOSART_heat_mod.F90 +++ b/components/mosart/src/riverroute/MOSART_heat_mod.F90 @@ -75,9 +75,6 @@ subroutine subnetworkHeat_simple(iunit, theDeltaT) integer, intent(in) :: iunit real(r8), intent(in) :: theDeltaT - !real(r8) :: Qsur, Qsub ! flow rate of surface and subsurface runoff separately - - !!if(TUnit%fdir(iunit) >= 0 .and. TUnit%areaTotal(iunit) > TINYVALUE1) then THeat%Hs_t(iunit) = 0._r8 THeat%Hl_t(iunit) = 0._r8 THeat%He_t(iunit) = 0._r8 @@ -87,10 +84,10 @@ subroutine subnetworkHeat_simple(iunit, theDeltaT) THeat%Ha_h2t(iunit) = 0._r8 THeat%Ha_t2r(iunit) = -cr_advectheat(abs(TRunoff%etout(iunit,nt_nliq)+TRunoff%etout(iunit,nt_nice)), THeat%Tt(iunit)) ! change of energy due to heat exchange with the environment - THeat%deltaH_t(iunit) = 0._r8 !theDeltaT * (THeat%Hs_t(iunit) + THeat%Hl_t(iunit) + THeat%He_t(iunit) + THeat%Hc_t(iunit) + THeat%Hh_t(iunit)) + THeat%deltaH_t(iunit) = 0._r8 ! change of energy due to advective heat flux - THeat%deltaM_t(iunit) = 0._r8 !theDeltaT * (THeat%Ha_h2t(iunit)-cr_advectheat(Qsur + Qsub, THeat%Tt(iunit))) - !!end if + THeat%deltaM_t(iunit) = 0._r8 + end subroutine subnetworkHeat_simple From ff3f37747f1fa9f92eebfb2e27597253f3c8c9bf Mon Sep 17 00:00:00 2001 From: Hong-Yi Li Date: Sun, 4 Dec 2022 10:34:39 -0800 Subject: [PATCH 3/4] adding a new test for mosart-heat --- cime_config/tests.py | 8 ++++++++ .../testdefs/testmods_dirs/mosart/heat/shell_commands | 1 + .../testdefs/testmods_dirs/mosart/heat/user_nl_mosart | 2 ++ 3 files changed, 11 insertions(+) create mode 100644 components/mosart/cime_config/testdefs/testmods_dirs/mosart/heat/shell_commands create mode 100644 components/mosart/cime_config/testdefs/testmods_dirs/mosart/heat/user_nl_mosart diff --git a/cime_config/tests.py b/cime_config/tests.py index 0140e62ea810..9b4624ec0993 100644 --- a/cime_config/tests.py +++ b/cime_config/tests.py @@ -13,6 +13,7 @@ "e3sm_mosart_developer" : { "share" : True, "time" : "0:45:00", + "inherit" : ("e3sm_mosart_heat"), "tests" : ( "ERS.r05_r05.RMOSGPCC.mosart-gpcc_1972", "ERS.MOS_USRDAT.RMOSGPCC.mosart-mos_usrdat", @@ -20,6 +21,13 @@ ) }, + "e3sm_mosart_heat" : { + "time" : "0:45:00", + "tests" : ( + "ERS.r05_r05.RMOSGPCC.mosart-heat", + ) + }, + "e3sm_mosart_exenoshare": { "time" : "0:45:00", "tests" : ( diff --git a/components/mosart/cime_config/testdefs/testmods_dirs/mosart/heat/shell_commands b/components/mosart/cime_config/testdefs/testmods_dirs/mosart/heat/shell_commands new file mode 100644 index 000000000000..1fe51e449b45 --- /dev/null +++ b/components/mosart/cime_config/testdefs/testmods_dirs/mosart/heat/shell_commands @@ -0,0 +1 @@ +./xmlchange DATM_CLMNCEP_YR_END=1972 diff --git a/components/mosart/cime_config/testdefs/testmods_dirs/mosart/heat/user_nl_mosart b/components/mosart/cime_config/testdefs/testmods_dirs/mosart/heat/user_nl_mosart new file mode 100644 index 000000000000..9dd0fc62663c --- /dev/null +++ b/components/mosart/cime_config/testdefs/testmods_dirs/mosart/heat/user_nl_mosart @@ -0,0 +1,2 @@ +frivinp_rtm = '$DIN_LOC_ROOT/rof/mosart/MOSART_global_half_20180721a.nc' +heatflag = .true. From 95a4541fbd5a35a8f9aad76d63eaa5b20a2df5c6 Mon Sep 17 00:00:00 2001 From: Hong-Yi Li Date: Wed, 7 Dec 2022 10:45:43 -0800 Subject: [PATCH 4/4] adding a mosart-heat test directly into the e3sm_mosart_developer suite --- cime_config/tests.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/cime_config/tests.py b/cime_config/tests.py index 9b4624ec0993..83dcb68cdc04 100644 --- a/cime_config/tests.py +++ b/cime_config/tests.py @@ -13,18 +13,11 @@ "e3sm_mosart_developer" : { "share" : True, "time" : "0:45:00", - "inherit" : ("e3sm_mosart_heat"), "tests" : ( "ERS.r05_r05.RMOSGPCC.mosart-gpcc_1972", "ERS.MOS_USRDAT.RMOSGPCC.mosart-mos_usrdat", "SMS.MOS_USRDAT.RMOSGPCC.mosart-unstructure", - ) - }, - - "e3sm_mosart_heat" : { - "time" : "0:45:00", - "tests" : ( - "ERS.r05_r05.RMOSGPCC.mosart-heat", + "ERS.r05_r05.RMOSGPCC.mosart-heat", ) },