Re: FillValue attributes

From: Kumar, Anil (GSFC-617.0)[UNIV OF MARYLAND] <anil.kumar_at_nyahnyahspammersnyahnyah>
Date: Mon Nov 11 2013 - 07:59:47 MST

Phani and Denis,
Yes I also found similar problem recently when same script used with two
different ncl versions.
Thanks to point out this bug and fix.
Anil
 

On 11/11/13 9:33 AM, "R Phani" <rphani@tropmet.res.in> wrote:

>Dear Dennis,
>
>Thank you for finding out the bug. Initially, I thought my data was
>wrong.
>
>Regards,
>Phani.
>
>
>----- Original Message -----
>From: "Dennis Shea" <shea@ucar.edu>
>To: "R Phani" <rphani@tropmet.res.in>
>Cc: "NCL" <ncl-talk@ucar.edu>
>Sent: Monday, November 11, 2013 9:35:02 AM
>Subject: Re: FillValue attributes
>
>After trying several local files, I have managed to reproduce
>the error. A fix will likely appear in the 6.2.0 release.
>
>On 11/9/13 7:59 PM, R Phani wrote:
>> Dear Dennis,
>>
>> "The error message is likely bogus."
>> I don't think so, I have solved the error by making the integer to
>>float with 'round' and it worked.
>>
>> Anyway, my concern was that it gives different values (max value) for
>>different versions! (5.1.1 is realistic) with the script being same.
>>
>> Phani
>> -------------------------------------
>> bash-3.2$ ncl rel_humid_denis.ncl
>> Copyright (C) 1995-2009 - All Rights Reserved
>> University Corporation for Atmospheric Research
>> NCAR Command Language Version 5.1.1
>> The use of this software is governed by a License Agreement.
>> See http://www.ncl.ucar.edu/ for more details.
>>
>>
>> Variable: rh
>> Type: float
>> Total Size: 1227264 bytes
>> 306816 values
>> Number of Dimensions: 3
>> Dimensions and sizes: [lv_ISBL1 | 17] x [g0_lat_2 | 94] x [g0_lon_3 |
>>192]
>> Coordinates:
>> lv_ISBL1: [10..1000]
>> g0_lat_2: [90..-90]
>> g0_lon_3: [ 0..358.125]
>> Number Of Attributes: 3
>> units : %
>> long_name : relative humidity
>> _FillValue : 1e+20
>> (0) rh: min=0 max=100
>> bash-3.2$ /gpfs1/scientific_appln/ncl-6.0.0/bin/ncl rel_humid_denis.ncl
>> Copyright (C) 1995-2011 - All Rights Reserved
>> University Corporation for Atmospheric Research
>> NCAR Command Language Version 6.0.0-beta
>> The use of this software is governed by a License Agreement.
>> See http://www.ncl.ucar.edu/ for more details.
>>
>> Variable: rh
>> Type: float
>> Total Size: 1227264 bytes
>> 306816 values
>> Number of Dimensions: 3
>> Dimensions and sizes: [lv_ISBL1 | 17] x [g0_lat_2 | 94] x [g0_lon_3 |
>>192]
>> Coordinates:
>> lv_ISBL1: [10..1000]
>> g0_lat_2: [90..-90]
>> g0_lon_3: [ 0..358.125]
>> Number Of Attributes: 3
>> units : %
>> long_name : relative humidity
>> _FillValue : 1e+20
>> (0) rh: min=0 max=1996.69
>> ==============================================
>>
>> ----- Original Message -----
>> From: "Dennis Shea" <shea@ucar.edu>
>> To: "R Phani" <rphani@tropmet.res.in>
>> Cc: "NCL" <ncl-talk@ucar.edu>
>> Sent: Saturday, November 9, 2013 7:10:25 PM
>> Subject: Re: FillValue attributes
>>
>> None of your GRIB files were complete.
>> --------------------------------------
>> The error message is likely bogus.
>>
>> If the variables are 4D, the following is *incorrect*
>>
>> rh = relhum (t_spcfs, mr_spcfs, conform(t_spcfs, levs*100, 0))
>>
>> Please read the Mini-Language Manual about array numbers.
>>
>> If 4D, it should be
>>
>> rh = relhum (t_spcfs, mr_spcfs, conform(t_spcfs, levs*100, 1))
>>
>> The ordering is
>>
>> (time,lev,lat,lon) => (0,1,2,3)
>>
>> ====
>> Please try the attached.
>>
>> Also, please do not send data unless we ask for it.
>>
>>
>>
>> On 11/9/13 9:18 AM, R Phani wrote:
>>> Dear Dennis,
>>>
>>> Thank you for your help and making my code efficient.
>>>
>>> 1) I have tried on both 5.1.1 and 6.0.0-beta versions
>>> 2) Now, I have allocated the memory and modified following your
>>>suggestions.
>>>
>>> Still I am getting the same error.
>>>
>>> fatal:relhum: If one _FillValue attribute is set, then all of them
>>>must be set.
>>> fatal:Execute: Error occurred at or near line 45 in file rel_humid.ncl
>>>
>>> Is it like, when I use 'conform', the attributes also should be set? I
>>>have uploaded the data and the script.
>>>
>>> Phani
>>>
>>>
>>> ----- Original Message -----
>>> From: "Dennis Shea" <shea@ucar.edu>
>>> To: "R Phani" <rphani@tropmet.res.in>, "NCL" <ncl-talk@ucar.edu>
>>> Sent: Saturday, November 9, 2013 9:47:47 AM
>>> Subject: Re: FillValue attributes
>>>
>>> [1] What version of NCL are you using?
>>>
>>> %> ncl -V
>>>
>>> [2] Where have you allocated memory for 'rh'. In your code,
>>> I would have expected to see:
>>>
>>> rh = new (dimsizes(temp_cfs), typeof(temp_cfs))
>>>
>>> [3] Your code could be made more efficient.
>>>
>>> [a] Whenever an entire variable is being read don't use (:,:,:,:).
>>> NCL accesses the data more efficiently without the (:,:,:,:).
>>> In practice, you will likely not notice any speed difference.
>>>
>>> temp_spcfs = f1->TMP_GDS0_ISBL_10 ; (:,:,:,:)
>>> sp_spcfs = f2->SPF_H_GDS0_ISBL_10
>>> temp_cfs = f3->TMP_GDS0_ISBL_10
>>> sp_cfs = f4->SPF_H_GDS0_ISBL_10
>>>
>>> [b] NCL is an interpreted language. Generally, it is better to
>>> avoid 'do' loops. NCL has 2 functions which can be used to
>>> replace your do loop
>>>
>>> http://www.ncl.ucar.edu/Document/Functions/Built-in/conform.shtml
>>> http://www.ncl.ucar.edu/Document/Functions/Built-in/conform_dims.shtml
>>>
>>> Replace
>>> rh = new(dimsizes(temp_cfs),typeof(temp_cfs)) ; added for
>>>correctness
>>>
>>> do k = 1,nlevs
>>> do j = 1, nlon
>>> do i = 1,nlat
>>> pPa = levs(k)*100
>>> rh(i, j, k) = relhum (t_spcfs(i,j,k), sph_spcfs(i,j,k),
>>>pPa)
>>> end do
>>> end do
>>> end do
>>>
>>> With
>>>
>>> rh = relhum (t_spcfs, sph_spcfs, conform(t_spcfs, levs*100, 1)
>>>
>>> There is no need to preallocate space for 'rh'. rh will be created
>>> automatically.
>>>
>>> ------------
>>>
>>> If you are new to NCL, please read the Mini-Language Manual at:
>>>
>>> http://www.ncl.ucar.edu/Document/Manuals/
>>>
>>>
>>>
>>> On 11/9/13 6:59 AM, R Phani wrote:
>>>> Hi NCL users,
>>>>
>>>> I am getting the following error.
>>>>
>>>> fatal:relhum: If one _FillValue attribute is set, then all of them
>>>>must be set.
>>>> fatal:Execute: Error occurred at or near line 45 in file rel_humid.ncl
>>>>
>>>> What could be the problem in the script?
>>>>
>>>> Phani
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> ncl-talk mailing list
>>>> List instructions, subscriber options, unsubscribe:
>>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>>
>_______________________________________________
>ncl-talk mailing list
>List instructions, subscriber options, unsubscribe:
>http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Nov 11 08:00:04 2013

This archive was generated by hypermail 2.1.8 : Mon Nov 11 2013 - 09:45:33 MST