Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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 UWLCM_plotters/include/Plotter2d.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,17 @@ class Plotter_t<2> : public PlotterCommon
// edge cells are smaller
dv(blitz::Range(0,0),blitz::Range::all()) /= 2.;
dv(blitz::Range::all(),blitz::Range(0,0)) /= 2.;
dv(blitz::Range::all(),blitz::Range(dv.cols() - 1, dv.cols() - 1)) /= 2.;
dv(blitz::Range(dv.rows() - 1, dv.rows() - 1), blitz::Range::all()) /= 2.;

// Printing the modified dv array
//std::cout << "Modified dv array:\n";
//for (int i = 0; i < dv.extent(0); ++i) {
// for (int j = 0; j < dv.extent(1); ++j) {
// std::cout << dv(i, j) << " ";
// }
// std::cout << "\n";
//}

// other dataset are of the size x*z, resize tmp
tmp.resize(n[0]-1, n[1]-1);
Expand Down
10 changes: 5 additions & 5 deletions UWLCM_plotters/include/PlotterCommon.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ class PlotterCommon
{
if(h5f.getFileName() != file)
{
notice_macro("about to close current file: " << h5f.getFileName())
//notice_macro("Teraz about to close current file: " << h5f.getFileName())
h5f.close();

notice_macro("about to open file: " << file)
//notice_macro("Teraaz 1about to open file: " << file)
h5f.openFile(file, H5F_ACC_RDONLY);
}

Expand All @@ -46,10 +46,10 @@ class PlotterCommon
{
if(h5f.getFileName() != file)
{
notice_macro("about to close current file: " << h5f.getFileName())
//notice_macro("Teraz 2 about to close current file: " << h5f.getFileName())
h5f.close();

notice_macro("about to open file: " << file)
//notice_macro("Teraz 2about to open file: " << file)
h5f.openFile(file, H5F_ACC_RDONLY);
}

Expand Down Expand Up @@ -85,7 +85,7 @@ class PlotterCommon
file(file)
{
// init h5f
notice_macro("about to open file: " << file << "/const.h5")
//notice_macro("Teraz 3about to open file: " << file << "/const.h5")
h5f.openFile(file + "/const.h5", H5F_ACC_RDONLY);

// init dt and outfreq
Expand Down
21 changes: 17 additions & 4 deletions UWLCM_plotters/include/PlotterMicro.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,16 @@ class PlotterMicro_t : public Plotter_t<NDims>
{
if(this->micro == "lgrngn")
{

//std::cout << "CellVol = " << this->CellVol << std::endl;
//std::cout << "dv = " << this->dv << std::endl;
//std::cerr << this->dv;
res = this->h5load_timestep("precip_rate", at)
* 4./3 * 3.14 * 1e3 // to get mass
/ this->CellVol // averaged over cell volume, TODO: make precip rate return specific moment? wouldnt need the dx and dy
* L_evap;
* 4./3 * 3.14 * 1e3 // to get mass
//5000.
/ this->dv // averaged over cell volume, TODO: make precip rate return specific moment? wouldnt need the dx and dy
// this->CellVol // averaged over cell volume, TODO: make precip rate return specific moment? wouldnt need the dx and dy
* L_evap;
}
else if(this->micro == "blk_1m")
try
Expand Down Expand Up @@ -388,7 +394,14 @@ class PlotterMicro_t : public Plotter_t<NDims>
/ 1e3 // to m^3 of water
* 1e3; // to mm
}

// accumulated volume precipitation [m^3]
double calc_acc_surf_precip_volume(double prec_vol)
{
if(this->micro == "lgrngn")
return calc_acc_surf_precip(prec_vol) * this->DomainSurf / 1000.;
if(this->micro == "blk_1m")
return calc_acc_surf_precip(prec_vol) * this->DomainSurf / 1000.;// to m^3 of water
}
// droplet removal rate (at boundaries) since last output [1/(cm^3 s)]
double calc_prtcl_removal(double prtcl_removal_diff)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,23 @@
# activate latex text rendering
rc('text', usetex=True)

Lasher_Trapp_vars = ["lwp", "rwp", "surf_precip", "acc_precip", "cl_nc"]
Cumulus_Congestus_vars = ["RH_max", "cloud_top_height", "surf_precip", "acc_precip", "acc_vol_precip"]

# init the plot
nplotx = 2
nploty= 3
fig, axarr = plt.subplots(nplotx,nploty)

plot_series( Lasher_Trapp_vars, 0, nplotx, nploty, axarr, xscaledict, yscaledict, xlimdict_series, ylimdict_series, xlabel='Time [h]')
plot_series( Cumulus_Congestus_vars, 0, nplotx, nploty, axarr, xscaledict, yscaledict, xlimdict_series, ylimdict_series, xlabel='Time [h]')

# legend font size
plt.rcParams.update({'font.size': 8})

# hide axes on empty plots
if len( Lasher_Trapp_vars) % nploty == 0:
if len( Cumulus_Congestus_vars) % nploty == 0:
nemptyplots = 0
else:
nemptyplots = nploty - len( Lasher_Trapp_vars) % nploty
nemptyplots = nploty - len( Cumulus_Congestus_vars) % nploty
emptyplots = np.arange(nploty - nemptyplots, nploty)
for empty in emptyplots:
axarr[nplotx-1, empty].axis('off')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
"sat_RH" : "linear",
"rad_flx" : "linear",
"lwp" : "linear",
"RH_max" : "linear",
"cloud_top_height" : "linear",
"total_droplets_number" : "linear",
"acc_precip_vol" : "linear",
"rwp" : "linear",
"er" : "linear",
"wvarmax" : "linear",
Expand All @@ -34,6 +38,10 @@
"sat_RH" : "linear",
"rad_flx" : "linear",
"lwp" : "linear",
"RH_max" : "linear",
"cloud_top_height" : "linear",
"total_droplets_number" : "linear",
"acc_precip_vol" : "linear",
"rwp" : "linear",
"er" : "linear",
"wvarmax" : "linear",
Expand All @@ -56,6 +64,8 @@
"wvar" : None,
"w3rd" : None,
"sat_RH" : None,
#"RH_max" : None,
#"cloud_top_height" : None,
"rad_flx" : None,
"gccn_rw_cl" : (0,90),
"non_gccn_rw_cl" : (0,12),
Expand All @@ -71,6 +81,8 @@
"wvar" : (0,3000),
"w3rd" : (0,3000),
"sat_RH" : (0,3000),
"RH_max" : (0,3000),
"cloud_top_height" : (0,3000),
"rad_flx" : (0,3000),
"gccn_rw_cl" : (0,3000),
"non_gccn_rw_cl" : (0,3000),
Expand All @@ -81,24 +93,32 @@
"clfrac" : None,
"cl_nc" : None,
"lwp" : None,
"RH_max" : None,
"cloud_top_height" : None,
"total_droplets_number" : None,
"rwp" : None,
"er" : None,
"wvarmax" : None,
"surf_precip" : None,
"acc_precip" : None,
"acc_precip_vol" : None,
"cl_gccn_conc" : None,
"cloud_base" : None
"cloud_base" : None
}

ylimdict_series = {
"clfrac" : None,
"cl_nc" : None,
"lwp" : None,
"RH_max" : None,
"cloud_top_height" : None,
"total_droplets_number" : None,
"acc_precip_vol" : None,
"rwp" : None,
"er" : None,
"wvarmax" : None,
"surf_precip" : None,
"acc_precip" : None,#(0,0.07),
"cl_gccn_conc" : (1e-6, 1),
"cloud_base" : None
}
"cloud_base" : None
}
2 changes: 1 addition & 1 deletion drawbicyc/average.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ int main(int argc, char* argv[])
const string profiles_suffix = string("_profiles_")+argv[2]+string("_")+argv[3];
string plot_type;
// determine type of plots based on the name of the first file
const string types[] = {"rico", "dycoms", "moist_thermal"};
const string types[] = {"rico", "dycoms", "moist_thermal", "cumulus_congestus"};
for(auto type : types)
{
if(hasEnding(string(argv[4]), type))
Expand Down
30 changes: 16 additions & 14 deletions drawbicyc/drawbicyc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ int main(int argc, char** argv)
("qv_qc_2_6_10_min", po::value<bool>()->default_value(false) , "plot comparison of qv and qc fields at 2, 6 and 10 min?")
("dir", po::value<std::string>()->required() , "directory containing out_lgrngn")
("micro", po::value<std::string>()->required(), "one of: blk_1m, blk_2m, lgrngn")
("type", po::value<std::string>()->required(), "one of: dycoms, moist_thermal, rico, Lasher_Trapp, gccn_ccn_conc")//, base_prflux_vs_clhght")
("type", po::value<std::string>()->required(), "one of: dycoms, moist_thermal, rico, cumulus_congestus, gccn_ccn_conc")//, base_prflux_vs_clhght")
;

po::variables_map vm;
Expand All @@ -33,8 +33,8 @@ int main(int argc, char** argv)

// handling the "type" option
std::string type = vm["type"].as<std::string>();
if(type != "dycoms" && type != "moist_thermal" && type != "rico" && type != "pi_chamber" && type != "Lasher_Trapp" && type != "pi_chamber_icmw" && type != "gccn_ccn_conc")
throw std::runtime_error("Unrecognized 'type' option, only dycoms, rico, moist_thermal, pi_chamber, pi_chamber_icmw, Lasher_Trapp, gccn_ccn_conc available now");//, base_prflux_vs_clhght available now");
if(type != "dycoms" && type != "moist_thermal" && type != "rico" && type != "pi_chamber" && type != "cumulus_congestus" && type != "pi_chamber_icmw" && type != "gccn_ccn_conc")
throw std::runtime_error("Unrecognized 'type' option, only dycoms, rico, moist_thermal, pi_chamber, pi_chamber_icmw, cumulus_congestus, gccn_ccn_conc available now");//, base_prflux_vs_clhght available now");

// should profiles be normalized by inversion height
const bool normalize_prof = type == "dycoms";
Expand All @@ -56,9 +56,10 @@ int main(int argc, char** argv)
H5::DataSet h5d = h5f.openDataSet("G");
H5::DataSpace h5s = h5d.getSpace();
int NDims = h5s.getSimpleExtentNdims();

// detecting if subgrid model was on
std::cout << NDims <<std::endl;
//detecting if subgrid model was on
bool sgs = true;
std::cout<<"WARTOSC SGS"<<std::endl;
try
{
auto h5g = h5f.openGroup("sgs");
Expand All @@ -69,26 +70,27 @@ int main(int argc, char** argv)
}

Plots plots(type, sgs);
//Plots plots(type, false);

if(NDims == 2)
{

if(flag_series) plot_series(PlotterMicro_t<2>(h5, micro), plots, type);
if(flag_profiles) plot_profiles(PlotterMicro_t<2>(h5, micro), plots, type, normalize_prof);
// if(flag_fields) plot_fields(PlotterMicro_t<2>(h5, micro), plots, type);
// if(flag_qv_qc_2_6_10_min) plot_qv_qc_2_6_10_min(PlotterMicro_t<2>(h5, micro));
//if(flag_fields) plot_fields(PlotterMicro_t<2>(h5, micro), plots, type);
//if(flag_qv_qc_2_6_10_min) plot_qv_qc_2_6_10_min(PlotterMicro_t<2>(h5, micro));
}
else if(NDims == 3)
{
if(flag_series) plot_series(PlotterMicro_t<3>(h5, micro), plots, type);
if(flag_profiles) plot_profiles(PlotterMicro_t<3>(h5, micro), plots, type, normalize_prof);
// if(flag_fields) plot_fields(PlotterMicro_t<3>(h5, micro), plots, type);
// if(flag_qv_qc_2_6_10_min) plot_qv_qc_2_6_10_min(PlotterMicro_t<2>(h5, micro));
// else if(NDims == 3)
// {
// if(flag_series) plot_series(PlotterMicro_t<3>(h5, micro), plots, type);
//if(flag_profiles) plot_profiles(PlotterMicro_t<3>(h5, micro), plots, type, normalize_prof);
//if(flag_fields) plot_fields(PlotterMicro_t<3>(h5, micro), plots, type);
//if(flag_qv_qc_2_6_10_min) plot_qv_qc_2_6_10_min(PlotterMicro_t<2>(h5, micro));
// if(flag_lgrngn_spec) {
// plot_lgrngn_spec_positions(PlotterMicro_t<3>(h5, "lgrngn"));
// plot_lgrngn_spec(PlotterMicro_t<3>(h5, "lgrngn"));
// }
}
// }
else
assert(false && "need 2d or 3d input data");

Expand Down
112 changes: 112 additions & 0 deletions drawbicyc/include/cases/Cumulus_Congestus/plots.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
#pragma once


const std::vector<std::string> series_Cumulus_Congestus({
//"clfrac",
"lwp",
"rwp",
"cwp",
"lwm",
"cwm",
"rwm",
"surf_precip",
"acc_precip",
"acc_vol_precip",
//"cl_nc",
//"cloud_base",
//"RH_max",
"cloud_top_height",
"total_droplets_number",
"cl_meanr",
"cl_nc",
"cl_nr",
"nc",
"nr",
"com_mom0",
"com_mom1",
"com_mom2",
"cloud_cover_rico",
//"surf_flux_latent",
//"surf_flux_sensible",
//"sd_conc_avg",
//"mass_dry",
//"cl_gccn_conc",
//"gccn_conc",
//"cl_non_gccn_conc",
//"non_gccn_conc",
//"cl_gccn_to_non_gccn_conc_ratio"
//, "cl_gccn_meanr"
//,"cl_avg_cloud_rad"
// "sd_conc_std_dev",
// "tot_water"
});

std::vector<std::string> profs_Cumulus_Congestus({
"actrw_rw_cl_conc",
"rliq",
"actrw_rw_cl",
"actrw_mom1",
"actrw_mom2",
"disp_r",
"actrw_rw_cl_sigma",
"sigma_r",
"mean_r",
//"00rtot",
//"rliq",
//"thl",
//"wvar",
"prflux",
//"clfrac",
//"sd_conc",
//"cl_nc",
//"cl_nc_up",
//"w",
//"u",
//"v",
//"coal_tele",
//"base_prflux_vs_clhght",
//"non_gccn_rw_cl",
//"gccn_rw_cl,"
//, "N_c",
// "actrw_reff_cl",
// "ratio_mean_volume_r_to_eff_r_cubed",
// "cloud_water_std",
//"rain_water_std",
// "cloud_std_dev"
//,"vel_div"
//, "nc_up"
//,"sat_RH_up"
//, "act_conc_up"
//, "nc_down"
});

std::vector<std::string> fields_Cumulus_Congestus({
//"rl",
"mass_conc_rain_drops",
"mass_conc_cloud_droplets",
"num_conc_droplets",
"LWC",
//"mass_conc_cloud",
"ratio_mean_volume_r_to_eff_r_cubed",
"std_dev_droplet_size_dist",
//"rr",
"num_conc_rain_drops",
"effective_radius",
//"na",
//"th",
//"rv"
//"u",
//"w"
//"sd_conc",
//"r_dry",
//"RH",
//"supersat",
//"nc",
//"rr",
//"nr",
//"ef", "na",
//"th",
//"rv",
//"u",
//"w"
});
Loading