Re: ncl-talk Digest, Vol 88, Issue 51

From: zilore mumba <zmumba_at_nyahnyahspammersnyahnyah>
Date: Sun Mar 27 2011 - 23:56:44 MDT

Thanks very much to Louis, my problem was precisely case sensitivity, now all is
ok.
Thanks for your time Louis and all those who looked at my problem.
Zilore

----- Original Message ----
From: "ncl-talk-request@ucar.edu" <ncl-talk-request@ucar.edu>
To: ncl-talk@ucar.edu
Sent: Fri, March 25, 2011 4:40:41 PM
Subject: ncl-talk Digest, Vol 88, Issue 51

Send ncl-talk mailing list submissions to
    ncl-talk@ucar.edu

To subscribe or unsubscribe via the World Wide Web, visit
    http://mailman.ucar.edu/mailman/listinfo/ncl-talk
or, via email, send a message with subject or body 'help' to
    ncl-talk-request@ucar.edu

You can reach the person managing the list at
    ncl-talk-owner@ucar.edu

When replying, please edit your Subject line so it is more specific
than "Re: Contents of ncl-talk digest..."

Today's Topics:

  1. Re: Bus Error with MacOSX , ver 6.0.0-beta and ver 5.2.1
      (Mary Haley)
  2. Re: filled spherical polygon problem (Mary Haley)
  3. Re: filled spherical polygon problem (Li Dong)
  4. Assist with Addfile and lat = f1-->laat (zilore mumba)
  5. Re :  Assist with Addfile and lat = f1-->laat (louis Vonder)
  6. about the precedence of operator "^" and "-" ? (Xin Xie)
  7. Segmentation fault when reading from DODs server (Andrea Hahmann)
  8. divergence calculations (Michael Notaro)

----------------------------------------------------------------------

Message: 1
Date: Thu, 24 Mar 2011 14:55:43 -0600
From: Mary Haley <haley@ucar.edu>
Subject: Re: Bus Error with MacOSX , ver 6.0.0-beta and ver
    5.2.1
To: Saji Hameed <saji.nh@gmail.com>
Cc: ncl-talk <ncl-talk@ucar.edu>
Message-ID: <86803BCB-853B-4711-A317-58849A3C9EBB@ucar.edu>
Content-Type: text/plain; charset="us-ascii"

Hi Saji,

I don't know of any outstanding bug that would explain why you're seeing the seg
faults in 5.2.1/6.0.0-beta and not 5.1.1.

Would you be able to provide a script and data as per usual:

http://www.ncl.ucar.edu/report_bug.shtml

Thanks,

--Mary

On Mar 24, 2011, at 7:08 AM, Saji Hameed wrote:

> Update - On NCL 5.1.1, there is no bus error
>
> Note - I have a similar bus error on Linux RedHat. So I have never updated NCL
>on that machine from version 5.1.1
>
> On Thu, Mar 24, 2011 at 9:37 PM, Saji Hameed <saji.nh@gmail.com> wrote:
> Dear Developers,
>
> I encounter a bus error with the NCL precompiled binary for MacOSX (Snow
>Leopard, x86_64). The problem does not exist on my Linux machines.  I earlier
>saw a thread on the same topic started by Eric Noble, but could not trace it to
>the answer.
>
> In my case, the error is experienced when I call
> gsn_csm_contour_map in one script and gsn_csm_vector_scalar_map in another.  I
>have not tested with other graphic routines, though.
>
> I first installed NCL version 6.0.0-beta and then switched to 5.2.1, with the
>same effect.  I don't mind using older versions of NCL, but could not find a
>binary for the x86_64 architecture.
>
> Any hints?
>
> saji
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20110324/cd1071f1/attachment.html
 

------------------------------

Message: 2
Date: Thu, 24 Mar 2011 14:57:29 -0600
From: Mary Haley <haley@ucar.edu>
Subject: Re: filled spherical polygon problem
To: Li Dong <dongli@lasg.iap.ac.cn>
Cc: ncl-talk@ucar.edu
Message-ID: <31D9287F-FF48-4A41-92F3-E98E00F87783@ucar.edu>
Content-Type: text/plain; charset=us-ascii

Hi Li,

I'm looking into this. There's something odd about the ordering of the points
that causes the problem in some cases and not others.

In some situtations, the problem is due to big jumps in your longitude values,
which can be solved by subtracting from 360.

--Mary

On Mar 24, 2011, at 3:43 AM, Li Dong wrote:

> Dear all,
>
> I want to plot many spherical polygons filled with color that cover the whole
>sphere, but NCL fills some polygons wrongly, that is the entire map has been
>filled except the polygons. I have asked this question some time ago:
>
> http://www.ncl.ucar.edu/Support/talk_archives/2010/2644.html
>
> But the problem still exists. The attachment contains the scripts and data. Can
>anyone solve this problem? Thanks a lot!
>
> Best regards,
>
> Li Dong
>
> <ncl_polygon_problem.tar.gz>_______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

