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...
xwb -- you are right ! 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...
do you know in advance :-
1) which column has missing values ? is it always column C ?
2) the value of A in each 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 )...
sorry this reply is so late
please find below some fortran code that possibly does what you want -- multivariate normal pdf.
i worked on a small project several years ago. part of it involved calculating the multivariate normal pdf. this is a sample of my code. it should help you get started...
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...
i'm using fortran 90/95.
i'm using recursive subroutines.
i want to use an optional argument within one of these subroutines. i'm trying to determine whether i can.
basically, i want to know if the following situation is valid :-
1) a recursive subroutine has the optional argument declared...
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.