Reading multiple files

From: Luis C. Cana Cascallar <lcana_at_nyahnyahspammersnyahnyah>
Date: Fri Sep 30 2011 - 07:30:27 MDT

Hi all,

I'm working with a huge WRF output file of 50 Gb and I've decided to split the

 output into smaller files. I'm following the example named 'Spanning Multiple Files'. This is part of the ncl script I'm using: (NCL version is 6.0.0)

;*******************************************************************************************
; load functions and procedures
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/wrf/WRFUserARW.ncl"

begin
;__________________________________________________________________
; WRF ARW open one big file
;a = addfile("./wrfout_d03_2007-04-09_12_Kessler.nc","r") ; 50 GB!!
;__________________________________________________________________
; WRF ARW open multiple files
; get list of all files and open as "one big file"
                             
 all_files = systemfunc ("ls /Users/lcana/Resultados_Brisas/wrfout*.nc")
 a = addfiles (all_files, "r")

; choose how files are combined and read in variable across files

 ListSetType (a, "cat") ; concatenate or "merge" (default)

; We generate plots, but what kind do we prefer?
  type = "x11"
; type = "pdf"
; type = "ps"
; type = "png"
wks = gsn_open_wks(type,"SBF_NoahLSM_USGS_10min_Kessler")

;---------------------------------------------------------------
times = wrf_user_list_times(a) ; get times in the file
ntimes = dimsizes(times) ; number of times in the file
; it = 0 ; only interested in first time
;do it = 120, 180, 3 ; big file, each 10 min D03
do it = 9, 75, 3 ; multiple files, each 10 min D03
res@TimeLabel = times(it) ; keep some time information
   
;---------------------------------------------------------------
; Get variables

slp = wrf_user_getvar(a,"slp",it) ;Get slp
  wrf_smooth_2d( slp, 5 ) ; Smooth slp
  slp@units = "hPa"

etc

When I execute this script it begins normally, but after reading some variables, the script crashes:
. . . .
(97) 2007-04-10_22:10:00
(98) 2007-04-10_22:20:00
(99) 2007-04-10_22:30:00
(100) 2007-04-10_22:40:00
(101) 2007-04-10_22:50:00
(102) 2007-04-10_23:00:00
(103) 2007-04-10_23:10:00
(104) 2007-04-10_23:20:00
(105) 2007-04-10_23:30:00
(106) 2007-04-10_23:40:00
(107) 2007-04-10_23:50:00
fatal:Argument type mismatch on argument (0) of (wrf_contour) can not coerce
fatal:Execute: Error occurred at or near line 83 in file SBF_con_vientos_10m.ncl

Is this the right way to read multiple files or I'm doing something wrong? I assume that it should be OK as the time list is correct. Attached I send the full script.

Thanks in advance,

Luis Cana

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk

Received on Fri Sep 30 07:30:37 2011

This archive was generated by hypermail 2.1.8 : Sun Oct 09 2011 - 13:05:26 MDT