Skip to content

Commit

Permalink
use hydro lapse rates for thermogen
Browse files Browse the repository at this point in the history
  • Loading branch information
yoctoyotta1024 committed Jan 9, 2024
1 parent 931c238 commit a3e6def
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 14 deletions.
24 changes: 12 additions & 12 deletions examples/rainshaft1d/rainshaft1d.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,14 @@
ygrid = np.array([0, 20]) # array of yhalf coords [m]

### --- settings for 1-D Thermodynamics --- ###
PRESS0 = 101315 # [Pa]
THETA0 = 298.15 # [K]
qcond = 0.0 # [Kg/Kg]
WVEL = 0.0 # [m/s]
qvapmethod = "qvap"
Zbase = 750 # [m]
qvap0 = [0.99, 1.0025] # s_ratio [below, above] Zbase
moistlayer=False
PRESS0 = 101315 # [Pa]
THETA0 = 297.9 # [K]
qvap0 = 0.013816 # [Kg/Kg]
Zbase = 750 # [m]
thetalapses = [0, 0.01] # [K m^-1]
qvlapses = [0, -0.0001] # [Kg/Kg m^-1]
qcond = 0.0 # [Kg/Kg]
WVEL = 0.0 # [m/s]

### --- settings for initial superdroplets --- ###
# settings for initial superdroplet coordinates
Expand Down Expand Up @@ -126,13 +126,13 @@
rgrid.print_domain_info(constsfile, gridfile)

### ----- write thermodynamics binaries ----- ###
thermodyngen = thermogen.ConstHydrostaticLapseRates(configfile, constsfile, PRESS0,
THETA0, qvapmethod, sratios, Zbase,
qcond, WVEL, VVEL, UVEL)
thermodyngen = thermogen.ConstHydrostaticLapseRates(PRESS0, THETA0, qvap0,
Zbase, thetalapses,
qvlapses, qcond,
WVEL, None, None)
cthermo.write_thermodynamics_binary(thermofile, thermodyngen, configfile,
constsfile, gridfile)


### ----- write initial superdroplets binary ----- ###
nsupers = crdgens.nsupers_at_domain_top(gridfile, constsfile, npergbx, zlim)
coord3gen = crdgens.SampleCoordGen(True) # sample coord3 randomly
Expand Down
3 changes: 1 addition & 2 deletions pySD/thermobinary_src/thermogen.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,15 +432,14 @@ def __init__(self, PRESS0, THETA0, qvap0, Zbase,
self.PRESS0 = PRESS0 # surface pressure [Pa]
self.THETA0 = THETA0 # surface temperature [T]
self.qvap0 = qvap0 # surface water vapour content [Kg/Kg]
self.Zbase = Zbase # cloud base height [m]
self.thetalapses = thetalapses # theta lapse rates [below, above] Zbase
self.qvlapses = qvlapses # qv lapse rates [below, above] Zbase
self.Zbase = Zbase # cloud base height [m]

self.qcond = qcond # liquid water content [Kg/Kg]
self.WVEL = WVEL # vertical (z) velocity [m/s]
self.UVEL = UVEL # horizontal x velocity [m/s]
self.VVEL = VVEL # horizontal y velocity [m/s]


def generate_thermo(self, gbxbounds, ndims, ntime):

Expand Down

0 comments on commit a3e6def

Please sign in to comment.