

C-----------------------------------------------------------------------------

      SUBROUTINE WLINEAR    

C-----------------------------------------------------------------------------

C     LINEAR WIND VELOCITY PROFILE   

C     PROVIDES CONSTANT RADIAL, ZONAL AND MERIDONAL WINDS  

C     EXCEPT THAT A POSSIBLE LINEAR HEIGHT GRADIENT OF THE ZONAL

C     COMPONENT IS ALLOWED.                   

C     COMMON DECK "RKAM" INSERTED HERE        

      implicit double precision (a-h,o-z)

      DOUBLE PRECISION KR,KTH,KPH

      COMMON//R,TH,PH,KR,KTH,KPH,RKVARS(14),TPULSE,CSTEP,DRDT(20)

C     COMMON DECK "UU" INSERTED HERE  

      DOUBLE PRECISION MODU

      COMMON/UU/MODU(4)               

     1  ,V  ,PVT  ,PVR  ,PVTH  ,PVPH  

     2  ,VR ,PVRT ,PVRR ,PVRTH ,PVRPH 

     3  ,VTH,PVTHT,PVTHR,PVTHTH,PVTHPH

     4  ,VPH,PVPHT,PVPHR,PVPHTH,PVPHPH

      COMMON/WW/ dum(10), MAXW,W(1000)



C     COMMON DECK "B1" INSERTED HERE                

      INTEGER UMX,UNTBL,UITBL,UFRMTBL,IDSU(10)      

      COMMON/B1/UMX,UNTBL(10),UITBL(10),UFRMTBL(10),UGP(10)    

      EQUIVALENCE (UGP,IDSU),(earthr,w(1))

      EQUIVALENCE (W(103),UR0)            

      EQUIVALENCE (W(104),UTH0),(W(105),UPH0),(W(106),PUPHZ0)

      INTEGER UPX    ,UQTBL(10),ULTBL(10),UIRMTBL(10)   

      DATA UPX/1/              

      DATA UQTBL/1,11,8*0/     

      DATA ULTBL/1,9*0/        

      DATA UIRMTBL/1,9*0/      

C                              

C                              

      ENTRY SETWND             

      UMX=UPX       

      CALL IMOVE(UNTBL,UQTBL,10)

      CALL IMOVE(UITBL,ULTBL,10)

      CALL IMOVE(UFRMTBL,UIRMTBL,10)

      CALL SETPWN                   

      RETURN                        

C                                   

      ENTRY IWINDR                  

      IF(W(100) .NE. 1.) THEN

           PRINT*,' Model check number mismatch: '

           STOP ' W(100) should be 1 if you are using model WLINEAR.'

      endif



      MODU(1)=7HWLINEAR                               

      MODU(2)=w(102)

      CALL IPWINDR                                    

      RETURN                                          

C                                                     

       ENTRY WINDR                                    

       H = R - EARTHR                

      CALL CLEAR(V,20)               

       VR = UR0                      

       VTH = UTH0                    

       VPH = (UPH0 + PUPHZ0 * H)     

      V=DSQRT(VR*VR+VTH*VTH+VPH*VPH) 

      PVR=PUPHZ0                     

      IF(V.NE.0.D0) PVR=VPH/V*PUPHZ0 

      PVPHR = PUPHZ0                 

      CALL PWINDR                    

       RETURN                        

       END                           

                                     

                                     

                                     

                                     



