Error 010 i nvalid function or declaration

error 010 i nvalid function or declaration

github.com › urShadow › Pawn.CMD › issues. The serving phase can also be a source of errors. Serving permission error due to the function being private. Cloud Functions allows you to declare functions. 0A, Feature Not Supported, Table 8. 0F, Invalid Token, Table 9. 0K, Resignal When Handler Not Active, Table 10. 0N, SQL/XML Mapping Error, Table 11. error 010 i nvalid function or declaration

Error 010 i nvalid function or declaration - simply remarkable

xargs ls") files = systemfunc("find " + diri + " -name 'sgp15swfcldgrid*' -print xargs basename")

Unable to load System Resource File

Sample code that causes the error:

This is an error message that can occur when you run any NCL script.

Cause: You either don't have your NCARG_ROOT environment variable set correctly or set at all. NCARG_ROOT needs to be set to the root location of where the NCL software is installed.

Fix: Check the setting of your NCARG_ROOT environment variable and other NCARG_XXXX variables.

On the UNIX command line, type:

which ncl

If this returns (for example), "/usr/local/ncl/bin", then NCARG_ROOT should be set to /usr/local/ncl. See the section "Set the NCARG_ROOT environment variable" section on the NCL download page for more information.


ContourPlotSetValues: Data values out of range of levels set by EXPLICITLEVELS mode

Sample code that causes the error: a = addfile("$NCARG_ROOT/lib/ncarg/data/cdf/uv300.nc","r") u = a->U(1,:,:) ; read July zonal winds printMinMax(u,0) wks = gsn_open_wks("x11","contour") res = True [email protected] = "ExplicitLevels" ; set explicit contour levels [email protected] = (/ 50, 60, 70, 80, 90, 100, 110 /) plot = gsn_csm_contour_map(wks,u,res)

Cause: You've chosen a set of contour levels that fall completely outside the range of your data. In the above case, "u" has a min/max of -15.27 and 41.07, but the levels specified are greater than the maximum value.

Fix: Fix the cnLevels setting so that at least some of the levels overlap with the actual range of the data you are trying to plot. Use the printMinMax procedure to help determine a good range of levels to use.

ContourPlotDraw: data boundary is out of range


ContourPlotDraw: data boundary is out of range

Sample code that causes the error:

This code may not always produce the error, but we've found that some WRF output files do, so we used a sample WRF output file name here.

f = addfile("wrfout_d01_2016-03-23_00:00:00.nc","r") wks = gsn_open_wks("x11","wrf_domains") res = True [email protected] = True [email protected] = f->XLONG(0,:,:) ; note the 2D lat/lon coordinates [email protected] = f->XLAT(0,:,:) plot = gsn_csm_contour(wks,f->HGT(0,:,:),res) Cause:This error seems to occur wen you are trying to create a contour plot of curvilinear data, but not putting the data over a map.

Fix: Try setting:

[email protected]trGridType = "TriangularMesh" This setting causes NCL to use a different contouring algorithm.

ARSCAM/ARPRAM ALGORITHM FAILURE

Sample code that causes the error:

None provided. This is an elusive problem that is hard to reproduce.

Cause: This error is usually caused by a precision error in our low-level contouring algorithm. It seems to occur when you have very "twisty" contours in small plot, like in a panel plot. It is more likely happen when you are drawing filled contours using the default "area fill" mode.

Fix: One thing you can try as a work-around is to fill the contours using "raster fill" mode instead:

[email protected]cnFillMode = "RasterFill" ; Default is "AreaFill" In addition, you can smooth the raster contours, making them closer in appearance to area-filled contours: [email protected]cnRasterSmoothingOn = True

Unfortunately, if you need contours produced by the "AreaFill" mode, there's no instant fix for this. We found that if you tweak certain things, like the rotation of your plot (mpCenterLonF), the size of the plot (vpWidthF/vpHeightF), or the contour levels themselves, you might be able to get rid of this error message.

Detailed and low-level description of the underlying problem

