!+ Subroutine to write a SAMSON-file.
!
! Method:
!       This routine merely implements Mark Webb's standard
!       writing routine.
!
! Current Owner of Code: J. M. Edwards
!
! History:
!       Version         Date                    Comment
!       1.0             12-04-95                First Version under RCS
!                                               (J. M. Edwards)
!
! Description of Code:
!   FORTRAN 77  with extensions listed in documentation.
!
!- ---------------------------------------------------------------------
      SUBROUTINE SAMSON_OUT(IUNIT, title, inthead, field)
!
!
      IMPLICIT NONE
!
!
!     INCLUDE HEADER FILES.
      INCLUDE 'incl/samson_parm.ecf'
      INCLUDE 'incl/dimensions_field.ucf'
!
!     DUMMY ARGUMENTS.
      INTEGER	!, INTENT(IN)
     &     IUNIT
!             UNIT NUMBER
     &   , inthead(P_headlen)
!             FILE HEADER
      CHARACTER	!, INTENT(IN)
     &     title*(*)
!             FILE TITLE
      REAL*8	!, INTENT(IN)
     &     field(-1: NPD_PROFILE, NPD_LAYER+1)
!             OUTPUT FIELD
!
!     LOCAL VARIABLES.
      INTEGER
     &     I
!             LOOP VARIABLE
     &   , J
!             LOOP VARIABLE
     &   , L
!             LOOP VARIABLE
!
!
      WRITE(IUNIT, '(A)') title
      WRITE(IUNIT, *) (inthead(J), J=1, P_headlen)
!
      DO I=1, inthead(2)
         WRITE(IUNIT, '((1P8E16.7))')
     &      (field(L, I), L=-1, inthead(1))
      ENDDO
!
!
      RETURN
      END
