@@ -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
@@ -1380,6 +1385,12 @@ EDMFBoxPlots = Union{
13801385 Val{:diagnostic_edmfx_dycoms_rf01_box },
13811386 Val{:diagnostic_edmfx_trmm_box_0M },
13821387 Val{:diagnostic_edmfx_dycoms_rf01_explicit_box },
1388+ Val{:prognostic_edmfx_bomex_box },
1389+ Val{:rcemipii_box_diagnostic_edmfx },
1390+ Val{:diagnostic_edmfx_trmm_stretched_box },
1391+ }
1392+
1393+ EDMFColumnPlots = Union{
13831394 Val{:prognostic_edmfx_adv_test_column },
13841395 Val{:prognostic_edmfx_gabls_column },
13851396 Val{:prognostic_edmfx_gabls_column_sparse_autodiff },
@@ -1395,13 +1406,10 @@ EDMFBoxPlots = Union{
13951406 Val{:prognostic_edmfx_simpleplume_column },
13961407 Val{:prognostic_edmfx_gcmdriven_column },
13971408 Val{:prognostic_edmfx_tv_era5driven_column },
1398- Val{:prognostic_edmfx_bomex_box },
1399- Val{:rcemipii_box_diagnostic_edmfx },
14001409 Val{:prognostic_edmfx_soares_column },
1401- Val{:diagnostic_edmfx_trmm_stretched_box },
14021410}
14031411
1404- EDMFBoxPlotsWithPrecip = Union{
1412+ EDMFColumnPlotsWithPrecip = Union{
14051413 Val{:prognostic_edmfx_rico_column },
14061414 Val{:prognostic_edmfx_rico_implicit_column },
14071415 Val{:prognostic_edmfx_rico_column_2M },
@@ -1493,14 +1501,99 @@ end
14931501function make_plots (
14941502 sim_type:: Union {
14951503 EDMFBoxPlots,
1496- EDMFBoxPlotsWithPrecip,
14971504 DiagEDMFBoxPlotsWithPrecip,
14981505 },
14991506 output_paths:: Vector{<:AbstractString} ,
15001507)
15011508 simdirs = SimDir .(output_paths)
15021509
1503- if sim_type isa EDMFBoxPlotsWithPrecip
1510+ if sim_type isa DiagEDMFBoxPlotsWithPrecip
1511+ precip_names = (" husra" , " hussn" , " husraup" , " hussnup" )
1512+ else
1513+ precip_names = ()
1514+ end
1515+
1516+ short_names = [
1517+ " wa" ,
1518+ " waup" ,
1519+ " ta" ,
1520+ " taup" ,
1521+ " hus" ,
1522+ " husup" ,
1523+ " arup" ,
1524+ " tke" ,
1525+ " ua" ,
1526+ " thetaa" ,
1527+ " thetaaup" ,
1528+ " ha" ,
1529+ " haup" ,
1530+ " hur" ,
1531+ " hurup" ,
1532+ " lmix" ,
1533+ " cl" ,
1534+ " clw" ,
1535+ " clwup" ,
1536+ " cli" ,
1537+ " cliup" ,
1538+ precip_names... ,
1539+ ]
1540+ reduction = " inst"
1541+
1542+ available_periods = ClimaAnalysis. available_periods (
1543+ simdirs[1 ];
1544+ short_name = short_names[1 ],
1545+ reduction,
1546+ )
1547+ # choose the shortest available period
1548+ available_periods = collect (available_periods) # ensure vector for indexing
1549+ period = available_periods[argmin (CA. time_to_seconds .(available_periods))]
1550+
1551+ short_name_tuples = pair_edmf_names (short_names)
1552+ var_groups_zt =
1553+ map_comparison (simdirs, short_name_tuples) do simdir, name_tuple
1554+ return [
1555+ slice (
1556+ get (simdir; short_name, reduction, period),
1557+ x = 0.0 ,
1558+ y = 0.0 ,
1559+ ) for short_name in name_tuple
1560+ ]
1561+ end
1562+
1563+ var_groups_z = [
1564+ ([slice (v, time = LAST_SNAP) for v in group]. .. ,) for
1565+ group in var_groups_zt
1566+ ]
1567+
1568+ tmp_file = make_plots_generic (
1569+ output_paths,
1570+ output_name = " tmp" ,
1571+ var_groups_z;
1572+ plot_fn = plot_edmf_vert_profile!,
1573+ MAX_NUM_COLS = 2 ,
1574+ MAX_NUM_ROWS = 4 ,
1575+ )
1576+
1577+ make_plots_generic (
1578+ output_paths,
1579+ vcat (var_groups_zt... ),
1580+ plot_fn = plot_parsed_attribute_title!,
1581+ summary_files = [tmp_file],
1582+ MAX_NUM_COLS = 2 ,
1583+ MAX_NUM_ROWS = 4 ,
1584+ )
1585+ end
1586+
1587+ function make_plots (
1588+ sim_type:: Union {
1589+ EDMFColumnPlots,
1590+ EDMFColumnPlotsWithPrecip,
1591+ },
1592+ output_paths:: Vector{<:AbstractString} ,
1593+ )
1594+ simdirs = SimDir .(output_paths)
1595+
1596+ if sim_type isa EDMFColumnPlotsWithPrecip
15041597 if sim_type isa Val{:prognostic_edmfx_rico_column_2M }
15051598 precip_names = (
15061599 " husra" ,
@@ -1520,8 +1613,6 @@ function make_plots(
15201613 precip_names =
15211614 (" husra" , " hussn" , " husraup" , " hussnup" , " husraen" , " hussnen" )
15221615 end
1523- elseif sim_type isa DiagEDMFBoxPlotsWithPrecip
1524- precip_names = (" husra" , " hussn" , " husraup" , " hussnup" )
15251616 else
15261617 precip_names = ()
15271618 end
@@ -1565,11 +1656,7 @@ function make_plots(
15651656 var_groups_zt =
15661657 map_comparison (simdirs, short_name_tuples) do simdir, name_tuple
15671658 return [
1568- slice (
1569- get (simdir; short_name, reduction, period),
1570- x = 0.0 ,
1571- y = 0.0 ,
1572- ) for short_name in name_tuple
1659+ get (simdir; short_name, reduction, period) for short_name in name_tuple
15731660 ]
15741661 end
15751662
0 commit comments