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