From 2599c62fc18adaf2f6a1377dbb9affe5ab6fc65b Mon Sep 17 00:00:00 2001 From: Zhaoyi Shen <11598433+szy21@users.noreply.github.com> Date: Sat, 7 Oct 2023 19:24:38 -0700 Subject: [PATCH] add advective edmf type --- .buildkite/pipeline.yml | 988 +++++++++--------- .../advective_edmfx_bomex_box.yml | 30 + .../advective_edmfx_gabls_box.yml | 30 + examples/hybrid/driver.jl | 1 + src/ClimaAtmos.jl | 1 + .../advective_edmf_precomputed_quantities.jl | 272 +++++ src/cache/precomputed_quantities.jl | 64 +- src/callbacks/callbacks.jl | 31 + src/initial_conditions/InitialConditions.jl | 1 + src/initial_conditions/atmos_state.jl | 21 + src/prognostic_equations/advection.jl | 107 +- src/prognostic_equations/edmfx_entr_detr.jl | 73 +- src/prognostic_equations/edmfx_sgs_flux.jl | 24 +- src/prognostic_equations/hyperdiffusion.jl | 2 + .../implicit/implicit_tendency.jl | 2 +- src/prognostic_equations/pressure_work.jl | 3 + src/prognostic_equations/zero_velocity.jl | 3 +- src/solver/model_getters.jl | 7 +- src/solver/types.jl | 10 + toml/edmfx_box.toml | 5 + 20 files changed, 1130 insertions(+), 545 deletions(-) create mode 100644 config/model_configs/advective_edmfx_bomex_box.yml create mode 100644 config/model_configs/advective_edmfx_gabls_box.yml create mode 100644 src/cache/advective_edmf_precomputed_quantities.jl diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 68f12985d48..a4912f47e0b 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -96,492 +96,492 @@ steps: command: "julia --color=yes --project=examples test/orographic_gravity_wave/ogwd_3d.jl" artifact_paths: "orographic_gravity_wave_test_3d/*" - - group: "Column Examples" - steps: - - - label: ":computer: single column hydrostatic balance float64" - command: > - julia --color=yes --project=examples examples/hybrid/driver.jl - --config_file $CONFIG_PATH/single_column_hydrostatic_balance_ft64.yml - artifact_paths: "single_column_hydrostatic_balance_ft64/*" - - - label: ":computer: single column radiative equilibrium gray" - command: > - julia --color=yes --project=examples examples/hybrid/driver.jl - --config_file $CONFIG_PATH/single_column_radiative_equilibrium_gray.yml - artifact_paths: "single_column_radiative_equilibrium_gray/*" - - - label: ":computer: single column radiative equilibrium clearsky" - command: > - julia --color=yes --project=examples examples/hybrid/driver.jl - --config_file $CONFIG_PATH/single_column_radiative_equilibrium_clearsky.yml - artifact_paths: "single_column_radiative_equilibrium_clearsky/*" - - - label: ":computer: single column radiative equilibrium clearsky prognostic surface temperature" - command: > - julia --color=yes --project=examples examples/hybrid/driver.jl - --config_file $CONFIG_PATH/single_column_radiative_equilibrium_clearsky_prognostic_surface_temp.yml - artifact_paths: "single_column_radiative_equilibrium_clearsky_prognostic_surface_temp/*" - - - label: ":computer: single column radiative equilibrium allsky idealized clouds varying insolation" - command: > - julia --color=yes --project=examples examples/hybrid/driver.jl - --config_file $CONFIG_PATH/single_column_radiative_equilibrium_allsky_idealized_clouds.yml - artifact_paths: "single_column_radiative_equilibrium_allsky_idealized_clouds/*" - - - label: ":computer: single column non-orographic gravity wave parameterization" - command: > - julia --color=yes --project=examples examples/hybrid/driver.jl - --config_file $CONFIG_PATH/single_column_nonorographic_gravity_wave.yml - - julia --color=yes --project=examples regression_tests/test_mse.jl - --job_id single_column_nonorographic_gravity_wave - --out_dir single_column_nonorographic_gravity_wave - artifact_paths: "single_column_nonorographic_gravity_wave/*" - - - group: "Box Examples" - steps: - - - label: ":computer: Box hydrostatic balance (ρe_tot)" - command: > - julia --color=yes --project=examples examples/hybrid/driver.jl - --config_file $CONFIG_PATH/box_hydrostatic_balance_rhoe.yml - artifact_paths: "box_hydrostatic_balance_rhoe/*" - - - label: ":computer: Bomex box (ρe_tot)" - command: > - julia --color=yes --project=examples examples/hybrid/driver.jl - --config_file $CONFIG_PATH/bomex_box_rhoe.yml - artifact_paths: "bomex_box_rhoe/*" - - - label: ":computer: 3D density current" - command: > - julia --color=yes --project=examples examples/hybrid/driver.jl - --config_file $CONFIG_PATH/box_density_current_test.yml - artifact_paths: box_density_current_test/*" - - - group: "Plane Examples" - steps: - - label: ":computer: Agnesi linear hydrostatic mountain experiment (uniform)" - command: > - julia --color=yes --project=examples examples/hybrid/driver.jl - --config_file $CONFIG_PATH/plane_agnesi_mountain_test_uniform.yml - artifact_paths: "plane_agnesi_mountain_test_uniform/*" - - - label: ":computer: Agnesi linear hydrostatic mountain experiment (stretched)" - command: > - julia --color=yes --project=examples examples/hybrid/driver.jl - --config_file $CONFIG_PATH/plane_agnesi_mountain_test_stretched.yml - artifact_paths: "plane_agnesi_mountain_test_stretched/*" - - - label: ":computer: Schar mountain experiment (uniform grid)" - command: > - julia --color=yes --project=examples examples/hybrid/driver.jl - --config_file $CONFIG_PATH/plane_schar_mountain_test_uniform.yml - artifact_paths: "plane_schar_mountain_test_uniform/*" - - - label: ":computer: Schar mountain experiment (stretched grid)" - command: > - julia --color=yes --project=examples examples/hybrid/driver.jl - --config_file $CONFIG_PATH/plane_schar_mountain_test_stretched.yml - artifact_paths: "plane_schar_mountain_test_stretched/*" - - - label: ":computer: Density current experiment" - command: > - julia --color=yes --project=examples examples/hybrid/driver.jl - --config_file $CONFIG_PATH/plane_density_current_test.yml - artifact_paths: "plane_density_current_test/*" - - - - group: "Sphere Examples (Dycore)" - steps: - - - label: ":computer: hydrostatic balance (ρe) float64" - command: > - julia --color=yes --project=examples examples/hybrid/driver.jl - --config_file $CONFIG_PATH/sphere_hydrostatic_balance_rhoe_ft64.yml - - julia --color=yes --project=examples post_processing/remap/remap_pipeline.jl - --data_dir sphere_hydrostatic_balance_rhoe_ft64 - --out_dir sphere_hydrostatic_balance_rhoe_ft64 - - julia --color=yes --project=examples post_processing/plot/plot_pipeline.jl - --nc_dir sphere_hydrostatic_balance_rhoe_ft64 - --fig_dir sphere_hydrostatic_balance_rhoe_ft64 - --case_name dry_held_suarez - artifact_paths: "sphere_hydrostatic_balance_rhoe_ft64/*" - agents: - slurm_mem: 20GB - - - label: ":computer: baroclinic wave (ρe)" - key: sphere_baroclinic_wave_rhoe - command: > - julia --color=yes --project=examples examples/hybrid/driver.jl - --config_file $CONFIG_PATH/sphere_baroclinic_wave_rhoe.yml - - julia --color=yes --project=examples post_processing/remap/remap_pipeline.jl - --data_dir sphere_baroclinic_wave_rhoe --out_dir sphere_baroclinic_wave_rhoe - - julia --color=yes --project=examples post_processing/plot/plot_pipeline.jl - --nc_dir sphere_baroclinic_wave_rhoe --fig_dir sphere_baroclinic_wave_rhoe - --case_name dry_baroclinic_wave - - julia --color=yes --project=examples regression_tests/test_mse.jl - --job_id sphere_baroclinic_wave_rhoe --out_dir sphere_baroclinic_wave_rhoe - artifact_paths: "sphere_baroclinic_wave_rhoe/*" - - - label: ":computer: no lim ARS baroclinic wave (ρe) equilmoist" - command: > - julia --color=yes --project=examples examples/hybrid/driver.jl - --config_file $CONFIG_PATH/sphere_baroclinic_wave_rhoe_equilmoist.yml - - julia --color=yes --project=examples post_processing/remap/remap_pipeline.jl - --data_dir sphere_baroclinic_wave_rhoe_equilmoist - --out_dir sphere_baroclinic_wave_rhoe_equilmoist - - julia --color=yes --project=examples post_processing/plot/plot_pipeline.jl - --nc_dir sphere_baroclinic_wave_rhoe_equilmoist - --fig_dir sphere_baroclinic_wave_rhoe_equilmoist --case_name moist_baroclinic_wave - - julia --color=yes --project=examples regression_tests/test_mse.jl - --job_id sphere_baroclinic_wave_rhoe_equilmoist - --out_dir sphere_baroclinic_wave_rhoe_equilmoist - artifact_paths: "sphere_baroclinic_wave_rhoe_equilmoist/*" + # - group: "Column Examples" + # steps: + + # - label: ":computer: single column hydrostatic balance float64" + # command: > + # julia --color=yes --project=examples examples/hybrid/driver.jl + # --config_file $CONFIG_PATH/single_column_hydrostatic_balance_ft64.yml + # artifact_paths: "single_column_hydrostatic_balance_ft64/*" + + # - label: ":computer: single column radiative equilibrium gray" + # command: > + # julia --color=yes --project=examples examples/hybrid/driver.jl + # --config_file $CONFIG_PATH/single_column_radiative_equilibrium_gray.yml + # artifact_paths: "single_column_radiative_equilibrium_gray/*" + + # - label: ":computer: single column radiative equilibrium clearsky" + # command: > + # julia --color=yes --project=examples examples/hybrid/driver.jl + # --config_file $CONFIG_PATH/single_column_radiative_equilibrium_clearsky.yml + # artifact_paths: "single_column_radiative_equilibrium_clearsky/*" + + # - label: ":computer: single column radiative equilibrium clearsky prognostic surface temperature" + # command: > + # julia --color=yes --project=examples examples/hybrid/driver.jl + # --config_file $CONFIG_PATH/single_column_radiative_equilibrium_clearsky_prognostic_surface_temp.yml + # artifact_paths: "single_column_radiative_equilibrium_clearsky_prognostic_surface_temp/*" + + # - label: ":computer: single column radiative equilibrium allsky idealized clouds varying insolation" + # command: > + # julia --color=yes --project=examples examples/hybrid/driver.jl + # --config_file $CONFIG_PATH/single_column_radiative_equilibrium_allsky_idealized_clouds.yml + # artifact_paths: "single_column_radiative_equilibrium_allsky_idealized_clouds/*" + + # - label: ":computer: single column non-orographic gravity wave parameterization" + # command: > + # julia --color=yes --project=examples examples/hybrid/driver.jl + # --config_file $CONFIG_PATH/single_column_nonorographic_gravity_wave.yml + + # julia --color=yes --project=examples regression_tests/test_mse.jl + # --job_id single_column_nonorographic_gravity_wave + # --out_dir single_column_nonorographic_gravity_wave + # artifact_paths: "single_column_nonorographic_gravity_wave/*" + + # - group: "Box Examples" + # steps: + + # - label: ":computer: Box hydrostatic balance (ρe_tot)" + # command: > + # julia --color=yes --project=examples examples/hybrid/driver.jl + # --config_file $CONFIG_PATH/box_hydrostatic_balance_rhoe.yml + # artifact_paths: "box_hydrostatic_balance_rhoe/*" + + # - label: ":computer: Bomex box (ρe_tot)" + # command: > + # julia --color=yes --project=examples examples/hybrid/driver.jl + # --config_file $CONFIG_PATH/bomex_box_rhoe.yml + # artifact_paths: "bomex_box_rhoe/*" + + # - label: ":computer: 3D density current" + # command: > + # julia --color=yes --project=examples examples/hybrid/driver.jl + # --config_file $CONFIG_PATH/box_density_current_test.yml + # artifact_paths: box_density_current_test/*" + + # - group: "Plane Examples" + # steps: + # - label: ":computer: Agnesi linear hydrostatic mountain experiment (uniform)" + # command: > + # julia --color=yes --project=examples examples/hybrid/driver.jl + # --config_file $CONFIG_PATH/plane_agnesi_mountain_test_uniform.yml + # artifact_paths: "plane_agnesi_mountain_test_uniform/*" + + # - label: ":computer: Agnesi linear hydrostatic mountain experiment (stretched)" + # command: > + # julia --color=yes --project=examples examples/hybrid/driver.jl + # --config_file $CONFIG_PATH/plane_agnesi_mountain_test_stretched.yml + # artifact_paths: "plane_agnesi_mountain_test_stretched/*" + + # - label: ":computer: Schar mountain experiment (uniform grid)" + # command: > + # julia --color=yes --project=examples examples/hybrid/driver.jl + # --config_file $CONFIG_PATH/plane_schar_mountain_test_uniform.yml + # artifact_paths: "plane_schar_mountain_test_uniform/*" + + # - label: ":computer: Schar mountain experiment (stretched grid)" + # command: > + # julia --color=yes --project=examples examples/hybrid/driver.jl + # --config_file $CONFIG_PATH/plane_schar_mountain_test_stretched.yml + # artifact_paths: "plane_schar_mountain_test_stretched/*" + + # - label: ":computer: Density current experiment" + # command: > + # julia --color=yes --project=examples examples/hybrid/driver.jl + # --config_file $CONFIG_PATH/plane_density_current_test.yml + # artifact_paths: "plane_density_current_test/*" + + + # - group: "Sphere Examples (Dycore)" + # steps: + + # - label: ":computer: hydrostatic balance (ρe) float64" + # command: > + # julia --color=yes --project=examples examples/hybrid/driver.jl + # --config_file $CONFIG_PATH/sphere_hydrostatic_balance_rhoe_ft64.yml + + # julia --color=yes --project=examples post_processing/remap/remap_pipeline.jl + # --data_dir sphere_hydrostatic_balance_rhoe_ft64 + # --out_dir sphere_hydrostatic_balance_rhoe_ft64 + + # julia --color=yes --project=examples post_processing/plot/plot_pipeline.jl + # --nc_dir sphere_hydrostatic_balance_rhoe_ft64 + # --fig_dir sphere_hydrostatic_balance_rhoe_ft64 + # --case_name dry_held_suarez + # artifact_paths: "sphere_hydrostatic_balance_rhoe_ft64/*" + # agents: + # slurm_mem: 20GB + + # - label: ":computer: baroclinic wave (ρe)" + # key: sphere_baroclinic_wave_rhoe + # command: > + # julia --color=yes --project=examples examples/hybrid/driver.jl + # --config_file $CONFIG_PATH/sphere_baroclinic_wave_rhoe.yml + + # julia --color=yes --project=examples post_processing/remap/remap_pipeline.jl + # --data_dir sphere_baroclinic_wave_rhoe --out_dir sphere_baroclinic_wave_rhoe + + # julia --color=yes --project=examples post_processing/plot/plot_pipeline.jl + # --nc_dir sphere_baroclinic_wave_rhoe --fig_dir sphere_baroclinic_wave_rhoe + # --case_name dry_baroclinic_wave + + # julia --color=yes --project=examples regression_tests/test_mse.jl + # --job_id sphere_baroclinic_wave_rhoe --out_dir sphere_baroclinic_wave_rhoe + # artifact_paths: "sphere_baroclinic_wave_rhoe/*" + + # - label: ":computer: no lim ARS baroclinic wave (ρe) equilmoist" + # command: > + # julia --color=yes --project=examples examples/hybrid/driver.jl + # --config_file $CONFIG_PATH/sphere_baroclinic_wave_rhoe_equilmoist.yml + + # julia --color=yes --project=examples post_processing/remap/remap_pipeline.jl + # --data_dir sphere_baroclinic_wave_rhoe_equilmoist + # --out_dir sphere_baroclinic_wave_rhoe_equilmoist + + # julia --color=yes --project=examples post_processing/plot/plot_pipeline.jl + # --nc_dir sphere_baroclinic_wave_rhoe_equilmoist + # --fig_dir sphere_baroclinic_wave_rhoe_equilmoist --case_name moist_baroclinic_wave + + # julia --color=yes --project=examples regression_tests/test_mse.jl + # --job_id sphere_baroclinic_wave_rhoe_equilmoist + # --out_dir sphere_baroclinic_wave_rhoe_equilmoist + # artifact_paths: "sphere_baroclinic_wave_rhoe_equilmoist/*" - - label: ":computer: no lim ARS baroclinic wave (ρe) equilmoist explicit vertdiff" - command: > - julia --color=yes --project=examples examples/hybrid/driver.jl - --config_file $CONFIG_PATH/sphere_baroclinic_wave_rhoe_equilmoist_expvdiff.yml - - julia --color=yes --project=examples post_processing/remap/remap_pipeline.jl - --data_dir sphere_baroclinic_wave_rhoe_equilmoist_expvdiff - --out_dir sphere_baroclinic_wave_rhoe_equilmoist_expvdiff - - julia --color=yes --project=examples post_processing/plot/plot_pipeline.jl - --nc_dir sphere_baroclinic_wave_rhoe_equilmoist_expvdiff - --fig_dir sphere_baroclinic_wave_rhoe_equilmoist_expvdiff --case_name aquaplanet - artifact_paths: "sphere_baroclinic_wave_rhoe_equilmoist_expvdiff/*" - - - label: ":computer: SSP zalesak tracer & energy upwind baroclinic wave (ρe_tot) equilmoist" - command: > - julia --color=yes --project=examples examples/hybrid/driver.jl - --config_file $CONFIG_PATH/$$JOB_NAME.yml - - julia --color=yes --project=examples post_processing/remap/remap_pipeline.jl - --data_dir $$JOB_NAME - --out_dir $$JOB_NAME - - julia --color=yes --project=examples post_processing/plot/plot_pipeline.jl - --nc_dir $$JOB_NAME - --fig_dir $$JOB_NAME --case_name moist_baroclinic_wave - - julia --color=yes --project=examples regression_tests/test_mse.jl --job_id $$JOB_NAME --out_dir $$JOB_NAME - artifact_paths: "$$JOB_NAME/*" - agents: - slurm_mem: 64GB - env: - JOB_NAME: "sphere_zalesak_upwind_tracer_energy_ssp_baroclinic_wave_rhoe_equilmoist" - - - label: ":computer: no lim ARS baroclinic wave (ρe) equilmoist check conservation float64" - command: "julia --color=yes --project=examples examples/hybrid/driver.jl --config_file $CONFIG_PATH/sphere_baroclinic_wave_rhoe_equilmoist_conservation_ft64.yml" - artifact_paths: "sphere_baroclinic_wave_rhoe_equilmoist_conservation_ft64/*" - - - label: ":computer: held suarez (ρθ)" - command: > - julia --color=yes --project=examples examples/hybrid/driver.jl - --config_file $CONFIG_PATH/sphere_held_suarez_rhotheta.yml - - julia --color=yes --project=examples post_processing/remap/remap_pipeline.jl - --data_dir sphere_held_suarez_rhotheta --out_dir sphere_held_suarez_rhotheta - - julia --color=yes --project=examples post_processing/plot/plot_pipeline.jl - --nc_dir sphere_held_suarez_rhotheta --fig_dir sphere_held_suarez_rhotheta - --case_name dry_held_suarez - - julia --color=yes --project=examples regression_tests/test_mse.jl - --job_id sphere_held_suarez_rhotheta --out_dir sphere_held_suarez_rhotheta - artifact_paths: "sphere_held_suarez_rhotheta/*" - - - label: ":computer: held suarez (ρe) hightop" - key: sphere_held_suarez_rhoe_hightop - command: > - julia --color=yes --project=examples examples/hybrid/driver.jl - --config_file $CONFIG_PATH/sphere_held_suarez_rhoe_hightop.yml - - julia --color=yes --project=examples post_processing/remap/remap_pipeline.jl - --data_dir sphere_held_suarez_rhoe_hightop --out_dir sphere_held_suarez_rhoe_hightop - - julia --color=yes --project=examples post_processing/plot/plot_pipeline.jl - --nc_dir sphere_held_suarez_rhoe_hightop --fig_dir sphere_held_suarez_rhoe_hightop - --case_name dry_held_suarez - - julia --color=yes --project=examples regression_tests/test_mse.jl - --job_id sphere_held_suarez_rhoe_hightop --out_dir sphere_held_suarez_rhoe_hightop - artifact_paths: "sphere_held_suarez_rhoe_hightop/*" - - - label: ":computer: no lim ARS held suarez (ρe) equilmoist hightop sponge" - command: > - julia --color=yes --project=examples examples/hybrid/driver.jl - --config_file $CONFIG_PATH/sphere_held_suarez_rhoe_equilmoist_hightop_sponge.yml - - julia --color=yes --project=examples post_processing/remap/remap_pipeline.jl - --data_dir sphere_held_suarez_rhoe_equilmoist_hightop_sponge - --out_dir sphere_held_suarez_rhoe_equilmoist_hightop_sponge - - julia --color=yes --project=examples post_processing/plot/plot_pipeline.jl - --nc_dir sphere_held_suarez_rhoe_equilmoist_hightop_sponge - --fig_dir sphere_held_suarez_rhoe_equilmoist_hightop_sponge --case_name moist_held_suarez - - julia --color=yes --project=examples regression_tests/test_mse.jl - --job_id sphere_held_suarez_rhoe_equilmoist_hightop_sponge - --out_dir sphere_held_suarez_rhoe_equilmoist_hightop_sponge - artifact_paths: "sphere_held_suarez_rhoe_equilmoist_hightop_sponge/*" - - - group: "Sphere Examples (Aquaplanet)" - steps: - - - label: ":computer: aquaplanet (ρe_tot) equilmoist allsky radiation monin_obukhov varying insolation gravity wave (gfdl_restart) high top" - command: > - julia --color=yes --project=examples examples/hybrid/driver.jl - --config_file $CONFIG_PATH/sphere_aquaplanet_rhoe_equilmoist_allsky_gw_res.yml - - julia --color=yes --project=examples post_processing/remap/remap_pipeline.jl - --data_dir sphere_aquaplanet_rhoe_equilmoist_allsky_gw_res - --out_dir sphere_aquaplanet_rhoe_equilmoist_allsky_gw_res - - julia --color=yes --project=examples post_processing/plot/plot_pipeline.jl - --nc_dir sphere_aquaplanet_rhoe_equilmoist_allsky_gw_res - --fig_dir sphere_aquaplanet_rhoe_equilmoist_allsky_gw_res --case_name aquaplanet - - julia --color=yes --project=examples regression_tests/test_mse.jl - --job_id sphere_aquaplanet_rhoe_equilmoist_allsky_gw_res - --out_dir sphere_aquaplanet_rhoe_equilmoist_allsky_gw_res - artifact_paths: "sphere_aquaplanet_rhoe_equilmoist_allsky_gw_res/*" - agents: - slurm_mem: 20GB - - - label: ":computer: aquaplanet (ρe_tot) equilmoist with EDMF" - command: > - julia --color=yes --project=examples examples/hybrid/driver.jl - --config_file $CONFIG_PATH/sphere_baroclinic_wave_rhoe_equilmoist_edmf.yml - - julia --color=yes --project=examples post_processing/remap/remap_pipeline.jl - --data_dir sphere_baroclinic_wave_rhoe_equilmoist_edmf - --out_dir sphere_baroclinic_wave_rhoe_equilmoist_edmf - - julia --color=yes --project=examples post_processing/plot/plot_pipeline.jl - --nc_dir sphere_baroclinic_wave_rhoe_equilmoist_edmf - --fig_dir sphere_baroclinic_wave_rhoe_equilmoist_edmf --case_name dry_held_suarez - artifact_paths: "sphere_baroclinic_wave_rhoe_equilmoist_edmf/*" - agents: - slurm_mem: 20GB - - - label: ":computer: aquaplanet (ρe_tot) equilmoist allsky radiation monin_obukhov varying insolation gravity wave (raw_topo) high top zonally asymmetric" - command: > - julia --color=yes --project=examples examples/hybrid/driver.jl - --config_file $CONFIG_PATH/sphere_aquaplanet_rhoe_equilmoist_allsky_gw_raw_zonallyasymmetric.yml - - julia --color=yes --project=examples post_processing/remap/remap_pipeline.jl - --data_dir sphere_aquaplanet_rhoe_equilmoist_allsky_gw_raw_zonallyasymmetric - --out_dir sphere_aquaplanet_rhoe_equilmoist_allsky_gw_raw_zonallyasymmetric - - julia --color=yes --project=examples post_processing/plot/plot_pipeline.jl - --nc_dir sphere_aquaplanet_rhoe_equilmoist_allsky_gw_raw_zonallyasymmetric - --fig_dir sphere_aquaplanet_rhoe_equilmoist_allsky_gw_raw_zonallyasymmetric - --case_name aquaplanet - - julia --color=yes --project=examples regression_tests/test_mse.jl - --job_id sphere_aquaplanet_rhoe_equilmoist_allsky_gw_raw_zonallyasymmetric - --out_dir sphere_aquaplanet_rhoe_equilmoist_allsky_gw_raw_zonallyasymmetric - artifact_paths: "sphere_aquaplanet_rhoe_equilmoist_allsky_gw_raw_zonallyasymmetric/*" - agents: - slurm_mem: 20GB - - - group: "Sphere Examples (Topography)" - steps: - - - label: ":computer: baroclinic wave (ρe) topography (dcmip)" - command: > - julia --color=yes --project=examples examples/hybrid/driver.jl - --config_file $CONFIG_PATH/sphere_baroclinic_wave_rhoe_topography_dcmip_rs.yml - - julia --color=yes --project=examples post_processing/remap/remap_pipeline.jl - --data_dir sphere_baroclinic_wave_rhoe_topography_dcmip_rs - --out_dir sphere_baroclinic_wave_rhoe_topography_dcmip_rs - artifact_paths: "sphere_baroclinic_wave_rhoe_topography_dcmip_rs/*" - - - label: ":computer: held suarez (ρe) topography (dcmip)" - command: > - julia --color=yes --project=examples examples/hybrid/driver.jl - --config_file $CONFIG_PATH/sphere_held_suarez_rhoe_topography_dcmip.yml - - julia --color=yes --project=examples post_processing/remap/remap_pipeline.jl - --data_dir sphere_held_suarez_rhoe_topography_dcmip - --out_dir sphere_held_suarez_rhoe_topography_dcmip - artifact_paths: "sphere_held_suarez_rhoe_topography_dcmip/*" - - - label: ":computer: held suarez (ρe) equilmoist topography (dcmip)" - command: > - julia --color=yes --project=examples examples/hybrid/driver.jl - --config_file $CONFIG_PATH/sphere_held_suarez_rhoe_equilmoist_topography_dcmip.yml - - julia --color=yes --project=examples post_processing/remap/remap_pipeline.jl - --data_dir sphere_held_suarez_rhoe_equilmoist_topography_dcmip - --out_dir sphere_held_suarez_rhoe_equilmoist_topography_dcmip - artifact_paths: "sphere_held_suarez_rhoe_equilmoist_topography_dcmip/*" - agents: - slurm_mem: 20GB - - - label: ":computer: Diagnostic DCMIP200 surface elevation spectra" - command: > - julia --color=yes --project=examples examples/hybrid/driver.jl - --config_file $CONFIG_PATH/sphere_ssp_baroclinic_wave_rhoe_equilmoist_dcmip200.yml - - julia --color=yes --project=examples post_processing/remap/remap_pipeline.jl - --data_dir sphere_ssp_baroclinic_wave_rhoe_equilmoist_dcmip200 - --out_dir sphere_ssp_baroclinic_wave_rhoe_equilmoist_dcmip200 - - julia --color=yes --project=examples post_processing/plot/plot_pipeline.jl - --nc_dir sphere_ssp_baroclinic_wave_rhoe_equilmoist_dcmip200 - --fig_dir sphere_ssp_baroclinic_wave_rhoe_equilmoist_dcmip200 - --case_name elevation_spectrum - artifact_paths: "sphere_ssp_baroclinic_wave_rhoe_equilmoist_dcmip200/*" - - - label: ":computer: Diagnostic Earth surface elevation spectra" - command: > - julia --color=yes --project=examples examples/hybrid/driver.jl - --config_file $CONFIG_PATH/sphere_ssp_baroclinic_wave_rhoe_equilmoist_earth.yml - - julia --color=yes --project=examples post_processing/remap/remap_pipeline.jl - --data_dir sphere_ssp_baroclinic_wave_rhoe_equilmoist_earth - --out_dir sphere_ssp_baroclinic_wave_rhoe_equilmoist_earth - - julia --color=yes --project=examples post_processing/plot/plot_pipeline.jl - --nc_dir sphere_ssp_baroclinic_wave_rhoe_equilmoist_earth - --fig_dir sphere_ssp_baroclinic_wave_rhoe_equilmoist_earth - --case_name elevation_spectrum - artifact_paths: "sphere_ssp_baroclinic_wave_rhoe_equilmoist_earth/*" - - - group: "MPI Examples" - steps: - - - label: ":computer: Prep restart for MPI" - key: "mpi_baro_wave_make_restart" - command: > - srun julia --color=yes --project=examples examples/hybrid/driver.jl - --config_file $MPI_CONFIG_PATH/mpi_make_restart.yml - artifact_paths: "mpi_make_restart/*" - env: - CLIMACORE_DISTRIBUTED: "MPI" - agents: - slurm_ntasks: 2 - slurm_mem: 16G - - - label: ":computer: Test restart for MPI baroclinic wave" - key: "restart_mpi_baro_wave" - depends_on: "mpi_baro_wave_make_restart" - command: > - srun julia --color=yes --project=examples examples/hybrid/driver.jl - --config_file $MPI_CONFIG_PATH/restart_mpi_baroclinic_wave_rhoe.yml - artifact_paths: "restart_mpi_baroclinic_wave_rhoe/*" - env: - CLIMACORE_DISTRIBUTED: "MPI" - RESTART_FILE: "mpi_make_restart/restart/day5.0.hdf5" - agents: - slurm_ntasks: 2 - slurm_mem: 16G - timeout_in_minutes: 20 - soft_fail: true - #retry: - # automatic: true - - - label: ":computer: MPI no lim ARS aquaplanet (ρe) equilmoist clearsky radiation" - command: > - srun julia --color=yes --project=examples examples/hybrid/driver.jl - --config_file $MPI_CONFIG_PATH/mpi_sphere_aquaplanet_rhoe_equilmoist_clearsky.yml - artifact_paths: "mpi_sphere_aquaplanet_rhoe_equilmoist_clearsky/*" - env: - CLIMACORE_DISTRIBUTED: "MPI" - agents: - slurm_ntasks: 2 - slurm_mem: 16GB - - - label: ":computer: Prep for calling remap pipeline" - key: "prep_remap" - command: > - srun julia --color=yes --project=examples examples/hybrid/driver.jl - --config_file $MPI_CONFIG_PATH/prep_remap.yml - artifact_paths: "prep_remap/*" - env: - CLIMACORE_DISTRIBUTED: "MPI" - agents: - slurm_ntasks: 2 - slurm_mem: 16G - - - label: ":computer: Exercise remap pipeline" - key: "remap_pipeline" - depends_on: "prep_remap" - command: > - julia --color=yes --project=examples post_processing/remap/remap_pipeline.jl - --data_dir prep_remap/ --out_dir remap_pipeline_output - artifact_paths: "remap_pipeline_output/*" - - - label: ":computer: Exercise parallel remap pipeline" - key: "parallel_remap_pipeline" - depends_on: "remap_pipeline" - command: > - julia -p 4 --color=yes --project=examples post_processing/remap/remap_pipeline_parallel.jl - --data_dir prep_remap/ --out_dir parallel_remap_pipeline_output - artifact_paths: "parallel_remap_pipeline_output/*" - agents: - slurm_ntasks: 5 - - - group: "Configs" - steps: - - - label: ":computer: Test IO" - command: > - julia --color=yes --project=examples --threads=8 examples/hybrid/driver.jl - --config_file $CONFIG_PATH/test_io.yml - artifact_paths: "test_io/*" - - - label: ":computer: Use test env with latest deps" - command: > - julia --color=yes --project=test examples/hybrid/driver.jl - --config_file $CONFIG_PATH/test_env.yml - artifact_paths: "test_env/*" - soft_fail: true - agents: - slurm_mem: 20GB - - - label: ":computer: MPI io test" - command: > - srun julia --color=yes --project=examples examples/hybrid/driver.jl - --config_file $CONFIG_PATH/test_mpi_io.yml - artifact_paths: "test_mpi_io/*" - env: - CLIMACORE_DISTRIBUTED: "MPI" - agents: - slurm_ntasks: 2 - slurm_mem: 16G - - # TODO: we should somehow decouple this unit test from the perf env / scripts - - label: ":computer: checkbounds" - command: > - julia --color=yes --check-bounds=yes --project=perf perf/benchmark.jl - $PERF_CONFIG_PATH/checkbounds.yml - artifact_paths: "checkbounds/*" - agents: - slurm_mem: 20GB - - - label: ":dart: Dycore Consistency test" - command: > - julia --color=yes --project=examples examples/hybrid/driver.jl - --config_file $CONFIG_PATH/dycore_consistency.yml - artifact_paths: "dycore_consistency/*" - soft_fail: true - agents: - slurm_mem: 20GB + # - label: ":computer: no lim ARS baroclinic wave (ρe) equilmoist explicit vertdiff" + # command: > + # julia --color=yes --project=examples examples/hybrid/driver.jl + # --config_file $CONFIG_PATH/sphere_baroclinic_wave_rhoe_equilmoist_expvdiff.yml + + # julia --color=yes --project=examples post_processing/remap/remap_pipeline.jl + # --data_dir sphere_baroclinic_wave_rhoe_equilmoist_expvdiff + # --out_dir sphere_baroclinic_wave_rhoe_equilmoist_expvdiff + + # julia --color=yes --project=examples post_processing/plot/plot_pipeline.jl + # --nc_dir sphere_baroclinic_wave_rhoe_equilmoist_expvdiff + # --fig_dir sphere_baroclinic_wave_rhoe_equilmoist_expvdiff --case_name aquaplanet + # artifact_paths: "sphere_baroclinic_wave_rhoe_equilmoist_expvdiff/*" + + # - label: ":computer: SSP zalesak tracer & energy upwind baroclinic wave (ρe_tot) equilmoist" + # command: > + # julia --color=yes --project=examples examples/hybrid/driver.jl + # --config_file $CONFIG_PATH/$$JOB_NAME.yml + + # julia --color=yes --project=examples post_processing/remap/remap_pipeline.jl + # --data_dir $$JOB_NAME + # --out_dir $$JOB_NAME + + # julia --color=yes --project=examples post_processing/plot/plot_pipeline.jl + # --nc_dir $$JOB_NAME + # --fig_dir $$JOB_NAME --case_name moist_baroclinic_wave + + # julia --color=yes --project=examples regression_tests/test_mse.jl --job_id $$JOB_NAME --out_dir $$JOB_NAME + # artifact_paths: "$$JOB_NAME/*" + # agents: + # slurm_mem: 64GB + # env: + # JOB_NAME: "sphere_zalesak_upwind_tracer_energy_ssp_baroclinic_wave_rhoe_equilmoist" + + # - label: ":computer: no lim ARS baroclinic wave (ρe) equilmoist check conservation float64" + # command: "julia --color=yes --project=examples examples/hybrid/driver.jl --config_file $CONFIG_PATH/sphere_baroclinic_wave_rhoe_equilmoist_conservation_ft64.yml" + # artifact_paths: "sphere_baroclinic_wave_rhoe_equilmoist_conservation_ft64/*" + + # - label: ":computer: held suarez (ρθ)" + # command: > + # julia --color=yes --project=examples examples/hybrid/driver.jl + # --config_file $CONFIG_PATH/sphere_held_suarez_rhotheta.yml + + # julia --color=yes --project=examples post_processing/remap/remap_pipeline.jl + # --data_dir sphere_held_suarez_rhotheta --out_dir sphere_held_suarez_rhotheta + + # julia --color=yes --project=examples post_processing/plot/plot_pipeline.jl + # --nc_dir sphere_held_suarez_rhotheta --fig_dir sphere_held_suarez_rhotheta + # --case_name dry_held_suarez + + # julia --color=yes --project=examples regression_tests/test_mse.jl + # --job_id sphere_held_suarez_rhotheta --out_dir sphere_held_suarez_rhotheta + # artifact_paths: "sphere_held_suarez_rhotheta/*" + + # - label: ":computer: held suarez (ρe) hightop" + # key: sphere_held_suarez_rhoe_hightop + # command: > + # julia --color=yes --project=examples examples/hybrid/driver.jl + # --config_file $CONFIG_PATH/sphere_held_suarez_rhoe_hightop.yml + + # julia --color=yes --project=examples post_processing/remap/remap_pipeline.jl + # --data_dir sphere_held_suarez_rhoe_hightop --out_dir sphere_held_suarez_rhoe_hightop + + # julia --color=yes --project=examples post_processing/plot/plot_pipeline.jl + # --nc_dir sphere_held_suarez_rhoe_hightop --fig_dir sphere_held_suarez_rhoe_hightop + # --case_name dry_held_suarez + + # julia --color=yes --project=examples regression_tests/test_mse.jl + # --job_id sphere_held_suarez_rhoe_hightop --out_dir sphere_held_suarez_rhoe_hightop + # artifact_paths: "sphere_held_suarez_rhoe_hightop/*" + + # - label: ":computer: no lim ARS held suarez (ρe) equilmoist hightop sponge" + # command: > + # julia --color=yes --project=examples examples/hybrid/driver.jl + # --config_file $CONFIG_PATH/sphere_held_suarez_rhoe_equilmoist_hightop_sponge.yml + + # julia --color=yes --project=examples post_processing/remap/remap_pipeline.jl + # --data_dir sphere_held_suarez_rhoe_equilmoist_hightop_sponge + # --out_dir sphere_held_suarez_rhoe_equilmoist_hightop_sponge + + # julia --color=yes --project=examples post_processing/plot/plot_pipeline.jl + # --nc_dir sphere_held_suarez_rhoe_equilmoist_hightop_sponge + # --fig_dir sphere_held_suarez_rhoe_equilmoist_hightop_sponge --case_name moist_held_suarez + + # julia --color=yes --project=examples regression_tests/test_mse.jl + # --job_id sphere_held_suarez_rhoe_equilmoist_hightop_sponge + # --out_dir sphere_held_suarez_rhoe_equilmoist_hightop_sponge + # artifact_paths: "sphere_held_suarez_rhoe_equilmoist_hightop_sponge/*" + + # - group: "Sphere Examples (Aquaplanet)" + # steps: + + # - label: ":computer: aquaplanet (ρe_tot) equilmoist allsky radiation monin_obukhov varying insolation gravity wave (gfdl_restart) high top" + # command: > + # julia --color=yes --project=examples examples/hybrid/driver.jl + # --config_file $CONFIG_PATH/sphere_aquaplanet_rhoe_equilmoist_allsky_gw_res.yml + + # julia --color=yes --project=examples post_processing/remap/remap_pipeline.jl + # --data_dir sphere_aquaplanet_rhoe_equilmoist_allsky_gw_res + # --out_dir sphere_aquaplanet_rhoe_equilmoist_allsky_gw_res + + # julia --color=yes --project=examples post_processing/plot/plot_pipeline.jl + # --nc_dir sphere_aquaplanet_rhoe_equilmoist_allsky_gw_res + # --fig_dir sphere_aquaplanet_rhoe_equilmoist_allsky_gw_res --case_name aquaplanet + + # julia --color=yes --project=examples regression_tests/test_mse.jl + # --job_id sphere_aquaplanet_rhoe_equilmoist_allsky_gw_res + # --out_dir sphere_aquaplanet_rhoe_equilmoist_allsky_gw_res + # artifact_paths: "sphere_aquaplanet_rhoe_equilmoist_allsky_gw_res/*" + # agents: + # slurm_mem: 20GB + + # - label: ":computer: aquaplanet (ρe_tot) equilmoist with EDMF" + # command: > + # julia --color=yes --project=examples examples/hybrid/driver.jl + # --config_file $CONFIG_PATH/sphere_baroclinic_wave_rhoe_equilmoist_edmf.yml + + # julia --color=yes --project=examples post_processing/remap/remap_pipeline.jl + # --data_dir sphere_baroclinic_wave_rhoe_equilmoist_edmf + # --out_dir sphere_baroclinic_wave_rhoe_equilmoist_edmf + + # julia --color=yes --project=examples post_processing/plot/plot_pipeline.jl + # --nc_dir sphere_baroclinic_wave_rhoe_equilmoist_edmf + # --fig_dir sphere_baroclinic_wave_rhoe_equilmoist_edmf --case_name dry_held_suarez + # artifact_paths: "sphere_baroclinic_wave_rhoe_equilmoist_edmf/*" + # agents: + # slurm_mem: 20GB + + # - label: ":computer: aquaplanet (ρe_tot) equilmoist allsky radiation monin_obukhov varying insolation gravity wave (raw_topo) high top zonally asymmetric" + # command: > + # julia --color=yes --project=examples examples/hybrid/driver.jl + # --config_file $CONFIG_PATH/sphere_aquaplanet_rhoe_equilmoist_allsky_gw_raw_zonallyasymmetric.yml + + # julia --color=yes --project=examples post_processing/remap/remap_pipeline.jl + # --data_dir sphere_aquaplanet_rhoe_equilmoist_allsky_gw_raw_zonallyasymmetric + # --out_dir sphere_aquaplanet_rhoe_equilmoist_allsky_gw_raw_zonallyasymmetric + + # julia --color=yes --project=examples post_processing/plot/plot_pipeline.jl + # --nc_dir sphere_aquaplanet_rhoe_equilmoist_allsky_gw_raw_zonallyasymmetric + # --fig_dir sphere_aquaplanet_rhoe_equilmoist_allsky_gw_raw_zonallyasymmetric + # --case_name aquaplanet + + # julia --color=yes --project=examples regression_tests/test_mse.jl + # --job_id sphere_aquaplanet_rhoe_equilmoist_allsky_gw_raw_zonallyasymmetric + # --out_dir sphere_aquaplanet_rhoe_equilmoist_allsky_gw_raw_zonallyasymmetric + # artifact_paths: "sphere_aquaplanet_rhoe_equilmoist_allsky_gw_raw_zonallyasymmetric/*" + # agents: + # slurm_mem: 20GB + + # - group: "Sphere Examples (Topography)" + # steps: + + # - label: ":computer: baroclinic wave (ρe) topography (dcmip)" + # command: > + # julia --color=yes --project=examples examples/hybrid/driver.jl + # --config_file $CONFIG_PATH/sphere_baroclinic_wave_rhoe_topography_dcmip_rs.yml + + # julia --color=yes --project=examples post_processing/remap/remap_pipeline.jl + # --data_dir sphere_baroclinic_wave_rhoe_topography_dcmip_rs + # --out_dir sphere_baroclinic_wave_rhoe_topography_dcmip_rs + # artifact_paths: "sphere_baroclinic_wave_rhoe_topography_dcmip_rs/*" + + # - label: ":computer: held suarez (ρe) topography (dcmip)" + # command: > + # julia --color=yes --project=examples examples/hybrid/driver.jl + # --config_file $CONFIG_PATH/sphere_held_suarez_rhoe_topography_dcmip.yml + + # julia --color=yes --project=examples post_processing/remap/remap_pipeline.jl + # --data_dir sphere_held_suarez_rhoe_topography_dcmip + # --out_dir sphere_held_suarez_rhoe_topography_dcmip + # artifact_paths: "sphere_held_suarez_rhoe_topography_dcmip/*" + + # - label: ":computer: held suarez (ρe) equilmoist topography (dcmip)" + # command: > + # julia --color=yes --project=examples examples/hybrid/driver.jl + # --config_file $CONFIG_PATH/sphere_held_suarez_rhoe_equilmoist_topography_dcmip.yml + + # julia --color=yes --project=examples post_processing/remap/remap_pipeline.jl + # --data_dir sphere_held_suarez_rhoe_equilmoist_topography_dcmip + # --out_dir sphere_held_suarez_rhoe_equilmoist_topography_dcmip + # artifact_paths: "sphere_held_suarez_rhoe_equilmoist_topography_dcmip/*" + # agents: + # slurm_mem: 20GB + + # - label: ":computer: Diagnostic DCMIP200 surface elevation spectra" + # command: > + # julia --color=yes --project=examples examples/hybrid/driver.jl + # --config_file $CONFIG_PATH/sphere_ssp_baroclinic_wave_rhoe_equilmoist_dcmip200.yml + + # julia --color=yes --project=examples post_processing/remap/remap_pipeline.jl + # --data_dir sphere_ssp_baroclinic_wave_rhoe_equilmoist_dcmip200 + # --out_dir sphere_ssp_baroclinic_wave_rhoe_equilmoist_dcmip200 + + # julia --color=yes --project=examples post_processing/plot/plot_pipeline.jl + # --nc_dir sphere_ssp_baroclinic_wave_rhoe_equilmoist_dcmip200 + # --fig_dir sphere_ssp_baroclinic_wave_rhoe_equilmoist_dcmip200 + # --case_name elevation_spectrum + # artifact_paths: "sphere_ssp_baroclinic_wave_rhoe_equilmoist_dcmip200/*" + + # - label: ":computer: Diagnostic Earth surface elevation spectra" + # command: > + # julia --color=yes --project=examples examples/hybrid/driver.jl + # --config_file $CONFIG_PATH/sphere_ssp_baroclinic_wave_rhoe_equilmoist_earth.yml + + # julia --color=yes --project=examples post_processing/remap/remap_pipeline.jl + # --data_dir sphere_ssp_baroclinic_wave_rhoe_equilmoist_earth + # --out_dir sphere_ssp_baroclinic_wave_rhoe_equilmoist_earth + + # julia --color=yes --project=examples post_processing/plot/plot_pipeline.jl + # --nc_dir sphere_ssp_baroclinic_wave_rhoe_equilmoist_earth + # --fig_dir sphere_ssp_baroclinic_wave_rhoe_equilmoist_earth + # --case_name elevation_spectrum + # artifact_paths: "sphere_ssp_baroclinic_wave_rhoe_equilmoist_earth/*" + + # - group: "MPI Examples" + # steps: + + # - label: ":computer: Prep restart for MPI" + # key: "mpi_baro_wave_make_restart" + # command: > + # srun julia --color=yes --project=examples examples/hybrid/driver.jl + # --config_file $MPI_CONFIG_PATH/mpi_make_restart.yml + # artifact_paths: "mpi_make_restart/*" + # env: + # CLIMACORE_DISTRIBUTED: "MPI" + # agents: + # slurm_ntasks: 2 + # slurm_mem: 16G + + # - label: ":computer: Test restart for MPI baroclinic wave" + # key: "restart_mpi_baro_wave" + # depends_on: "mpi_baro_wave_make_restart" + # command: > + # srun julia --color=yes --project=examples examples/hybrid/driver.jl + # --config_file $MPI_CONFIG_PATH/restart_mpi_baroclinic_wave_rhoe.yml + # artifact_paths: "restart_mpi_baroclinic_wave_rhoe/*" + # env: + # CLIMACORE_DISTRIBUTED: "MPI" + # RESTART_FILE: "mpi_make_restart/restart/day5.0.hdf5" + # agents: + # slurm_ntasks: 2 + # slurm_mem: 16G + # timeout_in_minutes: 20 + # soft_fail: true + # #retry: + # # automatic: true + + # - label: ":computer: MPI no lim ARS aquaplanet (ρe) equilmoist clearsky radiation" + # command: > + # srun julia --color=yes --project=examples examples/hybrid/driver.jl + # --config_file $MPI_CONFIG_PATH/mpi_sphere_aquaplanet_rhoe_equilmoist_clearsky.yml + # artifact_paths: "mpi_sphere_aquaplanet_rhoe_equilmoist_clearsky/*" + # env: + # CLIMACORE_DISTRIBUTED: "MPI" + # agents: + # slurm_ntasks: 2 + # slurm_mem: 16GB + + # - label: ":computer: Prep for calling remap pipeline" + # key: "prep_remap" + # command: > + # srun julia --color=yes --project=examples examples/hybrid/driver.jl + # --config_file $MPI_CONFIG_PATH/prep_remap.yml + # artifact_paths: "prep_remap/*" + # env: + # CLIMACORE_DISTRIBUTED: "MPI" + # agents: + # slurm_ntasks: 2 + # slurm_mem: 16G + + # - label: ":computer: Exercise remap pipeline" + # key: "remap_pipeline" + # depends_on: "prep_remap" + # command: > + # julia --color=yes --project=examples post_processing/remap/remap_pipeline.jl + # --data_dir prep_remap/ --out_dir remap_pipeline_output + # artifact_paths: "remap_pipeline_output/*" + + # - label: ":computer: Exercise parallel remap pipeline" + # key: "parallel_remap_pipeline" + # depends_on: "remap_pipeline" + # command: > + # julia -p 4 --color=yes --project=examples post_processing/remap/remap_pipeline_parallel.jl + # --data_dir prep_remap/ --out_dir parallel_remap_pipeline_output + # artifact_paths: "parallel_remap_pipeline_output/*" + # agents: + # slurm_ntasks: 5 + + # - group: "Configs" + # steps: + + # - label: ":computer: Test IO" + # command: > + # julia --color=yes --project=examples --threads=8 examples/hybrid/driver.jl + # --config_file $CONFIG_PATH/test_io.yml + # artifact_paths: "test_io/*" + + # - label: ":computer: Use test env with latest deps" + # command: > + # julia --color=yes --project=test examples/hybrid/driver.jl + # --config_file $CONFIG_PATH/test_env.yml + # artifact_paths: "test_env/*" + # soft_fail: true + # agents: + # slurm_mem: 20GB + + # - label: ":computer: MPI io test" + # command: > + # srun julia --color=yes --project=examples examples/hybrid/driver.jl + # --config_file $CONFIG_PATH/test_mpi_io.yml + # artifact_paths: "test_mpi_io/*" + # env: + # CLIMACORE_DISTRIBUTED: "MPI" + # agents: + # slurm_ntasks: 2 + # slurm_mem: 16G + + # # TODO: we should somehow decouple this unit test from the perf env / scripts + # - label: ":computer: checkbounds" + # command: > + # julia --color=yes --check-bounds=yes --project=perf perf/benchmark.jl + # $PERF_CONFIG_PATH/checkbounds.yml + # artifact_paths: "checkbounds/*" + # agents: + # slurm_mem: 20GB + + # - label: ":dart: Dycore Consistency test" + # command: > + # julia --color=yes --project=examples examples/hybrid/driver.jl + # --config_file $CONFIG_PATH/dycore_consistency.yml + # artifact_paths: "dycore_consistency/*" + # soft_fail: true + # agents: + # slurm_mem: 20GB - group: "EDMFX" steps: @@ -725,6 +725,24 @@ steps: artifact_paths: "sphere_baroclinic_wave_rhoe_equilmoist_edmfx/*" agents: slurm_mem: 20GB + + - label: ":genie: Advective EDMFX GABLS in a box" + command: > + julia --color=yes --project=examples examples/hybrid/driver.jl + --config_file $CONFIG_PATH/advective_edmfx_gabls_box.yml + artifact_paths: "advective_edmfx_gabls_box/*" + soft_fail: true + agents: + slurm_mem: 20GB + + - label: ":genie: Advective EDMFX Bomex in a box" + command: > + julia --color=yes --project=examples examples/hybrid/driver.jl + --config_file $CONFIG_PATH/advective_edmfx_bomex_box.yml + artifact_paths: "advective_edmfx_bomex_box/*" + soft_fail: true + agents: + slurm_mem: 20GB - group: "TurbulenceConvection" steps: diff --git a/config/model_configs/advective_edmfx_bomex_box.yml b/config/model_configs/advective_edmfx_bomex_box.yml new file mode 100644 index 00000000000..aac00b59721 --- /dev/null +++ b/config/model_configs/advective_edmfx_bomex_box.yml @@ -0,0 +1,30 @@ +job_id: "advective_edmfx_bomex_box" +initial_condition: "Bomex" +subsidence: "Bomex" +edmf_coriolis: "Bomex" +ls_adv: "Bomex" +surface_setup: "Bomex" +turbconv: "advective_edmfx" +edmfx_upwinding: first_order +edmfx_entr_model: "ConstantCoefficient" +edmfx_detr_model: "ConstantCoefficient" +edmfx_sgs_mass_flux: true +edmfx_sgs_diffusive_flux: true +edmfx_nh_pressure: false +prognostic_tke: false +moist: "equil" +config: "box" +hyperdiff: "true" +kappa_4: 1.0e12 +x_max: 1e5 +y_max: 1e5 +z_max: 3e3 +x_elem: 2 +y_elem: 2 +z_elem: 60 +z_stretch: false +perturb_initstate: false +dt: "1secs" +t_end: "10800secs" +dt_save_to_disk: "10secs" +toml: [toml/edmfx_box.toml] diff --git a/config/model_configs/advective_edmfx_gabls_box.yml b/config/model_configs/advective_edmfx_gabls_box.yml new file mode 100644 index 00000000000..0876753c0cf --- /dev/null +++ b/config/model_configs/advective_edmfx_gabls_box.yml @@ -0,0 +1,30 @@ +job_id: "advective_edmfx_gabls_box" +initial_condition: GABLS +edmf_coriolis: GABLS +surface_setup: GABLS +turbconv: "advective_edmfx" +edmfx_upwinding: "first_order" +edmfx_entr_model: "ConstantCoefficient" +edmfx_detr_model: "ConstantCoefficient" +edmfx_sgs_mass_flux: false +edmfx_sgs_diffusive_flux: false +edmfx_nh_pressure: false +prognostic_tke: false +moist: "equil" +config: "box" +hyperdiff: "true" +vert_diff: "true" +kappa_4: 1e12 +x_max: 1e5 +y_max: 1e5 +z_max: 400 +x_elem: 2 +y_elem: 2 +z_elem: 8 +z_stretch: false +dt: "5secs" +t_end: "9hours" +dt_save_to_disk: "10mins" +perturb_initstate: false +FLOAT_TYPE: "Float64" +toml: [toml/edmfx_box.toml] diff --git a/examples/hybrid/driver.jl b/examples/hybrid/driver.jl index 6af89053b03..552c94041ad 100644 --- a/examples/hybrid/driver.jl +++ b/examples/hybrid/driver.jl @@ -40,6 +40,7 @@ reference_job_id = isnothing(ref_job_id) ? simulation.job_id : ref_job_id is_edmfx = atmos.turbconv_model isa CA.EDMFX || + atmos.turbconv_model isa CA.AdvectiveEDMFX || atmos.turbconv_model isa CA.DiagnosticEDMFX if is_edmfx && config.parsed_args["post_process"] contours_and_profiles(simulation.output_dir, reference_job_id) diff --git a/src/ClimaAtmos.jl b/src/ClimaAtmos.jl index 1f0c7fcac38..3daa52df33c 100644 --- a/src/ClimaAtmos.jl +++ b/src/ClimaAtmos.jl @@ -26,6 +26,7 @@ include(joinpath("TurbulenceConvection_deprecated", "TurbulenceConvection.jl")) import .TurbulenceConvection as TC include(joinpath("cache", "edmf_precomputed_quantities.jl")) +include(joinpath("cache", "advective_edmf_precomputed_quantities.jl")) include(joinpath("cache", "diagnostic_edmf_precomputed_quantities.jl")) include(joinpath("cache", "precomputed_quantities.jl")) diff --git a/src/cache/advective_edmf_precomputed_quantities.jl b/src/cache/advective_edmf_precomputed_quantities.jl new file mode 100644 index 00000000000..8e17844cce6 --- /dev/null +++ b/src/cache/advective_edmf_precomputed_quantities.jl @@ -0,0 +1,272 @@ +##### +##### Precomputed quantities +##### +import Thermodynamics as TD +import ClimaCore: Spaces, Fields + +""" + set_advective_edmf_precomputed_quantities!(Y, p, t) + +Updates the precomputed quantities stored in `p` for edmfx. +""" +function set_advective_edmf_precomputed_quantities!(Y, p, ᶠuₕ³, t) + (; energy_form, moisture_model, turbconv_model) = p.atmos + #EDMFX BCs only support total energy as state variable + @assert energy_form isa TotalEnergy + @assert !(moisture_model isa DryModel) + + FT = Spaces.undertype(axes(Y.c)) + (; params) = p + (; dt) = p.simulation + thermo_params = CAP.thermodynamics_params(params) + n = n_mass_flux_subdomains(turbconv_model) + thermo_args = (thermo_params, energy_form, moisture_model) + + (; ᶜspecific, ᶜp, ᶜΦ, ᶜh_tot, ᶜρ_ref) = p + (; ᶜtke⁰, ᶜρa⁰, ᶠu₃⁰, ᶜu⁰, ᶠu³⁰, ᶜK⁰, ᶜts⁰, ᶜρ⁰, ᶜh_tot⁰, ᶜq_tot⁰) = p + (; ᶜmixing_length, ᶜlinear_buoygrad, ᶜstrain_rate_norm, ᶜK_u, ᶜK_h) = p + (; ᶜuʲs, ᶠu³ʲs, ᶜKʲs, ᶜtsʲs, ᶜρʲs, ᶜentrʲs, ᶜdetrʲs) = p + (; ustar, obukhov_length, buoyancy_flux) = p.sfc_conditions + + @. ᶜρa⁰ = ρa⁰(Y.c) + @. ᶜtke⁰ = divide_by_ρa(Y.c.sgs⁰.ρatke, ᶜρa⁰, 0, Y.c.ρ, turbconv_model) + # TODO: use all updrafts + @. ᶜh_tot⁰ = divide_by_ρa( + Y.c.ρ * ᶜh_tot - (Y.c.sgsʲs.:1).ρa * (Y.c.sgsʲs.:1).h_tot, + ᶜρa⁰, + Y.c.ρ * ᶜh_tot, + Y.c.ρ, + turbconv_model, + ) + @. ᶜq_tot⁰ = divide_by_ρa( + Y.c.ρq_tot - (Y.c.sgsʲs.:1).ρa * (Y.c.sgsʲs.:1).q_tot, + ᶜρa⁰, + Y.c.ρq_tot, + Y.c.ρ, + turbconv_model, + ) + set_sgs_ᶠu₃!(u₃⁰, ᶠu₃⁰, Y, turbconv_model) + # TODO: remove this hack + @. ᶜh_tot⁰ = ᶜh_tot + @. ᶜq_tot⁰ = ᶜspecific.q_tot + @. ᶠu₃⁰ = Y.f.u₃ + set_velocity_quantities!(ᶜu⁰, ᶠu³⁰, ᶜK⁰, ᶠu₃⁰, Y.c.uₕ, ᶠuₕ³) + @. ᶜK⁰ += ᶜtke⁰ + @. ᶜts⁰ = TD.PhaseEquil_phq(thermo_params, ᶜp, ᶜh_tot⁰ - ᶜK⁰ - ᶜΦ, ᶜq_tot⁰) + @. ᶜρ⁰ = TD.air_density(thermo_params, ᶜts⁰) + + for j in 1:n + ᶜuʲ = ᶜuʲs.:($j) + ᶠu³ʲ = ᶠu³ʲs.:($j) + ᶜKʲ = ᶜKʲs.:($j) + ᶠu₃ʲ = Y.f.sgsʲs.:($j).u₃ + ᶜtsʲ = ᶜtsʲs.:($j) + ᶜρʲ = ᶜρʲs.:($j) + ᶜh_totʲ = Y.c.sgsʲs.:($j).h_tot + ᶜq_totʲ = Y.c.sgsʲs.:($j).q_tot + + set_velocity_quantities!(ᶜuʲ, ᶠu³ʲ, ᶜKʲ, ᶠu₃ʲ, Y.c.uₕ, ᶠuₕ³) + @. ᶜtsʲ = + TD.PhaseEquil_phq(thermo_params, ᶜp, ᶜh_totʲ - ᶜKʲ - ᶜΦ, ᶜq_totʲ) + @. ᶜρʲ = TD.air_density(thermo_params, ᶜtsʲ) + + # When ᶜe_intʲ = ᶜe_int and ᶜq_totʲ = ᶜq_tot, we still observe that + # ᶜρʲ != ᶜρ. This is because the conversion from ᶜρ to ᶜp to ᶜρʲ + # introduces a tiny round-off error of order epsilon to ᶜρʲ. If left + # unchecked, this round-off error then changes the tendency of ᶠu₃ʲ, + # which in turn introduces an error to ᶠu³ʲ, which then increases + # the error in ᶜρʲ. For now, we will filter ᶜρʲ to fix this. Note + # that this will no longer be necessary after we add diffusion. + @. ᶜρʲ = ifelse(abs(ᶜρʲ - Y.c.ρ) <= 2 * eps(Y.c.ρ), Y.c.ρ, ᶜρʲ) + + # EDMFX boundary condition: + + # We need field_values everywhere because we are mixing + # information from surface and first interior inside the + # sgs_h/q_tot_first_interior_bc call. + ᶜz_int_val = + Fields.field_values(Fields.level(Fields.coordinate_field(Y.c).z, 1)) + z_sfc_val = Fields.field_values( + Fields.level(Fields.coordinate_field(Y.f).z, Fields.half), + ) + ᶜρ_int_val = Fields.field_values(Fields.level(Y.c.ρ, 1)) + ᶜp_int_val = Fields.field_values(Fields.level(ᶜp, 1)) + (; ρ_flux_h_tot, ρ_flux_q_tot, ustar, obukhov_length) = p.sfc_conditions + buoyancy_flux_val = Fields.field_values(buoyancy_flux) + ρ_flux_h_tot_val = Fields.field_values(ρ_flux_h_tot) + ρ_flux_q_tot_val = Fields.field_values(ρ_flux_q_tot) + ustar_val = Fields.field_values(ustar) + obukhov_length_val = Fields.field_values(obukhov_length) + sfc_local_geometry_val = Fields.field_values( + Fields.local_geometry_field(Fields.level(Y.f, Fields.half)), + ) + + # Based on boundary conditions for updrafts we overwrite + # the first interior point for EDMFX ᶜh_totʲ... + ᶜh_tot_int_val = Fields.field_values(Fields.level(ᶜh_tot, 1)) + ᶜh_totʲ_int_val = Fields.field_values(Fields.level(ᶜh_totʲ, 1)) + @. ᶜh_totʲ_int_val = sgs_scalar_first_interior_bc( + ᶜz_int_val - z_sfc_val, + ᶜρ_int_val, + ᶜh_tot_int_val, + buoyancy_flux_val, + ρ_flux_h_tot_val, + ustar_val, + obukhov_length_val, + sfc_local_geometry_val, + ) + + # ... and the first interior point for EDMFX ᶜq_totʲ. + ᶜq_tot_int_val = Fields.field_values(Fields.level(ᶜspecific.q_tot, 1)) + ᶜq_totʲ_int_val = Fields.field_values(Fields.level(ᶜq_totʲ, 1)) + @. ᶜq_totʲ_int_val = sgs_scalar_first_interior_bc( + ᶜz_int_val - z_sfc_val, + ᶜρ_int_val, + ᶜq_tot_int_val, + buoyancy_flux_val, + ρ_flux_q_tot_val, + ustar_val, + obukhov_length_val, + sfc_local_geometry_val, + ) + + # Then overwrite the prognostic variables at first inetrior point. + ᶜKʲ_int_val = Fields.field_values(Fields.level(ᶜKʲ, 1)) + ᶜΦ_int_val = Fields.field_values(Fields.level(ᶜΦ, 1)) + ᶜtsʲ_int_val = Fields.field_values(Fields.level(ᶜtsʲ, 1)) + @. ᶜtsʲ_int_val = TD.PhaseEquil_phq( + thermo_params, + ᶜp_int_val, + ᶜh_totʲ_int_val - ᶜKʲ_int_val - ᶜΦ_int_val, + ᶜq_totʲ_int_val, + ) + sgsʲs_ρ_int_val = Fields.field_values(Fields.level(ᶜρʲs.:($j), 1)) + sgsʲs_ρa_int_val = + Fields.field_values(Fields.level(Y.c.sgsʲs.:($j).ρa, 1)) + + turbconv_params = CAP.turbconv_params(params) + @. sgsʲs_ρa_int_val = + $(FT(turbconv_params.surface_area)) * + TD.air_density(thermo_params, ᶜtsʲ_int_val) + end + + ᶜz = Fields.coordinate_field(Y.c).z + z_sfc = Fields.level(Fields.coordinate_field(Y.f).z, Fields.half) + ᶜdz = Fields.Δz_field(axes(Y.c)) + ᶜlg = Fields.local_geometry_field(Y.c) + + for j in 1:n + @. ᶜentrʲs.:($$j) = entrainment( + params, + ᶜz, + z_sfc, + ᶜp, + Y.c.ρ, + buoyancy_flux, + draft_area(Y.c.sgsʲs.:($$j).ρa, ᶜρʲs.:($$j)), + get_physical_w(ᶜuʲs.:($$j), ᶜlg), + TD.relative_humidity(thermo_params, ᶜtsʲs.:($$j)), + ᶜphysical_buoyancy(params, ᶜρ_ref, ᶜρʲs.:($$j)), + get_physical_w(ᶜu⁰, ᶜlg), + TD.relative_humidity(thermo_params, ᶜts⁰), + ᶜphysical_buoyancy(params, ᶜρ_ref, ᶜρ⁰), + dt, + p.atmos.edmfx_entr_model, + ) + @. ᶜdetrʲs.:($$j) = detrainment( + params, + ᶜz, + z_sfc, + ᶜp, + Y.c.ρ, + buoyancy_flux, + draft_area(Y.c.sgsʲs.:($$j).ρa, ᶜρʲs.:($$j)), + get_physical_w(ᶜuʲs.:($$j), ᶜlg), + TD.relative_humidity(thermo_params, ᶜtsʲs.:($$j)), + ᶜphysical_buoyancy(params, ᶜρ_ref, ᶜρʲs.:($$j)), + get_physical_w(ᶜu⁰, ᶜlg), + TD.relative_humidity(thermo_params, ᶜts⁰), + ᶜphysical_buoyancy(params, ᶜρ_ref, ᶜρ⁰), + dt, + p.atmos.edmfx_detr_model, + ) + end + + # First order approximation: Use environmental mean fields. + @. ᶜlinear_buoygrad = buoyancy_gradients( + params, + moisture_model, + EnvBuoyGrad( + BuoyGradMean(), + TD.air_temperature(thermo_params, ᶜts⁰), # t_sat + TD.vapor_specific_humidity(thermo_params, ᶜts⁰), # qv_sat + ᶜq_tot⁰, # qt_sat + TD.dry_pottemp(thermo_params, ᶜts⁰), # θ_sat + TD.liquid_ice_pottemp(thermo_params, ᶜts⁰), # θ_liq_ice_sat + projected_vector_data( + C3, + ᶜgradᵥ(ᶠinterp(TD.virtual_pottemp(thermo_params, ᶜts⁰))), + ᶜlg, + ), # ∂θv∂z_unsat + projected_vector_data(C3, ᶜgradᵥ(ᶠinterp(ᶜq_tot⁰)), ᶜlg), # ∂qt∂z_sat + projected_vector_data( + C3, + ᶜgradᵥ(ᶠinterp(TD.liquid_ice_pottemp(thermo_params, ᶜts⁰))), + ᶜlg, + ), # ∂θl∂z_sat + ᶜp, # p + ifelse(TD.has_condensate(thermo_params, ᶜts⁰), 1, 0), # en_cld_frac + ᶜρ⁰, # ρ + ), + ) + + # TODO: Currently the shear production only includes vertical gradients + ᶠu⁰ = p.ᶠtemp_C123 + @. ᶠu⁰ = C123(ᶠinterp(Y.c.uₕ)) + C123(ᶠu³⁰) + ᶜstrain_rate = p.ᶜtemp_UVWxUVW + compute_strain_rate_center!(ᶜstrain_rate, ᶠu⁰) + @. ᶜstrain_rate_norm = norm_sqr(ᶜstrain_rate) + + ᶜprandtl_nvec = p.ᶜtemp_scalar + @. ᶜprandtl_nvec = turbulent_prandtl_number( + params, + obukhov_length, + ᶜlinear_buoygrad, + ᶜstrain_rate_norm, + ) + ᶜtke_exch = p.ᶜtemp_scalar_2 + @. ᶜtke_exch = 0 + for j in 1:n + @. ᶜtke_exch += + Y.c.sgsʲs.:($$j).ρa * ᶜdetrʲs.:($$j) / ᶜρa⁰ * ( + 1 / 2 * + ( + get_physical_w(ᶜuʲs.:($$j), ᶜlg) - get_physical_w(ᶜu⁰, ᶜlg) + )^2 - ᶜtke⁰ + ) + end + + sfc_tke = Fields.level(ᶜtke⁰, 1) + @. ᶜmixing_length = mixing_length( + p.params, + ustar, + ᶜz, + z_sfc, + ᶜdz, + sfc_tke, + ᶜlinear_buoygrad, + ᶜtke⁰, + obukhov_length, + ᶜstrain_rate_norm, + ᶜprandtl_nvec, + ᶜtke_exch, + ) + + turbconv_params = CAP.turbconv_params(params) + c_m = TCP.tke_ed_coeff(turbconv_params) + @. ᶜK_u = c_m * ᶜmixing_length * sqrt(max(ᶜtke⁰, 0)) + # TODO: add Prantdl number + @. ᶜK_h = ᶜK_u / ᶜprandtl_nvec + + return nothing +end diff --git a/src/cache/precomputed_quantities.jl b/src/cache/precomputed_quantities.jl index 2be28412bcd..e0b34a1a12f 100644 --- a/src/cache/precomputed_quantities.jl +++ b/src/cache/precomputed_quantities.jl @@ -40,6 +40,10 @@ function precomputed_quantities(Y, atmos) !(atmos.moisture_model isa DryModel) && atmos.energy_form isa TotalEnergy ) || !(atmos.turbconv_model isa DiagnosticEDMFX) + @assert ( + !(atmos.moisture_model isa DryModel) && + atmos.energy_form isa TotalEnergy + ) || !(atmos.turbconv_model isa AdvectiveEDMFX) TST = thermo_state_type(atmos.moisture_model, FT) SCT = SurfaceConditions.surface_conditions_type(atmos, FT) n = n_mass_flux_subdomains(atmos.turbconv_model) @@ -88,6 +92,32 @@ function precomputed_quantities(Y, atmos) ) : (;) )..., ) : (;) + advective_sgs_quantities = + atmos.turbconv_model isa AdvectiveEDMFX ? + (; + ᶜtke⁰ = similar(Y.c, FT), + ᶜρa⁰ = similar(Y.c, FT), + ᶠu₃⁰ = similar(Y.f, C3{FT}), + ᶜu⁰ = similar(Y.c, C123{FT}), + ᶠu³⁰ = similar(Y.f, CT3{FT}), + ᶜK⁰ = similar(Y.c, FT), + ᶜh_tot⁰ = similar(Y.c, FT), + ᶜq_tot⁰ = similar(Y.c, FT), + ᶜts⁰ = similar(Y.c, TST), + ᶜρ⁰ = similar(Y.c, FT), + ᶜlinear_buoygrad = similar(Y.c, FT), + ᶜstrain_rate_norm = similar(Y.c, FT), + ᶜmixing_length = similar(Y.c, FT), + ᶜK_u = similar(Y.c, FT), + ᶜK_h = similar(Y.c, FT), + ᶜuʲs = similar(Y.c, NTuple{n, C123{FT}}), + ᶠu³ʲs = similar(Y.f, NTuple{n, CT3{FT}}), + ᶜKʲs = similar(Y.c, NTuple{n, FT}), + ᶜtsʲs = similar(Y.c, NTuple{n, TST}), + ᶜρʲs = similar(Y.c, NTuple{n, FT}), + ᶜentrʲs = similar(Y.c, NTuple{n, FT}), + ᶜdetrʲs = similar(Y.c, NTuple{n, FT}), + ) : (;) diagnostic_sgs_quantities = atmos.turbconv_model isa DiagnosticEDMFX ? (; @@ -117,7 +147,12 @@ function precomputed_quantities(Y, atmos) ᶜK_h = similar(Y.c, FT), ρatke_flux = similar(Fields.level(Y.f, half), C3{FT}), ) : (;) - return (; gs_quantities..., sgs_quantities..., diagnostic_sgs_quantities...) + return (; + gs_quantities..., + sgs_quantities..., + advective_sgs_quantities..., + diagnostic_sgs_quantities..., + ) end # Interpolates the third contravariant component of Y.c.uₕ to cell faces. @@ -140,7 +175,7 @@ function set_velocity_at_surface!(Y, ᶠuₕ³, turbconv_model) sfc_uₕ³ = Fields.level(ᶠuₕ³.components.data.:1, half) sfc_g³³ = g³³_field(sfc_u₃) @. sfc_u₃ = -sfc_uₕ³ / sfc_g³³ # u³ = uₕ³ + w³ = uₕ³ + w₃ * g³³ - if turbconv_model isa EDMFX + if turbconv_model isa EDMFX || turbconv_model isa AdvectiveEDMFX for j in 1:n_mass_flux_subdomains(turbconv_model) sfc_u₃ʲ = Fields.level(Y.f.sgsʲs.:($j).u₃.components.data.:1, half) @. sfc_u₃ʲ = sfc_u₃ @@ -317,6 +352,10 @@ NVTX.@annotate function set_precomputed_quantities!(Y, p, t) set_edmf_precomputed_quantities!(Y, p, ᶠuₕ³, t) end + if turbconv_model isa AdvectiveEDMFX + set_advective_edmf_precomputed_quantities!(Y, p, ᶠuₕ³, t) + end + if turbconv_model isa DiagnosticEDMFX set_diagnostic_edmf_precomputed_quantities!(Y, p, t) end @@ -349,6 +388,27 @@ function output_sgs_quantities(Y, p, t) return (; ᶜspecific⁺, ᶠu₃⁺, ᶜu⁺, ᶠu³⁺, ᶜK⁺, ᶜts⁺, ᶜa⁺, ᶜa⁰) end +""" + output_advective_sgs_quantities(Y, p, t) + +Sets `ᶜu⁺`, `ᶠu³⁺`, `ᶜts⁺` and `ᶜa⁺` to be the same as the +values of the first updraft. +""" +function output_advective_sgs_quantities(Y, p, t) + (; turbconv_model) = p.atmos + thermo_params = CAP.thermodynamics_params(p.params) + (; ᶜp, ᶜρa⁰, ᶜρ⁰, ᶜΦ, ᶜtsʲs) = p + ᶠuₕ³ = p.ᶠtemp_CT3 + set_ᶠuₕ³!(ᶠuₕ³, Y) + (ᶠu₃⁺, ᶜu⁺, ᶠu³⁺, ᶜK⁺) = similar.((p.ᶠu₃⁰, p.ᶜu⁰, p.ᶠu³⁰, p.ᶜK⁰)) + set_sgs_ᶠu₃!(u₃⁺, ᶠu₃⁺, Y, turbconv_model) + set_velocity_quantities!(ᶜu⁺, ᶠu³⁺, ᶜK⁺, ᶠu₃⁺, Y.c.uₕ, ᶠuₕ³) + ᶜts⁺ = ᶜtsʲs.:1 + ᶜa⁺ = @. draft_area(ρa⁺(Y.c), TD.air_density(thermo_params, ᶜts⁺)) + ᶜa⁰ = @. draft_area(ᶜρa⁰, ᶜρ⁰) + return (; ᶠu₃⁺, ᶜu⁺, ᶠu³⁺, ᶜK⁺, ᶜts⁺, ᶜa⁺, ᶜa⁰) +end + """ output_diagnostic_sgs_quantities(Y, p, t) diff --git a/src/callbacks/callbacks.jl b/src/callbacks/callbacks.jl index 4625e50872c..4112e8d7e76 100644 --- a/src/callbacks/callbacks.jl +++ b/src/callbacks/callbacks.jl @@ -304,6 +304,37 @@ NVTX.@annotate function compute_diagnostics(integrator) ᶜts⁰, ) .+ ᶜa⁺ .* cloud_fraction.(thermo_params, ᶜts⁺, ᶜa⁺), ) + elseif p.atmos.turbconv_model isa AdvectiveEDMFX + (; ᶜtke⁰, ᶜu⁰, ᶜts⁰, ᶜmixing_length) = p + (; ᶜu⁺, ᶜts⁺, ᶜa⁺, ᶜa⁰) = output_advective_sgs_quantities(Y, p, t) + env_diagnostics = (; + common_diagnostics(p, ᶜu⁰, ᶜts⁰)..., + area = ᶜa⁰, + cloud_fraction = get_cloud_fraction.( + thermo_params, + env_thermo_quad, + ᶜp, + ᶜts⁰, + ), + tke = ᶜtke⁰, + mixing_length = ᶜmixing_length, + ) + draft_diagnostics = (; + common_diagnostics(p, ᶜu⁺, ᶜts⁺)..., + area = ᶜa⁺, + cloud_fraction = cloud_fraction.(thermo_params, ᶜts⁺, ᶜa⁺), + ) + turbulence_convection_diagnostic = (; + add_prefix(env_diagnostics, :env_)..., + add_prefix(draft_diagnostics, :draft_)..., + cloud_fraction = ᶜa⁰ .* + get_cloud_fraction.( + thermo_params, + env_thermo_quad, + ᶜp, + ᶜts⁰, + ) .+ ᶜa⁺ .* cloud_fraction.(thermo_params, ᶜts⁺, ᶜa⁺), + ) elseif p.atmos.turbconv_model isa DiagnosticEDMFX (; ᶜtke⁰, ᶜmixing_length) = p (; ᶜu⁺, ᶜts⁺, ᶜa⁺) = output_diagnostic_sgs_quantities(Y, p, t) diff --git a/src/initial_conditions/InitialConditions.jl b/src/initial_conditions/InitialConditions.jl index 29cef59fd7c..081bc892a18 100644 --- a/src/initial_conditions/InitialConditions.jl +++ b/src/initial_conditions/InitialConditions.jl @@ -16,6 +16,7 @@ import ..PrognosticSurfaceTemperature import ..C3 import ..C12 import ..EDMFX +import ..AdvectiveEDMFX import ..DiagnosticEDMFX import ..n_mass_flux_subdomains import ..gs_to_sgs diff --git a/src/initial_conditions/atmos_state.jl b/src/initial_conditions/atmos_state.jl index 84865dd0d24..8caf9e21705 100644 --- a/src/initial_conditions/atmos_state.jl +++ b/src/initial_conditions/atmos_state.jl @@ -129,6 +129,7 @@ function turbconv_center_variables(ls, turbconv_model::TC.EDMFModel, gs_vars) up = ntuple(_ -> (; ρarea = ρa, ρae_tot, ρaq_tot), Val(n)) return (; turbconv = (; en, up)) end + function turbconv_center_variables(ls, turbconv_model::EDMFX, gs_vars) n = n_mass_flux_subdomains(turbconv_model) a_draft = ls.turbconv_state.draft_area @@ -137,6 +138,20 @@ function turbconv_center_variables(ls, turbconv_model::EDMFX, gs_vars) return (; sgs⁰, sgsʲs) end +function turbconv_center_variables(ls, turbconv_model::AdvectiveEDMFX, gs_vars) + n = n_mass_flux_subdomains(turbconv_model) + a_draft = ls.turbconv_state.draft_area + sgs⁰ = (; ρatke = ls.ρ * (1 - a_draft) * ls.turbconv_state.tke) + ρa = ls.ρ * a_draft / n + h_tot = + TD.specific_enthalpy(ls.thermo_params, ls.thermo_state) + + norm_sqr(ls.velocity) / 2 + + CAP.grav(ls.params) * ls.geometry.coordinates.z + q_tot = TD.total_specific_humidity(ls.thermo_params, ls.thermo_state) + sgsʲs = ntuple(_ -> (; ρa = ρa, h_tot = h_tot, q_tot = q_tot), Val(n)) + return (; sgs⁰, sgsʲs) +end + function turbconv_center_variables(ls, turbconv_model::DiagnosticEDMFX, gs_vars) sgs⁰ = (; ρatke = ls.ρ * ls.turbconv_state.tke) return (; sgs⁰) @@ -157,4 +172,10 @@ turbconv_face_variables(ls, turbconv_model::EDMFX) = (; Val(n_mass_flux_subdomains(turbconv_model)), ) ) +turbconv_face_variables(ls, turbconv_model::AdvectiveEDMFX) = (; + sgsʲs = ntuple( + _ -> (; u₃ = C3(ls.turbconv_state.velocity, ls.geometry)), + Val(n_mass_flux_subdomains(turbconv_model)), + ) +) turbconv_face_variables(ls, turbconv_model::DiagnosticEDMFX) = (;) diff --git a/src/prognostic_equations/advection.jl b/src/prognostic_equations/advection.jl index 94d4bbfb496..dcfe9979b5f 100644 --- a/src/prognostic_equations/advection.jl +++ b/src/prognostic_equations/advection.jl @@ -12,12 +12,14 @@ NVTX.@annotate function horizontal_advection_tendency!(Yₜ, Y, p, t) if p.atmos.turbconv_model isa AbstractEDMF (; ᶜu⁰) = p end - if p.atmos.turbconv_model isa EDMFX + if p.atmos.turbconv_model isa EDMFX || + p.atmos.turbconv_model isa AdvectiveEDMFX (; ᶜuʲs) = p end @. Yₜ.c.ρ -= wdivₕ(Y.c.ρ * ᶜu) - if p.atmos.turbconv_model isa EDMFX + if p.atmos.turbconv_model isa EDMFX || + p.atmos.turbconv_model isa AdvectiveEDMFX for j in 1:n @. Yₜ.c.sgsʲs.:($$j).ρa -= wdivₕ(Y.c.sgsʲs.:($$j).ρa * ᶜuʲs.:($$j)) end @@ -42,6 +44,15 @@ NVTX.@annotate function horizontal_advection_tendency!(Yₜ, Y, p, t) end end + # FIXME: add horizontal advection + if p.atmos.turbconv_model isa AdvectiveEDMFX + for j in 1:n + if :h_tot in propertynames(Y.c) + @. Yₜ.c.sgsʲs.:($$j).h_tot -= 0 + end + end + end + if use_prognostic_tke(p.atmos.turbconv_model) @. Yₜ.c.sgs⁰.ρatke -= wdivₕ(Y.c.sgs⁰.ρatke * ᶜu⁰) end @@ -71,6 +82,14 @@ NVTX.@annotate function horizontal_tracer_advection_tendency!(Yₜ, Y, p, t) end end end + + # FIXME: add horizontal advection + if p.atmos.turbconv_model isa AdvectiveEDMFX + for j in 1:n + @. Yₜ.c.sgsʲs.:($$j).q_tot -= 0 + end + end + return nothing end @@ -84,13 +103,16 @@ NVTX.@annotate function explicit_vertical_advection_tendency!(Yₜ, Y, p, t) ᶜJ = Fields.local_geometry_field(Y.c).J (; ᶜu, ᶠu³, ᶜK, ᶜf) = p (; edmfx_upwinding) = n > 0 || advect_tke ? p : all_nothing - (; ᶜuʲs, ᶠu³ʲs, ᶜKʲs, ᶜρʲs, ᶜspecificʲs) = n > 0 ? p : all_nothing + (; ᶜuʲs, ᶠu³ʲs, ᶜKʲs, ᶜρʲs) = n > 0 ? p : all_nothing + (; ᶜspecificʲs) = turbconv_model isa EDMFX ? p : all_nothing (; ᶜp, ᶜp_ref, ᶜρ_ref, ᶠgradᵥ_ᶜΦ) = n > 0 ? p : all_nothing - (; ᶜh_totʲs) = n > 0 && is_total_energy ? p : all_nothing + (; ᶜh_totʲs) = turbconv_model isa EDMFX && is_total_energy ? p : all_nothing (; ᶠu³⁰) = advect_tke ? p : all_nothing ᶜρa⁰ = advect_tke ? (n > 0 ? p.ᶜρa⁰ : Y.c.ρ) : nothing ᶜρ⁰ = advect_tke ? (n > 0 ? p.ᶜρ⁰ : Y.c.ρ) : nothing - ᶜtke⁰ = advect_tke ? (n > 0 ? p.ᶜspecific⁰.tke : p.ᶜtke⁰) : nothing + ᶜtke⁰ = + advect_tke ? (turbconv_model isa EDMFX ? p.ᶜspecific⁰.tke : p.ᶜtke⁰) : + nothing ᶜa_scalar = p.ᶜtemp_scalar ᶜω³ = p.ᶜtemp_CT3 ᶠω¹² = p.ᶠtemp_CT12 @@ -139,25 +161,12 @@ NVTX.@annotate function explicit_vertical_advection_tendency!(Yₜ, Y, p, t) end # TODO: Move this to implicit_vertical_advection_tendency!. - for j in 1:n - @. ᶜa_scalar[colidx] = - draft_area(Y.c.sgsʲs.:($$j).ρa[colidx], ᶜρʲs.:($$j)[colidx]) - vertical_transport!( - Yₜ.c.sgsʲs.:($j).ρa[colidx], - ᶜJ[colidx], - ᶜρʲs.:($j)[colidx], - ᶠu³ʲs.:($j)[colidx], - ᶜa_scalar[colidx], - dt, - edmfx_upwinding, - ) - - if :ρae_tot in propertynames(Yₜ.c.sgsʲs.:($j)) + if p.atmos.turbconv_model isa EDMFX + for j in 1:n @. ᶜa_scalar[colidx] = - ᶜh_totʲs.:($$j)[colidx] * draft_area(Y.c.sgsʲs.:($$j).ρa[colidx], ᶜρʲs.:($$j)[colidx]) vertical_transport!( - Yₜ.c.sgsʲs.:($j).ρae_tot[colidx], + Yₜ.c.sgsʲs.:($j).ρa[colidx], ᶜJ[colidx], ᶜρʲs.:($j)[colidx], ᶠu³ʲs.:($j)[colidx], @@ -165,16 +174,52 @@ NVTX.@annotate function explicit_vertical_advection_tendency!(Yₜ, Y, p, t) dt, edmfx_upwinding, ) + + if :ρae_tot in propertynames(Yₜ.c.sgsʲs.:($j)) + @. ᶜa_scalar[colidx] = + ᶜh_totʲs.:($$j)[colidx] * draft_area( + Y.c.sgsʲs.:($$j).ρa[colidx], + ᶜρʲs.:($$j)[colidx], + ) + vertical_transport!( + Yₜ.c.sgsʲs.:($j).ρae_tot[colidx], + ᶜJ[colidx], + ᶜρʲs.:($j)[colidx], + ᶠu³ʲs.:($j)[colidx], + ᶜa_scalar[colidx], + dt, + edmfx_upwinding, + ) + end + + for (ᶜρaχʲₜ, ᶜχʲ, χ_name) in + matching_subfields(Yₜ.c.sgsʲs.:($j), ᶜspecificʲs.:($j)) + χ_name == :e_tot && continue + @. ᶜa_scalar[colidx] = + ᶜχʲ[colidx] * draft_area( + Y.c.sgsʲs.:($$j).ρa[colidx], + ᶜρʲs.:($$j)[colidx], + ) + vertical_transport!( + ᶜρaχʲₜ[colidx], + ᶜJ[colidx], + ᶜρʲs.:($j)[colidx], + ᶠu³ʲs.:($j)[colidx], + ᶜa_scalar[colidx], + dt, + edmfx_upwinding, + ) + end end + end - for (ᶜρaχʲₜ, ᶜχʲ, χ_name) in - matching_subfields(Yₜ.c.sgsʲs.:($j), ᶜspecificʲs.:($j)) - χ_name == :e_tot && continue + # FIXME: add vertical advection + if p.atmos.turbconv_model isa AdvectiveEDMFX + for j in 1:n @. ᶜa_scalar[colidx] = - ᶜχʲ[colidx] * draft_area(Y.c.sgsʲs.:($$j).ρa[colidx], ᶜρʲs.:($$j)[colidx]) vertical_transport!( - ᶜρaχʲₜ[colidx], + Yₜ.c.sgsʲs.:($j).ρa[colidx], ᶜJ[colidx], ᶜρʲs.:($j)[colidx], ᶠu³ʲs.:($j)[colidx], @@ -182,6 +227,16 @@ NVTX.@annotate function explicit_vertical_advection_tendency!(Yₜ, Y, p, t) dt, edmfx_upwinding, ) + + # FIXME: boundary conditions + @. Yₜ.c.sgsʲs.:($$j).h_tot[colidx] -= ᶜinterp( + adjoint(ᶠu³ʲs.:($$j)[colidx]) * + ᶠgradᵥ(Y.c.sgsʲs.:($$j).h_tot[colidx]), + ) + @. Yₜ.c.sgsʲs.:($$j).q_tot[colidx] -= ᶜinterp( + adjoint(ᶠu³ʲs.:($$j)[colidx]) * + ᶠgradᵥ(Y.c.sgsʲs.:($$j).q_tot[colidx]), + ) end end diff --git a/src/prognostic_equations/edmfx_entr_detr.jl b/src/prognostic_equations/edmfx_entr_detr.jl index 44ceaf99b58..676ff71b065 100644 --- a/src/prognostic_equations/edmfx_entr_detr.jl +++ b/src/prognostic_equations/edmfx_entr_detr.jl @@ -283,6 +283,27 @@ function detrainment( return detr * FT(2) * hm_limiter(ᶜaʲ) end +function detrainment( + params, + ᶜz::FT, + z_sfc::FT, + ᶜp::FT, + ᶜρ::FT, + buoy_flux_surface::FT, + ᶜaʲ::FT, + ᶜwʲ::FT, + ᶜRHʲ::FT, + ᶜbuoyʲ::FT, + ᶜw⁰::FT, + ᶜRH⁰::FT, + ᶜbuoy⁰::FT, + dt::FT, + ::ConstantTimescaleDetrainment, +) where {FT} + detr_tau = CAP.detr_tau(params) + detr = min(1 / detr_tau, 1 / dt) + return detr + edmfx_entr_detr_tendency!(Yₜ, Y, p, t, colidx, turbconv_model) = nothing function edmfx_entr_detr_tendency!(Yₜ, Y, p, t, colidx, turbconv_model::EDMFX) @@ -315,24 +336,36 @@ function edmfx_entr_detr_tendency!(Yₜ, Y, p, t, colidx, turbconv_model::EDMFX) return nothing end -function detrainment( - params, - ᶜz::FT, - z_sfc::FT, - ᶜp::FT, - ᶜρ::FT, - buoy_flux_surface::FT, - ᶜaʲ::FT, - ᶜwʲ::FT, - ᶜRHʲ::FT, - ᶜbuoyʲ::FT, - ᶜw⁰::FT, - ᶜRH⁰::FT, - ᶜbuoy⁰::FT, - dt::FT, - ::ConstantTimescaleDetrainment, -) where {FT} - detr_tau = CAP.detr_tau(params) - detr = min(1 / detr_tau, 1 / dt) - return detr +function edmfx_entr_detr_tendency!( + Yₜ, + Y, + p, + t, + colidx, + turbconv_model::AdvectiveEDMFX, +) + + n = n_mass_flux_subdomains(turbconv_model) + (; ᶜentrʲs, ᶜdetrʲs) = p + (; ᶜq_tot⁰, ᶜh_tot⁰, ᶠu₃⁰) = p + + for j in 1:n + + @. Yₜ.c.sgsʲs.:($$j).ρa[colidx] += + Y.c.sgsʲs.:($$j).ρa[colidx] * + (ᶜentrʲs.:($$j)[colidx] - ᶜdetrʲs.:($$j)[colidx]) + + @. Yₜ.c.sgsʲs.:($$j).h_tot[colidx] += + ᶜentrʲs.:($$j)[colidx] * + (ᶜh_tot⁰[colidx] - Y.c.sgsʲs.:($$j).h_tot[colidx]) + + @. Yₜ.c.sgsʲs.:($$j).q_tot[colidx] += + ᶜentrʲs.:($$j)[colidx] * + (ᶜq_tot⁰[colidx] - Y.c.sgsʲs.:($$j).q_tot[colidx]) + + @. Yₜ.f.sgsʲs.:($$j).u₃[colidx] += + ᶠinterp(ᶜentrʲs.:($$j)[colidx]) * + (ᶠu₃⁰[colidx] - Y.f.sgsʲs.:($$j).u₃[colidx]) + end + return nothing end diff --git a/src/prognostic_equations/edmfx_sgs_flux.jl b/src/prognostic_equations/edmfx_sgs_flux.jl index 1034f362448..114fbaf766f 100644 --- a/src/prognostic_equations/edmfx_sgs_flux.jl +++ b/src/prognostic_equations/edmfx_sgs_flux.jl @@ -89,6 +89,16 @@ function edmfx_sgs_mass_flux_tendency!( return nothing end +# FIXME: add sgs mass flux +edmfx_sgs_mass_flux_tendency!( + Yₜ, + Y, + p, + t, + colidx, + turbconv_model::AdvectiveEDMFX, +) = nothing + function edmfx_sgs_mass_flux_tendency!( Yₜ, Y, @@ -159,18 +169,14 @@ function edmfx_sgs_diffusive_flux_tendency!( p, t, colidx, - turbconv_model::EDMFX, + turbconv_model::Union{EDMFX, AdvectiveEDMFX}, ) FT = Spaces.undertype(axes(Y.c)) - n = n_mass_flux_subdomains(turbconv_model) - (; edmfx_upwinding, sfc_conditions) = p - (; ᶠu³, ᶜh_tot, ᶜspecific) = p - (; ᶠu³ʲs, ᶜh_totʲs, ᶜspecificʲs) = p - (; ᶜρa⁰, ᶠu³⁰, ᶜu⁰, ᶜh_tot⁰, ᶜspecific⁰) = p + (; sfc_conditions) = p + (; ᶜρa⁰, ᶠu³⁰, ᶜu⁰, ᶜh_tot⁰) = p + ᶜq_tot⁰ = turbconv_model isa EDMFX ? p.ᶜspecific⁰.q_tot : p.ᶜq_tot⁰ (; ᶜK_u, ᶜK_h) = p - (; dt) = p.simulation - ᶜJ = Fields.local_geometry_field(Y.c).J ᶠgradᵥ = Operators.GradientC2F() if p.atmos.edmfx_sgs_diffusive_flux @@ -194,7 +200,7 @@ function edmfx_sgs_diffusive_flux_tendency!( ), ) @. Yₜ.c.ρq_tot[colidx] -= ᶜdivᵥ_ρq_tot( - -(ᶠρaK_h[colidx] * ᶠgradᵥ(ᶜspecific⁰.q_tot[colidx])), + -(ᶠρaK_h[colidx] * ᶠgradᵥ(ᶜq_tot⁰[colidx])), ) end diff --git a/src/prognostic_equations/hyperdiffusion.jl b/src/prognostic_equations/hyperdiffusion.jl index c7a886184d6..a323383d09d 100644 --- a/src/prognostic_equations/hyperdiffusion.jl +++ b/src/prognostic_equations/hyperdiffusion.jl @@ -177,6 +177,8 @@ NVTX.@annotate function hyperdiffusion_tendency!(Yₜ, Y, p, t) wdivₕ(Y.c.sgsʲs.:($$j).ρa * gradₕ(ᶜ∇²specific_energyʲs.:($$j))) end end + # FIXME: add hyperdiffusion for advective edmf + if turbconv_model isa DiagnosticEDMFX && diffuse_tke @. Yₜ.c.sgs⁰.ρatke -= κ₄ * wdivₕ(Y.c.ρ * gradₕ(ᶜ∇²tke⁰)) end diff --git a/src/prognostic_equations/implicit/implicit_tendency.jl b/src/prognostic_equations/implicit/implicit_tendency.jl index c7c97a68f56..ab63c445c9c 100644 --- a/src/prognostic_equations/implicit/implicit_tendency.jl +++ b/src/prognostic_equations/implicit/implicit_tendency.jl @@ -107,7 +107,7 @@ function implicit_vertical_advection_tendency!(Yₜ, Y, p, t, colidx) if rayleigh_sponge isa RayleighSponge (; ᶠβ_rayleigh_w) = p @. Yₜ.f.u₃[colidx] -= ᶠβ_rayleigh_w[colidx] * Y.f.u₃[colidx] - if turbconv_model isa EDMFX + if turbconv_model isa EDMFX || turbconv_model isa AdvectiveEDMFX for j in 1:n @. Yₜ.f.sgsʲs.:($$j).u₃[colidx] -= ᶠβ_rayleigh_w[colidx] * Y.f.sgsʲs.:($$j).u₃[colidx] diff --git a/src/prognostic_equations/pressure_work.jl b/src/prognostic_equations/pressure_work.jl index a190c2cc5f9..a74e2f6ec11 100644 --- a/src/prognostic_equations/pressure_work.jl +++ b/src/prognostic_equations/pressure_work.jl @@ -14,4 +14,7 @@ function pressure_work_tendency!(Yₜ, Y, p, t, colidx, ::EDMFX) return nothing end +# FIXME: add pressure term +pressure_work_tendency!(Yₜ, Y, p, t, colidx, ::AdvectiveEDMFX) = nothing + pressure_work_tendency!(Yₜ, Y, p, t, colidx, ::Any) = nothing diff --git a/src/prognostic_equations/zero_velocity.jl b/src/prognostic_equations/zero_velocity.jl index f62a79b55cc..cb6787ddeb1 100644 --- a/src/prognostic_equations/zero_velocity.jl +++ b/src/prognostic_equations/zero_velocity.jl @@ -10,7 +10,8 @@ function zero_velocity_tendency!(Yₜ, Y, p, t, colidx) @. Yₜ.c.uₕ[colidx] = C12(FT(0), FT(0)) @. Yₜ.f.u₃[colidx] = Geometry.Covariant3Vector(FT(0)) - if p.atmos.turbconv_model isa EDMFX + if p.atmos.turbconv_model isa EDMFX || + p.atmos.turbconv_model isa AdvectiveEDMFX for j in 1:n @. Yₜ.f.sgsʲs.:($$j).u₃[colidx] = Geometry.Covariant3Vector(FT(0)) diff --git a/src/solver/model_getters.jl b/src/solver/model_getters.jl index ca0600dfb28..620233dc0f8 100644 --- a/src/solver/model_getters.jl +++ b/src/solver/model_getters.jl @@ -341,7 +341,8 @@ function get_turbconv_model( turbconv_params, ) turbconv = parsed_args["turbconv"] - @assert turbconv in (nothing, "edmf", "edmfx", "diagnostic_edmfx") + @assert turbconv in + (nothing, "edmf", "edmfx", "advective_edmfx", "diagnostic_edmfx") return if turbconv == "edmf" TC.EDMFModel( @@ -355,6 +356,10 @@ function get_turbconv_model( N = turbconv_params.updraft_number TKE = parsed_args["prognostic_tke"] EDMFX{N, TKE}(turbconv_params.min_area) + elseif turbconv == "advective_edmfx" + N = turbconv_params.updraft_number + TKE = parsed_args["prognostic_tke"] + AdvectiveEDMFX{N, TKE}(turbconv_params.min_area) elseif turbconv == "diagnostic_edmfx" N = turbconv_params.updraft_number TKE = parsed_args["prognostic_tke"] diff --git a/src/solver/types.jl b/src/solver/types.jl index 9673374188e..c044535db70 100644 --- a/src/solver/types.jl +++ b/src/solver/types.jl @@ -157,6 +157,12 @@ struct EDMFX{N, TKE, FT} <: AbstractEDMF end EDMFX{N, TKE}(a_half::FT) where {N, TKE, FT} = EDMFX{N, TKE, FT}(a_half) +struct AdvectiveEDMFX{N, TKE, FT} <: AbstractEDMF + a_half::FT # WARNING: this should never be used outside of divide_by_ρa +end +AdvectiveEDMFX{N, TKE}(a_half::FT) where {N, TKE, FT} = + AdvectiveEDMFX{N, TKE, FT}(a_half) + struct DiagnosticEDMFX{N, TKE, FT} <: AbstractEDMF a_int::FT # area fraction of the first interior cell above the surface a_half::FT # WARNING: this should never be used outside of divide_by_ρa @@ -165,13 +171,16 @@ DiagnosticEDMFX{N, TKE}(a_int::FT, a_half::FT) where {N, TKE, FT} = DiagnosticEDMFX{N, TKE, FT}(a_int, a_half) n_mass_flux_subdomains(::EDMFX{N}) where {N} = N +n_mass_flux_subdomains(::AdvectiveEDMFX{N}) where {N} = N n_mass_flux_subdomains(::DiagnosticEDMFX{N}) where {N} = N n_mass_flux_subdomains(::Any) = 0 n_prognostic_mass_flux_subdomains(::EDMFX{N}) where {N} = N +n_prognostic_mass_flux_subdomains(::AdvectiveEDMFX{N}) where {N} = N n_prognostic_mass_flux_subdomains(::Any) = 0 use_prognostic_tke(::EDMFX{N, TKE}) where {N, TKE} = TKE +use_prognostic_tke(::AdvectiveEDMFX{N, TKE}) where {N, TKE} = TKE use_prognostic_tke(::DiagnosticEDMFX{N, TKE}) where {N, TKE} = TKE use_prognostic_tke(::Any) = false @@ -234,6 +243,7 @@ Base.broadcastable(x::AbstractEnergyFormulation) = tuple(x) Base.broadcastable(x::AbstractPrecipitationModel) = tuple(x) Base.broadcastable(x::AbstractForcing) = tuple(x) Base.broadcastable(x::EDMFX) = tuple(x) +Base.broadcastable(x::AdvectiveEDMFX) = tuple(x) Base.broadcastable(x::DiagnosticEDMFX) = tuple(x) Base.broadcastable(x::AbstractEntrainmentModel) = tuple(x) Base.broadcastable(x::AbstractDetrainmentModel) = tuple(x) diff --git a/toml/edmfx_box.toml b/toml/edmfx_box.toml index 4f58178f41d..0e57384f748 100644 --- a/toml/edmfx_box.toml +++ b/toml/edmfx_box.toml @@ -13,3 +13,8 @@ alias = "min_area" value = 1.0e-3 type = "float" description = "Minimum area fraction per updraft. Parameter not described in the literature." + +[entr_coeff] +alias = "entr_coeff" +value = 1.0 +type = "float" \ No newline at end of file