Merge remote-tracking branch 'origin/release-v4.6.1'
[WRF.git] / var / convertor / kma_wave2grid / WAVMAG.inc
blob58d227a4389177f80859e0de797855b9f4195553
1       SUBROUTINE WAVMAG (WDATA,MNWAV,KMAXX,LTTL)                                 
2 crizvi    USE GSM_PARAMS, ONLY:KMAX
3 crizvi  DIMENSION   WDATA(KMAXX*2,MNWAV),ABS(KMAX)                                   
4       DIMENSION   WDATA(KMAXX*2,MNWAV),ABS(KMAXX)                                   
5       CHARACTER*(*) LTTL
6 C                                                                               
7       DO 100 K=1,KMAXX                                                           
8        ABS(K)=0.0                                                               
9        DO 120 L=1,MNWAV                                                         
10         ABS(K)=ABS(K)+WDATA(2*K-1,L)*WDATA(2*K-1,L)                             
11      1               +WDATA(2*K  ,L)*WDATA(2*K  ,L)                             
12   120  CONTINUE                                                                 
13        ABS(K)=SQRT(ABS(K))                                                      
14   100 CONTINUE                                                                  
15 C                                                                               
16       WRITE(96,888) LTTL                                                         
17   888 FORMAT(1H ,A4,'===ABSOLUTE AND MEAN VALUE ON EACH LEVEL===')              
18       WRITE(96,999) (ABS(K),K=1,KMAXX)                                            
19       WRITE(96,999) (WDATA(2*K-1,1),K=1,KMAXX)                                    
20   999 FORMAT(1H ,4X,10E12.5)                                                    
21 C                                                                               
22       RETURN                                                                    
23       END SUBROUTINE WAVMAG