Changeset 1601 for LMDZ4/branches
- Timestamp:
- Dec 7, 2011, 8:05:43 AM (13 years ago)
- Location:
- LMDZ4/branches/LMDZ4_AR5
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ4/branches/LMDZ4_AR5/arch/arch-PW6_VARGAS.fcm
r1459 r1601 3 3 %AR ar 4 4 %MAKE gmake 5 %FPP_FLAGS -P 6 %FPP_DEF NC_DOUBLE BLAS SGEMV=DGEMV SGEMM=DGEMM 7 %BASE_FFLAGS -qautodbl=dbl4 -qxlf90=autodealloc -q extname=flush5 %FPP_FLAGS -P -I/usr/local/pub/FFTW/3.2/include 6 %FPP_DEF NC_DOUBLE BLAS SGEMV=DGEMV SGEMM=DGEMM FFT_FFTW 7 %BASE_FFLAGS -qautodbl=dbl4 -qxlf90=autodealloc -qmaxmem=-1 -qzerosize -I/usr/local/pub/FFTW/3.2/include 8 8 %PROD_FFLAGS -O3 9 9 %DEV_FFLAGS -O2 -qfullpath -qinitauto=7FBFFFFF -qfloat=nans -qflttrap=overflow:zerodivide:invalid:enable -qsigtrap … … 11 11 %MPI_FFLAGS -I/usr/lpp/ppe.poe/include/thread64 12 12 %OMP_FFLAGS -qsmp=omp 13 %BASE_LD -lessl 13 %BASE_LD -lessl -L/usr/local/pub/FFTW/3.2/lib -lfftw3 14 14 %MPI_LD 15 15 %OMP_LD -qsmp=omp -
LMDZ4/branches/LMDZ4_AR5/libf/dyn3dpar/filtreg_p.F
r1146 r1601 208 208 IF( ifiltre.EQ.-2 ) THEN 209 209 DO j = jdfil,jffil 210 #ifdef BLAS 210 211 CALL DGEMM("N", "N", iim, nbniv_loc, iim, 1.0, 211 212 & matrinvn(1,1,j), iim, 212 213 & champ_loc(1,j,1), iip1*nlat, 0.0, 213 214 & champ_fft(1,j-jdfil+1,1), iip1*nlat) 215 #else 216 champ_fft(:,j-jdfil+1,:) 217 & =matmul(matrinvn(:,:,j),champ_loc(:iim,j,:)) 218 #endif 214 219 ENDDO 215 220 216 221 ELSE IF ( griscal ) THEN 217 222 DO j = jdfil,jffil 223 #ifdef BLAS 218 224 CALL DGEMM("N", "N", iim, nbniv_loc, iim, 1.0, 219 225 & matriceun(1,1,j), iim, 220 226 & champ_loc(1,j,1), iip1*nlat, 0.0, 221 227 & champ_fft(1,j-jdfil+1,1), iip1*nlat) 228 #else 229 champ_fft(:,j-jdfil+1,:) 230 & =matmul(matriceun(:,:,j),champ_loc(:iim,j,:)) 231 #endif 222 232 ENDDO 223 233 224 234 ELSE 225 235 DO j = jdfil,jffil 236 #ifdef BLAS 226 237 CALL DGEMM("N", "N", iim, nbniv_loc, iim, 1.0, 227 238 & matricevn(1,1,j), iim, 228 239 & champ_loc(1,j,1), iip1*nlat, 0.0, 229 240 & champ_fft(1,j-jdfil+1,1), iip1*nlat) 241 #else 242 champ_fft(:,j-jdfil+1,:) 243 & =matmul(matricevn(:,:,j),champ_loc(:iim,j,:)) 244 #endif 230 245 ENDDO 231 246 … … 236 251 IF( ifiltre.EQ.-2 ) THEN 237 252 DO j = jdfil,jffil 253 #ifdef BLAS 238 254 CALL DGEMM("N", "N", iim, nbniv_loc, iim, 1.0, 239 255 & matrinvs(1,1,j-jfiltsu+1), iim, 240 256 & champ_loc(1,j,1), iip1*nlat, 0.0, 241 257 & champ_fft(1,j-jdfil+1,1), iip1*nlat) 258 #else 259 champ_fft(:,j-jdfil+1,:) 260 & =matmul(matrinvs(:,:,j-jfiltsu+1), 261 & champ_loc(:iim,j,:)) 262 #endif 242 263 ENDDO 243 264 … … 245 266 246 267 DO j = jdfil,jffil 268 #ifdef BLAS 247 269 CALL DGEMM("N", "N", iim, nbniv_loc, iim, 1.0, 248 270 & matriceus(1,1,j-jfiltsu+1), iim, 249 271 & champ_loc(1,j,1), iip1*nlat, 0.0, 250 272 & champ_fft(1,j-jdfil+1,1), iip1*nlat) 273 #else 274 champ_fft(:,j-jdfil+1,:) 275 & =matmul(matriceus(:,:,j-jfiltsu+1), 276 & champ_loc(:iim,j,:)) 277 #endif 251 278 ENDDO 252 279 … … 254 281 255 282 DO j = jdfil,jffil 283 #ifdef BLAS 256 284 CALL DGEMM("N", "N", iim, nbniv_loc, iim, 1.0, 257 285 & matricevs(1,1,j-jfiltsv+1), iim, 258 286 & champ_loc(1,j,1), iip1*nlat, 0.0, 259 287 & champ_fft(1,j-jdfil+1,1), iip1*nlat) 288 #else 289 champ_fft(:,j-jdfil+1,:) 290 & =matmul(matricevs(:,:,j-jfiltsv+1), 291 & champ_loc(:iim,j,:)) 292 #endif 260 293 ENDDO 261 294 -
LMDZ4/branches/LMDZ4_AR5/libf/filtrez/coefils.h
r1146 r1601 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 -
LMDZ4/branches/LMDZ4_AR5/libf/filtrez/filtreg_mod.F90
r1279 r1601 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 -
LMDZ4/branches/LMDZ4_AR5/libf/filtrez/mod_fft_fftw.F90
r986 r1601 1 ! 2 ! $Id$ 3 ! 4 1 5 MODULE mod_fft_fftw 2 6 3 7 #ifdef FFT_FFTW 4 8 5 REAL,SAVE,ALLOCATABLE :: Table_forward(:) 6 REAL,SAVE,ALLOCATABLE :: Table_backward(:) 7 REAL,SAVE :: scale_factor 8 INTEGER,SAVE :: vsize 9 INTEGER,PARAMETER :: inc=1 9 REAL, SAVE :: scale_factor 10 INTEGER, SAVE :: vsize 11 INTEGER, PARAMETER :: inc=1 10 12 11 INTEGER ,SAVE:: plan_forward12 INTEGER ,SAVE:: plan_backward13 INTEGER*8, ALLOCATABLE, DIMENSION(:), SAVE :: plan_forward 14 INTEGER*8, ALLOCATABLE, DIMENSION(:), SAVE :: plan_backward 13 15 14 16 CONTAINS 15 17 16 SUBROUTINE Init_fft(iim )18 SUBROUTINE Init_fft(iim,nvectmax) 17 19 IMPLICIT NONE 18 #include < rfftw.h>20 #include <fftw3.f> 19 21 INTEGER :: iim 20 REAL :: rtmp=1. 21 COMPLEX*16 :: ctmp 22 INTEGER :: itmp=1 23 INTEGER :: isign=0 24 INTEGER :: ierr 22 INTEGER :: nvectmax 23 24 INTEGER :: itmp 25 26 INTEGER :: rank 27 INTEGER :: howmany 28 INTEGER :: istride, idist 29 INTEGER :: ostride, odist 30 INTEGER, DIMENSION(1) :: n_array, inembed, onembed 31 32 REAL, DIMENSION(iim+1,nvectmax) :: dbidon 33 COMPLEX, DIMENSION(iim/2+1,nvectmax) :: cbidon 34 35 vsize = iim 36 scale_factor = 1./SQRT(1.*vsize) 37 38 dbidon = 0 39 cbidon = 0 40 41 ALLOCATE(plan_forward(nvectmax)) 42 ALLOCATE(plan_backward(nvectmax)) 25 43 26 vsize=iim 27 scale_factor=1./SQRT(1.*vsize) 28 ALLOCATE(Table_forward(2*vsize+64)) 29 ALLOCATE(Table_backward(2*vsize+64)) 44 WRITE(*,*)"!---------------------!" 45 WRITE(*,*)"! !" 46 WRITE(*,*)"! INITIALISATION FFTW !" 47 WRITE(*,*)"! !" 48 WRITE(*,*)"!---------------------!" 30 49 31 ! CALL DZFFTM(isign,vsize,itmp,scale_factor,rtmp,vsize+inc,ctmp,vsize/2+1,table_forward,rtmp,ierr) 32 33 ! CALL ZDFFTM(isign,vsize,itmp,scale_factor,ctmp,vsize/2+1,rtmp,vsize+inc,table_backward,rtmp,ierr) 50 ! On initialise tous les plans 51 DO itmp = 1, nvectmax 52 rank = 1 53 n_array(1) = iim 54 howmany = itmp 55 inembed(1) = iim + 1 ; onembed(1) = iim/2 + 1 56 istride = 1 ; ostride = 1 57 idist = iim + 1 ; odist = iim/2 + 1 34 58 35 CALL rfftw_f77_create_plan(plan_forward,iim,FFTW_REAL_TO_COMPLEX,FFTW_ESTIMATE) 36 CALL rfftw_f77_create_plan(plan_backward,iim,FFTW_COMPLEX_TO_REAL,FFTW_ESTIMATE) 37 59 CALL dfftw_plan_many_dft_r2c(plan_forward(itmp), rank, n_array, howmany, & 60 & dbidon, inembed, istride, idist, & 61 & cbidon, onembed, ostride, odist, & 62 & FFTW_ESTIMATE) 63 64 rank = 1 65 n_array(1) = iim 66 howmany = itmp 67 inembed(1) = iim/2 + 1 ; onembed(1) = iim + 1 68 istride = 1 ; ostride = 1 69 idist = iim/2 + 1 ; odist = iim + 1 70 CALL dfftw_plan_many_dft_c2r(plan_backward(itmp), rank, n_array, howmany, & 71 & cbidon, inembed, istride, idist, & 72 & dbidon, onembed, ostride, odist, & 73 & FFTW_ESTIMATE) 74 75 ENDDO 76 77 WRITE(*,*)"!-------------------------!" 78 WRITE(*,*)"! !" 79 WRITE(*,*)"! FIN INITIALISATION FFTW !" 80 WRITE(*,*)"! !" 81 WRITE(*,*)"!-------------------------!" 82 38 83 END SUBROUTINE Init_fft 39 84 … … 41 86 SUBROUTINE fft_forward(vect,TF_vect,nb_vect) 42 87 IMPLICIT NONE 43 #include <rfftw.h> 44 INTEGER,INTENT(IN) :: nb_vect 45 REAL,INTENT(IN) :: vect(vsize+inc,nb_vect) 46 COMPLEX*16,INTENT(OUT) :: TF_vect(vsize/2+1,nb_vect) 47 REAL :: work(4*vsize*nb_vect) 48 INTEGER :: ierr 49 INTEGER, PARAMETER :: isign=-1 50 51 ! CALL DZFFTM(isign,vsize,nb_vect,scale_factor,vect,vsize+inc,TF_vect,vsize/2+1,table_forward,work,ierr) 52 CALL rfftwnd_f77_real_to_complex(plan_forward,nb_vect,vect, 1, vsize+inc , TF_vect, 1, vsize/2+1); 53 88 #include <fftw3.f> 89 INTEGER,INTENT(IN) :: nb_vect 90 REAL,INTENT(IN) :: vect(vsize+inc,nb_vect) 91 COMPLEX,INTENT(OUT) :: TF_vect(vsize/2+1,nb_vect) 92 93 CALL dfftw_execute_dft_r2c(plan_forward(nb_vect),vect,TF_vect) 94 95 TF_vect = scale_factor * TF_vect 96 54 97 END SUBROUTINE fft_forward 55 98 56 99 SUBROUTINE fft_backward(TF_vect,vect,nb_vect) 57 100 IMPLICIT NONE 58 #include <rfftw.h> 59 INTEGER,INTENT(IN) :: nb_vect 60 REAL,INTENT(OUT) :: vect(vsize+inc,nb_vect) 61 COMPLEX*16,INTENT(IN ) :: TF_vect(vsize/2+1,nb_vect) 62 REAL :: work(4*vsize*nb_vect) 63 INTEGER :: ierr 64 INTEGER, PARAMETER :: isign=1 65 66 ! CALL ZDFFTM(isign,vsize,nb_vect,scale_factor,TF_vect,vsize/2+1,vect,vsize+inc,table_backward,work,ierr) 67 CALL rfftwnd_f77_complex_to_real(plan_forward,nb_vect,TF_vect, 1, vsize/2+1 , vect, 1, vsize+inc); 101 #include <fftw3.f> 102 INTEGER,INTENT(IN) :: nb_vect 103 REAL,INTENT(OUT) :: vect(vsize+inc,nb_vect) 104 COMPLEX,INTENT(IN ) :: TF_vect(vsize/2+1,nb_vect) 105 106 CALL dfftw_execute_dft_c2r(plan_backward(nb_vect),TF_vect,vect) 107 108 vect = scale_factor * vect 68 109 69 110 END SUBROUTINE fft_backward … … 72 113 73 114 END MODULE mod_fft_fftw 74 -
LMDZ4/branches/LMDZ4_AR5/libf/filtrez/mod_fft_mathkeisan.F90
r986 r1601 15 15 INTEGER :: nb_vect_max 16 16 REAL :: rtmp=1. 17 COMPLEX *16:: ctmp17 COMPLEX :: ctmp 18 18 INTEGER :: itmp=1 19 19 INTEGER :: isign=0 … … 37 37 INTEGER,INTENT(IN) :: nb_vect 38 38 REAL,INTENT(IN) :: vect(vsize+inc,nb_vect) 39 COMPLEX *16,INTENT(OUT) :: TF_vect(vsize/2+1,nb_vect)39 COMPLEX,INTENT(OUT) :: TF_vect(vsize/2+1,nb_vect) 40 40 REAL :: work(4*vsize*nb_vect) 41 41 INTEGER :: ierr … … 51 51 INTEGER,INTENT(IN) :: nb_vect 52 52 REAL,INTENT(OUT) :: vect(vsize+inc,nb_vect) 53 COMPLEX *16,INTENT(IN ) :: TF_vect(vsize/2+1,nb_vect)53 COMPLEX,INTENT(IN ) :: TF_vect(vsize/2+1,nb_vect) 54 54 REAL :: work(4*vsize*nb_vect) 55 55 INTEGER :: ierr -
LMDZ4/branches/LMDZ4_AR5/libf/filtrez/mod_fft_mkl.F90
r1279 r1601 24 24 INTEGER :: nb_vect_max 25 25 REAL :: rtmp=1. 26 COMPLEX *16:: ctmp26 COMPLEX :: ctmp 27 27 INTEGER :: itmp=1 28 28 INTEGER :: isign=0 … … 60 60 INTEGER,INTENT(IN) :: nb_vect 61 61 REAL,INTENT(IN) :: vect((vsize+inc)*nb_vect) 62 COMPLEX *16,INTENT(OUT) :: TF_vect((vsize/2+1)*nb_vect)62 COMPLEX,INTENT(OUT) :: TF_vect((vsize/2+1)*nb_vect) 63 63 REAL :: work(4*vsize*nb_vect) 64 64 INTEGER :: ierr … … 102 102 INTEGER,INTENT(IN) :: nb_vect 103 103 REAL,INTENT(OUT) :: vect((vsize+inc)*nb_vect) 104 COMPLEX *16,INTENT(IN ) :: TF_vect((vsize/2+1)*nb_vect)104 COMPLEX,INTENT(IN ) :: TF_vect((vsize/2+1)*nb_vect) 105 105 REAL :: work(4*vsize*nb_vect) 106 106 INTEGER :: ierr -
LMDZ4/branches/LMDZ4_AR5/libf/filtrez/mod_fft_wrapper.F90
r1279 r1601 19 19 INTEGER,INTENT(IN) :: nb_vect 20 20 REAL,INTENT(IN) :: vect(vsize+inc,nb_vect) 21 COMPLEX *16,INTENT(INOUT) :: TF_vect(vsize/2+1,nb_vect)21 COMPLEX,INTENT(INOUT) :: TF_vect(vsize/2+1,nb_vect) 22 22 23 23 STOP "wrapper fft : une FFT doit etre specifiee a l'aide d'une clee CPP, sinon utiliser le filtre classique" … … 29 29 INTEGER,INTENT(IN) :: nb_vect 30 30 REAL,INTENT(INOUT) :: vect(vsize+inc,nb_vect) 31 COMPLEX *16,INTENT(IN ) :: TF_vect(vsize/2+1,nb_vect)31 COMPLEX,INTENT(IN ) :: TF_vect(vsize/2+1,nb_vect) 32 32 33 33 STOP "wrapper fft : une FFT doit etre specifiee a l'aide d'une clee CPP, sinon utiliser le filtre classique" -
LMDZ4/branches/LMDZ4_AR5/libf/filtrez/mod_filtre_fft.F90
r1279 r1601 1 ! 2 ! $Id$ 3 ! 4 1 5 MODULE mod_filtre_fft 2 6 … … 23 27 INTEGER :: index_vp(iim) 24 28 INTEGER :: i,j 25 29 INTEGER :: l,ll_nb 30 26 31 index_vp(1)=1 27 32 DO i=1,iim/2 … … 98 103 ENDDO 99 104 100 105 #ifdef FFT_FFTW 106 107 WRITE (*,*)"COTH jfiltnu,jfiltsu,jfiltnv,jjm-jfiltsv" 108 WRITE (*,*)jfiltnu,jfiltsu,jfiltnv,jjm-jfiltsv 109 WRITE (*,*)MAX(jfiltnu-2,jjm-jfiltsu,jfiltnv-2,jjm-jfiltsv)+1 110 CALL Init_FFT(iim,(llm+1)*(MAX(jfiltnu-2,jjm-jfiltsu,jfiltnv-2,jjm-jfiltsv)+1)) 111 #else 101 112 CALL Init_FFT(iim,(jjm+1)*(llm+1)) 102 113 #endif 103 114 104 115 END SUBROUTINE Init_filtre_fft … … 118 129 119 130 REAL :: vect(iim+inc,jj_end-jj_begin+1,nbniv) 120 ! REAL :: vect_test(iim+inc,jj_end-jj_begin+1,nbniv) 121 COMPLEX*16 :: TF_vect(iim/2+1,jj_end-jj_begin+1,nbniv) 122 ! COMPLEX*16 :: TF_vect_test(iim/2+1,jj_end-jj_begin+1,nbniv) 131 COMPLEX :: TF_vect(iim/2+1,jj_end-jj_begin+1,nbniv) 123 132 INTEGER :: nb_vect 124 133 INTEGER :: i,j,l 125 134 INTEGER :: ll_nb 126 ! REAL :: vect_tmp(iim+inc,jj_end-jj_begin+1,nbniv)127 135 128 136 ll_nb=0 … … 140 148 nb_vect=(jj_end-jj_begin+1)*ll_nb 141 149 142 ! vect_tmp=vect143 144 150 CALL FFT_forward(vect,TF_vect,nb_vect) 145 146 ! CALL FFT_forward(vect,TF_vect_test,nb_vect)147 ! PRINT *,"XXXXXXXXXXXXX Filtre_u_FFT xxxxxxxxxxxx"148 ! DO j=1,jj_end-jj_begin+1149 ! DO i=1,iim/2+1150 ! PRINT *,"====",i,j,"----->",TF_vect_test(i,j,1)151 ! ENDDO152 ! ENDDO153 151 154 152 DO l=1,ll_nb … … 159 157 ENDDO 160 158 ENDDO 161 159 162 160 CALL FFT_backward(TF_vect,vect,nb_vect) 163 ! CALL FFT_backward(TF_vect_test,vect_test,nb_vect) 164 165 ! PRINT *,"XXXXXXXXXXXXX Filtre_u_FFT xxxxxxxxxxxx" 166 ! DO j=1,jj_end-jj_begin+1 167 ! DO i=1,iim 168 ! PRINT *,"====",i,j,"----->",vect_test(i,j,1) 169 ! ENDDO 170 ! ENDDO 171 161 162 172 163 ll_nb=0 173 164 !$OMP DO SCHEDULE(STATIC,OMP_CHUNK) … … 199 190 200 191 REAL :: vect(iim+inc,jj_end-jj_begin+1,nbniv) 201 COMPLEX *16:: TF_vect(iim/2+1,jj_end-jj_begin+1,nbniv)192 COMPLEX :: TF_vect(iim/2+1,jj_end-jj_begin+1,nbniv) 202 193 INTEGER :: nb_vect 203 194 INTEGER :: i,j,l … … 260 251 REAL,INTENT(INOUT) :: vect_inout(iim+1,nlat,nbniv) 261 252 262 REAL :: vect(iim+inc,jj_end-jj_begin+1,nbniv)263 COMPLEX *16:: TF_vect(iim/2+1,jj_end-jj_begin+1,nbniv)253 REAL :: vect(iim+inc,jj_end-jj_begin+1,nbniv) 254 COMPLEX :: TF_vect(iim/2+1,jj_end-jj_begin+1,nbniv) 264 255 INTEGER :: nb_vect 265 256 INTEGER :: i,j,l … … 305 296 306 297 END SUBROUTINE Filtre_inv_fft 307 308 309 ! SUBROUTINE get_ll_index(nbniv,ll_index,ll_nb)310 ! IMPLICIT NONE311 ! INTEGER,INTENT(IN) :: nbniv312 ! INTEGER,INTENT(OUT) :: ll_index(nbniv)313 ! INTEGER,INTENT(OUT) :: ll_nb314 !315 ! INTEGER :: l,ll_begin, ll_end316 ! INTEGER :: omp_rank,omp_size317 ! INTEGER :: OMP_GET_NUM_THREADS318 ! INTEGER :: omp_chunk319 ! EXTERNAL OMP_GET_NUM_THREADS320 ! INTEGER :: OMP_GET_THREAD_NUM321 ! EXTERNAL OMP_GET_THREAD_NUM322 !323 !324 ! omp_size=OMP_GET_NUM_THREADS()325 ! omp_rank=OMP_GET_THREAD_NUM()326 ! omp_chunk=nbniv/omp_size+min(1,MOD(nbniv,omp_size))327 !328 ! ll_begin=omp_rank*OMP_CHUNK+1329 ! ll_nb=0330 ! DO WHILE (ll_begin<=nbniv)331 ! ll_end=min(ll_begin+OMP_CHUNK-1,nbniv)332 ! DO l=ll_begin,ll_end333 ! ll_nb=ll_nb+1334 ! ll_index(ll_nb)=l335 ! ENDDO336 ! ll_begin=ll_begin+omp_size*OMP_CHUNK337 ! ENDDO338 !339 ! END SUBROUTINE get_ll_index340 298 341 299 END MODULE mod_filtre_fft
Note: See TracChangeset
for help on using the changeset viewer.