...open(11,file='cl.dat',status='old')
open(12,file='lj.dat',status='old')
open(14,file='b.dat',status='old')
read(10,*)n,c
a=n*c
allocate(x(n,c))
allocate(pp(a))
do i=1,n
read(11,*)(x(i,j),j=1,c)
end do
read(12,*)(pp(j),j=1,a)
allocate(work_s(a))...
...open(11,file='cl.dat',status='old')
open(12,file='lj.dat',status='old')
open(14,file='b.dat',status='old')
read(10,*)n,c
a=n*c
allocate(x(n,c))
allocate(pp(a))
do i=1,n
read(11,*)(x(i,j),j=1,c)
end do
read(12,*)(pp(j),j=1,a)
allocate(work_s(a))...
...greater than the upper bound of 2
How to set up bounds?
integer :: i,j,k,c,n,a
real,dimension(:,:),allocatable :: x
Then comes main program:
read(10,*)n,c
a=n*c
allocate(x(n,c))
Reads 4,2 but latter values of array elements will be greater then 2.
How to solve this?
I want to use one subrutine from Press Numerical Recipees:
SUBROUTINE powell(p,xi,ftol,iter,fret)
USE nrtype; USE nrutil, ONLY : assert_eq,nrerror
So should I compile nrtype and nrutil as a module or there is an easier way ?
I agree with you it is pseudo norm.The physical problem is to calculate distance from cluster centers,dist_ik,which should be later weighted(other subroutine).
D=(Yk-Vi)T(Yk-Vi) like this
I found your post very usefull.I have found function.
function func(PP)
! Objective function
Use OptV
Implicit None
Real :: Func, PP(c*s) ! v(:,:) reshaped
Integer :: i, k
real, pointer :: dist_ik(:)
real(kind(1d0)) row_sum, total
integer, save :: count=0
vv = Reshape(PP, (/ c, s...
I have subroutine like this:
Subroutine FuncSub(N, PP, F)
Implicit None
integer :: N
real :: PP(N), F, func
F = func(PP)
end Subroutine FuncSub
I do not understand F = func(PP)?
I have calculated some matrixes,I want to call from the main code and put that into one matrix.I have eight (7,7) arrays and I want to write them on diagonal of new array to create (56,56) array.Any ideas?
...real,dimension(80,1):: d,wr
real,dimension(21,1):: l01
real,dimension(21) ::l0
real :: norm20
read(14,*)(s(i),i=1,1680)
ist=reshape(s,shape=shape(ist))
write(109,*)ist
The question is how columns are created?Is it equivalent to a loop?Does it...
I am trying this:
id1=iter/10
id2=iter-id1*10
tfile(3:4)=char(id1+48)//char(id2+48)
I have defined:
data tfile/'nr .res'/
Still i get file like this:
nr .res
I would like to be nr01.res,... and so on.
Where could be a problem?
When I read from file model 1:
do i=2,nc
read(5,*)icd,res(icd),ivar(icd)
cond(icd)=1./res(icd)
In next iteration I read from array:
xn=xnbig(:,:,iter)
icdar1=xn(:,1)
resar1=xn(:,2)
ivarar1 =xn(:,3)
How to denote that icdar1 has 57 elements icd,resar1...
I have array and want to use intrinsic pack functions.The problem is that my array is quite a big one so creating mask can be done by repeating true and false.Is there any simple way how I can write witout repeating 80 falses while creating mask?
...do i=1,nsites
do ico=1,nc
if(ivarp(ico).ne.0)then
iprd=ivarp(ico)
do k=1,4
write(128,*)apr4sens(k,i,iprd)
enddo
endif
enddo
enddo
k=4,i=20,iprd=21
where should I put group=apr4dsens...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.