SETSPHERE, INITSPHERES, and SPHEREDAT

Fortran version:

    LOGICAL FUNCTION SETSPHERE( AXISMAJOR, AXISMINOR )
    LOGICAL FUNCTION INITSPHERES()
    LOGICAL FUNCTION SPHEREDAT( INSPHERE, INPARAM, IOPARAM )
    
      REAL*8  AXISMAJOR     ! small integer, or major axis (meters)
      REAL*8  AXISMINOR     ! minor axis (meters) or eccentricity
      INTEGER INSPHERE      ! argument for GCTP
      REAL*8  INPARAM( 15 ) ! argument for GCTP
      REAL*8  IOPARAM( 15 ) ! argument for GCTP

Summary:

SETSPHERE(), INITSPHERES(), and SPHEREDAT() may be used to set up the choice of spheres for LL2UTM(), UTM2LL(), LL2LAM(), LAM2LLL(), etc., and for setting up the argument-lists for USGS National Mapping Division's General Cartographic Transformation Package routine GTPZ0().

INITSPHERES() uses environment variable IOAPI_ISPH to set up internal sphere specifications; it is called automatically during the initialization of the wrapper routines, and defaults to the GRS-1980 geodetic spheroid in the absence of user specification. Sphere-specification should follow the criteria below. Since INITSPHERES() is called automatically by the wrapper-routines, its use should not be needed unless you want to call GCTP directly.

SETSPHERE() uses sphere specifications established by SETSPHERE() or INITSPHERES(), and sets up the arguments INSPH, TPARIN, and TPARIO for GCTP accordingly.

SPHEREDAT() uses the most recently stored sphere specifications established by SETSPHERE() or INITSPHERES() to set up the arguments INSPH, TPARIN, and TPARIO accordingly for USGS National Mapping Division's General Cartographic Transformation Package routine GTPZ0(). (Normally this functionality is handled within the wrapper-routines; it should be needed only for direct calls to GCTP.)

Note that GCTP only permits the specification of one sphere at a time, so sphere-to-sphere coordinate transformations must use Lat-Lon as an intermediate step between the starting projection and spheroid and the final projection and spheroid. For example, to transform from UTM coordinates <x,y> on Clarke 1880 to Lambert coordinates <s,t> on GRS 1980, one might set the spheroid to 1 with SETSPHERE and use UTM2LL on <x,y> to compute Lat-Lon coordinates <p,q>, then set the spheroid to 8 with SETSPHERE and use LL2LAM to transform <p,q> into the desired <s,t>.

Sphere Specification:

Small integers in the range 0, ..., 19 may be used to designate "standard" USGS spheroids, according to the following list:
  1. Clarke 1866
  2. Clarke 1880
  3. Bessel
  4. New International 1967
  5. International 1909
  6. WGS 72
  7. Everest
  8. WGS 66
  9. GRS 1980
  10. Airy
  11. Modified Everest
  12. Modified Airy
  13. WGS 84
  14. Southeast Asia
  15. Australian National
  16. Krassovsky
  17. Hough
  18. Mercury 1960
  19. Modified Mercury 1968
  20. Normal Sphere
DOUBLE PRECISION sphere radius in meters may be used to designate a requested spherical Earth. A pair of DOUBLE PRECISION containing the major axis and the minor axis in meters, or the major axis and square of the eccentricity may be used to designate a requested spheroidal Earth. Examples are as follows:

Preconditions

  d setenv IOAPI_ISPHdd<value>
    
to establish program-wide non-default geodetic spheroid choices.

Fortran Usage:

(under construction!

See also Coordinate-coordinate conversion routines:


Previous: GCTP

Previous: LL2UTM and UTM2LL

Next: UNGRIDB

Up: Coordinate and Grid Related Routines

To: Models-3/EDSS I/O API: The Help Pages