Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Comunicados
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.

Print error

JohnNichols
Colaborador valorado III
1.920 Visualizações
!     ***** 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 Respostas
andrew_4619
Colaborador honorário III
1.903 Visualizações

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.

Steve_Lionel
Colaborador honorário III
1.902 Visualizações

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.

andrew_4619
Colaborador honorário III
1.898 Visualizações

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.

jimdempseyatthecove
Colaborador honorário III
1.880 Visualizações

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

Jim Dempsey

andrew_4619
Colaborador honorário III
1.851 Visualizações
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.
Steve_Lionel
Colaborador honorário III
1.874 Visualizações

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

andrew_4619
Colaborador honorário III
1.851 Visualizações
Yes maybe, some unknowns to ponder.
JohnNichols
Colaborador valorado III
1.842 Visualizações

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,/,&
JohnNichols
Colaborador valorado III
1.838 Visualizações

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.   

Responder