Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deal with uninitialized variables in MOSART_heat_mod.F90 #5343

Merged
merged 4 commits into from
Dec 14, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions cime_config/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,21 @@
"e3sm_mosart_developer" : {
"share" : True,
"time" : "0:45:00",
"inherit" : ("e3sm_mosart_heat"),
Copy link
Contributor

@bishtgautam bishtgautam Dec 5, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@liho745 Thanks for adding a new test. Instead of creating a new test suite (i.e. e3sm_mosart_heat), please directly add the new test in the e3sm_mosart_developer test suite at https://github.com/E3SM-Project/E3SM/pull/5343/files#diff-e2fbf220fd98012c3bdf61d7f341a1815f43823af2ffd3bf926d5aafc4363d8bR20. Does it make sense?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually not quite -- I followed the example of the sediment test added by Donghui Xu, where he created a mosart-sediment separately and then inherited it in the e3sm_mosart_developer suite. Are there any considerations to treating sediment and heat differently in the testing?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will have to revisit the approach taken for the sediment test when I re-merge that PR into next. To avoid creating many new test suites, directly add ERS.r05_r05.RMOSGPCC.mosart-heat in the e3sm_mosart_developer test suite.

Copy link
Contributor Author

@liho745 liho745 Dec 7, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It has to be created as a sub-suite and then called from the main e3sm_mosart_developer suite, since in this mosart-heat test we are turning on heatflag which is set to .false. by default in the other test cases. I have discussed this with Donghui about the reason he created a mosart-sediment test as a sub-suite, and I quote from him "mosart-sediment cannot run with other test cases with the same build". Similarly, in my case, if I create a mosart-heat case directly within e3sm_mosart_developer suite, the tests will just fail for mosart-heat.

It seems at least more discussion is needed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I quote from him "mosart-sediment cannot run with other test cases with the same build".

Okay, I now recall this issue with mosart sediment. Does your mosart heat test need different build flags (not namelist flags) than those tests in the e3sm_mosart_developer test suite?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I have to turn on heatflag via user_nl_mosart.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is a namelist flag and not a build flag (e.g. -DUSE_PETSC_LIB), which is used when compiling various *.F90. Thus, you should be able to directly add the new test in the e3sm_mosart_developer test suite.

Copy link
Contributor Author

@liho745 liho745 Dec 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is a namelist flag and not a build flag (e.g. -DUSE_PETSC_LIB), which is used when compiling various *.F90. Thus, you should be able to directly add the new test in the e3sm_mosart_developer test suite.

I tried what you said, and the test results are below, i.e., the baseline test failed.

ERS.r05_r05.RMOSGPCC.compy_intel.mosart-heat (Overall: DIFF) details:
PASS ERS.r05_r05.RMOSGPCC.compy_intel.mosart-heat CREATE_NEWCASE
PASS ERS.r05_r05.RMOSGPCC.compy_intel.mosart-heat XML
PASS ERS.r05_r05.RMOSGPCC.compy_intel.mosart-heat SETUP
PASS ERS.r05_r05.RMOSGPCC.compy_intel.mosart-heat SHAREDLIB_BUILD time=277
FAIL ERS.r05_r05.RMOSGPCC.compy_intel.mosart-heat NLCOMP
PASS ERS.r05_r05.RMOSGPCC.compy_intel.mosart-heat MODEL_BUILD time=212
PASS ERS.r05_r05.RMOSGPCC.compy_intel.mosart-heat SUBMIT
PASS ERS.r05_r05.RMOSGPCC.compy_intel.mosart-heat RUN time=51
PASS ERS.r05_r05.RMOSGPCC.compy_intel.mosart-heat COMPARE_base_rest
FAIL ERS.r05_r05.RMOSGPCC.compy_intel.mosart-heat BASELINE 21ffb4d: ERROR BFAIL baseline directory '/compyfs/liho623/e3sm_scratch/e3sm_baseline/21ffb4d/ERS.r05_r05.RMOSGPCC.compy_intel.mosart-heat' does not exist
PASS ERS.r05_r05.RMOSGPCC.compy_intel.mosart-heat MEMLEAK
PASS ERS.r05_r05.RMOSGPCC.compy_intel.mosart-heat SHORT_TERM_ARCHIVER

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The above failure is okay because the baseline for this new test doesn't exist.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good. Added the mosart-heat test directly into the e3sm_mosart_developer suite.

"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",
)
},

"e3sm_mosart_exenoshare": {
"time" : "0:45:00",
"tests" : (
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
./xmlchange DATM_CLMNCEP_YR_END=1972
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
frivinp_rtm = '$DIN_LOC_ROOT/rof/mosart/MOSART_global_half_20180721a.nc'
heatflag = .true.
26 changes: 12 additions & 14 deletions components/mosart/src/riverroute/MOSART_heat_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -75,21 +75,19 @@ 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
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) = 0._r8
! change of energy due to advective heat flux
THeat%deltaM_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
end subroutine subnetworkHeat_simple


Expand Down