There's a low-level package called AREAS that accepts as input groups of boundary lines in a plane (for example, contour lines generated by CONPACK/CONPACKT or geopolitical boundaries generated by EZMAP), puts them in a structure called an "area map", and then processes that structure to determine the collection of areas formed by the superimposed groups of lines. One of the routines of AREAS, called ARPRAM, performs a multi-step process to prepare the area map for use during subsequent calls to other routines of AREAS. The algorithm used by ARPRAM is inherently geometric in nature and would be exact if carried out using infinite-precision real arithmetic; unfortunately, it is not exact when carried out using the available limited-precision arithmetic. Practically speaking, what this means is that one of the steps leaves the area map in a state such that, when the next step is attempted, something unexpected happens, something that should not be possible, something that prevents that step, and subsequent steps, from being completed correctly and makes it unsafe to allow other AREAS routines to be called (because they might loop forever or produce completely incorrect results). At the moment, we understand what happens well enough to detect when it happens, to produce an error message (the infamous "ALGORITHM FAILURE"), and to quit trying to process the area map, but not well enough to fix whatever has gone wrong.


ContourPlotInitialize: no valid values in scalar field; ContourPlot not possible

Sample code that causes the error:

temp = new((/100,100/),float) ; Data are all missing wks = gsn_open_wks("x11","plot") plot = gsn_csm_contour(wks,temp,False)

Cause: This error will occur if your data values are all missing, as they are in the above example. You can verify if your data variable is all missing by using the all and ismissing functions together:

print("Is temp all missing ? " + all(ismissing(temp)))

Fix: You cannot plot data that is all missing, so the fix is that you need to check if there's something wrong with your code that's causing your data to be all missing. You can do this by inserting printMinMax calls in your code to see where a calculation might be going wrong. Or, if you are simply reading a data variable off a file and trying to plot it directly, then look at your data variable using printVarSummary and printMinMax together to see if there might be any other issues.


ContourPlotInitialize: 0.0 not currently supported as a missing value; expect inaccurate plot

Sample code that causes the error:

;---Generate dummy bullseye data for contour plot M = 29 ispn = conform_dims((/M,M/),ispan(-M/2,M/2,1)^2,1) jspn = conform_dims((/M,M/),ispan(-M/2,M/2,1)^2,0) data = sqrt(64*(jspn + ispn)) data(9:19,9:19) = 0. ; Set a rectangular block of data to [email protected]_FillValue = 0. ; missing, using 0.0 as a _FillValue wks = gsn_open_wks("x11","zero_msg_val") res = True [email protected] = True [email protected] = True [email protected] = "Missing value = " + [email protected]_FillValue ;---Plot will be incorrect, with a purple uneven square of data in the middle plot = gsn_csm_contour(wks,data,res)

Cause: NCL cannot contour data that has a missing value (_FillValue attribute) equal to 0.0.

Fix: Reset the _FillValue from 0.0 to a different value:

[email protected]_FillValue = 1e20 ; All zero values will be set to 1e20 ;---Plot will be correct, with a white square of missing data in the middle [email protected] = "Missing value = " + [email protected]_FillValue plot = gsn_csm_contour(wks,data,res)

NhlCvtStringToEnum: Unable to convert string

Sample code that causes the error:

This code shows three cases that will produce this error:

a = addfile("$NCARG_ROOT/lib/ncarg/data/cdf/uv300.nc","r") u = a->U(1,:,:) wks = gsn_open_wks("x11","contour") res = True [email protected]cnFillOn = True [email protected]mpProjection = "Ortographic" ; Should be "Orthographic" [email protected]cnFillPalette = "Ranbow" ; Should be "Rainbow" [email protected]cnLevelSelectionMode = "Explicit" ; Should be "ExplicitLevels" [email protected]cnLevels = ispan(-12,40,2) plot = gsn_csm_contour_map(wks,u,res)

Cause: This fatal message occurs when you are setting a graphical resource that expects a predefined string value, and you give it something invalid. Here are the errors the above code will produce:

