-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[JOSS review] Nat's Review of SpeedyWeather.jl #443
Comments
Nat also suggests looking into Paulius and Garner, 2006 for a simple radiation scheme |
implemented with #444 |
@milankl Let me know if you want me to do something |
I can create a type tree for the documentation and outline more clearly what new types within that tree need to fulfill in order to be used properly, e.g. what would a However, @maximilian-gelbrecht what do you think our community guidelines are or should be? I think "open an issue" is the answer to all of them, but maybe we can just make that clearer in the readme or documentation? |
I do think this is also a problem many Julia library have, so much so that I think that Julia should have some kind of built-in system that handles that. But that's probably besides the point here. Personally, I'd put it in the doc string of each abstract type.
We could think about enabling the GitHub Discussions as well, but currently I think it's fine to just use GitHub Issues for all of it. But yes, we should add a paragraph prominently to the documentation that encourages people to just open an issue if there are any questions, bugs, ideas, etc. We should also add an |
Agreed
Definitely |
Regarding @natgeo-wong comment:
@natgeo-wong I understand you are talking about https://speedyweather.github.io/SpeedyWeather.jl/dev/setups/#Shallow-water-with-mountains Personally I can change the resolution without any issue. Look at results below using using SpeedyWeather
for resolution in [63, 85, 127]
@info "resolution is T$(resolution)"
@show spectral_grid = SpectralGrid(trunc=resolution,nlev=1)
orography = NoOrography(spectral_grid);
initial_conditions = ZonalJet();
@show model.time_stepping
model = ShallowWaterModel(;spectral_grid, orography, initial_conditions);
simulation = initialize!(model);
run!(simulation,period=Day(6));
end [ Info: resolution is T63
spectral_grid = SpectralGrid(trunc = resolution, nlev = 1) = SpectralGrid:
├ Spectral: T63 LowerTriangularMatrix{Complex{Float32}}, radius = 6.371e6 m
├ Grid: 96-ring OctahedralGaussianGrid{Float32}, 10944 grid points
├ Resolution: 216km (average), 192km × 207km (Equator)
└ Vertical: 1-level SigmaCoordinates
model.time_stepping = Leapfrog{Float32} <: TimeStepper
├ trunc::Int64 = 63
├ Δt_at_T31::Second = 1800 seconds
├ radius::Float32 = 6.371e6
├ adjust_with_output::Bool = true
├ robert_filter::Float32 = 0.05
├ williams_filter::Float32 = 0.53
├ Δt_millisec::Dates.Millisecond = 900000 milliseconds
├ Δt_sec::Float32 = 900.0
└ Δt::Float32 = 0.0001412651
Weather is speedy: 100%|██████████████████████████████████████████████████████████| Time: 0:00:00 ( 3.37 millenia/day)
[ Info: resolution is T85
spectral_grid = SpectralGrid(trunc = resolution, nlev = 1) = SpectralGrid:
├ Spectral: T85 LowerTriangularMatrix{Complex{Float32}}, radius = 6.371e6 m
├ Grid: 128-ring OctahedralGaussianGrid{Float32}, 18688 grid points
├ Resolution: 165km (average), 147km × 156km (Equator)
└ Vertical: 1-level SigmaCoordinates
model.time_stepping = Leapfrog{Float32} <: TimeStepper
├ trunc::Int64 = 85
├ Δt_at_T31::Second = 1800 seconds
├ radius::Float32 = 6.371e6
├ adjust_with_output::Bool = true
├ robert_filter::Float32 = 0.05
├ williams_filter::Float32 = 0.53
├ Δt_millisec::Dates.Millisecond = 675000 milliseconds
├ Δt_sec::Float32 = 675.0
└ Δt::Float32 = 0.00010594883
Weather is speedy: 100%|██████████████████████████████████████████████████████████| Time: 0:00:01 (1279.78 years/day)
[ Info: resolution is T127
spectral_grid = SpectralGrid(trunc = resolution, nlev = 1) = SpectralGrid:
├ Spectral: T127 LowerTriangularMatrix{Complex{Float32}}, radius = 6.371e6 m
├ Grid: 192-ring OctahedralGaussianGrid{Float32}, 40320 grid points
├ Resolution: 112km (average), 100km × 104km (Equator)
└ Vertical: 1-level SigmaCoordinates
model.time_stepping = Leapfrog{Float32} <: TimeStepper
├ trunc::Int64 = 127
├ Δt_at_T31::Second = 1800 seconds
├ radius::Float32 = 6.371e6
├ adjust_with_output::Bool = true
├ robert_filter::Float32 = 0.05
├ williams_filter::Float32 = 0.53
├ Δt_millisec::Dates.Millisecond = 450000 milliseconds
├ Δt_sec::Float32 = 450.0
└ Δt::Float32 = 7.063255e-5
Weather is speedy: 100%|██████████████████████████████████████████████████████████| Time: 0:00:04 (303.66 years/day) Notice that when we construct the model, the tilmestep is different for different resolutions. I believe the CFL-type of instability you are hinting is taken care of by this automatic timestep change. Isn't it @milankl? My machine detailsjulia> versioninfo()
Julia Version 1.10.1
Commit 7790d6f064 (2024-02-13 20:41 UTC)
Build Info:
Note: This is an unofficial build, please report bugs to the project
responsible for this build and not to the Julia project unless you can
reproduce the issue using official builds available at https://julialang.org/downloads
Platform Info:
OS: macOS (arm64-apple-darwin23.3.0)
CPU: 10 × Apple M1 Max
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-15.0.7 (ORCJIT, apple-m1)
Threads: 8 default, 0 interactive, 4 GC (on 8 virtual cores)
Environment:
JULIA_EDITOR = code
julia> using Pkg; Pkg.status()
Project SpeedyWeather v0.8.0
Status `~/Research/SpeedyWeather.jl/Project.toml`
[621f4979] AbstractFFTs v1.5.0
[79e6a3ab] Adapt v4.0.1
[2119f1ac] AssociatedLegendrePolynomials v1.0.1
[de688a37] BitInformation v0.6.1
[052768ef] CUDA v5.2.0
⌃ [944b1d66] CodecZlib v0.7.3
[ffbed154] DocStringExtensions v0.9.3
⌃ [7a1cc6ca] FFTW v1.7.2
[cc61a311] FLoops v0.2.1
[442a2c76] FastGaussQuadrature v1.0.2
[a8297547] GenericFFT v0.1.6
⌃ [033835bb] JLD2 v0.4.44
[63c18a36] KernelAbstractions v0.9.16
⌃ [85f8d34a] NCDatasets v0.14.0
[27ebfcd6] Primes v0.5.5
[92933f4c] ProgressMeter v1.9.0
[b8865327] UnicodePlots v3.6.3
[ade2ca70] Dates
[37e2e46d] LinearAlgebra
[de0858da] Printf
[9a3f8284] Random
[10745b16] Statistics v1.10.0
[fa267f1f] TOML v1.0.3
Info Packages marked with ⌃ have new versions available and may be upgradable. |
Yes, the timestep is
Overall the time step is part of the numerics that SpeedyWeather should hide from the general user. A general user shouldn't worry about time stepping, scaling, transforms, etc. Sometimes that's inevitable, but that should be our mantra! |
@natgeo-wong As you have may seen in the recent pull requests the documentation is growing to address your points (feel free to check it out and comment back, appreciate any feedback!), currently missing are still your points from above, which I plan to adress next week, then you'll get a proper point-by-point response. Many thanks!!! |
@milankl How is this work coming along? |
@kthyng Thanks for the reminder, it's just a lot of documentation to write... I'm still working on @natgeo-wong's points (any feedback welcome to our recent progress on this issue!) who rightly requested to have more documentation, in particular we've added now
|
Responses to individual points @natgeo-wong
We now have 2D and 3D examples
introducing some of the types/components users can change and play around with. Others are discussed in other parts of the documentation, e.g. https://speedyweather.github.io/SpeedyWeather.jl/dev/land_sea_mask/#Time-dependent-land-sea-mask documents a time-dependent land-sea mask, or https://speedyweather.github.io/SpeedyWeather.jl/dev/analysis/ explains how to check for conservation of mass, energy etc on the fly using gradient operators and the spectral transform for spatial integrations: https://speedyweather.github.io/SpeedyWeather.jl/dev/gradients/
We did this. Thanks for the suggestion.
Thanks for the suggestion but in the end we decided against this because we wanted to separate the theoretical/physical/mathematical aspects from the implementation details, API, function signatures. We now usually have some example outlining how a given function/type is supposed to be used or extended and in that sense one can always request the docstring in the REPL like
We have added this to the readme and the documentation. There's many ways to contribute but we encourage people being interested to open an issue or reach out to us individually.
See https://speedyweather.github.io/SpeedyWeather.jl/dev/parameterizations/ and also more in answers below.
Only few have required fields, like orography, see https://speedyweather.github.io/SpeedyWeather.jl/dev/orography/, others like a custom coriolis struct would need to have a field
For the parameterizations we document the abstract types now in https://speedyweather.github.io/SpeedyWeather.jl/dev/parameterizations/ Technically you can always do julia> subtypes(SpeedyWeather.AbstractModelComponent)
16-element Vector{Any}:
SpeedyWeather.AbstractAdiabaticConversion
SpeedyWeather.AbstractAlbedo
SpeedyWeather.AbstractAtmosphere
SpeedyWeather.AbstractCoriolis
SpeedyWeather.AbstractDrag
SpeedyWeather.AbstractForcing
SpeedyWeather.AbstractGeopotential
SpeedyWeather.AbstractHorizontalDiffusion
SpeedyWeather.AbstractImplicit
SpeedyWeather.AbstractInitialConditions
SpeedyWeather.AbstractOrography
SpeedyWeather.AbstractParameterization
SpeedyWeather.AbstractParticleAdvection
SpeedyWeather.AbstractPlanet
SpeedyWeather.AbstractSchedule
SpeedyWeather.AbstractTimeStepper
julia> subtypes(SpeedyWeather.AbstractParameterization)
12-element Vector{Any}:
SpeedyWeather.AbstractBoundaryLayer
SpeedyWeather.AbstractClausiusClapeyron
SpeedyWeather.AbstractCondensation
SpeedyWeather.AbstractConvection
SpeedyWeather.AbstractRadiation
SpeedyWeather.AbstractSurfaceEvaporation
SpeedyWeather.AbstractSurfaceHeatFlux
SpeedyWeather.AbstractSurfaceThermodynamics
SpeedyWeather.AbstractSurfaceWind
SpeedyWeather.AbstractTemperatureRelaxation
SpeedyWeather.AbstractVegetation
SpeedyWeather.AbstractVerticalDiffusion But we are hesitating to put this list into the documentation as it sounds like we encourage users to just go ahead and define new concrete types for any of them. While some are straightforward to subtype, others are more complicated and so we'd rather explain those that we encourage users to experiment with and document them well but slowly growing the documentation over time.
Documented now are:
On
From a software engineering perspective it's easier and clearer to implement a very similar structure for (almost) all components. That's why we have abstract On Orography: We have
We have now several radiation schemes, see #502 #444 even though they are still very simple. More complicated ones on the todo list are #461, the Frierson 2006 2-band radiation (grey) and Fortran SPEEDY's 4-band radiation scheme (humidity and clouds impact radiation, +CO2 forcing). A simple |
Very nice work and detailed documentation! I have one passing comment, is that certain parameterizations and physics may only be relevant to |
All parameterizations act on vertical columns and are therefore only available for |
Maybe it should be mentioned somewhere? |
@natgeo-wong just added a prominent info block in the Parameterization docs for this! ☝🏼 Hope this is what you imagined and we can close this issue? |
Sorry was automatically closed with the pr merged. You should close it |
Okay, I had a look. Perhaps you should split the "Forcing and Drag" part into 2: (1) Introduction to Extensions and (2) Forcing and Drag. Also, I suggest a reordering. "Running SpeedyWeather" and "Extending SpeedyWeather" should probably come before the documentation on the physics and dynamics. But I will go ahead and close this issue. |
Good suggestion, I'll address those and references the pull requests here! |
Review of SpeedyWeather.jl by Nat (openjournals/joss-reviews#6323 (comment))
See the pdf for detailed comments.
reviewv1.pdf
Current outstanding issues on the checklist:
AbstractTypes
available for the different modelsAbstractType
modules are relevant for each of the different types of models (e.g.ShallowWaterModel
,PrimitiveDryModel
) available in SpeedyWeather.jlThe text was updated successfully, but these errors were encountered: