ccsm to vis5d

From: Michael Notaro <mnotaro_at_nyahnyahspammersnyahnyah>
Date: Wed Mar 21 2012 - 16:20:53 MDT

I am trying to convert sea-level pressure, precipitation, and cloud
cover at all 26 levels on 1.9x2.5 degree grid from CCSM3.5 to
a vi5d file for a single time step. Could you someone take a look
at the code below and offer some suggestions? I am particularly
not sure how to handle the vertical coordinates or multiple variables.
Sorry, I have no experience with vis5d up to now so this is my first
try to convert the data into that format.

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
copy_VarCoords(psl,pcp)
lat=doubletofloat(a->lat)
lon=doubletofloat(a->lon)
copy_VarCoords(a->lat,lat)
copy_VarCoords(a->lon,lon)

numtimes = 1
numvars = 3
nr = 96
nc = 144
nl = 26

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/)
bottomhgt = 0.0
hgtinc = 1.0
vert = 3
vert_args = (/bottomhgt, hgtinc/)
v5d_create("UVdata.v5d", numtimes, numvars, nr, nc, nl, (/"psl","pcp","cloud"/), timestamp, datestamp, compress, proj, proj_args, vert, vert_args)
v5d_write(numtimes, numvars, (/"psl","pcp","cloud"/))
v5d_close()

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Mar 21 16:21:09 2012

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