Skip to content

Add diagnostics in pressure coordinates#4252

Draft
ph-kev wants to merge 3 commits intomainfrom
kp/pressure-diags
Draft

Add diagnostics in pressure coordinates#4252
ph-kev wants to merge 3 commits intomainfrom
kp/pressure-diags

Conversation

@ph-kev
Copy link
Member

@ph-kev ph-kev commented Jan 30, 2026

This PR adds diagnostics in pressure coordinates. This PR requires merging CliMA/ClimaCore.jl#2422, CliMA/ClimaDiagnostics.jl#155, and CliMA/ClimaAnalysis.jl#362 and making releases for each of the packages.

An example of a name of a NetCDF file of a variable in pressure coordinates is hus_1d_inst_pressure.nc. By default, the pressure interpolation uses constant boundary conditions and the pressure levels are the same as those from ERA5 (see here).

Here is the output of ncdump on a NetCDF file of a variable in pressure coordinates:

ncdump result

output/baroclinic_wave_equil/output_0025/hus_1d_inst_pressure.nc
netcdf hus_1d_inst_pressure {
dimensions:
        time = UNLIMITED ; // (11 currently)
        lon = 72 ;
        lat = 36 ;
        pressure_level = 37 ;
        nv = 2 ;
variables:
        float time(time) ;
                time:units = "s" ;
                time:axis = "T" ;
                time:standard_name = "time" ;
                time:long_name = "Time" ;
                time:bounds = "time_bnds" ;
        float lon(lon) ;
                lon:units = "degrees_east" ;
                lon:axis = "X" ;
                lon:standard_name = "longitude" ;
                lon:long_name = "Longitude" ;
        float lat(lat) ;
                lat:units = "degrees_north" ;
                lat:axis = "Y" ;
                lat:standard_name = "latitude" ;
                lat:long_name = "Latitude" ;
        float pressure_level(pressure_level) ;
                pressure_level:long_name = "pressure" ;
                pressure_level:units = "Pa" ;
                pressure_level:stored_direction = "increasing" ;
                pressure_level:standard_name = "air_pressure" ;
        float time_bnds(time, nv) ;
                time_bnds:comments = "time bounds for each time value" ;
                time_bnds:units = "s" ;
        double date(time) ;
                date:units = "seconds since 2010-01-01T00:00:00" ;
                date:bounds = "date_bnds" ;
        double date_bnds(time, nv) ;
                date_bnds:comments = "date bounds for each date value" ;
                date_bnds:units = "seconds since 2010-01-01T00:00:00" ;
        float hus(pressure_level, lat, lon, time) ;
                hus:short_name = "hus" ;
                hus:long_name = "Specific Humidity, Instantaneous" ;
                hus:units = "kg kg^-1" ;
                hus:comments = "Mass of all water phases per mass of air" ;
                hus:start_date = "2010-01-01T00:00:00" ;

TODO

  • Run AMIP for a year from ClimaCoupler and produce diagnostics in pressure coordinates of ta, hur, hus, ua, and pfull

@ph-kev ph-kev force-pushed the kp/pressure-diags branch 4 times, most recently from 1c141ef to c306ef6 Compare February 1, 2026 18:45
@ph-kev
Copy link
Member Author

ph-kev commented Feb 2, 2026

From running AMIP (diagedmf + 0M + bucket for 1 year and 1 month, I plotted pressure slices at 850 hPa, 500 hPa, and 250 hPa of time-averaged hus, hur, and ta (removing a spin up of three months). The buildkite for the simulation is https://buildkite.com/clima/climacoupler-amip/builds/258).
pressure_slices_plot

@ph-kev ph-kev force-pushed the kp/pressure-diags branch from c306ef6 to 8040ad3 Compare February 2, 2026 22:54
Comment on lines +13 to +17
- short_name: [pfull, wa, va, rv, hus, ke]
period: 1days
reduction_time: average
pressure_coordinates: true
compute_every: 1hours
Copy link
Member Author

Choose a reason for hiding this comment

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

I don't know if this is a good simulation for writing diagnostics in pressure coordinates.

@ph-kev ph-kev requested review from juliasloan25 and szy21 February 2, 2026 22:56
@szy21
Copy link
Member

szy21 commented Feb 3, 2026

what's the default pressure coordinate fo the diagnostics?

@ph-kev
Copy link
Member Author

ph-kev commented Feb 3, 2026

what's the default pressure coordinate fo the diagnostics?

The default coordinates are the same as the one used for ERA5.

era5_pressure_levels() = return 100.0 .* [
    1, 2, 3, 5, 7, 10, 20, 30, 50, 70, 100, 125, 150, 175, 200, 225, 250, 300,
    350, 400, 450, 500, 550, 600, 650, 700, 750, 775, 800, 825, 850, 875, 900,
    925, 950, 975, 1000,
]

@szy21
Copy link
Member

szy21 commented Feb 3, 2026

And how does extrapolation work right now? e.g. for columns where the surface is lower than 1000 hPa.

Copy link
Member

@szy21 szy21 left a comment

Choose a reason for hiding this comment

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

Thanks!

@ph-kev
Copy link
Member Author

ph-kev commented Feb 3, 2026

And how does extrapolation work right now? e.g. for columns where the surface is lower than 1000 hPa.

The default is flat extrapolation, but I think linear extrapolation can also be used.

@ph-kev ph-kev force-pushed the kp/pressure-diags branch from 8040ad3 to 109cad6 Compare February 3, 2026 17:54
Copy link
Member

@juliasloan25 juliasloan25 left a comment

Choose a reason for hiding this comment

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

this looks good to me!

#### Writing in pressure coordinates

!!! compat "Compatibility"
This is only available in versions after than ClimaAtmos v0.34.0.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
This is only available in versions after than ClimaAtmos v0.34.0.
This is only available in versions after ClimaAtmos v0.35.0.

and maybe we can note it requires specific ClimaCore, ClimaDiagnostics, etc

Copy link
Member Author

Choose a reason for hiding this comment

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

I think it is fine to not include it for ClimaCore and ClimaDiagnostics, since I am going to bump the versions in the Project.toml for those packages anyway.

@ph-kev ph-kev force-pushed the kp/pressure-diags branch 2 times, most recently from 8356080 to d54e6e1 Compare February 6, 2026 18:27
@ph-kev ph-kev force-pushed the kp/pressure-diags branch from d54e6e1 to 890afe3 Compare February 6, 2026 20:17
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.

3 participants