Dear everyone,
I have a list of NetCDF files, like
1948-09.nc
1948-10.nc
1948-11.nc
1948-12.nc
and I'd like to open them by addfiles function, and then write them to one file. The script is like the follow,
+++++++++++++++++++
;*************************************************
; NCL tutorial script: vert_1.ncl
;************************************************
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
;************************************************
begin
;************************************************
; file handling
;************************************************
fns = systemfunc("ls 1948-??.nc")
in = addfiles(fns,"r") ; open netcdf file
ListSetType(in,"cat") ;specify type of merge
system("rm -f ./test.nc")
ncdf=addfile("test.nc","c") ;out put file
ncdf->time=in[:]->time
print(in[:]->time)
print(ncdf->time)
end
+++++++++++++++++++
When I run this script under the environment of NCL 5.0.0, the output information is
Copyright (C) 1995-2007 - All Rights Reserved
University Corporation for Atmospheric Research
NCAR Command Language Version 5.0.0
The use of this software is governed by a License Agreement.
See http://www.ncl.ucar.edu/ for more details.
(0) 30
(1) 61
(2) 91
(3) 122
Variable: time (file variable)
Type: double
Total Size: 32 bytes
4 values
Number of Dimensions: 1
Dimensions and sizes: [ncl0 | 4]
Coordinates:
Number Of Attributes: 0
(0) 30
(1) 61
(2) 91
(3) 122
but under the environment of NCL 5.1.0, it is
Copyright (C) 1995-2009 - All Rights Reserved
University Corporation for Atmospheric Research
NCAR Command Language Version 5.1.0
The use of this software is governed by a License Agreement.
See http://www.ncl.ucar.edu/ for more details.
Variable: time (file variable)
Type: double
Total Size: 32 bytes
4 values
Number of Dimensions: 1
Dimensions and sizes: [time | 4]
Coordinates:
time: [ 30.. 122]
Number Of Attributes: 2
long_name : time
units : days since 1948-09-01 00:00:00
(0) 30
(1) 61
(2) 91
(3) 122
Variable: time (file variable)
Type: double
Total Size: 32 bytes
4 values
Number of Dimensions: 1
Dimensions and sizes: [time | 4]
Coordinates:
time: [ 30.. 30]
Number Of Attributes: 2
long_name : time
units : days since 1948-09-01 00:00:00
(0) 30
(1) 30
(2) 30
(3) 30
The problem is that the assignment fails in NCL 5.1.0 but succeeds in NCL 5.0.0, so why? Is that a bug?
Thanks in advance.
Best Regards
Xuguang
2009-3-23
===================================
SUN Xuguang
School of Atmospheric Sciences, Nanjing University
22 Hankou Road, Nanjing 210093
China
Tel: +86-025-83597203 (O)
Email: sunxg007_at_yahoo.com.cn
___________________________________________________________
好玩贺卡等你发,邮箱贺卡全新上线!
http://card.mail.cn.yahoo.com/
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Sun Mar 22 2009 - 23:53:23 MDT
This archive was generated by hypermail 2.2.0 : Mon Mar 23 2009 - 12:30:31 MDT