[ncl-talk] netcdf TFLAG dimension
Luo, Chao
chao.luo at eas.gatech.edu
Thu Sep 17 16:43:09 MDT 2015
Hi, here is what I did.
---------------------------
begin
fin = addfile(METCRO2D_148x112_20110701,"r")
ncdf = addfile(out.nc,"c")
global_attnames = getvaratts(fin) ;-- retrieve the global attributes from input file
do i=0,dimsizes(global_attnames)-1
ncdf@$global_attnames(i)$ = fin@$global_attnames(i)$ ;-- write globalattribute to new netcdf file
end do
names = getfilevarnames(fin); extract all variable names
;do i = 0, dimsizes(names)-1
do i = 0, 1 ; write out two variable
ncdf->$names(i)$ = fin->$names(i)$
end do
end
--------------------------
But the dimensions of output netcdf file (out.nc) still are:
dimensions:
TSTEP = UNLIMITED ; // (25 currently)
DATE-TIME = 2 ;
LAY = 1 ;
VAR = 40 ;
ROW = 112 ;
COL = 148 ;
The dimensions of output file should be:
dimensions:
TSTEP = UNLIMITED ; // (25 currently)
DATE-TIME = 2 ;
LAY = 1 ;
VAR = 2 ;
ROW = 112 ;
COL = 148 ;
I don't know how to change VAR = 40 to VAR = 2 in output file.
Thanks very much,
Chao
----- Original Message -----
From: "Dennis Shea" <shea at ucar.edu>
To: "Chao Luo" <chao.luo at eas.gatech.edu>
Cc: "ncl-talk Talk" <ncl-talk at ucar.edu>
Sent: Thursday, September 17, 2015 1:33:44 PM
Subject: Re: [ncl-talk] netcdf TFLAG dimension
The description provides no information that can be used to help
diagnose the problem, Try again
On Wed, Sep 16, 2015 at 1:29 PM, Luo, Chao <chao.luo at eas.gatech.edu> wrote:
> Hi,
>
> I extracted couple variables from a netcdf file (with 40 variables) and
> write out to a new netcdf file with dimension and TFLAG information. But the
> new file's still has dimension: VAR =40, which is same as the original
> netcdf file. The VAR should be equal to 2 (VAR=2) in new netcdf file. I
> don't know how to change it by NCL.
> Very appreciate any help and suggestions.
>
> Chao
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
More information about the ncl-talk
mailing list