Skip to content

Commit

Permalink
Merge cdf4dad into 6d02210
Browse files Browse the repository at this point in the history
  • Loading branch information
juliasloan25 authored Oct 12, 2024
2 parents 6d02210 + cdf4dad commit 942eb98
Show file tree
Hide file tree
Showing 37 changed files with 212 additions and 913 deletions.
16 changes: 16 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,19 @@ low-resolution version of such files is automatically downloaded when a
higher-resolution version is not available. Please, refer to
[ClimaArtifacts](https://github.com/CliMA/ClimaArtifacts) for more information.

### Code cleanup
#### Remove ClimaCoupler.Diagnostics module - PR [#953](https://github.com/CliMA/ClimaCoupler.jl/pull/953)
The ClimaCoupler Diagnostics module had become redundant with
ClimaDiagnostics.jl, a package designed to provide robust
diagnostics across the CliMA ecosystem.
Here we remove ClimaCoupler.Diagnostics and instead use
ClimaDiagnostics.

We're able to retrieve most of the diagnostics
we want directly from ClimaAtmos and ClimaLand, but also want
some that come from coupler-computed quantities, such as
`F_turb_energy`. In this PR we add this coupler quantity
to our output diagnostics using the ClimaDiagnostics interface.

This PR also removes the AMIP paperplots function, but this
functionality is replaced by the generalized `make_plots` function.
1 change: 0 additions & 1 deletion config/benchmark_configs/amip_diagedmf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ monthly_checkpoint: false
start_date: "20100101"
t_end: "12hours"
turb_flux_partition: "CombinedStateFluxesMOST"
use_coupler_diagnostics: false
prescribe_ozone: true
aerosol_radiation: true
prescribed_aerosols: ["CB1", "CB2", "DST01", "OC1", "OC2", "SO4", "SSLT01"]
1 change: 0 additions & 1 deletion config/benchmark_configs/amip_diagedmf_io.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ monthly_checkpoint: false
start_date: "20100101"
t_end: "12hours"
turb_flux_partition: "CombinedStateFluxesMOST"
use_coupler_diagnostics: true
prescribe_ozone: true
aerosol_radiation: true
prescribed_aerosols: ["CB1", "CB2", "DST01", "OC1", "OC2", "SO4", "SSLT01"]
4 changes: 4 additions & 0 deletions config/ci_configs/coarse_single_ft32.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@ precip_model: "0M"
rad: "allskywithclear"
t_end: "10days"
vert_diff: "true"
diagnostics:
- short_name: [mse, lr, edt, evu, ts, mass_strf, stab, vt, egr, toa_fluxes_net]
reduction_time: average
period: 1days
4 changes: 4 additions & 0 deletions config/ci_configs/coarse_single_ft64_hourly_checkpoints.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@ precip_model: "0M"
rad: "allskywithclear"
t_end: "10days"
vert_diff: "true"
diagnostics:
- short_name: [mse, lr, edt, evu, ts, mass_strf, stab, vt, egr, toa_fluxes_net]
reduction_time: average
period: 1days
3 changes: 1 addition & 2 deletions config/ci_configs/slabplanet_atmos_diags.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@ h_elem: 4
mode_name: "slabplanet"
moist: "equil"
mono_surface: true
output_default_diagnostics: false
precip_model: "0M"
rad: "gray"
t_end: "10days"
vert_diff: "true"
diagnostics:
- short_name: [mse, lr, edt, evu, ts, mass_strf, stab, vt, egr]
- short_name: [mse, lr, edt, evu, ts, mass_strf, stab, vt, egr, toa_fluxes_net]
reduction_time: average
period: 1days
1 change: 0 additions & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ experiment_pages = [
interface_pages = [
"checkpointer.md",
"conservation.md",
"diagnostics.md",
"fieldexchanger.md",
"fluxcalculator.md",
"interfacer.md",
Expand Down
30 changes: 0 additions & 30 deletions docs/src/diagnostics.md

This file was deleted.

7 changes: 3 additions & 4 deletions docs/src/postprocessor.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# PostProcessor

This module contains functions for postprocessing model data that was saved during the simulation
by `ClimaCoupler.Diagnostics`. This module is used for offline regridding, slicing and spatial
This module contains functions for postprocessing model data that was saved during the simulation.
This module is used for offline regridding, slicing and spatial
averages. It can also handle data from other sources (e.g., NCEP reanalysis).

## Diagnostics API
## PostProcessor API

```@docs
ClimaCoupler.PostProcessor.postprocess
Expand All @@ -17,4 +17,3 @@ ClimaCoupler.PostProcessor.RawData
ClimaCoupler.PostProcessor.DataPackage
```

2 changes: 1 addition & 1 deletion experiments/ClimaEarth/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ ArtifactWrappers = "0.2"
ClimaAnalysis = "0.5.10"
ClimaAtmos = "0.27"
ClimaCorePlots = "0.2"
ClimaDiagnostics = "0.2"
ClimaDiagnostics = "0.2.6"
ClimaLand = "0.14, 0.15"
ClimaParams = "0.10"
ClimaTimeSteppers = "0.7"
Expand Down
4 changes: 0 additions & 4 deletions experiments/ClimaEarth/cli_options.jl
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,6 @@ function argparse_settings()
help = "Device type to use [`auto` (default) `CPUSingleThreaded`, `CPUMultiThreaded`, `CUDADevice`]"
arg_type = String
default = "auto"
"--use_coupler_diagnostics"
help = "Boolean flag indicating whether to compute and output coupler diagnostics [`true` (default), `false`]"
arg_type = Bool
default = true
"--unique_seed"
help = "Boolean flag indicating whether to set the random number seed to a unique value [`false` (default), `true`]"
arg_type = Bool
Expand Down
2 changes: 2 additions & 0 deletions experiments/ClimaEarth/components/atmosphere/climaatmos.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ import Statistics
import LinearAlgebra
import ClimaAtmos as CA
import ClimaAtmos: set_surface_albedo!
import ClimaAtmos.Parameters as CAP
import ClimaCore as CC
import ClimaCore.Geometry:
import SurfaceFluxes as SF
import Thermodynamics as TD
import ClimaCoupler: Checkpointer, FieldExchanger, FluxCalculator, Interfacer, Utilities

include("climaatmos_extra_diags.jl")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,29 @@ CAD.add_diagnostic_variable!(
end,
)

CAD.add_diagnostic_variable!(
short_name = "toa_fluxes_net",
long_name = "Net TOA radiation fluxes",
standard_name = "net_toa_radiation_fluxes",
units = "W m^-2",
comments = "Net top of the atmosphere radiation fluxes, calculated by summing the upward and downward shortwave and longwave radiation fluxes.",
compute! = (out, state, cache, time) -> begin
# Perform sum of radiation fluxes (rsu + rlu - rsd - rld)
if isnothing(out)
return CC.Fields.array2field(cache.radiation.rrtmgp_model.face_sw_flux_up, axes(state.f)) .+
CC.Fields.array2field(cache.radiation.rrtmgp_model.face_lw_flux_up, axes(state.f)) .-
CC.Fields.array2field(cache.radiation.rrtmgp_model.face_sw_flux_dn, axes(state.f)) .-
CC.Fields.array2field(cache.radiation.rrtmgp_model.face_lw_flux_dn, axes(state.f))
else
out .=
CC.Fields.array2field(cache.radiation.rrtmgp_model.face_sw_flux_up, axes(state.f)) .+
CC.Fields.array2field(cache.radiation.rrtmgp_model.face_lw_flux_up, axes(state.f)) .-
CC.Fields.array2field(cache.radiation.rrtmgp_model.face_sw_flux_dn, axes(state.f)) .-
CC.Fields.array2field(cache.radiation.rrtmgp_model.face_lw_flux_dn, axes(state.f))
end
end,
)

"""
static_stability(cache)
Expand Down
Loading

0 comments on commit 942eb98

Please sign in to comment.