[1591] | 1 | ! |
---|
[1685] | 2 | ! $Id$ |
---|
[1591] | 3 | ! |
---|
[1108] | 4 | MODULE filtreg_mod |
---|
[1086] | 5 | |
---|
| 6 | REAL, DIMENSION(:,:,:), ALLOCATABLE :: matriceun,matriceus,matricevn |
---|
| 7 | REAL, DIMENSION(:,:,:), ALLOCATABLE :: matricevs,matrinvn,matrinvs |
---|
| 8 | |
---|
| 9 | CONTAINS |
---|
| 10 | |
---|
| 11 | SUBROUTINE inifilr |
---|
[1840] | 12 | #ifdef CPP_PARA |
---|
[1685] | 13 | USE mod_filtre_fft, ONLY : use_filtre_fft,Init_filtre_fft |
---|
| 14 | USE mod_filtre_fft_loc, ONLY : Init_filtre_fft_loc=>Init_filtre_fft ! |
---|
[1840] | 15 | #endif |
---|
[2598] | 16 | USE serre_mod, ONLY: alphax |
---|
[2603] | 17 | USE logic_mod, ONLY: fxyhypb, ysinus |
---|
[4519] | 18 | USE comconst_mod, ONLY: maxlatfilter |
---|
| 19 | |
---|
[1086] | 20 | ! ... H. Upadhyaya, O.Sharma ... |
---|
| 21 | ! |
---|
[5271] | 22 | USE dimensions_mod, ONLY: iim, jjm, llm, ndm |
---|
[5272] | 23 | USE paramet_mod_h, ONLY: iip1, iip2, iip3, jjp1, llmp1, llmp2, llmm1, kftd, ip1jm, ip1jmp1, & |
---|
| 24 | ip1jmi1, ijp1llm, ijmllm, mvar, jcfil, jcfllm |
---|
[5271] | 25 | IMPLICIT NONE |
---|
[1086] | 26 | ! |
---|
| 27 | ! version 3 ..... |
---|
| 28 | |
---|
| 29 | ! Correction le 28/10/97 P. Le Van . |
---|
| 30 | ! ------------------------------------------------------------------- |
---|
[5271] | 31 | |
---|
[5272] | 32 | |
---|
[1086] | 33 | ! ------------------------------------------------------------------- |
---|
[2598] | 34 | include "comgeom.h" |
---|
| 35 | include "coefils.h" |
---|
[1086] | 36 | |
---|
| 37 | REAL dlonu(iim),dlatu(jjm) |
---|
| 38 | REAL rlamda( iim ), eignvl( iim ) |
---|
| 39 | ! |
---|
| 40 | |
---|
| 41 | REAL lamdamax,pi,cof |
---|
| 42 | INTEGER i,j,modemax,imx,k,kf,ii |
---|
| 43 | REAL dymin,dxmin,colat0 |
---|
| 44 | REAL eignft(iim,iim), coff |
---|
| 45 | |
---|
| 46 | LOGICAL, SAVE :: first_call_inifilr = .TRUE. |
---|
| 47 | |
---|
| 48 | #ifdef CRAY |
---|
| 49 | INTEGER ISMIN |
---|
| 50 | EXTERNAL ISMIN |
---|
| 51 | INTEGER iymin |
---|
| 52 | INTEGER ixmineq |
---|
| 53 | #endif |
---|
| 54 | ! |
---|
| 55 | ! ------------------------------------------------------------ |
---|
| 56 | ! This routine computes the eigenfunctions of the laplacien |
---|
| 57 | ! on the stretched grid, and the filtering coefficients |
---|
| 58 | ! |
---|
| 59 | ! We designate: |
---|
| 60 | ! eignfn eigenfunctions of the discrete laplacien |
---|
| 61 | ! eigenvl eigenvalues |
---|
| 62 | ! jfiltn indexof the last scalar line filtered in NH |
---|
| 63 | ! jfilts index of the first line filtered in SH |
---|
| 64 | ! modfrst index of the mode from WHERE modes are filtered |
---|
| 65 | ! modemax maximum number of modes ( im ) |
---|
| 66 | ! coefil filtering coefficients ( lamda_max*COS(rlat)/lamda ) |
---|
| 67 | ! sdd SQRT( dx ) |
---|
| 68 | ! |
---|
| 69 | ! the modes are filtered from modfrst to modemax |
---|
| 70 | ! |
---|
| 71 | !----------------------------------------------------------- |
---|
| 72 | ! |
---|
[4440] | 73 | if ( iim == 1 ) return ! No filtre in 2D y-z |
---|
[1086] | 74 | |
---|
| 75 | pi = 2. * ASIN( 1. ) |
---|
| 76 | |
---|
| 77 | DO i = 1,iim |
---|
| 78 | dlonu(i) = xprimu( i ) |
---|
| 79 | ENDDO |
---|
| 80 | ! |
---|
| 81 | CALL inifgn(eignvl) |
---|
| 82 | ! |
---|
[1591] | 83 | PRINT *,'inifilr: EIGNVL ' |
---|
[1086] | 84 | PRINT 250,eignvl |
---|
[1591] | 85 | 250 FORMAT( 1x,5e14.6) |
---|
[1086] | 86 | ! |
---|
| 87 | ! compute eigenvalues and eigenfunctions |
---|
| 88 | ! |
---|
| 89 | ! |
---|
| 90 | !................................................................. |
---|
| 91 | ! |
---|
| 92 | ! compute the filtering coefficients for scalar lines and |
---|
| 93 | ! meridional wind v-lines |
---|
| 94 | ! |
---|
| 95 | ! we filter all those latitude lines WHERE coefil < 1 |
---|
| 96 | ! NO FILTERING AT POLES |
---|
| 97 | ! |
---|
| 98 | ! colat0 is to be used when alpha (stretching coefficient) |
---|
| 99 | ! is set equal to zero for the regular grid CASE |
---|
| 100 | ! |
---|
| 101 | ! ....... Calcul de colat0 ......... |
---|
| 102 | ! ..... colat0 = minimum de ( 0.5, min dy/ min dx ) ... |
---|
| 103 | ! |
---|
| 104 | ! |
---|
| 105 | DO j = 1,jjm |
---|
| 106 | dlatu( j ) = rlatu( j ) - rlatu( j+1 ) |
---|
| 107 | ENDDO |
---|
| 108 | ! |
---|
| 109 | #ifdef CRAY |
---|
| 110 | iymin = ISMIN( jjm, dlatu, 1 ) |
---|
| 111 | ixmineq = ISMIN( iim, dlonu, 1 ) |
---|
| 112 | dymin = dlatu( iymin ) |
---|
| 113 | dxmin = dlonu( ixmineq ) |
---|
| 114 | #else |
---|
| 115 | dxmin = dlonu(1) |
---|
| 116 | DO i = 2, iim |
---|
| 117 | dxmin = MIN( dxmin,dlonu(i) ) |
---|
| 118 | ENDDO |
---|
| 119 | dymin = dlatu(1) |
---|
| 120 | DO j = 2, jjm |
---|
| 121 | dymin = MIN( dymin,dlatu(j) ) |
---|
| 122 | ENDDO |
---|
| 123 | #endif |
---|
| 124 | ! |
---|
[1591] | 125 | ! For a regular grid, we want the filter to start at latitudes |
---|
| 126 | ! corresponding to lengths dx of the same size as dy (in terms |
---|
| 127 | ! of angles: dx=2*dy) => at colat0=0.5 (i.e. colatitude=30 degrees |
---|
| 128 | ! <=> latitude=60 degrees). |
---|
| 129 | ! Same idea for the zoomed grid: start filtering polewards as soon |
---|
| 130 | ! as length dx becomes of the same size as dy |
---|
[1086] | 131 | ! |
---|
[4519] | 132 | ! if maxlatfilter >0, prescribe the colat0 value from the .def files |
---|
| 133 | |
---|
| 134 | IF (maxlatfilter .LT. 0.) THEN |
---|
| 135 | |
---|
[1086] | 136 | colat0 = MIN( 0.5, dymin/dxmin ) |
---|
[4440] | 137 | ! colat0 = 1. |
---|
[1086] | 138 | ! |
---|
| 139 | IF( .NOT.fxyhypb.AND.ysinus ) THEN |
---|
| 140 | colat0 = 0.6 |
---|
| 141 | ! ...... a revoir pour ysinus ! ....... |
---|
| 142 | alphax = 0. |
---|
| 143 | ENDIF |
---|
[4519] | 144 | |
---|
| 145 | ELSE |
---|
| 146 | |
---|
| 147 | colat0=(90.0-maxlatfilter)/180.0*pi |
---|
| 148 | |
---|
| 149 | ENDIF |
---|
| 150 | |
---|
| 151 | |
---|
| 152 | |
---|
[1086] | 153 | ! |
---|
| 154 | PRINT 50, colat0,alphax |
---|
| 155 | 50 FORMAT(/15x,' Inifilr colat0 alphax ',2e16.7) |
---|
| 156 | ! |
---|
| 157 | IF(alphax.EQ.1. ) THEN |
---|
| 158 | PRINT *,' Inifilr alphax doit etre < a 1. Corriger ' |
---|
| 159 | STOP |
---|
| 160 | ENDIF |
---|
| 161 | ! |
---|
| 162 | lamdamax = iim / ( pi * colat0 * ( 1. - alphax ) ) |
---|
| 163 | |
---|
| 164 | ! ... Correction le 28/10/97 ( P.Le Van ) .. |
---|
| 165 | ! |
---|
| 166 | DO i = 2,iim |
---|
| 167 | rlamda( i ) = lamdamax/ SQRT( ABS( eignvl(i) ) ) |
---|
| 168 | ENDDO |
---|
| 169 | ! |
---|
| 170 | |
---|
| 171 | DO j = 1,jjm |
---|
| 172 | DO i = 1,iim |
---|
| 173 | coefilu( i,j ) = 0.0 |
---|
| 174 | coefilv( i,j ) = 0.0 |
---|
| 175 | coefilu2( i,j ) = 0.0 |
---|
| 176 | coefilv2( i,j ) = 0.0 |
---|
| 177 | ENDDO |
---|
| 178 | ENDDO |
---|
| 179 | |
---|
| 180 | ! |
---|
| 181 | ! ... Determination de jfiltnu,jfiltnv,jfiltsu,jfiltsv .... |
---|
| 182 | ! ......................................................... |
---|
| 183 | ! |
---|
| 184 | modemax = iim |
---|
| 185 | |
---|
| 186 | !!!! imx = modemax - 4 * (modemax/iim) |
---|
| 187 | |
---|
| 188 | imx = iim |
---|
| 189 | ! |
---|
[1591] | 190 | PRINT *,'inifilr: TRUNCATION AT ',imx |
---|
[1086] | 191 | ! |
---|
[1591] | 192 | ! Ehouarn: set up some defaults |
---|
| 193 | jfiltnu=2 ! avoid north pole |
---|
| 194 | jfiltsu=jjm ! avoid south pole (which is at jjm+1) |
---|
| 195 | jfiltnv=1 ! NB: no poles on the V grid |
---|
| 196 | jfiltsv=jjm |
---|
| 197 | |
---|
[1086] | 198 | DO j = 2, jjm/2+1 |
---|
| 199 | cof = COS( rlatu(j) )/ colat0 |
---|
| 200 | IF ( cof .LT. 1. ) THEN |
---|
[1591] | 201 | IF( rlamda(imx) * COS(rlatu(j) ).LT.1. ) THEN |
---|
| 202 | jfiltnu= j |
---|
| 203 | ENDIF |
---|
[1086] | 204 | ENDIF |
---|
| 205 | |
---|
| 206 | cof = COS( rlatu(jjp1-j+1) )/ colat0 |
---|
| 207 | IF ( cof .LT. 1. ) THEN |
---|
[1591] | 208 | IF( rlamda(imx) * COS(rlatu(jjp1-j+1) ).LT.1. ) THEN |
---|
[1086] | 209 | jfiltsu= jjp1-j+1 |
---|
[1591] | 210 | ENDIF |
---|
[1086] | 211 | ENDIF |
---|
| 212 | ENDDO |
---|
| 213 | ! |
---|
| 214 | DO j = 1, jjm/2 |
---|
| 215 | cof = COS( rlatv(j) )/ colat0 |
---|
| 216 | IF ( cof .LT. 1. ) THEN |
---|
[1591] | 217 | IF( rlamda(imx) * COS(rlatv(j) ).LT.1. ) THEN |
---|
| 218 | jfiltnv= j |
---|
| 219 | ENDIF |
---|
[1086] | 220 | ENDIF |
---|
| 221 | |
---|
| 222 | cof = COS( rlatv(jjm-j+1) )/ colat0 |
---|
| 223 | IF ( cof .LT. 1. ) THEN |
---|
[1591] | 224 | IF( rlamda(imx) * COS(rlatv(jjm-j+1) ).LT.1. ) THEN |
---|
[1086] | 225 | jfiltsv= jjm-j+1 |
---|
[1591] | 226 | ENDIF |
---|
[1086] | 227 | ENDIF |
---|
| 228 | ENDDO |
---|
| 229 | ! |
---|
| 230 | |
---|
| 231 | IF( jfiltnu.GT. jjm/2 +1 ) THEN |
---|
| 232 | PRINT *,' jfiltnu en dehors des valeurs acceptables ' ,jfiltnu |
---|
| 233 | STOP |
---|
| 234 | ENDIF |
---|
| 235 | |
---|
| 236 | IF( jfiltsu.GT. jjm +1 ) THEN |
---|
| 237 | PRINT *,' jfiltsu en dehors des valeurs acceptables ' ,jfiltsu |
---|
| 238 | STOP |
---|
| 239 | ENDIF |
---|
| 240 | |
---|
| 241 | IF( jfiltnv.GT. jjm/2 ) THEN |
---|
| 242 | PRINT *,' jfiltnv en dehors des valeurs acceptables ' ,jfiltnv |
---|
| 243 | STOP |
---|
| 244 | ENDIF |
---|
| 245 | |
---|
| 246 | IF( jfiltsv.GT. jjm ) THEN |
---|
| 247 | PRINT *,' jfiltsv en dehors des valeurs acceptables ' ,jfiltsv |
---|
| 248 | STOP |
---|
| 249 | ENDIF |
---|
| 250 | |
---|
[1591] | 251 | PRINT *,'inifilr: jfiltnv jfiltsv jfiltnu jfiltsu ' , & |
---|
[1086] | 252 | jfiltnv,jfiltsv,jfiltnu,jfiltsu |
---|
| 253 | |
---|
| 254 | IF(first_call_inifilr) THEN |
---|
| 255 | ALLOCATE(matriceun(iim,iim,jfiltnu)) |
---|
[1591] | 256 | ALLOCATE(matriceus(iim,iim,jjm-jfiltsu+1)) |
---|
[1086] | 257 | ALLOCATE(matricevn(iim,iim,jfiltnv)) |
---|
[1591] | 258 | ALLOCATE(matricevs(iim,iim,jjm-jfiltsv+1)) |
---|
[1086] | 259 | ALLOCATE( matrinvn(iim,iim,jfiltnu)) |
---|
[1591] | 260 | ALLOCATE( matrinvs(iim,iim,jjm-jfiltsu+1)) |
---|
[1086] | 261 | first_call_inifilr = .FALSE. |
---|
| 262 | ENDIF |
---|
| 263 | |
---|
| 264 | ! |
---|
| 265 | ! ... Determination de coefilu,coefilv,n=modfrstu,modfrstv .... |
---|
| 266 | !................................................................ |
---|
| 267 | ! |
---|
| 268 | ! |
---|
| 269 | DO j = 1,jjm |
---|
[1591] | 270 | !default initialization: all modes are retained (i.e. no filtering) |
---|
[1086] | 271 | modfrstu( j ) = iim |
---|
| 272 | modfrstv( j ) = iim |
---|
| 273 | ENDDO |
---|
| 274 | ! |
---|
| 275 | DO j = 2,jfiltnu |
---|
| 276 | DO k = 2,modemax |
---|
| 277 | cof = rlamda(k) * COS( rlatu(j) ) |
---|
| 278 | IF ( cof .LT. 1. ) GOTO 82 |
---|
| 279 | ENDDO |
---|
| 280 | GOTO 84 |
---|
| 281 | 82 modfrstu( j ) = k |
---|
| 282 | ! |
---|
| 283 | kf = modfrstu( j ) |
---|
| 284 | DO k = kf , modemax |
---|
| 285 | cof = rlamda(k) * COS( rlatu(j) ) |
---|
| 286 | coefilu(k,j) = cof - 1. |
---|
| 287 | coefilu2(k,j) = cof*cof - 1. |
---|
| 288 | ENDDO |
---|
| 289 | 84 CONTINUE |
---|
| 290 | ENDDO |
---|
| 291 | ! |
---|
| 292 | ! |
---|
| 293 | DO j = 1,jfiltnv |
---|
| 294 | ! |
---|
| 295 | DO k = 2,modemax |
---|
| 296 | cof = rlamda(k) * COS( rlatv(j) ) |
---|
| 297 | IF ( cof .LT. 1. ) GOTO 87 |
---|
| 298 | ENDDO |
---|
| 299 | GOTO 89 |
---|
| 300 | 87 modfrstv( j ) = k |
---|
| 301 | ! |
---|
| 302 | kf = modfrstv( j ) |
---|
| 303 | DO k = kf , modemax |
---|
| 304 | cof = rlamda(k) * COS( rlatv(j) ) |
---|
| 305 | coefilv(k,j) = cof - 1. |
---|
| 306 | coefilv2(k,j) = cof*cof - 1. |
---|
| 307 | ENDDO |
---|
| 308 | 89 CONTINUE |
---|
| 309 | ENDDO |
---|
| 310 | ! |
---|
| 311 | DO j = jfiltsu,jjm |
---|
| 312 | DO k = 2,modemax |
---|
| 313 | cof = rlamda(k) * COS( rlatu(j) ) |
---|
| 314 | IF ( cof .LT. 1. ) GOTO 92 |
---|
| 315 | ENDDO |
---|
| 316 | GOTO 94 |
---|
| 317 | 92 modfrstu( j ) = k |
---|
| 318 | ! |
---|
| 319 | kf = modfrstu( j ) |
---|
| 320 | DO k = kf , modemax |
---|
| 321 | cof = rlamda(k) * COS( rlatu(j) ) |
---|
| 322 | coefilu(k,j) = cof - 1. |
---|
| 323 | coefilu2(k,j) = cof*cof - 1. |
---|
| 324 | ENDDO |
---|
| 325 | 94 CONTINUE |
---|
| 326 | ENDDO |
---|
| 327 | ! |
---|
| 328 | DO j = jfiltsv,jjm |
---|
| 329 | DO k = 2,modemax |
---|
| 330 | cof = rlamda(k) * COS( rlatv(j) ) |
---|
| 331 | IF ( cof .LT. 1. ) GOTO 97 |
---|
| 332 | ENDDO |
---|
| 333 | GOTO 99 |
---|
| 334 | 97 modfrstv( j ) = k |
---|
| 335 | ! |
---|
| 336 | kf = modfrstv( j ) |
---|
| 337 | DO k = kf , modemax |
---|
| 338 | cof = rlamda(k) * COS( rlatv(j) ) |
---|
| 339 | coefilv(k,j) = cof - 1. |
---|
| 340 | coefilv2(k,j) = cof*cof - 1. |
---|
| 341 | ENDDO |
---|
| 342 | 99 CONTINUE |
---|
| 343 | ENDDO |
---|
| 344 | ! |
---|
| 345 | |
---|
| 346 | IF(jfiltnv.GE.jjm/2 .OR. jfiltnu.GE.jjm/2)THEN |
---|
[1591] | 347 | ! Ehouarn: and what are these for??? Trying to handle a limit case |
---|
| 348 | ! where filters extend to and meet at the equator? |
---|
[1086] | 349 | IF(jfiltnv.EQ.jfiltsv)jfiltsv=1+jfiltnv |
---|
| 350 | IF(jfiltnu.EQ.jfiltsu)jfiltsu=1+jfiltnu |
---|
| 351 | |
---|
| 352 | PRINT *,'jfiltnv jfiltsv jfiltnu jfiltsu' , & |
---|
| 353 | jfiltnv,jfiltsv,jfiltnu,jfiltsu |
---|
| 354 | ENDIF |
---|
| 355 | |
---|
| 356 | PRINT *,' Modes premiers v ' |
---|
| 357 | PRINT 334,modfrstv |
---|
| 358 | PRINT *,' Modes premiers u ' |
---|
| 359 | PRINT 334,modfrstu |
---|
| 360 | |
---|
| 361 | ! |
---|
| 362 | ! ................................................................... |
---|
| 363 | ! |
---|
| 364 | ! ... Calcul de la matrice filtre 'matriceu' pour les champs situes |
---|
| 365 | ! sur la grille scalaire ........ |
---|
| 366 | ! ................................................................... |
---|
| 367 | ! |
---|
| 368 | DO j = 2, jfiltnu |
---|
| 369 | |
---|
| 370 | DO i=1,iim |
---|
| 371 | coff = coefilu(i,j) |
---|
| 372 | IF( i.LT.modfrstu(j) ) coff = 0. |
---|
| 373 | DO k=1,iim |
---|
| 374 | eignft(i,k) = eignfnv(k,i) * coff |
---|
| 375 | ENDDO |
---|
[1591] | 376 | ENDDO ! of DO i=1,iim |
---|
[1086] | 377 | #ifdef CRAY |
---|
| 378 | CALL MXM( eignfnv,iim,eignft,iim,matriceun(1,1,j),iim ) |
---|
| 379 | #else |
---|
| 380 | #ifdef BLAS |
---|
| 381 | CALL SGEMM ('N', 'N', iim, iim, iim, 1.0, & |
---|
| 382 | eignfnv, iim, eignft, iim, 0.0, matriceun(1,1,j), iim) |
---|
| 383 | #else |
---|
| 384 | DO k = 1, iim |
---|
| 385 | DO i = 1, iim |
---|
| 386 | matriceun(i,k,j) = 0.0 |
---|
| 387 | DO ii = 1, iim |
---|
| 388 | matriceun(i,k,j) = matriceun(i,k,j) & |
---|
| 389 | + eignfnv(i,ii)*eignft(ii,k) |
---|
| 390 | ENDDO |
---|
| 391 | ENDDO |
---|
[1591] | 392 | ENDDO ! of DO k = 1, iim |
---|
[1086] | 393 | #endif |
---|
| 394 | #endif |
---|
| 395 | |
---|
[1591] | 396 | ENDDO ! of DO j = 2, jfiltnu |
---|
[1086] | 397 | |
---|
| 398 | DO j = jfiltsu, jjm |
---|
| 399 | |
---|
| 400 | DO i=1,iim |
---|
| 401 | coff = coefilu(i,j) |
---|
| 402 | IF( i.LT.modfrstu(j) ) coff = 0. |
---|
| 403 | DO k=1,iim |
---|
| 404 | eignft(i,k) = eignfnv(k,i) * coff |
---|
| 405 | ENDDO |
---|
[1591] | 406 | ENDDO ! of DO i=1,iim |
---|
[1086] | 407 | #ifdef CRAY |
---|
| 408 | CALL MXM(eignfnv,iim,eignft,iim,matriceus(1,1,j-jfiltsu+1),iim) |
---|
| 409 | #else |
---|
| 410 | #ifdef BLAS |
---|
| 411 | CALL SGEMM ('N', 'N', iim, iim, iim, 1.0, & |
---|
| 412 | eignfnv, iim, eignft, iim, 0.0, & |
---|
| 413 | matriceus(1,1,j-jfiltsu+1), iim) |
---|
| 414 | #else |
---|
| 415 | DO k = 1, iim |
---|
| 416 | DO i = 1, iim |
---|
| 417 | matriceus(i,k,j-jfiltsu+1) = 0.0 |
---|
| 418 | DO ii = 1, iim |
---|
| 419 | matriceus(i,k,j-jfiltsu+1) = matriceus(i,k,j-jfiltsu+1) & |
---|
| 420 | + eignfnv(i,ii)*eignft(ii,k) |
---|
| 421 | ENDDO |
---|
| 422 | ENDDO |
---|
[1591] | 423 | ENDDO ! of DO k = 1, iim |
---|
[1086] | 424 | #endif |
---|
| 425 | #endif |
---|
| 426 | |
---|
[1591] | 427 | ENDDO ! of DO j = jfiltsu, jjm |
---|
[1086] | 428 | |
---|
| 429 | ! ................................................................... |
---|
| 430 | ! |
---|
| 431 | ! ... Calcul de la matrice filtre 'matricev' pour les champs situes |
---|
| 432 | ! sur la grille de V ou de Z ........ |
---|
| 433 | ! ................................................................... |
---|
| 434 | ! |
---|
| 435 | DO j = 1, jfiltnv |
---|
| 436 | |
---|
| 437 | DO i = 1, iim |
---|
| 438 | coff = coefilv(i,j) |
---|
| 439 | IF( i.LT.modfrstv(j) ) coff = 0. |
---|
| 440 | DO k = 1, iim |
---|
| 441 | eignft(i,k) = eignfnu(k,i) * coff |
---|
| 442 | ENDDO |
---|
| 443 | ENDDO |
---|
| 444 | #ifdef CRAY |
---|
| 445 | CALL MXM( eignfnu,iim,eignft,iim,matricevn(1,1,j),iim ) |
---|
| 446 | #else |
---|
| 447 | #ifdef BLAS |
---|
| 448 | CALL SGEMM ('N', 'N', iim, iim, iim, 1.0, & |
---|
| 449 | eignfnu, iim, eignft, iim, 0.0, matricevn(1,1,j), iim) |
---|
| 450 | #else |
---|
| 451 | DO k = 1, iim |
---|
| 452 | DO i = 1, iim |
---|
| 453 | matricevn(i,k,j) = 0.0 |
---|
| 454 | DO ii = 1, iim |
---|
| 455 | matricevn(i,k,j) = matricevn(i,k,j) & |
---|
| 456 | + eignfnu(i,ii)*eignft(ii,k) |
---|
| 457 | ENDDO |
---|
| 458 | ENDDO |
---|
| 459 | ENDDO |
---|
| 460 | #endif |
---|
| 461 | #endif |
---|
| 462 | |
---|
[1591] | 463 | ENDDO ! of DO j = 1, jfiltnv |
---|
[1086] | 464 | |
---|
| 465 | DO j = jfiltsv, jjm |
---|
| 466 | |
---|
| 467 | DO i = 1, iim |
---|
| 468 | coff = coefilv(i,j) |
---|
| 469 | IF( i.LT.modfrstv(j) ) coff = 0. |
---|
| 470 | DO k = 1, iim |
---|
| 471 | eignft(i,k) = eignfnu(k,i) * coff |
---|
| 472 | ENDDO |
---|
| 473 | ENDDO |
---|
| 474 | #ifdef CRAY |
---|
| 475 | CALL MXM(eignfnu,iim,eignft,iim,matricevs(1,1,j-jfiltsv+1),iim) |
---|
| 476 | #else |
---|
| 477 | #ifdef BLAS |
---|
| 478 | CALL SGEMM ('N', 'N', iim, iim, iim, 1.0, & |
---|
| 479 | eignfnu, iim, eignft, iim, 0.0, & |
---|
| 480 | matricevs(1,1,j-jfiltsv+1), iim) |
---|
| 481 | #else |
---|
| 482 | DO k = 1, iim |
---|
| 483 | DO i = 1, iim |
---|
| 484 | matricevs(i,k,j-jfiltsv+1) = 0.0 |
---|
| 485 | DO ii = 1, iim |
---|
| 486 | matricevs(i,k,j-jfiltsv+1) = matricevs(i,k,j-jfiltsv+1) & |
---|
| 487 | + eignfnu(i,ii)*eignft(ii,k) |
---|
| 488 | ENDDO |
---|
| 489 | ENDDO |
---|
| 490 | ENDDO |
---|
| 491 | #endif |
---|
| 492 | #endif |
---|
| 493 | |
---|
[1591] | 494 | ENDDO ! of DO j = jfiltsv, jjm |
---|
[1086] | 495 | |
---|
| 496 | ! ................................................................... |
---|
| 497 | ! |
---|
| 498 | ! ... Calcul de la matrice filtre 'matrinv' pour les champs situes |
---|
| 499 | ! sur la grille scalaire , pour le filtre inverse ........ |
---|
| 500 | ! ................................................................... |
---|
| 501 | ! |
---|
| 502 | DO j = 2, jfiltnu |
---|
| 503 | |
---|
| 504 | DO i = 1,iim |
---|
| 505 | coff = coefilu(i,j)/ ( 1. + coefilu(i,j) ) |
---|
| 506 | IF( i.LT.modfrstu(j) ) coff = 0. |
---|
| 507 | DO k=1,iim |
---|
| 508 | eignft(i,k) = eignfnv(k,i) * coff |
---|
| 509 | ENDDO |
---|
| 510 | ENDDO |
---|
| 511 | #ifdef CRAY |
---|
| 512 | CALL MXM( eignfnv,iim,eignft,iim,matrinvn(1,1,j),iim ) |
---|
| 513 | #else |
---|
| 514 | #ifdef BLAS |
---|
| 515 | CALL SGEMM ('N', 'N', iim, iim, iim, 1.0, & |
---|
| 516 | eignfnv, iim, eignft, iim, 0.0, matrinvn(1,1,j), iim) |
---|
| 517 | #else |
---|
| 518 | DO k = 1, iim |
---|
| 519 | DO i = 1, iim |
---|
| 520 | matrinvn(i,k,j) = 0.0 |
---|
| 521 | DO ii = 1, iim |
---|
| 522 | matrinvn(i,k,j) = matrinvn(i,k,j) & |
---|
| 523 | + eignfnv(i,ii)*eignft(ii,k) |
---|
| 524 | ENDDO |
---|
| 525 | ENDDO |
---|
| 526 | ENDDO |
---|
| 527 | #endif |
---|
| 528 | #endif |
---|
| 529 | |
---|
[1591] | 530 | ENDDO ! of DO j = 2, jfiltnu |
---|
[1086] | 531 | |
---|
| 532 | DO j = jfiltsu, jjm |
---|
| 533 | |
---|
| 534 | DO i = 1,iim |
---|
| 535 | coff = coefilu(i,j) / ( 1. + coefilu(i,j) ) |
---|
| 536 | IF( i.LT.modfrstu(j) ) coff = 0. |
---|
| 537 | DO k=1,iim |
---|
| 538 | eignft(i,k) = eignfnv(k,i) * coff |
---|
| 539 | ENDDO |
---|
| 540 | ENDDO |
---|
| 541 | #ifdef CRAY |
---|
| 542 | CALL MXM(eignfnv,iim,eignft,iim,matrinvs(1,1,j-jfiltsu+1),iim) |
---|
| 543 | #else |
---|
| 544 | #ifdef BLAS |
---|
| 545 | CALL SGEMM ('N', 'N', iim, iim, iim, 1.0, & |
---|
| 546 | eignfnv, iim, eignft, iim, 0.0, matrinvs(1,1,j-jfiltsu+1), iim) |
---|
| 547 | #else |
---|
| 548 | DO k = 1, iim |
---|
| 549 | DO i = 1, iim |
---|
| 550 | matrinvs(i,k,j-jfiltsu+1) = 0.0 |
---|
| 551 | DO ii = 1, iim |
---|
| 552 | matrinvs(i,k,j-jfiltsu+1) = matrinvs(i,k,j-jfiltsu+1) & |
---|
| 553 | + eignfnv(i,ii)*eignft(ii,k) |
---|
| 554 | ENDDO |
---|
| 555 | ENDDO |
---|
| 556 | ENDDO |
---|
| 557 | #endif |
---|
| 558 | #endif |
---|
| 559 | |
---|
[1591] | 560 | ENDDO ! of DO j = jfiltsu, jjm |
---|
[1086] | 561 | |
---|
[1840] | 562 | #ifdef CPP_PARA |
---|
[1279] | 563 | IF (use_filtre_fft) THEN |
---|
| 564 | CALL Init_filtre_fft(coefilu,modfrstu,jfiltnu,jfiltsu, & |
---|
| 565 | coefilv,modfrstv,jfiltnv,jfiltsv) |
---|
[1685] | 566 | CALL Init_filtre_fft_loc(coefilu,modfrstu,jfiltnu,jfiltsu, & |
---|
| 567 | coefilv,modfrstv,jfiltnv,jfiltsv) |
---|
[1279] | 568 | ENDIF |
---|
[1840] | 569 | #endif |
---|
[1086] | 570 | ! ................................................................... |
---|
| 571 | |
---|
| 572 | ! |
---|
| 573 | 334 FORMAT(1x,24i3) |
---|
| 574 | 755 FORMAT(1x,6f10.3,i3) |
---|
| 575 | |
---|
| 576 | RETURN |
---|
| 577 | END SUBROUTINE inifilr |
---|
| 578 | |
---|
[1108] | 579 | END MODULE filtreg_mod |
---|