Comments (2)
This topic came up again in #128.
With a growing number of parameters and constants, in particular in relation to the parameterizations, the various structs and constantly unpacking them is becoming a bit messy.
@milankl suggested an example structure like (OUTDATED see below)
struct Constants
time_integration::TimeConstants
parametrization::ParametrizationConstants
end
struct ParametrizationConstants
clouds::CloudConstants
convection::ConvectionConstants
end
as well as, potentially, some kind of @unpack_all
macro for importing a specific struct of macros into a namespace.
In addition, we need to move some numbers from the Parameters struct into the Constants struct in order to avoid type promotions: #128 (comment)
Let's use this issue to do a general overhaul of how we use parameters and constants.
from speedyweather.jl.
Picking this up again, with #241 we'll have the following
abstract type AbstractDynamicsConstants{NF} end
abstract type AbstractParameterizationConstants{NF} end
struct DynamicsConstants{NF<:AbstractFloat} <: AbstractDynamicsConstants{NF}
struct ParameterizationConstants{NF<:AbstractFloat} <: AbstractParameterizationConstants{NF}
While it sounds tempting to group both into Constants
or something, i don't think it makes sense as BarotropicModel or ShallowWaterModel won't use ParameterizationConstants so we should keep them separate. I'm still in favour of the following distinction between parameters, coefficients, constants. While all are * constant * at runtime
- parameters are user-facing, have a default value but can be changed through arguments to
initialize_speedy
, and define together withPrognosticVariables
the model run completely. - coefficients are bundled parameters, to be used (mostly) within the same function/algorithm; e.g. we have the
MagnusCoefficients
for the calculation of saturation vapour pressure - constants face the dynamical core / parameterizations, are fully determined by all parameters/coefficients, may include some precalculation (e.g. the scaled time step which is not chosen directly as parameter) and conversion to a given number format.
So schematically we have
- user -> parameters + coefficients -> constants -> dynamical core / parameterizations
from speedyweather.jl.
Related Issues (20)
- Precompilation Error HOT 2
- Add proper citations in Docs via DocumenterCitations.jl HOT 1
- JOSS review: text comments HOT 6
- Replace `PythonPlot` with a Julia-based plotting library in Docs HOT 2
- Verifying conserved quantities HOT 15
- Modified dynamics HOT 16
- PrimitiveDry and WetModel generation on Julia v1.9 hangs HOT 10
- The PrimitiveWetModel example fails HOT 10
- unbalanced initial condition for Galewsky Jet HOT 4
- ShallowWater dataset on PDEArena HOT 6
- Modularise netCDF output
- Time stepping of particle tracking HOT 1
- Virtual temperature as prognostic variable
- Spectral filtering instead of hyperdiffusion
- Lagrangian sampling of the model state HOT 1
- Instability develops over long integrations HOT 24
- set! initial conditions HOT 2
- Additional LowerTriangularArray functionality HOT 11
- arbitrary tracer support HOT 2
- RingGrids: Conflicting Broadcast Rules HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from speedyweather.jl.