Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
147 commits
Select commit Hold shift + click to select a range
6465387
playing with buoyancy sorting
Mar 19, 2018
c0b82db
testing entrainment
Mar 22, 2018
062159d
playing with buoayncy sorting
Mar 26, 2018
cdce551
testing entrainemnt
Mar 29, 2018
c1e2221
merge with updstream/master that include covariances
Apr 4, 2018
3a8a686
fix dissipation terms in coavarinaces
May 9, 2018
db622aa
fix dissipation terms in coavarinaces
May 9, 2018
120a1b0
add Ellison mixing length
May 11, 2018
a040cab
new miing length
May 19, 2018
e8d8324
random process in entrainment
May 24, 2018
2ce6507
..
Jun 5, 2018
0b486d3
first attempt
yairchn Jul 23, 2018
44c0319
..
yairchn Jul 27, 2018
e5e1af5
..
yairchn Jul 30, 2018
f259b75
..
Jul 30, 2018
d354841
..
Jul 30, 2018
5db9c9d
..
Jul 30, 2018
57cc55e
..
Jul 31, 2018
767b78c
..
Jul 31, 2018
e57b639
..
Jul 31, 2018
bcf52b1
..
Jul 31, 2018
fd9f3e2
..
Jul 31, 2018
d26faa0
..
Jul 31, 2018
4a91986
..
Jul 31, 2018
1a23647
..
Jul 31, 2018
2859920
..
Jul 31, 2018
886d607
change a_full to a in decomposed env
yairchn Aug 5, 2018
3e94c35
.
yairchn Aug 6, 2018
5a94a1d
.
yairchn Aug 6, 2018
885ed9f
working
yairchn Aug 6, 2018
1bf821c
..
yairchn Aug 6, 2018
7e9fde6
with reverse integration, still issues
Aug 7, 2018
91529ce
..
Aug 7, 2018
19846f7
fixing reversed entr
Aug 7, 2018
c045a76
working version
Aug 7, 2018
3a266e3
working version
Aug 7, 2018
b82f354
working for Tan2018 with w_bc from momentum equation
yairchn Aug 7, 2018
9aa7aa7
:..:
yairchn Aug 7, 2018
de721cb
working version cleeanup
yairchn Aug 7, 2018
8409a74
working
Aug 8, 2018
f5232ab
cleanup
Aug 8, 2018
383e738
:..:
Aug 8, 2018
aa89109
..
Aug 9, 2018
efc3d7c
converting to unified functions
Aug 10, 2018
5209881
compiling
Aug 11, 2018
2dd8a94
compile with nogil added and checked factor 2 in TKE fuctions
Aug 11, 2018
fe81ae8
running version
Aug 11, 2018
7070e8f
..
Aug 11, 2018
77ab0c1
..
Aug 11, 2018
a12687c
..
Aug 11, 2018
c52dacd
..
Aug 11, 2018
bd9390f
..
Aug 12, 2018
7582e82
fix cov dissipation, bomex simualtions works
Aug 12, 2018
5920fb2
cleanup of prints
Aug 12, 2018
34b10b0
merge with upstream/master
Aug 13, 2018
6d182f4
merge with upstream master
Aug 13, 2018
7bb783e
merge with upstream master
Aug 13, 2018
76e7d11
merge ..
Aug 13, 2018
8fdc8bc
..
Aug 20, 2018
c456da0
..
Aug 20, 2018
864553e
merge with upstream master - GITHUB
Aug 22, 2018
5e09dce
merge with upstream master + anna's changes to cov rain sources
Aug 23, 2018
e6e9164
..
Aug 23, 2018
1ebf0a7
testing teh surface buoyancy calc
Aug 23, 2018
8f205f0
fix double eos calcualtion in ReferenceStates.pyx
yairchn Sep 2, 2018
47bb1a3
..
yairchn Sep 2, 2018
8466d00
set p at the surface to Pg in Ref
yairchn Sep 2, 2018
66100e5
..
yairchn Sep 2, 2018
779616e
fix values -> new in first level thermodynamic sa
yairchn Sep 5, 2018
7785faa
adding quadrature based buoyancy_sorting
Sep 6, 2018
c8f291e
adding quadrature buoyacy sorting - tested version
Sep 6, 2018
dca908a
minor fixed for var_dissipiation writing
Sep 7, 2018
e25ee6b
..
Sep 7, 2018
5aa0034
fixing update_GMV_MF so that self.m is at full levels and the tenden…
Sep 7, 2018
caa09c2
fixing update_GMV_MF so that self.m is at full levels and the tenden…
Sep 7, 2018
63b5ef4
cleanup of prints
Sep 8, 2018
7b753e8
add conditios to calc tke and cov in stats_io prog TKE
Sep 8, 2018
e7bea04
set_bc for w and a
Sep 11, 2018
4c44be1
add if ws<0 flag in initialize_covariances
Sep 12, 2018
941571c
adding _f and _c for Ref profiles and adding function for calc the MF…
Sep 12, 2018
2a02d9e
..
Sep 13, 2018
a5a743e
change cov_massflux to interdomain
Sep 14, 2018
ff0f03f
change cov_massflux to interdomain
Sep 14, 2018
3affa45
fix p_f and p_c in Surface bflux
Sep 14, 2018
5d6c8b8
condition positive covariances only for TKE, Hvar and QTvar
Sep 17, 2018
8d469de
condition positive covariances only for TKE, Hvar and QTvar
Sep 17, 2018
0775869
fixing problems in calling update_covariance for HQTcov with GMV.H only
Sep 17, 2018
41eb484
factor 0.5 for TKE in calcualtion form GMV
Sep 18, 2018
10cbf58
add bounds for theal_qt_covar in covariance_update
Sep 18, 2018
8d80103
add bounds for theal_qt_covar in covariance_update
Sep 18, 2018
523edba
..
Sep 18, 2018
61593a1
checking for nans in Soares
Sep 21, 2018
eecf8f1
testing Soares cleanup needed
Sep 21, 2018
8da0ce1
testing for fake_collocated
Sep 21, 2018
edbb227
collocated that runs soares
Sep 22, 2018
c7e6c78
..
Sep 22, 2018
c1ab2d2
..
Sep 22, 2018
c4b5df9
calcualte w[gw] with the upwind function
Sep 22, 2018
f15daf5
..
Sep 22, 2018
5fe8c24
..
yairchn Sep 22, 2018
3e67532
..
Sep 22, 2018
c264295
merge with origin
yairchn Sep 22, 2018
ce3ca64
adding the downward integration parts
Sep 22, 2018
afe4012
fully fake_collocated that integrates downwards on Soares
Sep 22, 2018
9ccaadb
add fabs in pressure terms
Sep 22, 2018
4b1349f
...
Sep 22, 2018
14d57f3
add sgn_w for entr and detr in a equation
Sep 22, 2018
00e3c48
..
Sep 22, 2018
0693446
..
Sep 22, 2018
a7d1747
fix factor 0.5 for tkr in get_GMV_tke and below it
Sep 22, 2018
65e2775
..
Sep 23, 2018
772495e
fix _c in Turbulance.pyx
Sep 23, 2018
b6bfaed
..
Sep 23, 2018
a9f757b
..
Sep 23, 2018
1b9a025
..
Sep 23, 2018
94c20a0
turned collocated not running
Sep 24, 2018
462a597
turned collocated not running
Sep 24, 2018
dc3b5db
...
Sep 24, 2018
3b67403
..
Sep 24, 2018
fcb1808
add fabs in entr and detr on covarinaces
Sep 24, 2018
b847a25
add fabs in entr and detr on covarinaces
Sep 24, 2018
0d3c514
collocated works for Soares with clipping
Sep 24, 2018
a295d06
..
Sep 24, 2018
1d4fc6f
unified upwind works for soares with clipping
Sep 25, 2018
497afba
. ..
Sep 25, 2018
b47658d
..
Sep 25, 2018
1f49bbf
..
Sep 25, 2018
05d01eb
fix min max for HQTcov
Sep 25, 2018
47dafa4
replace _half by _c and add _f
Sep 25, 2018
1c11c24
unified covariances running for Soares with clipping
Sep 25, 2018
2325c33
cleanup
Sep 25, 2018
d7991a1
..:
Sep 25, 2018
be6492e
..
Sep 25, 2018
3c77f8a
working with Soares for downward integration
Sep 26, 2018
aa259bd
..
Sep 27, 2018
0c69d9f
..
Sep 27, 2018
025d123
merge with new unified and running soares
Sep 27, 2018
294671d
adding DyCOMS and GABLS required functions from Ignacio's branch
Sep 29, 2018
5bf6da3
changes in generate_namelist with new ml
yairchn Sep 29, 2018
26b6eab
..
yairchn Sep 29, 2018
3e025de
temp fix for ml flag
Sep 30, 2018
58dfb81
changing the flags of mixing scheme
Sep 30, 2018
29c0329
tests
Oct 2, 2018
d827c6b
cleanup
Oct 3, 2018
70a1f6a
..
Oct 3, 2018
2155a77
fixing issues with the sign of w[gw-1]
Oct 4, 2018
e92db56
..
Oct 4, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Cases.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,14 @@ cdef class DYCOMS_RF01(CasesBase):
cpdef io(self, NetCDFIO_Stats Stats)
cpdef update_surface(self, GridMeanVariables GMV, TimeStepping TS)
cpdef update_forcing(self, GridMeanVariables GMV, TimeStepping TS)


cdef class GABLS(CasesBase):
cpdef initialize_reference(self, Grid Gr, ReferenceState Ref, NetCDFIO_Stats Stats)
cpdef initialize_profiles(self, Grid Gr, GridMeanVariables GMV, ReferenceState Ref )
cpdef initialize_surface(self, Grid Gr, ReferenceState Ref )
cpdef initialize_forcing(self, Grid Gr, ReferenceState Ref, GridMeanVariables GMV )
cpdef initialize_io(self, NetCDFIO_Stats Stats)
cpdef io(self, NetCDFIO_Stats Stats)
cpdef update_surface(self, GridMeanVariables GMV, TimeStepping TS)
cpdef update_forcing(self, GridMeanVariables GMV, TimeStepping TS)
406 changes: 252 additions & 154 deletions Cases.pyx

Large diffs are not rendered by default.

29 changes: 23 additions & 6 deletions EDMF_Environment.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,23 @@ cdef class EnvironmentVariable:
str name
str units


cdef class EnvironmentVariable_2m:
cdef:
double [:] values
double [:] dissipation
double [:] shear
double [:] entr_gain
double [:] detr_loss
double [:] press
double [:] buoy
double [:] interdomain
double [:] rain_src
str loc
str kind
str name
str units

cdef class EnvironmentVariables:
cdef:

Expand All @@ -24,12 +41,12 @@ cdef class EnvironmentVariables:
EnvironmentVariable THL
EnvironmentVariable T
EnvironmentVariable B
EnvironmentVariable TKE
EnvironmentVariable Hvar
EnvironmentVariable QTvar
EnvironmentVariable HQTcov
EnvironmentVariable_2m TKE
EnvironmentVariable_2m Hvar
EnvironmentVariable_2m QTvar
EnvironmentVariable_2m HQTcov
EnvironmentVariable CF
EnvironmentVariable THVvar
EnvironmentVariable_2m THVvar
Grid Gr
bint calc_tke
bint calc_scalar_var
Expand Down Expand Up @@ -73,4 +90,4 @@ cdef class EnvironmentThermodynamics:
void eos_update_SA_sgs(self, EnvironmentVariables EnvVar, bint in_Env)#, TimeStepping TS)
void sommeria_deardorff(self, EnvironmentVariables EnvVar)

cpdef satadjust(self, EnvironmentVariables EnvVar, bint in_Env)#, TimeStepping TS)
cpdef satadjust(self, EnvironmentVariables EnvVar, bint in_Env)#, TimeStepping TS)
79 changes: 48 additions & 31 deletions EDMF_Environment.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,46 @@ from libc.math cimport fmax, fmin, sqrt, exp, erf
from thermodynamic_functions cimport *
from microphysics_functions cimport *


cdef class EnvironmentVariable:
def __init__(self, nz, loc, kind, name, units):
self.values = np.zeros((nz,),dtype=np.double, order='c')
self.flux = np.zeros((nz,),dtype=np.double, order='c')
if loc != 'half' and loc != 'full':
print('Invalid location setting for variable! Must be half or full')
if loc != 'half':
print('Invalid location setting for variable! Must be half ')
self.loc = loc
if kind != 'scalar' and kind != 'velocity':
print ('Invalid kind setting for variable! Must be scalar or velocity')
self.kind = kind
self.name = name
self.units = units

