Re: Opening multiple files and NCL wrf functions

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Thu Nov 29 2012 - 09:35:49 MST

I 'see' the issue.

The 1st (0-th) argument is prototyped as type 'file'

        function wrf_contour (
                nc_file : file, <=====
                wks : graphic,
                data [*][*] : numeric,
                res : logical
        )
====
Variable 'a' is of type "list".

print(a)

Each element of 'a' is of type "file"

For 'fun' try and see what it prints:

printVarSummary(a[0])

====
I do not know (nor do I want to know) how wrf_contour
uses the 'nc_file' argument but the following may work.

   cont_hgt = wrf_contour(a[0],wks,hgt,opts_h)

On 11/29/12 9:18 AM, Gerry Creager - NOAA Affiliate wrote:
> I've sent this along to wrf-help, where, as Dennis notes on a regular
> basis, this sort of thing should go. I've not run across that particular
> problem, however. I have concatenated files in this manner for WRF with
> no problems. This suggests, however, that wrf_contour isn't finding 'a',
> your concatenated files. I'm wondering if ListSetType is needed here.
>
> gerry
>
>
> On Thu, Nov 29, 2012 at 9:43 AM, Luis C. Cana Cascallar
> <lcana@dfis.ulpgc.es <mailto:lcana@dfis.ulpgc.es>> wrote:
>
> Dear all,
>
> I'm trying to open multiple wrf output files and concatenate the as
> one, following the example named "Spanning Multiple Files":
>
> ===============================
> ; WRF ARW open multiple files
> ; get list of all files and open as "one big file"
> all_files = systemfunc ("ls /Users/lcana/Dust/wrfout_d01_2004-03*")
> a = addfiles (all_files, "r")
> ; choose how files are combined and read in variable across files
> ListSetType (a, "cat") ; concatenate or "merge" (default)
> ===============================
>
> Later, I call different wrf_user functions as the following:
>
> ===============================
> times = wrf_user_list_times(a) ; get
> times in the file
> ntimes = dimsizes(times) ; number of times
> in the file
>
>
> hgt = wrf_user_getvar(a,"ter",it) ; get terrain height
> hgt@description = "Terrain height"
> hgt@units = "m"
> ====================================================
>
>
> and so on. When I execute the script, I can see the following output:
>
>
> Variable: times
> Type: string
> Total Size: 88 bytes
> 11 values
> Number of Dimensions: 1
> Dimensions and sizes: [11]
> Coordinates:
> Number Of Attributes: 2
> description : times in file
> _FillValue : missing
> (0) 2004-03-02_12:00:00
> (1) 2004-03-02_18:00:00
> (2) 2004-03-03_00:00:00
> (3) 2004-03-03_06:00:00
> (4) 2004-03-03_12:00:00
> (5) 2004-03-03_18:00:00
> (6) 2004-03-04_00:00:00
> (7) 2004-03-04_06:00:00
> (8) 2004-03-04_12:00:00
> (9) 2004-03-04_18:00:00
> (10) 2004-03-05_00:00:00
>
> It looks OK, so I assume all things are right. But then there is a
> problem at this line:
>
> cont_hgt=wrf_contour(a,wks,hgt,opts_h) ; create terrain
> plot for overlay, line 118
>
> fatal:Argument type mismatch on argument (0) of (wrf_contour) can
> not coerce
> fatal:Execute: Error occurred at or near line 118 in file
> Viento_en_niveles_z_brisas.ncl
>
> What is wrong here? wrf_contour function is different?
>
> Thanks in advance,
>
> Luis Cana
> ULPGC
>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Nov 29 09:36:05 2012

This archive was generated by hypermail 2.1.8 : Fri Dec 07 2012 - 13:30:06 MST