GithubHelp home page GithubHelp logo

Comments (6)

milankl avatar milankl commented on July 28, 2024

In the numerics of speedy there is only surface pressure ever used, in order to get "pressure" on other layers the geopotential is computed on those (with the surface geopotential being the orography times gravity). Hence, yes we had called it at some point pres_surf but realised it's a bit unnecessary as pres without _surf doesn't actually exist. Furthermore, for the ShallowWaterModel pres actually refers to the interface displacement which is often called eta. This is not to be confusing, but simply because we want to reuse that variable in that case -- and it has conceptually a very similar meaning.

To make things even more complicated it's actually the logarithm of surface pressure, so technically we should call it log_pres_surf pres_surf_log or whatever, as this seems to be just an overkill, we went for pres as it has conceptually the same meaning and is (hopefully) stated clearly in many parts of the code as that. I tend to annotate the variable names in many function signatures over and over again to avoid confusion and be clear about these issues. In that sense I believe we can never have a realitively short name that accurately describes what it is without making some sacrifice anyway. Hence I went for a bit shorter but a hopefully more comments overall to avoid confusion.

from speedyweather.jl.

milankl avatar milankl commented on July 28, 2024

@white-alistair which logic did you follow in convection.jl, is there something we should change?

from speedyweather.jl.

dmey avatar dmey commented on July 28, 2024

I think it would be worth discussing this a bit more so to maybe come up with some guidelines for developers. I appreciate your point but I still find the use of a variable named pres to mean a normalised surface pressure rather confusing. In column_variables.jl this is actually defined as surface pressure in hPa (i.e. not normalised)... Personally I would prefer to use more verbose variable names than contractions which lead to confusion and the code becoming unintelligible. If we could use those defined by the CF convention, the better. What is the reason for shortening variable names so much? I mean we are all using autocompletion so it's not like one has much to type. What's more In some sections of the code you already use fairly verbose variable names so it seems rather mixed.

from speedyweather.jl.

milankl avatar milankl commented on July 28, 2024

Note that we can do separate things in the dynamics vs the parameterizations. Why I'm hesitating in the dynamics is that pres may have units of [log(Pa)] in the PrimitiveEquationModel but [m] in the ShallowWaterModel. So being more specific than pres does not actually help because it creates even more confusion for the respectively other model. Happy to discuss this more, but for clarity in the parameterizations, where, I agree, clarification with units is more important, we could start by changing
https://github.com/milankl/SpeedyWeather.jl/blob/2da381d2eea75556b306d5e3a2fc954c921c0f49/src/column_variables.jl#L81-L83
meaning, you can add and change all pressure related variables as long as you pull D.surface.pres_grid[ij] which is the logarithm of surface pressure in Pa from the dynamics. So feel free to rename the variable to C.log_surf_pres in ColumnVariables and add surf_pres, norm_surf_pres etc.

from speedyweather.jl.

milankl avatar milankl commented on July 28, 2024

Update @dmey, in the physics ColumnVariables now has two fields

    # (log) pressure per layer
    const ln_pres::Vector{NF}    # logarithm of pressure [log(hPa)]
    const pres::Vector{NF}       # pressure [hPa]

In the dynamics we still have pres meaning the log of surface pressure [log(Pa)] in the PrimitiveEquation model or the layer height [m] in the shallow water model. Any strong feelings @white-alistair ? Now's the time probably as I'm addressing #255 anyway

from speedyweather.jl.

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

Hey, no strong feelings on my part. Your suggestion LGTM 👍

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.