Merge remote-tracking branch 'origin/release-v4.5.2'
[WRF.git] / var / convertor / wave2grid_kma / ZMNT.inc
blobd25874375a41768bb16459d5e85397e1a78643a1
1       SUBROUTINE ZMNT                                                           
2      O ( ZDAT, MAXJZ, KMX,                                                      
3      I   DATA, MAXIT, MAXJT )                                                   
4 C                                                                               
5       DIMENSION DATA( MAXIT*MAXJT/MAXJZ, MAXJZ, KMX )                           
6       DIMENSION ZDAT( MAXJZ, KMX )                                              
7 C                                                                               
8       CALL RESET( ZDAT, MAXJZ*KMX )                                             
9 C                                                                               
10 C   ==================                                                          
11 C   >>>   ‘S•½‹Ï   <<<                                                      
12 C   ==================                                                          
13       DO 10 K= 1, KMX                                                           
14         NMAX = 0                                                                
15         DO 20 J = 1, MAXJZ                                                      
16           NMAX = 0                                                              
17           DO 30 I = 1, MAXIT*MAXJT/MAXJZ                                        
18             ZDAT( J, K ) = ZDAT( J, K ) + DATA( I, J, K )                       
19             NMAX = NMAX + 1                                                     
20    30     CONTINUE                                                              
21           IF( NMAX.GT.0 ) THEN                                                  
22             ZDAT( J, K ) = ZDAT( J, K ) / FLOAT( NMAX )                         
23           ENDIF                                                                 
24    20   CONTINUE                                                                
25    10 CONTINUE                                                                  
26 C                                                                               
27       RETURN                                                                    
28       END SUBROUTINE ZMNT