source: LMDZ4/trunk/libf/filtrez/mod_fft_mkl.F90 @ 3132

Last change on this file since 3132 was 1403, checked in by Laurent Fairhead, 14 years ago

Merged LMDZ4V5.0-dev branch changes r1292:r1399 to trunk.

Validation:
Validation consisted in compiling the HEAD revision of the trunk,
LMDZ4V5.0-dev branch and the merged sources and running different
configurations on local and SX8 machines comparing results.

Local machine: bench configuration, 32x24x11, gfortran

  • IPSLCM5A configuration (comparison between trunk and merged sources):
    • numerical convergence on dynamical fields over 3 days
    • start files are equivalent (except for RN and PB fields)
    • daily history files equivalent
  • MH07 configuration, new physics package (comparison between LMDZ4V5.0-dev branch and merged sources):
    • numerical convergence on dynamical fields over 3 days
    • start files are equivalent (except for RN and PB fields)
    • daily history files equivalent

SX8 machine (brodie), 96x95x39 on 4 processors:

  • IPSLCM5A configuration:
    • start files are equivalent (except for RN and PB fields)
    • monthly history files equivalent
  • MH07 configuration:
    • start files are equivalent (except for RN and PB fields)
    • monthly history files equivalent

Changes to the makegcm and create_make_gcm scripts to take into account
main programs in F90 files


Fusion de la branche LMDZ4V5.0-dev (r1292:r1399) au tronc principal

Validation:
La validation a consisté à compiler la HEAD de le trunk et de la banche
LMDZ4V5.0-dev et les sources fusionnées et de faire tourner le modéle selon
différentes configurations en local et sur SX8 et de comparer les résultats

En local: 32x24x11, config bench/gfortran

  • pour une config IPSLCM5A (comparaison tronc/fusion):
    • convergence numérique sur les champs dynamiques après 3 jours
    • restart et restartphy égaux (à part sur RN et Pb)
    • fichiers histoire égaux
  • pour une config nlle physique (MH07) (comparaison LMDZ4v5.0-dev/fusion):
    • convergence numérique sur les champs dynamiques après 3 jours
    • restart et restartphy égaux
    • fichiers histoire équivalents

Sur brodie, 96x95x39 sur 4 proc:

  • pour une config IPSLCM5A:
    • restart et restartphy égaux (à part sur RN et PB)
    • pas de différence dans les fichiers histmth.nc
  • pour une config MH07
    • restart et restartphy égaux (à part sur RN et PB)
    • pas de différence dans les fichiers histmth.nc

