mkl: invalid value error exporing sparse matrix - fortran

The following program uses Intel MKL and creates a sparse matrix from the coordinate represenation, then the matrix is exported to the CSR format.
include 'mkl_spblas.f90'
program test
use iso_c_binding
use mkl_spblas
implicit none
complex(kind=kind(0.d0)) :: values(4)
integer :: columns(4)
integer :: rows(4)
TYPE(C_PTR) :: rows_start_csr, rows_end_csr, col_index_csr, values_csr
integer(C_INT) :: indexing_csr, nrows_csr, ncol_csr
type(SPARSE_MATRIX_T) :: handle
integer :: stat
! Matrix
!
! | 0 1 0 0 |
! | 1 0 0 0 |
! | 0 0 1 0 |
! | 0 0 0 1 |
values(1) = 1
rows(1) = 1
columns(1) = 2
values(2) = 1
rows(2) = 2
columns(2) = 1
values(3) = 1
rows(3) = 3
columns(3) = 3
values(4) = 1
rows(4) = 4
columns(4) = 4
stat = mkl_sparse_z_create_coo(handle, SPARSE_INDEX_BASE_ONE, 4, 4, 4, rows, columns, values)
write (*,*) 'stat after create = ', stat
stat = mkl_sparse_z_export_csr(handle, indexing_csr, nrows_csr, ncol_csr, rows_start_csr, rows_end_csr, col_index_csr, values_csr)
write (*,*) 'stat after export = ', stat, ' SPARSE_STATUS_INVALID_VALUE = ', SPARSE_STATUS_INVALID_VALUE
end program test
The output of the program is:
stat after create = 0
stat after export = 3 SPARSE_STATUS_INVALID_VALUE = 3
While after the matrix creation the status is OK, surprisingly, the status after exporting it corresponds to SPARSE_STATUS_INVALID_VALUE.
How can this possibly happens, and how to fix it?

You need to convert your COO format to CSR beforehand.
include 'mkl_spblas.f90'
program test
use iso_c_binding
use mkl_spblas
implicit none
complex(kind=kind(0.d0)) :: values(4)
integer :: columns(4)
integer :: rows(4)
TYPE(C_PTR) :: rows_start_csr, rows_end_csr, col_index_csr, values_csr
integer(C_INT) :: indexing_csr, nrows_csr, ncol_csr
type(SPARSE_MATRIX_T) :: coo, csr ! ===== NEW
integer :: stat
! Matrix
!
! | 0 1 0 0 |
! | 1 0 0 0 |
! | 0 0 1 0 |
! | 0 0 0 1 |
values(1) = 1
rows(1) = 1
columns(1) = 2
values(2) = 1
rows(2) = 2
columns(2) = 1
values(3) = 1
rows(3) = 3
columns(3) = 3
values(4) = 1
rows(4) = 4
columns(4) = 4
stat = mkl_sparse_z_create_coo(coo, SPARSE_INDEX_BASE_ONE, 4, 4, 4, rows, columns, values)
write (*,*) 'stat after create = ', stat
! ===== NEW ===== ->
stat = mkl_sparse_convert_csr(coo, SPARSE_OPERATION_NON_TRANSPOSE, csr)
write (*,*) 'stat after convert = ', stat
! ===== NEW ===== <-
stat = mkl_sparse_z_export_csr(csr, indexing_csr, nrows_csr, ncol_csr, rows_start_csr, rows_end_csr, col_index_csr, values_csr)
write (*,*) 'stat after export = ', stat, ' SPARSE_STATUS_INVALID_VALUE = ', SPARSE_STATUS_INVALID_VALUE
end program

Related

How to write to file elements of arrays in a particular pattern

I want to write to file elements of the three arrays: k= (/1, 2 /), kp = (/1, 2 /), w(k,kp) = (/1,2 ,3,4/)
in the following pattern, using Fortran:
k kp w(k,kp)
1 1 1
1 2 2
2 1 3
2 2 4
I know how to write for column "kp" and "w", but how can I write column "k" ?
I have my code as:
write(20,*) "k" , "kp", "W"
do i = 1,2
do j = 1, 2
write (20,*) k( ) kp(j) , W(i,j)
end do
end do
Is this homework problem?
program foo
implicit none
integer :: i, j, k(2) = [1,2], kp(2) = [1,2]
integer :: w(2,2) = reshape([1,3,2,4], [2,2])
do j = 1, 2
do i = 1, 2
write(*,'(*(1X,I0))') k(j), kp(i), w(k(j),kp(i))
end do
end do
end program foo

