1 year ago
#72346
Chloé Benz
Fortran 77 compilation for IRI 2016 model
I've been trying to compile the IRI model lately, somewhat unsuccessfully. I've downloaded the IRI 2016 + common files + indices files, and using the test file to, well, test. I'm using gfortran (though the code is in fortran 77) with the -std=legacy flag (to remove unnecessary warnings, but I think the code is compiled as fortran 2003 or something). The linking/compilation command I'm using is:
gfortran -std=legacy -o iri iritest.for irisub.for irifun.for iritec.for iridreg.for igrf.for cira.for iriflip.for
This gives me the iri.exe
executable, and yields a few warnings of the form:
Warning: Array reference at (1) out of bounds in loop beginning at (2)
(at compile time).
When I run the executable and enter the inputs through the console, I'm getting the following flags:
Note: The following floating-point exceptions are signalling: IEEE_UNDERFLOW_FLAG IEEE_DENORMAL
and the code apparently does what it's supposed to (outputs a nonempty file named fort.7
with the results). I've read that the IEEE flags I'm getting are rather common, and that I can disregard them, but the out of range warnings are a bit more concerning to me.
I'm also getting the following warnings:
igrf.for:298:10:
296 | DO 3 N=3,3333
| 2
297 | C*****CORRECTOR (FIELD LINE TRACING)
298 | P(1,N)=P(1,N-1)+STEP12*(5.*P(4,N)+8.*P(4,N-1)-P(4,N-2))
| 1
Warning: Array reference at (1) out of bounds (3333 > 100) in loop beginning at (2)
igrf.for:298:17:
296 | DO 3 N=3,3333
| 2
297 | C*****CORRECTOR (FIELD LINE TRACING)
298 | P(1,N)=P(1,N-1)+STEP12*(5.*P(4,N)+8.*P(4,N-1)-P(4,N-2))
| 1
Warning: Array reference at (1) out of bounds (3332 > 100) in loop beginning at (2)
igrf.for:298:37:
296 | DO 3 N=3,3333
| 2
297 | C*****CORRECTOR (FIELD LINE TRACING)
298 | P(1,N)=P(1,N-1)+STEP12*(5.*P(4,N)+8.*P(4,N-1)-P(4,N-2))
| 1
Warning: Array reference at (1) out of bounds (3333 > 100) in loop beginning at (2)
igrf.for:298:47:
296 | DO 3 N=3,3333
| 2
297 | C*****CORRECTOR (FIELD LINE TRACING)
298 | P(1,N)=P(1,N-1)+STEP12*(5.*P(4,N)+8.*P(4,N-1)-P(4,N-2))
| 1
Warning: Array reference at (1) out of bounds (3332 > 100) in loop beginning at (2)
igrf.for:298:56:
296 | DO 3 N=3,3333
| 2
297 | C*****CORRECTOR (FIELD LINE TRACING)
298 | P(1,N)=P(1,N-1)+STEP12*(5.*P(4,N)+8.*P(4,N-1)-P(4,N-2))
| 1
Warning: Array reference at (1) out of bounds (3331 > 100) in loop beginning at (2)
igrf.for:299:10:
296 | DO 3 N=3,3333
| 2
......
299 | P(2,N)=P(2,N-1)+STEP12*(5.*P(5,N)+8.*P(5,N-1)-P(5,N-2))
| 1
Warning: Array reference at (1) out of bounds (3333 > 100) in loop beginning at (2)
igrf.for:299:17:
296 | DO 3 N=3,3333
| 2
......
299 | P(2,N)=P(2,N-1)+STEP12*(5.*P(5,N)+8.*P(5,N-1)-P(5,N-2))
| 1
Warning: Array reference at (1) out of bounds (3332 > 100) in loop beginning at (2)
igrf.for:299:37:
296 | DO 3 N=3,3333
| 2
......
299 | P(2,N)=P(2,N-1)+STEP12*(5.*P(5,N)+8.*P(5,N-1)-P(5,N-2))
| 1
Warning: Array reference at (1) out of bounds (3333 > 100) in loop beginning at (2)
igrf.for:299:47:
296 | DO 3 N=3,3333
| 2
......
299 | P(2,N)=P(2,N-1)+STEP12*(5.*P(5,N)+8.*P(5,N-1)-P(5,N-2))
| 1
Warning: Array reference at (1) out of bounds (3332 > 100) in loop beginning at (2)
igrf.for:299:56:
296 | DO 3 N=3,3333
| 2
......
299 | P(2,N)=P(2,N-1)+STEP12*(5.*P(5,N)+8.*P(5,N-1)-P(5,N-2))
| 1
Warning: Array reference at (1) out of bounds (3331 > 100) in loop beginning at (2)
igrf.for:302:10:
296 | DO 3 N=3,3333
| 2
......
302 | P(8,N)=STEP2*(P(1,N)*P(4,N)+P(2,N)*P(5,N))
| 1
Warning: Array reference at (1) out of bounds (3333 > 100) in loop beginning at (2)
igrf.for:302:24:
296 | DO 3 N=3,3333
| 2
......
302 | P(8,N)=STEP2*(P(1,N)*P(4,N)+P(2,N)*P(5,N))
| 1
Warning: Array reference at (1) out of bounds (3333 > 100) in loop beginning at (2)
igrf.for:302:31:
296 | DO 3 N=3,3333
| 2
......
302 | P(8,N)=STEP2*(P(1,N)*P(4,N)+P(2,N)*P(5,N))
| 1
Warning: Array reference at (1) out of bounds (3333 > 100) in loop beginning at (2)
igrf.for:302:38:
296 | DO 3 N=3,3333
| 2
......
302 | P(8,N)=STEP2*(P(1,N)*P(4,N)+P(2,N)*P(5,N))
| 1
Warning: Array reference at (1) out of bounds (3333 > 100) in loop beginning at (2)
igrf.for:302:45:
296 | DO 3 N=3,3333
| 2
......
302 | P(8,N)=STEP2*(P(1,N)*P(4,N)+P(2,N)*P(5,N))
| 1
Warning: Array reference at (1) out of bounds (3333 > 100) in loop beginning at (2)
igrf.for:303:13:
296 | DO 3 N=3,3333
| 2
......
303 | C0=P(1,N-1)**2+P(2,N-1)**2
| 1
Warning: Array reference at (1) out of bounds (3332 > 100) in loop beginning at (2)
igrf.for:303:25:
296 | DO 3 N=3,3333
| 2
......
303 | C0=P(1,N-1)**2+P(2,N-1)**2
| 1
Warning: Array reference at (1) out of bounds (3332 > 100) in loop beginning at (2)
igrf.for:304:13:
296 | DO 3 N=3,3333
| 2
......
304 | C1=P(8,N-1)
| 1
Warning: Array reference at (1) out of bounds (3332 > 100) in loop beginning at (2)
igrf.for:305:14:
296 | DO 3 N=3,3333
| 2
......
305 | C2=(P(8,N)-P(8,N-2))*0.25
| 1
Warning: Array reference at (1) out of bounds (3333 > 100) in loop beginning at (2)
igrf.for:305:21:
296 | DO 3 N=3,3333
| 2
......
305 | C2=(P(8,N)-P(8,N-2))*0.25
| 1
Warning: Array reference at (1) out of bounds (3331 > 100) in loop beginning at (2)
igrf.for:306:14:
296 | DO 3 N=3,3333
| 2
......
306 | C3=(P(8,N)+P(8,N-2)-C1-C1)/6.0
| 1
Warning: Array reference at (1) out of bounds (3333 > 100) in loop beginning at (2)
igrf.for:306:21:
296 | DO 3 N=3,3333
| 2
......
306 | C3=(P(8,N)+P(8,N-2)-C1-C1)/6.0
| 1
Warning: Array reference at (1) out of bounds (3331 > 100) in loop beginning at (2)
igrf.for:307:13:
296 | DO 3 N=3,3333
| 2
......
307 | D0=P(6,N-1)
| 1
Warning: Array reference at (1) out of bounds (3332 > 100) in loop beginning at (2)
igrf.for:308:14:
296 | DO 3 N=3,3333
| 2
......
308 | D1=(P(6,N)-P(6,N-2))*0.5
| 1
Warning: Array reference at (1) out of bounds (3333 > 100) in loop beginning at (2)
igrf.for:308:21:
296 | DO 3 N=3,3333
| 2
......
308 | D1=(P(6,N)-P(6,N-2))*0.5
| 1
Warning: Array reference at (1) out of bounds (3331 > 100) in loop beginning at (2)
igrf.for:309:14:
296 | DO 3 N=3,3333
| 2
......
309 | D2=(P(6,N)+P(6,N-2)-D0-D0)*0.5
| 1
Warning: Array reference at (1) out of bounds (3333 > 100) in loop beginning at (2)
igrf.for:309:21:
296 | DO 3 N=3,3333
| 2
......
309 | D2=(P(6,N)+P(6,N-2)-D0-D0)*0.5
| 1
Warning: Array reference at (1) out of bounds (3331 > 100) in loop beginning at (2)
igrf.for:310:13:
296 | DO 3 N=3,3333
| 2
......
310 | E0=P(7,N-1)
| 1
Warning: Array reference at (1) out of bounds (3332 > 100) in loop beginning at (2)
igrf.for:311:14:
296 | DO 3 N=3,3333
| 2
......
311 | E1=(P(7,N)-P(7,N-2))*0.5
| 1
Warning: Array reference at (1) out of bounds (3333 > 100) in loop beginning at (2)
igrf.for:311:21:
296 | DO 3 N=3,3333
| 2
......
311 | E1=(P(7,N)-P(7,N-2))*0.5
| 1
Warning: Array reference at (1) out of bounds (3331 > 100) in loop beginning at (2)
igrf.for:312:14:
296 | DO 3 N=3,3333
| 2
......
312 | E2=(P(7,N)+P(7,N-2)-E0-E0)*0.5
| 1
Warning: Array reference at (1) out of bounds (3333 > 100) in loop beginning at (2)
igrf.for:312:21:
296 | DO 3 N=3,3333
| 2
......
312 | E2=(P(7,N)+P(7,N-2)-E0-E0)*0.5
| 1
Warning: Array reference at (1) out of bounds (3331 > 100) in loop beginning at (2)
igrf.for:314:15:
296 | DO 3 N=3,3333
| 2
......
314 | 4 T=(Z-P(3,N-1))/STEP
| 1
Warning: Array reference at (1) out of bounds (3332 > 100) in loop beginning at (2)
This is what I'm getting with gfortran
compiler. I don't get any when using the Intel Fortran compiler.
Now, when I'm trying to compile the same model with a custom script instead of the test script in iritest.for
, I get the same out of range warnings at compile time and a few errors at runtime, as well as a fort.7
file containing only -1s (which is the value for "no value/result"). The errors/flags at runtime are:
Note: The following floating-point exceptions are signalling: IEEE_INVALID_FLAG
and
201301** OUT OF RANGE **
The file IG_RZ.DAT which contains the indices Rz12 and IG12
currently only covers the time period (yymm) : 0- 0
In that custom script I'm only calling the subroutine IRI_SUB
present in the irisub.for
file, with inputs declared within the script+read from a text file. I've made sure to include the lines that are mandatory to include (see iritest.for
). The inputs from the text file are indeed read (verified with a few WRITE
). I know the custom script worked at some point in time because it's from a thesis made in the laboratory I'm currently working for. I've run out of ideas as of what I can try to debug this. I've tried the same with IRI 2012 and I'm getting the exact same flags/warnings/errors. Has anyone any idea of what I can try next?
EDIT: I've been able to get the custom script to yield results, but I'm not sure they are the right ones, since I've used the Intel Fortran compiler (and this one does not give me any warning anymore).
fortran
gfortran
fortran77
0 Answers
Your Answer