[ncl-install] Convert to Ascii format

Dennis Shea shea at ucar.edu
Fri May 15 11:15:23 MDT 2009


If you are new to NCL, please read the mini-language manual at

http://www.ncl.ucar.edu/Document/Manuals/

Also, the line-by-line "Getting Started" tutorial at:

http://www.ncl.ucar.edu/Document/Manuals/Getting_Started/

===
Writing netCDF to ascii will result in *huge* files.
You should have a good reason to do this.

Read the following:
http://www.ncl.ucar.edu/Document/Functions/Built-in/write_matrix.shtml
http://www.ncl.ucar.edu/Document/Functions/Built-in/systemfunc.shtml
http://www.ncl.ucar.edu/Document/Functions/Built-in/addfile.shtml
===
A sketch of what could be done

  diri = "./"                                    ; input directory
  fils = systemfunc("ls " + diri + "foo*")
  nfil = dimsizes(fils)

  fmtx = ...

  do nf=0,nfils-1
       f = addfile (fils(nf) , "r")

       x = f->VAR1

     opt = True
     opt at fout = "VAR1_nf="+nf
      write_matrix (x, fmtx, opt)

; other variables
  end do

Good luck


More information about the ncl-install mailing list