Hello, Your approach sounds correct, although it is difficult to say the execution is proper without the code, or a sample netCDF file which demonstrates this. You mention you are changing `start`; are you also modifying `count`? Also, when you say 'huge', how large is the file? I wonder if it would be possible to use `nccopy` or `ncdump` to facilitate the conversion in this case. Using nccopy and ncdump, you are able to specify specific variables to include. The CDL generated by ncdump could be edited by hand to remove the extraneous values, at which point ncgen could be used to convert the cdl back into a binary file. This is a one-off solution, however, as it may be fairly time consuming given the size of the data. If you can provide the binary file, or a netCDF file that can be used to demonstrate this issue, I'd be happy to take a look at it, as well as the code you have written. I hope this helps! -Ward > Hi, > > As recommended on the Netcdf Group web page, I send to you my simple > question. > > I successfully read a (huge) nc file and write a subset of variable in a > new one (which will be used by a simulator we wrote). Unfortunately, the > dimensions (in Lat & Lon) are not exactly the ones required by the > simulator since the original nc has one supplementary unit in lat and > lon. So, I tried to write the new nc file changing the parameter start > (1 in stead of 0) of the function nc_put_vara_float > > <https://www.unidata.ucar.edu/software/netcdf/docs/group__variables.html#ga2d7791cd2e373f3c70984fa6268298a3>, > > to skip the first value in lat (lon). > > this worked but plotting the resulting file showed that the contained > values (e.g. sst) are not at the right place (a right shift of several > places in each line of the map). > > Maybe my method is wrong...what do you think ? > > Best regards, Patrick Coquillard > > > -- > -- > ------------------------------------------------------------------------ > > *Le savoir n'est pas une marchandise,* > > *L'Università n'est pas une entreprise *"la prÃvision est un art > difficile, surtout quand elle concerne l'avenir" (P. Dac) > > ------------------------------------------------------------------------ > > *Dr. Patrick Coquillard,* > > *Institut Sophia-Agrobiotech **[INRA-CNRS-Università de Nice]*****Ecologie > des CommunautÃs (Ãquipe CEA) > > *400, routes des Chappes, P.O. box 167,* > > *06 903, Sophia Antipolis* > > TÃl/fax : *#33(0) 492 386 430* > > (from foreign countries dial 33492... instead of 330492...) Coordinateur > de L3 Biologie-Informatique-MathÃmatiques > > http://www.unice.fr/coquillard > > > Ticket Details =================== Ticket ID: SFV-348763 Department: Support netCDF Priority: Normal Status: Closed =================== NOTE: All email exchanges with Unidata User Support are recorded in the Unidata inquiry tracking system and then made publicly available through the web. If you do not want to have your interactions made available in this way, you must let us know in each email you send to us.
NOTE: All email exchanges with Unidata User Support are recorded in the Unidata inquiry tracking system and then made publicly available through the web. If you do not want to have your interactions made available in this way, you must let us know in each email you send to us.