Re: filemane is undefined?

From: donna Cote <d-cote_at_nyahnyahspammersnyahnyah>
Date: Mon Sep 19 2011 - 11:59:58 MDT

I see what might be a small problem. The first three if statements all
append "gfs_master_00z" as the filename. That should be adjusted.

Also, you won't find a system date with an hour of 24. If this was my
code, I would use hour 0 instead of 24. You might use this instead:

   filename = ""
   if ((systemdate.ge.06).and.(systemdate.lt.12)) then
     filename = url+"gfs_master_00z"
   end if
   if ((systemdate.ge.12).and.(systemdate.lt.18)) then
     filename = url+"gfs_master_06z"
   end if
   if ((systemdate.ge.18)) then
     filename = url+"gfs_master_12z"
   end if
   if ((systemdate.ge.0).and.(systemdate.lt.6)) then
     filename = url+"gfs_master_18z"
   end if

Donna

On 9/18/11 1:00 PM, ncl-talk-request@ucar.edu wrote:
> url ="http://nomad1.ncep.noaa.gov:9090/dods/gfs_master/gfs" + systemfunc("date +%Y%m%d") + "/"
> systemdate = systemfunc("date +%H")
>
> if ((systemdate.ge.06).and.(systemdate.lt.12)) then
> filename = url + "gfs_master_00z"
> end if
> if ((systemdate.ge.12).and.(systemdate.lt.18)) then
> filename = url + "gfs_master_00z"
> end if
> if ((systemdate.ge.18).and.(systemdate.lt.24)) then
> filename = url + "gfs_master_00z"
> end if
> if ((systemdate.ge.24).and.(systemdate.lt.06)) then
> filename = url + "gfs_master_18z"
> end if
> exists = isfilepresent(filename)
> if(.not.exists) then
> print("OPeNDAP isfilepresent test unsuccessful.")
> print("Either file doesn't exist, or NCL does not have OPeNDAP capabilities on this system")
> else
> print("OPeNDAP isfilepresent test successful.")
> gfs = addfile(filename,"r")
> vars = getfilevarnames(gfs)
> end if
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Sep 19 14:00:13 2011

This archive was generated by hypermail 2.1.8 : Thu Sep 22 2011 - 17:12:44 MDT