Re: Nio.open_file hangs NOT necessarily too few grid points in GRIB1

From: Wenchieh YEN <wenchieh.yen_at_nyahnyahspammersnyahnyah>
Date: Fri, 16 Feb 2007 13:43:28 +0100

Hi David,

having said, one grid point GRIB data is definitely a special case
regarding the grid spacing di and dj. However, the di and di's in a GRIB
record produced by the DWD mesoscale NWP model (Lokal Modell: LM) are
all set to zero, regardless of how many grid points are actually there.

The reason is that di and dj have a precision of 0.001 degree and it is
not enough to reveal the true grid spacing in one of the LM variants LME
(E for Europe), which has di=dj=0.0625 in a rotated lon-lat grid.
Therefore, all GRIB records from LM have di=dj=0 and the true grid
spacing are calculated using the first and the last Lat/Lon and nx/ny.

There is also something worth noting in one of the LM variants LMK,
which has a GRIB output schedule of 15 min. Since this forecast
timestamp is not specified in the GRIB doc, the PDS octet 18 is chosen
to be 13. As far as I know, for a 30 min output PDS octet 18 is coded as
14 at DWD. Of course, a warning will be issued by opening these using Nio.

Back to my problem. I noticed that it has possibly nothing to do with
the number of grid points but the length of the whole GRIB file. It is
perplexing because GRIB reading is actually record based. Some quick
tryouts showed that if a GRIB file, possibly with many records, has a
length less than c.a. 400kB, Nio stops working.

My system settings:

SuSE Linux 10.0
PyNGL_numpy-1.1.0-gcc3 (gcc4 not working)

OSX 10.4.8


David Ian Brown wrote:
> Hi Wenchieh,
> Handling GRIB records with only 1 data point is definitely a special
> case because the
> distance between grid points (di and dj in the GRIB docs) becomes 0, and
> therefore the code has to take
> precautions to avoid division by 0. I have added code to account for this.
> This does not explain why you were having problems with 4x4 grids, which
> I was not able to reproduce.
> Nevertheless I have made some modifications to the code that generates
> rotated lat/lon grid points
> and the rotation angle that may have fixed your problem.
> Can you tell me what system you were running on when you experienced the
> problems you described
> in your earlier email? I'd like to test my changes on a similar system.
> -dave

Wenchieh Yen
Institut fuer Physik der Atmosphaere
DLR Oberpfaffenhofen
T: +49 8153 28 2587
F: +49 8153 28 1841
E: wenchieh.yen @
Received on Fri Feb 16 2007 - 05:43:28 MST

This archive was generated by hypermail 2.2.0 : Sun Apr 01 2007 - 11:53:11 MDT