SST data

516 views
Skip to first unread message

kg

unread,
Mar 14, 2017, 12:08:00 PM3/14/17
to MPAS-Atmosphere Users
Hello,

Where can I get SST data to create surface update files for MPAS 5.0?

Kemal.

Dominikus Heinzeller

unread,
Mar 14, 2017, 3:37:03 PM3/14/17
to kg, MPAS-Atmosphere Users
Hi Kemal,

you can use any kind of gridded SST data set that runs through ungrib (WRF/WPS), you need those intermediate files.

For instance: https://www.ghrsst.org/ghrsst-data-services/services/ you need to choose L4 data when following one of those links (gridded, gap-free).

You can also search the Research Data Archive RDA. Or you can use/extract data from re-analyses if the resolution is good enough for you.

To run this data through ungrib, you should check or create the appropriate Vtable (see WPS/ungrib/Variable_Tables/ for examples and templates). MPAS will look for variables named “SST”, “SEAICE” (flag or fraction), and “LANDSEA” (land sea mask) in the intermediate files created by ungrib.

Cheers

Dom

--
You received this message because you are subscribed to the Google Groups "MPAS-Atmosphere Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mpas-atmosphere-...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

kg

unread,
Mar 14, 2017, 5:01:48 PM3/14/17
to MPAS-Atmosphere Users
Hello Dom,

Thank you very much for your kind reply and I do appreciate your guidance for both getting it and preparing to put it into the model. I will go to the site and search for a suitable dataset. With regards,

Kemal.

kg

unread,
Mar 15, 2017, 4:13:01 PM3/15/17
to MPAS-Atmosphere Users
Hello Dom, and others who wish to respond,

I looked at the SST data sources available at:

https://www.ghrsst.org/ghrsst-data-services/services/

and they are all in netcdf format. My immediate question is "How can I incorporate the SST data within these netcdf files into MPAS initialization?" For example, variables in netcdf files located below are:

https://data.nodc.noaa.gov/ghrsst/L4/GLOB/ABOM/GAMSSA_28km/2012/213/

short "lat(lat)"
short "lon(lon)"
int "time(time)"
short "analysed_sst(time,lat,lon)"
short "analysis_error(time,lat,lon)"
byte "sea_ice_fraction(time,lat,lon)"
byte "mask(time,lat,lon)"

I am not sure if MPAS-5.0 init_atmosphere can read netcdf files (I even added these variable names into the mpas_init_atm_surface.F file, recompiled, and added the file prefix into namelist.init_atmosphere), but the initialization process did not find the variable "landmask" and stopped there. If I have to use ungrib, then I guess I have to convert the netcdf files into grib2 files.

I am still learning all the steps involved running the code, and would appreciate if you could let me know the steps to prepare the "*.grid.sfc_update.nc" initialization file.

Thank you all who wish to contribute and for your time. With regards,

Kemal.

Dominikus Heinzeller

unread,
Mar 16, 2017, 5:53:10 AM3/16/17
to kg, MPAS-Atmosphere Users
Hi Kemal,

Right now you should use ungrib to create the intermediate files containing the SST data. init_atmosphere does not (yet) support reading in arbitrary netCDF files but relies on WPS data produced by ungrib or by the user. It is relatively easy to write a simple Fortran programme to read in a netCDF data set and produce an intermediate file, template code can be found at the end of this page: http://www2.mmm.ucar.edu/wrf/OnLineTutorial/Basics/IM_files/IM_wps.htm.

