title: How can I modify a variable and it's corresponding dimension in a netcdf
body: <p>I am running an idealized experiment with a atmospheric model with output in the format of netcdf. But the netcdf file header does not describe the variable and and dimension clearly. for example :</p>
  
  <pre><code>netcdf qc3d {
  dimensions:
      Time = UNLIMITED ; // (1453 currently)
      bottom_top = 45 ;
      south_north = 32 ;
      west_east = 12288 ;
  variables:
      float Time(Time) ;
          Time:axis = "Time" ;
          Time:long_name = "Time" ;
          Time:standard_name = "Time" ;
          Time:units = "minutes since 1900-01-01 " ;
      double zc(bottom_top) ;
          zc:axis = "Z" ;
          zc:long_name = "vertical height of model layers, MSL" ;
          zc:standard_name = "altitude" ;
          zc:units = "m" ;
          zc:positive = "up" ;
      double yc(south_north) ;
          yc:axis = "Y" ;
          yc:long_name = "y-coordinate of grid cell centers in Cartesian system" ;
          yc:units = "m" ;
      double xc(west_east) ;
          xc:axis = "X" ;
          xc:long_name = "x-coordinate of grid cell centers in Cartesian system" ;
          xc:units = "m" ;
      float qc(Time, bottom_top, south_north, west_east) ;
          qc:long_name = "cloud water mixing ratio" ;
          qc:standard_name = "cloud_water_mixing" ;
          qc:units = "kg kg-1" ;
          qc:_FillValue = 9.96921e+36f ;
          qc:missing_value = 9.96921e+36f ;
  
  // global attributes:
          :model_tag = "CSU VVM" ;
          :references = "http://kiwi.atmos.colostate.edu/pubs/joon-hee-tech_report.pdf" ;
          :contact = "jung@atmos.colostate.edu" ;
          :institution = "Colorado State University" ;
          :VVM_casename = "GATE_PHASE_III                                                                  " ;
  }
  </code></pre>
  
  <p>there are 4 dimensions,  Time(Time), zc(bottom_top), yc(south_north), xc(west_east) and 5 variable in which first 4 variables should be the dimension of the fifth variable, so called qc. But it seems not. The dimension is just a series number index from 1 to 45, 32 ...whatever else. </p>
  
  <p>I would like to calculate some variable which is the function of pressure. in the CDO the script is like this </p>
  
  <pre><code>cdo expr,"pottemp=temp*((100000/clev(temp))^0.287);"  ifile pottemp.nc
  </code></pre>
  
  <p>(this code is from <a href="https://code.zmaw.de/boards/53/topics/3839" rel="nofollow">here</a>)</p>
  
  <p>but I just obtain a series of index like 1 ,2 ,3 ... not the real pressure  level when I use this function, clev(qv). 
  So how can I rewrite the variable dimension like qc from 
  <code>qc(Time, bottom_top, south_north, west_east) ;</code>
  to
  <code>qc(Time, zc, yc, xc) ;</code>
  I think it's possible for me to finish this in matlab, but I just don't want to open this dataset because it's size is too large... so I am trying to find some tools like ncks or cdo, but still failed to do this.</p>
  
  <p>thanks a lot.</p>