fatal:NhlCvtStringToEnum: Unable to convert string "Ortographic" to requested type warning:Error retrieving resource mpProjection from args - Ignoring Arg fatal:CvtStringToCmap:Unable to convert string "Ranbow" to ColorMap warning:Error retrieving resource cnFillPalette from args - Ignoring Arg fatal:NhlCvtStringToEnum: Unable to convert string "Explicit" to requested type warning:Error retrieving resource cnLevelSelectionMode from args - Ignoring Arg

Fix: Check the values you are using for the resource in question. Once you make the suggested fixes the code will work as expected.

[email protected]mpProjection = "Orthographic" [email protected]cnFillPalette = "Rainbow" [email protected]cnLevelSelectionMode = "ExplicitLevels"

NhlDraw: cannot draw Plot Member

Sample code that causes the error:

wks = gsn_open_wks("x11","test") res = True [email protected]gsnDraw = False [email protected]gsnFrame = False contour_line = gsn_csm_contour(wks,z1,res) [email protected]cnFillOn = True contour_fill = gsn_csm_contour(wks,z2,res) overlay(contour_fill,contour_line) draw(contour_line) ; contour_line is now an "overlay" plot and can't be drawn individually. frame(wks) draw(contour_fill) frame(wks)

Cause: This error occurs when you try to draw a plot that has been overlaid on another plot.

Fix: If you need to draw "contour_line" by itself, then you will need to do this before the overlay call:

wks = gsn_open_wks("x11","test") res = True [email protected]gsnDraw = False [email protected]gsnFrame = False contour_line = gsn_csm_contour(wks,z1,res) [email protected]cnFillOn = True contour_fill = gsn_csm_contour(wks,z2,res) draw(contour_line) ; draw this before you overlay it frame(wks) overlay(contour_fill,contour_line) draw(contour_fill) frame(wks)

is_valid_lat_ycoord: Warning: The units attribute of the Y coordinate array is not set to one of the allowable units values


Full error:

is_valid_lat_ycoord: Warning: The units attribute of the Y coordinate array is not set to one of the allowable units values (i.e. 'degrees_north'). Your latitude labels may not be correct. is_valid_lat_xcoord: Warning: The units attribute of the X coordinate array is not set to one of the allowable units values (i.e. 'degrees_east'). Your longitude labels may not be correct.

Sample code that causes the error:

f = addfile("$NCARG_ROOT/lib/ncarg/data/cdf/Tstorm.cdf","r") t = f->t ; 64 x 33 x 36 wks = gsn_open_wks("png","dataonmap") res = True [email protected] = True plot = gsn_csm_contour_map(wks,t(0,:,:),res)

Cause:

This warning can occur if you are trying to plot contours, vectors, or streamlines over a map using one of the gsn_csm_xxxx_map functions (gsn_csm_contour_map, gsn_csm_vector_map, etc) and you either have latitude / longitude coordinate arrays that do not have "units" attributes of "degrees_north" and "degrees_east", or else you have not provided any lat /lon information at all.

Fix: the fix below shows how to fix coordinate arrays that don't have the correct units. If this is not the situation with your own data, then visit the "plotting data on a map" examples page for more information about what the problem might be.

f = addfile("$NCARG_ROOT/lib/ncarg/data/cdf/Tstorm.cdf","r") t = f->t ; 64 x 33 x 36 printVarSummary(t&lat) ; Notice the missing units printVarSummary(t&lon) ; Ditto [email protected] = "degrees_north" ; Fix the lat/lon units [email protected] = "degrees_east" wks = gsn_open_wks("x11","coord_arrays_error") res = True [email protected] = True [email protected] = False ; Turn off the cyclic point ;---Zoom in on plot for a better view of the data [email protected] = min(t&lat) - 1 [email protected] = max(t&lat) + 1 [email protected] = min(t&lon) - 1 [email protected] = max(t&lon) + 1 plot = gsn_csm_contour_map(wks,t(0,:,:),res)

check_for_y_lat_coord: Warning: Data either does not contain a valid latitude coordinate array or doesn't contain one at all

Full error:

