I am using Fortran Powerstation 4.0
and I am trying to read a file with the following structure:
Aarhus, Denmark OVPID: 034 Latitude: 56.170 deg. Longitude: 10.200 deg. Altitude: 53 m
Value 1 (year) : Year
Value 2 (mon) : Month
Value 3 (day) : Day
Value 4 (doy) : Day of Year
Value 5 (time) : Seconds after UTC midnight (s)
Value 6 (dist) : Distance to station (km)
Value 7 (#pts) : Number of points used in overpass
Value 8 (sza) : Solar zenith angle (deg.)
Value 9 (ptoz) : Profile total ozone (DU)
Value 10-30 : Layer ozone amount (DU) for 21 layers
Layer Bottom Pressure (hPa) 1013.25 639.3 403.4 254.5 160.6 101.3 63.9 40.3 25.5 16.1 10.1 6.39 4.03 2.55 1.61 1.01 0.639 0.403 0.254 0.161 0.101
year mon day doy time dist #pts sza ptoz L1 L2 L3 L4 L5 L6 L7 L8 L9 L10 L11 L12 L13 L14 L15 L16 L17 L18 L19 L20 L21
2012 02 02 33 43035 95.7 1 73.1 300.3 11.35 8.32 10.32 22.86 37.13 42.06 42.64 36.56 27.90 20.66 15.21 10.86 7.05 3.97 1.95 0.862 0.363 0.150 0.062 0.025 0.017
2012 02 03 34 41898 191.0 1 73.0 338.3 11.76 8.90 11.35 26.04 43.78 50.92 51.68 42.41 30.01 20.84 15.06 11.03 7.25 3.93 1.86 0.841 0.369 0.155 0.064 0.026 0.018
When running:
program project
integer year, mon, day, doy, time
open(1,file='C:\test.txt')
read(1,1000, end=35) year, mon, day, doy, time
close(1)
35 continue
1000 format(i4, 1x, i3, 1x, i2, 1x, i5)
1001 format(i4)
end
I get the following error:
run-time error F6101: READ(C:\test.txt)
- invalid INTEGER
I found out that this error is due to the 15 first lines of the file, since when I erase them from the file my code runs smoothly. I was wondering how I can skip reading the first 15 lines of the test file without having to mess with the file itself. I am looking for something like the skiprow
parameter used in python.