cli_lapse.f90 Source File


This file depends on

sourcefile~~cli_lapse.f90~~EfferentGraph sourcefile~cli_lapse.f90 cli_lapse.f90 sourcefile~basin_module.f90 basin_module.f90 sourcefile~cli_lapse.f90->sourcefile~basin_module.f90 sourcefile~climate_module.f90 climate_module.f90 sourcefile~cli_lapse.f90->sourcefile~climate_module.f90 sourcefile~hydrograph_module.f90 hydrograph_module.f90 sourcefile~cli_lapse.f90->sourcefile~hydrograph_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

Source Code

      subroutine cli_lapse
      
!!    ~ ~ ~ PURPOSE ~ ~ ~
!!    this subroutine adjusts precip and temperature for elevation

      use basin_module
      use climate_module
      use hydrograph_module, only : ob, sp_ob
      
      implicit none

      integer :: iob = 0    !       |object number
      integer :: iwst = 0   !       |weather station number
      integer :: iwgn = 0   !       |weather generator station number
      integer :: igage = 0  !       |number of measured precip or temperature gage
      
      !! set precip and temp lapse for each object
      do iob = 1, sp_ob%objs
        iwst = ob(iob)%wst
        !! adjust precip and temperature for elevation using lapse rates
        if (wst(iwst)%wco_c%pgage == "sim") then
          iwgn = wst(iwst)%wco%wgn
          ob(iob)%plaps = bsn_prm%plaps * (ob(iob)%elev - wgn(iwgn)%elev) / 1000.
        else
          igage = wst(iwst)%wco%pgage
          ob(iob)%plaps = bsn_prm%plaps * (ob(iob)%elev - pcp(igage)%elev) / 1000.
        end if
        if (wst(iwst)%wco_c%tgage == "sim") then
          iwgn = wst(iwst)%wco%wgn
          ob(iob)%tlaps = bsn_prm%tlaps * (wgn(iwgn)%elev - ob(iob)%elev) / 1000.
        else
          igage = wst(iwst)%wco%tgage
          ob(iob)%tlaps = bsn_prm%tlaps * (tmp(igage)%elev - ob(iob)%elev) / 1000.
        end if
      end do
      
      return
      end subroutine cli_lapse