Scheduled Downtime
On Friday 21 April 2023 @ 5pm MT, this website will be down for maintenance and expected to return online the morning of 24 April 2023 at the latest

Issues with converting SST nc data to grib

SaraCam

New member
Hi all,

I'm in the process of updating SSTs in the WRF v3.8 model but I'm running into WPS issues when attempting to convert GLSEA SST data from netcdf to grib. I'm aware that there are similar posts on this forum however, after trying out a couple of different options, I am still running into issues with this conversion.

So far I have attempted to use the iris package in python to convert netcdf to grib which results in Grib code '255' ie missing

1716324282858.png

I've also tried to convert the files using cdo following this tutorial. While I manage to produce grib files, ungrib results in empty files. I have attempted to use sst parameter ids (id 34) and skin temp (id 235) codes from ECMWF tables which produce grib files (logs below) however, ungrib is unsuccessful.
1716324257913.png

I am very unfamiliar with grib file manipulation and using my limited understanding, I assumed that if my Grib file had similar codes (e.g. 235) which matched the Vtable is WPS then ungrib should work, which is not the case (Vtable.ECMWF and generic Vtable.SST screenshots below).

1716324462832.png1716324588404.png


Any help to adequately convert netcdf to grib would be greatly appreciated.
 
Hi,
I know you said you've tried a few methods posted in this forum, but this is the best I'm aware of - using this example given by mgduda. Just want to make sure you're aware of that one.
 
Hi @kwerner,

Thanks so much for pointing me to that thread. I had attempted to create intermediate files previously but not following the example you've shared. The python scripts are super helpful, thank you! I've been following the example to covert GLSEA nc sst data to intermediate format. While I managed to create intermediate SST files and met_em files successfully, the output doesn't seem right (d01 and d03 {d03 should be Lake Michigan} met_em screenshots attached).

I suspect I'm missing something fundamental. For reference I've attached the python script I'm using to convert the SSTs to intermediate format and the namelist.wps. It seems to me like the masked sst array is not being interpolated correctly for some reason. I went for a LatLon projection given the 'almost equal' lat/lon distribution defined in the sst metadata however that might also be something I'm getting wrong.

Any help/suggestions would be much appreciated.

Thank you for all your help.

Sara
 

Attachments

  • namelist.wps
    2.3 KB · Views: 1
  • convert_pl_SC_v3.pdf
    22.4 KB · Views: 4
  • Screenshot 2024-06-20 at 12.30.44 PM.png
    Screenshot 2024-06-20 at 12.30.44 PM.png
    31.9 KB · Views: 2
  • Screenshot 2024-06-20 at 12.30.01 PM.png
    Screenshot 2024-06-20 at 12.30.01 PM.png
    21.4 KB · Views: 4
Last edited:
Hi @kwerner,

I've made some progress with this. The main issue I had was that I had to transpose the lat/lon. Once I do that, the met_em files look much better (see attached figs).

The next steps I need some help with are (1) should I be creating a new SST field or updating the SKINTEMP field when running metgrid? and (2) do you have any suggestions how I should go about only updating the unmasked values? ie avoiding that NA values on land surrounding the great lakes in the met_em files?

Thanks for you help!
 

Attachments

  • Screenshot 2024-06-21 at 8.20.21 AM.png
    Screenshot 2024-06-21 at 8.20.21 AM.png
    153.7 KB · Views: 5
  • Screenshot 2024-06-21 at 8.21.14 AM.png
    Screenshot 2024-06-21 at 8.21.14 AM.png
    311 KB · Views: 5
Hi Sara,
Please see my answers below:

(1) should I be creating a new SST field or updating the SKINTEMP field when running metgrid?

You need to create a new SST file and add this file to fg_name in namelist.wps, e.g.,

fg_name = 'GFS','SST',

Note that you need to follow the WPS convention to name your SST file, e.g., SST:yyyy-mm-dd_h

(2) how I should go about only updating the unmasked values? ie avoiding that NA values on land surrounding the great lakes in the met_em files?

You need to provide mask for your SST data in metgrid.tbl. Detailed instruction can be found in :

 
Thanks for your reply @Ming Chen, that's very helpful. To clarify, in my first question, what I meant to ask was: when I'm creating the intermediate files from my nc SST files following mgduda's tutorial, should I be creating a new variable name e.g. SST that is not included in the GFS intermediate files or should I be updating the SKINTEMP variable? (included in the GFS data). So basically my GFS intermediate files only have a SKINTEMP but no SST variable and I'm wondering if the SST intermediate files should include the same GFS variable ie SKINTEMP or a new variable e.g. SST.

If I use SKINTEMP as a variable name for my SST intermediate files, when I run metgrid I get the SKINTEMP variable update (with a mask issue/ white boundary around the great lakes) but if I use SST as the variable name I get a new variable - SST as well as the unaltered SKINTEMP in the met_em files.
 
Top