------------------------------

Message: 3
Date: Fri, 25 Mar 2011 09:03:49 +0800
From: Li Dong <dongli@lasg.iap.ac.cn>
Subject: Re: filled spherical polygon problem
To: Mary Haley <haley@ucar.edu>
Cc: ncl-talk@ucar.edu
Message-ID: <A874F328-5B66-4D90-993C-669ED201F246@lasg.iap.ac.cn>
Content-Type: text/plain; charset=us-ascii

Dear Mary,

Thanks a lot! The order of the vertices of each polygon is counter-clockwise.
And the range of the longitude is 0-360.

Best regards,

Li Dong

On Mar 25, 2011, at 4:57 AM, Mary Haley wrote:

> Hi Li,
>
> I'm looking into this. There's something odd about the ordering of the points
>that causes the problem in some cases and not others.
>
> In some situtations, the problem is due to big jumps in your longitude values,
>which can be solved by subtracting from 360.
>
>
> --Mary
>
> On Mar 24, 2011, at 3:43 AM, Li Dong wrote:
>
>> Dear all,
>>
>> I want to plot many spherical polygons filled with color that cover the whole
>>sphere, but NCL fills some polygons wrongly, that is the entire map has been
>>filled except the polygons. I have asked this question some time ago:
>>
>> http://www.ncl.ucar.edu/Support/talk_archives/2010/2644.html
>>
>> But the problem still exists. The attachment contains the scripts and data. Can
>>anyone solve this problem? Thanks a lot!
>>
>> Best regards,
>>
>> Li Dong
>>
>> <ncl_polygon_problem.tar.gz>_______________________________________________
>> ncl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>

------------------------------

Message: 4
Date: Thu, 24 Mar 2011 23:52:59 -0700 (PDT)
From: zilore mumba <zmumba@yahoo.com>
Subject: Assist with Addfile and lat = f1-->laat
To: ncl-talk@ucar.edu
Message-ID: <983302.75104.qm@web161606.mail.bf1.yahoo.com>
Content-Type: text/plain; charset=iso-8859-1

Definition of lat/lon in a file.
With Excuses on people's time with a very basic problem I have, I
would like to request once more if someone can spare some of their
time to look at my definition of lat/lon in the native_2.ncl ncl script.
1. I have binary data (not GRIB, but written into binary by fortran)
converted through Grads (Lats4d) into NetCdf. Both the original binary
file and the NetCdf versions work in Grads but not in ncl. I assumed
it did not work because the file was binary (not GRIB).
2. I took model output data in GRIB and made a ctl with grib2ctl and
converted to NetCdf in Grads. It does not work in ncl.
3. I downloaded 850hPa temperature data (in NetCdf format) from the
NCEP reanalysis page. It does not work in ncl, but works in Grads.
In all the three cases above the error is the same, as below
**************
?Copyright (C) 1995-2010 - All Rights Reserved
?University Corporation for Atmospheric Research
?NCAR Command Language Version 5.2.1
?The use of this software is governed by a License Agreement.
?See http://www.ncl.ucar.edu/ for more details.
fatal:Either file (f1) isn't defined or variable (Air) is not a
variable in the file
fatal:Execute: Error occurred at or near line 20 in file native_2.ncl
***********************************
Here is how I introduced the file
!!!!!!!!!
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
;*****************************************************
begin
?f1 = addfile("AirTempFeb11.nc","r")
?Air=f1->Air
?lat = f1->lat
?lon = f1->lon
?lat_len = dimsizes(lat)
?lon_len = dimsizes(lon)
; time = f1-> time
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
I would appreciate assistance, where am I making the mistake?
Appreciation
Zilore

     

------------------------------

Message: 5
Date: Fri, 25 Mar 2011 08:41:29 +0000 (GMT)
From: louis Vonder <appopson@yahoo.fr>
Subject: Re :  Assist with Addfile and lat = f1-->laat
To: zilore mumba <zmumba@yahoo.com>, ncl forum <ncl-talk@ucar.edu>
Message-ID: <91714.708.qm@web26302.mail.ukl.yahoo.com>
Content-Type: text/plain; charset="iso-8859-1"

Hi Zilore,

I am not expert in NCL, but just a user.

I think the error is coming from the fact that NCL is case sensitive.

There is difference between Air and air.

If you type ncdump -h AirTempFeb11.nc (outside NCL) or ncl_filedump
AirTempFeb11.nc? you can see that in your file coming from NCEP the variable is
air.

Change
Air=f1->Air
to
Air=f1->air

Regards

--- En date de?: Ven 25.3.11, zilore mumba <zmumba@yahoo.com> a ?crit?:

