NCL Website header

NCL > What's New | previous releases | current release

What's coming in the next release of NCL

The next release of NCL will be version 6.5.0, as we are going to include the much requested "elseif" construct to go with NCL's "if" and "end if" statements.

We will be announcing another new major feature soon. Stay tuned!

We're planning for a release date of April-May 2018. If you want to try a development snapshot version of NCL, then you can download the latest development snapshot version using conda. The instructions are in the "development snapshot" section.

New Functions

  • dim_pad_extend - Extend (i.e., expand, append, pad) an existing array along the 'record dimension' to a user specified size.

  • dim_pad_modulo - Pad (i.e., expand, append, extend) an existing array such that the size of a specified dimension is a user specified 'modulo' length.

  • enthalpy - Compute atmospheric enthalpy.

  • exponential_curve_fit - Calculates the coefficients for a simple exponential curve fit of the form ' y = A*exp(B*x)' using least squares.

  • geolocation_circle - Create latitudes and longitudes that define concentric circles at user specified distances from a central location.

  • Several new file I/O query functions were added for consistency purposes and more meaningful names:

  • isconform - Check two variables for array conformance (same shape and size).

  • keyword_values - Read a text file that contains keywords and associated values (similar to fortran NAMELIST).

  • tlcl_evp_bolton - Compute the lifting condensation level temperature using water vapor pressure.

  • tlcl_mixr_bolton - Compute the lifting condensation level temperature using mixing ratio and pressure.

  • tlcl_rh_bolton - Compute the lifting condensation level temperature using relative humidity.

  • tlcl_td_bolton - Compute the lifting condensation level temperature using dew point temperature.

  • mixhum_convert - Convert mixing ratio to specific humidity or vice-versa.

  • pot_temp_equiv_tlcl - Compute equivalent potential temperature using the lifting condensation temperature.

  • regline_weight - Calculates the linear regression coefficient between two series where the dependent (y) variable's values are weighted by some measure of uncertainty (typically, standard deviations) such that the Chi-square goodness-of-fit is minimized.

  • refevt_hamon - Use the Hamon formulation to derive reference evapotranspiration.

  • str_match_bool / str_match_bool_ic - Returns logical array of True/False/Missing indicating where the input array of strings contain the given substring.

  • simple_legend_ndc - Creates a legend in NDC space based on user supplied resources. Similarly to simple_legend, simple_legend_ndc gives the user complete control over the design and placement of the legend, and can be seen as an easier way to create legends in NCL.

  • static_energy_atm - Compute the atmospheric moist and dry static energy.

  • temp_virtual - Compute atmospheric virtual temperature.

  • unwrap_phase - Unwrap (correct) phase angles to produce smoother phase plots.

  • zscore - Computes the zscore of a variable's given dimensions at all other dimensions and retains metadata.

New "elseif" statement added

This version will have the long-requested "elseif" statement!

The old way of using "else if" required you to have an "end if" for every "else if" statement:

  a = 5
  if (a.eq.1) then
    a = a + 1
  else if (a.eq.2) then
    a = a + 2
  else if (a.eq.3) then
    a = a + 3
  else if (a.eq.5) then
    a = a + 5
    a = -1
  end if
  end if
  end if
  end if
  print("a = " + a)

The new way, with the use of "elseif" (no spaces) looks like this:

  a = 5
  if (a.eq.1) then
    a = a + 1
  elseif (a.eq.2) then
    a = a + 2
  elseif (a.eq.3) then
    a = a + 3
  elseif (a.eq.5) then
    a = a + 5
    a = -1
  end if
  print("a = " + a)

The old way will still work, and both codes above should return:

   a = 10

Preloaded NCL scripts

Several NCL scripts are now preloaded, and you no longer need to explicitly load them at the top of your own scripts. Here's a full list of the preloaded scripts:


It's okay to still load one or more of these scripts, even though NCL is preloading them.

In most cases you will not notice but loading these scripts does take a few tenths of a second. In certain situations where you want to run many very short scripts the resulting overhead may cause a significant slowdown of your work flow. For this case, a new command line option, '-s', allows you to start NCL without preloading any scripts.

New resources