Find the sum of each rows and each columns

need to use SUM() and dim
the problem in the sum() algorithm does not calculate correctly, I can’t fix it, I need someone’s help
program main
use environment
implicit none
character(*), parameter :: input_file = "../data/input.txt", output_file = "output.txt"
integer :: In = 0, Out = 0, rows = 0, columns = 0!, i = 0
integer, allocatable :: A(:,:)
integer :: res_rows = 0, res_columns = 0
open (file=input_file, newunit=In)
read(In, *) rows, columns
allocate(A(rows, columns))
read (In, *) A
close (In)
res_rows = sum(A(1:columns+1,1), dim=1)
res_columns = sum(A(1:rows+1,1), dim=1)
!outout data
open (file=output_file, encoding=E_, newunit=Out, position='append')
write(*,*)"rows:",res_rows
write(*,*)"columns:",res_columns
close (Out)
end program main
input data from txt file
4 3
1 1 2
4 3 4
1 1 2
4 3 2
output data to txt file
rows: 4 11 4 9
columns: 10 8 10
Fortran is a column-major language. Your read(in,*) a is populating the matrix in the wrong order. Try writing out the first row of your matrix a. Your use of the sum intrinsic is also wrong. See below.
program main
implicit none
character(*), parameter :: input_file = "a.dat"
integer i, in, out, rows, columns
integer, allocatable :: a(:,:)
integer :: res_rows = 0, res_columns = 0
open(file=input_file, newunit=in, status='old')
read(in, *) rows, columns
allocate(a(rows, columns))
do i = 1, rows
read(in,*) a(i,:)
end do
close(in)
print '(A,4(1X,I0))', 'Sum of each row:', sum(a,dim=2)
do i = 1, rows
print '(3I3,A,I0)', a(i,:),' = ', sum(a(i,:))
end do
print *
print '(A,4(1X,I0))', 'Sum of each column:', sum(a,dim=1)
do i = 1, columns
print '(4I3,A,I0)', a(:,i),' = ',sum(a(:,i))
end do
end program main

Reading data from files using MPI in Fortran

