Re: Issues with the time function -Derek

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Mon Jul 29 2013 - 16:06:57 MDT

Hi Derek,

If you visit the documentation for this function:

http://www.ncl.ucar.edu/Document/Functions/Contributed/yyyymmddhh_time.shtml

You will see that you have to load a special script for this function to be defined:

load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
My guess is that your NCARG_ROOT is incorrect and pointing to an older version of NCL when
you get the errors.

You can interactively print the NCARG_ROOT from ncl with:

print(getenv("NCARG_ROOT"))

The reason why you didn't see any printed output when you ran it interactively is because you included a "begin" statement.
When you do this, nothing will get executed until you also include an "end" statement.

When running interactively, leave out the "begin" and "end" (unless you are definining a function or procedure).

--Mary

On Jul 25, 2013, at 1:56 PM, Derek Mallia <tartanrunner25@yahoo.com> wrote:

> Hello,
>
> I am sending this email in regards to an issue that I am having with the yyyymmddhh_time function. I recently wrote a NCL script which loops through a bunch of 3-hourly WRF files and interpolates temperature and wind arrays on set pressure levels. In order to loop through these files I was using the yyyymmddhh_time function to create an array of times which are used when naming the WRF files that I am interpolating for (see attached script).
>
> I was originally testing this script on my laptop without to many issues where I am using NCL version 6.1.0, and gcc version 4.8.0 20120603 (experimental) (GCC) without any issues. The script successfully looped through each of the WRF files starting from from July 2nd to the 1st of August interpolating to set pressure levels and then to a specific point using the linint2 function (for now its at a single point at 1.5, 1.5 to keep things simple).
>
> I then uploaded the same script to my schools server and started running into issues. When I run the same script I got the following error:
>
>
> fatal:Undefined identifier: (yyyymmddhh_time) is undefined, can't continue
> fatal:["Execute.c":7743]:Execute: Error occurred at or near line 39 in file wrf_interpolate.ncl
>
> My initial thought was that I was perhaps using an older version of NCL. However, checking the NCL version revealed that my school's server is using version 6.1.0. I then tried to manually run the first part of the script from the NCL command line:
>
> Eg.
>
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
>
> begin
>
> TIME = yyyymmddhh_time(2000, 2013, 12, "integer")
> time = TIME({2007070200:2007080100})
>
>
> and an array for the specified times are created. When I ran the script from the terminal command the script dies on the the last two lines listed above. Another interesting note is that when I run the above commands in the NCL command line printing the variable TIME and time doesn't print anything out.
>
> I would of sent this email to WRF help since they generally deal with scripts that use WRF functions however I don't think the issue has to with the WRF functions (I commented out the entire middle loop that makes use of the WRF functions and still got the same error).
>
> For now I can run this on my laptop though I figured this issue was worth bringing to your attention.
>
> I provided the script I was using at the following address along with several test WRF files (though you probably won't need these as you can comment out the middle chunk of the script):
>
> http://home.chpc.utah.edu/~u0703457/ncl/
>
>
>
>
>
> Thanks!
>
>
>
>
>
> Derek
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> _______________________________________________
> 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 Jul 29 16:07:09 2013

This archive was generated by hypermail 2.1.8 : Thu Aug 01 2013 - 15:55:04 MDT