Skip to content

Conversation

kmdeck
Copy link
Member

@kmdeck kmdeck commented Dec 8, 2023

Purpose

Close #134 - though some of the discussion around displacement height may be specific to land, where u = 0.

Deploys here: https://clima.github.io/SurfaceFluxes.jl/previews/PR139/basic_usage/index.html

To-do

figure out why CI fails thought I do not touch src, tomls
make sure it deploys with correct url

Content

add a markdown doc

Review checklist

I have:

In the Content, I have included

  • relevant unit tests, and integration tests,
  • appropriate docstrings on all functions, structs, and modules, and included relevant documentation.

  • I have read and checked the items on the review checklist.

@kmdeck kmdeck self-assigned this Dec 8, 2023
@glwagner
Copy link
Member

glwagner commented Dec 9, 2023

What do you think about me trying to turn this into a script that I can try to run and putting it in a new directory examples? If that seems like a nice idea I am happy to put the work into that. I think this is extremely helpful already so it's not necessary, but having a script that can be executed I think would accelerate getting up and started with this package even further?

@kmdeck
Copy link
Member Author

kmdeck commented Dec 11, 2023

What do you think about me trying to turn this into a script that I can try to run and putting it in a new directory examples? If that seems like a nice idea I am happy to put the work into that. I think this is extremely helpful already so it's not necessary, but having a script that can be executed I think would accelerate getting up and started with this package even further?

sure! A script would for be easier to start from. I also thought about making a Literate tutorial (julia script that runs but also appears in the docs with markdown). That is a little more involved but we have examples of how to update the make.jl to handle it. it might be nice if we envision a couple of tutorials being helpful?

@glwagner
Copy link
Member

Do you distinguish between examples and tutorials or are they the same thing? I find that example scripts are the most useful. Docs tutorials are also helpful for many (but less for me, as a developer in addition to user). I also like Literate to save some effort and code.

@kmdeck
Copy link
Member Author

kmdeck commented Dec 12, 2023

hm, in ClimaLSM we have docs tutorials (simple examples, intro to interface, etc, using Literate) and experiments (longer simulations more relevant to earth system modeling, not rendered as docs). Im not sure how to use Literate outside of the docs, though.

@glwagner
Copy link
Member

glwagner commented Dec 12, 2023

I'm just clarifying! We refer to examples as a script that can be executed and illustrates an entire workflow, like this:

https://github.com/CliMA/Oceananigans.jl/blob/main/examples/two_dimensional_turbulence.jl

A "tutorial" is a bit different in that it goes a bit more slowly and pedagogically and may not go through the entire workflow. Usually packages distinguish between "examples" and "tutorials" so I wanted to make sure we were talking about the same thing.

As for Literate, I think that is most relevant for examples, since it may not be useful to execute a tutorial anyways (but it's definitely possible to write a tutorial that way). But Literate allows us to write a script like any other but also include that script with output in the docs, maximizing its utility.

@glwagner
Copy link
Member

So just to summarize what's in this PR is great, I only wanted to ask if it would make sense to transfer its content to a script that could be executed (which I'm happy to do as well as setting up Literate).

I can also put a little atmos/ocean data into the example and then make a figure like I've done on CliMA/Thermodynamics.jl#172

@kmdeck
Copy link
Member Author

kmdeck commented Dec 12, 2023

So just to summarize what's in this PR is great, I only wanted to ask if it would make sense to transfer its content to a script that could be executed (which I'm happy to do as well as setting up Literate).

I can also put a little atmos/ocean data into the example and then make a figure like I've done on CliMA/Thermodynamics.jl#172

that all sounds great! Id learn from seeing literate set up from scratch.

These also provide a nice way to communicate with the atmos folks and make sure everyone is on the same page re usage.


```
const CP = CLIMAParameters
include(joinpath(pkgdir(SurfaceFluxes), "parameters", "create_parameters.jl"))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this line do? Maybe a comment to explain its function could help

const CP = CLIMAParameters
include(joinpath(pkgdir(SurfaceFluxes), "parameters", "create_parameters.jl"))
FT = Float32
toml_dict = CP.create_toml_dict(FT; dict_type = "alias")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the content of toml_dict?

u = FT(4) # horizontal windspeed
P = FT(101350)
T = FT(298.15)
q = FT(0.006)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Totally minor detail but I think all the FT's are distracting / make this harder to read so I'd advocate for leaving them out of a simple demonstration

air.

```
function compute_ρ_sfc(thermo_params, ts_atmos, T_sfc)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this function do?

@glwagner
Copy link
Member

So just to summarize what's in this PR is great, I only wanted to ask if it would make sense to transfer its content to a script that could be executed (which I'm happy to do as well as setting up Literate).
I can also put a little atmos/ocean data into the example and then make a figure like I've done on CliMA/Thermodynamics.jl#172

that all sounds great! Id learn from seeing literate set up from scratch.

These also provide a nice way to communicate with the atmos folks and make sure everyone is on the same page re usage.

Ok! I can add to this PR (but I'd need to be a collaborator) or can start a new PR once this is merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Examples of using SurfaceFluxes to compute fluxes given an atmosphere and ocean state?

2 participants