I got this:
Subscript #2 of the array X has value 3 which is 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...
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 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?
I have iterative process but my subroutine has problems.
c ======================================
subroutine datainpe
c ======================================
use definitions
use mt2ddat
implicit none
write(*,*)iper
id1=iper/10
id2=iper-id1*10...
I have a file with 1680 numerical values,I want to read it and reshape it,later use that array for further calculations.Like this:
integer:: i,j
real,dimension(1680) :: s
real, dimension(21,80) :: ist
integer,dimension(80,80) :: wd,wd2...
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?
Well I have already posted before,but even with much help from other collegues it didn't work.
do i=1,nsites
do ico=1,nc
if(ivarp(ico).ne.0)then
iprd=ivarp(ico)
apr4sens(1,i,iprd)=apr1dsens(i,iprd)...
I am trying to work with the code,but I am using Intel Fortran Compiler and the guy how make it used f77.I wrote my one makefile and compile it,but it is not working properly.Where should I look for error?
FC= ifort
LD = ifort -align all
FCFLAGS = -O2 -g -ipo -traceback -warn noalign
LDFLAGS =...
I have already posted regarding this,but I will try to explain.I calculate some functions,store them in arrays and then want to send them to main program but there I get some wrong values.My module:
module s2em
contains
c ---------------------------
subroutine...
I have problem like this:real*4 apr1dsens(nmax,nfmax,ncmax)
apr1dsens(j,1,iprd),apr1dsens(j,2,iprd),apr1dsens(j,3,iprd),apr1dsens(j,4,iprd)
All have 420 numerical values.How to join them into single array?Can merge intinsic function be used for 4 arrays?I have tried like this but got some apsurd...
I have come to the point that I have xn array,model as a result of first iteration.Defined like this:
real,dimension(57,3) :: xn
How to store it and how to use it in further iterations?Is global module with allocatable array best solution?
Well I am trying to read a file and make it rank3 array.
forrtl: severe (24): end-of-file during read, unit 5, file /home/milenko/ircg/test_res1.dat
program praviar
implicit none
integer*4 k,n,m
integer,dimension(3) ::s
real,dimension(57,57,57) :: x...
I have problems with my code.As a result of calculation I got rank2 l(21,1) array.Due to the THE ITERATIVE PROCESS I will get the same array in every iteration.How to allocate values and use them later.Should I create new array
like lbig(iter,nmax,1)=l(nmax,1)?
I am writing in my code some values to file,but I want to write them to new array.
apr1dsens(j,3,iprd)=2*g*(real(sens_zyx)*real(zyx)
& +aimag(sens_zyx)*aimag(zyx))
apr1dsens(j,4,iprd)=g1*(aimag(sens_zyx)*real(zyx)
& -aimag(zyx)*real(sens_zyx))...
I need this because of easy array maniplulation. I tryed like this:
program arrayc
implicit none
integer :: i
integer,dimension(57) :: a
real,dimension(57) :: b(1,1.8,63.39,472.97,801.43,3.71,35.07,15.63...
I have calculated some corections but now I have problem to add them to original values.
rewind(5)
do i=2,nc
read(5,*)icd,res(icd),ivar(icd)
if(ivar(icd).ne.0)then
ivarprd=ivarprd+1
ivarp(ivarprd)=icd
endif
I want to add 21 real values to res(icd)
res(icd)=res(icd)+cor(icd)
But it...
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.