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 have moved to the Altera Community. Existing Intel Community members can sign in with their current credentials.
29302 Discussions

Parameters not passed correctly - why??

jim_cox
Beginner
1,041 Views

I have a problem with passed parameters

On arriving at a called routine I find that values are nothing like what was originally set

The code looks like this....

CHARACTER*1 SCRAMBLED*20, KEY_SITEFILE*20
INTEGER(4) OUT_DATE(3)
LOGICAL*4 ERR

SCRAMBLED = 'ONJIAOLZ537 '
KEY_SITEFILE = 'GabitesPorter '
OUTDATE = 0
ERR = .FALSE.

CALL DECODEDATE(SCRAMBLED, KEY_SITEFILE, OUT_DATE, ERR)


But when we get there...

SUBROUTINE DECODEDATE(IN_KEY, IN_CRYPT, OUT_DATE, ERR)

CHARACTER*1 IN_KEY*20, IN_CRYPT*20
INTEGER(4) OUT_DATE(3)
LOGICAL*4 ERR


We find that...

IN_KEY = 'O '
IN_CRYPT = ' '
OUT_DATE(1) = Undefined address
OUT_DATE(2) = Undefined address
OUT_DATE(3) = Undefined address
ERR = .TRUE.


Both pieces of code reside in the same file

Any ideas what might cause this?


Thankx for your help

Jim
Desperate in Christchurch






0 Kudos
5 Replies
Steven_L_Intel1
Employee
1,041 Views

The code "looks like" that or "is" that? If I work up a complete example based on what you showed, I get different behavior. I will note that you declare OUT_DATE but assign to OUTDATE.

Which compiler and version are you using?
0 Kudos
jim_cox
Beginner
1,041 Views

The code "looks like" that or "is" that? If I work up a complete example based on what you showed, I get different behavior. I will note that you declare OUT_DATE but assign to OUTDATE.

Which compiler and version are you using?


I have since found that setting iface/:CVF sorted the problem

Thankx
0 Kudos
onkelhotte
New Contributor II
1,041 Views
Quoting - jim.cox

The code looks like this....

CHARACTER*1 SCRAMBLED*20, KEY_SITEFILE*20

Why do you use character*1 and then scrambled*20?

When you look at the first parameter of your routine, it also has only one character. Doesnt look like clean coding, using some compiler options to get rid of itis not the way to go...

Markus
0 Kudos
Steven_L_Intel1
Employee
1,041 Views
That use of *1 and *20 is legal, but confusing.

If /iface:CVF sorted the problem, then what you showed us was not representative of the actual code or organization.
0 Kudos
jim_cox
Beginner
1,041 Views
Quoting - onkelhotte

Why do you use character*1 and then scrambled*20?

When you look at the first parameter of your routine, it also has only one character. Doesnt look like clean coding, using some compiler options to get rid of itis not the way to go...

Markus

Agreed

It is nasty 20 year old code

And moving to the Intel compiler is uncovering a whole heap of "issues"

At least I now have a build that runs (sort of) and is debug-able
0 Kudos
Reply