cdef class EnvironmentVariable_2m:
def __init__(self, nz, loc, kind, name, units):
self.values = np.zeros((nz,),dtype=np.double, order='c')
self.dissipation = np.zeros((nz,),dtype=np.double, order='c')
self.entr_gain = np.zeros((nz,),dtype=np.double, order='c')
self.detr_loss = np.zeros((nz,),dtype=np.double, order='c')
self.buoy = np.zeros((nz,),dtype=np.double, order='c')
self.press = np.zeros((nz,),dtype=np.double, order='c')
self.shear = np.zeros((nz,),dtype=np.double, order='c')
self.interdomain = np.zeros((nz,),dtype=np.double, order='c')
self.rain_src = np.zeros((nz,),dtype=np.double, order='c')
if loc != 'half':
print('Invalid location setting for variable! Must be half')
self.loc = loc
if kind != 'scalar' and kind != 'velocity':
print ('Invalid kind setting for variable! Must be scalar or velocity')
self.kind = kind
self.name = name
self.units = units

cdef class EnvironmentVariables:
def __init__(self, namelist, Grid Gr ):
def __init__(self, namelist, Grid Gr):
cdef Py_ssize_t nz = Gr.nzg
self.Gr = Gr

self.W = EnvironmentVariable(nz, 'full', 'velocity', 'w','m/s' )
self.W = EnvironmentVariable(nz, 'half', 'velocity', 'w','m/s' )
self.QT = EnvironmentVariable( nz, 'half', 'scalar', 'qt','kg/kg' )
self.QL = EnvironmentVariable( nz, 'half', 'scalar', 'ql','kg/kg' )
self.QR = EnvironmentVariable( nz, 'half', 'scalar', 'qr','kg/kg' )
Expand All @@ -48,7 +68,6 @@ cdef class EnvironmentVariables:
self.B = EnvironmentVariable( nz, 'half', 'scalar', 'buoyancy','m^2/s^3' )
self.CF = EnvironmentVariable(nz, 'half', 'scalar','cloud_fraction', '-')

# TKE TODO repeated from Variables.pyx logic
if namelist['turbulence']['scheme'] == 'EDMF_PrognosticTKE':
self.calc_tke = True
else:
Expand All @@ -69,18 +88,17 @@ cdef class EnvironmentVariables:
except:
self.EnvThermo_scheme = 'sa_mean'
print('Defaulting to saturation adjustment with respect to environmental means')

if self.calc_tke:
self.TKE = EnvironmentVariable( nz, 'half', 'scalar', 'tke','m^2/s^2' )
self.TKE = EnvironmentVariable_2m( nz, 'half', 'scalar', 'tke','m^2/s^2' )

if self.calc_scalar_var:
self.QTvar = EnvironmentVariable( nz, 'half', 'scalar', 'qt_var','kg^2/kg^2' )
self.QTvar = EnvironmentVariable_2m( nz, 'half', 'scalar', 'qt_var','kg^2/kg^2' )
if namelist['thermodynamics']['thermal_variable'] == 'entropy':
self.Hvar = EnvironmentVariable(nz, 'half', 'scalar', 's_var', '(J/kg/K)^2')
self.HQTcov = EnvironmentVariable(nz, 'half', 'scalar', 's_qt_covar', '(J/kg/K)(kg/kg)' )
self.Hvar = EnvironmentVariable_2m(nz, 'half', 'scalar', 's_var', '(J/kg/K)^2')
self.HQTcov = EnvironmentVariable_2m(nz, 'half', 'scalar', 's_qt_covar', '(J/kg/K)(kg/kg)' )
elif namelist['thermodynamics']['thermal_variable'] == 'thetal':
self.Hvar = EnvironmentVariable(nz, 'half', 'scalar', 'thetal_var', 'K^2')
self.HQTcov = EnvironmentVariable(nz, 'half', 'scalar', 'thetal_qt_covar', 'K(kg/kg)' )
self.Hvar = EnvironmentVariable_2m(nz, 'half', 'scalar', 'thetal_var', 'K^2')
self.HQTcov = EnvironmentVariable_2m(nz, 'half', 'scalar', 'thetal_qt_covar', 'K(kg/kg)' )

if self.EnvThermo_scheme == 'sommeria_deardorff':
self.THVvar = EnvironmentVariable(nz, 'half', 'scalar', 'thetav_var', 'K^2' )
Expand Down Expand Up @@ -186,7 +204,7 @@ cdef class EnvironmentThermodynamics:
EnvVar.QT.values[k] = qt
EnvVar.QL.values[k] = ql
EnvVar.QR.values[k] += qr
EnvVar.B.values[k] = buoyancy_c(self.Ref.alpha0_half[k], alpha)
EnvVar.B.values[k] = buoyancy_c(self.Ref.alpha0_c[k], alpha)
return

