Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Peculiar PRINT statement behavior

William_S_1
Beginner
389 Views

The subroutine I am uploading has an anomaly I can't explain.

Around line 61 there is a PRINT statement for the array QU(0:NQU)

It does not print the array, just the opening character string.

I checked with the debugger, and the value NQU is just as it should be, a positive number.

furthermore the other arrays DO print out as desired -

using the same Format statement.

So I am wondering - what is special about that array that would trigger this problem?

BTW, I have a special reason for dimensioning the arrays the way I do,

starting with 0 as the first element, but I am wondering if that "fools" the compiler.

I tried taking the array QU out of the calling sequence, but that had NO effect.

 

 

0 Kudos
12 Replies
William_S_1
Beginner
389 Views

I can put everything into a special project if you need to RUN it.

How do I upload a whole project at once?

0 Kudos
Steven_L_Intel1
Employee
389 Views

ZIP the project folder and attach that.

0 Kudos
William_S_1
Beginner
389 Views

OK, lets hope I did this right - - 

The PRINT statement is at line 53 of the routine IDIV.

These routines are supposed to simulate long division with integers,

so its a package that does operations with very large integers.

You can put a read(*,*) to make it stop at line  54.

0 Kudos
Steven_L_Intel1
Employee
389 Views

Your ZIP doesn't include the sources, and you didn't attach all of them.

0 Kudos
WSinc
New Contributor I
389 Views

I zipped the entire folder with all the sources in it, and when I moved into another computer, all the sources were there.

so I don't see why you say that.

0 Kudos
mecej4
Honored Contributor III
389 Views

The only Fortran source files in your zip archive are the *genmod.f90 files generated by the compiler. There is not a single original source file in the zip from which those interface checking files could be generated.

List the names of your original Fortran source files, and we can check.

0 Kudos
William_S_1
Beginner
389 Views

OK, here it is again -

I think some of the files were attached to a project in another folder.\

This one should have 7 source files in it.

You can see where I printed the number NQU, but the array QU does not print.

Thats around line 53 of the routine IDIV.

QU(0:NQU) should print out NQU+1

quantities, right?

I also tried ( QU(KK),kk=0,NQU )

but got the same result.

0 Kudos
IanH
Honored Contributor II
389 Views

You've got two character edit descriptors (i.e. two letter A's ) in the format specification (labelled 102), but you don't have two character things in the item list in the print statement.

0 Kudos
William_S_1
Beginner
389 Views

OK, I see where I forgot to put the BLANKS in -

But why didn't it flag an error when I tried to print an integer 

with an A descriptor?

0 Kudos
Steven_L_Intel1
Employee
389 Views

Because we allow that to work by default - some people used such a feature. There is an optional check for format mismatch you can turn on.

0 Kudos
IanH
Honored Contributor II
389 Views

The mismatch isn't detected with /warn:all /check:all /stand.  is something else required?
 

0 Kudos
mecej4
Honored Contributor III
389 Views

The option /check:format appears to catch some mismatches between format descriptors and I/O list elements.

[fortran]program tfmt
integer ::          i = 90    ! 'Z'
character(len=1) :: cz = 'Z'
!
write(*,'(1x,A5)')i       !no error
write(*,'(1x,I8)')cz      !flagged
!
end program tfmt[/fortran]

0 Kudos
Reply