LCOV - code coverage report
Current view: top level - diagonalization - writeout.F90 (source / functions) Hit Total Coverage
Test: combined.info Lines: 0 25 0.0 %
Date: 2019-09-08 04:53:50 Functions: 0 1 0.0 %

          Line data    Source code
       1             : MODULE m_writeout
       2             : CONTAINS
       3             : 
       4           0 :   SUBROUTINE diag_writeout(smat,hmat)
       5             :     USE m_types_mat
       6             :     USE m_judft
       7             :     USE m_io_matrix
       8             :     USE m_types_mpimat
       9             :     IMPLICIT NONE
      10             :     CLASS(t_mat),INTENT(INOUT) :: hmat,smat
      11             :     !small subroutine that does only wite the matrix to a file
      12             :     INTEGER:: i,ii,irank,ierr,matsize
      13             :     CHARACTER(len=20)::filename
      14             : #ifdef CPP_MPI
      15             :     INCLUDE 'mpif.h'
      16           0 :     CALL MPI_COMM_RANK(MPI_COMM_WORLD,irank,ierr)
      17             : #else
      18             :     irank=0
      19             : #endif
      20             : 
      21             :     SELECT TYPE(hmat)
      22             :     TYPE is (t_mpimat)
      23           0 :        matsize=hmat%global_size1
      24             :     CLASS default
      25           0 :        matsize=hmat%matsize1
      26             :     END SELECT
      27             :     !First write binary file
      28             : #ifdef CPP_HDF
      29           0 :     i=open_matrix(hmat%l_real,matsize,2,2,"hs_mat")
      30             : #else
      31             :     i=open_matrix(hmat%l_real,hmat%matsize1,1,2,"hs_mat")
      32             : #endif
      33           0 :     CALL write_matrix(hmat,1,i)
      34           0 :     CALL write_matrix(smat,2,i)
      35           0 :     CALL close_matrix(i)
      36             : 
      37             :     !Now the formatted matrix
      38           0 :     WRITE(filename,"(a,i0)") "hmat",irank
      39           0 :     OPEN(999,file=TRIM(filename))
      40           0 :     WRITE(filename,"(a,i0)") "smat",irank
      41           0 :     OPEN(998,file=TRIM(filename))
      42           0 :     DO i=1,hmat%matsize2
      43           0 :        DO ii=1,hmat%matsize1
      44           0 :           IF (hmat%l_real) THEN
      45           0 :              WRITE(999,"(2i6,f15.6)") ii,i,hmat%data_r(ii,i)
      46           0 :              WRITE(998,"(2i6,f15.6)") ii,i,smat%data_r(ii,i)
      47             :           ELSE
      48           0 :              WRITE(999,"(2i6,2f15.6)") ii,i,hmat%data_c(ii,i)
      49           0 :              WRITE(998,"(2i6,2f15.6)") ii,i,smat%data_c(ii,i)
      50             :           ENDIF
      51             :        END DO
      52             :     ENDDO
      53           0 :     CLOSE(999)
      54           0 :     CLOSE(998)
      55             : #ifdef CPP_MPI
      56           0 :     CALL MPI_BARRIER(MPI_COMM_WORLD,ierr)
      57             : #endif
      58           0 :     CALL judft_error("STOP in eigen_diag:debug_diag")
      59           0 :   END SUBROUTINE diag_writeout
      60           0 : END MODULE m_writeout

Generated by: LCOV version 1.13