If you are using ungrib, then you need to convert the netCDF files into grib files. I use a little python tool to do that. It uses the pygrib module (https://github.com/jswhit/pygrib; requires several libraries to be installed, see here: https://jswhit.github.io/pygrib/docs/index.html) and grib record templates that I created (they must be adapted to the resolution etc. of the SST data being used). Attached is a zip file that contains the code I am using for download and conversion for your information.

Writing some piece of code to generate WPS files straight from netCDF might be easier, though. I can help you with this little programme if necessary (not before March 22).

Cheers,

Dom

noaa_oi_sst_seaice.zip

kg

unread,
Mar 16, 2017, 11:24:44 AM3/16/17
to MPAS-Atmosphere Users
Hello Dom,

Thank you very very much for your detailed and insightful comments and directions. I do appreciate that. I will follow your guidance. I can write a piece of code to write the netcdf files into grib files. No problem there. Yet, I will try first the python tool method that you mentioned and the links that you provided. I should be fine with that. If not, I will choose the code option next.

Thank you very much again. With my best regards,

Kemal.

Note: I had updated SST data for WRF runs at every 6 hours using ungrib before. In that study, I had obtained RTG SST files and converted them to WPS intermediate files and joined them with met intermediate fields to create met initialization files. I tried to use those SST files, but those files only have SST data in it while MPAS surface update step requires landmask and seaice data in input SST files in addition to SST data. I thought about modifying the surface update code (mpas_init_atm_surface.F) to skip landmask and seaice information and get those variables from other initialization steps, but the code a lot of dependence on both those additional variables in addition to SST that we specifically need. Since the daily netcdf files (such as ABOM) have sst, sea_ice_fraction and mask data in it, it makes sense and easier to use those netcdf files for the surface update initialization step by creating those intermediate files.


kg

unread,
Mar 16, 2017, 12:17:34 PM3/16/17
to MPAS-Atmosphere Users
Dom,

I apologize that I forgot to mention this very important point: While I thanked you for your help, I specifically forgot to thank you for providing your python scripts and supporting templates. Thank you very much for that and I appreciate your contribution. This is a very important help to me and to anyone else who wants to update their initialization with SST data. I did see significant near air temperature change along the coast when SST is updated that brought the forecast air temperature to observations. You are very thoughtful and helpful. Have a great day.

Kemal.

kg

unread,
Mar 22, 2017, 6:44:38 PM3/22/17
to MPAS-Atmosphere Users
Hi Dom,

I need your help again. I created the intermediate files via my code and then using ungrib as:

SST:2012-07-31_12
SST:2012-08-01_12
...
...
for every 24 hr using daily SST and ICEC mean values as well as LANDMASK from the statis lsmask file. I can read the content of the intermediate file using "rd_intermediate.exe" fine, which is:

================================================
FIELD = sst
UNITS = degree C DESCRIPTION = Sea surface temperature
DATE = 2012-07-31_12:00:00 FCST = 213.000000
SOURCE = NOAA
LEVEL = 201300.000000
I,J DIMS = 1440, 720
IPROJ = 0  PROJECTION = LAT LON
  REF_X, REF_Y = 1.000000, 1.000000
  REF_LAT, REF_LON = -89.750000, -179.750000
  DLAT, DLON = 0.250000, 0.250000
  EARTH_RADIUS = 6367.470215
DATA(1,1)=-999.000000

================================================
FIELD = xice
UNITS = fraction DESCRIPTION = ice cover
DATE = 2012-07-31_12:00:00 FCST = 213.000000
SOURCE = NOAA
LEVEL = 201300.000000
I,J DIMS = 1440, 720
IPROJ = 0  PROJECTION = LAT LON
  REF_X, REF_Y = 1.000000, 1.000000
  REF_LAT, REF_LON = -89.750000, -179.750000
  DLAT, DLON = 0.250000, 0.250000
  EARTH_RADIUS = 6367.470215
DATA(1,1)=-999.000000

================================================
FIELD = landmask
UNITS =  DESCRIPTION = land cover
DATE = 2012-07-31_12:00:00 FCST = 213.000000
SOURCE = NOAA
LEVEL = 201300.000000
I,J DIMS = 1440, 720
IPROJ = 0  PROJECTION = LAT LON
  REF_X, REF_Y = 1.000000, 1.000000
  REF_LAT, REF_LON = -89.750000, -179.750000
  DLAT, DLON = 0.250000, 0.250000
  EARTH_RADIUS = 6367.470215
DATA(1,1)=0.000000

 SUCCESSFUL COMPLETION OF PROGRAM RD_INTERMEDIATE
FORTRAN STOP
====================================

Then, I set data_sources in "namelist.init_atmosphere" file as:

&data_sources
    config_geog_data_path = '/aa/kgurer/WPS_GEOG/'
    config_met_prefix = 'FILE'
    config_sfc_prefix = 'SST'
    config_fg_interval = 86400
    config_landuse_data = 'USGS'
    config_use_spechumd = true
/

Thus, I have:

FILE:2012-07-31_12
SST:2012-07-31_12
...
...

in my run directory. Yet, when I try to create surface initialization file, I get "landmask field is zero" error:

 *******************************************************************************
 The global maximum of the 'landmask' field is zero, which suggests that this
 field was not in the input file.  A 'landmask' field is needed to properly
 interpolate surface fields.
 Please rerun after specifying a static or initial conditions file as input in
 the 'streams.init_atmosphere' file.
 *******************************************************************************

I looked at the "mpas_init_atm_surface.F" file where I think it is looking for the variable name (I assume capitalization being important) within the intermediate file as "landmask", but that doesn't help. As the error states, I tried to include intermediate input file into streams.init_atmosphere, but apparently I can only put one input file, and that has to be the gridded mesh file at the moment. I either put these variables into that file, or do something else. Am I setting streams.init_atmosphere and/or namelist.init_atmosphere file wrong? I attached both files and one sample intermediate file (gzipped) to this message for your information. I appreciate if you could help me on that. Thank you.

Kemal.



namelist.init_atmosphere
streams.init_atmosphere
test.SST.gz

kg

unread,
Mar 29, 2017, 10:39:50 AM3/29/17
to MPAS-Atmosphere Users
Hi Dom,

I found the answer to my question in another question that you had answered back in October last year and carefully re-reading the instructions to create the surface update files. I created the surface update files now. With regards.

Kemal.

EI

unread,
Sep 13, 2021, 3:05:25 PM9/13/21
to MPAS-Atmosphere Users
I could generate grib file using this code but Iam having an issue in generating ungrib file using WPS
Is it due to Vtable? For this grib file can you suggest me which Vtable should be referred for? 

I tried  ./g1print.exe file.grb

Copen: File = file.grb
Fortran Unit = 32765
UNIX File descriptor: 3

----------------------------------------------------
 rec GRIB GRIB  Lvl  Lvl  Lvl         Time      Fcst
 Num Code name  Code one  two                   hour
----------------------------------------------------
Error trying to read grib edition number in gribsize.
Possible corrupt grib file.
 Incorrect edition number  =          120
 Skipping the rest of the file and continuing.

***** End-Of-File on C unit   3

While in WPS4
Error encountered 
"ERROR: Grib2 file or date problem, stopping in edition_num."

Can you kindly suggest on this
Thanking you
Reply all
Reply to author
Forward
0 new messages