@@ -437,8 +437,6 @@ make_plots_generic(
437437 simulation_path,
438438 vars,
439439 time = LAST_SNAP,
440- x = 0.0, # Our columns are still 3D objects...
441- y = 0.0,
442440 more_kwargs = YLINEARSCALE,
443441)
444442```
@@ -453,8 +451,6 @@ make_plots_generic(
453451 simulation_path,
454452 vars,
455453 time = LAST_SNAP,
456- x = 0.0, # Our columns are still 3D objects...
457- y = 0.0,
458454 more_kwargs = YLINEARSCALE,
459455)
460456```
@@ -589,14 +585,23 @@ ColumnPlots = Union{
589585function make_plots (:: ColumnPlots , output_paths:: Vector{<:AbstractString} )
590586 simdirs = SimDir .(output_paths)
591587 short_names = [" ta" , " wa" ]
592- vars = map_comparison (get, simdirs, short_names)
588+ vars = map_comparison (simdirs, short_names) do simdir, short_name
589+ var = get (simdir; short_name)
590+ # For vertical-only (FiniteDifferenceGrid) spaces, the data may have
591+ # extra singleton dimensions. Check and squeeze if needed.
592+ if haskey (var. dims, " x" ) && length (var. dims[" x" ]) == 1
593+ var = slice (var; x = var. dims[" x" ][1 ])
594+ end
595+ if haskey (var. dims, " y" ) && length (var. dims[" y" ]) == 1
596+ var = slice (var; y = var. dims[" y" ][1 ])
597+ end
598+ return var
599+ end
593600
594601 make_plots_generic (
595602 output_paths,
596603 vars,
597604 time = LAST_SNAP,
598- x = 0.0 , # Our columns are still 3D objects...
599- y = 0.0 ,
600605 MAX_NUM_COLS = length (simdirs),
601606 more_kwargs = YLINEARSCALE,
602607 )
@@ -644,7 +649,7 @@ function make_plots(
644649 end
645650
646651 vars = [
647- slice ( get (simdir; short_name), x = 0.0 , y = 0.0 ) for
652+ get (simdir; short_name) for
648653 short_name in short_names
649654 ]
650655
@@ -689,7 +694,7 @@ function make_plots(
689694 surface_precip = read_var (simdir. variable_paths[" pr" ][" inst" ][" 10s" ])
690695 viz. line_plot1D! (
691696 fig,
692- slice ( surface_precip, x = 0.0 , y = 0.0 ) ;
697+ surface_precip;
693698 p_loc = [pr_row, 1 : 3 ],
694699 )
695700
@@ -1371,6 +1376,12 @@ EDMFBoxPlots = Union{
13711376 Val{:diagnostic_edmfx_dycoms_rf01_box },
13721377 Val{:diagnostic_edmfx_trmm_box_0M },
13731378 Val{:diagnostic_edmfx_dycoms_rf01_explicit_box },
1379+ Val{:prognostic_edmfx_bomex_box },
1380+ Val{:rcemipii_box_diagnostic_edmfx },
1381+ Val{:diagnostic_edmfx_trmm_stretched_box },
1382+ }
1383+
1384+ EDMFColumnPlots = Union{
13741385 Val{:prognostic_edmfx_adv_test_column },
13751386 Val{:prognostic_edmfx_gabls_column },
13761387 Val{:prognostic_edmfx_gabls_column_sparse_autodiff },
@@ -1386,13 +1397,10 @@ EDMFBoxPlots = Union{
13861397 Val{:prognostic_edmfx_simpleplume_column },
13871398 Val{:prognostic_edmfx_gcmdriven_column },
13881399 Val{:prognostic_edmfx_tv_era5driven_column },
1389- Val{:prognostic_edmfx_bomex_box },
1390- Val{:rcemipii_box_diagnostic_edmfx },
13911400 Val{:prognostic_edmfx_soares_column },
1392- Val{:diagnostic_edmfx_trmm_stretched_box },
13931401}
13941402
1395- EDMFBoxPlotsWithPrecip = Union{
1403+ EDMFColumnPlotsWithPrecip = Union{
13961404 Val{:prognostic_edmfx_rico_column },
13971405 Val{:prognostic_edmfx_rico_implicit_column },
13981406 Val{:prognostic_edmfx_rico_column_2M },
@@ -1485,14 +1493,99 @@ end
14851493function make_plots (
14861494 sim_type:: Union {
14871495 EDMFBoxPlots,
1488- EDMFBoxPlotsWithPrecip,
14891496 DiagEDMFBoxPlotsWithPrecip,
14901497 },
14911498 output_paths:: Vector{<:AbstractString} ,
14921499)
14931500 simdirs = SimDir .(output_paths)
14941501
1495- if sim_type isa EDMFBoxPlotsWithPrecip
1502+ if sim_type isa DiagEDMFBoxPlotsWithPrecip
1503+ precip_names = (" husra" , " hussn" , " husraup" , " hussnup" )
1504+ else
1505+ precip_names = ()
1506+ end
1507+
1508+ short_names = [
1509+ " wa" ,
1510+ " waup" ,
1511+ " ta" ,
1512+ " taup" ,
1513+ " hus" ,
1514+ " husup" ,
1515+ " arup" ,
1516+ " tke" ,
1517+ " ua" ,
1518+ " thetaa" ,
1519+ " thetaaup" ,
1520+ " ha" ,
1521+ " haup" ,
1522+ " hur" ,
1523+ " hurup" ,
1524+ " lmix" ,
1525+ " cl" ,
1526+ " clw" ,
1527+ " clwup" ,
1528+ " cli" ,
1529+ " cliup" ,
1530+ precip_names... ,
1531+ ]
1532+ reduction = " inst"
1533+
1534+ available_periods = ClimaAnalysis. available_periods (
1535+ simdirs[1 ];
1536+ short_name = short_names[1 ],
1537+ reduction,
1538+ )
1539+ # choose the shortest available period
1540+ available_periods = collect (available_periods) # ensure vector for indexing
1541+ period = available_periods[argmin (CA. time_to_seconds .(available_periods))]
1542+
1543+ short_name_tuples = pair_edmf_names (short_names)
1544+ var_groups_zt =
1545+ map_comparison (simdirs, short_name_tuples) do simdir, name_tuple
1546+ return [
1547+ slice (
1548+ get (simdir; short_name, reduction, period),
1549+ x = 0.0 ,
1550+ y = 0.0 ,
1551+ ) for short_name in name_tuple
1552+ ]
1553+ end
1554+
1555+ var_groups_z = [
1556+ ([slice (v, time = LAST_SNAP) for v in group]. .. ,) for
1557+ group in var_groups_zt
1558+ ]
1559+
1560+ tmp_file = make_plots_generic (
1561+ output_paths,
1562+ output_name = " tmp" ,
1563+ var_groups_z;
1564+ plot_fn = plot_edmf_vert_profile!,
1565+ MAX_NUM_COLS = 2 ,
1566+ MAX_NUM_ROWS = 4 ,
1567+ )
1568+
1569+ make_plots_generic (
1570+ output_paths,
1571+ vcat (var_groups_zt... ),
1572+ plot_fn = plot_parsed_attribute_title!,
1573+ summary_files = [tmp_file],
1574+ MAX_NUM_COLS = 2 ,
1575+ MAX_NUM_ROWS = 4 ,
1576+ )
1577+ end
1578+
1579+ function make_plots (
1580+ sim_type:: Union {
1581+ EDMFColumnPlots,
1582+ EDMFColumnPlotsWithPrecip,
1583+ },
1584+ output_paths:: Vector{<:AbstractString} ,
1585+ )
1586+ simdirs = SimDir .(output_paths)
1587+
1588+ if sim_type isa EDMFColumnPlotsWithPrecip
14961589 if sim_type isa Val{:prognostic_edmfx_rico_column_2M }
14971590 precip_names = (
14981591 " husra" ,
@@ -1512,8 +1605,6 @@ function make_plots(
15121605 precip_names =
15131606 (" husra" , " hussn" , " husraup" , " hussnup" , " husraen" , " hussnen" )
15141607 end
1515- elseif sim_type isa DiagEDMFBoxPlotsWithPrecip
1516- precip_names = (" husra" , " hussn" , " husraup" , " hussnup" )
15171608 else
15181609 precip_names = ()
15191610 end
@@ -1557,11 +1648,7 @@ function make_plots(
15571648 var_groups_zt =
15581649 map_comparison (simdirs, short_name_tuples) do simdir, name_tuple
15591650 return [
1560- slice (
1561- get (simdir; short_name, reduction, period),
1562- x = 0.0 ,
1563- y = 0.0 ,
1564- ) for short_name in name_tuple
1651+ get (simdir; short_name, reduction, period) for short_name in name_tuple
15651652 ]
15661653 end
15671654
0 commit comments