NOAA-EMC / graphcast

GraphCastGFS
https://graphcastgfs.readthedocs.io/en/latest/index.html
Apache License 2.0
17 stars 6 forks source link

Added capability to save output in grib2 format #25

Closed LinlinCui-NOAA closed 5 months ago

LinlinCui-NOAA commented 5 months ago

Description

This PR updated the run_graphcast.py script to provide an option to save output in grib2 format if argument "output" endswith "grib2" and added a new script utils.py to save utility functions. If in grib2 format, files will be saved one file per time, e.g., f006, f012, and so on.

Linked Issues

Blocking Dependencies

Anticipated Changes

Input data

Needed libraries

SadeghTabas-NOAA commented 5 months ago

@LinlinCui-NOAA generating grib2 files won't be an option for the user, we always need to generate grib2 files. Please name them as follows (it won't have .grib2 extension): for 00: graphcastgfs.t00z.pgrb2.0p25.f000 , graphcastgfs.t00z.pgrb2.0p25.f006, graphcastgfs.t00z.pgrb2.0p25.f012, ..., graphcastgfs.t00z.pgrb2.0p25.f240

for 06: graphcastgfs.t06z.pgrb2.0p25.f000 , graphcastgfs.t06z.pgrb2.0p25.f006, graphcastgfs.t06z.pgrb2.0p25.f012, ..., graphcastgfs.t06z.pgrb2.0p25.f240

for 12: graphcastgfs.t12z.pgrb2.0p25.f000 , graphcastgfs.t12z.pgrb2.0p25.f006, graphcastgfs.t12z.pgrb2.0p25.f012, ..., graphcastgfs.t12z.pgrb2.0p25.f240

for 18: graphcastgfs.t18z.pgrb2.0p25.f000 , graphcastgfs.t18z.pgrb2.0p25.f006, graphcastgfs.t18z.pgrb2.0p25.f012, ..., graphcastgfs.t18z.pgrb2.0p25.f240

SadeghTabas-NOAA commented 5 months ago

@LinlinCui-NOAA The grib2 files needs to be uploaded in the same directory as netcdf file in the s3. I've already written the function for this (look at run_graphcast.py) you need to update this function in a way that it takes all forecasts file names as a list variable (in the output option) instead of just getting the forecast netcdf file name. In addition please update the upload_to_s3bucket.py (it's for hera machine and it calls the same function in run_graphcast.py) accordingly. Thanks

SadeghTabas-NOAA commented 5 months ago

Once you are done with this please test it on hera and share the result directory with me. Thanks

LinlinCui-NOAA commented 5 months ago

@LinlinCui-NOAA generating grib2 files won't be an option for the user, we always need to generate grib2 files. Please name them as follows (it won't have .grib2 extension): for 00: graphcastgfs.t00z.pgrb2.0p25.f000 , graphcastgfs.t00z.pgrb2.0p25.f006, graphcastgfs.t00z.pgrb2.0p25.f012, ..., graphcastgfs.t00z.pgrb2.0p25.f240

for 06: graphcastgfs.t06z.pgrb2.0p25.f000 , graphcastgfs.t06z.pgrb2.0p25.f006, graphcastgfs.t06z.pgrb2.0p25.f012, ..., graphcastgfs.t06z.pgrb2.0p25.f240

for 12: graphcastgfs.t12z.pgrb2.0p25.f000 , graphcastgfs.t12z.pgrb2.0p25.f006, graphcastgfs.t12z.pgrb2.0p25.f012, ..., graphcastgfs.t12z.pgrb2.0p25.f240

for 18: graphcastgfs.t18z.pgrb2.0p25.f000 , graphcastgfs.t18z.pgrb2.0p25.f006, graphcastgfs.t18z.pgrb2.0p25.f012, ..., graphcastgfs.t18z.pgrb2.0p25.f240

Sure. I'll remove grib2 from the file name.