This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
Hi Marc, > I think that I found a work around to my problem, but I 'd like your opinion > to know if what I do is correct. I used the attach script replaceByte.sh to > modify directly the byte of the value of the record dimension through the > command > ./replaceByte.sh my_corrupted_file.nc 7 $new_value > where the variable $new_value is the correct value of the record dimension. > By doing so, I am able to work on the netcdf file as usual (ncdump, ncview, > matlab, ...) and the data seem to be correct. My only concern, is that I > might forget to replace some other bytes but, if my crude understanding of > the netcdf storage is correct, there are no other bytes related to the record > dimension. What do you think? If you just updated bytes 4 through 7 of the netCDF file, you did exactly the right thing. That's the only place the number of records is stored in a classic or 64-bit-offset netCDF file, as a bigendian 4-byte integer. --Russ > Thanks in advance for your time. > > Marc > > PS: I forgot to mention that the format of the file is NetCDF 64-bit offset. > > > > > On 2013-08-06, at 6:32 PM, Unidata netCDF Support wrote: > > > > > Marc d'Orgeville, > > > > Your Ticket has been received, and a Unidata staff member will review it > > and reply accordingly. Listed below are details of this new Ticket. Please > > make sure the Ticket ID remains in the Subject: line on all correspondence > > related to this Ticket. > > > > Ticket ID: MAP-823711 > > Subject: how to modify the length of the record dimension in an existing > > netcdf file? > > Department: Support netCDF > > Priority: Normal > > Status: Open > > > > > > > > The NetCDF libraries are developed at the Unidata Program Center, > > in Boulder, Colorado, funded primarily by the National Science Foundation. > > > > All support requests are handled by the development team. No dedicated > > support staff are funded at this time. For this reason we cannot guarantee > > response times, nor that we can resolve every support issue, although we > > do our best to respond within 72 hours. > > > > It is in the nature of support requests that the same question is asked many > > times. We urge you to search the support archives for material relating to > > your support request: > > > > http://www.unidata.ucar.edu/search.jsp?support&netcdf > > > > If you are having trouble building netCDF, please take a look at the > > "Building NetCDF" page: > > > > http://www.unidata.ucar.edu/software/netcdf/docs/building.html > > > > or the (unfortunately somewhat out-of-date) NetCDF Build Troubleshooter > > page: > > > > http://www.unidata.ucar.edu/software/netcdf/docs/troubleshoot.html > > > > Windows users should see the FAQ list: > > > > http://www.unidata.ucar.edu/software/netcdf/docs/faq.html#windows_netcdf4_2 > > > > Complete documentation (including a tutorial, and sample programs in C, > > Fortran, > > Java, and other programming languages) can be found on the netCDF > > Documentation page: > > > > http://www.unidata.ucar.edu/software/netcdf/docs/ > > http://www.unidata.ucar.edu/software/netcdf/examples/programs/ > > > > If you resolve your issue through one of these methods, please send a reply > > to > > this email, letting us know that you no longer need support. This will help > > us spend more time on netCDF development. > > > > Best regards, > > > > Unidata User Support > > > > > Russ Rew UCAR Unidata Program address@hidden http://www.unidata.ucar.edu Ticket Details =================== Ticket ID: MAP-823711 Department: Support netCDF Priority: Normal Status: Closed