wallo_treatment.f90 Source File


This file depends on

sourcefile~~wallo_treatment.f90~~EfferentGraph sourcefile~wallo_treatment.f90 wallo_treatment.f90 sourcefile~hydrograph_module.f90 hydrograph_module.f90 sourcefile~wallo_treatment.f90->sourcefile~hydrograph_module.f90 sourcefile~water_allocation_module.f90 water_allocation_module.f90 sourcefile~wallo_treatment.f90->sourcefile~water_allocation_module.f90 sourcefile~basin_module.f90 basin_module.f90 sourcefile~hydrograph_module.f90->sourcefile~basin_module.f90 sourcefile~time_module.f90 time_module.f90 sourcefile~hydrograph_module.f90->sourcefile~time_module.f90 sourcefile~water_allocation_module.f90->sourcefile~hydrograph_module.f90

Source Code

      subroutine wallo_treatment (iwallo, idmd)
      
      use water_allocation_module
      use hydrograph_module
      
      implicit none 

      integer, intent (in):: iwallo         !water allocation object number
      integer, intent (in) :: idmd          !water demand object number
      integer :: itrt = 0           !none       |treatment database number
      integer :: irec = 0           !none       |recall database number
      
      !! treatment option for treating water
      if (wallo(iwallo)%dmd(idmd)%treat_typ == "treat") then
        itrt = wallo(iwallo)%dmd(idmd)%trt_num
        !! treated outflow is a fraction of withdrawal
        ht5 = trt(itrt)
        ht5%flo = trt(itrt)%flo * wallo(iwallo)%dmd(idmd)%hd%flo
        !! convert concentration to mass
        call hyd_convert_conc_to_mass (ht5)
        wallo(iwallo)%dmd(idmd)%trt = ht5
      end if
      
      !! recall option for treated water
      if (wallo(iwallo)%dmd(idmd)%treat_typ == "recall") then
        irec = wallo(iwallo)%dmd(idmd)%trt_num
        select case (recall(irec)%typ)
        case (1)    !daily
          wallo(iwallo)%dmd(idmd)%trt = recall(irec)%hd(time%day,time%yrs)
        case (2)    !monthly
          wallo(iwallo)%dmd(idmd)%trt = recall(irec)%hd(time%mo,time%yrs)
        case (3)    !annual
          wallo(iwallo)%dmd(idmd)%trt = recall(irec)%hd(1,time%yrs)
        end select
      end if
      
      return
      end subroutine wallo_treatment