[ncarg-talk] contour over map (from CISM output)

Mary Haley haley at ucar.edu
Wed May 9 11:11:04 MDT 2018


Hi Michele,

The quick answer is that in NCL V6.4.0 there's some code that still expects
tfDoNDCOverlay to just be set to True or False, so instead of:

res at tfDoNDCOverlay = "DataTransform"

use:

res at tfDoNDCOverlay = False

This resource is False by default, however, so you can also just not set it
at all.

In the future, please post NCL questions to ncl-talk and not ncarg-talk.
The ncarg-talk talk list is for people working with the old NCAR Graphics
libraries, and there's not much activity on this email list.  You will need
to subscribe:

http://mailman.ucar.edu/mailman/listinfo/ncl-talk

Regards,

--Mary


On Tue, May 8, 2018 at 3:21 PM, Michele Petrini - CITG <M.Petrini at tudelft.nl
> wrote:

> Dear helpdesk,
>
> I am trying to plot Greenland ice thickness (from CISM model) contour over
> a map, but I get an error I never had before - so far, I plotted ice
> thickness contours using outputs from different ice sheet models with no
> problems. Below you can find the code
>
> begin
>
> in = "./data/"
> out = "./results/"
> H_filename = "ice_thickness.nc"
> H_file = addfile(in+H_filename,"r")
>
> H            = H_file->thk
> time_sim         = ispan(0,16100,100)
> ny =  dimsizes(H&y1)
> nx =  dimsizes(H&x1)
> ntime = dimsizes(time_sim)
>
> H at _FillValue = -999.
>
> H = mask(H,H.lt..1,False)
>
> lat1 = fspan(58.25,84.61,ny)
> lat1 at units = "degrees_north"
> lat1!0 = "lat"
> lat1 at long_name = "latitude"
> lat1 at standard_name = "latitude"
> lat1 at axis = "Y"
> print(lat1)
> lon1 = fspan(-95.68,13.33,nx)
> lon1 at units = "degrees_east"
> lon1!0 = "lon"
> lon1 at long_name = "longitude"
> lon1 at standard_name = "longitude"
> lon1 at axis = "X"
>
> H!1 = "lat"
> H!2 = "lon"
> H&lat = lat1
> H&lon = lon1
>
> minlat = 58.25
> maxlat = 84.61
> minlon = -95.68
> maxlon = 13.33
>
>   res                       = True              ; plot mods desired
>   ;res at gsnDraw               = False
>   ;res at gsnFrame              = False
>   res at cnFillOn              = True              ; turn on color
>   res at cnFillMode            = "RasterFill"
>   res at cnLinesOn             = False
>   res at cnLineLabelsOn        = False
>   res at lbLabelBarOn          = False             ; turn off individual lb's
>
>   res at trGridType            = "TriangularMesh"
>
>   res at mpProjection          = "Stereographic"
>   res at mpDataBaseVersion     = "mediumres"
>   res at mpFillOn              = False             ; turn off default land
> map fill
>
>   res at mpLimitMode           = "Corners"
>   res at mpLeftCornerLatF      = minlat
>   res at mpLeftCornerLonF      = minlon
>   res at mpRightCornerLatF     = maxlat
>   res at mpRightCornerLonF     = maxlon
>   res at mpCenterLonF          = 0
>   res at mpCenterLatF          = 90
>   res at gsnLeftString         = ""
>   res at gsnRightString        = ""
>   res at cnFillPalette        = "testcmap"
>   res at cnLevelSelectionMode = "ManualLevels"     ; set manual contour
> levels
>   res at cnMinLevelValF       =     0.
>   res at cnMaxLevelValF       =     1.
>   res at cnLevelSpacingF      =     0.2
>   res at tfDoNDCOverlay      = "DataTransform"
>
> do i=0,ntime-1
> wks = gsn_open_wks("pdf","./results/image-"+sprinti("%03i",i))
>         print("simulation time(" + i + ") = " + time_sim(i))
>         res at gsnRightString = "Simulation time: " + time_sim(i) + " (yr)"
> ice = new((/ny,nx/),double)
> ice(:,:) = H(i,:,:)
> plot = new(1,graphic)
> plot(0) = gsn_csm_contour_map(wks,ice,res)
> delete(wks)
> end do
>
> cmd = "cd ./results/ ; pdflatex movie.tex"
> system(cmd)
>
> end
>
> whereas the error I get is the following
>
> fatal:Or: operation not supported on type (string)
> fatal:["Execute.c":8640]:Execute: Error occurred at or near line 3642 in
> file /usr/local/ncl-6.4.0/lib/ncarg/nclscripts/csm/gsn_csm.ncl
>
> fatal:["Execute.c":8640]:Execute: Error occurred at or near line 7985 in
> file /usr/local/ncl-6.4.0/lib/ncarg/nclscripts/csm/gsn_csm.ncl
>
> fatal:["Execute.c":8640]:Execute: Error occurred at or near line 11287 in
> file /usr/local/ncl-6.4.0/lib/ncarg/nclscripts/csm/gsn_csm.ncl
>
> fatal:["Execute.c":8640]:Execute: Error occurred at or near line 80 in
> file contour_movie.ncl
>
> I can’t find any suggestion by looking at previous questions and I really
> don’t understand what the problem can be.
> thanks!
>
> best,
> Michele
>
>
>
> ******************************************************************
> Michele Petrini
>
> PhD in Earth Science and Fluid Mechanics
> Department of Geoscience and Remote Sensing, TUDelft
> Delft, The Netherlands
>
> M.Petrini at tudelft.nl
> +39 3398367372
> michele.petrins (Skype alias)
>
>
>
>
> _______________________________________________
> ncarg-talk mailing list
> ncarg-talk at ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncarg-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncarg-talk/attachments/20180509/739819e7/attachment.html>


More information about the ncarg-talk mailing list