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...

    e.g.

    "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?

    Thanks,

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

    minger

    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 :-)
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Quantile subroutine, Fortran 90
  1. Fortran 90 (Replies: 7)

  2. Fortran 90 (Replies: 1)

  3. FORTRAN 90 subroutine (Replies: 3)

  4. Fortran 90 (Replies: 1)

Loading...