Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fortran missing values

Status
Not open for further replies.

Azorio

Programmer
Jan 7, 2012
10
US
I am trying to figure out how to represent missing values in an array with a value I know won't be in there for example -99.9.

A sample of my code, is below. The array "pro" has been read in from a data file of numeric values. The code below print "0.00" where there isn't data to be read. I need the do loop range to stay fixed because other parts of the array that I will be working with fill the range, but this specific part does not. I have tried setting the array equal to -99.9 before the loop but all that prints is "*****".

Code:
DO i=1,31
PRINT *, pro(1,3,i)
END DO
 
Must be something strange going on if it prints ***. This normally means you are doing a formatted print and the value does not fit in the format. print * will always print the value of the number.
 
The ***** appears when I put in a specified format. I took out the specified format statement and the code prints -99.9 through out the entire loop.MY guess is that is overwritting the data in the array and replacing it with -99.9 rather than replacing the values that are not present in the array with -99.9 which is what I am trying to get.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top