SECOORA / modeling

A place to discuss technical aspects of serving SECOORA model products, via issues and code/config fragments
MIT License
1 stars 0 forks source link

WRF output converted to NCL, FMRC not reading in times #2

Open jbzambon opened 8 years ago

jbzambon commented 8 years ago

For USEast WRF and COAWST-WRF, we haven't been saving the entire dataset, only some of the fields. wrfouts are huge and we derive some additional fields using NCL. The time fields are pushed over from the wrfout as an array of characters in a netcdf file I generate using NCL. I've included some sample ncl output files for reference (off GitHub because of the 100MB limit).

jbzambon@oceanus:~$ ncks -v Times 20160830.nc Times: type NC_CHAR, 2 dimensions, 0 attributes, chunked? no, compressed? no, packed? no Times size (RAM) = 25_19_sizeof(NC_CHAR) = 475*1 = 475 bytes Times dimension 0: Time, size = 25 (Record non-coordinate dimension) Times dimension 1: DateStrLen, size = 19 (Non-coordinate dimension)

Time[0] DateStrLen[0] Times[0--18]='2016-08-30_00:00:00' Time[1] DateStrLen[0] Times[19--37]='2016-08-30_03:00:00' .... Time[24] DateStrLen[0] Times[456--474]='2016-09-02_00:00:00'

As you can see, the array is very similar to ISO8601 formatted date strings. Any suggestion on how to rework these files so that FMRC can read them to create the "best" dataset?

Simply setting "_CoordinateModelRunDate" seems like it would get the initialization, but subsequent forecast times would be missing. At the moment I'm getting errors in FMRC trying to find the run dates, even with a simple test file referenced in the xml (useast_WRF_nf_catalog.xml; attached). I played around with dateFormatMark and other #yyyyMMdd# settings to no avail...

[2016-08-31T19:33:15.044+0000] WARN ucar.nc2.ft.fmrc.GridDatasetInv: GridDatasetInv using gds.getStartDate() for run date = [null, /home/jbzambon/20160830.nc] [2016-08-31T19:33:15.045+0000] ERROR ucar.nc2.ft.fmrc.Fmrc: makeFmrcInv java.lang.IllegalStateException: No run date

rsignell-usgs commented 8 years ago

@jbzambon, ISO date strings are unfortunately not CF compliant.

Here's some notes on making WRF files CF compliant: http://rsignell.tiddlyspace.com/#%5B%5BMaking%20WRF%20files%20CF-Compliant%5D%5D http://www.unidata.ucar.edu/blogs/developer/en/entry/wrf_goes_cf_two

I see also there is a "wrfout_to_cf" NCL conversion script here: http://www2.mmm.ucar.edu/wrf/src/utils/ncl/wrfout_to_cf.ncl http://foehn.colorado.edu/wrfout_to_cf/ but I haven't tried it, and I'm not sure if you use NCL.

jbzambon commented 8 years ago

@rsignell-usgs Great! I was able to get an implementation of this going with our nowcast/forecast. Doesn't seem like I can do this with earlier data. I took some stuff from the NCL script and FMRC is picking up the WRF data now. Thanks, I will be applying this to COAWST-WRF in a few days after I'm sure its "stable".

http://oceanus.meas.ncsu.edu:8080/thredds/catalog/fmrc/useast_wrf/catalog.html?dataset=fmrc/useast_wrf/USEast_WRF_Forecast_Model_Run_Collection_best.ncd