From: David Ian Brown <dbrown_at_nyahnyahspammersnyahnyah>

Date: Fri, 16 Feb 2007 11:41:38 -0700

Date: Fri, 16 Feb 2007 11:41:38 -0700

Wenchieh,

OK, thanks for this information -- it's quite useful. My earlier reply

was a bit of a shortcut.

In fact the Nio code does calculate dj and di using the difference

between the first and last lat/lons

divided by ny -1 or nx-1. This was actually what was leading to the

division by 0 in the case of only

a single grid point.

Since codes 13 and 14 for the forecast time unit are not otherwise

defined I can (in the case of records from DWD)

add code to treat these as .25 and .5 hours respectively.

Concerning your problem, it definitely seems odd. Can you say for sure

that the file lfff00150000.crop_4x4.grb

that you sent us is one of the files that does not work for you?

Because on my mac (still at 10.3.9) I have no problem reading it.

I will try it out on other systems to see if I can get it to fail.

Also I notice that these files have parameters from DWD table 204 which

is not yet incorporated into NCL.

A quick google search gives me the values below for table 204. Is this

correct? I can see that it is not complete.

Can you point me to an authoritative version of the table so that I can

add it into NCL's set of parameter tables.

Thanks.

-dave

131 RR20 Prob RR 20mm probability of total

precipitation > 20 mm %

132 RR50 Prob RR 50mm probability of total

precipitation > 50 mm %

133 RR100 Prob RR 100mm probability of total

precipitation > 100 mm %

134 RR25 Prob RR 25mm probability of total

precipitation > 25 mm %

135 RR40 Prob RR 40mm probability of total

precipitation > 40 mm %

136 RR70 Prob RR 70mm probability of total

precipitation > 70 mm %

141 FF10 Prob FF 10m/s probability of

maximum wind speed > 10 m/s %

142 FF15 Prob FF 15m/s probability of

maximum wind speed > 15 m/s %

143 FF20 Prob FF 20m/s probability of

maximum wind speed > 20 m/s %

144 FF25 Prob FF 25m/s probability of

maximum wind speed > 25 m/s %

151 SNOW1 Prob SNOW 1cm probability of

accumulated snow > 1 cm %

152 SNOW5 Prob SNOW 5cm probability of

accumulated snow > 5 cm %

153 SNOW10 Prob SNOW 20cm probability of accumulated

snow > 10 cm %

154 SNOW20 Prob SNOW 20cm probability of accumulated

snow > 20 cm %

161 GUST10 Prob GUST 10m/s probability of maximum

wind gust speed > 10 m/s %

162 GUST15 Prob GUST 15m/s probability of maximum

wind gust speed > 15 m/s %

163 GUST20 Prob GUST 20m/s probability of maximum

wind gust speed > 20 m/s %

164 GUST25 Prob GUST 25m/s probability of maximum

wind gust speed > 25 m/s %

165 GUST33 Prob GUST 33m/s probability of maximum

wind gust speed > 33 m/s %

On Feb 16, 2007, at 5:43 AM, Wenchieh YEN wrote:

*> 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
*

*> GCC-4.0.2
*

*> Python-2.4.4
*

*> Numpy-1.0.1
*

*> PyNGL_numpy-1.1.0-gcc3 (gcc4 not working)
*

*>
*

*> OSX 10.4.8
*

*> GCC-4.0.1
*

*> Python-2.4.3
*

*> Numpy-1.0.1
*

*> PyNGL_numpy-1.1.0
*

*>
*

*> Regards,
*

*> -Wenchieh-
*

*>
*

*>
*

*> 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 @ dlr.de
*

*> ------------------------------------------
*

Received on Fri Feb 16 2007 - 11:41:38 MST

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