Changeset 1591 for LMDZ5/trunk
- Timestamp:
- Nov 25, 2011, 10:12:33 AM (13 years ago)
- Location:
- LMDZ5/trunk/libf/filtrez
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ5/trunk/libf/filtrez/coefils.h
r1146 r1591 1 1 ! 2 ! $ Header$2 ! $Id $ 3 3 ! 4 4 COMMON/coefils/jfiltnu,jfiltsu,jfiltnv,jfiltsv,sddu(iim),sddv(iim)& … … 7 7 & ,coefilu2(iim,jjm),coefilv2(iim,jjm) 8 8 !c 9 INTEGER jfiltnu,jfiltsu,jfiltnv,jfiltsv,modfrstu,modfrstv 9 INTEGER jfiltnu ! index of the last lat line filtered in NH (U grid) 10 INTEGER jfiltsu ! index of the first lat line filtered in SH (U grid) 11 INTEGER jfiltnv ! index of the last lat line filtered in NH (V grid) 12 INTEGER jfiltsv ! index of the first lat line filtered in SH (V grid) 13 INTEGER modfrstu ! number of retained (ie: unfiltered) modes on U grid 14 INTEGER modfrstv ! number of retained (ie: unfiltered) modes on V grid 10 15 REAL sddu,sddv,unsddu,unsddv,coefilu,coefilv,eignfnu,eignfnv 11 16 REAL coefilu2,coefilv2 -
LMDZ5/trunk/libf/filtrez/filtreg_mod.F90
r1279 r1591 1 ! 2 ! $Id $ 3 ! 1 4 MODULE filtreg_mod 2 5 … … 42 45 INTEGER ixmineq 43 46 #endif 44 EXTERNAL inifgn45 47 ! 46 48 ! ------------------------------------------------------------ … … 71 73 CALL inifgn(eignvl) 72 74 ! 73 PRINT *,' EIGNVL '75 PRINT *,'inifilr: EIGNVL ' 74 76 PRINT 250,eignvl 75 250 FORMAT( 1x,5e1 3.6)77 250 FORMAT( 1x,5e14.6) 76 78 ! 77 79 ! compute eigenvalues and eigenfunctions … … 113 115 #endif 114 116 ! 117 ! For a regular grid, we want the filter to start at latitudes 118 ! corresponding to lengths dx of the same size as dy (in terms 119 ! of angles: dx=2*dy) => at colat0=0.5 (i.e. colatitude=30 degrees 120 ! <=> latitude=60 degrees). 121 ! Same idea for the zoomed grid: start filtering polewards as soon 122 ! as length dx becomes of the same size as dy 115 123 ! 116 124 colat0 = MIN( 0.5, dymin/dxmin ) … … 158 166 imx = iim 159 167 ! 160 PRINT *,' TRUNCATION AT ',imx 161 ! 168 PRINT *,'inifilr: TRUNCATION AT ',imx 169 ! 170 ! Ehouarn: set up some defaults 171 jfiltnu=2 ! avoid north pole 172 jfiltsu=jjm ! avoid south pole (which is at jjm+1) 173 jfiltnv=1 ! NB: no poles on the V grid 174 jfiltsv=jjm 175 162 176 DO j = 2, jjm/2+1 163 177 cof = COS( rlatu(j) )/ colat0 164 178 IF ( cof .LT. 1. ) THEN 165 IF( rlamda(imx) * COS(rlatu(j) ).LT.1. ) jfiltnu= j 179 IF( rlamda(imx) * COS(rlatu(j) ).LT.1. ) THEN 180 jfiltnu= j 181 ENDIF 166 182 ENDIF 167 183 168 184 cof = COS( rlatu(jjp1-j+1) )/ colat0 169 185 IF ( cof .LT. 1. ) THEN 170 IF( rlamda(imx) * COS(rlatu(jjp1-j+1) ).LT.1. ) &186 IF( rlamda(imx) * COS(rlatu(jjp1-j+1) ).LT.1. ) THEN 171 187 jfiltsu= jjp1-j+1 188 ENDIF 172 189 ENDIF 173 190 ENDDO … … 176 193 cof = COS( rlatv(j) )/ colat0 177 194 IF ( cof .LT. 1. ) THEN 178 IF( rlamda(imx) * COS(rlatv(j) ).LT.1. ) jfiltnv= j 195 IF( rlamda(imx) * COS(rlatv(j) ).LT.1. ) THEN 196 jfiltnv= j 197 ENDIF 179 198 ENDIF 180 199 181 200 cof = COS( rlatv(jjm-j+1) )/ colat0 182 201 IF ( cof .LT. 1. ) THEN 183 IF( rlamda(imx) * COS(rlatv(jjm-j+1) ).LT.1. ) &202 IF( rlamda(imx) * COS(rlatv(jjm-j+1) ).LT.1. ) THEN 184 203 jfiltsv= jjm-j+1 204 ENDIF 185 205 ENDIF 186 206 ENDDO 187 207 ! 188 208 189 IF ( jfiltnu.LE.0 ) jfiltnu=1190 209 IF( jfiltnu.GT. jjm/2 +1 ) THEN 191 210 PRINT *,' jfiltnu en dehors des valeurs acceptables ' ,jfiltnu … … 193 212 ENDIF 194 213 195 IF( jfiltsu.LE.0) jfiltsu=1196 214 IF( jfiltsu.GT. jjm +1 ) THEN 197 215 PRINT *,' jfiltsu en dehors des valeurs acceptables ' ,jfiltsu … … 199 217 ENDIF 200 218 201 IF( jfiltnv.LE.0) jfiltnv=1202 219 IF( jfiltnv.GT. jjm/2 ) THEN 203 220 PRINT *,' jfiltnv en dehors des valeurs acceptables ' ,jfiltnv … … 205 222 ENDIF 206 223 207 IF( jfiltsv.LE.0) jfiltsv=1208 224 IF( jfiltsv.GT. jjm ) THEN 209 225 PRINT *,' jfiltsv en dehors des valeurs acceptables ' ,jfiltsv … … 211 227 ENDIF 212 228 213 PRINT *,' jfiltnv jfiltsv jfiltnu jfiltsu ' , &229 PRINT *,'inifilr: jfiltnv jfiltsv jfiltnu jfiltsu ' , & 214 230 jfiltnv,jfiltsv,jfiltnu,jfiltsu 215 231 216 232 IF(first_call_inifilr) THEN 217 233 ALLOCATE(matriceun(iim,iim,jfiltnu)) 218 ALLOCATE(matriceus(iim,iim,j filtsu))234 ALLOCATE(matriceus(iim,iim,jjm-jfiltsu+1)) 219 235 ALLOCATE(matricevn(iim,iim,jfiltnv)) 220 ALLOCATE(matricevs(iim,iim,j filtsv))236 ALLOCATE(matricevs(iim,iim,jjm-jfiltsv+1)) 221 237 ALLOCATE( matrinvn(iim,iim,jfiltnu)) 222 ALLOCATE( matrinvs(iim,iim,j filtsu))238 ALLOCATE( matrinvs(iim,iim,jjm-jfiltsu+1)) 223 239 first_call_inifilr = .FALSE. 224 240 ENDIF … … 230 246 ! 231 247 DO j = 1,jjm 248 !default initialization: all modes are retained (i.e. no filtering) 232 249 modfrstu( j ) = iim 233 250 modfrstv( j ) = iim … … 306 323 307 324 IF(jfiltnv.GE.jjm/2 .OR. jfiltnu.GE.jjm/2)THEN 308 325 ! Ehouarn: and what are these for??? Trying to handle a limit case 326 ! where filters extend to and meet at the equator? 309 327 IF(jfiltnv.EQ.jfiltsv)jfiltsv=1+jfiltnv 310 328 IF(jfiltnu.EQ.jfiltsu)jfiltsu=1+jfiltnu … … 334 352 eignft(i,k) = eignfnv(k,i) * coff 335 353 ENDDO 336 ENDDO 354 ENDDO ! of DO i=1,iim 337 355 #ifdef CRAY 338 356 CALL MXM( eignfnv,iim,eignft,iim,matriceun(1,1,j),iim ) … … 350 368 ENDDO 351 369 ENDDO 352 ENDDO 353 #endif 354 #endif 355 356 ENDDO 370 ENDDO ! of DO k = 1, iim 371 #endif 372 #endif 373 374 ENDDO ! of DO j = 2, jfiltnu 357 375 358 376 DO j = jfiltsu, jjm … … 364 382 eignft(i,k) = eignfnv(k,i) * coff 365 383 ENDDO 366 ENDDO 384 ENDDO ! of DO i=1,iim 367 385 #ifdef CRAY 368 386 CALL MXM(eignfnv,iim,eignft,iim,matriceus(1,1,j-jfiltsu+1),iim) … … 381 399 ENDDO 382 400 ENDDO 383 ENDDO 384 #endif 385 #endif 386 387 ENDDO 401 ENDDO ! of DO k = 1, iim 402 #endif 403 #endif 404 405 ENDDO ! of DO j = jfiltsu, jjm 388 406 389 407 ! ................................................................... … … 421 439 #endif 422 440 423 ENDDO 441 ENDDO ! of DO j = 1, jfiltnv 424 442 425 443 DO j = jfiltsv, jjm … … 452 470 #endif 453 471 454 ENDDO 472 ENDDO ! of DO j = jfiltsv, jjm 455 473 456 474 ! ................................................................... … … 488 506 #endif 489 507 490 ENDDO 508 ENDDO ! of DO j = 2, jfiltnu 491 509 492 510 DO j = jfiltsu, jjm … … 518 536 #endif 519 537 520 ENDDO 538 ENDDO ! of DO j = jfiltsu, jjm 521 539 522 540 IF (use_filtre_fft) THEN
Note: See TracChangeset
for help on using the changeset viewer.