Skip to content
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

add surface flux tutorial to examples #303

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

wilsonduan10
Copy link
Contributor

@wilsonduan10 wilsonduan10 commented Jun 27, 2023

Purpose

This PR adds another example to the EKP docs which details the use of EKP to recover surface flux parameters in a perfect model example.

Content

This PR adds a few files in the examples/SurfaceFluxExample folder:

kappa_calibration.jl

This file implements EKI to recover the von-karman constant, which is used in many MOST equations. It pulls data from the John Hopkins Tubulence Channel Flow, which is used by ensemble members to predict friction velocity u*. The difference in the predicted u* to the observed u* given by the dataset is used to calibrate the von-karman constant. This file is rendered to the documentation through Literate and Documenter along with a few other example Julia files.

This file differs from the file given in the SURF_2023 folder in a few ways:

  • formatting: moved all imports to the top
  • only downloaded the profiles data since the code did not use the standard deviation data
    • however, we could use the standard deviation data to add noise to the input u
  • made code in the physical_model more concise
    • the physical model attempts to override the stability function constants with the parameter von karman constant, but there is nothing to override
    • the physical model extracts the von karman constant from the toml only to override it in a following line, so it is unnecessary to extract the von karman constant in the first place
  • changed the Gamma noise constant to scale by 0.0005 instead of 0.1 because 0.1 is too much noise; the observable u_star_obs is only ~0.04, so adding noise on the order of magnitude of 10^-1 is too much noise. This noise reduced the model's effectiveness.
  • In addition to plotting the truth observed u_star, I plotted y as well as the output of the model given the truthful parameters
  • I changed the second plot to a histogram to better fit the data given
  • I removed the transform_init_prior_to_constrained function because there is already a method provided by EKP that gets constrained parameters

setup_parameter_set.jl

This file is a helper file used by kappa_calibration.jl to define functions that are helpful for setting parameters necessary for the surface_conditions function from the SurfaceFluxes package.

alt_kappa_calibration.jl

This file is an alternate method of recovering the von-karman constant. Instead of using surface_conditions as the forward model, this example simply uses the wind profile function. The observable used is the mean wind given by the same dataset as kappa_calibration.jl. Although this file is not rendered to the documentation, it can be used by new developers to better understand the EKI pipeline.


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

@wilsonduan10 wilsonduan10 changed the title add surface flux tutorial to EnsembleKalmanProcesses.j add surface flux tutorial to examples Jun 29, 2023
@wilsonduan10 wilsonduan10 marked this pull request as ready for review June 30, 2023 00:22
@wilsonduan10 wilsonduan10 force-pushed the wd/surface-flux-example branch 2 times, most recently from 877be99 to 5f787ff Compare July 18, 2023 18:01
broken code for now

changed directory name

necessary fixes

might work

improve kappa model by reducing noise

better formatting

intermediate changes

additional changes

improvement to tutorial

docs build working

fix build

fixed make and added another jl file

removed data from make.jl and updated alt_kappa

added pre-rendered plots

undid changes to Project.toml in docs

small change to comments

added surface flux example

formatting changes
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.

1 participant