When you say a 'string' of numbers, do you mean an array of numbers?
And, when you say 'non-standard length' (so you can manipulate 5 or 50 numbers), do you mean to say simply that you need to manipulate a variable quantity of numbers?
If so, reading and manipulating a one-dimensional array of variable length is rather easy in Fortran (or any language)
Here's a simple example:
Code:
INTEGER N
REAL SCORE(100),AVE
C (Assume old Fortran-compatible record layout, with
C header indicating number of records that follow)
READ *,N
READ *,(SCORE(J)J = 1,N)
C Variable N is the size of the array SCORE
C Pass it along with the array to the subroutine
CALL MEAN(N,SCORE,AVE)
PRINT *,AVE
END
C This makes the subroutine quite straightforward
C Just total the numbers, and divide by the quantity
SUBROUTINE MEAN(N,X,BAR)
INTEGER N
REAL X(100),XBAR,SUM
SUM = 0
DO 10 J = 1,N
SUM = SUM + X(J)
10 CONTINUE
XBAR = SUM/REAL(N)
END
Of course, i may have completely misunderstood your question.