Changement sur makegcm et create_make-gcm pour pouvoir prendre en compte des
programmes principaux en *F90

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 5.0 KB
Line 
1MODULE mod_fft_mkl
2#ifdef FFT_MKL
3
4  USE MKL_DFTI
5 
6  REAL,SAVE                :: scale_factor
7  INTEGER,SAVE             :: vsize
8  INTEGER,PARAMETER        :: inc=1
9 
10!  TYPE FFT_HANDLE
11!    TYPE(DFTI_DESCRIPTOR), POINTER :: Pt
12!    LOGICAL :: IsAllocated
13!  END TYPE FFT_HANDLE
14 
15!  TYPE(FFT_HANDLE),SAVE,ALLOCATABLE :: Forward_Handle(:)
16!  TYPE(FFT_HANDLE),SAVE,ALLOCATABLE :: Backward_Handle(:)
17!!$OMP THREADPRIVATE(Forward_Handle,Backward_Handle) 
18 
19CONTAINS
20 
21  SUBROUTINE Init_fft(iim,nb_vect_max)
22    IMPLICIT NONE
23    INTEGER :: iim
24    INTEGER :: nb_vect_max
25    REAL    :: rtmp=1.
26    COMPLEX :: ctmp
27    INTEGER :: itmp=1
28    INTEGER :: isign=0
29    INTEGER :: ierr
30   
31    vsize=iim
32    scale_factor=1./SQRT(1.*vsize)
33!    ALLOCATE(Forward_Handle(nb_vect_max))
34!    ALLOCATE(Backward_Handle(nb_vect_max))
35   
36!    Forward_Handle(:)%IsAllocated=.FALSE.
37!    Backward_Handle(:)%IsAllocated=.FALSE.
38   
39!    ALLOCATE(Table_forward(2*vsize+64))
40!    ALLOCATE(Table_backward(2*vsize+64))
41!   
42!    CALL DZFFTM(isign,vsize,itmp,scale_factor,rtmp,vsize+inc,ctmp,vsize/2+1,table_forward,rtmp,ierr)
43!   
44!    CALL ZDFFTM(isign,vsize,itmp,scale_factor,ctmp,vsize/2+1,rtmp,vsize+inc,table_backward,rtmp,ierr)
45
46!    ierr = DftiCreateDescriptor( FFT_Handle, DFTI_DOUBLE, DFTI_REAL, 1, vsize )
47!    ierr = DftiSetValue(FFT_Handle,DFTI_NUMBER_OF_TRANSFORMS,nb_vect)
48!    ierr = DftiSetValue(FFT_Handle,DFTI_FORWARD_SCALE,scale_factor)
49!    ierr = DftiSetValue(FFT_Handle,DFTI_BACKWARD_SCALE,scale_factor)
50!    ierr = DftiSetValue(FFT_Handle,DFTI_PLACEMENT,DFTI_NOT_INPLACE)
51!    ierr = DftiSetValue(Desc_Handle, DFTI_INPUT_DISTANCE, vsize+inc)
52!    ierr = DftiSetValue(Desc_Handle, DFTI_OUTPUT_DISTANCE, vsize)
53!    ierr = DftiCommitDescriptor( FFT_HANDLE )
54
55  END SUBROUTINE Init_fft
56 
57 
58  SUBROUTINE fft_forward(vect,TF_vect,nb_vect)
59    IMPLICIT NONE
60    INTEGER,INTENT(IN)  :: nb_vect
61    REAL,INTENT(IN)     :: vect((vsize+inc)*nb_vect)
62    COMPLEX,INTENT(OUT) :: TF_vect((vsize/2+1)*nb_vect)
63    REAL                :: work(4*vsize*nb_vect)
64    INTEGER             :: ierr
65    INTEGER, PARAMETER :: isign=-1
66    REAL               :: vect_out((vsize+inc)*nb_vect)
67    TYPE(DFTI_DESCRIPTOR), POINTER :: FFT_Handle
68   
69!    IF ( .NOT. Forward_handle(nb_vect)%IsAllocated) THEN
70      ierr = DftiCreateDescriptor( FFT_Handle, DFTI_DOUBLE, DFTI_REAL, 1, vsize )
71      ierr = DftiSetValue(FFT_Handle,DFTI_NUMBER_OF_TRANSFORMS,nb_vect)
72      ierr = DftiSetValue(FFT_Handle,DFTI_FORWARD_SCALE,scale_factor)
73      ierr = DftiSetValue(FFT_Handle,DFTI_BACKWARD_SCALE,scale_factor)
74      ierr = DftiSetValue(FFT_Handle,DFTI_PLACEMENT,DFTI_NOT_INPLACE)
75      ierr = DftiSetValue(FFT_Handle, DFTI_INPUT_DISTANCE, vsize+inc)
76      ierr = DftiSetValue(FFT_Handle, DFTI_OUTPUT_DISTANCE, (vsize/2+1)*2)
77      ierr = DftiCommitDescriptor( FFT_Handle )
78!      Forward_handle(nb_vect)%IsAllocated=.TRUE.
79!    ENDIF
80   
81    ierr = DftiComputeForward( FFT_Handle, vect, TF_vect )
82
83    ierr = DftiFreeDescriptor( FFT_Handle )
84
85!    ierr = DftiCreateDescriptor( FFT_Handle, DFTI_DOUBLE, DFTI_REAL, 1, vsize )
86!    ierr = DftiSetValue(FFT_Handle,DFTI_NUMBER_OF_TRANSFORMS,nb_vect)
87!    ierr = DftiSetValue(FFT_Handle,DFTI_FORWARD_SCALE,scale_factor)
88!    ierr = DftiSetValue(FFT_Handle,DFTI_BACKWARD_SCALE,scale_factor)
89!    ierr = DftiSetValue(FFT_Handle,DFTI_PLACEMENT,DFTI_NOT_INPLACE)
90!    ierr = DftiSetValue(FFT_HANDLE, DFTI_INPUT_DISTANCE, vsize/2+1)
91!    ierr = DftiSetValue(FFT_HANDLE, DFTI_OUTPUT_DISTANCE, vsize+inc)
92!    ierr = DftiCommitDescriptor( FFT_HANDLE )
93!    ierr = DftiComputeBackward( FFT_HANDLE, TF_vect, vect_out )
94!    ierr = DftiFreeDescriptor( FFT_HANDLE )
95
96!    CALL DZFFTM(isign,vsize,nb_vect,scale_factor,vect,vsize+inc,TF_vect,vsize/2+1,table_forward,work,ierr)
97 
98  END SUBROUTINE fft_forward
99 
100  SUBROUTINE fft_backward(TF_vect,vect,nb_vect)
101    IMPLICIT NONE
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    REAL                :: work(4*vsize*nb_vect)
106    INTEGER             :: ierr
107    INTEGER, PARAMETER :: isign=1
108    TYPE(DFTI_DESCRIPTOR),POINTER :: FFT_Handle
109!    CALL ZDFFTM(isign,vsize,nb_vect,scale_factor,TF_vect,vsize/2+1,vect,vsize+inc,table_backward,work,ierr)
110!    IF ( .NOT. Backward_handle(nb_vect)%IsAllocated) THEN
111      ierr = DftiCreateDescriptor( FFT_Handle, DFTI_DOUBLE, DFTI_REAL, 1, vsize )
112      ierr = DftiSetValue(FFT_Handle,DFTI_NUMBER_OF_TRANSFORMS,nb_vect)
113      ierr = DftiSetValue(FFT_Handle,DFTI_FORWARD_SCALE,scale_factor)
114      ierr = DftiSetValue(FFT_Handle,DFTI_BACKWARD_SCALE,scale_factor)
115      ierr = DftiSetValue(FFT_Handle,DFTI_PLACEMENT,DFTI_NOT_INPLACE)
116      ierr = DftiSetValue(FFT_Handle, DFTI_INPUT_DISTANCE,  (vsize/2+1)*2)
117      ierr = DftiSetValue(FFT_Handle, DFTI_OUTPUT_DISTANCE, vsize+inc)
118      ierr = DftiCommitDescriptor( FFT_Handle )
119!      Backward_handle(nb_vect)%IsAllocated=.TRUE.
120!    ENDIF
121    ierr = DftiComputeBackward( FFT_Handle, TF_vect, vect )
122    ierr = DftiFreeDescriptor( FFT_Handle)
123 
124  END SUBROUTINE fft_backward
125
126#endif
127 
128END MODULE mod_fft_mkl
Note: See TracBrowser for help on using the repository browser.