Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Quantile subroutine, Fortran 90

  1. Feb 8, 2010 #1
    Hi all,

    I have been Googling for a Fortran 90 quantile routine but to no avail...

    I need a subroutine to which one passes an 1-D array plus the quantile range required...


    "call quantile(array,0.5D0,value)"

    would give me the median of array. Does anyone know of a handy (and free) F90 script to accomplish this?


    Last edited: Feb 8, 2010
  2. jcsd
  3. Feb 8, 2010 #2


    User Avatar
    Science Advisor

    Just use one of the many sorting routines that are available. Then get the SIZE(array), divide that number of by 2, round and get the data point at that location.
  4. Feb 8, 2010 #3
    Yup was just about to post that I'd done exactly that :-)
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook