Re: calculating "CAPE"

From: Brammer, Alan P <abrammer_at_nyahnyahspammersnyahnyah>
Date: Mon Jun 16 2014 - 08:48:58 MDT

Mark,

fatal:["Execute.c":7432]:performASSIGN_VAR_VAR_OP: Number of subscripts on rhs do not match
                        number of dimensions of variable, (4) Subscripts used, (5) ▒

fatal:["Execute.c":8128]:Execute: Error occurred at or near line 22 in file my3_CAPE.ncl

Line 22: cape = cape_3d(0,:,:,:)


So in this line you’re telling NCL that cape_3d has 4 dimensions "(4) Subscripts used”. NCL is telling you that there are actually 5 dimensions.

Put a printVarSummary(cape_3d) in Line 21 and edit your subscripts accordingly.
The 5 dimensions are I imagine, (time, cape/cin, level, lat, lon ) maybe not in that order.

You probably then want to also check that the output file CAPE3D matches the output dimensions of cape.




Alan.


##############################
Alan Brammer,
PhD Student,

Department of Atmospheric and Environmental Sciences,
University at Albany, State University of New York, Albany, NY, 12222
abrammer@albany.edu<mailto:abrammer@albany.edu>
##############################

On Jun 15, 2014, at 16:16, Mark Chan <cym263@yahoo.com<mailto:cym263@yahoo.com>> wrote:

Dear NCL users,

In the below is an ncl script, which is for calculating CAPE and put the result into a file "CAPE_3D.nc". But I got the error message as:

-----error message------------
 Copyright (C) 1995-2013 - All Rights Reserved
 University Corporation for Atmospheric Research
 NCAR Command Language Version 6.1.2
 The use of this software is governed by a License Agreement.
 See http://www.ncl.ucar.edu/ for more details.
fatal:["Execute.c":7432]:performASSIGN_VAR_VAR_OP: Number of subscripts on rhs do not match
                        number of dimensions of variable, (4) Subscripts used, (5) ▒

fatal:["Execute.c":8128]:Execute: Error occurred at or near line 22 in file my3_CAPE.ncl
-------------------------------------

I would appreciate if you could give more suggestion about the "CAPE" based on my script here.

Thanks so much!
Mark

===NCL script======
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.

   a = addfile("wrfout_d02_1994-01-11_00:00:00.nc","r")

   system("/bin/rm -f " + "CAPE_3D.nc")

   b = addfile("CAPE_3D.nc","c")

   dim_names = getvardims(a)
   dim_sizes = getfiledimsizes(a)
   dimUnlim = (/True, False, False, False, False, False, False, False, False/)
   filedimdef(b, dim_names, dim_sizes, dimUnlim)
   time = -1

     cape_3d = wrf_user_getvar(a,"cape_3d",time)

     cape = cape_3d(0,:,:,:)

   lat = a->XLAT
   lon = a->XLONG
   times = a->Times
   fileattdef(b,a)

   b->Times = times
   b->XLAT = lat
   b->XLONG = lon
   b->CAPE3D = cape

end


_______________________________________________
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 Mon Jun 16 02:49:19 2014

This archive was generated by hypermail 2.1.8 : Wed Jul 23 2014 - 15:33:46 MDT