Skip to content

Commit

Permalink
Corrected scaling for potential temperature perturbations
Browse files Browse the repository at this point in the history
  • Loading branch information
franslql authored and fjansson committed Dec 7, 2023
1 parent c61aa1e commit f051312
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/modsynturb.f90
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ module modsynturb
real, allocatable, dimension(:,:) :: kn,p,q,vturb,wturb,k_thl,k_qt
real, allocatable, dimension(:) :: omega,omega_thl,omega_qt,p_thl,p_qt,q_thl,q_qt
real, allocatable, dimension(:) :: xf,xh,yf,yh
real :: nisqrt,ctot,nisqrt2
real :: nisqrt,ctot
real, dimension(3) :: lambdasxyz
integer :: nxturb,nyturb,nzturb
integer, parameter :: isepsim_mom = 10,isepsim_all=11, isynturb_mom = 0, isynturb_all = 1
Expand Down Expand Up @@ -66,7 +66,6 @@ subroutine initsynturb
if(iturb == isynturb_all .or. iturb == isynturb_mom) then
! Constants
nisqrt = sqrt(2./nmodes)
nisqrt2 = sqrt(1./nmodes)
ctot = lambda/tau
noise = new_RandomNumberSequence(seed = 100)
nxturb = int(dx/dxturb*real(itot));
Expand Down Expand Up @@ -534,8 +533,8 @@ subroutine calc_pert2(ib,x,y,z,nx,ny,nz,uturb,iuturb,thlturb,qtturb)
! Reproject to cartesian velocity pertubations
uturb(pi1,pi2) = nisqrt*dot(eigvec(iuturb,:),(/utemp,vtemp,wtemp/))
! Calculate thlturb and qtturb
thltemp = thltemp * nisqrt2
qttemp = qttemp * nisqrt2
thltemp = thltemp * nisqrt
qttemp = qttemp * nisqrt
wturbf = nisqrt*dot(eigvec(3,:),(/utemp,vtemp,wtemp/))
wthl = fp*boundary(ib)%wthl(pi1patch,pi2patch,itp) + fm*boundary(ib)%wthl(pi1patch,pi2patch,itm)
wqt = fp*boundary(ib)%wqt(pi1patch,pi2patch,itp) + fm*boundary(ib)%wqt(pi1patch,pi2patch,itm)
Expand Down

0 comments on commit f051312

Please sign in to comment.