Skip to content

Conversation

@TomMelt
Copy link

@TomMelt TomMelt commented Apr 14, 2025

fixes DataWaveProject/nonlocal_gwfluxes#48
fixes DataWaveProject/nonlocal_gwfluxes#51
fixes DataWaveProject/nonlocal_gwfluxes#52

Add 1x1 CNN non-local gravity wave model into CAM

This is an initial implementation of coupling the nonlocal gw models into CAM.

  • Instructions on how to run are included in the README.md
  • Path to traced/scripted NN can be provided via gw_nlgw_model_path namelist var
  • nlgw model can be enabled by setting use_gw_nlgw=.true. in the namelist
  • model std dev.s and means are currently hardcoded (this could be changed in a future PR)
  • era5 ak and bk coefficients are also hardcoded to interpolate between the ERA5 pressure grid and the CAM pressure grid
  • currently inference takes place on the GPU and as such this requires a GPU TorchScript model

Note

If you follow the instructions in the README.md before this is merged you need to checkout branch nonlocal-gws instead of datawave_ml

TODO

Merge Dependencies First

@TomMelt TomMelt added the enhancement New feature or request label Apr 14, 2025
@TomMelt TomMelt requested a review from ma595 April 14, 2025 14:37
@TomMelt TomMelt self-assigned this Apr 14, 2025
@TomMelt TomMelt requested a review from amangupta2 May 7, 2025 15:30
Comment on lines +31 to +41
lat, &! latitude (radians)
lon, &! longitude (radians)
ps, &! surface pressure
phis ! surface geopotential
real(r8), dimension(:,:), allocatable :: &
u, &! zonal wind (m/s)
v, &! meridional wind (m/s)
omega, &! vertical pressure velocity (Pa/s)
t, &! temperature (K)
theta, &! potential temperature (K)
pmid ! midpoint pressure (Pa)
Copy link
Author

Choose a reason for hiding this comment

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

@amangupta2 can you double check the units of the inputs/outputs vs training data and expected model output

Choose a reason for hiding this comment

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

Sorry for my late response on this, but all the units seem consistent.

Base automatically changed from coupling to datawave_ml May 23, 2025 14:45
@TomMelt TomMelt changed the title wip: initial framework for nonlocal GWs Implement 1x1 nonlocal GW model into CAM Jun 11, 2025
@TomMelt TomMelt marked this pull request as ready for review June 11, 2025 20:26
@amangupta2
Copy link

amangupta2 commented Jun 17, 2025

I have scripted the model but have been unable to run CAM successfully, so perhaps I can merge this PR tomorrow morning after our discussion?

@TomMelt
Copy link
Author

TomMelt commented Sep 17, 2025

Once we have merged #30 and #34 I think we can merge this. @ma595 would be good to have one of the longer runs to confirm results look sensible

@TomMelt TomMelt merged commit e0479be into datawave_ml Nov 7, 2025
@TomMelt TomMelt deleted the nonlocal-gws branch November 7, 2025 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

output utgw vtgw via CAM outputs use latest version of weights (epoch 85) update documentation to run CAM on derecho

4 participants