Computes the divergence using spherical harmonics given the u and v wind components on a gaussian grid.
function uv2dvG ( u : numeric, v : numeric ) return_val [dimsizes(u)] : float or double
Wind components (input, arrays with two or more dimensions, rightmost two dimensions must be nlat x nlon)
- input values must be in ascending latitude order
- input array must be on a global grid
This function returns a double array if u or v are double; a float array otherwise. Divergence is returned in an array dimensioned dimsizes(u).
Given wind components u and v, uv2dvG computes the divergence. This function operates on a gaussian grid.
This function does not allow for missing data (defined by the _FillValue attribute) to be present. If any missing values are encountered in a particular 2D input grid, then all of the values in the corresponding output grid will be set to the default missing value appropriate to the type of the output.
Note, if the input arrays are not global or contain missing data, then it is recommended that uv2dv_cfd be used.
Note: For the arrays whose rightmost two dimensions are nlat x nlon, the rest of the dimensions (if any) are collectively referred to as N. If the input/output arrays are just two dimensions, then N can either be considered equal to 1 or nothing at all.
Arrays which have dimensions N x nlat x nlon should not include the cyclic (wraparound) points when invoking the procedures and functions which use spherical harmonics (Spherepack).
Use uv2dvG_Wrap if retention of metadata is desired.
Calculate the divergence from the wind components u,v, and then calculate the divergent wind components. u and v are on a gaussian grid.
begin a = addfile("/cgd/cas/shea/MURPHYS/ATMOS/80.nc","r") u = a->U(:,0,:,:) v = a->V(:,0,:,:) dv = uv2dvG (u,v) ; u,v ==> divergence uvd = dv2uvG (dv) ; dv ==> divergent wind components end
If jer or ker is equal to:
1 : error in the specification of nlat
2 : error in the specification of nlon
4 : error in the specification of N (jer only)