Hi Adam
That is great thanks, it solved the problem. You also cleared up some confusion I had about the use of 0 and : which is useful.
Kind regards
Dominique
________________________________
From: ncl-talk-bounces@ucar.edu [ncl-talk-bounces@ucar.edu] on behalf of Adam Phillips [asphilli@ucar.edu]
Sent: 28 June 2012 20:08
To: ncl-talk@ucar.edu
Subject: Re: Problem using dim_numrun_n and plotting output
Hi Dominique,
I noticed that instead of using colons you are using semicolons, as you are here:
plot = gsn_csm_contour_map(wks,tc2_tally(0,0,;,;),res)
Try changing the semicolons to colons and see if that works.
Note that semicolons are used exclusively for commenting, as in:
plot = gsn_csm_contour_map(wks,tc2_tally(0,0,:,:),res) ; plot data
Also, you are passing a 4D array into gsn_csm_contour_map here:
plot = gsn_csm_contour_map(wks,tc2_tally(0,;,;,;,;),res)
You can only pass a latitude/longitude array into gsn_csm_contour_map, so for instance:
plot = gsn_csm_contour_map(wks,tc2_tally(0,0,0,:,:),res)
Hope that helps. If not, please reply to ncl-talk.. Adam
On 06/28/2012 11:24 AM, Cannavina, Dominique wrote:
Hi NCL-Talk
I am writing a script to count the number of occurances for given number of consecutive days that a temperature falls below a given temperature. The data I am am using is from the DEMETER project and each file contains 3 different models each running 9 ensembles to give daily minimum temperatures. The domain covering Europe.
I have written a script using dim_numrun_n to count up the number of occurances of a run of temperature below zero where the run is 1 day below zero, 2 days below zero, 3 days .........
But when I go to plot the output I get a plotting errors -I have tried a few variations of the plot = line and so have included two of them (the full script is attached)
fatal:syntax error: line 207 in file /work/dc2011/WRF/ECMWF_DEMETER/plt_min2m_allmodels_allensembles_all_days.ncl before or near ;,;),res)
plot = gsn_csm_contour_map(wks,tc2_tally(0,0,;,;),res)
^
fatal:Error in subscript, normal subscripting is being used, make sure named subscripting has not been used
fatal:syntax error: line 207 in
file /work/dc2011/WRF/ECMWF_DEMETER/plt_min2m_allmodels_allensembles_all_days.ncl before or near ;,;,;,;,;),res)
plot = gsn_csm_contour_map(wks,tc2_tally(;,;,;,;,;),res)
^
fatal:Syntax Error in block, block not executed
fatal:error at line 215 in file /work/dc2011/WRF/ECMWF_DEMETER/plt_min2m_allmodels_allensembles_all_days.ncl
I printed out the variable tc2_tally (see below) and it has 5 dimensions and looking at the sizes I think it is
[number of files] x [number of days in each sample] x [number of ensembles] x [lat] x [lon]
Variable: tc2_tally
Type: integer
Total Size: 6998400 bytes
1749600 values
Number of Dimensions: 5
Dimensions and sizes: [2] x [180] x [9] x [18] x [30]
Coordinates:
Apart from my plotting issue would this indicate a second problem earlier up in my script as I was expecting less dimensions?
A sample of the main variables is given below
Any guidance would be greatly appreciated.
Kind regards
Dominique
Variable: ukmo
Type: float
Total Size: 6998400 bytes
1749600 values
Number of Dimensions: 5
Dimensions and sizes: [ncl_join | 2] x [step | 180] x [number | 9] x [latitude | 18] x [longitude | 30]
Coordinates:
step: [24..4320]
number: [0..8]
latitude: [75..32.5]
longitude: [-27.5..45]
Number Of Attributes: 6
_FillValue_original : -32767
_FillValue : -32767
missing_value_original : -32767
units : K
long_name : Minimum 2 metre temperature
missing_value : -32767
Variable: scwf
Type: float
Total Size: 6998400 bytes
1749600 values
Number of Dimensions: 5
Dimensions and sizes: [ncl_join | 2] x [step | 180] x [number | 9] x [latitude | 18] x [longitude | 30]
Coordinates:
step: [24..4320]
number: [0..8]
latitude: [75..32.5]
longitude: [-27.5..45]
Number Of Attributes: 6
_FillValue_original : -32767
_FillValue : -32767
missing_value_original : -32767
units : K
long_name : Minimum 2 metre temperature
missing_value : -32767
Variable: cnrm
Type: float
Total Size: 6998400 bytes
1749600 values
Number of Dimensions: 5
Dimensions and sizes: [ncl_join | 2] x [step | 180] x [number | 9] x [latitude | 18] x [longitude | 30]
Coordinates:
step: [24..4320]
number: [0..8]
latitude: [75..32.5]
longitude: [-27.5..45]
Number Of Attributes: 6
_FillValue_original : -32767
_FillValue : -32767
missing_value_original : -32767
units : K
long_name : Minimum 2 metre temperature
missing_value : -32767
Variable: lat
Type: float
Total Size: 72 bytes
18 values
Number of Dimensions: 1
Dimensions and sizes: [latitude | 18]
Coordinates:
latitude: [75..32.5]
Number Of Attributes: 2
units : degrees_north
long_name : latitude
Variable: lon
Type: float
Total Size: 120 bytes
30 values
Number of Dimensions: 1
Dimensions and sizes: [longitude | 30]
Coordinates:
longitude: [-27.5..45]
Number Of Attributes: 2
units : degrees_east
long_name : longitude
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
-- ______________________________________________________________ Adam Phillips asphilli@ucar.edu<mailto:asphilli@ucar.edu> NCAR/Climate and Global Dynamics Division (303) 497-1726 P.O. Box 3000 Boulder, CO 80307-3000 http://www.cgd.ucar.edu/cas/asphilli
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Jun 28 13:53:37 2012
This archive was generated by hypermail 2.1.8 : Fri Jun 29 2012 - 15:46:14 MDT