Skip to content

Commit

Permalink
Only try to access irrig_method for CFTs
Browse files Browse the repository at this point in the history
Without this, in runs with create_crop_landunit false, we run into
problems trying to access irrig_method for the irrigated generic crop,
which falls outside the bounds of clm_varsur's irrig_method array:

   at /gpfs/fs1/work/sacks/ctsm_code/current_branch1/src/biogeophys/IrrigationMod.F90:715

   Fortran runtime error: Index '16' of dimension 2 of array 'irrig_method' below lower bound of 17

I'm not sure we want this check long-term, but we need it at least until
the code for irrig_method is generalized to work with
create_crop_landunit false.
  • Loading branch information
billsacks committed Nov 15, 2018
1 parent 23645cb commit 21616fc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/biogeophys/IrrigationMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ module IrrigationMod
use pftconMod , only : pftcon
use clm_varctl , only : iulog
use clm_varcon , only : isecspday, denh2o, spval, ispval, namec, nameg
use clm_varpar , only : nlevsoi, nlevgrnd
use clm_varpar , only : nlevsoi, nlevgrnd, cft_lb, cft_ub
use clm_time_manager , only : get_step_size
use SoilWaterRetentionCurveMod, only : soil_water_retention_curve_type
use WaterFluxBulkType , only : waterfluxbulk_type
Expand Down Expand Up @@ -710,8 +710,8 @@ subroutine SetIrrigMethod(this, bounds)

do p = bounds%begp,bounds%endp
g = patch%gridcell(p)
if (pftcon%irrigated(patch%itype(p)) == 1._r8) then
m = patch%itype(p)
m = patch%itype(p)
if (m >= cft_lb .and. m <= cft_ub .and. pftcon%irrigated(m) == 1._r8) then
this%irrig_method_patch(p) = irrig_method(g,m)
! ensure irrig_method is valid; if not set, use drip irrigation
if(irrig_method(g,m) == irrig_method_unset) then
Expand Down

0 comments on commit 21616fc

Please sign in to comment.