Skip to content

Add low resolution dataset for DYAMOND summer#77

Open
sriharshakandala wants to merge 2 commits intomainfrom
sk/update_dyamond_summer
Open

Add low resolution dataset for DYAMOND summer#77
sriharshakandala wants to merge 2 commits intomainfrom
sk/update_dyamond_summer

Conversation

@sriharshakandala
Copy link
Copy Markdown
Member

@sriharshakandala sriharshakandala commented Nov 20, 2024

Add a low-resolution initial conditions dataset for DYAMOND summer simulation.

Checklist:

  • I created a new folder $artifact_name
    • I added a README.md in that that folder that
      • describes the data and processing done to it
      • lists the sources of the raw data
      • lists the required citation, licenses
    • If applicable (e.g., for Creative Commons), I added a LICENSE file
    • I added the scripts that retrieve, process, and produce the artifact
    • I added the environment used for such scripts (typically, Project.toml
      and Manifest.toml)
    • I added the OutputArtifacts.toml file containing the information
      needed for package developers to add $artifact_name to their package
  • I uploaded the artifact folder to the Caltech cluster (in
    /groups/esm/ClimaArtifacts/artifacts/$artifact_name)
  • I added the relevant code to the Overides.toml on the Caltech Cluster
    (in /groups/esm/ClimaArtifacts/artifacts/Overrides.toml)
  • I added a link to the main README.md to point to the new artifact

@szy21
Copy link
Copy Markdown
Member

szy21 commented Nov 20, 2024

This is not quite right. To get the level -> pressure -> z conversion, you need to follow what is done here for the aerosols. With this, you will have a different z for each grid point, and you will need to interpolate to a fixed z coordinate, as in the aerosol artifact.

After you fix it, Could you make some latitude-pressure plots for different variables so I can take a look at whether it is reasonable?

@sriharshakandala sriharshakandala force-pushed the sk/update_dyamond_summer branch 2 times, most recently from 0a72619 to 0bd3fce Compare November 21, 2024 14:47
@sriharshakandala sriharshakandala changed the title Add elevation information and low resolution dataset for DYAMOND summer Add low resolution dataset for DYAMOND summer Nov 21, 2024
@akshaysridhar
Copy link
Copy Markdown
Member

akshaysridhar commented Nov 21, 2024

Tested on M1 Mac desktop; using locally generated plot script to viz datasets (some variable name choices in the generated dataset are unusual e.g. t as opposed to ta for air temperature)

julia> @time create_initial_conditions(FILE_PATH, "DYAMOND_SUMMER_ICS_p98deg.nc", skip=7)
351.898330 seconds (2.84 G allocations: 129.391 GiB, 2.12% gc time, 1.12% compilation time)

Averaged along `lon` dim:

dyamond_ciwc.pdf
dyamond_clwc.pdf
dyamond_crwc.pdf
dyamond_cswc.pdf
dyamond_p.pdf
dyamond_q.pdf
dyamond_rho.pdf
dyamond_T.pdf
dyamond_u.pdf
dyamond_w.pdf

Example slices at 828m altitude : Spec hum and air temp
Screenshot 2024-11-21 at 10 04 01 AM
Screenshot 2024-11-21 at 10 03 14 AM

@szy21
Copy link
Copy Markdown
Member

szy21 commented Nov 21, 2024

Thanks @akshaysridhar. Could you make some lat-lon plots at e.g. surface, 2km, and 5km (the z level doesn't need to be accurate)? I mostly want to make sure things are correct over topography.

@akshaysridhar
Copy link
Copy Markdown
Member

akshaysridhar commented Nov 21, 2024

Comment thread atmos_dyamond_summer/create_artifact.jl
Comment thread atmos_dyamond_summer/create_artifact.jl Outdated
Comment thread atmos_dyamond_summer/create_artifact.jl Outdated
@szy21
Copy link
Copy Markdown
Member

szy21 commented Nov 21, 2024

Please also update the README to describe the processing is done (See the README in the aerosol artifact for example).

Comment thread atmos_dyamond_summer/create_artifact.jl Outdated
Comment thread atmos_dyamond_summer/create_artifact.jl Outdated
Comment thread atmos_dyamond_summer/create_artifact.jl Outdated
@Sbozzolo
Copy link
Copy Markdown
Member

Also, this artifact is missing the Manifest.toml

@sriharshakandala
Copy link
Copy Markdown
Member Author

@szy21 : Would it be ok to compute rho and rho_e_tot directly in ClimaAtmos after interpolating the required variables? It would be much more efficient!

@szy21
Copy link
Copy Markdown
Member

szy21 commented Nov 23, 2024

@szy21 : Would it be ok to compute rho and rho_e_tot directly in ClimaAtmos after interpolating the required variables? It would be much more efficient!

Yes, that’s fine. How is it more efficient though?

@sriharshakandala
Copy link
Copy Markdown
Member Author

sriharshakandala commented Nov 23, 2024

@szy21 : Would it be ok to compute rho and rho_e_tot directly in ClimaAtmos after interpolating the required variables? It would be much more efficient!

Yes, that’s fine. How is it more efficient though?

For this low-resolution case, it reduced the processing time to about 25 sec from 400 sec. I would assume the total_energy and rho calculations are much more optimized and efficient in a distributed setting in ClimaAtmos

@Sbozzolo
Copy link
Copy Markdown
Member

It's not immediately clear to me that computing in atmos would be faster (what's faster: a linear interpolation, or computing some thermodynamic variables? The answer will be different for different resolutions and devices; for GPUs, it is probably preferable to reduce the file size anyway).

