WikiPrint - from Polar Technologies



Ncml could be a useful tool to manipulate netcdf files. In this example, we are going to describe how to modify the values of a particular variable (rlat) in an existing netcdf file (

For this purpuse it is necessary to generate a ncml that refers to that particular netcdf, by adding a location argument. Then, we just need to specify the variable name that we want to change, their values and the separator between them. The ncml file will look something like this:

<?xml version="1.0" encoding="UTF-8"?>
<netcdf xmlns="" location="">
  <variable name="rlat">
    <values start="0.883846282958984" incr="0.22"/>

In order to save the changes in a new netcdf file, we can use toolsUI.

java -cp /software/meteo/jar/toolsUI-4.6.5.jar ucar.nc2.write.Nccopy --input rlat_new.ncml --output --format netcdf4_classic -d 4 -sh