Skip to content

Commit

Permalink
Merge pull request #99 from yairchn/clima_master
Browse files Browse the repository at this point in the history
change turb entr to have env tke
  • Loading branch information
ilopezgp authored Apr 17, 2020
2 parents 70562d4 + 7a4c5ad commit 2c47f3a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
11 changes: 2 additions & 9 deletions Turbulence_PrognosticTKE.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1026,23 +1026,16 @@ cdef class EDMF_PrognosticTKE(ParameterizationBase):
cpdef compute_horizontal_eddy_diffusivities(self, GridMeanVariables GMV):
cdef:
Py_ssize_t i, k
double R_up,wu_half, we_half, a, velocity_scale
double R_up
double [:] ae = np.subtract(np.ones((self.Gr.nzg,),dtype=np.double, order='c'),self.UpdVar.Area.bulkvalues)
double l[2]

with nogil:
for k in xrange(self.Gr.gw, self.Gr.nzg-self.Gr.gw):
for i in xrange(self.n_updrafts):
if self.UpdVar.Area.values[i,k]>0.0:
wu_half = interp2pt(self.UpdVar.W.values[i,k], self.UpdVar.W.values[i,k-1])
we_half = interp2pt(self.EnvVar.W.values[k], self.EnvVar.W.values[k-1])
a = self.UpdVar.Area.values[i,k]
with gil:
l[0] = sqrt(fmax(ae[k]*self.EnvVar.TKE.values[k],0.0))
l[1] = sqrt(fmax(a*ae[k]*(wu_half-we_half)**2.0,0.0))
velocity_scale = lamb_smooth_minimum(l, 0.1, 0.05)
self.horizontal_KM[i,k] = self.UpdVar.Area.values[i,k]*self.turbulent_entrainment_factor \
*velocity_scale*self.pressure_plume_spacing[i]
*sqrt(fmax(self.EnvVar.TKE.values[k],0.0))*self.pressure_plume_spacing[i]
self.horizontal_KH[i,k] = self.horizontal_KM[i,k] / self.prandtl_nvec[k]
else:
self.horizontal_KM[i,k] = 0.0
Expand Down
2 changes: 1 addition & 1 deletion generate_paramlist.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def main():
paramlist_defaults['turbulence']['EDMF_PrognosticTKE']['max_area'] = 0.9
paramlist_defaults['turbulence']['EDMF_PrognosticTKE']['entrainment_factor'] = 0.13
paramlist_defaults['turbulence']['EDMF_PrognosticTKE']['detrainment_factor'] = 0.51
paramlist_defaults['turbulence']['EDMF_PrognosticTKE']['turbulent_entrainment_factor'] = 0.08
paramlist_defaults['turbulence']['EDMF_PrognosticTKE']['turbulent_entrainment_factor'] = 0.015
paramlist_defaults['turbulence']['EDMF_PrognosticTKE']['entrainment_ed_mf_sigma'] = 50.0
paramlist_defaults['turbulence']['EDMF_PrognosticTKE']['entrainment_smin_tke_coeff'] = 0.3
paramlist_defaults['turbulence']['EDMF_PrognosticTKE']['updraft_mixing_frac'] = 0.25
Expand Down

0 comments on commit 2c47f3a

Please sign in to comment.