The attached .f95 code does a range of statistical manipulations to a large data set. The program had successfully deduced all instances of x > threshold and x < threshold for each of the 42,000+ instances and written them to file. The specific application is daily high temperatures exceeding or falling short of the 30-year average high temperature.
Furthermore, the code computes the lengths of runs above or below the average over the entire period of record. That is, 5 days above average, 3 days below, 10 days above, etc ... from 1896 to 2009. I want to find the MEAN and MEDIAN run length values for EACH YEAR, which requires me to store the run values per year and sort them (to find median). I'm having a hard time sorting the array. All of the scripts I found on line were much more sophisticated that my intentions, and so I tried to build a sorting block, but to no avail.
The attached code uses a .txt data file, which is also attached. Thanks for any help you can offer!
Dave
Furthermore, the code computes the lengths of runs above or below the average over the entire period of record. That is, 5 days above average, 3 days below, 10 days above, etc ... from 1896 to 2009. I want to find the MEAN and MEDIAN run length values for EACH YEAR, which requires me to store the run values per year and sort them (to find median). I'm having a hard time sorting the array. All of the scripts I found on line were much more sophisticated that my intentions, and so I tried to build a sorting block, but to no avail.
The attached code uses a .txt data file, which is also attached. Thanks for any help you can offer!
Dave