Skip to content

Commit 0a02579

Browse files
committed
unify surface variable naming
1 parent 5048b99 commit 0a02579

15 files changed

+60
-55
lines changed

NEWS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ ClimaCoupler.jl Release Notes
66

77
### ClimaCoupler features
88

9+
### Coupler fields surface variable names all use `_sfc` PR[#1195](https://github.com/CliMA/ClimaCoupler.jl/pull/1195)
10+
`T_S`, `z0m_S`, and `z0b_S` are renamed to `T_sfc`, `z0m_sfc`, and `z0b_sfc`.
11+
This makes them consistent with the other surface fields, e.g. `ρ_sfc` and `q_sfc`.
12+
913
#### Driver function `setup_and_run` added PR[#1178](https://github.com/CliMA/ClimaCoupler.jl/pull/1178)
1014
A new function `setup_and_run` is added, which takes in a path to a config file,
1115
and contains all the code to initialize component models and run the simulation.

docs/src/interfacer.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ following properties:
106106
| `surface_temperature` | temperature over the combined surface space | K |
107107
| `turbulent_fluxes` | turbulent fluxes (note: only required when using `PartitionedStateFluxes` option - see our `FluxCalculator` module docs for more information) | W m^-2 |
108108

109-
- `calculate_surface_air_density(atmos_sim::Interfacer.AtmosModelSimulation, T_S::ClimaCore.Fields.Field)`:
109+
- `calculate_surface_air_density(atmos_sim::Interfacer.AtmosModelSimulation, T_sfc::ClimaCore.Fields.Field)`:
110110
A function to return the air density of the atmosphere simulation
111111
extrapolated to the surface, with units of [kg m^-3].
112112

