[ncl-talk] Error

Najib Yusuf najibgal at yahoo.com
Tue Jun 23 05:51:42 MDT 2015


Dear Sir/Madam,Kindly guide me to solve this error message. I am trying to plot contour map of surface pressure from CESM data but i am receiving the below error, i tried to figure out the solution but could not. Thank you.

ncl 0>  dir = "/home/model-user/CESM/" 
ncl 1> filen = "cesmdata/inputdata/atm/cam/ozone/waccm_ozone_c121126.nc"
ncl 2> f1 = addfile("cesmdata/inputdata/atm/cam/ozone/waccm_ozone_c121126.nc","r")
ncl 3> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
ncl 4> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
ncl 5> begin
ncl 6> vNames = getfilevarnames (f1)
ncl 7> nNames = dimsizes (vNames)
ncl 8> print (vNames)
ncl 9>  PS = f1->PS
ncl 10> wks = gsn_open_wks("ps","proj")
ncl 11> gsn_define_colormap(wks,"gui_default")
ncl 12>  res                   = True
ncl 13> res at mpProjection      = "Mollweide"
ncl 14> res at mpGridAndLimbOn   = True
ncl 15> res at mpPerimOn         = False
ncl 16> res at mpGridLatSpacingF = 30.
ncl 17> res at mpGridLonSpacingF = 30.
ncl 18> res at mpFillOn          = False
ncl 19> res at cnFillOn          = True
ncl 20> res at cnLineLabelsOn    = False
ncl 21> res at txFontHeightF     = 0.015
ncl 22> res at vpXF            = 0.1
ncl 23> res at vpYF            = 0.9
ncl 24> res at vpWidthF        = 0.8
ncl 25> res at vpHeightF       = 0.8
ncl 26> res at gsnSpreadColors     = True
ncl 27> res at gsnSpreadColorStart = 2
ncl 28> res at gsnSpreadColorEnd   = -3
ncl 29> res at lbLabelFontHeightF  = 0.015
ncl 30> res at tiMainString       = "Figure 4"
ncl 31> res at tiMainFontHeightF  = .018
ncl 32> contour = gsn_csm_contour_map(wks,PS,res)
ncl 33> end


Variable: vNames
Type: string
Total Size: 88 bytes
            11 values
Number of Dimensions: 1
Dimensions and sizes:    [11]
Coordinates: 
(0)    O3
(1)    P0
(2)    PS
(3)    date
(4)    datesec
(5)    hyam
(6)    hybm
(7)    lat
(8)    lev
(9)    lon
(10)    time
(0)    gsn_csm_contour_map_other: Fatal: the input data array must be 1D or 2D
fatal:Illegal right-hand side type for assignment
fatal:["Execute.c":8126]:Execute: Error occurred at or near line 32

ncl 34> printVarSummary(PS)

Variable: PS
Type: float
Total Size: 663552 bytes
            165888 values
Number of Dimensions: 3
Dimensions and sizes:    [time | 12] x [lat | 96] x [lon | 144]
Coordinates: 
            time: [   1..  12]
            lat: [ -90..89.99999999999999]
            lon: [   0..357.5]
Number Of Attributes: 3
  units :    Pa
  long_name :    Surface pressure
  cell_methods :    time: mean
ncl 35> plot = gsn_csm_contour_map(wks,PS(0,:,:),res)
ncl 36> contour = gsn_csm_contour_map(wks,PS(0,:,:),res)
ncl 37> plot = gsn_csm_contour_map(wks,PS(0,:,:),res)    
ncl 38> end
fatal:syntax error: line 38 before or near end 
end
--^

fatal:error in statement
ncl 39> 

Thank you
Najib YusufCentre for Atmospheric ResearchNational Space Research and Development AgencyKogi State University Campus, Anyigba. 
Nigeria. +234 80 38714158
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150623/43174262/attachment.html 


More information about the ncl-talk mailing list