       Subroutine sststp(sstupstep)
C       Implicit none									   
       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			   
       INCLUDE "CTLBLK.comm"								   
       INCLUDE "LOOPS.comm"								   
       INCLUDE "MASKS.comm"								   
       INCLUDE "PHYS.comm"								   
       
       integer,intent(in)	    :: sstupstep					   
       integer  		    :: day						   
       integer  		    :: mon						   
       integer  		    :: yr						   
       integer  		    :: utc						   
       integer  		    :: ma						   
       integer  		    :: mb
       integer                      :: imes
       integer                      :: imes2
       integer			    :: nmessst					   
       real*4			    :: yday						   
       real*4			    :: add						   
       real*4			    :: fa						   
       real*4			    :: fb						   
       integer, dimension(12)	    :: monl
       character(len=10)            :: chardate	
       					   
      iyr=IDAT(3)
      imo=IDAT(1)
      idy=IDAT(2)
      iutc=NTSD*DT/3600     ! Utilizando um passo de tempo para a rodada definido pelo def_eta.scr,chou dt eh 90seg
      nmessst=30*(86400/DT) ! Calculo do numero de passo de tempo em 1 mes(30dias)
      
      
      CALL getdate(iyr,imo,idy,iutc,yr,mon,day,utc)
       
       data monl /30,30,30,30,30,30,30,30,30,30,30,30/					   
C       If (mod(yr,4) .eq. 0) monl(2)=29 						   
C*			   
       yday=day 									   
       ma=mon-1
c       print*,"MA",ma,"DAY",yday 
C       write(6,*) yday, mon, day, utc 								   
       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
       if(ntsd.eq.1)then
         imes=initsst
         imes2=imes+1
c	 print*,"IMES",imes,"MON",mon
       
       else
CGAJSST MUDANDO O MES DA LEITURA DA SST NO DIA 16 DE CADA MES PARA UM dt=90      
	
	ntsd1=(ntsd+(nmessst/2))
	imes=int(ntsd1/nmessst)+initsst
        imes2=imes+1
c	print*,"IMES",imes,"MON",mon,"NTSDU",ntsd,ntsd1

CGAJSST FIM 		
       endif									   
       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
       If ((ntsd.eq.1).and.(int(yday).eq.15)) Then					   
         sst=sstm(:,:,imes)	
       Else
         sst=fa*sstm(:,:,imes)+fb*sstm(:,:,imes2)
       Endif										   
       RETURN										   
      END
