# Re: Assigning value to logical variable.

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Sat Feb 26 2011 - 09:04:09 MST

There is "no problem".

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

===================================
full is given the default "missing" value.
This is correect.
=====================================

if season=0 and norecs1yr=0 then

print("case 3 : full = False")
full = False ;;; Here is the key problem
print("C: "+full)

yields

(0) case 3 : full = False
(0) False

That is as it should be.

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,
> NCL (P. O.), Pashan,
> Pune 411008, India.*
>
>
> 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
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Sat Feb 26 09:04:15 2011

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