Re: ERROR 5 IN CTTMTL/ICAEDG - LOGIC ERROR

From: David Brown <dbrown_at_nyahnyahspammersnyahnyah>
Date: Fri Nov 16 2012 - 14:24:48 MST

Hi Alexander,
There are two different problems here. The first is that attempting to use asciiread to read your text file as a float type file does not work for the whole file because starting at line 22698 there is a non-numerical field with the values like "20110325_130642.atm4cT3.qi". When asciiread reads float data it simply skips over everything that is not a number and looks for the next number it can find, without regard to separators like commas, etc. This field turns into 4 float values: 20110325, 130642., 4, and 3. That completely throws off your attempt to turn the input into a 2D array of floats.
A better approach is to read the data as an array of strings and then use the "str_split_csv" function to separate it into fields. Something like:

  dummy = asciiread("OIB_20110325_IDCSI2.txt",-1,"string")
  str_array = str_split_csv(dummy,",",0)
  lat = tofloat(str_array(:,0))
  lon = tofloat(str_array(:,1))
  pwv = tofloat(str_array(:,2))
  pwv = where(pwv.lt.0, 0,pwv)
  pwv@_FillValue = -99999.9
  printMinMax (pwv, True)

The gives a much more reasonable value for the pwv range:

(0) min=0 max=13.3265

as well as for the lat and lon arrays.

However, it turns out that reading the data correctly does not fix the main problem: the CTTMTL/ICAEDG - LOGIC ERROR. This is definitely a bug in NCL. As you note, there have been similar reports in the past, but we have not yet resolved the problem. I am bumping up the priority of this issue and we hope to have a solution soon. Sorry I can't offer you a workaround or any kind of fix immediately, but I will let you know as soon as we have solved the problem.

 -dave

On Nov 15, 2012, at 1:07 PM, Alexander Semenov wrote:

> Hello,
>
> I have a question about the error in my code. I saw a few posts on ncl-talk about from people having similar issues, but I couldn't find any solutions on how to solve this. Do you have any suggestions?
>
> Thank you,
>
> the error message:
> pacman8 1002% ncl plot.ncl
> Copyright (C) 1995-2009 - All Rights Reserved
> University Corporation for Atmospheric Research
> NCAR Command Language Version 5.1.1
> The use of this software is governed by a License Agreement.
> See http://www.ncl.ucar.edu/ for more details.
> warning:onedtond : output dimension sizes have fewer elements than input, some data not copied
>
>
> Variable: data
> Type: float
> Total Size: 8236000 bytes
> 2059000 values
> Number of Dimensions: 2
> Dimensions and sizes: [41180] x [50]
> Coordinates:
> (0)
> (0) min=0 max=2.01103e+07
> warning:gsnPolarLabelDistance is not a valid resource in station_contour at this time
> warning:gsnPolarLabelFontHeightF is not a valid resource in station_contour at this time
> fatal:ContourPlotDraw: CTTMTL/ICAEDG - LOGIC ERROR
> ERROR 5 IN CTTMTL/ICAEDG - LOGIC ERROR
> fatal:ContourPlotDraw: CTMESH - UNCLEARED PRIOR ERROR
> fatal:ContourPlotDraw: draw error
> warning:WorkstationDeactivate: workstation not active or not opened
>
>
> My code:
>
> 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"
>
> begin
> dummy = asciiread("OIB_20110325_IDCSI2.txt",-1,"float")
>
> ncol =50
> npts = dimsizes(dummy)/ncol
>
> data = onedtond(dummy,(/npts,ncol/)) ; npts x ncol
>
> printVarSummary(data)
>
> lat = data(:,0)
> lon = data(:,1)
> pwv = data(:,2)
>
> pwv = where(pwv.lt.0, 0,pwv)
> pwv@_FillValue = -99999.9
> printMinMax (pwv, True)
> wks = gsn_open_wks("x11","station")
> gsn_define_colormap(wks,"BlWhRe")
>
> res = True
> res@gsnFrame = True ; So we can draw markers
> res@gsnMaximize = True
>
> res@gsnSpreadColors = True
> res@cnMinLevelValF = 25
> res@cnMaxLevelValF = 35
> res@mpGridLineDashPattern = 1
> res@mpGeophysicalLineColor = "Black"
> res@mpGeophysicalLineThicknessF = 1.5
> res@cnFillOn = True
>
> res@mpGridLatSpacingF = 30.
> res@mpGridLonSpacingF = 30.
> res@mpOutlineOn = True
> res@tiMainOn = True
> res@tiMainPosition = "Center"
> res@tiMainFontHeightF = 0.025
> res@lbLabelFontHeightF = 0.02
> res@gsnPolarLabelDistance = 1.08
> res@gsnPolarLabelFontHeightF= 0.02
> res@gsnLeftString = " "
> res@gsnRightString = " "
>
> res@cnLinesOn = True
> res@cnLineLabelsOn = True
>
> res@sfXArray = lon
> res@sfYArray = lat
>
> res@mpProjection = "Stereographic"
> res@mpLimitMode = "Corners"
> res@mpLeftCornerLatF = 41.0
> res@mpLeftCornerLonF = 140.8014
> res@mpRightCornerLatF = 44.0
> res@mpRightCornerLonF = -50.0
> res@mpCenterLatF = 90
> res@mpCenterLonF = -180
>
> res@mpFillOn = True
>
>
> map = gsn_csm_contour_map(wks,pwv,res)
>
> end
>
> --
> regards
>
> *******************************************************
> Alex Semenov
>
> PhD Student - Research Assistant
> International Arctic Research Center
> Department of atmospheric sciences
> University of Alaska Fairbanks
>
> 930 Koyukuk dr, 408c3
> Fairbanks, AK, USA, 99775
> work phone +19074742672
>
> _______________________________________________
> 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 Fri Nov 16 14:24:55 2012

This archive was generated by hypermail 2.1.8 : Wed Nov 21 2012 - 11:16:05 MST