Hello,
I have created NetCDF file for variable with
dimenstion (t,x,y,mon) using following code,
but the problem is that when looking at the file with
ncdump the dimensions of the variable have the
the opposite order, (mon,y,x,t)
Does anyone have an idea what the problem is
when writing the variable?
cheers,
Tolly
;;T_mon has dimensions (1,165,281,12)
SSize=size(T_mon)
id=NCDF_CREATE('T_mon.nc',/CLOBBER)
NCDF_CONTROL,id,/FILL
Dim1 = NCDF_DIMDEF(id,'t',SSize(1))
Dim2 = NCDF_DIMDEF(id,'x',SSize(2))
Dim3 = NCDF_DIMDEF(id,'y',SSize(3))
Dim4 = NCDF_DIMDEF(id,'mon',SSize(4))
VarId1 = NCDF_VARDEF(id,'temp_mon',[Dim1,Dim2,Dim3,Dim4], /FLOAT)
NCDF_ATTPUT,id,VarId1, "long_name", 'monthly mean surface temperature'
NCDF_ATTPUT,id,VarId1, "standard_name", 'land_ice_monthly_temperature'
NCDF_ATTPUT,id,VarId1, "units", 'K'
NCDF_ATTPUT,id,VarId1, "missing_value", 'none'
NCDF_CONTROL, id, /ENDEF
NCDF_VARPUT, id, VarId1,T_mon
NCDF_CLOSE,id
the ncdump gives however the following:
netcdf T_mon {
dimensions:
t = 1 ;
x = 165 ;
y = 281 ;
mon = 12 ;
variables:
float temp_mon(mon, y, x, t) ;
temp_mon:long_name = "monthly mean surface
temperature" ;
temp_mon:standard_name =
"land_ice_monthly_temperature" ;
temp_mon:units = "K" ;
temp_mon:missing_value = "none" ;
}
|