Re: [Fwd: Re: Proposed ncl_convert2nc modification]

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Mon Jun 21 2010 - 15:17:01 MDT

I am sure that the question will be answered by NCL's GRIB expert.
Suffice it to say, GRIB is a moving target. EG: Historically,
NCEP left the short name columns blank so NCL created its'
own short names ... then NCEP decided they should fill in the short
names ... hence the disagreement.

As a fall back ...something generically like the following
may possibly be used to address the naming inconsistency:

function rdVar(f:file, varName[1]:string)
local varLookUp, iVar
begin
             ; variable look up table
   varLookUp = (/ \ ; (N,2)
               (/"oldVarName_1", "newVarName_1"/) \
               (/"oldVarName_2", "newVarName_2"/) \
                    ..... .....
               (/"oldVarName_N", "newVarName_N"/) /)

   iVar = ind( varLookUp(:,0).eq.varName ) ; is this an old name
   if (.not.ismissing(iVar)) then
       return( f->$varLookUp(iVar,1)$ ) ; use new variable name
   else
       return( f->$varName$ ) ; Use input variable name
   end if
end

==============================================================
If using addfiles

function rdVar(f:list, varName[1]:string)
local varLookUp, iVar
begin
             ; variable look up table
   varLookUp = (/ \ ; (N,2)
               (/"oldVarName_1", "newVarName_1"/) \
               (/"oldVarName_2", "newVarName_2"/) \
                    ..... .....
               (/"oldVarName_N", "newVarName_N"/) /)

   iVar = ind( varLookUp(:,0).eq.varName ) ; is this an old name
   if (.not.ismissing(iVar)) then
       return( f[:]->$varLookUp(iVar,1)$ ) ; use new variable name
   else
       return( f[:]->$varName$ ) ; Use input variable name
   end if
end

On 06/21/2010 01:56 PM, Julie Prestopnik wrote:
> Hello. This is a follow up question to a discussion earlier this year
> (see forwarded email) from 04/06/2010.
>
> I was given some direction on setting the environment variable
> NIO_GRIB2_CODETABLES in a way so that a user could point to previous
> versions of the tables in order to keep the same variable names. After
> looking at these tables, it appears that this will work for short name
> changes only.
>
> I encountered a similar problem recently where the field name, but not
> the short name part of the field name, changed. For example, the field
> name for long_name Temperature was TMP_P0_L104_GLC0 (see attached
> 20100606_i15_f006_WRF-RR.txt file produced from using ncl_filedump on
> the grb2 file) before either 20100611 or 20100612, but after that date
> the field name changed to TMP_P0_L105_GLC0 (see attached
> 20100621_i15_f006_WRF-RR.txt). Note the change from "L104" to "L105".
> Could you please tell me what the "P0", "L104"/"L105", and "GLC0" stand for?
>
> Another change in these files was that the sigma levels (lv_SIGL0 and
> lv_SIGL3) changed to hybrid levels (lv_HYBL0 and lv_HYBL3).
>
> We use ncl_convert2nc to convert the grb2 files to nc files and our
> software relies upon the names staying the same. Is there a way to work
> around this issue so that we can keep the same field names?
>
> Thanks,
> Julie
>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

-- 
======================================================
Dennis J. Shea                  tel: 303-497-1361    |
P.O. Box 3000                   fax: 303-497-1333    |
Climate Analysis Section                             |
Climate & Global Dynamics Div.                       |
National Center for Atmospheric Research             |
Boulder, CO  80307                                   |
USA                        email: shea 'at' ucar.edu |
======================================================
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Jun 21 15:19:01 2010

This archive was generated by hypermail 2.1.8 : Thu Jun 24 2010 - 14:10:27 MDT