Page 1 of 1

Fix for opening GRIB files fo rCOAMPS 'ww3_regional/euro'

Posted: 07 Sep 2015 18:07
by salva
Hi,

Zygrib 7.0.0 does not open GRIB files for COAMPS 'ww3_regional/euro',
the terminal output tells that the GRIB records are not recognised (see below).
To solve this I've added the identifiers to the line src/GribRecord.cpp:172.
The patch below applies to zyGrib-7.0.0
http://speirofr.appspot.com/files/patch ... regi.patch

Best,
--
salva

Terminal output:

Code: Select all

====== GribRecord 242 : translateDataType() : Unknown Center GribRecord
idCenter=58 idModel=11 idGrid=255
dataType=103 levelType=1 levelValue=0
hour=96
sav   xmin=-15.000000 xmax=45.000000    ymin=29.000000 ymax=66.400000   savDi=0.200000 savDj=0.200000
final xmin=-15.000000 xmax=45.000000    ymin=29.000000 ymax=66.400000
Ni=301 Nj=188    entireWorldInLongitude=0
hasDiDj=1 Di,Dj=(0.200000 0.200000)
final     Di,Dj=(0.200000 0.200000)
hasBMS=1 isScanIpositive=1 isScanJpositive=1 isAdjacentI=1
Patch:

Code: Select all

From 5d442dca355df0101661112b5944ca1611ae5886 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Salva=20Peir=C3=B3?= <speirofr@gmail.com>
Date: Mon, 7 Sep 2015 18:34:26 +0200
Subject: [PATCH] zyGrib: Add GRIB idModel to recognize COAMPS 'ww3_regional/euro'

---
 src/GribRecord.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/GribRecord.cpp b/src/GribRecord.cpp
index ac483b6..902e0f4 100644
--- a/src/GribRecord.cpp
+++ b/src/GribRecord.cpp
@@ -169,6 +169,7 @@ void  GribRecord::translateDataType ()
 	 || (idCenter==7   && idModel==45  && idGrid==255) // saildocs.com RTOFS GulfStream
 	 || (idCenter==58 && idModel==22 && idGrid==179) // COAMPS
 	 || (idCenter==58 && idModel==22 && idGrid==158) // COAMPS
+	 || (idCenter==58 && idModel==11 && idGrid==255) // COAMPS 'ww3_regional/euro' (speirofr)
 	 || (idCenter==58 && idModel==22 && idGrid==255) // COAMPS via Saildocs
 	 || (idCenter==54 && idModel==47 && idGrid==255) // Canada GEM
 	) {
-- 
2.1.4