title: How to remove/delete dimension from a netcdf file without modifying other variables?
body: <p>Need help. Please have a look and suggest a solution. Note that I'm a beginner.</p>
  <pre><code>I have a netcdf file named 'Lw_15_21.nc' 
  netcdf Lw_15_21 {
  dimensions:
          longitude = 135 ;
          latitude = 129 ;
          expver = 2 ;
          time = 54247 ;
  variables:
          float longitude(longitude) ;
                  longitude:units = &quot;degrees_east&quot; ;
                  longitude:long_name = &quot;longitude&quot; ;
          float latitude(latitude) ;
                  latitude:units = &quot;degrees_north&quot; ;
                  latitude:long_name = &quot;latitude&quot; ;
          int expver(expver) ;
                  expver:long_name = &quot;expver&quot; ;
          int time(time) ;
                  time:units = &quot;hours since 1900-01-01 00:00:00.0&quot; ;
                  time:long_name = &quot;time&quot; ;
                  time:calendar = &quot;gregorian&quot; ;
          short str(time, expver, latitude, longitude) ;
                  str:scale_factor = 22.4949414798651 ;
                  str:add_offset = -574761.74747074 ;
                  str:_FillValue = -32767s ;
                  str:missing_value = -32767s ;
                  str:units = &quot;J m**-2&quot; ;
                  str:long_name = &quot;Surface net thermal radiation&quot; ;
                  str:standard_name = &quot;surface_net_upward_longwave_flux&quot; ;
  </code></pre>
  <p>And I want to delete the variable <code>expver</code> (since it prevents merging with other *.nc files).
  Even after deleting (using <code>nco</code>'s command <code>ncks -C -O -x -v expver Lw_15_21.nc test.nc</code>), the <code>expver</code> still remains in dimension and in varible <code>str</code>.</p>
  <pre><code>netcdf test {
  dimensions:
          latitude = 129 ;
          longitude = 135 ;
          time = 54247 ;
          expver = 2 ;
  variables:
          float latitude(latitude) ;
                  latitude:units = &quot;degrees_north&quot; ;
                  latitude:long_name = &quot;latitude&quot; ;
          float longitude(longitude) ;
                  longitude:units = &quot;degrees_east&quot; ;
                  longitude:long_name = &quot;longitude&quot; ;
          short str(time, expver, latitude, longitude) ;
                  str:scale_factor = 22.4949414798651 ;
                  str:add_offset = -574761.74747074 ;
                  str:_FillValue = -32767s ;
                  str:missing_value = -32767s ;
                  str:units = &quot;J m**-2&quot; ;
                  str:long_name = &quot;Surface net thermal radiation&quot; ;
                  str:standard_name = &quot;surface_net_upward_longwave_flux&quot; ;
          int time(time) ;
                  time:units = &quot;hours since 1900-01-01 00:00:00.0&quot; ;
                  time:long_name = &quot;time&quot; ;
                  time:calendar = &quot;gregorian&quot; ;
  </code></pre>
  <p>How to remove the <code>expver</code> from dimension and variable str while keeping others constant. I also tried <code>ncwa -a</code> but got a segmentation fault (core dumped) error.
  That means I would like to get the following output.</p>
  <p>Assuming the file name <code>test1.nc</code></p>
  <pre><code>netcdf test1 {
  dimensions:
          latitude = 129 ;
          longitude = 135 ;
          time = 54247 ;
  variables:
          float latitude(latitude) ;
                  latitude:units = &quot;degrees_north&quot; ;
                  latitude:long_name = &quot;latitude&quot; ;
          float longitude(longitude) ;
                  longitude:units = &quot;degrees_east&quot; ;
                  longitude:long_name = &quot;longitude&quot; ;
          short str(time, latitude, longitude) ;
                  str:scale_factor = 22.4949414798651 ;
                  str:add_offset = -574761.74747074 ;
                  str:_FillValue = -32767s ;
                  str:missing_value = -32767s ;
                  str:units = &quot;J m**-2&quot; ;
                  str:long_name = &quot;Surface net thermal radiation&quot; ;
                  str:standard_name = &quot;surface_net_upward_longwave_flux&quot; ;
          int time(time) ;
                  time:units = &quot;hours since 1900-01-01 00:00:00.0&quot; ;
                  time:long_name = &quot;time&quot; ;
                  time:calendar = &quot;gregorian&quot; ;
  </code></pre>
  <p>Thank you.</p>