// Determines target soil moisture level for irrigation. If h2osoi_liq_so is the soil moisture level at
// which stomata are fully open and h2osoi_liq_sat is the soil moisture level at saturation (eff_porosity),
// then the target soil moisture level is (h2osoi_liq_so + irrig_factor*(h2osoi_liq_sat - h2osoi_liq_so)).
// A value of 0 means that the target soil moisture level is h2osoi_liq_so.
// A value of 1 means that the target soil moisture level is h2osoi_liq_sat
doubleirrig_factor=0.7;
doubleirrig_min_lai=0.0;// Minimum LAI for irrigation
doubleirrig_btran_thresh=0.999999;// Irrigate when btran falls below 0.999999 rather than 1 to allow for round-off error
intirrig_start_time=isecspday/4// Time of day to check whether we need irrigation, seconds (0 = midnight).
intirrig_length=isecspday/6;// Desired amount of time to irrigate per day (sec). Actual time may differ if this is not a multiple of dtime. Irrigation won't work properly if dtime > secsperday
intirrig_nsteps_per_day=((irrig_length+(dtime-1))/dtime);// number of time steps per day in which we irrigate
// Determine if irrigation is needed (over irrigated soil columns)
// First, determine in what grid cells we need to bother 'measuring' soil water, to see if we need irrigation
// Also set n_irrig_steps_left for these grid cells
// n_irrig_steps_left(p) > 0 is ok even if irrig_rate(p) ends up = 0
// in this case, we'll irrigate by 0 for the given number of time steps
// get_prev_date(yr, mon, day, time) ! get time as of beginning of time step --- figure out!! -- need variable 'time'