== python addcyclic routine == {{{#!python def addcyclic(arrin,lonsin): """ ``arrout, lonsout = addcyclic(arrin, lonsin)`` adds cyclic (wraparound) point in longitude to ``arrin`` and ``lonsin``. """ nlats = arrin.shape[0] nlons = arrin.shape[1] if ma.isMA(arrin): arrout = ma.zeros((nlats,nlons+1),arrin.dtype) else: arrout = np.zeros((nlats,nlons+1),arrin.dtype) arrout[:,0:nlons] = arrin[:,:] arrout[:,nlons] = arrin[:,0] if ma.isMA(lonsin): lonsout = ma.zeros(nlons+1,lonsin.dtype) else: lonsout = np.zeros(nlons+1,lonsin.dtype) lonsout[0:nlons] = lonsin[:] lonsout[nlons] = lonsin[-1] + lonsin[1]-lonsin[0] return arrout,lonsout }}}