Write position



Hello,

I'd like to write the number of data at the beginning of the result
file.

I tried the following code
===============================
NCOUNT = 0
DO N = 1, 1000000000, 1
NCOUNT = NCOUNT + 1
RESULT( N ) = some calculations
WRITE( 99, * ) RESULT( N )
IF( RESULT( N ) > 10. ) EXIT
ENDDO
REWIND( 99 )
WRITE( 99, * ) NCOUNT
===============================
but the result shows NCOUNT only without any RESULT( N )

How can I write NCOUNT in the first line of the 'fort.99' like
following

fort.99 example
5
0.01
0.2
0.5
1.0
20.0
.