Subroutine: MINMAX4
Purpose: Finds the minimum and maximum value and their
positions in a data array of reals, counting the BLANK
values. Especially for finding the minimum and maximum
in a subset.
File: minmax.c
Author: K.G. Begeman
Use: CALL MINMAX4( DATA , Input REAL ARRAY
NDAT , Input INTEGER
AMIN , In/Output REAL
AMAX , In/Output REAL
IMIN , In/Output INTEGER
IMAX , In/Output INTEGER
NBLANK, In/Output INTEGER
COUNT ) In/Output INTEGER
DATA Data array to operate on.
NDAT Number of data points in DATA.
AMIN Minimum value.
AMAX maximum value.
IMIN Offset of minimum.
IMAX Offset of maximum.
NBLANK Total number of blanks.
COUNT On input, the number of data points
checked so far, on output the number
of data points checked.
Example: COUNT = 0
REPEAT
CALL GDSI_READ(SET,C1,C2,A,SIZE,N,I_ERR)
CALL MINMAX4(A,N,AMIN,AMAX,IMIN,IMAX,NBLANK,COUNT)
UNTIL (I_ERR .EQ. 0)
WRITE(*,*) ' The number of blanks is:',NBLANK
etc.
Note: If all values in the data array have the BLANK value,
the minimum and maximum will also be set to BLANK.
Updates: Jul 22, 1989: KGB, Document created.