???????????
-
entropies.py: sv_c() -- correct to set it to zero if pv=0?
-
pv_star_1 > p0 --> qv_star_1<0 (bcs. in calculation qv_star_c: pd<0) --> qt>qv_star_1 (saturated even for qt=0) but pv=0 --> changed formulation for (saturated && pv==0) to s_1 = s (initial entropy)
-
if continuing saturated thermodynamics with qt=0, pv=0:
--> pv_star_2 >> pv_star_1 >> p0 --> qv_star_2 << qv_star_1 -
s_1 negative for
parameters.py
: LES parameters
EM_PDF
: fit Gaussian mixed model (GMM) by using the 'expectation-maximation' (EM) algorithm
and save parameters (means, covariances, weights) in nc-files
using scikit package: sklearn.mixture.GaussianMixture
--> output means, covariances and relative weights
EM_PDF_univariate
: fit uni-variate Gaussian mixed model (GMM) using the 'expectation-maximation' (EM)
algorithm and save parameters (means, covariances, weights) in nc-files
using scikit package: sklearn.mixture.GaussianMixture
--> output means, covariances and relative weights
EM_PDF_plot
: read in output from EM_PDF.py / EM_PDF_univariate.py & plot PDFs from Gaussian
EM_PDF_stochastic
: read in files with GMM parameters and feed to auto-regression (AR) model (VAR model)
using stats_LES.py: module to compute statsmodel model
using statsmodel package (former scikits.statsmodels)
--> output AR matrices
AR Fit Matlab package from Tapio:
arfit_py.py
arqr_py.py
: QR decomposition
Repositories:
- CloudClosure: test version, in python
- CloudClosure_unsat: test of unsaturated thermodynamics, to verify LES output
- CloudClosure_sat: base version for all versions that are in use
- CloudClosure_zlayer: based on CloudClosure_sat with accumulation over multiple levels
- CloudClosure_resolution: current version; based on CloudClosure_sat with accumulation over multiple levels and variable computational domain
Lx
CloudClosure_sat:
check_ql_file.py
: compute and plot statistics from a single 3D field output or cumulated over several output fields corresponding to several timesteps (mean profiles of liquid water, entropy and thetali; maximum liquid water)plotting_gaussians.py
: plotting Gaussian functions with adjustable number of components (only for illustration)main_CC_sat.py
: defining path, casename, timesteps etc.; calling the main fileCloudClosure.pyx
CloudClosure.pyx
: reading in files, computing GMM (Gaussian Mixture Model) PDF, saving corresponding parameters, Monte Carlo sampling from fitted PDF and computing (grid cell) mean liquid water from data and samples to compute the fitting error; calling plotting functionsCC_thermodynamics.pyx
: Clausius Clapeyron incl. Lookup Table; Latent Heat class; saturation adjustment, analog to PyCLES; Cython interfaces to thermodynamic functions from C-files, that are directly copied from PyCLES (in Csrc)plotting_functions.py
: plotting functions for Data scatterplot, sampling
CloudClosure_zlayer:
- based on
CloudClosure_sat
- additional accumulation of data points (LES fields as training data) over several levels to take into account the box height of large-scale models
CloudClosure_resolution:
- based on
CloudClosure_zlayer
- chosing computational domain size
Lx
- accumulation over layers
dz
and files / timesteps CloudClosure_res
: normal fileCloudClosure_res_acc
: (!!! not in use) for Lx (compuational domain) is smaller than the LES domain size, it accumulates over all columns of size Lx*LxCloudClosure_res_anomaly
: use anomalies of liquid potential temperature and total water for computing the PDF
###Concept:
-
Initialize: case_name, ref.pressure and height
-
Update:
(a) read in 3D files at time d: qt_, s_, ql_, T_
(b) PDF Model:
1. Initialize CC, Lv-Lookup Table 2. for n in ncomp_range: # (no accumulation over several time steps or levels) for k in zrange: - <ql>[k], CF[k] - normalise data - clf[k] - labels - sort PDFs and labels - rearrange labels from 2D file (nx*ny,nz) into 3D file (nx,ny,nz) return labels
(c) Tracer Model:
for type in list: - read in 3D label array (pickel file) - plotting...
io_read_in_files.py
: read in nc-files, Namelist files etc.
budget_TKE
: offline TKE budget computation from LES output (old LES; hdf5 output)
budget_Th
: offline potential temperature budget (potential energy)
compatibility
: check compatibility of scalar tracer convergence according to Chr. Schär
EddyField_output
:
- compute Eddy Fields (fluctuations) from LES field output
- save as new nc-files
Correlations
:
- compute Correlations from Eddy Fields
- output as nc-files
####Vis: plot from Visualization outputs (pickle files)
####Vis_fields:
- plot from LES output fields and profiles
- plot contourf and contours
INPUT: path-to-fields case_name --var_name qt --cont_name ql
var_name:
optional, name of variable that should be plot by contourf
in 2D plot
cont_name:
optional, name of variable that should be plot by contour
, overlaying the var_name
-plot
####Vis_correlations:
- compute and plot Correlations
#Thermodynamics Saturation Adjustment:
thermodynamics_1
: offline saturation adjustment with (Clausius Clapeyron by Magnus Formula; saturation adjustment) as in LES;
normal loop --> gives nan in T
thermodynamics_2
: same as thermodynamics_1, but with correction on first iteration loop (qv_star_1 > 0)
thermodynamics_3
: same as thermodynamics_1, but with additional corrections on all iteration loop (qv_star_i > 0, or equivalently T<373K or pd>0)
thermodynamics_4
: same as thermodynamics_1, but with correction in T_2 --> if pv_star_2>p0: T_2 = 371K
- T_2 <= 371K:
if pv_star_2[i,j] >= p0:
T_2[i,j] = 371.0 K
...
- T_2 <= 350K:
if T_2[i,j] >= 350:
T_2[i,j] = 350.0 K
...
CC_Magnus
: saturation adjustment 'step by step', Clausius Clapeyron with Magnus formula and from PyCLES
CC_Magnus_mod
: like CC_Magnus, but with modified T_2 formulation (if T_2>373.3K: set T_2=373.3K)
Plotting:
thermo_plot
: simple file for plotting thermodynamic relations (e.g. defined in thermo_aux)