awips2/ncep/gov.noaa.nws.ncep.ui.nsharp/AwcNsharp/sortmtbl.f
Steve Harris b13cbb7e00 12.5.1-15 baseline
Former-commit-id: 4909e0dd166e43c22a34d96aa744f51db8a7d6c0
2012-06-08 13:39:48 -05:00

37 lines
686 B
Fortran

C* L. Hinson/AWC Corrected type definition for sindex
SUBROUTINE Sort_Mtbl(nstn,stid,thres)
INTEGER nstn
CHARACTER*(*) stid (*)
INTEGER thres (*)
INTEGER sindex
DO i=1,nstn-1
sindex=i
DO j=i+1,nstn
IF (stid(j) .gt. stid(sindex)) THEN
sindex=j
END IF
END DO
IF (i .ne. sindex) THEN
CALL Swap_Items(stid,thres,i,sindex)
END IF
END DO
RETURN
END
SUBROUTINE Swap_Items(stid,thres,i,j)
CHARACTER*(*) stid (*)
INTEGER thres (*)
INTEGER i,j
CHARACTER tstid*4
INTEGER tthres
tstid=stid(i)
stid(i)=stid(j)
stid(j)=tstid
tthres=thres(i)
thres(i)=thres(j)
thres(j)=tthres
RETURN
END