Project

General

Profile

reorder the dimensions in a netcdf file

Added by nazanin tavakoli about 3 years ago

Hello,
I have a question about reordering the dimensions with ncpdq. The dimensions in my file are in (lengthd,time, langitude, latitude) order like:
lengthd = 10
time = 12 (UNLIMITED)
longitude = 720
latitude = 360

I need them in (longitude, latitude, time,length) order.

I tried the following:
ncpdq -a -longitude,latitude,time,lengthd f1.nc f3.nc

now, I got an order of dimension like below, the lengthd is eliminated, and the longitude became UNLIMITED, and reordering did not happend

Dimensions:
time = 12
longitude = 720 (UNLIMITED)
latitude = 360

could anybody help me?

data.zip (2.51 MB) data.zip

Replies (7)

RE: reorder the dimensions in a netcdf file - Added by Karin Meier-Fleischer about 3 years ago

This is not a CDO problem. Please, read the NCO doc about ncpdq or google your question, I'm sure you will get the information you need immetdiately.

RE: reorder the dimensions in a netcdf file - Added by nazanin tavakoli about 3 years ago

yes, you're completely right, I have searched a lot but my code has some problem. When I was searching, I found that a person asked about reordering in this group ( I have sent the link here), so I asked my question maybe somebody knows s.th and help me.

https://code.mpimet.mpg.de/boards/2/topics/8241

RE: reorder the dimensions in a netcdf file - Added by nazanin tavakoli about 3 years ago

Even you have suggested me these 2 codes in this link (https://code.mpimet.mpg.de/boards/2/topics/10494?r=10875#message-10875) two month ago.

ncpdq -O -a lon,lat,time 1901.nc tmp.nc
ncks -O --fix_rec_dmn lon tmp.nc 1901reorder.nc

RE: reorder the dimensions in a netcdf file - Added by Karin Meier-Fleischer about 3 years ago

I usually try to help as much as I can, but I'm not an NCO expert, so it's on you to search for an answer.

RE: reorder the dimensions in a netcdf file - Added by nazanin tavakoli about 3 years ago

yes, I know. You always answer my question carefully.
Thank you very much

RE: reorder the dimensions in a netcdf file - Added by Karin Meier-Fleischer almost 3 years ago

Hi Nazanin,

I come back to your question because now I can point you to an answer, see https://code.mpimet.mpg.de/boards/2/topics/11747.

-Karin

    (1-7/7)