[Fortran] 纯文本查看 复制代码
module zx
integer, parameter :: N=4
real::k_y
real,dimension(N,N) :: a
real,dimension(N,N) :: b
real,dimension(N,N) :: c
real,dimension(N,N) :: d
real,dimension(2*N,2*N) :: e
real,dimension(2*N,2*N) :: f
real,dimension(2*N,2*N) :: g
real,dimension(N,N) :: inv_e
end module zx
subroutine xx
use zx
call QW
CALL QWW
e(1:N,1:N)=a(:,:)
e(1:N,N+1:2*N)=b(:,:)
e(N+1:2*N,1:N)=c(:,:)
e(N+1:2*N,N+1:2*N)=d(:,:)
f(1:N,1:N)=d(:,:)
f(1:N,N+1:2*N)=c(:,:)
f(N+1:2*N,1:N)=b(:,:)
f(N+1:2*N,N+1:2*N)=a(:,:)
end subroutine xx
program main
include 'link_fnl_shared.h'
use zx
call xx
USE LINRG_INT
USE WRRRN_INT
CALL LINRG (e, inv_e)
CALL WRRRN ('inv_e', inv_e)
end program main
SUBROUTINE QW
use zx
integer :: i,j
do i=1,N
do j=1,N
a(i,j)=3.d0*i+2.d0*j
end do
end do
do i=1,N
do j=1,N
b(i,j)=2.d0*i+3.d0*j
end do
end do
END SUBROUTINE QW
SUBROUTINE QWW
use zx
integer :: i,j
do i=1,N
do j=1,N
c(i,j)=6.d0*i+1.d0*j
end do
end do
do i=1,N
do j=1,N
d(i,j)=1.d0*i+6.d0*j
end do
end do
END SUBROUTINE QWW