conditional_module.f90 Source File


Files dependent on this one

sourcefile~~conditional_module.f90~~AfferentGraph sourcefile~conditional_module.f90 conditional_module.f90 sourcefile~actions.f90 actions.f90 sourcefile~actions.f90->sourcefile~conditional_module.f90 sourcefile~cal_allo_init.f90 cal_allo_init.f90 sourcefile~cal_allo_init.f90->sourcefile~conditional_module.f90 sourcefile~cal_cond_read.f90 cal_cond_read.f90 sourcefile~cal_cond_read.f90->sourcefile~conditional_module.f90 sourcefile~cal_conditions.f90 cal_conditions.f90 sourcefile~cal_conditions.f90->sourcefile~conditional_module.f90 sourcefile~cal_parm_select.f90 cal_parm_select.f90 sourcefile~cal_parm_select.f90->sourcefile~conditional_module.f90 sourcefile~calsoft_chsed.f90 calsoft_chsed.f90 sourcefile~calsoft_chsed.f90->sourcefile~conditional_module.f90 sourcefile~calsoft_hyd.f90 calsoft_hyd.f90 sourcefile~calsoft_hyd.f90->sourcefile~conditional_module.f90 sourcefile~calsoft_hyd_bfr.f90 calsoft_hyd_bfr.f90 sourcefile~calsoft_hyd_bfr.f90->sourcefile~conditional_module.f90 sourcefile~calsoft_hyd_bfr_et.f90 calsoft_hyd_bfr_et.f90 sourcefile~calsoft_hyd_bfr_et.f90->sourcefile~conditional_module.f90 sourcefile~calsoft_hyd_bfr_latq.f90 calsoft_hyd_bfr_latq.f90 sourcefile~calsoft_hyd_bfr_latq.f90->sourcefile~conditional_module.f90 sourcefile~calsoft_hyd_bfr_perc.f90 calsoft_hyd_bfr_perc.f90 sourcefile~calsoft_hyd_bfr_perc.f90->sourcefile~conditional_module.f90 sourcefile~calsoft_hyd_bfr_surq.f90 calsoft_hyd_bfr_surq.f90 sourcefile~calsoft_hyd_bfr_surq.f90->sourcefile~conditional_module.f90 sourcefile~calsoft_plant.f90 calsoft_plant.f90 sourcefile~calsoft_plant.f90->sourcefile~conditional_module.f90 sourcefile~calsoft_read_codes.f90 calsoft_read_codes.f90 sourcefile~calsoft_read_codes.f90->sourcefile~conditional_module.f90 sourcefile~calsoft_sed.f90 calsoft_sed.f90 sourcefile~calsoft_sed.f90->sourcefile~conditional_module.f90 sourcefile~caltsoft_hyd.f90 caltsoft_hyd.f90 sourcefile~caltsoft_hyd.f90->sourcefile~conditional_module.f90 sourcefile~ch_rtmusk.f90 ch_rtmusk.f90 sourcefile~ch_rtmusk.f90->sourcefile~conditional_module.f90 sourcefile~cond_integer.f90 cond_integer.f90 sourcefile~cond_integer.f90->sourcefile~conditional_module.f90 sourcefile~cond_real.f90 cond_real.f90 sourcefile~cond_real.f90->sourcefile~conditional_module.f90 sourcefile~conditions.f90 conditions.f90 sourcefile~conditions.f90->sourcefile~conditional_module.f90 sourcefile~dtbl_flocon_read.f90 dtbl_flocon_read.f90 sourcefile~dtbl_flocon_read.f90->sourcefile~conditional_module.f90 sourcefile~dtbl_lum_read.f90 dtbl_lum_read.f90 sourcefile~dtbl_lum_read.f90->sourcefile~conditional_module.f90 sourcefile~dtbl_res_read.f90 dtbl_res_read.f90 sourcefile~dtbl_res_read.f90->sourcefile~conditional_module.f90 sourcefile~dtbl_scen_read.f90 dtbl_scen_read.f90 sourcefile~dtbl_scen_read.f90->sourcefile~conditional_module.f90 sourcefile~gcycl.f90 gcycl.f90 sourcefile~gcycl.f90->sourcefile~conditional_module.f90 sourcefile~hru_control.f90 hru_control.f90 sourcefile~hru_control.f90->sourcefile~conditional_module.f90 sourcefile~hru_dtbl_actions_init.f90 hru_dtbl_actions_init.f90 sourcefile~hru_dtbl_actions_init.f90->sourcefile~conditional_module.f90 sourcefile~hru_lte_read.f90 hru_lte_read.f90 sourcefile~hru_lte_read.f90->sourcefile~conditional_module.f90 sourcefile~mallo_control.f90 mallo_control.f90 sourcefile~mallo_control.f90->sourcefile~conditional_module.f90 sourcefile~manure_allocation_read.f90 manure_allocation_read.f90 sourcefile~manure_allocation_read.f90->sourcefile~conditional_module.f90 sourcefile~pathogen_init.f90 pathogen_init.f90 sourcefile~pathogen_init.f90->sourcefile~conditional_module.f90 sourcefile~plant_init.f90 plant_init.f90 sourcefile~plant_init.f90->sourcefile~conditional_module.f90 sourcefile~proc_cond.f90 proc_cond.f90 sourcefile~proc_cond.f90->sourcefile~conditional_module.f90 sourcefile~res_control.f90 res_control.f90 sourcefile~res_control.f90->sourcefile~conditional_module.f90 sourcefile~res_hydro.f90 res_hydro.f90 sourcefile~res_hydro.f90->sourcefile~conditional_module.f90 sourcefile~res_read.f90 res_read.f90 sourcefile~res_read.f90->sourcefile~conditional_module.f90 sourcefile~res_sediment.f90 res_sediment.f90 sourcefile~res_sediment.f90->sourcefile~conditional_module.f90 sourcefile~res_weir_release.f90 res_weir_release.f90 sourcefile~res_weir_release.f90->sourcefile~conditional_module.f90 sourcefile~sd_channel_control2.f90 sd_channel_control2.f90 sourcefile~sd_channel_control2.f90->sourcefile~conditional_module.f90 sourcefile~sd_channel_control3.f90 sd_channel_control3.f90 sourcefile~sd_channel_control3.f90->sourcefile~conditional_module.f90 sourcefile~wallo_demand.f90 wallo_demand.f90 sourcefile~wallo_demand.f90->sourcefile~conditional_module.f90 sourcefile~water_allocation_read.f90 water_allocation_read.f90 sourcefile~water_allocation_read.f90->sourcefile~conditional_module.f90 sourcefile~wet_read.f90 wet_read.f90 sourcefile~wet_read.f90->sourcefile~conditional_module.f90 sourcefile~wetland_control.f90 wetland_control.f90 sourcefile~wetland_control.f90->sourcefile~conditional_module.f90

Source Code

      module conditional_module
    
      implicit none
    
      !integer :: rndseed_cond = 748932582   ! random number seed for dtbl conditional

      type conditions_var
        character(len=25) :: var = ""       ! condition variable (ie volume, flow, sw, time, etc)
        character(len=25) :: ob = ""        ! object variable (ie res, hru, canal, etc)
        integer :: ob_num = 0               ! object number
        character(len=25) :: lim_var = ""   ! limit variable (ie evol, pvol, fc, ul, etc)
        character(len=25) :: lim_op = ""    ! limit operator (*,+,-)
        real :: lim_const = 0.              ! limit constant
      end type conditions_var
              
      type actions_var
        character(len=25) :: typ = ""       ! type of action (ie reservoir release, irrigate, fertilize, etc)
        character(len=25) :: ob = ""        ! object variable (ie res, hru, canal, etc)
        integer :: ob_num = 0               ! object number
        character(len=25) :: name = ""      ! name of action
        character(len=25) :: option = ""    ! action option - specific to type of action (ie for reservoir, option to
                                            ! input rate, days of drawdown, weir equation pointer, etc
        real :: const = 0.                  ! constant used for rate, days, etc
        real :: const2 = 1                  ! additional constant used for rate, days, etc
        character(len=25) :: file_pointer = ""! pointer for option (ie weir equation pointer)
      end type actions_var
       
      type decision_table
        character (len=25) :: name = ""                                 ! name of the decision table
        integer :: conds = 0                                            ! number of conditions
        integer :: alts = 0                                             ! number of alternatives
        integer :: acts = 0                                             ! number of actions
        type (conditions_var), dimension(:), allocatable :: cond        ! conditions
        character(len=25), dimension(:,:), allocatable :: alt           ! condition alternatives
        type (actions_var), dimension(:), allocatable :: act            ! actions
        character(len=1), dimension(:,:), allocatable :: act_outcomes   ! action outcomes ("y" to perform action; "n" to not perform)
        character(len=1), dimension(:), allocatable :: act_hit          ! "y" if all condition alternatives (rules) are met; "n" if not
        integer, dimension(:), allocatable :: act_typ                   ! pointer to action type (ie plant, fert type, tillage implement, release type, etc)
        integer, dimension(:), allocatable :: act_app                   ! pointer to operation or application type (ie harvest.ops, chem_app.ops, wier shape, etc)
        integer, dimension(:), allocatable :: con_act                   ! pointer for days since last action condition to point to appropriate action
        integer :: hru_lu = 0                                           ! number of hru's in the land_use condition(s) - used for probabilistic mgt operations or lu change
        real :: ha_lu = 0.                                              ! area of land_use in ha
        integer :: hru_lu_cur = 0                                       ! number of hru's in the land_use condition(s) that have currently been applied
        real :: hru_ha_cur = 0.                                         ! area of land_use in ha that has currently been applied
        integer :: days_prob = 0                                        ! days since start of application window
        integer :: day_prev = 0                                         ! to check if same day - don't increment day in application window
        real :: prob_cum  = 0.                                          ! cumulative probability of application on current day of window
        real :: frac_app  = 0.                                          ! fraction of time (during each window) the application occurs
      end type decision_table
      type (decision_table), dimension(:), allocatable, target :: dtbl_lum
      type (decision_table), dimension(:), allocatable, target :: dtbl_res
      type (decision_table), dimension(:), allocatable, target :: dtbl_scen
      type (decision_table), dimension(:), allocatable, target :: dtbl_flo
      type (decision_table), pointer :: d_tbl
      
      end module conditional_module