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

Example pages containing: tips | resources | functions/procedures

Opening and editing an existing netCDF file

The NCL function addfile can be used to read, create or overwrite a NetCDF file. To overwrite an existing file, use a "w" as the second argument. Note that you can not change the dimensionality of any existing variables, but you can change the values. If adding to a netCDF file the type and size of the variable must already exist.
      in = addfile("./","w")
      (ncdump of original file)
      z_t = (/30,40,89,78,45,234,98,23,456,294,12,17,40,56,17,32,85,93,72,\


      (ncdump of modified file)