M3TOGTPZ

Fortran version:

"Generic" Fortran-90 routine with an optional SPHER argument:
    LOGICAL FUNCTION  M3TOGTPZ( GDTYP, IZONE1, P_ALP, P_BET, P_GAM, YCENT,   &
                                TPA, ISYS, IZONE, IUNIT, ISPH )
    LOGICAL FUNCTION  M3TOGTPZ( GDTYP, IZONE1, P_ALP, P_BET, P_GAM, YCENT, SPHER,  &
                                TPA, ISYS, IZONE, IUNIT, ISPH )

        INTEGER, INTENT(IN   ) :: GDTYP                 !!  I/O API projection type LATGRD3, ...
        INTEGER, INTENT(IN   ) :: IZONE1                !!  UTM zone, or
        projection-ID > 60
        REAL*8 , INTENT(IN   ) :: P_ALP, P_BET, P_GAM   !!  defining angles
        REAL*8 , INTENT(IN   ) :: YCENT                 !!  central meridian
        REAL*8 , INTENT(IN   ) :: SPHER                 !!  sphere-radius
        REAL*8 , INTENT(  OUT) :: TPA( 15 )             !!  CTPZ0()-arguments
        INTEGER, INTENT(  OUT) :: ISYS, IZONE, IUNIT    !!  CTPZ0()-arguments
        INTEGER, INTENT(INOUT) :: ISPH                  !!  CTPZ0()-arguments

Summary:

For I/O API Version 3.2 or later, only.

Set up arguments TPA, ISYS, IZONE, IUNIT, ISPH for USGS coordinate-transform routine GTPZ0(). To set up for GCTP, use twice: once for the input arguments, one for the output arguments.

See also Coordinate-coordinate conversion routines:

Preconditions

USE MODGCTGP

Fortran Usage:

    ...
    !!   Arguments for GTPZ0:

    REAL*8          CRDIN( 2 )      !  input coordinates x,y
    INTEGER*4       INSYS           !  input projection code
    INTEGER*4       INZONE          !  input utm zone, etc.
    REAL*8          TPAIN( 15 )     !  input projection parameters
    INTEGER*4       INUNIT          !  input units code
    INTEGER*4       INSPH           !  spheroid code
    INTEGER*4       IPR             !  error print flag
    INTEGER*4       JPR             !  projection parameter print flag
    INTEGER*4       LEMSG           !  error message unit number
    INTEGER*4       LPARM           !  projection parameter unit number
    REAL*8          CRDIO( 2 )      !  output coordinates x,y
    INTEGER*4       IOSYS           !  output projection code
    INTEGER*4       IOZONE          !  output utm zone, etc.
    REAL*8          TPOUT( 15 )     !  output projection parameters
    INTEGER*4       IOUNIT          !  output units code
    INTEGER*4       LN27            !  NAD1927 file unit number
    INTEGER*4       LN83            !  NAD1983 file unit number
    CHARACTER*128   FN27            !  NAD1927 file name
    CHARACTER*128   FN83            !  NAD1983 file name
    INTEGER*4       LENGTH          !  NAD* record-length
    INTEGER*4       IFLG            !  error flag
    ...
    IF ( .NOT.M3TOGTPZ( GDTYP2, 70, P_ALP2, P_BET2, P_GAM2, YCENT2,    &
                        TPAIN, INSYS, INZONE, INUNIT, INSPH ) ) THEN
        EFLAG = .TRUE.
        MESG = 'Lat-Lon, LAM, UTM, TRM, POL, EQM, and ALB supported'
        CALL M3MSG2( MESG )
        WRITE( MESG, '( A, I6, 2X, A )' ) '>>> Output grid type', GDTYP2, 'not supported'
        CALL M3MESG( MESG )
    END IF

    IF ( .NOT.M3TOGTPZ( GDTYP1, 80, P_ALP1, P_BET1, P_GAM1, YCENT1,     &
                        TPOUT, IOSYS, IOZONE, IOUNIT, INSPH ) ) THEN
        MESG = 'Lat-Lon, LAM, UTM, TRM, POL, EQM, and ALB supported'
        CALL M3MSG2( MESG )
        WRITE( MESG, '( A, I6, 2X, A, A )' ) 'Grid type', GDTYP1,'not supported'
        CALL M3EXIT( PNAME, 0, 0, MESG, 2 )
    END IF  ! if non-Lam grid (etc...) for GTP0 input
    ...
    CALL GTPZ0( CRDIN, INSYS, INZONE, TPAIN, INUNIT, INSPH,     &
                IPR, JPR, LEMSG, LPARM, CRDIO, IOSYS, IOZONE,   &
                TPOUT, IOUNIT, LN27, LN83, FN27, FN83,          &
                LENGTH, IFLG )
    ...
    

Up: MODULE MODGCTP

Up: Coordinate and Grid Related Routines

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