check_for_y_lat_coord: Warning: Data either does not contain a valid latitude coordinate array or doesn't contain one at all. A valid latitude coordinate array should have a 'units' attribute equal to one of the following values: 'degrees_north' 'degrees-north' 'degree_north' 'degrees north' 'degrees_N' 'Degrees_north' 'degree_N' 'degreeN' 'degreesN' 'deg north' check_for_lon_coord: Warning: Data either does not contain a valid longitude coordinate array or doesn't contain one at all. A valid longitude coordinate array should have a 'units' attribute equal to one of the following values: 'degrees_east' 'degrees-east' 'degree_east' 'degrees east' 'degrees_E' 'Degrees_east' 'degree_E' 'degreeE' 'degreesE' 'deg east'

Below are two possible scenarios that could cause this warning:

Sample code #1 that causes the error:

f = addfile("$NCARG_ROOT/lib/ncarg/data/cdf/Tstorm.cdf","r") t = f->t ; 64 x 33 x 36 wks = gsn_open_wks("x11","coord_arrays_error") res = True [email protected] = True plot = gsn_csm_contour_map(wks,t(0,:,:),res)

Sample code #2 that also causes the error:

f = addfile("wrfout_d01_2008-09-29_00:00:00","r") slp = wrf_user_getvar(f,"slp",0) wks = gsn_open_wks("x11","curvilinear") res = True [email protected] = True [email protected] = False ; Data is regional, turn off cyclic point plot = gsn_csm_contour_map(wks,slp,res)

Cause:

This warning can occur if you are trying to plot contours, vectors, or streamlines over a map using one of the gsn_csm_xxxx_map functions (gsn_csm_contour_map, gsn_csm_vector_map, etc) and you either have latitude / longitude coordinate arrays that do not have "units" attributes of "degrees_north" and "degrees_east", or else you have not provided any lat / lon array information at all.

Fix for sample code #1:

The code below shows how to fix the case in which your data has coordinate arrays, but they either don't have any "units" attributes, or the "units" attributes are incorrect. This is where printVarSummary can come in handy to look at your data to see what's missing.

f = addfile("$NCARG_ROOT/lib/ncarg/data/cdf/Tstorm.cdf","r") t = f->t ; 64 x 33 x 36 printVarSummary(t) ; Confirm "t" has coordinate arrays "lat" and "lon" printVarSummary(t&lat) ; Notice "lat" and "lon" arrays are missing the printVarSummary(t&lon) ; "units" attribute. [email protected] = "degrees_north" ; Add the lat/lon units before plotting. [email protected] = "degrees_east" wks = gsn_open_wks("x11","coord_arrays_error") res = True [email protected] = True [email protected] = False ; Turn off the cyclic point ;---Zoom in on plot for a better view of the data [email protected] = min(t&lat) - 1 [email protected] = max(t&lat) + 1 [email protected] = min(t&lon) - 1 [email protected] = max(t&lon) + 1 plot = gsn_csm_contour_map(wks,t(0,:,:),res)

Fix for sample code #2:

The code below shows how to fix the case in which your data does not have coordinate arrays, but is on a curvilinear grid. This means your lat/lon arrays are two-dimensional and cannot be represented as traditional coordinate arrays. In this case, you must read the lat/lon arrays off the file and attach them as special "lat2d" and "lon2d" attributes to the data variable being plotted:

a = addfile("wrfout_d01_2008-09-29_00:00:00","r") slp = wrf_user_getvar(a,"slp",0) [email protected] = wrf_user_getvar(a,"XLAT",0) ; latitude/longitude [email protected] = wrf_user_getvar(a,"XLONG",0) ; required for plotting wks = gsn_open_wks("x11","curvilinear") res = True [email protected] = True [email protected] = False plot = gsn_csm_contour_map(wks,slp,res)

If neither of these fixes work for you, then visit the "plotting data on a map" examples page for more information about what the problem might be.


gsn_add_cyclic: Warning: The range of your longitude data is not 360.

Full error:

gsn_add_cyclic: Warning: The range of your longitude data is not 360. You may want to set the gsnAddCyclic resource to False to avoid a warning message from the spline function. warning:_NhlCreateSplineCoordApprox: Attempt to create spline approximation for X axis failed: consider adjusting trXTensionF value warning:IrTransInitialize: error creating spline approximation for trXCoordPoints; defaulting to linear

