GithubHelp home page GithubHelp logo

Comments (5)

milankl avatar milankl commented on July 28, 2024

On this note, for the shallow water model, I've decided to use the interface displacement η as prognostic variable, so the instantaneous layer thickness h = η + H, whereby H is the thickness at rest and H = H₀ - orography and H₀ a global constant, something like 8-12km probably. Having said that, I don't want to redefine the variable names in PrognosticVariables for the different models, so I'll be using pres (or even pres_log if we decide to redefine it) for η. This is probably an argument to keep this variable name quite generic (I vote for pres, as this has a generic meaning, whether you think about logarithm of surface pressure or interface displacement).

from speedyweather.jl.

white-alistair avatar white-alistair commented on July 28, 2024

@milankl picking this up again. How about the following approach:

  1. Pre-allocate a new grid variable pres_exp_grid in the GridVariables struct (the name is potentially misleading, but I think all of the options are suboptimal in their own way, so I'd be happy to go with your preference from the previous comment).
  2. In tendencies_parametrizations.jl, do pres_exp_grid = exp.(pres_grid), i.e. before any of the parametrizations are calculated, since this quantity is used by several of them. I'm not 100% this is the most logical place to do this, but as far as I know we only use this in the parametrizations.

Let me know what you think!

from speedyweather.jl.

milankl avatar milankl commented on July 28, 2024

Is pres_grid (i.e. the logarithm of surface pressure on the grid) even used for the tendencies? If not, we could just have pres_grid which is first transformed from spectral pres and then calculate the exponent in-place? Then pres would always be the logarithm of surface pressure in spectral space and pres_grid the surface pressure (hPa) in grid-point space.

from speedyweather.jl.

milankl avatar milankl commented on July 28, 2024

I agree that we should have one place where the exp is calculated as this is expensive (usually taking several times more cycles than +,-,*,/ etc) but maybe we don't have to allocate another array but can do it in-place like

for i in eachindex(pres_grid)
    pres_grid[i] = exp(pres_grid[i])
end

from speedyweather.jl.

white-alistair avatar white-alistair commented on July 28, 2024

As far as I can see it's only used for the physics, so yeah I think this works. I'll just comment it clearly so newcomers aren't confused :)

from speedyweather.jl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.