RE: [ncl-talk] read error

From: Debasish Pai Mazumder <debasish_at_nyahnyahspammersnyahnyah>
Date: Wed, 10 Oct 2007 17:01:04 -0800

Dear Erik,

Kindly check the type of data in your netcdf file. The NCAR/NCEP reanalysis
data is mostly short format. If your data is also short format, change it in
float.

 slp = short2flt(a->slp)
 slp = slp/100

Good Luck

Debasish

 

-----Original Message-----
From: nobleeu_at_gmail.com [mailto:nobleeu_at_gmail.com] On Behalf Of Erik Noble
Sent: Wednesday, October 10, 2007 3:59 PM
To: Debasish Pai Mazumder
Cc: ncl-talk_at_ucar.edu
Subject: Re: read error

This did not work. Thank you, though.
-Erik

On 10/10/07, Debasish Pai Mazumder <debasish_at_gi.alaska.edu> wrote:
> Dear Erik Noble,
>
> This error ("fatal:Assignment type mismatch, right hand side can't be
> coerced to type of left hand side") occurs due to mismatch of the type of
> the variables in left and right hand side.
>
> You may try to use 100. instead of 100 in your last line.
>
> Thanks
>
> Debasish
>
> -----Original Message-----
> From: ncl-talk-bounces_at_ucar.edu [mailto:ncl-talk-bounces_at_ucar.edu] On
Behalf
> Of Erik Noble
> Sent: Wednesday, October 10, 2007 3:32 PM
> To: ncl-talk_at_ucar.edu
> Subject: read error
>
> Hi. Could I have some help?
> I am receiving an error when reading a netCDF file (NCAR reanalysis to
> be exact) that contains only one variable.
>
> It looks like everything is correct.
>
> Thank you,
> Erik
>
>
> The error:
> noble:/Volumes/Data_and_Models/ncl_scripts enoble$ ncl
> NCAR_SLP_ht700_Plot.ncl
> Copyright (C) 1995-2007 - All Rights Reserved
> University Corporation for Atmospheric Research
> NCAR Command Language Version 4.3.1
> The use of this software is governed by a License Agreement.
> See http://www.ncl.ucar.edu/ for more details.
> fatal:Assignment type mismatch, right hand side can't be coerced to
> type of left hand side
> fatal:Execute: Error occurred at or near line 31 in file
> NCAR_SLP_ht700_Plot.ncl
>
> noble:/Volumes/Data_and_Models/ncl_scripts enoble$
>
> My code up to the line where error is occurring:
>
> ;*************************************************
> ; NCAR_SLP_ht700_Plot.ncl
> ;************************************************
> 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"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"
> ;************************************************
> begin
> ;************************************************
> ; read in netCDF file
> ;************************************************
> a = addfile("NCEP_SOP3_080710_12-slp.nc","r")
> b = addfile("NCEP_SOP3_080710_12-ht700.nc","r")
> type = "x11"
> ;type = "pdf"
> wks = gsn_open_wks(type,"NCAR-9-12UTC_SLP_Hgt_Panel")
> plot = new(2,graphic)
>
> lonW = -35
> lonE = 35
> latN = 35
> latS = -25
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> ; First get the variables we will need
>
> ;slp = a->PRMSL_3_MSL_10({latS:latN},{lonW:lonE}) ; slp (Pa)
> slp = a->slp ; slp (Pa)
> slp = slp/100 ; Turn
> Pressure into hPa
> _______________________________________________
> ncl-talk mailing list
> ncl-talk_at_ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
>

_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Oct 10 2007 - 19:01:04 MDT

This archive was generated by hypermail 2.2.0 : Thu Oct 11 2007 - 15:12:42 MDT