Soil Water Balance (SWB2)
Loading...
Searching...
No Matches
irrigation.F90
Go to the documentation of this file.
1!> @file
2!> Contains a single module, \ref irrigation, which
3!> provides support for estimating irrigation amounts
4
5!> Provides support for assessing the effect of irrigation on recharge
6!> values by estimating the irrigation required to maintain soil moisture levels
7!> for specific crop types.
9
10 use iso_c_binding, only : c_short, c_int, c_float, c_double
12 use data_catalog, only : dat
14 use datetime, only : mmdd2doy
15 use exceptions, only : warn, die, assert
16 use logfiles, only : logs, log_all
17 use parameters, only : params
18 use simulation_datetime, only : sim_dt
19 use fstring, only : ascharacter, operator( .contains. )
21
22 implicit none
23
24 private
25
27
28 enum, bind(c)
31 end enum
32
33 character (len=35), parameter :: app_option_name(0:4) = &
34 [ "Apply nothing ", &
35 "Apply to field capacity ", &
36 "Apply to specified deficit fraction", &
37 "Apply constant amount ", &
38 "Apply proportional to (PE + RO - R)" ]
39
40 real (c_float), allocatable :: maximum_allowable_depletion_fraction(:)
41 real (c_float), allocatable :: irrigation_from_groundwater(:)
42 real (c_float), allocatable :: irrigation_from_surface_water(:)
43
44 real (c_float), allocatable :: fraction_of_irrigation_from_gw(:)
45 real (c_float), allocatable :: irrigation_efficiency(:)
46 integer (c_int), allocatable :: num_days_of_irrigation(:)
47 integer (c_int), allocatable :: first_day_of_irrigation(:)
48 integer (c_int), allocatable :: last_day_of_irrigation(:)
49 integer (c_int), allocatable :: application_method_code(:)
50 integer (c_short), allocatable :: monthly_irrigation_schedule(:,:)
51 real (c_float), allocatable :: application_amount(:)
52
54
55contains
56
57!> Estimate the irrigation water required to sustain plant growth.
58!!
59!! Estimate the irrigation water required in order to
60!! keep soil moisture values above the maximum allowable depletion (MAD)
61!! for each gridcell.
62!!
63!! @param[inout] pGrd Pointer to the model grid object
64!! @param[in] pConfig Pointer to the configuration data structure (type T_CONFIG).
65!!
66
67 subroutine irrigation__initialize( is_active)
68
69 logical (c_bool), intent(in) :: is_active(:,:)
70
71 ! [ LOCALS ]
72 type (fstring_list_t) :: sl_temp_list
73 integer (c_int) :: number_of_landuse_codes
74 integer (c_int), allocatable :: landuse_table_codes(:)
75 integer (c_int) :: num_records
76 logical (c_bool) :: are_lengths_unequal
77 integer (c_int) :: index
78 integer (c_int) :: i
79 integer (c_int) :: status
80 character (len=256) :: str_buffer
81 type (fstring_list_t) :: sl_irrigation_days
82 type (fstring_list_t) :: sl_irrigation_begin
83 type (fstring_list_t) :: sl_irrigation_end
84 type (fstring_list_t) :: sl_application_method
85 type (fstring_list_t) :: sl_monthly_irrigation_schedule
86 character (len=31) :: temp_str
87
88 allocate( irrigation_from_groundwater( count( is_active ) ), stat=status )
89 call assert( status==0, "Failed to allocate memory.", __file__, __line__ )
90
91 allocate( irrigation_from_surface_water( count( is_active ) ), stat=status )
92 call assert( status==0, "Failed to allocate memory.", __file__, __line__ )
93
94 ! create list of possible table headings to look for...
95 call sl_temp_list%append( "LU_Code" )
96 call sl_temp_list%append( "Landuse_Lookup_Code" )
97
98 !> determine how many landuse codes are present
99 call params%get_parameters( slkeys=sl_temp_list, ivalues=landuse_table_codes )
100 number_of_landuse_codes = count( landuse_table_codes >= 0 )
101
102 ! create list of possible table headings to look for...
103 call sl_temp_list%clear()
104 call sl_temp_list%append( "Monthly_Irrigation_Schedule" )
105 call sl_temp_list%append( "Monthly_Irr_Schedule" )
106 call sl_temp_list%append( "Irrigation_Application_Schedule" )
107 call sl_temp_list%append( "Monthly_Application_Schedule" )
108
109 !> determine how many landuse codes are present
110 call params%get_parameters( slkeys=sl_temp_list, slvalues=sl_monthly_irrigation_schedule )
111
112 !> retrieve list of fraction of irrigation from groundwater
113 call sl_temp_list%clear()
114 call sl_temp_list%append("Fraction_irrigation_from_GW")
115 call sl_temp_list%append("Frac_irr_fm_GW")
116 call sl_temp_list%append("Fraction_irrigation_from_groundwater")
117 call sl_temp_list%append("Frac_irrigation_from_GW")
118 call sl_temp_list%append("Fraction_of_irrigation_from_GW")
119 call sl_temp_list%append("Fraction_of_irrigation_from_groundwater")
120
121 call params%get_parameters( slkeys=sl_temp_list, fvalues=fraction_of_irrigation_from_gw, lfatal=true )
122
123 !> retrieve maximum allowable depletion
124 call sl_temp_list%clear()
125 call sl_temp_list%append("Max_allowable_depletion")
126 call sl_temp_list%append("Maximum_allowable_depletion")
127 call sl_temp_list%append("MAD")
128
129 call params%get_parameters( slkeys=sl_temp_list, &
131 lfatal=true )
132
133
134 !> retrieve length (in days since planting) of irrigation
135 call sl_temp_list%clear()
136 call sl_temp_list%append("Irrigation_length")
137 call sl_temp_list%append("Irrigation_days")
138 call sl_temp_list%append("Irrigation_days_since_planting")
139
140 call params%get_parameters( slkeys=sl_temp_list, slvalues=sl_irrigation_days, lfatal=false )
141
142
143 !> retrieve first day of irrigation
144 call sl_temp_list%clear()
145 call sl_temp_list%append("First_day_of_irrigation")
146 call sl_temp_list%append("First_DOY_irrigation")
147 call sl_temp_list%append("Irrigation_start")
148 call sl_temp_list%append("Irrigation_start_date")
149
150 call params%get_parameters( slkeys=sl_temp_list, slvalues=sl_irrigation_begin, lfatal=true )
151
152
153 !> retrieve last day of irrigation
154 call sl_temp_list%clear()
155 call sl_temp_list%append("Last_day_of_irrigation")
156 call sl_temp_list%append("Last_DOY_irrigation")
157 call sl_temp_list%append("Irrigation_end")
158 call sl_temp_list%append("Irrigation_end_date")
159
160 call params%get_parameters( slkeys=sl_temp_list, slvalues=sl_irrigation_end, lfatal=true )
161 call sl_temp_list%clear()
162
163
164 !> retrieve irrigation efficiency
165 call sl_temp_list%clear()
166 call sl_temp_list%append("Irrigation_efficiency")
167 call sl_temp_list%append("Irrigation_application_efficiency")
168
169 call params%get_parameters( slkeys=sl_temp_list, &
170 fvalues=irrigation_efficiency, &
171 lfatal=true )
172
173 !> check: number of irrigation efficiency values == number of landuse codes?
174 num_records = ubound(irrigation_efficiency,1)
175 are_lengths_unequal = ( num_records /= number_of_landuse_codes )
176
177 if ( are_lengths_unequal ) &
178 call warn( smessage="The number of values specifying irrigation application" &
179 //" efficiency (" &
180 //ascharacter( num_records )//") does not match the number of landuse values (" &
181 //ascharacter( number_of_landuse_codes )//").", &
182 smodule=__file__, iline=__line__, lfatal=.true._c_bool )
183
184
185 !> process first day of irrigation. retrieved as a list of strings;
186 !! must convert the strings from mm/dd to DOY
187 allocate( first_day_of_irrigation( sl_irrigation_begin%count ), stat=status )
188 call assert( status==0, "Problem allocating memory.", __file__, __line__ )
189
190 ! if there are no missing values in the column of data, process the days/dates
191 if ( sl_irrigation_begin%count_matching("<NA>") == 0 ) then
192
193 do index = 1, sl_irrigation_begin%count
194 str_buffer = sl_irrigation_begin%get( index )
195 if ( scan(str_buffer, "/-") /= 0 ) then
196 first_day_of_irrigation( index ) = mmdd2doy( str_buffer, "FIRST_DAY_OF_IRRIGATION" )
197 else
198 first_day_of_irrigation( index ) = asint( str_buffer )
199 endif
200 enddo
201
202 !> check: number of irrigation_start values == number of landuse codes?
203 num_records = ubound(first_day_of_irrigation,1)
204 are_lengths_unequal = ( num_records /= number_of_landuse_codes )
205
206 if ( are_lengths_unequal ) &
207 call warn( smessage="The number of values specifying first day of irrigation (" &
208 //ascharacter( num_records )//") does not match the number of landuse values (" &
209 //ascharacter( number_of_landuse_codes )//").", &
210 smodule=__file__, iline=__line__, lfatal=.true._c_bool )
211
212 else
213
214 ! assign a dummy value and kill the run
216 call warn("No value was found to define the first day of irrigation " &
217 //"('first_day_of_irrigation' or 'irrigation_start').", &
218 shints="Make sure there is a lookup table with the column name " &
219 //"'first_day_of_irrigation' or 'irrigation_start'.", lfatal=true )
220 endif
221
222 !> process last day of irrigation. retrieved as a list of strings;
223 !! must convert the strings from mm/dd to DOY
224 allocate( last_day_of_irrigation( sl_irrigation_end%count ), stat=status )
225 call assert( status==0, "Problem allocating memory.", __file__, __line__ )
226
227 if ( sl_irrigation_end%count_matching("<NA>") == 0 ) then
228
229 do index = 1, sl_irrigation_end%count
230 str_buffer = sl_irrigation_end%get( index )
231 if ( scan(str_buffer, "/-") /= 0 ) then
232 last_day_of_irrigation( index ) = mmdd2doy( str_buffer, "LAST_DAY_OF_IRRIGATION" )
233 else
234 last_day_of_irrigation( index ) = asint( str_buffer )
235 endif
236 enddo
237
238 !> check: number of irrigation_end values == number of landuse codes?
239 num_records = ubound(last_day_of_irrigation,1)
240 are_lengths_unequal = ( num_records /= number_of_landuse_codes )
241
242 if ( are_lengths_unequal ) &
243 call warn( smessage="The number of values specifying last day of irrigation (" &
244 //ascharacter( num_records )//") does not match the number of landuse values (" &
245 //ascharacter( number_of_landuse_codes )//").", &
246 smodule=__file__, iline=__line__, lfatal=.true._c_bool )
247
248 else
249
251 call warn("No value was found to define the last day of irrigation " &
252 //"('last_day_of_irrigation' or 'irrigation_end').", &
253 shints="Make sure there is a lookup table with the column name " &
254 //"'last_day_of_irrigation' or 'irrigation_end'.", lfatal=true )
255 endif
256
257 !> process number of days of irrigation. retrieved as a list of strings
258 allocate( num_days_of_irrigation( sl_irrigation_days%count ), stat=status )
259 call assert( status==0, "Problem allocating memory.", __file__, __line__ )
260
261 num_days_of_irrigation = sl_irrigation_days%get_integer()
262
263 if ( sl_irrigation_days%count_matching("<NA>") == 0 ) then
264
265 !> check: number of 'Irrigation_length' values == number of landuse codes?
266 num_records = ubound(num_days_of_irrigation,1)
267 are_lengths_unequal = ( num_records /= number_of_landuse_codes )
268
269 if ( are_lengths_unequal ) &
270 call warn( smessage="The number of values specifying 'irrigation_length' (" &
271 //ascharacter( num_records )//") does not match the number of landuse values (" &
272 //ascharacter( number_of_landuse_codes )//").", &
273 smodule=__file__, iline=__line__, lfatal=.true._c_bool )
274
275 else
276
278
279 call warn("No value was found to define the maximum number of days of irrigation ('irrigation_length').", &
280 shints="Make sure there is a lookup table with the column name " &
281 //"'irrigation_length'.", lfatal=true )
282
283 endif
284
285 !> retrieve application option (i.e. to field capacity, to defined deficit amount, as constant amount)
286 call sl_temp_list%clear()
287 call sl_temp_list%append("Irrigation_application_method")
288 call sl_temp_list%append("Irrigation_application_scheme")
289 call sl_temp_list%append("Irrigation_application_option")
290 call sl_temp_list%append("Application_method")
291 call sl_temp_list%append("Application_scheme")
292 call sl_temp_list%append("Application_option")
293
294 call params%get_parameters( slkeys=sl_temp_list, slvalues=sl_application_method, lfatal=true )
295 call sl_temp_list%clear()
296
297 allocate( application_method_code( sl_application_method%count ), stat=status )
298 call assert( status==0, "Problem allocating memory.", __file__, __line__ )
299
300 !> retrieve application amount. not used if "field capacity" option is active.
301 !! value represents deficit fraction or constant amount depending on application option active.
302 call sl_temp_list%clear()
303 call sl_temp_list%append("Application_amount")
304 call sl_temp_list%append("Irrigation_amount")
305
306 call params%get_parameters( slkeys=sl_temp_list, fvalues=application_amount, lfatal=true )
307 call sl_temp_list%clear()
308
309 !> basic checks to see whether the number of parameters equals the number of lu codes
310 num_records = ubound(first_day_of_irrigation,1)
311 are_lengths_unequal = ( num_records /= number_of_landuse_codes )
312
313 if ( are_lengths_unequal ) &
314 call warn( smessage="The number of values specifying date of first " &
315 //"irrigation application (" &
316 //ascharacter( num_records )//") does not match the number of landuse values (" &
317 //ascharacter( number_of_landuse_codes )//").", &
318 smodule=__file__, iline=__line__, lfatal=.true._c_bool )
319
320 num_records = ubound(last_day_of_irrigation,1)
321 are_lengths_unequal = ( num_records /= number_of_landuse_codes )
322
323 if ( are_lengths_unequal ) &
324 call warn( smessage="The number of values specifying date of last irrigation" &
325 //" application (" &
326 //ascharacter( num_records )//") does not match the number of landuse values (" &
327 //ascharacter( number_of_landuse_codes )//").", &
328 smodule=__file__, iline=__line__, lfatal=.true._c_bool )
329
330 num_records = ubound(fraction_of_irrigation_from_gw,1)
331 are_lengths_unequal = ( num_records /= number_of_landuse_codes )
332
333 if ( are_lengths_unequal ) &
334 call warn( smessage="The number of values specifying the fraction of irrigation" &
335 //" from groundwater (" &
336 //ascharacter( num_records )//") does not match the number of landuse values (" &
337 //ascharacter( number_of_landuse_codes )//").", &
338 smodule=__file__, iline=__line__, lfatal=.true._c_bool )
339
340 num_records = ubound(maximum_allowable_depletion_fraction,1)
341 are_lengths_unequal = ( num_records /= number_of_landuse_codes )
342
343 if ( are_lengths_unequal ) &
344 call warn( smessage="The number of values for the maximum allowable depletion " &
345 //" fraction (" &
346 //ascharacter( num_records )//") does not match the number of landuse values (" &
347 //ascharacter( number_of_landuse_codes )//").", &
348 smodule=__file__, iline=__line__, lfatal=.true._c_bool )
349
350
351 num_records = sl_monthly_irrigation_schedule%count
352 are_lengths_unequal = ( num_records /= number_of_landuse_codes )
353
354 allocate( monthly_irrigation_schedule( number_of_landuse_codes, 31 ), stat=status )
355 call assert( status==0, "Problem allocating memory")
356
357 if ( are_lengths_unequal ) then
358 call warn( smessage="The number of values defining monthly irrigation application" &
359 //" timing ("//ascharacter( num_records )//")~does not match the number of" &
360 //" landuse codes ("//ascharacter( number_of_landuse_codes )//"). ~Assuming" &
361 //" that irrigation is applied *every* day [default].", &
362 smodule=__file__, iline=__line__, lecho=.true._c_bool, iloglevel=log_all )
363
365
366 else
367
369
370 do index=1, number_of_landuse_codes
371 temp_str = sl_monthly_irrigation_schedule%get( index )
372 if ( is_numeric( temp_str ) ) then
373 do i=1, ubound(monthly_irrigation_schedule, 2)
374 monthly_irrigation_schedule( index, i ) = asint( temp_str(i:i) )
375 enddo
376 endif
377 enddo
378 endif
379
380 num_records = ubound(application_method_code,1)
381 are_lengths_unequal = ( num_records /= number_of_landuse_codes )
382
383 if ( are_lengths_unequal ) &
384 call warn( smessage="The number of values for the irrigation application option (" &
385 //ascharacter( num_records )//") does not match the number of landuse values (" &
386 //ascharacter( number_of_landuse_codes )//").", &
387 smodule=__file__, iline=__line__, lfatal=.true._c_bool )
388
389
390 num_records = ubound(application_amount,1)
391 are_lengths_unequal = ( num_records /= number_of_landuse_codes )
392
393 if ( are_lengths_unequal ) &
394 call warn( smessage="The number of values for the irrigation application amount (" &
395 //ascharacter( num_records )//") does not match the number of landuse values (" &
396 //ascharacter( number_of_landuse_codes )//").", &
397 smodule=__file__, iline=__line__, lfatal=.true._c_bool )
398
399 ! locate the data structure associated with the gridded irrigation mask entries
400 ! pIRRIGATION_MASK => DAT%find("IRRIGATION_MASK")
401 ! if ( associated(pIRRIGATION_MASK) ) call pIRRIGATION_MASK%getvalues( )
402
403 ! if ( associated(pIRRIGATION_MASK) ) then
404
405 ! irrigation_mask = pack( real(pIRRIGATION_MASK%pGrdBase%iData, c_float), is_active )
406
407 ! else
408
409 ! irrigation_mask = 1.0_c_float
410
411 ! endif
412
413 call logs%write(" ## Initializing irrigation application rules and application schedules ##", ilinesbefore=1, &
414 ilinesafter=1, iloglevel=log_all )
415
416 do index = 1, sl_application_method%count
417
418 str_buffer = sl_application_method%get( index )
419
420 if ( str_buffer .contains. "capacity") then
422 elseif ( str_buffer .contains. "deficit") then
424 elseif ( str_buffer .contains. "constant") then
426 elseif ( str_buffer .contains. "demand") then
428 else
430 endif
431
432
433 call logs%write(" landuse "//ascharacter( landuse_table_codes( index ) )//": " &
434 //trim(app_option_name( application_method_code( index ) ) ), iloglevel=log_all )
435
436 enddo
437
438 irrigation_from_groundwater(:) = 0.0_c_float
439 irrigation_from_surface_water(:) = 0.0_c_float
440
441 end subroutine irrigation__initialize
442
443!--------------------------------------------------------------------------------------------------
444
445 function irrigation__output_schedule_values( landuse_index ) result( values )
446
447 integer (c_int), intent(in) :: landuse_index
448 integer (c_int) :: values(31)
449
450 values = monthly_irrigation_schedule( landuse_index, : )
451
453
454!--------------------------------------------------------------------------------------------------
455
456 impure elemental subroutine irrigation__calculate( irrigation_amount, &
457 landuse_index, &
458 soil_storage, &
459 soil_storage_max, &
460 total_available_water, &
461 rainfall, &
462 runoff, &
463 crop_etc, &
464 irrigation_mask, &
465 num_days_since_planting, &
466 monthly_rainfall, &
467 monthly_runoff &
468 )
469
470 real (c_float), intent(inout) :: irrigation_amount
471 integer (c_int), intent(in) :: landuse_index
472 real (c_double), intent(in) :: soil_storage
473 real (c_float), intent(in) :: soil_storage_max
474 real (c_double), intent(in) :: total_available_water
475 real (c_float), intent(in) :: rainfall
476 real (c_float), intent(in) :: runoff
477 real (c_float), intent(in) :: crop_etc
478 real (c_float), intent(in) :: irrigation_mask
479 integer (c_int), intent(in) :: num_days_since_planting
480 real (c_float), intent(in), optional :: monthly_rainfall
481 real (c_float), intent(in), optional :: monthly_runoff
482
483 ! [ LOCALS ]
484 real (c_float) :: depletion_fraction
485
486 integer (c_int) :: month
487 integer (c_int) :: day
488 integer (c_int) :: year
489 integer (c_int) :: julian_day
490 integer (c_int) :: day_of_year
491 integer (c_int) :: days_in_month
492 integer (c_int) :: num_days_from_origin
493 integer (c_int) :: index
494 character (len=31) :: irrigation_day
495 integer (c_int) :: irrigation_days_per_month
496 real (c_float) :: efficiency
497 real (c_float) :: interim_irrigation_amount
498 integer (c_int) :: option
499
500 ! zero out Irrigation term
501! IRRIGATION_FROM_GROUNDWATER = rZERO
502! IRRIGATION_FROM_SURFACE_WATER = rZERO
503
504 associate( dt => sim_dt%curr )
505
506 julian_day = dt%getJulianDay()
507 month = asint( dt%iMonth )
508 day = asint( dt%iDay )
509 year = dt%iYear
510 days_in_month = sim_dt%iDaysInMonth
511 day_of_year = sim_dt%iDOY
512 num_days_from_origin = sim_dt%iNumDaysFromOrigin
513
514 end associate
515
516! call pIRRIGATION_MASK%getvalues( month, day, year, julian_day )
517! iIrrigation_Mask = pack( pIRRIGATION_MASK%pGrdBase%iData, is_active )
518
519 ! for each cell, add water if soil storage zone is below the
520 ! maximum allowable depletion
521
522 ! now we run the gauntlet of tests to ensure that we really need
523 ! to perform all of the irrigation calculations
524
525 do
526
527 irrigation_amount = 0.0_c_float
528 interim_irrigation_amount = 0.0_c_float
529 depletion_fraction = 0.0_c_float
530
531 if ( ( day_of_year < first_day_of_irrigation( landuse_index ) ) &
532 .or. ( day_of_year > last_day_of_irrigation( landuse_index ) ) ) exit
533
534! if ( MAXIMUM_ALLOWABLE_DEPLETION_FRACTION( landuse_index ) > 0.99 ) exit
535 if ( soil_storage_max <= 0.0_c_float ) exit
536 if ( irrigation_mask < 1.0e-6_c_float ) exit
537 if ( num_days_since_planting > num_days_of_irrigation( landuse_index ) ) exit
538
539 ! total_available_water is calculated only by the fao56_two_stage module, but
540 ! not by any other modules; need to just calculate depletion fraction based on
541 ! total soil moisture storage capacity in this case
542 if ( total_available_water > 0.0_c_float ) then
543 depletion_fraction = min( ( soil_storage_max - soil_storage ) / total_available_water, 1.0_c_float )
544 else
545 depletion_fraction = min( ( soil_storage_max - soil_storage ) / soil_storage_max, 1.0_c_float )
546 endif
547
548 option = application_method_code( landuse_index )
549
550 select case ( option )
551
552 case ( app_field_capacity )
553
554 if ( depletion_fraction >= maximum_allowable_depletion_fraction( landuse_index ) ) &
555 interim_irrigation_amount = max( 0.0_c_float, soil_storage_max - soil_storage )
556
557 case ( app_defined_deficit )
558
559 ! @TODO check this calculation
560
561 if ( depletion_fraction >= maximum_allowable_depletion_fraction( landuse_index ) ) &
562 interim_irrigation_amount = max( 0.0_c_float, application_amount( landuse_index ) &
563 * soil_storage_max - soil_storage )
564
565 case ( app_constant_amount )
566
567 if ( depletion_fraction >= maximum_allowable_depletion_fraction( landuse_index ) ) &
568 interim_irrigation_amount = application_amount( landuse_index )
569
570 case ( app_hwb_demand_based )
571
572 if ( monthly_irrigation_schedule( landuse_index, day ) == 0 ) exit
573
574 if (present( monthly_runoff ) .and. present( monthly_rainfall ) ) then
575
576 irrigation_days_per_month = count( monthly_irrigation_schedule( landuse_index, 1:days_in_month ) == 1 )
577
578 if ( irrigation_days_per_month <= 0 ) then
579 interim_irrigation_amount = 0.0_c_float
580 else
581 interim_irrigation_amount = max( 0.0_c_float, &
582 ( crop_etc * real( days_in_month, c_float) + monthly_runoff - monthly_rainfall ) ) &
583 / real( irrigation_days_per_month, c_float )
584 endif
585
586 else
587
588 interim_irrigation_amount = max( 0.0_c_float, crop_etc + runoff - rainfall )
589
590 endif
591
592 case default
593
594 interim_irrigation_amount = 0.0_c_float
595
596 end select
597
598 efficiency = max( irrigation_efficiency( landuse_index ), 0.20_c_float )
599
600 irrigation_amount = interim_irrigation_amount &
601 * irrigation_mask &
602 / efficiency
603
604 exit
605
606 enddo
607
608 end subroutine irrigation__calculate
609
610end module irrigation
This module contains physical constants and convenience functions aimed at performing unit conversion...
logical(c_bool), parameter, public true
logical(c_bool), parameter, public false
impure elemental logical(c_bool) function, public is_numeric(value)
Determine if string contains numeric values.
Defines the DATA_CATALOG_T data type, which contains type-bound procedures to add,...
type(data_catalog_t), public dat
DAT is a global to hold data catalog entries.
This module contains the DATETIME_T class and associated time and date-related routines,...
Definition datetime.F90:9
integer(c_int) function, public day_of_year(ijd)
integer(c_int) function, public mmdd2doy(smmdd, sinputitemname)
integer(c_int) function, public julian_day(iyear, imonth, iday, iorigin, sinputitemname)
Definition datetime.F90:642
subroutine, public warn(smessage, smodule, iline, shints, lfatal, iloglevel, lecho)
subroutine, public die(smessage, smodule, iline, shints, scalledby, icalledbyline)
Provides support for assessing the effect of irrigation on recharge values by estimating the irrigati...
Definition irrigation.F90:8
type(data_catalog_entry_t), pointer pirrigation_mask
character(len=35), dimension(0:4), parameter app_option_name
real(c_float), dimension(:), allocatable irrigation_from_surface_water
impure elemental subroutine, public irrigation__calculate(irrigation_amount, landuse_index, soil_storage, soil_storage_max, total_available_water, rainfall, runoff, crop_etc, irrigation_mask, num_days_since_planting, monthly_rainfall, monthly_runoff)
@ app_hwb_demand_based
@ app_defined_deficit
@ app_constant_amount
integer(c_int), dimension(:), allocatable num_days_of_irrigation
real(c_float), dimension(:), allocatable maximum_allowable_depletion_fraction
integer(c_short), dimension(:,:), allocatable monthly_irrigation_schedule
real(c_float), dimension(:), allocatable irrigation_from_groundwater
real(c_float), dimension(:), allocatable fraction_of_irrigation_from_gw
integer(c_int) function, dimension(31), public irrigation__output_schedule_values(landuse_index)
integer(c_int), dimension(:), allocatable first_day_of_irrigation
real(c_float), dimension(:), allocatable irrigation_efficiency
integer(c_int), dimension(:), allocatable last_day_of_irrigation
real(c_float), dimension(:), allocatable application_amount
integer(c_int), dimension(:), allocatable application_method_code
subroutine, public irrigation__initialize(is_active)
Estimate the irrigation water required to sustain plant growth.
type(logfile_t), public logs
Definition logfiles.F90:62
type(parameters_t), public params
type(date_range_t), public sim_dt