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

Bugfix on hybrid sigma-pressure to constant pressure level interpolation #150

Closed
wants to merge 6 commits into from

Conversation

yingkaisha
Copy link
Collaborator

@yingkaisha yingkaisha commented Jan 27, 2025

Bugfix

  • Minor fixes on credit.interp. Now it allows user-defined model-level coefficient names.
  • Added some documentation to the script.
  • Now geopotential at surface is loaded from model_level_file instead of the rollout files. This variable is static and typically not an output.
  • A new file test_interp_static.nc is added to pair to the existing test_interp.nc.

@yingkaisha yingkaisha marked this pull request as draft January 27, 2025 19:31
@yingkaisha yingkaisha marked this pull request as ready for review January 30, 2025 18:38
@yingkaisha
Copy link
Collaborator Author

Ready

@yingkaisha yingkaisha requested review from djgagne and WillyChap and removed request for WillyChap January 30, 2025 22:10
@djgagne
Copy link
Collaborator

djgagne commented Feb 3, 2025

I am ok with everything but adding the surface geopotential height to the model level netcdf file. I currently include the model level file in the credit metadata since it's a very small file, and adding surface geopotential would make the file a lot bigger. The ERA5 model levels and their coefficients are also constant across different spatial resolutions, whereas the surface geopotential field is not. When I call the pressure interpolation in credit/output.py, I link the surface geopotential variable to the model state xarray Dataset.

if "interp_pressure" in conf["predict"].keys():
if "surface_geopotential_var" in conf["predict"]["interp_pressure"].keys():
surface_geopotential_var = conf["predict"]["interp_pressure"][
"surface_geopotential_var"
]
else:
surface_geopotential_var = "Z_GDS4_SFC"
with xr.open_dataset(conf["data"]["save_loc_static"]) as static_ds:
ds_merged[surface_geopotential_var] = static_ds[
surface_geopotential_var
]
pressure_interp = full_state_pressure_interpolation(
ds_merged, **conf["predict"]["interp_pressure"]
)
ds_merged = xr.merge([ds_merged, pressure_interp])

@yingkaisha
Copy link
Collaborator Author

yingkaisha commented Feb 4, 2025

surface geopotential

surface geopotential is constant.
surface geopotential ≠ surface pressure

@yingkaisha yingkaisha marked this pull request as draft February 4, 2025 17:14
@yingkaisha yingkaisha closed this Feb 11, 2025
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.

2 participants