C+ C NAME: C GridSphere2D C PURPOSE: C Fills 'holes' and/or smooths a 3D array using a Gaussian weighting function. C The array dimensions represent a regular grid in spherical coordinates C (longitude and latitude). The third is the grid in radial distance. C CALLING SEQUENCE: subroutine GridSphere2D(dXC,nLng,nLat,nR,Z,WidDeg,iBadZ,WThreshold,ClipLng) C INPUTS: real dXC ! range of Carrington variable covered by nLng ! i.e. number of 360 deg rotations. integer nLng ! # longitudes integer nLat ! # latitudes integer nR ! # radial distances real Z(nLng,nLat,nR) ! 3D array of function values real WidDeg ! Width of Gaussian used for angular ! smoothing (in degrees) (WidDeg<0 has ! special meaning; see PROCEDURE) integer iBadZ ! 0: Invalid elements remain invalid; ! valid elements are replaced by a ! smoothed value ! 1: All elements (valid and invalid) are ! replaced by smoothed values. ! 2: Invalid elements are replaced by ! smoothed values; valid elements remain ! untouched. ! ! The following two options are useful if all ! bad bins have to be filled in with something. ! Use them at your own risk (see PROCEDURE). ! ! 3: Same as iBadZ=1, but if any invalid ! elements remain at the end, these are ! all filled in by a call to GridFill ! 4: Same as iBadZ=2, but if any invalid ! elements remain at the end, these are ! all filled in by a call to GridFill ! ! >=10: use open grid for longitude and latitude real WThreshold ! The replacement by a smoothed value is ! made only if total weight is ! larger than/equal to the threshold value. ! (see PROCEDURE). real ClipLng ! Longitude difference (see PROCEDURE) ! (usually set to zero). C OUTPUTS: C real Z(nLng,nLat,nR) smoothed array of function values C CALLS: C GridSphere3D C PROCEDURE: C GridSphere2D is a one-line wrapper around GridSphere3D C MODIFICATION HISTORY: C FEB-1997, Paul Hick (UCSD/CASS; pphick@ucsd.edu) C- call GridSphere3D(dXC,nLng,nLat,nR,Z,WidDeg,-1.,iBadZ,WThreshold,ClipLng) return end