Re: debug environment for NCL?

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Mon Jun 24 2013 - 09:05:37 MDT

Hi folks,

For what it's worth, we are looking into better interactive and debug capabilities for NCL, or
more specifically, an IDE (Integrated Development Environment) for NCL. This
has actually be on our list for some time now, but other priorities have always taken precedence.

As an example, we took an R class a few weeks ago, and it has a nice environment called RStudio
that allows you to start randomly anywhere in a script, and then step through it. As you step through
the script, it displays progress in another window. It is also set up to display the graphics in another
window if desired. You can see a sample session here:

http://www.rstudio.com/ide/

We have some great editor enhancements that have been contributed by users:

http://www.ncl.ucar.edu/Applications/editor.shtml

but this is not a complete environment. The NetBeans enhancement has a pretty nice environment,
but it does require a little bit of extra work to set it up.

--Mary

On Jun 16, 2013, at 10:19 AM, Sam McClatchie (NOAA Federal) wrote:

> Thanks Yemi -- that works nicely. I add the illegal print statement into
> my script following the variables I want to examine, copy the script to
> an interactive ncl session to run, which then crashes, but leaves the
> variables accessible in the workspace:
>
> ; code snippet ********************
>
> 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/contrib/calendar_decode2.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
>
> ;************************************************
> begin
> ;************************************************
> ; read in data
> ;************************************************
> f=addfile
> ("../data/PFEL_winds_and_ocean_transports/erdlasFnWPr_4baa_b7bc_5c31.nc","r")
> curl = f->curl(:,0,0)
> time = f->time
> yearfrac = cd_calendar(time, 4)
>
> print(1/0) ; illegal division
> ;****************************
>
> ************* interactive session in terminal ****************
>
> ncl 36> printVarSummary(yearfrac)
>
> Variable: yearfrac
> Type: double
> Total Size: 4456 bytes
> 557 values
> Number of Dimensions: 1
> Dimensions and sizes: [557]
> Coordinates:
> Number Of Attributes: 1
> calendar : standard
>
> ncl 37> print(time)
>
> Variable: time
> Type: double
> Total Size: 4456 bytes
> 557 values
> Number of Dimensions: 1
> Dimensions and sizes: [time | 557]
> Coordinates:
> time: [-93355200..1368792000]
> Number Of Attributes: 8
> _CoordinateAxisType : Time
> actual_range : ( -93355200, 1368792000 )
> axis : T
> ioos_category : Time
> long_name : reference time
> standard_name : time
> time_origin : 01-JAN-1970 00:00:00
> units : seconds since 1970-01-01T00:00:00Z
> (0) -93355200
> (1) -90806400
> (2) -88257600
> (3) -85622400
> (4) -82987200
> (5) -80352000
> (6) -77716800
>
> ncl 38> print(curl)
>
> Variable: curl
> Type: float
> Total Size: 2228 bytes
> 557 values
> Number of Dimensions: 1
> Dimensions and sizes: [time | 557]
> Coordinates:
> time: [-93355200..1368792000]
> Number Of Attributes: 8
> longitude : 242.5
> latitude : 32.5
> _FillValue : -9999
> colorBarMaximum : 3
> colorBarMinimum : -3
> ioos_category : Wind
> long_name : Curl of Surface Wind Stress
> units : MPa m-1
> (0) 0.06939734
> (1) 0.1011225
> (2) -0.09163887
> (3) -0.2258962
> (4) 0.07263987
> (5) -0.02644638
>
> ncl 39>
>
> This will make debugging much more efficient.
>
> Best fishes
>
> Sam
>
> --
> Sam McClatchie,
> Supervisory oceanographer, Fisheries oceanography
> Southwest Fisheries Science Center, NOAA,
> 8901 La Jolla Shores Dr.
> La Jolla, CA 92037-1509, U.S.A.
> email <Sam.McClatchie@noaa.gov>
> Office: 858 546 7083, Cellular: 858 752 8495
> Research home page <www.fishocean.info>
>
> /\
> ...>><xX(¡>
> //// \\\\
> <¡)Xx><<
> ///// \\\\\\
>> <(((¡>
>>> <(((¡> ...>><xX(¡>O<¡)Xx><<
>
> _______________________________________________
> 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 Mon Jun 24 09:05:51 2013

This archive was generated by hypermail 2.1.8 : Mon Jun 24 2013 - 11:46:47 MDT