Skip to content

Commit

Permalink
move irrigation calls
Browse files Browse the repository at this point in the history
  • Loading branch information
swensosc committed Mar 17, 2023
1 parent faad7ae commit 7f2a446
Showing 1 changed file with 29 additions and 29 deletions.
58 changes: 29 additions & 29 deletions src/main/clm_driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,35 @@ subroutine clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate, ro
call setExposedvegpFilter(bounds_clump, &
canopystate_inst%frac_veg_nosno_patch(bounds_clump%begp:bounds_clump%endp))

! ============================================================================
! Determine irrigation needed for future time steps
! ============================================================================

! NOTE(wjs, 2016-09-08) The placement of this call in the driver is historical: it
! used to be that it had to come after btran was computed. Now it no longer depends
! on btran, so it could be moved earlier in the driver loop - possibly even
! immediately before ApplyIrrigation, which would be a more clear place to put it.

call t_startf('irrigationneeded')
call irrigation_inst%CalcIrrigationNeeded( &
bounds = bounds_clump, &
num_exposedvegp = filter(nc)%num_exposedvegp, &
filter_exposedvegp = filter(nc)%exposedvegp, &
elai = canopystate_inst%elai_patch(bounds_clump%begp:bounds_clump%endp), &
t_soisno = temperature_inst%t_soisno_col(bounds_clump%begc:bounds_clump%endc , 1:nlevgrnd), &
eff_porosity = soilstate_inst%eff_porosity_col(bounds_clump%begc:bounds_clump%endc, 1:nlevgrnd), &
h2osoi_liq = waterstate_inst%h2osoi_liq_col(bounds_clump%begc:bounds_clump%endc , 1:nlevgrnd), &
volr = atm2lnd_inst%volrmch_grc(bounds_clump%begg:bounds_clump%endg), &
rof_prognostic = rof_prognostic)
call t_stopf('irrigationneeded')

! Update irrigation rate from data stream
if (use_irrigation_streams) then
call t_startf('prescribed_irrig')
call PrescribedIrrigationInterp(bounds_clump, irrigation_inst)
call t_stopf('prescribed_irrig')
endif

! Irrigation flux
! input is main channel storage
call irrigation_inst%ApplyIrrigation(bounds_clump)
Expand Down Expand Up @@ -615,35 +644,6 @@ subroutine clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate, ro
humanindex_inst)
call t_stopf('bgplake')

! ============================================================================
! Determine irrigation needed for future time steps
! ============================================================================

! NOTE(wjs, 2016-09-08) The placement of this call in the driver is historical: it
! used to be that it had to come after btran was computed. Now it no longer depends
! on btran, so it could be moved earlier in the driver loop - possibly even
! immediately before ApplyIrrigation, which would be a more clear place to put it.

call t_startf('irrigationneeded')
call irrigation_inst%CalcIrrigationNeeded( &
bounds = bounds_clump, &
num_exposedvegp = filter(nc)%num_exposedvegp, &
filter_exposedvegp = filter(nc)%exposedvegp, &
elai = canopystate_inst%elai_patch(bounds_clump%begp:bounds_clump%endp), &
t_soisno = temperature_inst%t_soisno_col(bounds_clump%begc:bounds_clump%endc , 1:nlevgrnd), &
eff_porosity = soilstate_inst%eff_porosity_col(bounds_clump%begc:bounds_clump%endc, 1:nlevgrnd), &
h2osoi_liq = waterstate_inst%h2osoi_liq_col(bounds_clump%begc:bounds_clump%endc , 1:nlevgrnd), &
volr = atm2lnd_inst%volrmch_grc(bounds_clump%begg:bounds_clump%endg), &
rof_prognostic = rof_prognostic)
call t_stopf('irrigationneeded')

! Update irrigation rate from data stream
if (use_irrigation_streams) then
call t_startf('prescribed_irrig')
call PrescribedIrrigationInterp(bounds_clump, irrigation_inst)
call t_stopf('prescribed_irrig')
endif


! ============================================================================
! DUST and VOC emissions
Expand Down

0 comments on commit 7f2a446

Please sign in to comment.