Re: loop error ??? WRF

From: Gareth Berry <gareth_at_nyahnyahspammersnyahnyah>
Date: Wed, 26 Nov 2008 15:07:49 +0000 (GMT)

Hi Erik,

I think your start of you loop may be the problem:

do it=0,maxt-9 ; store each time step rather than accumulate

maxt is an integer array of 3 elements (time,lat,lon dimension sizes). Try
specifying which of these elements you want to use in the loop, i.e.

do it=0,(maxt(0)-9) ; store each time step rather than accumulate

I think that should work!

Cheers,

Gareth.

Hi. May I have some help? Why am I getting this error in this simple script?
It is not clear to me.

fatal:Loop end must be scalar, can't execute loop
fatal:Execute: Error occurred at or near line 28 in file
wrf_test_precip_to_nc.ncl

I am just trying to read in WRF accumulated rain for many timesteps.

10 squall:noble% ncl wrf_test_precip_to_nc.ncl
 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.

Variable: times
Type: string
Total Size: 136 bytes
            17 values
Number of Dimensions: 1
Dimensions and sizes: [17]
Coordinates:
Number Of Attributes: 2
  description : times in file
  _FillValue : missing
(0) 2006-09-01_00:00:00
(1) 2006-09-01_03:00:00
(2) 2006-09-01_06:00:00
(3) 2006-09-01_09:00:00
(4) 2006-09-01_12:00:00
(5) 2006-09-01_15:00:00
(6) 2006-09-01_18:00:00
(7) 2006-09-01_21:00:00
(8) 2006-09-02_00:00:00
(9) 2006-09-02_03:00:00
(10) 2006-09-02_06:00:00
(11) 2006-09-02_09:00:00
(12) 2006-09-02_12:00:00
(13) 2006-09-02_15:00:00
(14) 2006-09-02_18:00:00
(15) 2006-09-02_21:00:00
(16) 2006-09-03_00:00:00

Variable: maxt
Type: integer
Total Size: 12 bytes
            3 values
Number of Dimensions: 1
Dimensions and sizes: [3]
Coordinates:
(0) 17
(1) 110
(2) 140
fatal:Loop end must be scalar, can't execute loop
fatal:Execute: Error occurred at or near line 28 in file
wrf_test_precip_to_nc.ncl
11 squall:noble% cat wrf_test_precip_to_nc.ncl
; script to produce accumualted rain from WRF real-data run,
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"
begin
; The WRF ARW input file.
diri1
="/gpfs/ptmp/noble/Output-WRF/GFS_Study/SOP3_48_forecast/WRF_Output_gfs_3_200609
01/"
ifile1 ="wrfout_d01_2006-09-01_00:00:00.nc"
title = "WRF-SOP3_R2_Accum_Precip_00UT-GFS"
a=addfile(diri1+ifile1,"r")
; What times and how many time steps are in the data set?
  FirstTime = True
  times = wrf_user_list_times(a) ; get times in the file
  ntimes = dimsizes(times) ; number of times in the file
; rain variables
 nc = a->RAINNC
 cc = a->RAINC
 rainfall = nc + cc ; this is rainfall summed retaining lat,lon,time
dimensions
 maxt = dimsizes(rainfall) ; result should return 3 values (time, lat,lon
lenth of dimensions)
print(maxt)
do it=0,maxt-9 ; store each time step rather than accumulate
rain = rainfall(t+8,:,:)-rainfall(t,:,:)
end do
end

>X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on
cypress.atmos.albany.edu
>X-Spam-Level:
>X-Spam-Status: No, score=-2.6 required=8.0 tests=BAYES_00,HTML_MESSAGE
autolearn=ham version=3.2.4
>X-Original-To: ncl-talk_at_mailman.ucar.edu
>X-SMTP-Auth: no
>DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
h=domainkey-signature:received:received:message-id:date:from:sender
:to:subject:mime-version:content-type:x-google-sender-auth;
bh=UhUCCTf+Shox+HO20U+ikdqVjqlBm97D8BCZf7o7P/0=;
b=uDs7IgnA/CwLGM1XAFbLXrUauZnRYPZ9nTtvXR5bPMQsKqgkO4T5ywC1jCpQ/gYSLi
Q2IUglE3AkJUPcN70gSFyPtPGqv/iMK+DsGb9ArA0+7HC15X7/TpZxyJb6ZpXQaSHgDw
23K0ZcYxJ8y+ufn6DTgzYS2pdhOy5lohmldLc=
>DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
h=message-id:date:from:sender:to:subject:mime-version:content-type
:x-google-sender-auth;
b=VUqIjiJbW89c/yT8TEfKnGnXAH05B4szSKaQdxcDXeHMPjcumPY26AN0QNh1sy5p1V
UIbCzeRjanDTvX8fEubsphroC3hCHU9ow6LYVPZyVybIuRDPK4TKb662gToR1VB65wjr
n6T8z8RJUpwrEus/rMItszaHNOn82nP/OFP44=
>Date: Wed, 26 Nov 2008 01:38:50 -0500
>From: "Erik Noble" <enoble_at_giss.nasa.gov>
>To: "ncl-talk_at_ucar.edu" <ncl-talk_at_ucar.edu>
>MIME-Version: 1.0
>X-Google-Sender-Auth: d77beebba4cc693d
>X-Virus-Scanned: amavisd-new at ucar.edu
>Subject: loop error ??? WRF
>X-BeenThere: ncl-talk_at_ucar.edu
>X-Mailman-Version: 2.1.5
>List-Id: NCAR Command Language User Group <ncl-talk.ucar.edu>
>List-Unsubscribe: <http://mailman.ucar.edu/mailman/listinfo/ncl-talk>,
<mailto:ncl-talk-request_at_ucar.edu?subject=unsubscribe>
>List-Post: <mailto:ncl-talk_at_ucar.edu>
>List-Help: <mailto:ncl-talk-request_at_ucar.edu?subject=help>
>List-Subscribe: <http://mailman.ucar.edu/mailman/listinfo/ncl-talk>,
<mailto:ncl-talk-request_at_ucar.edu?subject=subscribe>
>X-Keywords:
>

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Nov 26 2008 - 08:07:49 MST

This archive was generated by hypermail 2.2.0 : Sun Nov 30 2008 - 08:25:42 MST