tfortran90.f - numeric - C++ library with numerical algorithms
 (HTM) git clone git://src.adamsgaard.dk/numeric
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) LICENSE
       ---
       tfortran90.f (1059B)
       ---
            1       PROGRAM fortranmatmul
            2 
            3           IMPLICIT NONE
            4           integer i, j
            5           !integer nargs
            6           !character arg*8
            7           integer, parameter :: N = 2
            8 
            9           !parameter nargs = iargs()
           10           !do i = 0,nargs 
           11           !    call getarg(i, arg) 
           12           !    print '(a)', arg 
           13           !end do
           14 
           15           !if (nargs == 2) then
           16           !    call getarg(2, arg)
           17           !    read(s,*) N 
           18           !end if
           19 
           20           real :: a(N,N) = RESHAPE((/(2.0, i=0,N*N, 1)/),(/N,N/))
           21           real :: b(N,N) = RESHAPE((/(i, i=0,N*N, 1)/),(/N,N/))
           22           real :: c(N,N)
           23 
           24           write(*,*) 'Matrix [a]'
           25           do i=1,N
           26           write(*,1000) (a(i,j),j=1,N)
           27           enddo
           28           write(*,*)
           29 
           30           write(*,*) 'Matrix [b]'
           31           do i=1,N
           32           write(*,1000) (b(i,j),j=1,N)
           33           enddo
           34           write(*,*)
           35 
           36           c = matmul(a, b)
           37           write(*,*) 'Matrix [c] = [a] x [b]'
           38           do i = 1,N
           39           write(*,1000) (c(i,j),j=1,N)
           40           enddo
           41 
           42 1000  FORMAT(1x,1P10E14.6)
           43 
           44       END PROGRAM fortranmatmul