Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

passing arrays doesn't work

milenko1976
Beginner
926 Views
I have my module where I calculate apr1dsens,but when I call it in the main program I got some stupid values:
0.0000000E+00 0.0000000E+00 0.0000000E+00 0.0000000E+00 0.0000000E+00
0.0000000E+00 0.0000000E+00 0.0000000E+00 0.0000000E+00 0.0000000E+00
0.0000000E+00 0.0000000E+00 0.0000000E+00 0.0000000E+00 0.0000000E+00
0.0000000E+00 0.0000000E+00 0.0000000E+00 0.0000000E+00 0.0000000E+00
0.0000000E+00 0.0000000E+00 0.0000000E+00 0.0000000E+00 0.0000000E+00
0.0000000E+00 0.0000000E+00 0.0000000E+00 0.0000000E+00 0.0000000E+00
0.0000000E+00 0.0000000E+00 2.7352493E-18 3.2547820E-17 -7.0026940E-16
9.2288178E-13 -5.7592910E-11 -1.8561423E-10 -5.2476946E-11 3.1348585E-12
-3.3206750E-11 -1.8173362E-11 -1.4415173E-12 -3.9798069E-12 2.4102038E-12
3.6711172E-12 9.3366406E-13 5.1709132E-14 2.2899610E-15 -5.3728867E-15
2.7020611E-15 3.0098718E-16 -1.4520080E-05 1.7714583E-05 -1.0487682E-05
-1.0487465E-06 0.0000000E+00 0.0000000E+00 0.0000000E+00 0.0000000E+00
0.0000000E+00 0.0000000E+00 0.0000000E+00 0.0000000E+00 0.0000000E+00
0.0000000E+00 0.0000000E+00 0.0000000E+00 0.0000000E+00 0.0000000E+00
0.0000000E+00 0.0000000E+00 1.6734045E-19 1.5395922E-18 -3.8514049E-17

This is part of the output.I am attaching the whole program.
0 Kudos
6 Replies
Steven_L_Intel1
Employee
926 Views
The call to sensd2hmod_mod1 in ircg.for is inconsistent with the actual routine. You pass four arguments to a routine with only three, and it looks as if the second one shouldn't be there.
0 Kudos
milenko1976
Beginner
926 Views
Thanks Steve.
Well the problem si even if I change this to sensd2hmod_mod1(iper,apr3dsens,apr4dsens) and compile it I get output:
0.0000000E+00 0.0000000E+00 0.0000000E+00 0.0000000E+00 0.0000000E+00
0.0000000E+00 0.0000000E+00 0.0000000E+00 0.0000000E+00 0.0000000E+00
0.0000000E+00 0.0000000E+00 0.0000000E+00 0.0000000E+00 0.0000000E+00
0.0000000E+00 0.0000000E+00 0.0000000E+00 0.0000000E+00 0.0000000E+00
0.0000000E+00 0.0000000E+00 0.0000000E+00 0.0000000E+00 0.0000000E+00
0.0000000E+00 0.0000000E+00 0.0000000E+00 0.0000000E+00 0.0000000E+00
0.0000000E+00 0.0000000E+00 3.9282067E-08 4.4769473E-07 1.6902050E-05
-1.3822162E-03 -1.7433049E-09 -1.5438827E-08 9.2458697E-07 -1.3776307E-04
-1.2786566E-02 -3.6022477E-02 -1.5723234E-02 4.8045099E-02 1.375854
0.6727987 0.1763481 0.1299756 -1.3305345E-02 -2.1294735E-02
-4.9546692E-03 -3.3784957E-04 -1.3261051E-05 1.7116079E-05 -1.0121098E-05

Again wrong values,the appropriate one are written in file 114.So something else is sisue.
0 Kudos
mecej4
Honored Contributor III
926 Views
Your program has bugs, and persons writing code are expected to learn to use the tools provided by the compiler to detect bugs.

Compile with at least subscript checking turned on and run your code. You will see subscript overruns.
0 Kudos
milenko1976
Beginner
926 Views
Thanks.
I wiill try with -CB.
0 Kudos
Steven_L_Intel1
Employee
926 Views
Did you write this code? Your responses suggest that you don't understand what it does.
0 Kudos
milenko1976
Beginner
926 Views
I have wrote one part of it,I know where the problem is now.
0 Kudos
Reply