Changeset 5099 for LMDZ6/branches/Amaury_dev/libf/filtrez/filtreg_mod.F90
- Timestamp:
- Jul 22, 2024, 9:29:09 PM (4 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/branches/Amaury_dev/libf/filtrez/filtreg_mod.F90
r5098 r5099 1 ! 1 2 2 ! $Id$ 3 ! 3 4 4 MODULE filtreg_mod 5 5 … … 19 19 20 20 ! ... H. Upadhyaya, O.Sharma ... 21 ! 21 22 22 IMPLICIT NONE 23 ! 23 24 24 ! version 3 ..... 25 25 … … 34 34 REAL dlonu(iim),dlatu(jjm) 35 35 REAL rlamda( iim ), eignvl( iim ) 36 !37 36 38 37 REAL lamdamax,pi,cof … … 47 46 INTEGER iymin 48 47 INTEGER ixmineq 49 ! 48 50 49 ! ------------------------------------------------------------ 51 50 ! This routine computes the eigenfunctions of the laplacien 52 51 ! on the stretched grid, and the filtering coefficients 53 ! 52 54 53 ! We designate: 55 54 ! eignfn eigenfunctions of the discrete laplacien … … 61 60 ! coefil filtering coefficients ( lamda_max*COS(rlat)/lamda ) 62 61 ! sdd SQRT( dx ) 63 ! 62 64 63 ! the modes are filtered from modfrst to modemax 65 ! 64 66 65 !----------------------------------------------------------- 67 ! 66 68 67 if ( iim == 1 ) return ! No filtre in 2D y-z 69 68 … … 73 72 dlonu(i) = xprimu( i ) 74 73 ENDDO 75 ! 74 76 75 CALL inifgn(eignvl) 77 ! 76 78 77 PRINT *,'inifilr: EIGNVL ' 79 78 PRINT 250,eignvl 80 79 250 FORMAT( 1x,5e14.6) 81 ! 80 82 81 ! compute eigenvalues and eigenfunctions 83 ! 84 ! 82 83 85 84 !................................................................. 86 ! 85 87 86 ! compute the filtering coefficients for scalar lines and 88 87 ! meridional wind v-lines 89 ! 88 90 89 ! we filter all those latitude lines WHERE coefil < 1 91 90 ! NO FILTERING AT POLES 92 ! 91 93 92 ! colat0 is to be used when alpha (stretching coefficient) 94 93 ! is set equal to zero for the regular grid CASE 95 ! 94 96 95 ! ....... Calcul de colat0 ......... 97 96 ! ..... colat0 = minimum de ( 0.5, min dy/ min dx ) ... 98 ! 99 ! 97 98 100 99 DO j = 1,jjm 101 100 dlatu( j ) = rlatu( j ) - rlatu( j+1 ) 102 101 ENDDO 103 !104 102 105 103 dxmin = dlonu(1) … … 111 109 dymin = MIN( dymin,dlatu(j) ) 112 110 ENDDO 113 ! 111 114 112 ! For a regular grid, we want the filter to start at latitudes 115 113 ! corresponding to lengths dx of the same size as dy (in terms … … 118 116 ! Same idea for the zoomed grid: start filtering polewards as soon 119 117 ! as length dx becomes of the same size as dy 120 ! 118 121 119 ! if maxlatfilter >0, prescribe the colat0 value from the .def files 122 120 … … 125 123 colat0 = MIN( 0.5, dymin/dxmin ) 126 124 ! colat0 = 1. 127 ! 125 128 126 IF( .NOT.fxyhypb.AND.ysinus ) THEN 129 127 colat0 = 0.6 … … 137 135 138 136 ENDIF 139 140 141 142 ! 137 143 138 PRINT 50, colat0,alphax 144 139 50 FORMAT(/15x,' Inifilr colat0 alphax ',2e16.7) 145 ! 140 146 141 IF(alphax==1. ) THEN 147 142 PRINT *,' Inifilr alphax doit etre < a 1. Corriger ' 148 143 STOP 149 144 ENDIF 150 ! 145 151 146 lamdamax = iim / ( pi * colat0 * ( 1. - alphax ) ) 152 147 153 148 ! ... Correction le 28/10/97 ( P.Le Van ) .. 154 ! 149 155 150 DO i = 2,iim 156 151 rlamda( i ) = lamdamax/ SQRT( ABS( eignvl(i) ) ) 157 152 ENDDO 158 !159 153 160 154 DO j = 1,jjm … … 167 161 ENDDO 168 162 169 !170 163 ! ... Determination de jfiltnu,jfiltnv,jfiltsu,jfiltsv .... 171 164 ! ......................................................... 172 ! 165 173 166 modemax = iim 174 167 … … 176 169 177 170 imx = iim 178 ! 171 179 172 PRINT *,'inifilr: TRUNCATION AT ',imx 180 ! 173 181 174 ! Ehouarn: set up some defaults 182 175 jfiltnu=2 ! avoid north pole … … 200 193 ENDIF 201 194 ENDDO 202 ! 195 203 196 DO j = 1, jjm/2 204 197 cof = COS( rlatv(j) )/ colat0 … … 216 209 ENDIF 217 210 ENDDO 218 !219 211 220 212 IF( jfiltnu> jjm/2 +1 ) THEN … … 251 243 ENDIF 252 244 253 !254 245 ! ... Determination de coefilu,coefilv,n=modfrstu,modfrstv .... 255 246 !................................................................ 256 ! 257 ! 247 248 258 249 DO j = 1,jjm 259 250 !default initialization: all modes are retained (i.e. no filtering) … … 261 252 modfrstv( j ) = iim 262 253 ENDDO 263 ! 254 264 255 DO j = 2,jfiltnu 265 256 DO k = 2,modemax … … 269 260 GOTO 84 270 261 82 modfrstu( j ) = k 271 ! 262 272 263 kf = modfrstu( j ) 273 264 DO k = kf , modemax … … 278 269 84 CONTINUE 279 270 ENDDO 280 ! 281 ! 271 272 282 273 DO j = 1,jfiltnv 283 ! 274 284 275 DO k = 2,modemax 285 276 cof = rlamda(k) * COS( rlatv(j) ) … … 288 279 GOTO 89 289 280 87 modfrstv( j ) = k 290 ! 281 291 282 kf = modfrstv( j ) 292 283 DO k = kf , modemax … … 297 288 89 CONTINUE 298 289 ENDDO 299 ! 290 300 291 DO j = jfiltsu,jjm 301 292 DO k = 2,modemax … … 305 296 GOTO 94 306 297 92 modfrstu( j ) = k 307 ! 298 308 299 kf = modfrstu( j ) 309 300 DO k = kf , modemax … … 314 305 94 CONTINUE 315 306 ENDDO 316 ! 307 317 308 DO j = jfiltsv,jjm 318 309 DO k = 2,modemax … … 322 313 GOTO 99 323 314 97 modfrstv( j ) = k 324 ! 315 325 316 kf = modfrstv( j ) 326 317 DO k = kf , modemax … … 331 322 99 CONTINUE 332 323 ENDDO 333 !334 324 335 325 IF(jfiltnv>=jjm/2 .OR. jfiltnu>=jjm/2)THEN … … 348 338 PRINT 334,modfrstu 349 339 350 ! 351 ! ................................................................... 352 ! 340 ! ................................................................... 341 353 342 ! ... Calcul de la matrice filtre 'matriceu' pour les champs situes 354 343 ! sur la grille scalaire ........ 355 344 ! ................................................................... 356 ! 345 357 346 DO j = 2, jfiltnu 358 347 … … 410 399 411 400 ! ................................................................... 412 ! 401 413 402 ! ... Calcul de la matrice filtre 'matricev' pour les champs situes 414 403 ! sur la grille de V ou de Z ........ 415 404 ! ................................................................... 416 ! 405 417 406 DO j = 1, jfiltnv 418 407 … … 471 460 472 461 ! ................................................................... 473 ! 462 474 463 ! ... Calcul de la matrice filtre 'matrinv' pour les champs situes 475 464 ! sur la grille scalaire , pour le filtre inverse ........ 476 465 ! ................................................................... 477 ! 466 478 467 DO j = 2, jfiltnu 479 468 … … 539 528 ! ................................................................... 540 529 541 !542 530 334 FORMAT(1x,24i3) 543 531
Note: See TracChangeset
for help on using the changeset viewer.