cdef void update_cloud_dry(self, long k, EnvironmentVariables EnvVar, double T, double th, double qt, double ql, double qv) nogil :
Expand Down Expand Up @@ -218,9 +236,8 @@ cdef class EnvironmentThermodynamics:
with nogil:
for k in xrange(gw,self.Gr.nzg-gw):
# condensation + autoconversion
sa = eos(self.t_to_prog_fp, self.prog_to_t_fp, self.Ref.p0_half[k], EnvVar.QT.values[k], EnvVar.H.values[k])
mph = microphysics(sa.T, sa.ql, self.Ref.p0_half[k], EnvVar.QT.values[k], self.max_supersaturation, in_Env)

sa = eos(self.t_to_prog_fp, self.prog_to_t_fp, self.Ref.p0_c[k], EnvVar.QT.values[k], EnvVar.H.values[k])
mph = microphysics(sa.T, sa.ql, self.Ref.p0_c[k], EnvVar.QT.values[k], self.max_supersaturation, in_Env)
self.update_EnvVar( k, EnvVar, mph.T, mph.thl, mph.qt, mph.ql, mph.qr, mph.alpha)
self.update_cloud_dry(k, EnvVar, mph.T, mph.th, mph.qt, mph.ql, mph.qv)
return
Expand Down Expand Up @@ -314,8 +331,8 @@ cdef class EnvironmentThermodynamics:
h_hat = sqrt2 * sigma_h_star * abscissas[m_h] + mu_h_star

# condensation + autoconversion
sa = eos(self.t_to_prog_fp, self.prog_to_t_fp, self.Ref.p0_half[k], qt_hat, h_hat)
mph = microphysics(sa.T, sa.ql, self.Ref.p0_half[k], qt_hat, self.max_supersaturation, in_Env)
sa = eos(self.t_to_prog_fp, self.prog_to_t_fp, self.Ref.p0_c[k], qt_hat, h_hat)
mph = microphysics(sa.T, sa.ql, self.Ref.p0_c[k], qt_hat, self.max_supersaturation, in_Env)

# environmental variables
inner_env[i_ql] += mph.ql * weights[m_h] * sqpi_inv
Expand Down Expand Up @@ -353,11 +370,11 @@ cdef class EnvironmentThermodynamics:
# update cloudy/dry variables for buoyancy in TKE
EnvVar.CF.values[k] = outer_env[i_cf]
self.qt_dry[k] = outer_env[i_qt_dry]
self.th_dry[k] = theta_c(self.Ref.p0_half[k], outer_env[i_T_dry])
self.th_dry[k] = theta_c(self.Ref.p0_c[k], outer_env[i_T_dry])
self.t_cloudy[k] = outer_env[i_T_cld]
self.qv_cloudy[k] = outer_env[i_qt_cld] - outer_env[i_ql]
self.qt_cloudy[k] = outer_env[i_qt_cld]
self.th_cloudy[k] = theta_c(self.Ref.p0_half[k], outer_env[i_T_cld])
self.th_cloudy[k] = theta_c(self.Ref.p0_c[k], outer_env[i_T_cld])
# update var/covar rain sources
if in_Env:
self.Hvar_rain_dt[k] = outer_src[i_SH_H] - outer_src[i_SH] * EnvVar.H.values[k]
Expand All @@ -367,8 +384,8 @@ cdef class EnvironmentThermodynamics:

else:
# the same as in SA_mean
sa = eos(self.t_to_prog_fp, self.prog_to_t_fp, self.Ref.p0_half[k], EnvVar.QT.values[k], EnvVar.H.values[k])
mph = microphysics(sa.T, sa.ql, self.Ref.p0_half[k], EnvVar.QT.values[k], self.max_supersaturation, in_Env)
sa = eos(self.t_to_prog_fp, self.prog_to_t_fp, self.Ref.p0_c[k], EnvVar.QT.values[k], EnvVar.H.values[k])
mph = microphysics(sa.T, sa.ql, self.Ref.p0_c[k], EnvVar.QT.values[k], self.max_supersaturation, in_Env)

