Skip to content

Commit 2ac7c40

Browse files
ray-chewZhaoyi ShendennisYatunincharleskawczynskiSbozzolo
committed
Apply review feedback, formatter, and update NEWS.md
- Format codebase using JuliaFormatter. - Apply suggested changes from code review. - Update release notes in NEWS.md reflecting recent changes. - Update ref_counter.jl for new NOGW CI results. Co-authored-by: Zhaoyi Shen <11598433@[email protected]> Co-authored-by: Dennis Yatunin <[email protected]> Co-authored-by: Charles Kawczynski <[email protected]> Co-authored-by: Gabriele Bozzola <[email protected]>
1 parent 05e2202 commit 2ac7c40

File tree

12 files changed

+87
-113
lines changed

12 files changed

+87
-113
lines changed

NEWS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ main
77
### Add support for reanalysis-driven single column model with time-varying forcing
88
PR [#3758](https://github.com/CliMA/ClimaAtmos.jl/pull/3758) adds support for driving single-column model (SCM) simulations with time-varying ERA5 reanalysis data. This extends the existing GCM-driven SCM interface to allow site-specific simulations that resolve the diurnal cycle and are suited for calibration against observations. Users can now run reanalysis-driven cases globally using only a date and lat/lon, thanks to integrated data handling via ClimaArtifacts.jl. See the updated “Single Column Model” docs page for details on setup, variable requirements, and how to prepare ERA5 input files.
99

10+
### Non-orographic gravity wave tendency as a callback
11+
12+
PR[#3761](https://github.com/CliMA/ClimaAtmos.jl/pull/3761) introduces support for intermittent calls to update the computation of non-orographic gravity wave tendencies. This PR closes issue[#3434](https://github.com/CliMA/ClimaAtmos.jl/issues/3434).
13+
1014
### Remove `dt_save_to_sol`
1115

1216
The option to save the solution to the integrator object (`dt_save_to_sol`) was

config/default_configs/default_config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ non_orographic_gravity_wave:
222222
value: false
223223
dt_nogw:
224224
help: "Time between calling non-orographic gravity wave update"
225-
value: "400secs"
225+
value: "1800secs"
226226
nh_poly:
227227
help: "Horizontal polynomial degree. Note: The number of quadrature points in 1D within each horizontal element is then Nq = <--nh_poly> + 1"
228228
value: 3

config/model_configs/single_column_nonorographic_gravity_wave.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@ t_end: "1500secs"
44
config: "column"
55
hyperdiff: false
66
dt: "400secs"
7-
output_default_diagnostics: true
87
disable_surface_flux_tendency: true
98
non_orographic_gravity_wave: true
109
dt_nogw: "400secs"
11-
# diagnostics:
12-
# - short_name: [ta, rhoa]
13-
# period: 400secs
10+

config/model_configs/sphere_nonorographic_gravity_wave.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ non_orographic_gravity_wave: true
55
dt_nogw: "450secs"
66
diagnostics:
77
- short_name: [ta, thetaa, ua, va, wa, zg, utendnogw, vtendnogw]
8-
period: 1hours
8+
period: 1hours

docs/src/diagnostics.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,6 @@ were computed differently for `EquilMoistModel` and `NonEquilMoistModel`.
209209
In `ClimaAtmos`, we define some helper functions to produce error messages, so
210210
the above code can be written as
211211
```julia
212-
213212
function compute_relative_humidity!(
214213
out,
215214
state,
@@ -227,7 +226,7 @@ end
227226

228227
compute_relative_humidity!(out, state, cache, time) =
229228
compute_relative_humidity!(out, state, cache, time, cache.atmos.moisture_model)
230-
compute_relative_humidity!(_, _, _, _, model::T) where {T} =
229+
compute_relative_humidity!(_, _, _, _, model) =
231230
error_diagnostic_variable("relative_humidity", model)
232231
```
233232

docs/src/gravity_wave.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ Similar to the base flux calculation but for the 3D fields, we computed ``N`` an
167167
```math
168168
^f V_{\tau}[k] = \max(\epsilon_0, - V[k] \cdot \frac{\tau}{|\tau|}),
169169
```
170-
where where ``\epsilon_0`` denotes a measure of floating-point precision.
170+
where ``\epsilon_0`` denotes a measure of floating-point precision.
171171

172172
Let ``L_1 = L_0 * \max(0.5, \min(2.0, 1.0-samp*V_\tau*d^2V_{\tau}/N^2))`` where ``samp=1.0`` is the correction for coarse sampling of ``d^2V/dz^2``, and
173173
```math

reproducibility_tests/ref_counter.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
234
1+
235
22

33
# **README**
44
#
@@ -20,6 +20,10 @@
2020

2121

2222
#=
23+
235
24+
- Related to #3775, the computation and update of non-orographic gravity wave (NOGW)
25+
are now separated into callback and tendencies update, affecting the NOGW-related
26+
tests.
2327
2428
234
2529
- Move the virtual mass term in pressure closure to prognostic edmf momentum equation

src/callbacks/callbacks.jl

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -399,16 +399,14 @@ NVTX.@annotate function rrtmgp_model_callback!(integrator)
399399
return nothing
400400
end
401401

402-
403-
404402
NVTX.@annotate function nogw_model_callback!(integrator)
405403
Y = integrator.u
406404
p = integrator.p
407405

408-
non_orographic_gravity_wave_compute_tendency!(Y,p)
406+
non_orographic_gravity_wave_compute_tendency!(Y, p)
407+
return nothing
409408
end
410409

411-
412410
#Uniform insolation, magnitudes from Wing et al. (2018)
413411
#Note that the TOA downward shortwave fluxes won't be the same as the values in the paper if add_isothermal_boundary_layer is true
414412
function set_insolation_variables!(Y, p, t, ::RCEMIPIIInsolation)

src/callbacks/get_callbacks.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -378,8 +378,7 @@ function get_callbacks(config, sim_info, atmos, params, Y, p)
378378
@warn "This simulation will not be reproducible when restarted"
379379
end
380380

381-
callbacks =
382-
(callbacks..., call_every_dt(nogw_model_callback!, dt_nogw))
381+
callbacks = (callbacks..., call_every_dt(nogw_model_callback!, dt_nogw))
383382
end
384383

385384
return callbacks

src/diagnostics/diagnostic.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,5 @@ include("tracer_diagnostics.jl")
101101
include("gravitywave_diagnostics.jl")
102102
include("conservation_diagnostics.jl")
103103

104-
105104
# Default diagnostics and higher level interfaces
106105
include("default_diagnostics.jl")

0 commit comments

Comments
 (0)