@@ -179,11 +179,11 @@ subroutine BalanceCheck( bounds, &
179
179
! error = abs(precipitation - change of water storage - evaporation - runoff)
180
180
!
181
181
! !USES:
182
- use clm_varcon , only : spval
183
- use clm_time_manager , only : get_step_size, get_nstep
184
- use clm_time_manager , only : get_nstep_since_startup_or_lastDA_restart_or_pause
185
- use CanopyStateType , only : canopystate_type
186
- use SurfaceAlbedoType , only : surfalb_type
182
+ use clm_varcon , only : spval
183
+ use clm_time_manager , only : get_step_size, get_nstep
184
+ use clm_time_manager , only : get_nstep_since_startup_or_lastDA_restart_or_pause
185
+ use CanopyStateType , only : canopystate_type
186
+ use SurfaceAlbedoType , only : surfalb_type
187
187
use subgridAveMod
188
188
!
189
189
! !ARGUMENTS:
@@ -227,7 +227,6 @@ subroutine BalanceCheck( bounds, &
227
227
errh2osno = > waterstate_inst% errh2osno_col , & ! Output: [real(r8) (:) ] error in h2osno (kg m-2)
228
228
endwb = > waterstate_inst% endwb_col , & ! Output: [real(r8) (:) ] water mass end of the time step
229
229
total_plant_stored_h2o_col = > waterstate_inst% total_plant_stored_h2o_col, & ! Input: [real(r8) (:) ] water mass in plant tissues (kg m-2)
230
-
231
230
qflx_rootsoi_col = > waterflux_inst% qflx_rootsoi_col , & ! Input [real(r8) (:) ] water loss in soil layers to root uptake (mm H2O/s)
232
231
! (ie transpiration demand, often = transpiration)
233
232
qflx_rain_grnd_col = > waterflux_inst% qflx_rain_grnd_col , & ! Input: [real(r8) (:) ] rain on ground after interception (mm H2O/s) [+]
@@ -261,6 +260,7 @@ subroutine BalanceCheck( bounds, &
261
260
qflx_ice_dynbal = > waterflux_inst% qflx_ice_dynbal_grc , & ! Input: [real(r8) (:) ] ice runoff due to dynamic land cover change (mm H2O /s)
262
261
snow_sources = > waterflux_inst% snow_sources_col , & ! Output: [real(r8) (:) ] snow sources (mm H2O /s)
263
262
snow_sinks = > waterflux_inst% snow_sinks_col , & ! Output: [real(r8) (:) ] snow sinks (mm H2O /s)
263
+
264
264
qflx_irrig = > irrigation_inst% qflx_irrig_col , & ! Input: [real(r8) (:) ] irrigation flux (mm H2O /s)
265
265
266
266
qflx_glcice_dyn_water_flux = > glacier_smb_inst% qflx_glcice_dyn_water_flux_col, & ! Input: [real(r8) (:)] water flux needed for balance check due to glc_dyn_runoff_routing (mm H2O/s) (positive means addition of water to the system)
@@ -346,6 +346,7 @@ subroutine BalanceCheck( bounds, &
346
346
- qflx_ice_runoff_xs(c) &
347
347
- qflx_snwcp_discarded_liq(c) &
348
348
- qflx_snwcp_discarded_ice(c)) * dtime
349
+
349
350
else
350
351
351
352
errh2o(c) = 0.0_r8
@@ -355,12 +356,11 @@ subroutine BalanceCheck( bounds, &
355
356
end do
356
357
357
358
found = .false.
358
-
359
359
do c = bounds% begc, bounds% endc
360
- if (abs (errh2o(c)) > 1.e-9_r8 ) then
361
- found = .true.
362
- indexc = c
363
- end if
360
+ if (abs (errh2o(c)) > 1.e-9_r8 ) then
361
+ found = .true.
362
+ indexc = c
363
+ end if
364
364
end do
365
365
366
366
if ( found ) then
@@ -406,12 +406,12 @@ subroutine BalanceCheck( bounds, &
406
406
! TODO: Balance errors must be fixed for fully coupled model (ICON-eCLM-ParFlow)
407
407
write (iulog,* )' Ignoring water balance error...'
408
408
#else
409
- write (iulog,* )' clm model is stopping - error is greater than 1e-5 (mm) '
409
+ write (iulog,* )' clm model is stopping'
410
410
call endrun(decomp_index= indexc, clmlevel= namec, msg= errmsg(sourcefile, __LINE__))
411
411
#endif
412
412
else if (abs (errh2o(indexc)) > 1.e-5_r8 .and. (DAnstep > skip_steps) ) then
413
413
414
-
414
+ write (iulog, * ) ' clm model is stopping - error is greater than 1e-5 (mm) '
415
415
write (iulog,* )' nstep = ' ,nstep
416
416
write (iulog,* )' errh2o = ' ,errh2o(indexc)
417
417
write (iulog,* )' forc_rain = ' ,forc_rain_col(indexc)* dtime
@@ -441,7 +441,7 @@ subroutine BalanceCheck( bounds, &
441
441
! TODO: Balance errors must be fixed for fully coupled model (ICON-eCLM-ParFlow)
442
442
write (iulog,* )' Ignoring water balance error...'
443
443
#else
444
- write (iulog,* )' clm model is stopping - error is greater than 1e-5 (mm) '
444
+ write (iulog,* )' clm model is stopping'
445
445
call endrun(decomp_index= indexc, clmlevel= namec, msg= errmsg(sourcefile, __LINE__))
446
446
#endif
447
447
end if
@@ -690,6 +690,7 @@ subroutine BalanceCheck( bounds, &
690
690
end if
691
691
692
692
! Soil energy balance check
693
+
693
694
found = .false.
694
695
do c = bounds% begc,bounds% endc
695
696
if (col% active(c)) then
@@ -707,8 +708,10 @@ subroutine BalanceCheck( bounds, &
707
708
! TODO: Balance errors must be fixed for fully coupled model (ICON-eCLM-ParFlow)
708
709
write (iulog,* )' Ignoring soil balance error...'
709
710
#else
710
- write (iulog,* )' clm model is stopping - error is greater than 1e-5 (mm)'
711
- call endrun(decomp_index= indexc, clmlevel= namec, msg= errmsg(sourcefile, __LINE__))
711
+ if (abs (errsoi_col(indexc)) > 1.e-4_r8 .and. (DAnstep > skip_steps) ) then
712
+ write (iulog,* )' clm model is stopping'
713
+ call endrun(decomp_index= indexc, clmlevel= namec, msg= errmsg(sourcefile, __LINE__))
714
+ end if
712
715
#endif
713
716
end if
714
717
0 commit comments