New color table added

The srip_reanalysis colormap, selected by the SPARC reanalysis intercomparison project group for reanalysis comparisons, was added to the NCL distribution.

The group carefully selected colors so that groups of reanalyses worked well and so colorblind people could use it. The idea is that papers will have these colors for time-series comparisons. Thanks to Cathy Smith (NOAA/ESRL PSD and CU CIRES) for bringing it to our attention.

Graphics enhancements

  • get_color_index / get_color_rgba - these functions were enhanced to allow the 3rd argument to be an array of values. This can signficantly speed up the routines if you have a lot of calls to these functions.

    See example table_8.ncl.

Function enhancements

  • get_color_index / get_color_rgba - these functions were enhanced to allow the 3rd argument to be an array of values. This can signficantly speed up the routines if you have a lot of calls to these functions.

    See example table_8.ncl.

  • nggcog - this procedure was updated to allow numeric input and/or float and double output.

Function and procedure bugs fixed

  • bin_avg - This function expects equal grid spacing for the destination grid. The internal test required exact spacing. However, some grid spacing led to round-off errors which caused the test to fail. More robust testing was used to address this issue.

  • calculate_daily_values / calculate_monthly_values / calculate_segment_values - The documentation for each function has been updated to clarify the supported data structures. The calculate_daily_values / calculate_monthly_values now support 5-dimensional structures of the form: (ncase,time,level,lat,lon) and (time,ncase,level,lat,lon).

  • cd_calendar / cd_string - these two functions now allow the "calendar" attribute to be any case ("julian", "JULIAN", "Julian", etc)

  • daylight_fao56 - Fixed an issue which arose when two-dimensional latitude/longitude coordinates were encountered.

  • get_isolines - This function was not correctly checking for out-of-bounds conditions and sometimes returned non-sensical values.

  • lspoly / lspoly_n - These functions were potentially returning the wrong coefficients if multiple least-squares polynominals were input at once.

  • natgrid_Wrap - This function was not correctly attaching the coordinate arrays to the return variable (it had the rightmost two dimensions swapped).

  • pot_vort_isobaric - When opt=1, this function returned seven variables as elements of a list variable. It was supposed to return three variables.

  • product - This function now allows types int64, uint, and uint64 to be input.

  • trop_wmo - Fix a bug in which this function was returning -999 for missing values, but no _FillValue attribute was being set.

  • ut_string_fix - This function was not calling ut_calendar_fix under the hood, and thus it still had the infamous "60 second" bug.

  • wgt_volrmse - This function was returning the wrong values due to a value being squared twice.

Graphics bugs fixed

  • cnLineLabelFormat - Fixed a bug that caused this resource to not be recognized by the gsn_csm contouring routines.

  • gsn_add_text / gsn_create_text / gsn_text / gsn_text_ndc - Fixed a bug in which missing text strings would show up on the plot as whatever the missing value was for that string.

  • gsnYRefLine / gsnXRefLine - Fixed a bug where if you are adding a different number of X and Y reference lines to a plot via these two resources, then you may get a fatal error:

    fatal:Number of dimensions on right hand side do not match number of dimension in left hand side
    fatal:["Execute.c":8640]:Execute: Error occurred at or near line 6014 in file 

    If you need a fix for this problem, download this gsn_csm_640_fix.ncl file and load it from your own script after any other load commands.

  • gsn_add_polyline / gsn_polyline

    • Fixed a bug in which NCL was not always drawing the shortest path between two points on a map.

    • Fixed a bug in which the lines wouldn't be drawn correctly if the precision exceeded that which could be represented by a float.

  • gsn_panel / gsnPanelLabelBar Fixed a bug where if you are running a script that calls gsn_panel to panel XY plots and setting gsnPanelLabelBar to True, then you would get a fatal error:

    fatal:Variable (mono_fill_scl) is undefined
    fatal:["Execute.c":8640]:Execute: Error occurred at or near line 6100 \
       in file $NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl

    The gsnPanelLabelBar resource cannot be applied to XY plots anyway, so the solution is to simply not set this resource. In the next release, NCL will produce a warning instead of exiting with an error.

Other bugs fixed