Unverified Commit e7917ad5 authored by Andreas Marek's avatar Andreas Marek
Browse files

Fortran test programs can now write eigenvalues and eigenvectors to

files
parent 069b84b3
......@@ -123,6 +123,8 @@ program test_complex
#endif
type(output_t) :: write_to_file
logical :: success
character(len=8) :: task_suffix
integer(kind=ik) :: j
success = .true.
! read input parameters if they are provided
......@@ -275,13 +277,16 @@ program test_complex
if(myid == 0) print *,'Total time (sum above):',time_evp_back+time_evp_solve+time_evp_fwd
if(write_to_file%eigenvectors) then
if (myid == 0) then
open(17,file="EVs_complex_out.txt",form='formatted',status='new')
do i=1,na
write(17,*) i,ev(i)
enddo
close(17)
endif
write(unit = task_suffix, fmt = '(i8.8)') myid
open(17,file="EVs_complex_out_task_"//task_suffix(1:8)//".txt",form='formatted',status='new')
write(17,*) "Part of eigenvectors: na_rows=",na_rows,"of na=",na," na_cols=",na_cols," of na=",na
do i=1,na_rows
do j=1,na_cols
write(17,*) "row=",i," col=",j," element of eigenvector=",z(i,j)
enddo
enddo
close(17)
endif
if(write_to_file%eigenvalues) then
......
......@@ -132,6 +132,8 @@ program test_complex2
#endif
type(output_t) :: write_to_file
logical :: success
character(len=8) :: task_suffix
integer(kind=ik) :: j
success = .true.
......@@ -277,13 +279,16 @@ program test_complex2
if(myid == 0) print *,'Total time (sum above) :',time_evp_back+time_evp_solve+time_evp_fwd
if(write_to_file%eigenvectors) then
if (myid == 0) then
open(17,file="EVs_complex2_out.txt",form='formatted',status='new')
do i=1,na
write(17,*) i,ev(i)
enddo
close(17)
endif
write(unit = task_suffix, fmt = '(i8.8)') myid
open(17,file="EVs_complex2_out_task_"//task_suffix(1:8)//".txt",form='formatted',status='new')
write(17,*) "Part of eigenvectors: na_rows=",na_rows,"of na=",na," na_cols=",na_cols," of na=",na
do i=1,na_rows
do j=1,na_cols
write(17,*) "row=",i," col=",j," element of eigenvector=",z(i,j)
enddo
enddo
close(17)
endif
if(write_to_file%eigenvalues) then
if (myid == 0) then
......
......@@ -135,6 +135,8 @@ program test_complex2
#endif
type(output_t) :: write_to_file
logical :: success
character(len=8) :: task_suffix
integer(kind=ik) :: j
success = .true.
......@@ -301,13 +303,16 @@ program test_complex2
if(myid == 0) print *,'Total time (sum above) :',time_evp_back+time_evp_solve+time_evp_fwd
if(write_to_file%eigenvectors) then
if (myid == 0) then
open(17,file="EVs_complex2_out.txt",form='formatted',status='new')
do i=1,na
write(17,*) i,ev(i)
enddo
close(17)
endif
write(unit = task_suffix, fmt = '(i8.8)') myid
open(17,file="EVs_complex2_out_task_"//task_suffix(1:8)//".txt",form='formatted',status='new')
write(17,*) "Part of eigenvectors: na_rows=",na_rows,"of na=",na," na_cols=",na_cols," of na=",na
do i=1,na_rows
do j=1,na_cols
write(17,*) "row=",i," col=",j," element of eigenvector=",z(i,j)
enddo
enddo
close(17)
endif
if(write_to_file%eigenvalues) then
......
......@@ -134,6 +134,8 @@ program test_complex2
#endif
type(output_t) :: write_to_file
logical :: success
character(len=8) :: task_suffix
integer(kind=ik) :: j
success = .true.
......@@ -302,13 +304,16 @@ program test_complex2
if(myid == 0) print *,'Total time (sum above) :',time_evp_back+time_evp_solve+time_evp_fwd
if(write_to_file%eigenvectors) then
if (myid == 0) then
open(17,file="EVs_complex2_out.txt",form='formatted',status='new')
do i=1,na
write(17,*) i,ev(i)
enddo
close(17)
endif
write(unit = task_suffix, fmt = '(i8.8)') myid
open(17,file="EVs_complex2_out_task_"//task_suffix(1:8)//".txt",form='formatted',status='new')
write(17,*) "Part of eigenvectors: na_rows=",na_rows,"of na=",na," na_cols=",na_cols," of na=",na
do i=1,na_rows
do j=1,na_cols
write(17,*) "row=",i," col=",j," element of eigenvector=",z(i,j)
enddo
enddo
close(17)
endif
if(write_to_file%eigenvalues) then
......
......@@ -124,9 +124,8 @@ program test_real
#endif
type(output_t) :: write_to_file
logical :: success
integer :: j
character(len=8) :: task_suffix
integer(kind=ik) :: j
!-------------------------------------------------------------------------------
success = .true.
......@@ -241,18 +240,6 @@ program test_real
!-------------------------------------------------------------------------------
! Calculate eigenvalues/eigenvectors
open(12,file="matrix.dat",form="formatted",status="new")
do i=1, na
do j=1,na
write(12,*) i,j,a(i,j)
enddo
enddo
do i=1, na
do j=1,na
write(12,*) i,j,z(i,j)
enddo
enddo
close(12)
if (myid==0) then
print '(a)','| Entering one-step ELPA solver ... '
print *
......@@ -280,15 +267,20 @@ program test_real
if(myid == 0) print *,'Time solve_tridi :',time_evp_solve
if(myid == 0) print *,'Time trans_ev_real :',time_evp_back
if(myid == 0) print *,'Total time (sum above):',time_evp_back+time_evp_solve+time_evp_fwd
if(write_to_file%eigenvectors) then
if (myid == 0) then
open(17,file="EVs_real_out.txt",form='formatted',status='new')
do i=1,na
write(17,*) i,ev(i)
enddo
close(17)
endif
write(unit = task_suffix, fmt = '(i8.8)') myid
open(17,file="EVs_real_out_task_"//task_suffix(1:8)//".txt",form='formatted',status='new')
write(17,*) "Part of eigenvectors: na_rows=",na_rows,"of na=",na," na_cols=",na_cols," of na=",na
do i=1,na_rows
do j=1,na_cols
write(17,*) "row=",i," col=",j," element of eigenvector=",z(i,j)
enddo
enddo
close(17)
endif
if(write_to_file%eigenvalues) then
if (myid == 0) then
open(17,file="Eigenvalues_real_out.txt",form='formatted',status='new')
......
......@@ -127,6 +127,8 @@ program test_real2
#endif
type(output_t) :: write_to_file
logical :: success
character(len=8) :: task_suffix
integer(kind=ik) :: j
success = .true.
......@@ -275,13 +277,16 @@ program test_real2
if(write_to_file%eigenvectors) then
if (myid == 0) then
open(17,file="EVs_real2_out.txt",form='formatted',status='new')
do i=1,na
write(17,*) i,ev(i)
enddo
close(17)
endif
write(unit = task_suffix, fmt = '(i8.8)') myid
open(17,file="EVs_real2_out_task_"//task_suffix(1:8)//".txt",form='formatted',status='new')
write(17,*) "Part of eigenvectors: na_rows=",na_rows,"of na=",na," na_cols=",na_cols," of na=",na
do i=1,na_rows
do j=1,na_cols
write(17,*) "row=",i," col=",j," element of eigenvector=",z(i,j)
enddo
enddo
close(17)
endif
if(write_to_file%eigenvalues) then
......
......@@ -131,6 +131,8 @@ program test_real2
#endif
type(output_t) :: write_to_file
logical :: success
character(len=8) :: task_suffix
integer(kind=ik) :: j
success = .true.
......@@ -296,13 +298,16 @@ program test_real2
if(myid == 0) print *,'Total time (sum above) :',time_evp_back+time_evp_solve+time_evp_fwd
if(write_to_file%eigenvectors) then
if (myid == 0) then
open(17,file="EVs_real2_out.txt",form='formatted',status='new')
do i=1,na
write(17,*) i,ev(i)
enddo
close(17)
endif
write(unit = task_suffix, fmt = '(i8.8)') myid
open(17,file="EVs_real2_out_task_"//task_suffix(1:8)//".txt",form='formatted',status='new')
write(17,*) "Part of eigenvectors: na_rows=",na_rows,"of na=",na," na_cols=",na_cols," of na=",na
do i=1,na_rows
do j=1,na_cols
write(17,*) "row=",i," col=",j," element of eigenvector=",z(i,j)
enddo
enddo
close(17)
endif
if(write_to_file%eigenvalues) then
......
......@@ -130,6 +130,8 @@ program test_real2
#endif
type(output_t) :: write_to_file
logical :: success
character(len=8) :: task_suffix
integer(kind=ik) :: j
success = .true.
......@@ -295,13 +297,16 @@ program test_real2
if(myid == 0) print *,'Total time (sum above) :',time_evp_back+time_evp_solve+time_evp_fwd
if(write_to_file%eigenvectors) then
if (myid == 0) then
open(17,file="EVs_real2_out.txt",form='formatted',status='new')
do i=1,na
write(17,*) i,ev(i)
enddo
close(17)
endif
write(unit = task_suffix, fmt = '(i8.8)') myid
open(17,file="EVs_real2_out_task_"//task_suffix(1:8)//".txt",form='formatted',status='new')
write(17,*) "Part of eigenvectors: na_rows=",na_rows,"of na=",na," na_cols=",na_cols," of na=",na
do i=1,na_rows
do j=1,na_cols
write(17,*) "row=",i," col=",j," element of eigenvector=",z(i,j)
enddo
enddo
close(17)
endif
if(write_to_file%eigenvalues) then
if (myid == 0) then
......
......@@ -131,6 +131,8 @@ program test_real2
#endif
type(output_t) :: write_to_file
logical :: success
character(len=8) :: task_suffix
integer(kind=ik) :: j
success = .true.
......@@ -306,13 +308,16 @@ program test_real2
if(myid == 0) print *,'Total time (sum above) :',time_evp_back+time_evp_solve+time_evp_fwd
if(write_to_file%eigenvectors) then
if (myid == 0) then
open(17,file="EVs_real2_out.txt",form='formatted',status='new')
do i=1,na
write(17,*) i,ev(i)
enddo
close(17)
endif
write(unit = task_suffix, fmt = '(i8.8)') myid
open(17,file="EVs_real2_out_task_"//task_suffix(1:8)//".txt",form='formatted',status='new')
write(17,*) "Part of eigenvectors: na_rows=",na_rows,"of na=",na," na_cols=",na_cols," of na=",na
do i=1,na_rows
do j=1,na_cols
write(17,*) "row=",i," col=",j," element of eigenvector=",z(i,j)
enddo
enddo
close(17)
endif
if(write_to_file%eigenvalues) then
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment