dot Subroutine

private pure subroutine dot(a, anew, adot, fac)

Get a theta-centered and time-centered estimate of the time derivative of a field.

tunits(ky) == 1. unless the "omega_" units are chosen. omega_ units normalize time by an additional factor of ky.

Arguments

Type IntentOptional Attributes Name
complex, intent(in), dimension (-ntgrid:,:,:) :: a
complex, intent(in), dimension (-ntgrid:,:,:) :: anew
complex, intent(out), dimension (-ntgrid:,:,:) :: adot
real, intent(in) :: fac

Contents

Source Code

dot

Source Code

  pure subroutine dot (a, anew, adot, fac)
    use gs2_time, only: code_dt, tunits
    use kt_grids, only: naky, ntheta0
    use theta_grid, only: ntgrid

    implicit none
    complex, intent (in), dimension (-ntgrid:,:,:) :: a, anew
    complex, intent (out), dimension (-ntgrid:,:,:) :: adot
    real, intent (in) :: fac
    real :: dtinv
    integer :: ig, it, ik

    do ik=1,naky
       dtinv = 1./(code_dt*tunits(ik))
       do it=1,ntheta0
          do ig=-ntgrid,ntgrid-1
             adot(ig,it,ik) = 0.5*fac*(anew(ig+1,it,ik)+anew(ig,it,ik) - &
                  (a(ig+1,it,ik)+a(ig,it,ik)))*dtinv
          end do
       end do
    end do

  end subroutine dot