More importantly, this is only done at initialization, so performance is not important (unless it's really slow). What's preferable is trying to avoid introducing additional errors, if that can be avoided.

Interpolating and them computing variables is different from computing variables and then interpolating. My preference would go for the first (meaning, compute everything in ClimaAtmos) for two reasons:

  1. it ensure consistency in the Thermodynamics and the parameters being used
  2. it ensures that the thermodynamic variables are internally consistent (because they are computed one with the other directly)

@sriharshakandala sriharshakandala force-pushed the sk/update_dyamond_summer branch 2 times, most recently from c5cf282 to b07ebc6 Compare November 23, 2024 21:53
@sriharshakandala sriharshakandala marked this pull request as ready for review November 23, 2024 21:53
@sriharshakandala sriharshakandala marked this pull request as draft December 3, 2024 22:01
@akshaysridhar
Copy link
Copy Markdown
Member

https://buildkite.com/clima/climaatmos-target-gpu-simulations/builds/396#019461bf-f7e7-488d-9e35-83a91667450c Following this build I think we can clean up this PR and formalize the p14deg artifact @sriharshakandala.

@szy21
Copy link
Copy Markdown
Member

szy21 commented Feb 14, 2025

What's the status of this PR?

@sriharshakandala
Copy link
Copy Markdown
Member Author

What's the status of this PR?

I have updated it to use the main branch of ClimaInterpolations.jl. I am fine with merging this unless there are any other comments!

@sriharshakandala sriharshakandala marked this pull request as ready for review February 14, 2025 04:26
@akshaysridhar
Copy link
Copy Markdown
Member

akshaysridhar commented Jun 27, 2025

@ph-kev @imreddyTeja Any further comments on this PR? Do we merge this and close #78 ?

@akshaysridhar
Copy link
Copy Markdown
Member

@ph-kev Is it worth generalizing these regridding tools : https://github.com/CliMA/ClimaAnalysis.jl/blob/6b6b6b9abf987b7c375f4ee766a37a73705bd0d6/src/Atmos.jl#L63 in ClimaUtilities? I'm not sure what the best location for these tools would be.

Comment thread atmos_dyamond_summer/create_artifact.jl
Comment on lines +94 to +100
p = defVar(ncout, "p", FT, ("lon", "lat", "z",), attrib = OrderedDict(
"Datatype" => string(FT),
"standard_name" => "pressure",
"long_name" => "pressure",
"units" => "Pa",
),
)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

For this and altitude, it would be good to also include the short name as well.

@ph-kev ph-kev requested a review from imreddyTeja June 27, 2025 21:33
@ph-kev
Copy link
Copy Markdown
Member

ph-kev commented Jun 27, 2025

@ph-kev Is it worth generalizing these regridding tools : https://github.com/CliMA/ClimaAnalysis.jl/blob/6b6b6b9abf987b7c375f4ee766a37a73705bd0d6/src/Atmos.jl#L63 in ClimaUtilities? I'm not sure what the best location for these tools would be.

I think it depends on the use case of the regridding tools. Is it for making NetCDF files or something beyond that? If it is just for NetCDF files, I think it is okay to add them to ClimaUtilities.

@imreddyTeja

The downloaded artifact has a resolution of about 0.14 degrees. A low-resolution version of this data, with a resolution of about 1 degree (0.98 degrees) and a custom vertical grid that is uniform across all columns, is generated. The following procedure is followed for generating the low-resolution data:

- Since the horizontal grid is uniformly spaced, a low-resolution horizontal grid is generated by skipping some horizontal points.
- The input file uses hybrid sigma pressure coordinates in the vertical direction. First, we compute the pressure at the vertical levels using $P = ap(k) + P_S b(k)$. In the file, this is $P_S$ = `exp(lnsp)`, b = `hybm` and a = `hyam`. Next, we assume a hydrostatic profile and convert pressure to altitude over the mean sea level using $P = P0*exp(-z / H)$ with scale height $H$. We assume $P^* = 1e5$ (Pa) and $H = 7000$(m). Now, we select our target z, from 10m to 80km, and interpolate all source data onto this grid. We use "Flat" boundary conditions for those points that are outside the range of definition.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Assuming $P = P0*exp(-z / H)$ is not sufficiently accurate to convert pressure to altitude. Need to integrate hydrostatic balance (+ideal gas law) vertically, or, if available, use geopotential/grav for altitude.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Integrating hydrostatic balance is in fact what's being done below.

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.

6 participants