I want to read data from some .dat files to a Fortran code for postprocessing. As a test case, I am just using one processor for MPI and trying to read single data file to my code. The content of the data file is as follows:
qout0050.dat : 1 1 1
However, the matrix (Vn in this case) which is supposed to store the content of this data file shows all 0 values. The relevant part of the code which reads from data file and store to the matrix is as follows:
subroutine postproc()
use precision_mod
use mpicomms_mod
implicit none
integer(kind=MPI_Offset_kind) :: i, j , igrid, k, l, disp, iproc, info, lwork
integer :: rst, numvar, ifile, number, num, step, ntot
integer :: Nx_max, Ny_max, Nz_max
integer :: Nxp, Nzp, Nyp, Ngrid
integer :: Ifirst, Ilast, Jfirst, Jlast, Kfirst, Klast
character*(64) :: fname, buffer, ffname
integer :: tmp, N1, N2, N3, tmpp
real(WP), allocatable :: qout(:,:,:,:), phi_xyz(:,:,:,:,:)
real(WP), allocatable :: Vn(:,:), Vntmp(:,:), TAU(:,:)
real(WP), allocatable :: Rprime(:,:), Rtmp(:,:), Rend(:,:), Q(:,:), tmpL(:), tmpG(:)
real(WP), allocatable :: s(:), vt(:,:), u(:,:), utmp(:,:)
real(WP), allocatable :: tmp1(:,:), tmp2(:,:), tmp3(:,:), phi(:,:)
integer, dimension(2) :: view
integer :: view1
integer, dimension(3) :: lsizes, gsizes, start
real(WP) :: tmpr
real(WP), allocatable :: work(:), mu(:), eigY(:,:), wr(:), wi(:), beta(:)
integer(kind=MPI_Offset_kind) :: SP_MOK, Nx_MOK, Ny_MOK, Nz_MOK, WP_MOK
open(unit=110,file='postparameters.dat',form="formatted")
read (110,*) Nx_max
read (110,*) Ny_max
read (110,*) Nz_max
read (110,*) numvar
read (110,*) step
close(110)
! Define the size of grid on each processor
if (mod(Nx_max,px).ne.0) then
write(*,*) 'Error in preproc: Nx_max is not devisable by px'
call MPI_ABORT(MPI_COMM_WORLD,0,ierr)
end if
Nxp = Nx_max/px
if (mod(Ny_max,py).ne.0) then
write(*,*) 'Error in preproc: Nx_max is not devisable by px'
call MPI_ABORT(MPI_COMM_WORLD,0,ierr)
end if
Nyp = Ny_max/py
if (mod(Nz_max,pz).ne.0) then
write(*,*) 'Error in preproc: Nx_max is not devisable by px'
call MPI_ABORT(MPI_COMM_WORLD,0,ierr)
end if
Nzp = Nz_max/pz
Ifirst = irank*Nxp + 1
Ilast = Ifirst + Nxp - 1
Jfirst = jrank*Nyp + 1
Jlast = Jfirst + Nyp - 1
Kfirst = krank*Nzp + 1
Klast = Kfirst + Nzp - 1
! Setting the view for phi
gsizes(1) = Nx_max
gsizes(2) = Ny_max
gsizes(3) = Nz_max
lsizes(1) = Nxp
lsizes(2) = Nyp
lsizes(3) = Nzp
start(1) = Ifirst - 1
start(2) = Jfirst - 1
start(3) = Kfirst - 1
call MPI_TYPE_CREATE_SUBARRAY(3,gsizes,lsizes,start,&
MPI_ORDER_FORTRAN,MPI_REAL_SP,view,ierr)
call MPI_TYPE_COMMIT(view,ierr)
call MPI_TYPE_CREATE_SUBARRAY(3,gsizes,lsizes,start,&
MPI_ORDER_FORTRAN,MPI_REAL_WP,view1,ierr)
call MPI_TYPE_COMMIT(view1,ierr)
WP_MOK = int(8, MPI_Offset_kind)
Nx_MOK = int(Nx_max, MPI_Offset_kind)
Ny_MOK = int(Ny_max, MPI_Offset_kind)
Nz_MOK = int(Nz_max, MPI_Offset_kind)
! Reading the qout file
ffname = 'qout'
allocate(qout(Nxp,Nyp,Nzp,numvar))
allocate(Vn(Nxp*Nyp*Nzp*numvar,step))
do rst = 1,step
if (myrank == 0) print*, 'Step = ', 50 + rst -1
write(buffer,"(i4.4)") 50 + rst -1
fname = trim(ffname)//trim(buffer)
fname = trim('ufs')//":"// trim(fname)
fname = trim(adjustl(fname))//'.dat'
call MPI_FILE_OPEN(MPI_COMM_WORLD,fname,MPI_MODE_RDONLY,MPI_INFO_NULL,ifile,ierr)
call MPI_FILE_READ(ifile,Ngrid,1,MPI_INTEGER,status,ierr)
if (1 /= Ngrid) then
if (myrank == 0 ) write(*,*) Ngrid
endif
call MPI_FILE_READ(ifile,tmp,1,MPI_INTEGER,status,ierr)
if (tmp /= Nx_max) write(*,*) tmp
call MPI_FILE_READ(ifile,tmp,1,MPI_INTEGER,status,ierr)
if (tmp /= Ny_max) write(*,*) tmp
call MPI_FILE_READ(ifile,tmp,1,MPI_INTEGER,status,ierr)
if (tmp /= Nz_max) write(*,*) tmp
call MPI_FILE_READ(ifile,tmpr,1,MPI_REAL_WP,status,ierr)
call MPI_FILE_READ(ifile,tmpr,1,MPI_REAL_WP,status,ierr)
call MPI_FILE_READ(ifile,tmpr,1,MPI_REAL_WP,status,ierr)
call MPI_FILE_READ(ifile,tmpr,1,MPI_REAL_WP,status,ierr)
do l=1,numvar
disp = 4*4 + 4*WP_MOK + Nx_MOK*Ny_MOK*Nz_MOK*WP_MOK*(l-1)
call MPI_FILE_SET_VIEW(ifile,disp,MPI_REAL_WP,view1,"native",MPI_INFO_NULL,ierr)
call MPI_FILE_READ_ALL(ifile,qout(1:Nxp,1:Nyp,1:Nzp,l),Nxp*Nzp*Nyp, MPI_REAL_WP,status,ierr)
end do
call MPI_FILE_CLOSE(ifile,ierr)
!-----------------------------------------------
! Bluiding the snapshot matrix Vn --------------
!-----------------------------------------------
do i=1,numvar
do k=1,Nzp
do j=1,Nyp
Vn((1 + Nxp*(j-1) + Nxp*Nyp*(k-1) + Nxp*Nyp*Nzp*(i-1)):(Nxp*j + Nxp*Nyp*(k-1) + Nxp*Nyp*Nzp*(i-1)),rst) = qout(1:Nxp,j,k,i)
end do
end do
end do
end do
call MPI_BARRIER(MPI_COMM_WORLD,ierr)
deallocate(qout)

