NCL Home> Application examples> File IO || Data files for some examples

Example pages containing: tidbits | resources | functions/procedures

OPeNDAP (formerly DODS)

OPeNDAP is a means by which a user can access a remote file over the internet. There are certain caveats to using this functionality in NCL:

Here's a test script you can use to see if your version of NCL has OPeNDAP capabilities:

Actual Script

  url      = "http://test.opendap.org/opendap/data/nc/"
  filename = url + "123.nc"
 
  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.")
    f = addfile(filename,"r")
    vars = getfilevarnames(f)
    print(vars)   ; should be (in any order): "l","j","i","cross","aloan",
                  ; "shot","order","bears"
  end if