Re: debug environment for NCL?

From: Gerry Creager - NOAA Affiliate <gerry.creager_at_nyahnyahspammersnyahnyah>
Date: Sat Jun 15 2013 - 23:51:50 MDT

Interesting approach. I'll have to try this!
gerry

On Sun, Jun 16, 2013 at 12:09 AM, Yemi! <adadebiyi@gmail.com> wrote:

> Hi,
>
> I think what you are looking for is "*print(1/0)*" -- This way, you can
> load up all your variables in a session have them in the computer memory
> and break the script wherever you want. What this does, in particular, is
> to cause a fatal statement. But dont worry, no harm is done and you have a
> pretty neat work around.
>
> Maybe Adams or Mary can find a way to use this as a breakpoint function(or
> something related) for NCL
>
> Yemi.
>
>
>
> On 6/16/13 12:58 AM, Gerry Creager - NOAA Affiliate wrote:
>
> I tend to use an interactive session, and use 'exit' to break out of a
> script. I've been known to 'load' the script and remain in interactive mode
> when I'm done with the initial run. That way I can query variables and
> intermediate results. Works well.
>
> gerry
>
>
> On Fri, Jun 14, 2013 at 12:18 PM, Rick Brownrigg <brownrig@ucar.edu>wrote:
>
>> Hi Sam,
>>
>> There is not currently any means of loading up a script into a
>> "session" and setting arbitrary breakpoints before firing off the script to
>> run. Interactive is about the closest that gets.
>>
>> Rick
>>
>> On Jun 14, 2013, at 11:09 AM, "Sam McClatchie (NOAA Federal)" <
>> sam.mcclatchie@noaa.gov> wrote:
>>
>> On 06/14/2013 10:00 AM, Adam Phillips wrote:
>>
>> Hi Sam,
>> I think you want to use the exit statement:
>> http://www.ncl.ucar.edu/Document/Functions/Built-in/exit.shtml
>>
>> I use this all the time when debugging to stop scripts at a particular
>> place after I use
>> print or printVarSummary.
>>
>> If I'm off on what you are after let me (+ncl-talk) know..
>> Adam
>>
>> ______________________________________________________________
>> Adam Phillips asphilli@ucar.edu
>> NCAR/Climate and Global Dynamics Division (303) 497-1726
>> P.O. Box 3000
>> Boulder, CO 80307-3000 http://www.cgd.ucar.edu/cas/asphilli
>>
>>
>> Thanks Adam -- I do use the exit statement to stop a script, but as soon
>> as you exit, unless I misunderstand, you are no longer in the workspace
>> environment and the temporary variables are no longer available to work
>> with. I can use print commands in the script before exit, but is more
>> cumbersome than examining variables in a workspace of a halted script. For
>> example it might occur to me after examining a variable that I printed,
>> that I should look at a couple of other variables that I did not explicitly
>> print.
>>
>> 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> <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
>>
>>
>
>
> --
> Gerry Creager
> NSSL/CIMMS
> 405.325.6371
> ++++++++++++++++++++++
> “Big whorls have little whorls,
> That feed on their velocity;
> And little whorls have lesser whorls,
> And so on to viscosity.”
> Lewis Fry Richardson (1881-1953)
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
>

-- 
Gerry Creager
NSSL/CIMMS
405.325.6371
++++++++++++++++++++++
“Big whorls have little whorls,
That feed on their velocity;
And little whorls have lesser whorls,
And so on to viscosity.”
Lewis Fry Richardson (1881-1953)

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Sat Jun 15 23:52:01 2013

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