      SUBROUTINE PUTHD(NF ,PH,CH,TH,ESH,
     1                 KOUNT,LA,LRLMT,ILEV,LEVS,LS,LH)

C     * OCT 29/93 - M.LAZARE. REPLACE UNFORMATTED WRITE OF LABEL BY
C     *                       CALL TO FBUFOUT, SO WILL WORK ON 32-BIT
C     *                       MACHINES.
C     * JUL 26/92 - M.LAZARE. WRITE OUT IN NATIVE FORMAT (IBUF(8)=0).  
C     * APR 02/92 - E.CHAN. (MODIFY I/O FOR 2-RECORD FORMAT)
C     * DEC 04/90 - E.CHAN. 
C     * ADAPTED FROM PUTSTG7. 
C     * 
C     * SAVES GLOBAL SPECTRAL FORECAST (HORIZONTAL DIFFUSION TERMS
C     * VORTICITY, DIVERGENCE, TEMPERATURE, AND MOISTURE) 
C     * ON SEQUENTIAL FILE NF.
C     * ALL FIELDS ARE WRITTEN UNPACKED.
C     * LS,LH = OUTPUT LABEL VALUES FOR FULL,HALF LEVELS. 
C 

      IMPLICIT REAL (A-H,O-Z),
     +INTEGER (I-N)

      COMPLEX PH(LA,ILEV),CH(LA,ILEV),TH(LA,ILEV),ESH(LA,LEVS)
  
      INTEGER LS(ILEV),LH(ILEV) 
      INTEGER IBUF(8) 
  
C-------------------------------------------------------------------- 
      IVORT=NC4TO8("VRTH")
       IDIV=NC4TO8("DIVH")
        IES=NC4TO8(" ESH")
C 
      CALL SETLAB(IBUF,NC4TO8("SPEC"),KOUNT,NC4TO8("TMPH"),1,LA,1,
     1                                                    LRLMT,0)
C 
C     * SAVE TEMPERATURE TENDENCY FOR ILEV LEVELS.
C 
      DO 310 L=1,ILEV 
      IBUF(4)=LH(L) 
      CALL FBUFOUT(NF,IBUF,-1,K)  
      WRITE(NF) (TH(I,L),I=1,LA) 
      WRITE(6,6026) IBUF
  310 CONTINUE
C 
C     * SAVE VORTICITY AND DIVERGENCE IN PAIRS FOR EACH LEVEL.
C 
      DO 410 L=1,ILEV 
      IBUF(4)=LS(L) 
      IBUF(3)=IVORT
      CALL FBUFOUT(NF,IBUF,-1,K)  
      WRITE(NF) (PH(I,L),I=1,LA) 
      WRITE(6,6026) IBUF
      IBUF(3)=IDIV
      CALL FBUFOUT(NF,IBUF,-1,K)  
      WRITE(NF) (CH(I,L),I=1,LA) 
      WRITE(6,6026) IBUF
  410 CONTINUE
C 
C     * MOISTURE VARIABLE SAVED FOR LEVS LEVELS.
C 
      IF(LEVS.EQ.0) RETURN
      DO 510 N=1,LEVS 
      L=(ILEV-LEVS)+N 
      IBUF(4)=LH(L) 
      IBUF(3)=IES
      CALL FBUFOUT(NF,IBUF,-1,K)  
      WRITE(NF) (ESH(I,N),I=1,LA)
      WRITE(6,6026) IBUF
  510 CONTINUE
C 
      RETURN
C-----------------------------------------------------------------------
 6026 FORMAT(' ',60X,A4,I10,2X,A4,5I6)
      END 
