SlideShare a Scribd company logo
PROGRAM pod
IMPLICIT NONE
INTEGER ::
i,j,Nx,Raw_No,Vx,INFO,a,b,c,k,l,LWORK,n,imod,it,ix,nxdeb,nxfin,nydeb,nyfin,Vxmax,ix1
,ix0,imode,ival,ifile
REAL ::
Xcord,Ycord,u,v,s,waste,sumvel,x,w,pval,pvali,ti,at,array,valuemtx,summ,rms
REAL :: xdec,ydec,height,width,Xhcord,Yhcord,hu,hv,hs
PARAMETER(Nx=2000,Raw_No=5084,Vx=48,LWORK=3*Vx,Vxmax=62)
REAL :: xuv(Raw_No),yuv(Raw_No),velu(Raw_No),velv(Raw_No)
REAL :: sp(Vx),velvec(Nx,Vx),T_velvec(Vx,Nx),meanvel(Nx),vel(Nx,Vx)
REAL :: lambda(Vx),mods(Vx),modsum(Vx),normmodsum(Vx),av(Nx,Vx)
REAL :: atf(Nx,Vx),evec(Vx,Vx),phi(Nx,Vx),prephi(Vx),correl(Vx,Vx)
CHARACTER (LEN=4) :: filenumber
CHARACTER (LEN=100) :: datachar
CHARACTER (LEN=100) :: lone
CHARACTER (LEN=100) :: ltwo
CHARACTER (LEN=100) :: lthree
DOUBLE PRECISION :: WORK(LWORK)
DOUBLE PRECISION :: vp(LWORK)
DOUBLE PRECISION :: Aeg(Vx,Vx)
CHARACTER(*), PARAMETER :: path_data ='/home/sbhattac/Bureau/Fortran_POD/'
CHARACTER(*), PARAMETER :: path_filenumber
='/home/sbhattac/Bureau/Fortran_POD/FileNumber/'
CHARACTER(*), PARAMETER :: path_parameters
='/home/sbhattac/Bureau/Fortran_POD/Parameters/'
CHARACTER(*), PARAMETER :: path_rawdata
='/home/sbhattac/Bureau/Fortran_POD/Raw_Data/'
CHARACTER(*), PARAMETER :: path_correctedfile
='/home/sbhattac/Bureau/Fortran_POD/Corrected_Data/'
CHARACTER(*), PARAMETER :: path_snapshot
='/home/sbhattac/Bureau/Fortran_POD/Snapshot_Files/'
CHARACTER(*), PARAMETER :: path_egvec
='/home/sbhattac/Bureau/Fortran_POD/Egvec_Files/'
CHARACTER(*), PARAMETER :: path_phi
='/home/sbhattac/Bureau/Fortran_POD/Phi_Files/'
CHARACTER(*), PARAMETER :: path_lamda
='/home/sbhattac/Bureau/Fortran_POD/Lamda_Files/'
CHARACTER(*), PARAMETER :: path_eigenvectors
='/home/sbhattac/Bureau/Fortran_POD/Eigenvectors_Files/'
do i=1,Nx
do j=1,Vx
velvec(i,j)=0
vel(i,j)=0
T_velvec(j,i)=0
phi(i,j)=0
atf(i,j)=0
end do
end do
WRITE(*,*)".... CREATION OF 'correct_parameters.ini' ...."
WRITE(*,*) '....Reading Parameters....'
OPEN(22,FILE=path_parameters//'parameters.ini')
OPEN(23,FILE=path_parameters//'correct_parameters.ini')
READ(22,*)datachar
WRITE(23,*)datachar
READ(22,*)xdec
WRITE(23,*)xdec+50
READ(22,*)datachar
WRITE(23,*)datachar
READ(22,*)ydec
WRITE(23,*)ydec
READ(22,*)datachar
WRITE(23,*)datachar
READ(22,*)height
WRITE(23,*)height
READ(22,*)datachar
WRITE(23,*)datachar
READ(22,*)width
WRITE(23,*)width
READ(22,*)datachar
WRITE(23,*)datachar
READ(22,*)nxdeb,nxfin
WRITE(23,*)nxdeb,nxfin
READ(22,*)datachar
WRITE(23,*)datachar
READ(22,*)nydeb,nyfin
WRITE(23,*)nydeb,nyfin
CLOSE(22)
xdec = xdec+50.
CLOSE(23)
WRITE(*,*)".... CREATION OF 'correct_parameters.ini' COMPLETE ...."
WRITE(*,*) 'xdec(+50)=',xdec
WRITE(*,*)".... CREATION OF SET OF 'CorrectedFile.ini' ...."
WRITE(*,*) '....Correction of Coordinates....'
OPEN(24,FILE=path_filenumber//'filenumbers.dat')
OPEN(46,FILE=path_data//'Datafile.dat')
DO i=1,Nx
READ(24,*)filenumber
OPEN(25,FILE=path_rawdata//'File'//filenumber//'.dat')
READ(25,*)lone
READ(25,*)ltwo
READ(25,*)lthree
DO ival=1,Raw_No
READ(25,*) Xcord,Ycord,u,v,s
xuv(ival)=-1.*Ycord - xdec
yuv(ival)=Xcord - ydec
velu(ival) = -1.*v
velv(ival) = u
IF ( yuv(ival) .GT. 98.0 .AND. yuv(ival) .LT. 99.0 ) THEN
IF ( xuv(ival) .LT. 50.0 .AND. xuv(ival) .GT. -49.0 ) THEN
WRITE(46,*)xuv(ival),velv(ival)
END IF
END IF
END DO
CLOSE(25)
END DO
CLOSE(46)
CLOSE(24)
WRITE(*,*)".... CREATION OF 'Datafile.dat' COMPLETE ...."
OPEN(36,FILE=path_data//'Datafile.dat')
DO ifile=1,Nx
sumvel=0
DO ival=1,Vx
READ(36,*)x,w
sp(ival)=x
vel(ifile,ival)=w
END DO
END DO
DO ival=1,Vx
sumvel=0
DO ifile=1,Nx
sumvel=sumvel+vel(ifile,ival)
END DO
meanvel(ival)=sumvel/Nx
END DO
DO ifile=1,Nx
DO ival=1,Vx
velvec(ifile,ival)=meanvel(ival)-vel(ifile,ival)
END DO
END DO
DO ix0 = 1,Vx
DO ix1 = 1,Vx
correl(ix0,ix1) = 0.
ENDDO
ENDDO
DO it= 1,Nx
DO ix0 = 1,Vx
DO ix1 = 1,Vx
correl(ix0,ix1) =correl(ix0,ix1)+velvec(it,ix0)*velvec(it,ix1)
ENDDO
ENDDO
END DO
DO ix0 = 1,Vx
DO ix1 = 1,Vx
correl(ix1,ix0) = correl(ix1,ix0)/FLOAT(Nx)
ENDDO
ENDDO
DO ix0 = 1,Vx
DO ix1 = 1,Vx
Aeg(ix0,ix1)=correl(ix0,ix1)
ENDDO
ENDDO
WRITE(*,*) 'Number of values in matrix_three=',SIZE(Aeg)
CALL dsyev('V','U',Vx,Aeg,Vx,vp,WORK,LWORK,INFO)
IF (INFO.ne.0) then
WRITE (*,*) 'INFO = ',INFO
STOP
END IF
DO k=1,Vx
DO l=1,Vx
evec(k,l)=Aeg(k,Vx+1-l)
END DO
END DO
DO imode=1,Vx
lambda(imode)=vp(Vx+1-imode)
IF (lambda(imode).LT.0.) THEN
WRITE(*,*)'Attention,valeur propre negative'
WRITE(*,*)k
END IF
END DO
!***********************************************************************************
****************************************
WRITE(*,*) '.... CREATTION OF "lamda.dat" ....'
OPEN(41,FILE=path_lamda//'lamda.dat')
OPEN(81,FILE=path_lamda//'loglamda.dat')
DO imode=1,Vx
WRITE(41,*)imode,lambda(imode)
WRITE(81,*)log(float(imode)),log(lambda(imode))
END DO
CLOSE(41)
CLOSE(81)
WRITE(*,*) '.... CREATTION OF "lambda.dat" COMPLETE ....'
!***********************************************************************************
****************************************
WRITE(*,*) '.... CREATTION OF "eigenvectors.dat" ....'
OPEN(42,FILE=path_filenumber//'filenumbers.dat')
DO imode=1,Vx
READ(42,*)filenumber
OPEN(43,FILE=path_eigenvectors//'eigenvectors'//filenumber//'.dat')
DO ival=1,Vx
WRITE(43,121)(sp(ival))/height,evec(ival,imode)
END DO
CLOSE(43)
END DO
CLOSE(42)
WRITE(*,*) '.... CREATTION OF SET OF "eigenvectors.dat" COMPLETE ....'
121 FORMAT (8(e20.6,2X))
!***********************************************************************************
****************************************
WRITE(*,*) '.... CALCULATION OF MODS ....'
!DO imod = 1,Vx
!rms = 0.
!DO it=1,Nx
!av(it,imod)=0.
!DO ix=1,Vx
!av(it,imod) = av(it,imod)+evec(ix,imod)*velvec(it,ix)
!ENDDO
!rms = rms+av(it,imod)**2
!ENDDO
!rms = rms/FLOAT(Nx)
!WRITE(*,*)rms,lambda(imod)
!ENDDO
!OPEN(64,FILE=path_filenumber//'filenumbers.dat')
!DO it=1,Nx
!READ(64,*)filenumber
!OPEN(45,FILE=path_phi//'Phi'//filenumber//'.dat')
!DO imod = 1,Vx
! WRITE(45,122)av(it,imod),(av(it,imod)/SQRT(lambda(imod)))
!END DO
!END DO
!CLOSE(45)
!CLOSE(64)
!122 FORMAT (40(e20.6,2X))
DO ifile=1,Nx
DO ival=1,Vx
at=0
DO imode=1,Vx
ti=velvec(ifile,ival)*evec(ival,imode)
at=at+ti
END DO
atf(ifile,ival)=at
END DO
END DO
DO ival=1,Vx
pval=0
DO ifile=1,Nx
pvali=atf(ifile,ival)
pval=pval+pvali
END DO
prephi(ival)=pval
END DO
DO imode=1,Vx
DO ival=1,Vx
phi(ival,imode)=evec(ival,imode)*prephi(ival)
END DO
END DO
OPEN(64,FILE=path_filenumber//'filenumbers.dat')
DO imode=1,Vx
READ(64,*)filenumber
OPEN(45,FILE=path_phi//'Phi'//filenumber//'.dat')
DO ival=1,Vx
WRITE(45,*)sp(ival),phi(ival,imode)
END DO
CLOSE(45)
END DO
CLOSE(64)
WRITE(*,*) '.... CREATTION OF SET OF "Phi.dat" SUCCESSFUL ....'
!***********************************************************************************
****************************************
WRITE(*,*) '.... FORTRAN_POD SUCCESSFUL ....'
END PROGRAM pod

More Related Content

What's hot

The Ring programming language version 1.9 book - Part 38 of 210
The Ring programming language version 1.9 book - Part 38 of 210The Ring programming language version 1.9 book - Part 38 of 210
The Ring programming language version 1.9 book - Part 38 of 210
Mahmoud Samir Fayed
 
Cg my own programs
Cg my own programsCg my own programs
Cg my own programsAmit Kapoor
 
The Ring programming language version 1.6 book - Part 44 of 189
The Ring programming language version 1.6 book - Part 44 of 189The Ring programming language version 1.6 book - Part 44 of 189
The Ring programming language version 1.6 book - Part 44 of 189
Mahmoud Samir Fayed
 
第一回 冬のスイッチ大勉強会 - XBee編 -
第一回 冬のスイッチ大勉強会 - XBee編 -第一回 冬のスイッチ大勉強会 - XBee編 -
第一回 冬のスイッチ大勉強会 - XBee編 -
Wataru Kani
 
The Ring programming language version 1.8 book - Part 35 of 202
The Ring programming language version 1.8 book - Part 35 of 202The Ring programming language version 1.8 book - Part 35 of 202
The Ring programming language version 1.8 book - Part 35 of 202
Mahmoud Samir Fayed
 
Oops in c++
Oops in c++Oops in c++
Oops in c++
DravidSh
 
Wap in c to draw a line using DDA algorithm
Wap in c to draw a line using DDA algorithmWap in c to draw a line using DDA algorithm
Wap in c to draw a line using DDA algorithm
Kapil Pandit
 
Tabla de _derivadas
Tabla de _derivadasTabla de _derivadas
Tabla de _derivadas
edusucina
 
The Ring programming language version 1.4 book - Part 8 of 30
The Ring programming language version 1.4 book - Part 8 of 30The Ring programming language version 1.4 book - Part 8 of 30
The Ring programming language version 1.4 book - Part 8 of 30
Mahmoud Samir Fayed
 
ES6(ES2015) is beautiful
ES6(ES2015) is beautifulES6(ES2015) is beautiful
ES6(ES2015) is beautiful
monikagupta18jan
 
The Ring programming language version 1.3 book - Part 32 of 88
The Ring programming language version 1.3 book - Part 32 of 88The Ring programming language version 1.3 book - Part 32 of 88
The Ring programming language version 1.3 book - Part 32 of 88
Mahmoud Samir Fayed
 
D3 svg & angular
D3 svg & angularD3 svg & angular
D3 svg & angular
500Tech
 
computer graphics practicals
computer graphics practicalscomputer graphics practicals
computer graphics practicals
Manoj Chauhan
 
Tabla derivadas
Tabla derivadasTabla derivadas
Tabla derivadas
a99carlitos
 
How to extend map? Or why we need collections redesign? - Scalar 2017
How to extend map? Or why we need collections redesign? - Scalar 2017How to extend map? Or why we need collections redesign? - Scalar 2017
How to extend map? Or why we need collections redesign? - Scalar 2017
Szymon Matejczyk
 
Computer Graphics Lab File C Programs
Computer Graphics Lab File C ProgramsComputer Graphics Lab File C Programs
Computer Graphics Lab File C Programs
Kandarp Tiwari
 
ECMAScript 6 major changes
ECMAScript 6 major changesECMAScript 6 major changes
ECMAScript 6 major changeshayato
 
Exploring Color Spaces
 with Gesture Tracking and Smart Bulbs (Distill 2014)
Exploring Color Spaces
 with Gesture Tracking and Smart Bulbs (Distill 2014)Exploring Color Spaces
 with Gesture Tracking and Smart Bulbs (Distill 2014)
Exploring Color Spaces
 with Gesture Tracking and Smart Bulbs (Distill 2014)
Daniel Luxemburg
 
Hitchhiker's Guide to Functional Programming
Hitchhiker's Guide to Functional ProgrammingHitchhiker's Guide to Functional Programming
Hitchhiker's Guide to Functional Programming
Sergey Shishkin
 

What's hot (20)

The Ring programming language version 1.9 book - Part 38 of 210
The Ring programming language version 1.9 book - Part 38 of 210The Ring programming language version 1.9 book - Part 38 of 210
The Ring programming language version 1.9 book - Part 38 of 210
 
Cg my own programs
Cg my own programsCg my own programs
Cg my own programs
 
The Ring programming language version 1.6 book - Part 44 of 189
The Ring programming language version 1.6 book - Part 44 of 189The Ring programming language version 1.6 book - Part 44 of 189
The Ring programming language version 1.6 book - Part 44 of 189
 
第一回 冬のスイッチ大勉強会 - XBee編 -
第一回 冬のスイッチ大勉強会 - XBee編 -第一回 冬のスイッチ大勉強会 - XBee編 -
第一回 冬のスイッチ大勉強会 - XBee編 -
 
The Ring programming language version 1.8 book - Part 35 of 202
The Ring programming language version 1.8 book - Part 35 of 202The Ring programming language version 1.8 book - Part 35 of 202
The Ring programming language version 1.8 book - Part 35 of 202
 
Oops in c++
Oops in c++Oops in c++
Oops in c++
 
Wap in c to draw a line using DDA algorithm
Wap in c to draw a line using DDA algorithmWap in c to draw a line using DDA algorithm
Wap in c to draw a line using DDA algorithm
 
Tabla de _derivadas
Tabla de _derivadasTabla de _derivadas
Tabla de _derivadas
 
The Ring programming language version 1.4 book - Part 8 of 30
The Ring programming language version 1.4 book - Part 8 of 30The Ring programming language version 1.4 book - Part 8 of 30
The Ring programming language version 1.4 book - Part 8 of 30
 
ES6(ES2015) is beautiful
ES6(ES2015) is beautifulES6(ES2015) is beautiful
ES6(ES2015) is beautiful
 
The Ring programming language version 1.3 book - Part 32 of 88
The Ring programming language version 1.3 book - Part 32 of 88The Ring programming language version 1.3 book - Part 32 of 88
The Ring programming language version 1.3 book - Part 32 of 88
 
D3 svg & angular
D3 svg & angularD3 svg & angular
D3 svg & angular
 
computer graphics practicals
computer graphics practicalscomputer graphics practicals
computer graphics practicals
 
ts
tsts
ts
 
Tabla derivadas
Tabla derivadasTabla derivadas
Tabla derivadas
 
How to extend map? Or why we need collections redesign? - Scalar 2017
How to extend map? Or why we need collections redesign? - Scalar 2017How to extend map? Or why we need collections redesign? - Scalar 2017
How to extend map? Or why we need collections redesign? - Scalar 2017
 
Computer Graphics Lab File C Programs
Computer Graphics Lab File C ProgramsComputer Graphics Lab File C Programs
Computer Graphics Lab File C Programs
 
ECMAScript 6 major changes
ECMAScript 6 major changesECMAScript 6 major changes
ECMAScript 6 major changes
 
Exploring Color Spaces
 with Gesture Tracking and Smart Bulbs (Distill 2014)
Exploring Color Spaces
 with Gesture Tracking and Smart Bulbs (Distill 2014)Exploring Color Spaces
 with Gesture Tracking and Smart Bulbs (Distill 2014)
Exploring Color Spaces
 with Gesture Tracking and Smart Bulbs (Distill 2014)
 
Hitchhiker's Guide to Functional Programming
Hitchhiker's Guide to Functional ProgrammingHitchhiker's Guide to Functional Programming
Hitchhiker's Guide to Functional Programming
 

Similar to PROGRAM pod

Create a java project that - Draw a circle with three random init.pdf
Create a java project that - Draw a circle with three random init.pdfCreate a java project that - Draw a circle with three random init.pdf
Create a java project that - Draw a circle with three random init.pdf
arihantmobileselepun
 
Definition ofvectorspace
Definition ofvectorspaceDefinition ofvectorspace
Definition ofvectorspace
Tanuj Parikh
 
Array
ArrayArray
FINAL PROJECT, MATH 251, FALL 2015[The project is Due Mond.docx
FINAL PROJECT, MATH 251, FALL 2015[The project is Due Mond.docxFINAL PROJECT, MATH 251, FALL 2015[The project is Due Mond.docx
FINAL PROJECT, MATH 251, FALL 2015[The project is Due Mond.docx
voversbyobersby
 
Introduction to Neural Networks and Deep Learning from Scratch
Introduction to Neural Networks and Deep Learning from ScratchIntroduction to Neural Networks and Deep Learning from Scratch
Introduction to Neural Networks and Deep Learning from Scratch
Ahmed BESBES
 
Jscex: Write Sexy JavaScript (中文)
Jscex: Write Sexy JavaScript (中文)Jscex: Write Sexy JavaScript (中文)
Jscex: Write Sexy JavaScript (中文)jeffz
 
Using R Tool for Probability and Statistics
Using R Tool for Probability and Statistics Using R Tool for Probability and Statistics
Using R Tool for Probability and Statistics
nazlitemu
 
Calculus Homework Help
Calculus Homework HelpCalculus Homework Help
Calculus Homework Help
Maths Assignment Help
 
Jscex: Write Sexy JavaScript
Jscex: Write Sexy JavaScriptJscex: Write Sexy JavaScript
Jscex: Write Sexy JavaScriptjeffz
 
SaveI need help with this maze gui that I wrote in java, I am tryi.pdf
SaveI need help with this maze gui that I wrote in java, I am tryi.pdfSaveI need help with this maze gui that I wrote in java, I am tryi.pdf
SaveI need help with this maze gui that I wrote in java, I am tryi.pdf
arihantstoneart
 
深入浅出Jscex
深入浅出Jscex深入浅出Jscex
深入浅出Jscexjeffz
 
Ch4
Ch4Ch4
2 vectors notes
2 vectors notes2 vectors notes
2 vectors notes
Vinh Nguyen Xuan
 
Scope Graphs: A fresh look at name binding in programming languages
Scope Graphs: A fresh look at name binding in programming languagesScope Graphs: A fresh look at name binding in programming languages
Scope Graphs: A fresh look at name binding in programming languages
Eelco Visser
 
Introduction to R programming
Introduction to R programmingIntroduction to R programming
Introduction to R programming
Alberto Labarga
 
The Ring programming language version 1.4 book - Part 18 of 30
The Ring programming language version 1.4 book - Part 18 of 30The Ring programming language version 1.4 book - Part 18 of 30
The Ring programming language version 1.4 book - Part 18 of 30
Mahmoud Samir Fayed
 
Building fast interpreters in Rust
Building fast interpreters in RustBuilding fast interpreters in Rust
Building fast interpreters in Rust
Ingvar Stepanyan
 
The Ring programming language version 1.3 book - Part 50 of 88
The Ring programming language version 1.3 book - Part 50 of 88The Ring programming language version 1.3 book - Part 50 of 88
The Ring programming language version 1.3 book - Part 50 of 88
Mahmoud Samir Fayed
 

Similar to PROGRAM pod (20)

Create a java project that - Draw a circle with three random init.pdf
Create a java project that - Draw a circle with three random init.pdfCreate a java project that - Draw a circle with three random init.pdf
Create a java project that - Draw a circle with three random init.pdf
 
Definition ofvectorspace
Definition ofvectorspaceDefinition ofvectorspace
Definition ofvectorspace
 
Ssaw08 0624
Ssaw08 0624Ssaw08 0624
Ssaw08 0624
 
Array
ArrayArray
Array
 
Disjoint sets
Disjoint setsDisjoint sets
Disjoint sets
 
FINAL PROJECT, MATH 251, FALL 2015[The project is Due Mond.docx
FINAL PROJECT, MATH 251, FALL 2015[The project is Due Mond.docxFINAL PROJECT, MATH 251, FALL 2015[The project is Due Mond.docx
FINAL PROJECT, MATH 251, FALL 2015[The project is Due Mond.docx
 
Introduction to Neural Networks and Deep Learning from Scratch
Introduction to Neural Networks and Deep Learning from ScratchIntroduction to Neural Networks and Deep Learning from Scratch
Introduction to Neural Networks and Deep Learning from Scratch
 
Jscex: Write Sexy JavaScript (中文)
Jscex: Write Sexy JavaScript (中文)Jscex: Write Sexy JavaScript (中文)
Jscex: Write Sexy JavaScript (中文)
 
Using R Tool for Probability and Statistics
Using R Tool for Probability and Statistics Using R Tool for Probability and Statistics
Using R Tool for Probability and Statistics
 
Calculus Homework Help
Calculus Homework HelpCalculus Homework Help
Calculus Homework Help
 
Jscex: Write Sexy JavaScript
Jscex: Write Sexy JavaScriptJscex: Write Sexy JavaScript
Jscex: Write Sexy JavaScript
 
SaveI need help with this maze gui that I wrote in java, I am tryi.pdf
SaveI need help with this maze gui that I wrote in java, I am tryi.pdfSaveI need help with this maze gui that I wrote in java, I am tryi.pdf
SaveI need help with this maze gui that I wrote in java, I am tryi.pdf
 
深入浅出Jscex
深入浅出Jscex深入浅出Jscex
深入浅出Jscex
 
Ch4
Ch4Ch4
Ch4
 
2 vectors notes
2 vectors notes2 vectors notes
2 vectors notes
 
Scope Graphs: A fresh look at name binding in programming languages
Scope Graphs: A fresh look at name binding in programming languagesScope Graphs: A fresh look at name binding in programming languages
Scope Graphs: A fresh look at name binding in programming languages
 
Introduction to R programming
Introduction to R programmingIntroduction to R programming
Introduction to R programming
 
The Ring programming language version 1.4 book - Part 18 of 30
The Ring programming language version 1.4 book - Part 18 of 30The Ring programming language version 1.4 book - Part 18 of 30
The Ring programming language version 1.4 book - Part 18 of 30
 
Building fast interpreters in Rust
Building fast interpreters in RustBuilding fast interpreters in Rust
Building fast interpreters in Rust
 
The Ring programming language version 1.3 book - Part 50 of 88
The Ring programming language version 1.3 book - Part 50 of 88The Ring programming language version 1.3 book - Part 50 of 88
The Ring programming language version 1.3 book - Part 50 of 88
 

PROGRAM pod

  • 1. PROGRAM pod IMPLICIT NONE INTEGER :: i,j,Nx,Raw_No,Vx,INFO,a,b,c,k,l,LWORK,n,imod,it,ix,nxdeb,nxfin,nydeb,nyfin,Vxmax,ix1 ,ix0,imode,ival,ifile REAL :: Xcord,Ycord,u,v,s,waste,sumvel,x,w,pval,pvali,ti,at,array,valuemtx,summ,rms REAL :: xdec,ydec,height,width,Xhcord,Yhcord,hu,hv,hs PARAMETER(Nx=2000,Raw_No=5084,Vx=48,LWORK=3*Vx,Vxmax=62) REAL :: xuv(Raw_No),yuv(Raw_No),velu(Raw_No),velv(Raw_No) REAL :: sp(Vx),velvec(Nx,Vx),T_velvec(Vx,Nx),meanvel(Nx),vel(Nx,Vx) REAL :: lambda(Vx),mods(Vx),modsum(Vx),normmodsum(Vx),av(Nx,Vx) REAL :: atf(Nx,Vx),evec(Vx,Vx),phi(Nx,Vx),prephi(Vx),correl(Vx,Vx) CHARACTER (LEN=4) :: filenumber CHARACTER (LEN=100) :: datachar CHARACTER (LEN=100) :: lone CHARACTER (LEN=100) :: ltwo CHARACTER (LEN=100) :: lthree DOUBLE PRECISION :: WORK(LWORK) DOUBLE PRECISION :: vp(LWORK) DOUBLE PRECISION :: Aeg(Vx,Vx) CHARACTER(*), PARAMETER :: path_data ='/home/sbhattac/Bureau/Fortran_POD/' CHARACTER(*), PARAMETER :: path_filenumber ='/home/sbhattac/Bureau/Fortran_POD/FileNumber/' CHARACTER(*), PARAMETER :: path_parameters ='/home/sbhattac/Bureau/Fortran_POD/Parameters/' CHARACTER(*), PARAMETER :: path_rawdata ='/home/sbhattac/Bureau/Fortran_POD/Raw_Data/' CHARACTER(*), PARAMETER :: path_correctedfile ='/home/sbhattac/Bureau/Fortran_POD/Corrected_Data/' CHARACTER(*), PARAMETER :: path_snapshot ='/home/sbhattac/Bureau/Fortran_POD/Snapshot_Files/' CHARACTER(*), PARAMETER :: path_egvec ='/home/sbhattac/Bureau/Fortran_POD/Egvec_Files/' CHARACTER(*), PARAMETER :: path_phi ='/home/sbhattac/Bureau/Fortran_POD/Phi_Files/' CHARACTER(*), PARAMETER :: path_lamda ='/home/sbhattac/Bureau/Fortran_POD/Lamda_Files/' CHARACTER(*), PARAMETER :: path_eigenvectors ='/home/sbhattac/Bureau/Fortran_POD/Eigenvectors_Files/' do i=1,Nx do j=1,Vx velvec(i,j)=0 vel(i,j)=0 T_velvec(j,i)=0 phi(i,j)=0 atf(i,j)=0 end do end do WRITE(*,*)".... CREATION OF 'correct_parameters.ini' ...." WRITE(*,*) '....Reading Parameters....' OPEN(22,FILE=path_parameters//'parameters.ini') OPEN(23,FILE=path_parameters//'correct_parameters.ini') READ(22,*)datachar WRITE(23,*)datachar
  • 2. READ(22,*)xdec WRITE(23,*)xdec+50 READ(22,*)datachar WRITE(23,*)datachar READ(22,*)ydec WRITE(23,*)ydec READ(22,*)datachar WRITE(23,*)datachar READ(22,*)height WRITE(23,*)height READ(22,*)datachar WRITE(23,*)datachar READ(22,*)width WRITE(23,*)width READ(22,*)datachar WRITE(23,*)datachar READ(22,*)nxdeb,nxfin WRITE(23,*)nxdeb,nxfin READ(22,*)datachar WRITE(23,*)datachar READ(22,*)nydeb,nyfin WRITE(23,*)nydeb,nyfin CLOSE(22) xdec = xdec+50. CLOSE(23) WRITE(*,*)".... CREATION OF 'correct_parameters.ini' COMPLETE ...." WRITE(*,*) 'xdec(+50)=',xdec WRITE(*,*)".... CREATION OF SET OF 'CorrectedFile.ini' ...." WRITE(*,*) '....Correction of Coordinates....' OPEN(24,FILE=path_filenumber//'filenumbers.dat') OPEN(46,FILE=path_data//'Datafile.dat') DO i=1,Nx READ(24,*)filenumber OPEN(25,FILE=path_rawdata//'File'//filenumber//'.dat') READ(25,*)lone READ(25,*)ltwo READ(25,*)lthree
  • 3. DO ival=1,Raw_No READ(25,*) Xcord,Ycord,u,v,s xuv(ival)=-1.*Ycord - xdec yuv(ival)=Xcord - ydec velu(ival) = -1.*v velv(ival) = u IF ( yuv(ival) .GT. 98.0 .AND. yuv(ival) .LT. 99.0 ) THEN IF ( xuv(ival) .LT. 50.0 .AND. xuv(ival) .GT. -49.0 ) THEN WRITE(46,*)xuv(ival),velv(ival) END IF END IF END DO CLOSE(25) END DO CLOSE(46) CLOSE(24) WRITE(*,*)".... CREATION OF 'Datafile.dat' COMPLETE ...." OPEN(36,FILE=path_data//'Datafile.dat') DO ifile=1,Nx sumvel=0 DO ival=1,Vx READ(36,*)x,w sp(ival)=x vel(ifile,ival)=w END DO END DO DO ival=1,Vx sumvel=0 DO ifile=1,Nx sumvel=sumvel+vel(ifile,ival) END DO meanvel(ival)=sumvel/Nx END DO DO ifile=1,Nx DO ival=1,Vx velvec(ifile,ival)=meanvel(ival)-vel(ifile,ival) END DO END DO DO ix0 = 1,Vx DO ix1 = 1,Vx correl(ix0,ix1) = 0. ENDDO ENDDO DO it= 1,Nx DO ix0 = 1,Vx DO ix1 = 1,Vx correl(ix0,ix1) =correl(ix0,ix1)+velvec(it,ix0)*velvec(it,ix1) ENDDO ENDDO END DO DO ix0 = 1,Vx DO ix1 = 1,Vx correl(ix1,ix0) = correl(ix1,ix0)/FLOAT(Nx) ENDDO
  • 4. ENDDO DO ix0 = 1,Vx DO ix1 = 1,Vx Aeg(ix0,ix1)=correl(ix0,ix1) ENDDO ENDDO WRITE(*,*) 'Number of values in matrix_three=',SIZE(Aeg) CALL dsyev('V','U',Vx,Aeg,Vx,vp,WORK,LWORK,INFO) IF (INFO.ne.0) then WRITE (*,*) 'INFO = ',INFO STOP END IF DO k=1,Vx DO l=1,Vx evec(k,l)=Aeg(k,Vx+1-l) END DO END DO DO imode=1,Vx lambda(imode)=vp(Vx+1-imode) IF (lambda(imode).LT.0.) THEN WRITE(*,*)'Attention,valeur propre negative' WRITE(*,*)k END IF END DO !*********************************************************************************** **************************************** WRITE(*,*) '.... CREATTION OF "lamda.dat" ....' OPEN(41,FILE=path_lamda//'lamda.dat') OPEN(81,FILE=path_lamda//'loglamda.dat') DO imode=1,Vx WRITE(41,*)imode,lambda(imode) WRITE(81,*)log(float(imode)),log(lambda(imode)) END DO CLOSE(41) CLOSE(81) WRITE(*,*) '.... CREATTION OF "lambda.dat" COMPLETE ....' !*********************************************************************************** **************************************** WRITE(*,*) '.... CREATTION OF "eigenvectors.dat" ....' OPEN(42,FILE=path_filenumber//'filenumbers.dat') DO imode=1,Vx READ(42,*)filenumber OPEN(43,FILE=path_eigenvectors//'eigenvectors'//filenumber//'.dat') DO ival=1,Vx WRITE(43,121)(sp(ival))/height,evec(ival,imode) END DO CLOSE(43) END DO CLOSE(42) WRITE(*,*) '.... CREATTION OF SET OF "eigenvectors.dat" COMPLETE ....'
  • 5. 121 FORMAT (8(e20.6,2X)) !*********************************************************************************** **************************************** WRITE(*,*) '.... CALCULATION OF MODS ....' !DO imod = 1,Vx !rms = 0. !DO it=1,Nx !av(it,imod)=0. !DO ix=1,Vx !av(it,imod) = av(it,imod)+evec(ix,imod)*velvec(it,ix) !ENDDO !rms = rms+av(it,imod)**2 !ENDDO !rms = rms/FLOAT(Nx) !WRITE(*,*)rms,lambda(imod) !ENDDO !OPEN(64,FILE=path_filenumber//'filenumbers.dat') !DO it=1,Nx !READ(64,*)filenumber !OPEN(45,FILE=path_phi//'Phi'//filenumber//'.dat') !DO imod = 1,Vx ! WRITE(45,122)av(it,imod),(av(it,imod)/SQRT(lambda(imod))) !END DO !END DO !CLOSE(45) !CLOSE(64) !122 FORMAT (40(e20.6,2X)) DO ifile=1,Nx DO ival=1,Vx at=0 DO imode=1,Vx ti=velvec(ifile,ival)*evec(ival,imode) at=at+ti END DO atf(ifile,ival)=at END DO END DO DO ival=1,Vx pval=0 DO ifile=1,Nx pvali=atf(ifile,ival) pval=pval+pvali END DO prephi(ival)=pval END DO DO imode=1,Vx DO ival=1,Vx phi(ival,imode)=evec(ival,imode)*prephi(ival) END DO END DO OPEN(64,FILE=path_filenumber//'filenumbers.dat') DO imode=1,Vx
  • 6. READ(64,*)filenumber OPEN(45,FILE=path_phi//'Phi'//filenumber//'.dat') DO ival=1,Vx WRITE(45,*)sp(ival),phi(ival,imode) END DO CLOSE(45) END DO CLOSE(64) WRITE(*,*) '.... CREATTION OF SET OF "Phi.dat" SUCCESSFUL ....' !*********************************************************************************** **************************************** WRITE(*,*) '.... FORTRAN_POD SUCCESSFUL ....' END PROGRAM pod