THERMOGEN

Copyright (c) 2024 MPI-M, Clara Bayley

—– CLEO —– File: thermogen.py Project: thermobinary_src Created Date: Monday 16th October 2023 Author: Clara Bayley (CB) Additional Contributors: —– License: BSD 3-Clause “New” or “Revised” License https://opensource.org/licenses/BSD-3-Clause —– File Description: Various ways of generating fields for Temp, Pressure, Qvap and Qcond to read into CLEO

class cleopy.thermobinary_src.thermogen.ConstUniformThermo(PRESS, TEMP, qvap, qcond, relh=False, constants_filename='')[source]

create thermodynamics that’s constant in time and uniform throughout the domain

class cleopy.thermobinary_src.thermogen.DryHydrostaticAdiabatic2TierRelH(config_filename, constants_filename, PRESSz0, THETA, qvapmethod, qvapparams, Zbase, qcond, moistlayer)[source]

create thermodynamics that’s constant in time and in hydrostatic equillibrium with a dry adiabat accounting for the mass of water vapour in the air. Equations derived from Arabas et al. 2015 (sect 2.1). Relative humidity like for Simple2TierRelativeHumidity exceptional moist layer possible to add within in a certain height range

hydrostatic_adiabatic_profile(ZCOORDS)[source]

returns profile of density (not the density itself!) rho = rhoprofile^((1-RC_DRY)/RC_DRY) = profile^pow

rhotilda(ZCOORDS)[source]

returns dimensionless rho_dry profile for use in stream function

class cleopy.thermobinary_src.thermogen.HydrostaticLapseRates(config_filename, constants_filename, PRESS0, TEMP0, qvap0, Zbase, TEMPlapses, qvaplapses, qcond)[source]

create thermodynamics that’s constant in time and in hydrostatic equillibrium and following temperature and qvap (adiabats) with constant lapse rates above/below zbase. Qcond is uniform and constant.

press1(z)[source]

hydrostatic pressure for value z where z <= self.Zbase

press2(z)[source]

hydrostatic pressure for value z where z > self.Zbase

qvap1(z)[source]

note unit conversion of input lapse rates: qvaplapse rate = -dqvap/dz [g/Kg km^-1] –> [m^-1]

qvap2(z)[source]

note unit conversion of input lapse rates: qvaplapse rate = -dqvap/dz [g/Kg km^-1] –> [m^-1]

temp1(z)[source]

note unit conversion of input lapse rates: templapse rate = -dT/dz [K km^-1] –> [K m^-1]

temp2(z)[source]

note unit conversion of input lapse rates: templapse rate = -dT/dz [K km^-1] –> [K m^-1]

class cleopy.thermobinary_src.thermogen.Simple2TierRelativeHumidity(config_filename, constants_filename, PRESS, TEMP, qvapmethod, qvapparams, Zbase, qcond)[source]

create thermodynamics that’s constant in time with (P,T,qc) uniform throughout the domain and with relative humidity uniform above and below Zbase

rhotilda(ZCOORDS)[source]

returns dimensionless rho_dry profile for use in stream function

cleopy.thermobinary_src.thermogen.qparams_to_qvap(method, params, Mr_ratio, PRESS, TEMP)[source]

returns qvaps given list of qvaps, supersaturation ratios or relative humidities

cleopy.thermobinary_src.thermogen.relh2qvap(press, temp, relh, Mr_ratio)[source]

convert relative humidity [%] (relh) into vapour mass mixing ratio (qvap) given ambient temperature and pressure and ratio of molecular masses: vapour/air

cleopy.thermobinary_src.thermogen.saturation_press(TEMP)[source]

Calculate the equilibrium vapor pressure of water over liquid water ie. the saturation pressure (psat) given the temperature [K]. Equation from Bjorn Steven’s “make_tetens” function in module “moist_thermodynamics.saturation_vapour_pressures” available on gitlab. Original paper “Murray, F. W. On the Computation of Saturation Vapor Pressure. Journal of Applied Meteorology and Climatology 6, 203–204 (1967).