Populate a constant array in order specified by other constants?

Is there a way to populate a constant array in an order specified by other constant variables?
So, in effect this:
integer, parameter :: ired = 1
integer, parameter :: iblue = 2
real, parameter :: myarr(2,3)
myarr(ired, :) = [1,0,0]
myarr(iblue,:) = [0,0,1]
Except the above of course will not compile. Is there a way to get to this in some way?
To generalize #HPM's answer to the case where ired and iblue etc may be discontiguous (e.g, 1 and 3), combined use of implied do-loop + array constructor might be useful. Because arrays in Fortran are column-major, I have aligned the vectors in a matrix such that [ vec1, vec2, ..., vecN ] where vecX is a 3-vector.
integer :: k
integer, parameter :: ired = 1, iblue = 3, mxvec = 4, ndim = 3, zero(3) = [0,0,0]
integer, dimension( ndim * mxvec ), parameter :: &
red = [ (zero, k=1,ired-1 ), [1,1,1], (zero, k=ired+1, mxvec) ], &
blue = [ (zero, k=1,iblue-1), [7,7,7], (zero, k=iblue+1,mxvec) ]
integer, parameter :: myarr( ndim, mxvec ) = reshape( red + blue, [ ndim, mxvec ] )
print "(a,/100(3i2/))", "red = ", red
print "(a,/100(3i2/))", "blue = ", blue
print "(a,/100(3i2/))", "myarr = ", myarr
print *, "myarr( :, ired ) = ", myarr( :, ired )
print *, "myarr( :, iblue ) = ", myarr( :, iblue )
Result:
red =
1 1 1
0 0 0
0 0 0
0 0 0
blue =
0 0 0
0 0 0
7 7 7
0 0 0
myarr =
1 1 1
0 0 0
7 7 7
0 0 0
myarr( :, ired ) = 1 1 1
myarr( :, iblue ) = 7 7 7
No, there is no way to assign values to a parameter after program start-up; that's exactly what the attribute parameter is intended to prevent.
You could write
real, parameter :: myarr(2,3) = reshape([1.0,0,0,0,0,1],[2,3])
to initialise myarr. Note that the elements are provided to reshape in the array element order specified by Fortran (ie column major); here it happens to be the same as if you had specified them in row major order. And note that in Fortran initialization means, precisely, setting a value in the declaration statement, which is how parameters acquire values.
I don't immediately see any way to use ired and iblue in the intialisation but I'm struggling to see that as a problem.
EDIT, after OP's comment:
I guess you could write something like
INTEGER, PARAMETER :: ired = 1
INTEGER, PARAMETER :: iblue = 2
REAL, PARAMETER, DIMENSION(2,3) :: rows = reshape([1,0,0,0,0,1],[2,3])
REAL, PARAMETER :: myarr(2,3) = RESHAPE([rows(ired,:), rows(iblue,:)], [2,3])
and now you only have to swap the values of ired and blue to change myarr. And the only thing you might forget is why you wrote such convoluted code !

Not reading Input file to run stress autocorrelation function

