Ahn210 -- i'm glad you found a method that works for you
salgerman -- thanks to you, too. just like mikrom, i also did not know about the TR descriptor. we learn something new every day :)
something else to add to the above
my suggestion AND the "string" suggestion should both work.
my suggestion might be less tedious -- if you know in advance WHICH column has blank entries, WHERE (in the column) those blank entries are, etc
otherwise, if you don't know that info in advance...
...i completely forgot that little detail ... i'm a bit rusty :(
instead, try something like the following revised code :-
DO I = 1 , N
READ (1,*) A (I)
BACKSPACE 1
IF ( A (I) == 85337 ) THEN
READ (1,*) A (I), B (I) , C (I) , D (I) , E (I) , F (I)
ELSE IF ( A (I) == 85339 )...
...of the rows that have missing values ? is it always either 85337 or 85339 ?
if so, then why not have something like :-
DO I = 1 , N
READ (1,*) A (I)
IF ( A (I) == 85337 ) THEN
READ (1,*) B (I) , C (I) , D (I) , E (I) , F (I)
ELSE IF ( A (I) == 85339 ) THEN
READ (1,*) B...
...THEN
XPDF=1.0D0
DO I=1,TOTLOAD
CALL PDF_NORM(X(I),MEAN_X(I),SD_X(I),PDF,INTEST)
XPDF=XPDF*PDF
END DO
ELSE
CALL JOINT_PDF_NORM_NX3(X,IX,MEAN_X,IMEAN_X,SD_X,ISD_X,COV_X,&
&ICOV_X,JCOV_X,INV_COV_X,IINV_COV_X,&
&JINV_COV_X,DET_COV_X,NX,XPDF,INTEST)
END...
a subtle point to make
you said :- "...works fine until I get to the 53rd time in the LOOP then it crashes."
but, according to your code, there are 2 LOOPS where that could occur :-
do k=1,60
end do
and
do i=1,1096
end do
do you know WHICH of these loops is the culprit ?
if it's...
hmmm, sounds to me like a fortran question :-
PROGRAM PUB_SLOPE
REAL :: SLOPE_1
REAL :: SLOPE_2
SLOPE_1 = slope from pub 1 to home
SLOPE_2 = slope from pub 2 to home
IF ( SLOPE_1 < 0.0 ) THEN
GOTO pub 1
ELSE IF ( SLOPE_2 < 0.0 ) THEN
GOTO pub 2
ELSE
FIND another pub
END IF
sorry :)
oops ! i forgot some "dimension" details ...
the lines
?? ,INTENT (IN) :: X
?? ,INTENT (INOUT) :: B
should instead be
?? ,INTENT (IN) :: X (9,2)
?? ,INTENT (INOUT) :: B (512,9)
i "sort of" get what you are trying to do.
but, your code seems to be doing 1 thing, and your "description" (of what you're trying to do) seems to want something else.
regarding the nested do loops:- maybe you could try using a recursive subroutine (or recursive function) ? for example, see...
a quick note to all of you that replied.
sorry if i haven't given you all of you a star (as a thanks). i did try to give you all a star, but, i don't think it worked properly, so maybe it only worked for a few of you. but yeah -- i did try to give everyone a star.
Norbert (and others) :- i'm not using gfortran. i'm using intel visual fortran composer xe.
FJacq :- by "no" do you mean that only a subroutine is made PUBLIC, and it's local variables are not ALSO made PUBLIC ?
Norbert (and others) :- about the automatic deallocation of allocatable arrays. as...
thanks for your replies.
first, i'll just go back a step, and explain one detail i left out of my original post. i said my subroutines have the attribute PUBLIC. by this i mean:- a) each subroutine is stored in it's own module, b) each module contains one (and only one) subroutine, c) in each...
i'm using Fortran 90. i use lots of subroutines (each of which are given the PUBLIC attribute). in most of these subroutines i'm using ALLOCATABLE matrices -- which are "locally within" each subroutine.
for ease of programming, i've thought of a "universal" way of naming INTEGER variables...
sorry that this reply is so late.
you said that allocatable arrays (that have been ALLOCATEd in the current "procedure") are automatically deallocated (upon return to the "calling procedure").
does the same apply with files ? i.e. are all files (that have been OPENed during the current...
thanks for your replies.
in reply to your replies :-
Salgerman :- you are correct (as usual!), about the term "calling program". i wrote "calling program", but i meant "calling CODE" -- which refers to the code that called the subroutine. Correct me if i'm wrong, but "calling CODE" refers to...
i'm using fortran 90/95.
i'm using recursive subroutines.
i need to use arrays within these subroutines. i'm trying to determine whether i can use allocatable arrays, or whether i instead have to use "fixed size" arrays.
as you probably know, when using allocatable arrays, if they have already...
i'm using fortran 90/95.
i'm using a lot of (multi-dimensional) matrices.
forgetting about program performance / efficiency / etc, is there a limit to the number of dimensions each matrix can have ?
for example, say i have
REAL, DIMENSION ( IA , JA , KA , ... , ) :: A
where IA, JA, KA, etc...
thanks for that reply.
i agree with what you said about "too many levels can cause program inefficiency". but, with my program, i have a combination of lots of variables, and lots of subroutines. so, in order to (significantly) reduce the number of dummy arguements, i'm resorting to type...
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.