Skip to content

Commit 3446e98

Browse files
authored
Merge pull request ESCOMP#138 from mvdebolskiy/bug-fix-eri-towstream
Bug fix eri towstream
2 parents 49c7f8b + cca42a6 commit 3446e98

File tree

4 files changed

+40
-8
lines changed

4 files changed

+40
-8
lines changed

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ fxDONOTUSEurl = https://github.com/ESCOMP/CMEPS.git
9292
[submodule "cdeps"]
9393
path = components/cdeps
9494
url = https://github.com/NorESMhub/CDEPS.git
95-
fxtag = cdeps1.0.70_noresm_v0
95+
fxtag = cdeps1.0.70_noresm_v5
9696
fxrequired = ToplevelRequired
9797
# Standard Fork to compare to with "git fleximod test" to ensure personal forks aren't committed
9898
fxDONOTUSEurl = https://github.com/NorESMhub/CDEPS.git

cime_config/testdefs/testlist_clm.xml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4371,7 +4371,7 @@
43714371
<option name="comment">""</option>
43724372
</options>
43734373
</test>
4374-
<test name="ERP_D_Ld5" grid="f45_f45_mg37" compset="I1850Clm60FatesSp" testmods="clm/FatesColdClm60Cam7LndTuningMode">
4374+
<test name="ERI_D_Ld30" grid="f45_f45_mg37" compset="I1850Clm60FatesSp" testmods="clm/FatesColdClm60Cam7LndTuningMode">
43754375
<machines>
43764376
<machine name="betzy" compiler="gnu" category="aux_clm_noresm"/>
43774377
</machines>
@@ -4410,7 +4410,7 @@
44104410
<option name="comment">""</option>
44114411
</options>
44124412
</test>
4413-
<test name="ERS_D_Ln11" grid="ne30pg3_ne30pg3_mtn14" compset="I1850Clm60FatesNocompSpinup" testmods="clm/FatesColdSpinup">
4413+
<test name="ERS_D_Ld11" grid="ne30pg3_ne30pg3_mtn14" compset="I1850Clm60FatesNocompSpinup" testmods="clm/FatesColdSpinup">
44144414
<machines>
44154415
<machine name="betzy" compiler="intel" category="aux_clm_noresm"/>
44164416
</machines>
@@ -4419,6 +4419,24 @@
44194419
<option name="comment">""</option>
44204420
</options>
44214421
</test>
4422+
<test name="ERI_D_Ld11" grid="ne30pg3_ne30pg3_mtn14" compset="I1850Clm60FatesNocompSpinup" testmods="clm/FatesColdSpinup">
4423+
<machines>
4424+
<machine name="betzy" compiler="intel" category="aux_clm_noresm"/>
4425+
</machines>
4426+
<options>
4427+
<option name="wallclock">01:50:00</option>
4428+
<option name="comment">""</option>
4429+
</options>
4430+
</test>
4431+
<test name="ERI_D_Ld30" grid="f45_f45_mg37" compset="I1850Clm60FatesNocomp" testmods="clm/FatesColdClm60Cam7LndTuningMode">
4432+
<machines>
4433+
<machine name="betzy" compiler="gnu" category="aux_clm_noresm"/>
4434+
</machines>
4435+
<options>
4436+
<option name="wallclock">00:30:00</option>
4437+
<option name="comment">""</option>
4438+
</options>
4439+
</test>
44224440
<test name="ERS_D_Ld5" grid="f45_f45_mg37" compset="I2000Clm60Fates" testmods="clm/FatesColdMeganNoComp">
44234441
<machines>
44244442
<machine name="betzy" compiler="intel" category="aux_clm_noresm"/>

src/main/clm_driver.F90

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ module clm_driver
1313
use clm_varctl , only : use_cn, use_lch4, use_noio, use_c13, use_c14
1414
use CNSharedParamsMod , only : use_matrixcn
1515
use clm_varctl , only : use_crop, irrigate, ndep_from_cpl
16-
use clm_varctl , only : use_soil_moisture_streams
17-
use clm_varctl , only : use_cropcal_streams
16+
use clm_varctl , only : use_soil_moisture_streams, fates_radiation_model
17+
use clm_varctl , only : use_cropcal_streams, is_cold_start, nsrest, nsrStartup
1818
use clm_time_manager , only : get_nstep, is_beg_curr_day, is_beg_curr_year
1919
use clm_time_manager , only : get_prev_date, is_first_step
2020
use clm_varpar , only : nlevsno, nlevgrnd
@@ -606,6 +606,7 @@ subroutine clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate, ro
606606
! over the patch index range defined by bounds_clump%begp:bounds_proc%endp
607607

608608
if(use_fates) then
609+
if (masterproc) write(iulog,*),"MVD wrapsun ", get_nstep(), nextsw_cday, declinp1, doalb
609610
call clm_fates%wrap_sunfrac(nc,atm2lnd_inst, canopystate_inst)
610611
else
611612
call CanopySunShadeFracs(filter(nc)%nourbanp,filter(nc)%num_nourbanp, &
@@ -1226,9 +1227,22 @@ subroutine clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate, ro
12261227
! ============================================================================
12271228
! Determine albedos for next time step
12281229
! ============================================================================
1229-
1230-
if (doalb) then
12311230

1231+
! This is only relevant to fates two stream to not break sun fraction calculations
1232+
! on the second timestep after start from finidat or for hybrid run.
1233+
if (use_fates .and. .not. use_fates_sp .and. fates_radiation_model == 'twostream') then
1234+
if (.not. doalb .and. get_nstep() == 1) then
1235+
if (.not. is_cold_start .and. nsrest == nsrStartup) then
1236+
call UpdateZenithAngles(bounds_clump, surfalb_inst, nextsw_cday, declinp1)
1237+
call clm_fates%wrap_canopy_radiation(bounds_clump, nc, &
1238+
water_inst%waterdiagnosticbulk_inst%fcansno_patch(bounds_clump%begp:bounds_clump%endp), &
1239+
surfalb_inst)
1240+
endif
1241+
endif
1242+
endif
1243+
1244+
if (doalb) then
1245+
if (masterproc) write(iulog,*) "Step alb: ", get_nstep()
12321246
! Albedos for non-urban columns
12331247
call t_startf('surfalb')
12341248
call SurfaceAlbedo(bounds_clump, &

0 commit comments

Comments
 (0)