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

Print error

JohnNichols
Valued Contributor III
1,053 Views
!     ***** Printing results *****
        print *,"                            Method :: vsRng Gaussian Box Mueller."
        print *,"                            ---------------------------------------------!!-------------------------"
        print *,"                            seed=2000*(100-mul) + 100000000*j*mul"
        print *,""
        print *,"                            Parameters:"
        print 11,"                             a        = ",a
        print 11,"                             sigma    = ",sigma
        print 11,"                             Variance = ",sigma*sigma
        print 15,"                             Mult     = ",mul
        print 15,"                             seed     = ",seed
        print 15,"                             Number   = ",n

Screenshot 2023-10-05 100302.png

Any idea why the second print statement puts in a new line where there is not one. 

0 Kudos
9 Replies
andrew_4619
Honored Contributor III
1,036 Views

Dunno! Is this windows 11? Recent W11 have a defualt console that is "Windows Terminal" as opposed the "Windows Console Host", the behaviour is different in many ways. Maybe it is a 'word wrap' thing.

0 Kudos
Steve_Lionel
Honored Contributor III
1,035 Views

List-directed wraps at column 80 by default. Here's what the docs say:

There is a property of list-directed sequential WRITE statements called the right margin. If you do not specify RECL as an OPEN statement specifier or in environmental variable FORT_FMT_RECL, the right margin value defaults to 80. When RECL is specified, the right margin is set to the value of RECL. If the length of a list-directed sequential WRITE exceeds the value of the right margin value, the remaining characters will wrap to the next line. Therefore, writing 100 characters will produce two lines of output, and writing 180 characters will produce three lines of output. You can turn off the right margin using the wrap-margin compiler option or the FORT_FMT_NO_WRAP_MARGIN environment variable.

0 Kudos
andrew_4619
Honored Contributor III
1,031 Views

But there is a longer single line lower down the page so why has it broken the long line where it has? There is something more than just the 80 char wrap going on I think.

0 Kudos
jimdempseyatthecove
Honored Contributor III
1,013 Views

No. Is that text longer than the bottom "---..." line?

Jim Dempsey

0 Kudos
andrew_4619
Honored Contributor III
984 Views
Yes the line is longer but I would expect the first line of the wrap to be at max length which it clearly isn't as the line lower down is longer than it.
0 Kudos
Steve_Lionel
Honored Contributor III
1,007 Views

He didn't show the WRITE for that line. If it's formatted, then the margin doesn't apply.

0 Kudos
andrew_4619
Honored Contributor III
984 Views
Yes maybe, some unknowns to ponder.
0 Kudos
JohnNichols
Valued Contributor III
975 Views

Screenshot 2023-10-05 160451.png

 dum = 2.0/float(n)
        ttest = (sM - tM)/(sqrt(dum)*sqrt((sD + tD)/2.0))

        print *,"---------------------------------------------------------------------------------------------80----------------------"
        
        write(2,221)a,sigma, sigma*sigma,mul,seed,n
         write(*,221)a,sigma, sigma*sigma,mul,seed,n
221     format("                            Method :: vsRng Gaussian Box Mueller.",/,&
               "                            ----------------------------------------------------------------------",/,&    
               "                            seed=2000*(100-mul) + 100000000*j*mul",//,&
               "                            Parameters:",/,&
               "                            a        = ",f12.3,/,&
0 Kudos
JohnNichols
Valued Contributor III
971 Views

vsRngGaussian is not nice nor does seed play nicely.  

 

I have had to factor every single seed to get a different number set.  

The problem was I ended up with a dependent set of supposedly independent variables and then I got the same answer 10000 times.   

0 Kudos
Reply