C&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
      SUBROUTINE SSTSTP(sstupstep)
C-----------------------------------------------------------------
      INCLUDE "parmeta"
      INCLUDE "parm.tbl"
      INTEGER, PARAMETER    :: la=13
      INTEGER, PARAMETER    :: imjm=im*jm-jm/2,jam=6+2*(jm-10)  
     &        , lp1=lm+1,ltop=1,lbot=lm , lscrch=4*lm+1+la +1  
     &        , l1=la+lm+1,l2=la+2*lm+1 , l3=la+3*lm+1,l4=la+4*lm+1
     &        ,imt=2*im-1,jmt=jm
      INCLUDE "CTLBLK.comm"
      INCLUDE "UPDT.comm"

      INTEGER,INTENT(IN)           :: sstupstep
      INTEGER			   :: ma
      INTEGER			   :: mb
      REAL*4			   :: yday
      REAL*4			   :: add
      REAL*4			   :: fa
      REAL*4			   :: fb
      INTEGER, DIMENSION(12)	   :: monl
      REAL, DIMENSION(imt,jmt)     :: FVarUpdated
C*
      DATA monl /31,28,31,30,31,30,31,31,30,31,30,31/
      write(0,*)chardate
      READ(chardate,'(I4,3I2)')yr,mon,day,utc
      IF (mod(yr,4) .EQ. 0) monl(2)=29

C*
       CALL getdate(yr,mon,day,utc,sstupstep,0,chardate)
       yday=day
       ma=mon-1
       IF ((yday.GE.(1.0+float(monl(mon))/2.0)).OR.((ntsd.eq.1). 
     &      AND.(yday.gt.15))) ma=mon
       mb=ma+1
       IF (ma .LT. 1) ma=12
       IF (mb .GT. 12) mb=1
       add=float(monl(ma))/2.0-1.0
       IF (ma.EQ.mon) add=-add-2.0
       fb=2.0*(yday+add)/FLOAT(monl(ma)+monl(mb))
       fa=1.0-fb
       write(0,*)"SSTSTP",yr,mon,day,utc
       write(0,*)"SSTSTP",fa,ma,fb,mb
       IF ((ntsd.EQ.1).AND.(INT(yday).EQ.15)) THEN
        VarUpdated=sstr(:,:,ma)
       ELSE
          write(99,*)sstr(:,:,ma)
        VarUpdated=fa*sstr(:,:,ma)+fb*sstr(:,:,mb)
       ENDIF
       CALL FILLV(VarUpdated,FVarUpdated,2,imt,jmt)
       OPEN(97,file='SST'//chardate//'.dat',status='unknown')
       write(97)FVarUpdated(:,:)
       CLOSE(97)
       close(99)
      RETURN
      END SUBROUTINE SSTSTP