I am trying to run a stress autocorrelation function code to calculate the stress autocorrelation function,then from there I would like to calculate viscosity using Green -Kubo equation. Now the Fortran code I have does not read out my stress data in order to calculate stress auot-correlarion function. Anyone can please help me with this. I have attached my code and data I want to correlate. Hope to here from you soon.
Here is the error
./a.out
**** Program Stress_autocorrelation ****
Calculation of time Correlation Functions
Enter data file name
DFILE
Enter results file name
RFILE
0.00000000
0.00000000
0.00000000
0.00000000
0.00000000
0.00000000
0.00000000
0.00000000
At line 106 of file main.f95 (unit = 10, file = 'DFILE')
Fortran runtime error: Bad value during floating point read
Code and below is Input data:
! Program to claculate pressure autocorrelation function
program stress_autocorrelation
implicit none
common / block1 / STORA, STORB, STORC, STORD,STORE,STORF,STORG, STORH, STORI
common / block2 / PA, PB, PC, PD, PE, PF, PG, PH , PI
common / block3 / PACF, ANORM
! *******************************************************************
! ............ PRINCIPAL VARIABLES............
!
! ** integer N Number of atoms
! ** integer NSTEP Number of steps on the tape
! ** integer IOR Interval for time origins
! ** integer NT Correlation length, Including T=0
! ** integer NTIMOR Number of time origin
! ** integer NLABEL Label for step (1,2,3.....Nstep)
!
!
! ** real PACF(NT) The pressure correlation function
! ** NSTEP and NT should be multiples of IOR.
! ** PA,PB,PC = Pxx,Pxy,Pxz
! ** PD,PE,PF = Pyx,Pyy,Pyz
! ** PG,PH,PI = Pzx,Pzy,Pzz
!
!
! ...............ROUTINES REFERENCED..........................
!
! ....Subroutine Store (J1)..........
!Routine to store the data for correlation
! .....Subroutine Corr (J1,J2,IT).........
!Routine to correlate the stored time origin
!
!
! .....................USAGE..............................
!
! Data in file DFILE on fortrran UNIT DUNIT
! Results in File RFILE on fortran UNIT RUNIT
! *******************************************************************
integer N, NSTEP, IOR, NT, NDIM, DUNIT, RUNIT, NTIMOR
integer FULLUP
parameter ( N = 78, NSTEP = 10, IOR = 4, NT = 8 )
parameter ( DUNIT = 10, RUNIT = 11 )
parameter ( NDIM = NT / IOR + 1, NTIMOR = NSTEP / IOR )
parameter ( FULLUP = NDIM - 1 )
real PA(N), PB(N), PC(N), PD(N), PE(N), PF(N), PG(N), PH(N), PI(N)
real STORA(NDIM,N), STORB(NDIM,N), STORC(NDIM,N),STORD(NDIM,N), STORE(NDIM,N),STORF(NDIM,N),STORG(NDIM,N),STORH(NDIM,N)
real STORI(NDIM,N)
REAL PACF(NT), ANORM(NT)
integer S(NTIMOR), TM(NTIMOR)
integer TS, TSS, L, NINCOR, K, R, JA, IB, IN, IA, JO, I
integer NLABEL
character DUMMY * 5
character DFILE * 115
character RFILE * 115
! *******************************************************************
write(*,'('' **** Program Stress_autocorrelation **** '')')
write(*,'('' Calculation of time Correlation Functions '')')
!.....READ IN FILE NAMES.........
write(*,'('' Enter data file name'')')
read (*,'(A)') DFILE
write (*,'('' Enter results file name'')')
read (*,'(A)') RFILE
!......INITIALIZE COUNTERS.......
NINCOR = FULLUP
JA = 1
IA = 1
IB = 1
!........ZERO ARRAYS.............
do 5 I = 1, NT
PACF(I) = 0.0
ANORM(I) = 0.0
write(*,*) PACF(I)
5 continue
!..........OPEN DATA FILE AND RESULTS FILE...........
open ( UNIT = DUNIT, FILE = DFILE, STATUS = 'OLD', FORM = 'FORMATTED')
open ( UNIT = RUNIT, FILE = RFILE, STATUS = 'NEW' )
!.........CALCULATION BEGINS............
do 40 L = 1, NTIMOR
JA = JA + 1
S(L) = JA - 1
read ( DUNIT, '(A5,I4)') DUMMY, NLABEL
do 7 R = 1, N
read (DUNIT,'(F9.6,8(9X,F9.6))')PA(R),PB(R),PC(R),PD(R),PE(R),PF(R),PG(R),PH(R),PI(R)
7 continue
TM(L) = NLABEL
write(*,*) TM(L)
!.......STORE STEP AS A TIME ORIGIN......
call STOREE ( JA )
!........CORRELATE THE ORIGINS IN STORE......
do 10 IN = IA, L
TSS = TM(L) - TM(IN)
TS = TSS + 1
JO = S(IN) + 1
call CORR ( JO, JA, TS )
10 continue
!Read IN data between time origins. This can
!Be conveniently stored IN element 1 of the
!Array storx etc. and can then ben correlated
!With the time origins
do 30 K = 1, IOR - 1
read ( DUNIT, '(A5,I4)') DUMMY, NLABEL
do 15 R = 1, N
read ( DUNIT,'(F17.14,8(13X,F17.14))')PA(R),PB(R),PC(R),PD(R),PE(R),PF(R),PG(R),PH(R),PI(R)
15 continue
call STOREE ( 1 )
do 20 IN = IA, L
TSS = NLABEL - TM(IN)
TS = TSS + 1
JO = S(IN) + 1
call CORR ( JO, 1, TS )
20 continue
30 continue
if ( L .GE. FULLUP ) then
if ( L .EQ. NINCOR ) then
NINCOR = NINCOR + FULLUP
JA = 1
endif
IA = IA + 1
endif
40 continue
close ( DUNIT )
!.....NORMALISE CORRELATION FUNCTIONS.......
PACF(1) = PACF(1) / ANORM(1) / REAL ( N )
do 50 I = 2, NT
PACF(I) = PACF(I) / ANORM(I) / REAL ( N ) / PACF(1)
50 continue
write ( RUNIT, '('' Pressure ACF '')')
write ( RUNIT, '(I6,E15.6)') ( I, PACF(I), I = 1, NT )
close ( RUNIT )
stop
end
subroutine STOREE ( J1 )
common / BLOCK1 / STORA, STORB, STORC, STORD,STORE,STORF,STORG,STORH,STORI
common/ BLOCK2 / PA, PB, PC, PD, PE, PF, PG, PH, PI
! *******************************************************************
!.........SUBROUTINE TO STORE TIME ORIGINS..............
! *******************************************************************
integer J1
integer N, NT, IOR, NDIM
parameter ( N = 78, NT = 8, IOR =4 )
parameter ( NDIM = NT / IOR + 1 )
real STORA(NDIM,N), STORB(NDIM,N), STORC(NDIM,N),STORD(NDIM,N)
real STORE(NDIM,N),STORF(NDIM,N),STORG(NDIM,N),STORH(NDIM,N),STORI(NDIM,N)
real PA(N), PB(N), PC(N), PD(N), PE(N), PF(N),PG(N), PH(N), PI(N)
integer I
do 10 I = 1, N
STORA(J1,I) = PA(I)
STORB(J1,I) = PB(I)
STORC(J1,I) = PC(I)
STORD(J1,I) = PD(I)
STORE(J1,I) = PE(I)
STORF(J1,I) = PF(I)
STORG(J1,I) = PG(I)
STORH(J1,I) = PH(I)
STORI(J1,I) = PI(I)
10 continue
return
end
subroutine CORR ( J1, J2, IT )
common / block1 / STORA, STORB, STORC, STORD,STORE,STORF,STORG,STORH,STORI
common/ block3 / PACF, ANORM
! *******************************************************************
!......SUBROUTINE TO CORRELATE TIME ORIGINS....
! *******************************************************************
integer J1, J2, IT
integer N, NT, IOR, NDIM
parameter ( N = 78, NT = 8, IOR = 4 )
parameter ( NDIM = NT / IOR + 1 )
real STORA(NDIM,N), STORB(NDIM,N), STORC(NDIM,N),STORD(NDIM,N)
real STORE(NDIM,N),STORF(NDIM,N),STORG(NDIM,N),STORH(NDIM,N),STORI(NDIM,N)
real PACF(NT), ANORM(NT)
integer I
!********************************************************************
do 10 I = 1, N
PACF(IT) = PACF(IT) + STORA(J1,I) * STORA(J2,I) &
+ STORB(J1,I) * STORB(J2,I) &
+ STORC(J1,I) * STORC(J2,I) &
+ STORD(J1,I) * STORD(J2,I) &
+ STORE(J1,I) * STORE(J2,I) &
+ STORF(J1,I) * STORF(J2,I) &
+ STORG(J1,I) * STORG(J2,I) &
+ STORH(J1,I) * STORH(J2,I) &
+ STORI(J1,I) * STORI(J2,I)
10 continue
ANORM(IT) = ANORM(IT) + 1.0
return
end
Data: has 9 columns
-9.568336E+00 -1.615161E+00 1.042644E+00 -1.615161E+00 -1.131916E+01 -6.979813E-01 1.042644E+00 -6.979813E-01 -1.182917E+01
-4.765572E-01 9.005122E-01 -2.282920E+00 9.005122E-01 -3.827857E+00 -3.206736E+00 -2.282920E+00 -3.206736E+00 -6.252462E+00
-1.012710E+01 4.672368E-01 8.791873E-02 4.672368E-01 -4.680832E+00 -5.271814E-01 8.791873E-02 -5.271814E-01 -1.898345E-01
-7.699012E+00 -9.906154E-01 7.450304E-01 -9.906154E-01 -1.061230E+00 -3.546956E+00 7.450304E-01 -3.546956E+00 -6.843898E+00
-3.544260E+00 4.254020E+00 -1.963602E+00 4.254020E+00 3.740858E+00 -4.587760E+00 -1.963602E+00 -4.587760E+00 -6.776258E+00
1.755595E-01 -9.625855E-01 -2.395960E+00 -9.625855E-01 -1.701399E+00 -8.483695E-01 -2.395960E+00 -8.483695E-01 -4.165223E+00
-3.244186E+00 5.540608E+00 -4.951768E-01 5.540608E+00 3.068601E+00 -1.613010E-01 -4.951768E-01 -1.613010E-01 -5.641277E+00
-8.985849E+00 1.870244E+00 -2.295795E-01 1.870244E+00 -4.635924E+00 -4.787461E+00 -2.295795E-01 -4.787461E+00 -3.014272E+00
-1.651073E-01 -6.326584E-01 -3.028051E+00 -6.326584E-01 -2.621833E+00 -2.640439E+00 -3.028051E+00 -2.640439E+00 1.668877E+00
1.250349E+00 3.054784E+00 -2.898975E+00 3.054784E+00 8.419503E-01 9.620184E-01 -2.898975E+00 9.620184E-01 1.479256E+00
-7.796195E-01 1.942983E+00 -2.736569E+00 1.942983E+00 6.073043E+00 -2.520281E+00 -2.736569E+00 -2.520281E+00 -9.600832E-01
4.697066E-01 3.138124E+00 -1.092573E+00 3.138124E+00 -2.099285E+00 -1.581031E+00 -1.092573E+00 -1.581031E+00 -6.285002E-01
3.017532E-01 -9.701574E-02 1.611936E+00 -9.701574E-02 -1.762075E+00 -3.401961E+00 1.611936E+00 -3.401961E+00 -6.889746E-01
1.177410E-01 5.090611E-01 1.452691E-01 5.090611E-01 5.695570E+00 -3.573245E+00 1.452691E-01 -3.573245E+00 -1.099615E+00
-5.180126E+00 -1.876409E-01 -2.067182E+00 -1.876409E-01 1.611177E+00 5.458450E-01 -2.067182E+00 5.458450E-01 1.026071E+00
1.477567E+00 1.598949E+00 -1.577546E+00 1.598949E+00 3.933810E+00 -2.698132E+00 -1.577546E+00 -2.698132E+00 3.485029E+00
-2.533324E+00 1.753033E+00 1.425241E-01 1.753033E+00 2.406501E+00 -1.147217E+00 1.425241E-01 -1.147217E+00 3.065603E-01
-2.360274E+00 1.312721E+00 -3.711419E-01 1.312721E+00 2.556935E+00 3.152605E-01 -3.711419E-01 3.152605E-01 3.378170E+00
-1.698217E+00 1.105760E+00 3.780822E-01 1.105760E+00 2.736574E+00 7.920578E-01 3.780822E-01 7.920578E-01 -6.596856E-01
-5.099544E+00 1.647542E-01 -1.036544E+00 1.647542E-01 3.845429E+00 -1.034068E+00 -1.036544E+00 -1.034068E+00 -3.152053E+00
-2.686567E+00 1.335786E+00 -1.889911E-01 1.335786E+00 9.755267E-01 9.322043E-01 -1.889911E-01 9.322043E-01 3.229615E-01
1.542994E-01 3.104663E+00 -1.634353E-01 3.104663E+00 4.090105E+00 -1.128244E+00 -1.634353E-01 -1.128244E+00 -2.909383E-01
-4.235419E-01 1.554157E+00 3.475430E+00 1.554157E+00 4.701173E+00 -1.789414E+00 3.475430E+00 -1.789414E+00 1.517218E+00
-8.054924E-01 -1.167935E+00 -1.123460E+00 -1.167935E+00 1.169303E+00 -2.171076E+00 -1.123460E+00 -2.171076E+00 -5.636150E+00