timedepsw Subroutine

private subroutine timedepsw()

Uses

  • proc~~timedepsw~~UsesGraph proc~timedepsw timedepsw module~initfac initfac proc~timedepsw->module~initfac module~modglobal modglobal proc~timedepsw->module~modglobal module~modmpi modmpi proc~timedepsw->module~modmpi module~initfac->module~modglobal module~initfac->module~modmpi mpi mpi module~initfac->mpi netcdf netcdf module~initfac->netcdf module~modmpi->mpi

Arguments

None

Called by

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

Source Code

  subroutine timedepsw
    use modglobal, only : timee, nfcts, rk3step, tnextEB
    use initfac, only : netsw
    use modmpi, only : myid

    implicit none
    integer t,n
    real fac

    if(.not.(ltimedepsw .and. myid==0)) return

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

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

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

    if (t .ne. ntimedepsw) then
      fac = (timee - timesw(t)) / (timesw(t+1) - timesw(t))
      do n=1,nfcts
         netsw(n) = netswt(n,t) + fac * (netswt(n,t+1) - netswt(n,t))
      end do
    end if

    end if

  end subroutine timedepsw