      SUBROUTINE PUTDTND(NF ,PTD,CTD,TTD,ESTD,
     1                   KOUNT,LA,LRLMT,ILEV,LEVS,LS,LH,
     2                   LSRTOTAL,LATOTAL,LMTOTAL,GLL)

C     * FEB 29/2012 - M.LAZARE. 
C
C     * SAVES GLOBAL SPECTRAL DYNAMICS TENDENCIES 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 TTD(LA,ILEV),PTD(LA,ILEV),CTD(LA,ILEV),ESTD(LA,LEVS)
      COMPLEX GLL(LATOTAL)

      INTEGER LSRTOTAL(2,LMTOTAL+1)
      INTEGER LS(ILEV),LH(ILEV) 
      INTEGER IBUF(8) 
  
      LOGICAL OK

      COMMON /IPARIO/  IPIO
      COMMON /KEEPTIM/ IYEAR,IYMDH,MYRSSTI,ISAVDTS
C-------------------------------------------------------------------- 
      MAX=2*LATOTAL
C
       ITMP=NC4TO8(" TTD")
      IVORT=NC4TO8(" PTD")
       IDIV=NC4TO8(" CTD")
        IES=NC4TO8("ESTD")

C     * DETERMINE PROPER IBUF(2) TO USE FOR SAVED FIELDS, BASED ON
C     * VALUE OF OPTION SWITCH "ISAVDTS".
C
      IF(ISAVDTS.NE.0)                   THEN
         IBUF2=IYMDH
      ELSE
         IBUF2=KOUNT
      ENDIF
C
      CALL SETLAB(IBUF,NC4TO8("SPEC"),IBUF2,-1,1,-1,1,LRLMT,0)
C 
C     * SAVE TEMPERATURE TENDENCIES FOR ILEV LEVELS. 
C
      IBUF(3)=ITMP 
      DO 310 L=1,ILEV 
         IBUF(4)=LH(L) 
         CALL PUTSPN (NF,TTD(1,L),LA,
     1                LSRTOTAL,LATOTAL,LMTOTAL,GLL,
     2                IBUF,MAX,IPIO,OK)
  310 CONTINUE
C 
C     * SAVE VORTICITY AND DIVERGENCE TENDENCIES IN PAIRS FOR EACH LEVEL.
C 
      DO 410 L=1,ILEV 
         IBUF(4)=LS(L) 

         IBUF(3)=IVORT
         CALL PUTSPN (NF,PTD(1,L),LA,
     1                LSRTOTAL,LATOTAL,LMTOTAL,GLL,
     2                IBUF,MAX,IPIO,OK)

         IBUF(3)=IDIV
         CALL PUTSPN (NF,CTD(1,L),LA,
     1                LSRTOTAL,LATOTAL,LMTOTAL,GLL,
     2                IBUF,MAX,IPIO,OK)
  410 CONTINUE
C 
C     * MOISTURE VARIABLE TENDENCIES SAVED FOR LEVS LEVELS.
C 
      IF(LEVS.EQ.0) RETURN
      IBUF(3)=IES
      DO 510 N=1,LEVS 
         L=(ILEV-LEVS)+N 
         IBUF(4)=LH(L) 
         CALL PUTSPN (NF,ESTD(1,N),LA,
     1                LSRTOTAL,LATOTAL,LMTOTAL,GLL,
     2                IBUF,MAX,IPIO,OK)
  510 CONTINUE
C 
      RETURN
C-----------------------------------------------------------------------
      END