De: zilore mumba <zmumba@yahoo.com>
Objet: [ncl-talk] Assist with Addfile and lat = f1-->laat
?: ncl-talk@ucar.edu
Date: Vendredi 25 mars 2011, 7h52

Definition of lat/lon in a file.
With Excuses on people's time with a very basic problem I have, I
would like to request once more if someone can spare some of their
time to look at my definition of lat/lon in the native_2.ncl ncl script.
1. I have binary data (not GRIB, but written into binary by fortran)
converted through Grads (Lats4d) into NetCdf. Both the original binary
file and the NetCdf versions work in Grads but not in ncl. I assumed
it did not work because the file was binary (not GRIB).
2. I took model output data in GRIB and made a ctl with grib2ctl and
converted to NetCdf in Grads. It does not work in ncl.
3. I downloaded 850hPa temperature data (in NetCdf format) from the
NCEP reanalysis page. It does not work in ncl, but works in Grads.
In all the three cases above the error is the same, as below
**************
?Copyright (C) 1995-2010 - All Rights Reserved
?University Corporation for Atmospheric Research
?NCAR Command Language Version 5.2.1
?The use of this software is governed by a License Agreement.
?See http://www.ncl.ucar.edu/ for more details.
fatal:Either file (f1) isn't defined or variable (Air) is not a
variable in the file
fatal:Execute: Error occurred at or near line 20 in file native_2.ncl
***********************************
Here is how I introduced the file
!!!!!!!!!
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
;*****************************************************
begin
?f1 = addfile("AirTempFeb11.nc","r")
?Air=f1->Air
?lat = f1->lat
?lon = f1->lon
?lat_len = dimsizes(lat)
?lon_len = dimsizes(lon)
; time = f1-> time
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
I would appreciate assistance, where am I making the mistake?
Appreciation
Zilore

? ? ?
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk

     
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20110325/b211fa57/attachment.html
 

------------------------------

Message: 6
Date: Fri, 25 Mar 2011 08:59:10 -0400
From: Xin Xie <xiexinyls@gmail.com>
Subject: about the precedence of operator "^" and "-" ?
To: ncl-talk@ucar.edu
Message-ID:
    <AANLkTi=x+eW22Y2MUM7vbS2Eh2k0B+vwH2tsKcu_HBWc@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

Hi,

I found the exponent operator precedence lower than minus, which is not common.
For example
print(-1^2)
yields
1
I am not sure if this is a bug. If so, you may fix it. Thanks very much!

Xin Xie (Jason)
PhD Student
School of Marine and Atmospheric Sciences
Stony Brook University

------------------------------

Message: 7
Date: Fri, 25 Mar 2011 14:50:52 +0100
From: Andrea Hahmann <ahah@risoe.dtu.dk>
Subject: Segmentation fault when reading from DODs server
To: ncl-talk <ncl-talk@ucar.edu>
Message-ID: <C9B25C4C.10B4B%ahah@exchange.risoe.dk>
Content-Type: text/plain; charset="iso-8859-1"

Dear NCLelers,

I have written a script to extract a sub-set of model fields from (very
large) CFSR reanalysis datasets using a DODs version of NCL.  Its is saving
a lot of time not to have to transfer these big files over the network.
However, as the script goes along over a time loop it sometimes gives a
?segmentation fault? and the script stops.  Then, by hand I have to restart
the script and it continues on past the date that gave the original problem.
I suspect there are occasional problems with the network, but I have not
been able to confirm this. So, my question is: Is there any way to make the
script ?retry? the addfile preventing the segmentation fault to occur and
the script to stop?  Any other suggestions?

Thanks in advance for any guidance.
Andrea

-- 
Andrea N. Hahmann
Senior Scientist
Wind Energy Division
Ris? DTU
Technical University of Denmark
Ris? National Laboratory for Sustainable Energy
Frederikborgvej 399, P.O. Box 49
4000 Roskilde, Denmark
Direct +45 4677 5471
Mobil: +45 2133 0550
ahah@risoe.dtu.dk 
www.risoe.dtu.dk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20110325/3ce881aa/attachment.html
 
