Figuring Out Missing Values in Fortran Array

  • Fortran
  • Thread starter Azorio
  • Start date
  • Tags
    Fortran
In summary, the speaker is trying to figure out how to represent missing values in an array using a value that will not be present in the array, such as -99.9. They have provided a sample of their code, where they are trying to print the values of the array "pro" using a do loop with a fixed range. However, they are unable to print the desired values and have tried setting the array equal to -99.9 before the loop without success. They request for the entire code to be posted in order to troubleshoot the issue.
  • #1
Azorio
6
0
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. 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.

Code:
DO i=1,31
PRINT *, pro(1,3,i)
END DO

I have tried setting the array equal to -99.9 before the loop but all that prints is "*****".
 
Technology news on Phys.org
  • #2
Azorio said:
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. 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.

Code:
DO i=1,31
PRINT *, pro(1,3,i)
END DO

I have tried setting the array equal to -99.9 before the loop but all that prints is "*****".

You need to post the entire code. The code that doesn't work
is what precedes these 3 lines.
 

FAQ: Figuring Out Missing Values in Fortran Array

1. How do I identify and handle missing values in a Fortran array?

To identify missing values in a Fortran array, you can use the WHERE statement to check for conditions such as NaN, INF, or -INF. Once identified, you can handle these values by either replacing them with a valid value or ignoring them during calculations.

2. Can I fill in missing values in a Fortran array with interpolated values?

Yes, you can use interpolation methods such as linear, cubic, or nearest neighbor to fill in missing values in a Fortran array. These methods use the surrounding valid values to estimate the value of the missing data point.

3. How can I efficiently deal with a large number of missing values in a Fortran array?

If you have a large number of missing values in a Fortran array, it is best to use a combination of techniques such as data imputation, data filtering, and data smoothing. These techniques can help you handle the missing values while still maintaining the integrity of your data.

4. Is there a way to automatically detect and replace missing values in a Fortran array?

Yes, you can use the WHERE statement together with the REPLACE function to automatically detect and replace missing values in a Fortran array. This method is particularly useful if you have a large dataset with multiple missing values.

5. Can I use parallel processing to handle missing values in a Fortran array?

Yes, you can use parallel processing techniques such as OpenMP or MPI to handle missing values in a Fortran array. These techniques allow you to distribute the workload across multiple processors, making it faster and more efficient to process large amounts of data with missing values.

Similar threads

Replies
20
Views
3K
Replies
13
Views
2K
Replies
4
Views
1K
Replies
5
Views
3K
Replies
4
Views
1K
Replies
19
Views
6K
Replies
4
Views
2K
Back
Top