Sample code that causes the error:

f = addfile("$NCARG_ROOT/lib/ncarg/data/cdf/Tstorm.cdf","r") t = f->t ; 64 x 33 x 36 [email protected] = "degrees_north" ; Fix the lat/lon units [email protected] = "degrees_east" wks = gsn_open_wks("x11","cyclic_problem") res = True [email protected] = True [email protected] = False ; Turn off the cyclic point ;---Zoom in on plot for a better view of the data [email protected] = min(t&lat) - 1 [email protected] = max(t&lat) + 1 [email protected] = min(t&lon) - 1 [email protected] = max(t&lon) + 1 plot = gsn_csm_contour_map(wks,t(0,:,:),res)

Cause: In some cases, the gsn_csm_xxxxx_map functions will assume your data is global and hence it will try to add an additional longitude point at lon=360 in order to avoid a "seam" in the plot. If your data is not global or the cyclic point has already been added, then you will likely see this error.

Fix: To fix, simply set gsnAddCyclic to False, which tells the plotting function not to add the longitude cyclic point:

f = addfile("$NCARG_ROOT/lib/ncarg/data/cdf/Tstorm.cdf","r") t = f->t ; 64 x 33 x 36 [email protected] = "degrees_north" ; Fix the lat/lon units [email protected] = "degrees_east" wks = gsn_open_wks("x11","cyclic_problem") res = True [email protected] = True [email protected] = False ; Turn off the cyclic point ;---Zoom in on plot for a better view of the data [email protected] = min(t&lat) - 1 [email protected] = max(t&lat) + 1 [email protected] = min(t&lon) - 1 [email protected] = max(t&lon) + 1 plot = gsn_csm_contour_map(wks,t(0,:,:),res)

MDRGSF/MDRGOF - ERROR OPENING RANGS/GSHHS CAT FILE

Full error:

fatal:MapRGDHDrawMapList: MDRGSF/MDRGOF - ERROR OPENING RANGS/GSHHS CAT FILE fatal:PlotManagerDraw: error in plot draw fatal:_NhlPlotManagerDraw: Draw error

Sample code that causes the error:

wks = gsn_open_wks("x11","rangs_test") mpres = True [email protected]gsnMaximize = True [email protected]mpLimitMode = "LatLon" [email protected]mpMinLonF = -15. [email protected]mpMaxLonF = 15 [email protected]mpMinLatF = 40. [email protected]mpMaxLatF = 70. [email protected]mpDataBaseVersion = "HighRes" [email protected]pmTickMarkDisplayMode = "Always" map = gsn_csm_map(wks,res)

Cause: You are trying to use the high-resolution map database ([email protected]mpDataBaseVersion = "HighRes"), but you haven't downloaded the necessary map database files.

Fix: you need to download a set of ten files that NCL reads to generate the high-res coastlines. For information on how to get these files, go to the page on high-resolution coastlines.


TransformPostDraw: tfPolyDrawList element 0 is invalid

Sample code that causes the error:

wks = gsn_open_wks("x11","polydraw_test") mpres = True [email protected]gsnMaximize = True [email protected]gsnDraw = False [email protected]gsnFrame = False map = gsn_csm_map(wks,mpres) gsres = True [email protected]gsMarkerIndex = 16 [email protected]gsLineColor = "NavyBlue" [email protected]gsLineThicknessF = 3 dum = gsn_add_polyline(wks,map,(/0,0/),(/-90,90/),gsres) dum = gsn_add_polyline(wks,map,(/0,180/),(/30,30/),gsres) dum = gsn_add_polyline(wks,map,(/-180,0/),(/30,30/),gsres) dum = gsn_add_polymarker(wks,map,(/-60,-30,30,60/),(/-45,-15,15,45/),gsres) draw(map) ; Only the last "dum" set of primitives will show up, frame(wks) ; which are the markers in this case.

Cause: If you are using one of the gsn_add_polyxxx functions to add primitives to your plot and not using a unique variable name for the return value, you will one of these errors for every call.

Fix: Make sure each of the variables returned by the gsn_add_polyxxx routines is unique:

. . . dum1 = gsn_add_polyline(wks,map,(/0,0/),(/-90,90/),gsres) dum2 = gsn_add_polyline(wks,map,(/0,180/),(/30,30/),gsres) dum3 = gsn_add_polyline(wks,map,(/-180,0/),(/30,30/),gsres) dum4 = gsn_add_polymarker(wks,map,(/-60,-30,30,60/),(/-45,-15,15,45/),gsres) . . .

xxYYYYZZZZ is not a valid resource in nnnn at this time

Sample code that causes the warning:

M = 29 ispn = conform_dims((/M,M/),ispan(-M/2,M/2,1)^2,1) jspn = conform_dims((/M,M/),ispan(-M/2,M/2,1)^2,0) T = sqrt(64*(jspn + ispn)) wks = gsn_open_wks("x11","plot") res = True [email protected]gsnMaximize = True [email protected]xyLineColor = "NavyBlue" [email protected] = False plot = gsn_csm_contour(wks,T,res)

The above script should produce two warnings:

warning:xyLineColor is not a valid resource in plot_contour at this time warning:cnLineLabelOn is not a valid resource in plot_contour at this time

Cause: This warning can be caused by two things:

  1. Misspelling a graphical resource name, for example, "xyLineColour" instead of "xyLineColor".
  2. Setting a resource that is not recognized by the type of plotting function you are calling, for example, setting "xyLineColor" when drawing a contour plot.

Fix: Double-check the spelling of your graphical resources and make sure you are setting resources that are recognized by the plotting function. In the example above, you want to use cnLineColor, and correct "cnLineLabelOn" to be cnLineLabelsOn.

Tip: If you use an editor enhancement while editing your NCL scripts, this will help you know if you are spelling resources correctly as the resource name will be highlighted. See the Editor enhancement examples page for more details.


NclMalloc Failed

Sample code that causes the error:

Say, for example, there is 8 GB of available memory on your system and that you are trying to read two variables off a NetCDF with the following dimensions:

f = addfile("some_file.nc","r") T = f->T ; ntim x nlat x mlon ( 1320 x 360 x 720) P = f->P ; ntim x klev x nlat x mlon ( 1320 x 6 x 360 x 720)

The total memory requirement of these two arrays will be:

T: 1320*360*720 = 342144000 values = 342144000*4 = 1368576000 bytes (~1.37GB) P: 1320*6*360*720 = 2052864000 values = 2052864000*4 = 8211456000 bytes (~8.21GB)

Together, these two arrays require 9,580,032,000 bytes (~9.58 GB), which would lead to the error:

fatal:NclMalloc Failed

Cause: This message likely means the memory requirements of the variable(s) have exceeded the available memory on your system. This can happen if you are trying to read or create very large arrays, or if you have lots of variables.

Fix: You need to reduce to reduce the amount of memory being requested by the NCL script:

  1. Use a "do" loop to only access part of the arrays at a time: f = addfile("some_file.nc","r") do nt=0,ntim-1 T = f->T(nt,:,:) do kl=0,klev-1 P = f->P(nt,kl,:,:) ...do some operation with T and P... end do end do
  2. Reduce the spatial dimensions (if possible). This could be useful if you are plotting T and P, plotting every other value may not make that much of a visual difference: T = f->T(:,::2,::2) P = f->T(:,:,::2,::2)
  3. If you don't have big arrays, but you have lots of variables in your script, then use delete to remove variables you no longer need: f = addfile("some_file.nc","r") T = f->T P = f->P QVAPOR = f->QVAPOR PH = f->PH T = T + 300. P = P + f->PB QVAPOR = QVAPOR > 0.000 PH = ( PH + f->PHB ) / 9.81 z = wrf_user_unstagger(PH,[email protected]) tk = wrf_tk( P , T ) ; calculate TK delete([/PH,T/]) slp = wrf_slp( z, tk, P, QVAPOR ) delete([/z,tk,P,QVAPOR/])

    Tip: Note that several delete commands are used, rather than one big one at the end. This is so you can free up memory as you go, in case new calculations cause you to exceed your machine's memory limit.