------------------------------
Message: 8
Date: Fri, 25 Mar 2011 09:40:36 -0500
From: Michael Notaro <mnotaro@wisc.edu>
Subject: divergence calculations
To: ncl-talk NCL <ncl-talk@ucar.edu>
Message-ID: <AB65B61A-6757-48FA-909F-62F04EDBC5D7@wisc.edu>
Content-Type: text/plain; charset="us-ascii"
My calculated monthly mean 250-hPa divergence map
looks extremely noisy (see attached plots of divergence
and interpolated u wind).
I started with 6-hourly U and V on a regional model lat2d x lon2d
grid.  I used int2p to interpolate U and V from sigma to 250 hPa.
Then I used rcm2rgrid to interpolate to a fixed grid.  Then I used
uv2dv_cfd to compute 250 hPa divergence of these interpolated
wind components.  Finally I averaged the divergences across
all time steps to get the monthly mean.
Any suggestions?  I assume the interpolated wind components
are not the best, and so the derivates for divergence look messy.
Michael
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"
begin
nlat=148
nlon=158
ctl=new((/8,148,158,10/),float)
months=(/"MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT"/)
yrs=(/"1991","1992","1993","1994","1995","1996","1997","1998","1999","2000"/)
yr=(/"91","92","93","94","95","96","97","98","99","00"/)
mns=(/"03","04","05","06","07","08","09","10"/)
hr=(/"06","00","00","00","00","00","00","00"/)
days=(/31,30,31,30,31,31,30,31/)
do iy=0,9
  do im=0,7
    print(iy+" "+im)
    if ( (yrs(iy)+""+mns(im).eq."199103").or.(yrs(iy)+""+mns(im).eq."199406") ) 
then
      a=addfile("../con9096/Southwest_ATM."+yrs(iy)+""+mns(im)+"0106.nc","r")
    else
      a=addfile("../con9096/Southwest_ATM."+yrs(iy)+""+mns(im)+"0100.nc","r")
    end if
    if ( (yrs(iy)+""+mns(im).eq."199103").or.(yrs(iy)+""+mns(im).eq."199406") ) 
then
      u=a->u(3::,:,:,:)
      v=a->v(3::,:,:,:)
      ps=a->ps(3::,:,:)
      time=a->time(3::)
    else
      if (mns(im).eq."03") then
        u=a->u(4::,:,:,:)
        v=a->v(4::,:,:,:)
        ps=a->ps(4::,:,:)
        time=a->time(4::)
      else
        u=a->u(:,:,:,:)
        v=a->v(:,:,:,:)
        ps=a->ps(:,:,:)
        time=a->time
      end if
    end if
    lat2d=a->xlat
    lon2d=a->xlon
    sigma=a->sigma
    ptop=a->ptop ; hPa
    nt=dimsizes(time)
    lat=fspan(min(lat2d),max(lat2d),148)
    lon=fspan(min(lon2d),max(lon2d),158)
    lat!0="lat"
    lat&lat=lat
    lat@units="degrees_north"
    lon!0="lon"
    lon&lon=lon
    lon@units="degrees_east"
    p=new((/nt,18,148,158/),float)
    do ilev=0,17
      p(:,ilev,:,:)=ps*sigma(ilev)
    end do
    copy_VarCoords(u,p)
    ulev=int2p(p(time|:,iy|:,jx|:,kz|:),u(time|:,iy|:,jx|:,kz|:),250.,1)
    vlev=int2p(p(time|:,iy|:,jx|:,kz|:),v(time|:,iy|:,jx|:,kz|:),250.,1)
    ulevel=ulev(:,:,:,0)
    vlevel=vlev(:,:,:,0)
    copy_VarCoords(ps,ulevel)
    copy_VarCoords(ps,vlevel)
    ugrid=rcm2rgrid(lat2d,lon2d,ulevel,lat,lon,0)
    vgrid=rcm2rgrid(lat2d,lon2d,vlevel,lat,lon,0)
    ugrid!0="time"
    ugrid!1="lat"
    ugrid!2="lon"
    ugrid&time=time
    ugrid&lat=lat
    ugrid&lon=lon
    copy_VarCoords(ugrid,vgrid)
    div=uv2dv_cfd (ugrid,vgrid,lat,lon,2)
    copy_VarCoords(ps,div)
    ctl(im,:,:,iy)=dim_avg_Wrap(div(iy|:,jx|:,time|:))
    out=addfile("out.nc","c")
    out->ctl=ctl(im,:,:,iy)
    out->ugrid=ugrid
    out->vgrid=vgrid
    delete(a)
    delete(time)
    delete(u)
    delete(v)
    delete(ps)
    delete(p)
    delete(ulev)
    delete(vlev)
    delete(ugrid)
    delete(vgrid)
    delete(div)
  end do
end do
end
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screen shot 2011-03-25 at 9.33.05 AM.png
Type: image/png
Size: 70849 bytes
Desc: not available
Url : 
http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20110325/0f80ceee/attachment.png
 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screen shot 2011-03-25 at 9.33.50 AM.png
Type: image/png
Size: 68806 bytes
Desc: not available
Url : 
http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20110325/0f80ceee/attachment-0001.png
 
------------------------------
_______________________________________________
ncl-talk mailing list
ncl-talk@ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
End of ncl-talk Digest, Vol 88, Issue 51
****************************************
      
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Mar 28 00:03:32 2011

This archive was generated by hypermail 2.1.8 : Mon Mar 28 2011 - 08:51:50 MDT