Good day,
I'm working with a FORTRAN program that has the line:
EDEN=EDEN+(STVS**2)/(N(J)-1)
I would like to check if N(J)-1 is equal to zero. If so make N(J)-1=1.0
The following doesn't work:
IF ((N(J)-1).EQ.0.0) THEN
N(J)-1=1.0
END IF
I'm using gfortran and am getting...
Thanks jedishrfu. This worked. I was able to determine that Y = SAREA(2,ISN) / X13 was the culprit. X13 =0...division by zero problem. Thanks so much. Very much appreciated.
Good day. My FORTRAN program is throwing an ARITHMETIC exception on this line of code:
SAREA(2,ISN)=SAREA(2,ISN)/IND(13)/1000./6080.2*IND(12)/1000.
When I check this using gdb and print the contents of the variable SAREA(2,ISN), the value is 1432.
gdb error message:
Program received signal...
Hi,
I've made some progress. Issue resolved. The code block should have only printed the information for either MALES or FEMALES. But in fact it was printing duplicate information. If the species was female, for instance, it should have just printed out female and the associated stats...
Hi David. Thanks for your response. I believe I have found the offending piece of code in a linked object file. I started learning GDB to debug yesterday ! The main program calls many linked subroutines. I'm not sure yet how to use GDB to step through an object file to see how the variables...
I've inherited the code below. It's giving an infinite loop but I can't find what's causing it. This is code originally on OpenVMS written now for AIX. Can you help?
SUBROUTINE MREAD3(N_VESSEL,N_TRIP,N_ICNAF,N_SPECIES,N_DELSTR,
+ N_SETDEL,N_SELSTR,VESSELS_TO_BE_SELECTED,
+...
Thanks all for your input. It has been very helpful to me. This is what I was able to discover using the information in this thread. The line: READ(*,7)IVES,MIN,ITRIP is asking for input of the vessel name beginning in the first column and the trip number beginning in column 27. When I...
I will do this and get back to you. You've been very helpful. Thanks so much. I have a meeting now but will read the site info you sent me. I had downloaded some manuals from various sites but found that they had different approaches. Probably because of the various versions of FORTRAN...
On the OpenVMS I don't have to give any input from the keyboard. The fortran program itself is called from a DCL script which I re-wrote to bash. I've included both here. My compiler is gfortran. I use this code to compile: gfortran -std=legacy -ff2c sdetcat.for...I have hard coded paths...
Good day,
I am not familiar with older FORTRAN. We are shutting down an old OpenVMS server and moving to AIX. I am trying to tweak old FORTRAN code that is working fine on OpenVMS to now run on AIX. I have one error left in this code that I can't seem to fix. It is the line that reads
6...