timedeplw Subroutine

private subroutine timedeplw()

Uses

  • proc~~timedeplw~~UsesGraph proc~timedeplw timedeplw module~modglobal modglobal proc~timedeplw->module~modglobal module~modmpi modmpi proc~timedeplw->module~modmpi mpi mpi module~modmpi->mpi

Arguments

None

Called by

proc~~timedeplw~~CalledByGraph proc~timedeplw timedeplw proc~timedep timedep proc~timedep->proc~timedeplw proc~inittimedep inittimedep proc~inittimedep->proc~timedep program~dalesurban DALESURBAN program~dalesurban->proc~timedep program~dalesurban->proc~inittimedep

Source Code

  subroutine timedeplw
    use modglobal,    only : timee, skyLW, rk3step, tnextEB
    use modmpi,       only : myid

    implicit none
    integer t,k
    real fac

    if(.not.(ltimedeplw)) return

    if ((rk3step .eq. 3) .and. (timee .ge. tnextEB)) then

    ! if (myid == 0) then
    !  write(*,*) "EB coming up so changing longwave forcing"
    ! end if

    !---- interpolate ----
    do t=ntimedeplw,1,-1
      if (timee .ge. timelw(t)) then
        exit
      endif
    end do

    if (t .ne. ntimedeplw) then
      fac = (timee - timelw(t)) / (timelw(t+1) - timelw(t))
      skyLW = skyLWt(t) + fac * (skyLWt(t+1) - skyLWt(t))
    end if

    end if

  end subroutine timedeplw