self.update_EnvVar( k, EnvVar, mph.T, mph.thl, mph.qt, mph.ql, mph.qr, mph.alpha)
self.update_cloud_dry(k, EnvVar, mph.T, mph.th, mph.qt, mph.ql, mph.qv)
Expand All @@ -394,13 +411,13 @@ cdef class EnvironmentThermodynamics:
Lv = latent_heat(EnvVar.T.values[k])
cp = cpd
# paper notation used below
Tl = EnvVar.H.values[k]*exner_c(self.Ref.p0_half[k])
q_sl = qv_star_t(self.Ref.p0[k], Tl) # using the qv_star_c function instead of the approximation in eq. (4) in SD
Tl = EnvVar.H.values[k]*exner_c(self.Ref.p0_c[k])
q_sl = qv_star_t(self.Ref.p0_c[k], Tl) # using the qv_star_c function instead of the approximation in eq. (4) in SD
beta1 = 0.622*Lv**2/(Rd*cp*Tl**2) # eq. (8) in SD
#q_s = q_sl*(1+beta1*EnvVar.QT.values[k])/(1+beta1*q_sl) # eq. (7) in SD
lambda1 = 1/(1+beta1*q_sl) # text under eq. (20) in SD
# check the pressure units - mb vs pa
alpha1 = (self.Ref.p0[k]/100000.0)**0.286*0.622*Lv*q_sl/Rd/Tl**2 # eq. (14) and eq. (6) in SD
alpha1 = (self.Ref.p0_c[k]/100000.0)**0.286*0.622*Lv*q_sl/Rd/Tl**2 # eq. (14) and eq. (6) in SD
# see if there is another way to calculate dq/dT from scmapy
sigma1 = EnvVar.QTvar.values[k]-2*alpha1*EnvVar.HQTcov.values[k]+alpha1**2*EnvVar.Hvar.values[k] # eq. (18) in SD , with r from (11)
Q1 = (EnvVar.QT.values[k]-q_sl)/sigma1 # eq. (17) in SD
Expand All @@ -419,17 +436,17 @@ cdef class EnvironmentThermodynamics:
EnvVar.T.values[k] = Tl + Lv/cp*EnvVar.QL.values[k] # should this be the differnece in ql - would it work for evaporation as well ?
EnvVar.CF.values[k] = R
qv = EnvVar.QT.values[k] - EnvVar.QL.values[k]
alpha = alpha_c(self.Ref.p0_half[k], EnvVar.T.values[k], EnvVar.QT.values[k], qv)
EnvVar.B.values[k] = buoyancy_c(self.Ref.alpha0_half[k], alpha)
EnvVar.THL.values[k] = t_to_thetali_c(self.Ref.p0_half[k], EnvVar.T.values[k], EnvVar.QT.values[k],
alpha = alpha_c(self.Ref.p0_c[k], EnvVar.T.values[k], EnvVar.QT.values[k], qv)
EnvVar.B.values[k] = buoyancy_c(self.Ref.alpha0_c[k], alpha)
EnvVar.THL.values[k] = t_to_thetali_c(self.Ref.p0_c[k], EnvVar.T.values[k], EnvVar.QT.values[k],
EnvVar.QL.values[k], 0.0)

self.qt_dry[k] = EnvVar.QT.values[k]
self.th_dry[k] = EnvVar.T.values[k]/exner_c(self.Ref.p0_half[k])
self.th_dry[k] = EnvVar.T.values[k]/exner_c(self.Ref.p0_c[k])
self.t_cloudy[k] = EnvVar.T.values[k]
self.qv_cloudy[k] = EnvVar.QT.values[k] - EnvVar.QL.values[k]
self.qt_cloudy[k] = EnvVar.QT.values[k]
self.th_cloudy[k] = EnvVar.T.values[k]/exner_c(self.Ref.p0_half[k])
self.th_cloudy[k] = EnvVar.T.values[k]/exner_c(self.Ref.p0_c[k])

#using the approximation in eq. (25) in SD, noting that in the paper there is a typo in the first
# condition and 1.6 there should be -1.6
Expand All @@ -456,4 +473,4 @@ cdef class EnvironmentThermodynamics:
else:
sys.exit('EDMF_Environment: Unrecognized EnvThermo_scheme. Possible options: sa_mean, sa_quadrature, sommeria_deardorff')

return
return
Loading