
C-----------------------------------------------------------------------------
      SUBROUTINE SHORIZ
C-----------------------------------------------------------------------------
C 10 Mar 2008 - corrected length errors in blank common
C-----------------------------------------------------------------------------
C     SURFACE MODEL USING FIXED OFFSET TO EARTHR'S SURFACE.
      IMPLICIT DOUBLE PRECISION (A-H,O-Z)
      COMMON//R,TH,PH,KR,KTH,KPH,RKVARS(14),TPULSE,CSTEP,DRDT(20)
      double precision kr,kth,kph                                  ! 10 Mar 2008
C     COMMON DECK "SS" INSERTED HERE                             
      DOUBLE PRECISION MODSURF
      common/ww/ dum(10), maxw,w(1000)
      COMMON/SS/ MODSURF(4) 
      COMMON/SS/U,PUR,PURR,PURTH,PURPH   
      COMMON/SS/PUTH,PUPH,PUTHTH,PUPHPH,PUTHPH,USELECT,UTIME
      EQUIVALENCE (EARTHR,W(1))
C     ATMOSPHERIC SURFACE TOPOGRAPHY   350-374   
      EQUIVALENCE (W(353),SHEIGHT)                             
C     COMMON DECK "CB11" INSERTED HERE                         
      INTEGER SMX,SNTBL,SITBL,SFRMTBL,IDSS(10)                 
      COMMON/B11/SMX,SNTBL(10),SITBL(10),SFRMTBL(10),SGP(11)   
      EQUIVALENCE (SGP,IDSS),(ANS,SGP(11))                     
      INTEGER SPX    ,SQTBL(10),SLTBL(10),SIRMTBL(10)          
      DATA SPX/1/          
      DATA SQTBL/1,11,8*0/ 
      DATA SLTBL/1,9*0/    
      DATA SIRMTBL/1,9*0/  
C                     
      ENTRY SETSUR    
      SMX=SPX         
      CALL IMOVE(SNTBL,SQTBL,10) 
      CALL IMOVE(SITBL,SLTBL,10) 
      CALL IMOVE(SFRMTBL,SIRMTBL,10)
      CALL SETPSR  
      RETURN       
C                  
      ENTRY ISURFAC
      IF(W(350) .NE. 1.) THEN
           PRINT*,' Model check number mismatch: '
           STOP ' W(350) should be 1 if you are using model SHORIZ.'
      endif

      MODSURF(1)=8HSHORIZ                     
      MODSURF(2)= w(352)
C     CALL THE PERTURBATION INITIALIZATION    
      CALL IPSURF                             
      RETURN                                  
C                                             
      ENTRY SURFACE                           
      U=-(R-EARTHR-SHEIGHT)                   
      PUR=-1.d0                               
      CALL CLEAR(PURR,8)                      
C     CALL THE PERTURBATION                   
      CALL PSURFCE                            
      END                                     
