My module:
module kstep
implicit none
contains
subroutine kpr(iter,l,lt,koef)
integer:: i,j
real,allocatable,dimension),intent(in) :: l
real,allocatable,dimension),intent(in) :: lt
real,allocatable,dimension),intent(out) :: koef
integer,intent(in) :: iter
real,dimension(21:1) :: l1
real,dimension(21:1) :: lt1
real,dimension(1:21) :: tlt
real,dimension(80:1) :: a
real,dimension(21:1) :: b
integer,dimension(21,21) :: wm
integer,dimension(80,80) :: wd
real, dimension(80,21) :: sens
real :: norm2a, norm2b,z1,z2
l1=reshape(l,shape=shape(l1))
lt1=reshape(lt,shape=shape(lt1))
tlt=transpose(lt1)
z1=tlt*l1
do j=1,21
do i=1,80
read(114,*)sens(i,j)
end do
end do
do j=1,80
do i=1,80
read(17,*)wd(i,j)
end do
end do
swd=matmul(wd,sens)
a=matmul(swd,lt1)
norm2a=(sum(a(1:80,1:1)**2))
do i=1,21
read(18,*)(wm1(i,j),j=1,21)
end do
x=iter-1
alpha=300*(0.92)**x
b=matmul(wm,lt1)
norm2b=(sum(b(1:21,1:1)**2))
z2=norm2a+alpha*norm2b
koef=z1/z2
end subroutine
end module
I got this:
kstep.for(24): error #6373: Two-dimensional array-valued arguments are required in this context. [TRANSPOSE]
tlt=transpose(lt1)
--------------------^
kstep.for(24): error #6366: The shapes of the array expressions do not conform. [TLT]
tlt=transpose(lt1)
So I didn't manage to reshape rank1 to rank2 array.Why?
module kstep
implicit none
contains
subroutine kpr(iter,l,lt,koef)
integer:: i,j
real,allocatable,dimension),intent(in) :: l
real,allocatable,dimension),intent(in) :: lt
real,allocatable,dimension),intent(out) :: koef
integer,intent(in) :: iter
real,dimension(21:1) :: l1
real,dimension(21:1) :: lt1
real,dimension(1:21) :: tlt
real,dimension(80:1) :: a
real,dimension(21:1) :: b
integer,dimension(21,21) :: wm
integer,dimension(80,80) :: wd
real, dimension(80,21) :: sens
real :: norm2a, norm2b,z1,z2
l1=reshape(l,shape=shape(l1))
lt1=reshape(lt,shape=shape(lt1))
tlt=transpose(lt1)
z1=tlt*l1
do j=1,21
do i=1,80
read(114,*)sens(i,j)
end do
end do
do j=1,80
do i=1,80
read(17,*)wd(i,j)
end do
end do
swd=matmul(wd,sens)
a=matmul(swd,lt1)
norm2a=(sum(a(1:80,1:1)**2))
do i=1,21
read(18,*)(wm1(i,j),j=1,21)
end do
x=iter-1
alpha=300*(0.92)**x
b=matmul(wm,lt1)
norm2b=(sum(b(1:21,1:1)**2))
z2=norm2a+alpha*norm2b
koef=z1/z2
end subroutine
end module
I got this:
kstep.for(24): error #6373: Two-dimensional array-valued arguments are required in this context. [TRANSPOSE]
tlt=transpose(lt1)
--------------------^
kstep.for(24): error #6366: The shapes of the array expressions do not conform. [TLT]
tlt=transpose(lt1)
So I didn't manage to reshape rank1 to rank2 array.Why?