subroutine mnmx(n,vector,vmin,vmax) ! ! (c) Copyright 1991 to 1998 by Michael A. Beer, William D. Dorland, ! P. B. Snyder, Q. P. Liu, and Gregory W. Hammett. ALL RIGHTS RESERVED. ! ! ! finds the minimum and maximum of the vector of length n, and ! stores the results in vmin and vmax (unless vmin or vmax ! already exceed this new minimum and maximum). ! ! Written by Greg Hammett 29-Jan-1991 ! Modified by BD 6-8-98 implicit none ! declare arguments: integer n real, dimension(:) :: vector real vmin real vmax if (n < 1) return vmin=min(vmin,minval(vector(1:n))) vmax=max(vmax,maxval(vector(1:n))) end subroutine mnmx