C&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
                        SUBROUTINE READ_SST12M(NHB)
C     ******************************************************************
C$$$  SUBPROGRAM DOCUMENTATION BLOCK
C                .      .    .

C SUBPROGRAM:    READ_NHB    READ AND DISTRIBUTE NHB FILE
C   PRGRMMR: BLACK           ORG: W/NP2      DATE: 98-10-22
C
C ABSTRACT:
C     READ_NHB READS IN QUANTITIES FROM THE NHB FILE AND THEN
C     DISTRIBUTES THEM TO THE OTHER NODES/PEs AS NEEDED
C
C PROGRAM HISTORY LOG:
C   97-??-??  MEYS       - ORIGINATOR
C   97-08-??  BLACK      - REWROTE FOR BENCHMARK
C   98-??-??  TUCCILLO   - MODIFIED FOR SINGLE OR DOUBLE PRECISION
C
C USAGE: CALL READ_NHB FROM SUBROUTINE INIT
C   INPUT ARGUMENT LIST:
C       NHB: FILE NUMBER OF THE NHB FILE
C
C   OUTPUT ARGUMENT LIST:
C     NONE
C
C   OUTPUT FILES:
C     NONE
C
C   SUBPROGRAMS CALLED:
C     UNIQUE: DSTRB
C             IDSTRB
C
C     LIBRARY: NONE
C
C   COMMON BLOCKS: CTLBLK
C                  LOOPS
C                  MASKS
C                  DYNAM
C                  PHYS2
C                  MAPOT1
C                  VRBLS
C                  CONTIN
C                  PVRBLS
C                  BOCO
C                  ACMCLH
C                  ACMCLD
C                  ACMPRE
C                  ACMRDL
C                  ACMRDS
C                  ACMSFC
C                  CLDWTR
C                  CNVCLD
C                  SOIL
C                  INDX
C    
C   ATTRIBUTES:
C     LANGUAGE: FORTRAN 90
C     MACHINE : IBM SP
C$$$  
C
C-----------------------------------------------------------------------
C     INCLUDE/SET PARAMETERS.
C-----------------------------------------------------------------------
      INCLUDE "parmeta"
      INCLUDE "parm.tbl"
      INCLUDE "parmsoil"
      
C-----------------------------------------------------------------------
                              P A R A M E T E R
     & (G=9.8,CM1=2937.4,CM2=4.9283,CM3=23.5518,EPS=0.622
C
CVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV
C    &, Q2INI=.01E0,EPSQ2=1.E-4,EPSQ=2.E-12,EPSWET=1.E-4
C    &, Q2INI=1.0E0,EPSQ2=1.E-4,EPSQ=2.E-12,EPSWET=1.E-4
C    &, Q2INI=.50E0,EPSQ2=1.E-4,EPSQ=2.E-12,EPSWET=1.E-4
C    &, Q2INI=.01E0,EPSQ2=1.E-4,EPSQ=2.E-12,EPSWET=0.0E0
     &, Q2INI=.50,EPSQ2=2.E-2,EPSQ=2.E-12,EPSWET=0.0
CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
     &, Z0LAND=.10,Z0SEA=.001,FCM=.00001
     &, DTR=0.1745329E-1,H360=360.0
     &, H1905=190.5,H105=105.0)
C
C-----------------------------------------------------------------------
                              P A R A M E T E R
     & (IMJM=IM*JM-JM/2,JMP1=JM+1,JAM=6+2*(JM-10),LB=2*IM+JM-3
     &, LM1=LM-1,LP1=LM+1,IMT=2*IM-1)
C
C-----------------------------------------------------------------------
C     
C                            DECLARE VARIABLES
C     
C-----------------------------------------------------------------------
                              L O G I C A L
     & RUN,RUNB,FIRST,RESTRT,SIGMA
C-----------------------------------------------------------------------
                              C H A R A C T E R *32
     & LABEL
                              C H A R A C T E R *40
     & CONTRL,FILALL,FILMST,FILTMP,FILTKE,FILUNV
     &,FILCLD,FILRAD,FILSFC
C-----------------------------------------------------------------------
                              I N T E G E R
     & IDATB(3)
C-----------------------------------------------------------------------
C     
C     INCLUDE COMMON BLOCKS.
C
      INCLUDE "CTLBLK.comm"
      INCLUDE "LOOPS.comm"
      INCLUDE "MASKS.comm"
      INCLUDE "DYNAM.comm"
      INCLUDE "PHYS2.comm"
      INCLUDE "MAPOT1.comm"
      INCLUDE "VRBLS.comm"
      INCLUDE "CONTIN.comm"
      INCLUDE "PVRBLS.comm"
      INCLUDE "BOCO.comm"
      INCLUDE "ACMCLH.comm"
      INCLUDE "ACMCLD.comm"
      INCLUDE "ACMPRE.comm"
      INCLUDE "ACMRDL.comm"
      INCLUDE "ACMRDS.comm"
      INCLUDE "ACMSFC.comm"
      INCLUDE "CLDWTR.comm"
      INCLUDE "CNVCLD.comm"
      INCLUDE "SOIL.comm"
      INCLUDE "INDX.comm"
C-----------------------------------------------------------------------
      INCLUDE "mpif.h"
      INCLUDE "mpp.h"
#include "sp.h"
C-----------------------------------------------------------------------
      INTEGER ISTAT(MPI_STATUS_SIZE)
      REAL GMS(IM,JM,385)
C
#ifdef DP_REAL
      INTEGER*8 ITEMPX(IM,JM)
      INTEGER*8 NFCSTX,NBCX,LISTX,IDTADX
      INTEGER*8 KHLAX,KHHAX,KVLAX,KVHAX,KHL2X,KHH2X,KVL2X,KVH2X
      INTEGER*8 IXMX,IYMX
      LOGICAL*8 SIGMAX
#endif
C-----------------------------------------------------------------------
C     
C     DECLARE NAMELIST.
C
C***********************************************************************
C
CJFP          ADAPTADO PARA A LEITURA DO ARQUIVO DE SST MENSAL 
C                   A DATA INICIAL DO ARQUIVO E JAN1959
C********************************************************************   

        OPEN(1,form='unformatted',FILE='monthly_sst.bin',
     1  ACCESS='sequential') 

C-----------------------------------------------------------------------
C***
C***  DISTRIBUTE SSTM
C***  
      DO M=1,385
      IF(MYPE.EQ.0)THEN
        READ(1)TEMP1
C       WRITE(0,*)'READ SSTM'
      ENDIF
      CALL DSTRB(TEMP1,SSTM,1,385,M)
      ENDDO
C-----------------------------------------------------------------------
CJFP
        OPEN(8,FORM='FORMATTED',FILE='tempo_init_sst.txt')
        READ(8,*)INITSST
        IF(MYPE.EQ.0) WRITE(*,*)'INITSST= ',INITSST
CJFP        
C-----------------------------------------------------------------------
C     END OF SUBROUTINE READ_SST12M
C     
C-----------------------------------------------------------------------
      RETURN
      END

CJFP ****************************************************************
C                  FINAL DAS ALTERACOES DO PESQUERO
