Re: Assigning value to logical variable.

From: gibies george <gibies_at_nyahnyahspammersnyahnyah>
Date: Mon Feb 28 2011 - 11:52:33 MST

What I am asking is whether there is a possibility of having the same
variable outside the function which have been taken in the place of the
local variable.

On 28 February 2011 23:50, gibies george <gibies@tropmet.res.in> wrote:

> *As told by Dennis on the discussion online and offline, the attached
> script gives the following output.*
>
> (0) norecs1yr=0
>
>
> Variable: season
> Type: integer
> Total Size: 4 bytes
> 1 values
> Number of Dimensions: 1
> Dimensions and sizes: [1]
> Coordinates:
> (0) 0
> (0) ================
> (0) Defining full = new(1,logical)
>
>
> Variable: full
> Type: logical
> Total Size: 4 bytes
> 1 values
> Number of Dimensions: 1
> Dimensions and sizes: [1]
> Coordinates:
> Number Of Attributes: 1
> _FillValue : Missing
> (0) Missing
> *(0)** **case 3 : full = False*
> *(0)** **C: False*
> *(0)** **E: False*
> *(0)** **F: False*
> *(0)** **G: True*
> *(0)** **H: (Message from Gibies)*
>
> *This what I am expecting. *
> *But when I paste the same thing on my script it gives a different
> output. *
> *(Case 3 is assigning a wrong value at position C: )*
> *Why is it so? *
> *Does the source of error is somewhere else?*
>
> Variable: data
> Type: float
> Total Size: 5101056 bytes
> 1275264 values
> Number of Dimensions: 3
> Dimensions and sizes: [time | 369] x [lat | 24] x [lon | 144]
> Coordinates:
> time: [101902..113103]
> lat: [-28.75..28.75]
> lon: [1.25..358.75]
> Number Of Attributes: 26
> unit : mm/day
> initial : 1
> yn : 2008
> y1 : 1979
> lastmonth : 9
> startmonth : 1
> dataend : 2009
> datastart : 1979
> exmons : True
> norecs1mo : 1
> norecs1yr : 12
> long_name : Average Monthly Rate of Precipitation
> valid_range : ( 0, 100 )
> units : mm/day
> add_offset : 0
> scale_factor : 1
> actual_range : ( 0, 85.967 )
> missing_value : -9.96921e+36
> precision : 32767
> least_significant_digit : 2
> var_desc : Precipitation
> dataset : GPCP Version 2.1 Combined Precipitation Dataset
> level_desc : Surface
> statistic : Mean
> parent_stat : Mean
> _FillValue : -9.96921e+36
> (0) ================
> (0) Defining full = new(1,logical)
>
>
> Variable: full
> Type: logical
> Total Size: 4 bytes
> 1 values
> Number of Dimensions: 1
> Dimensions and sizes: [1]
> Coordinates:
> Number Of Attributes: 1
> _FillValue : Missing
> (0) Missing
> *(0)** **case 3 : full = False*
> *(0)** **C: True*
> *(0)** **E: True*
> *(0)** **F: True*
> *(0)** **G: False*
> *(0)** **K: Rank = 3 Condition not yet handled: (Message from Gibies)*
>
> _________________________________________________________________________
>
>
> On 26 February 2011 21:42, gibies george <gibies@tropmet.res.in> wrote:
>
>> Sorry for the mistake.
>>
>> And thank you very much.
>>
>>
>> On 26 February 2011 21:36, Dennis Shea <shea@ucar.edu> wrote:
>>
>>> offline
>>>
>>> When you send requests for help, you should make our
>>> job easier. *Our time is valuable too!*
>>>
>>> For example, see the attached.
>>>
>>>
>>>
>>> On 2/26/11 1:16 AM, gibies george wrote:
>>>
>>>> Some part of my ncl script is as follows
>>>> ***********************************************
>>>>
>>>> print("Defineing full = new(1,logical)")
>>>> full = new(1,logical)
>>>> print(full)
>>>> if (norecs1yr .eq. 1)
>>>> print("case 1 : full = True")
>>>> full = True
>>>> print(""+full)
>>>> else
>>>> if (dimsizes(season) .eq. 1)
>>>> if (season(0) .eq. "all")
>>>> print("case 2 : full = True")
>>>> full = True
>>>> print(""+full)
>>>> else
>>>> *** print("case 3 : full = False")*
>>>> *** full = False **;;; Here is the key problem*
>>>> ***print(""+full)***
>>>> end if
>>>> else
>>>> print("case 4 : full = False")
>>>> full = False
>>>> print(""+full)
>>>> end if
>>>> end if
>>>> print(""+full)
>>>> lat = data&lat
>>>> lon = data&lon
>>>> print(full)
>>>> print(.not.full)
>>>>
>>>> ********************************
>>>> And the output is
>>>> ********************************
>>>>
>>>> (0)Defineing full = new(1,logical)
>>>>
>>>>
>>>> Variable: full
>>>> Type: logical
>>>> Total Size: 4 bytes
>>>> 1 values
>>>> Number of Dimensions: 1
>>>> Dimensions and sizes:[1]
>>>> Coordinates:
>>>> Number Of Attributes: 1
>>>> _FillValue :Missing
>>>> *(0)****Missing*
>>>> *(0)****case 3 : full = False*
>>>> *(0)****True*
>>>> (0)True
>>>>
>>>>
>>>> Variable: full
>>>> Type: logical
>>>> Total Size: 4 bytes
>>>> 1 values
>>>> Number of Dimensions: 1
>>>> Dimensions and sizes:[1]
>>>> Coordinates:
>>>> Number Of Attributes: 1
>>>> _FillValue :Missing
>>>> (0)True
>>>> (0)False
>>>>
>>>> ***********************************
>>>> Can anybody tell the reason ?
>>>>
>>>> --
>>>> *Gibies George, CSIR-RF,
>>>> Climate and Global Modelling Division,
>>>> Indian Institute of Tropical Meteorology,
>>>> Dr. Homi Bhabha Road,
>>>> NCL (P. O.), Pashan,
>>>> Pune 411008, India.*
>>>>
>>>> *http://sites.google.com/site/gibiesge/*
>>>>
>>>> Think about the environment. Save paper; Save Trees. Please don't print
>>>> this e-mail unless it is necessary.
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> ncl-talk mailing list
>>>> List instructions, subscriber options, unsubscribe:
>>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>>
>>>
>>
>>
>> --
>> *Gibies George, CSIR-RF,
>> Climate and Global Modelling Division,
>> Indian Institute of Tropical Meteorology,
>> Dr. Homi Bhabha Road,
>> NCL (P. O.), Pashan,
>> Pune 411008, India.*
>>
>> *http://sites.google.com/site/gibiesge/*
>>
>> Think about the environment. Save paper; Save Trees. Please don't print
>> this e-mail unless it is necessary.
>>
>
>
>
> --
> *Gibies George, CSIR-RF,
> Climate and Global Modelling Division,
> Indian Institute of Tropical Meteorology,
> Dr. Homi Bhabha Road,
> NCL (P. O.), Pashan,
> Pune 411008, India.*
>
> *http://sites.google.com/site/gibiesge/*
>
> Think about the environment. Save paper; Save Trees. Please don't print
> this e-mail unless it is necessary.
>

-- 
*Gibies George,   CSIR-RF,
Climate and Global Modelling Division,
Indian Institute of Tropical Meteorology,
Dr. Homi Bhabha Road,
NCL (P. O.), Pashan,
Pune 411008, India.*
*http://sites.google.com/site/gibiesge/*
Please Think about the environment. Save paper; Save Trees; and don't print
this e-mail unless it is necessary.

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Feb 28 11:52:40 2011

This archive was generated by hypermail 2.1.8 : Wed Mar 02 2011 - 09:18:13 MST