grey layout spacer                                                 NEAR REAL-TIME       NOTIFICATIONS       PRODUCTS      
print page
 

Reading and plotting an ASCII data file with FORTRAN

The ASCII data files can be read with FORTRAN for further processing. As mentioned in the ASCII data format specification, the data file has a number of comment lines, which need to be skipped when reading the file.

 
The Fortran-77 sample program so2ascread_f77.f reads the data from a single data file into a set of arrays, and issue a few notes to show that it has read the file.

The header of the sample program specifies how to compile and use it:

!
! Compilation:
!
!    FC  -o so2ascread_f77  so2ascread_f77.f
!
! where 'FC' is your favourite Fortran-77 compiler.
! (With '.f' as extention, the file can also be
! compiled with a Fortran-90 compiler.)
!
! Usage:
!
!    so2ascread_f77  SO2datafile
!
! For example:
!
!    so2ascread_f77  so2cd20070321_011537.dat
!
Issuing the latter command (prepending the appropriate path to the filename) gives the following output to the screen:

 --- Reading datafile ...
 --- Number of data lines read:     3633
     Date and time of first pixel: 20070321 015449.912
                       last pixel: 20070321 022701.108

The actual reading of the data file is done with a subroutine, so that it is easy to make the program read multiple data files.

 
Reading with Fortran-90 is quite similar, though then it is possible to load the data in one structure, rather than in separate arrays.

 
Link naar de website van het Federaal Wetenschapsbeleid      grey layout spacer Link naar de Federale Portaalsite
 
TEMIS Home Page  PROMOTE Home Page  O3M SAF Home Page Last update on 09 Dec 2010