vis5d problems continue

From: Michael Notaro <mnotaro_at_nyahnyahspammersnyahnyah>
Date: Thu Mar 22 2012 - 12:35:23 MDT

My script below is producing the following error:
fatal:v5d_write - data size mismatch
fatal:Execute: Error occurred at or near line 73

I have 3 variables: sea-level pressure, precipitation,
and 3D cloud cover.  I fit them all to a 3d grid to make
things "easy" (so same precip values at all levels for
example).

So my data variables has dimensions 96,144,3*26
for 96x144 data with 26 vertical levels. 

Seems these dimensions are not working with my
script.  Any thoughts? 

I recommend adding a vis5d example to the ncl
website where multiple variables (say a 2d and 3d)
are written to a single v5d file.  That would help
slow people like me (:

Michael

a=addfile("test1.nc","r")
b=addfile("test2.nc","r")
psl=a->PSL(0,:,:)
cloud=b->CLOUD(0,:,:,:)
pcp=(b->PRECL(0,:,:))+(b->PRECC(0,:,:))
pcp=pcp*60.*60.*24.*1000. ; mm/d
lev=doubletofloat(a->lev)
lev=lev(::-1)
copy_VarCoords(a->lev,lev)
lat=doubletofloat(a->lat)
lon=doubletofloat(a->lon)
lat=lat(::-1)
lon=lon(::-1)
copy_VarCoords(a->lat,lat)
copy_VarCoords(a->lon,lon)

psl=psl(::-1,:)
pcp=pcp(::-1,:)
cloud=cloud(:,::-1,:)

psl!0="lat"
psl!1="lon"
psl&lat=lat
psl&lon=lon
pcp!0="lat"
pcp!1="lon"
pcp&lat=lat
pcp&lon=lon
cloud!0="lev"
cloud!1="lat"
cloud!2="lon"
cloud&lev=lev
cloud&lat=lat
cloud&lon=lon

numtimes = 1
numvars = 3
nr = 96
nc = 144
nl = (/26,26,26/)

varnames=(/"psl","pcp","cloud"/)

timestamp = (/1/)
datestamp = (/1/)
compress = 1
northlat = 90.0
latinc = 1.9
westlon = 0.0
loninc = 2.5
projection = 1
proj_args = (/northlat, westlon, latinc, loninc/)
vert = 3
vert_args=lev

data=new((/96,144,3*26/),float)
do i=0,25
  data(:,:,i)=psl
end do
do i=26,51
  data(:,:,i)=pcp
end do
data(:,:,52:77)=cloud(lat|:,lon|:,lev|:)

v5d_create("monsoon.v5d", numtimes, numvars, nr, nc, nl, varnames, timestamp, datestamp, compress, projection, proj_args, vert, vert_args)
v5d_write(numtimes, numvars, data)
v5d_close()

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Mar 22 12:35:34 2012

This archive was generated by hypermail 2.1.8 : Tue Mar 27 2012 - 08:50:24 MDT