title: Change dimension name in netcdf file with python
body: <p>Hi I want to edit some information in a NetCDF file, to give an example suppose that you have a ncdump of the file with the next info:</p>
  
  <pre><code>NetCDF dimension information:
   Name: lon
      size: 144
      type: dtype('float64')
   Name: lat
      size: 73
      type: dtype('float64')
   Name: time
      size: 29220
      type: dtype('float64')
  NetCDF variable information:
   Name: rlut
      dimensions: (u'time', u'lat', u'lon')
      type: dtype('float32')
  </code></pre>
  
  <p>I want to change 'lon' for 'longitude'. I tried with:</p>
  
  <pre><code>from netCDF4 import Dataset
  path="Here goes the file path"
  f=Dataset(path,'r+')
  f.renameDimension(u'lon',u'longitude')
  f.close()
  </code></pre>
  
  <p>But after this when I tried to read the file again for doing something different the file doesn't work anymore.</p>
  
  <p>Any help I will Thank you.</p>