experiments/ClimaEarth/components/atmosphere/climaatmos.jl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ function Interfacer.update_field!(sim::ClimaAtmosSimulation, ::Val{:surface_temp
190190
# note that this field is also being updated internally by the surface thermo state in ClimaAtmos
191191
# if turbulent fluxes are calculated, to ensure consistency. In case the turbulent fluxes are not
192192
# calculated, we update the field here.
193-
sim.integrator.p.radiation.rrtmgp_model.surface_temperature .= CC.Fields.field2array(csf.T_S)
193+
sim.integrator.p.radiation.rrtmgp_model.surface_temperature .= CC.Fields.field2array(csf.T_sfc)
194194
end
195195
# extensions required by FluxCalculator (partitioned fluxes)
196196
Interfacer.get_field(sim::ClimaAtmosSimulation, ::Val{:height_int}) =
@@ -272,14 +272,14 @@ function FieldExchanger.update_sim!(atmos_sim::ClimaAtmosSimulation, csf, turbul
272272
end
273273

274274
"""
275-
FluxCalculator.calculate_surface_air_density(atmos_sim::ClimaAtmosSimulation, T_S::CC.Fields.Field)
275+
FluxCalculator.calculate_surface_air_density(atmos_sim::ClimaAtmosSimulation, T_sfc::CC.Fields.Field)
276276
277277
Extension for this function to calculate surface density.
278278
"""
279-
function FluxCalculator.calculate_surface_air_density(atmos_sim::ClimaAtmosSimulation, T_S::CC.Fields.Field)
279+
function FluxCalculator.calculate_surface_air_density(atmos_sim::ClimaAtmosSimulation, T_sfc::CC.Fields.Field)
280280
thermo_params = get_thermo_params(atmos_sim)
281281
ts_int = Interfacer.get_field(atmos_sim, Val(:thermo_state_int))
282-
FluxCalculator.extrapolate_ρ_to_sfc.(Ref(thermo_params), ts_int, Utilities.swap_space!(axes(ts_int.ρ), T_S))
282+
FluxCalculator.extrapolate_ρ_to_sfc.(Ref(thermo_params), ts_int, Utilities.swap_space!(axes(ts_int.ρ), T_sfc))
283283
end
284284

285285
# FluxCalculator.get_surface_params required by FluxCalculator (partitioned fluxes)
@@ -412,9 +412,9 @@ Returns a new `p` with the updated surface conditions.
412412
"""
413413
function get_new_cache(atmos_sim::ClimaAtmosSimulation, csf)
414414
if hasmoisture(atmos_sim.integrator)
415-
csf_sfc = (csf.T_S, csf.z0m_S, csf.z0b_S, csf.beta, csf.q_sfc)
415+
csf_sfc = (csf.T_sfc, csf.z0m_sfc, csf.z0b_sfc, csf.beta, csf.q_sfc)
416416
else
417-
csf_sfc = (csf.T_S, csf.z0m_S, csf.z0b_S, csf.beta)
417+
csf_sfc = (csf.T_sfc, csf.z0m_sfc, csf.z0b_sfc, csf.beta)
418418
end
419419

420420
p = atmos_sim.integrator.p
@@ -438,8 +438,8 @@ trigger flux calculation during Atmos `Interfacer.step!`. We only want to trigge
438438
timestep from ClimaCoupler.
439439
440440
For debigging atmos, we can set the following atmos defaults:
441-
csf.z0m_S .= 1.0e-5
442-
csf.z0b_S .= 1.0e-5
441+
csf.z0m_sfc .= 1.0e-5
442+
csf.z0b_sfc .= 1.0e-5
443443
csf.beta .= 1
444444
csf = merge(csf, (;q_sfc = nothing))
445445
"""

experiments/ClimaEarth/run_cloudless_aquaplanet.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,9 @@ ocean_sim = SlabOceanSimulation(
173173

174174
## coupler exchange fields
175175
coupler_field_names = (
176-
:T_S,
177-
:z0m_S,
178-
:z0b_S,
176+
:T_sfc,
177+
:z0m_sfc,
178+
:z0b_sfc,
179179
:ρ_sfc,
180180
:q_sfc,
181181
:surface_direct_albedo,

experiments/ClimaEarth/run_cloudy_aquaplanet.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,9 +196,9 @@ ocean_sim = SlabOceanSimulation(
196196

197197
## coupler exchange fields
198198
coupler_field_names = (
199-
:T_S,
200-
:z0m_S,
201-
:z0b_S,
199+
:T_sfc,
200+
:z0m_sfc,
201+
:z0b_sfc,
202202
:ρ_sfc,
203203
:q_sfc,
204204
:surface_direct_albedo,

experiments/ClimaEarth/run_cloudy_slabplanet.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,9 +240,9 @@ ocean_sim = SlabOceanSimulation(
240240

241241
## coupler exchange fields
242242
coupler_field_names = (
243-
:T_S,
244-
:z0m_S,
245-
:z0b_S,
243+
:T_sfc,
244+
:z0m_sfc,
245+
:z0b_sfc,
246246
:ρ_sfc,
247247
:q_sfc,
248248
:surface_direct_albedo,

experiments/ClimaEarth/run_dry_held_suarez.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,9 @@ boundary_space = ClimaCore.Spaces.horizontal_space(atmos_sim.domain.face_space)
142142

143143
## coupler exchange fields
144144
coupler_field_names = (
145-
:T_S,
146-
:z0m_S,
147-
:z0b_S,
145+
:T_sfc,
146+
:z0m_sfc,
147+
:z0b_sfc,
148148
:ρ_sfc,
149149
:q_sfc,
150150
:surface_direct_albedo,

experiments/ClimaEarth/run_moist_held_suarez.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,9 @@ ocean_sim = Interfacer.SurfaceStub((;
178178

179179
## coupler exchange fields
180180
coupler_field_names = (
181-
:T_S,
182-
:z0m_S,
183-
:z0b_S,
181+
:T_sfc,
182+
:z0m_sfc,
183+
:z0b_sfc,
184184
:ρ_sfc,
185185
:q_sfc,
186186
:surface_direct_albedo,

experiments/ClimaEarth/setup_run.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -458,9 +458,9 @@ function setup_and_run(config_file = joinpath(pkgdir(ClimaCoupler), "config/ci_c
458458

459459
## coupler exchange fields
460460
coupler_field_names = (
461-
:T_S,
462-
:z0m_S,
463-
:z0b_S,
461+
:T_sfc,
462+
:z0m_sfc,
463+
:z0b_sfc,
464464
:ρ_sfc,
465465
:q_sfc,
466466
:surface_direct_albedo,

experiments/ClimaEarth/test/debug_plots_tests.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,12 @@ plot_field_names(sim::Interfacer.SurfaceStub) = (:stub_field,)
4545
:F_turb_ρτyz,
4646
:P_liq,
4747
:P_snow,
48-
:T_S,
48+
:T_sfc,
4949
:ρ_sfc,
5050
:q_sfc,
5151
:beta,
52-
:z0b_S,
53-
:z0m_S,
52+
:z0b_sfc,
53+
:z0m_sfc,
5454
:radiative_energy_flux_toa,
5555
)
5656
atmos_names = (:atmos_field,)

0 commit comments

Comments
 (0)