      SUBROUTINE XPRTF(DEPTH,PRVDEP,DYNHT,PRVDHT,PRVTRN,TRANSP)
C
C     TITLE:
C     *****
C
C       XPRTF  -- CALCULATE TRANSPORT FUNCTION
C
C     SYSTEM:
C     ******
C
C       PACODF HYDROGRAPHIC DATA LIBRARY
C
C     PURPOSE:
C     *******
C
C       TO CALCULATE TRANSPORT FUNCTION
C
C     METHOD:
C     ******
C
C       TRANSPORT FUNCTION IS CALCULATED BY INTEGRATION OF DYNAMIC
C       HEIGHT WITH RESPECT TO DEPTH
C
C     USAGE:
C     *****
C
C       PREVIOUS TRANSPORT FUNCTION VALUE (PRVTRN) SHOULD BE SET TO
C       THE NULL VALUE nan TO INITIALIZE XPRTF.
C
C     PARAMETERS:
C     **********
C
C       DEPTH   -> DEPTH (METERS)
C       PRVDEP  -> PREVIOUS DEPTH (METERS)
C       DYNHT   -> DYNAMIC HEIGHT (JOULES/(10*Kg) or M**2/(10*SEC**2))
C       PRVDHT  -> PREVIOUS DYNAMIC HEIGHT
C       PRVTRN  -> PREVIOUS TRANSPORT FUNCTION
C       TRANSP  <- TRANSPORT FUNC (M**3/(10*SEC**2))
C
        REAL DEPTH,PRVDEP,DYNHT,PRVDHT,PRVTRN,TRANSP
C
C     VARIABLES:
C     *********
C
        REAL DZ
C
C     CONSTANTS:
C     *********
C
      integer isnan
C
C     CODE:
C     ****
C
C     SELECT
C       (NO PREVIOUS DEPTH INTERVAL):
          IF(isnan(PRVDEP).ne.0) THEN
          DZ=DEPTH
C       (OTHERWISE):
          ELSE
          DZ = DEPTH-PRVDEP
C         /* CHANGE IN DEPTH */
          ENDIF
C     SELECT
C       (NO PREVIOUS TRANSPORT FUNCTION):
          IF(isnan(PRVTRN).ne.0) THEN
          PRVTRN = 0.0
          PRVDHT = DYNHT
C         SELECT
C           (DEPTH > 15 METERS):
              IF(DEPTH.LT.15.0) GO TO 20
              TRANSP = 0.0
              GO TO 30
C           (OTHERWISE):  /* CALCULATE FROM SURFACE */
C         END SELECT
          ENDIF
C       (DZ <= 0.5 METERS):  /* INSIGNIFICANT DEPTH CHANGE */
   10     CONTINUE
          IF(ABS(DZ).GT.0.5) GO TO 20
          TRANSP = PRVTRN
          GO TO 30
C       (OTHERWISE):
   20     CONTINUE
          TRANSP = PRVTRN + (PRVDHT+DYNHT)*0.5*DZ
C           /* TRANSPORT FUNCTION M**3/(10*SEC**2) */
   30   CONTINUE
C     END SELECT
C
C     /* RETURN */
C
      RETURN
C
C     END XPRTF
C
      END
