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

ULARC

JohnNichols
Valued Contributor II
780 Views
DO 211 N=1,NUMSFT
        Read (sr,*, end = 1005, err = 1005)N_DUM, AA(N), XI(N), YBAR(N), E(N),SKII(N),SKJJ(N),SKIJ(N),nsfsci(n),NSFSCJ(N)
        AA(N) = AA(N) * (1.0+0.05*R1A)
        XI(N) = XI(N) * (1.0+0.05*R1B)
        E(N) = E(N) * (1.0+0.05*R1C)
        write (sw,220)N,AA(N),XI(N),E(N),YBAR(N),SKII(N),SKJJ(N),SKIJ(N),nsfsci(n),nSFSCJ(N)
        
211 CONTINUE

210 FORMAT(I5,6F10.0,2I5)
215 FORMAT(/////' STIFFNESS TYPE TABLE'//' STIFF.',3X,'SECTION',2X,'MOMENT OF',3X,' YOUNGS    Y',6X,' STIFFNESS COEFFICIENTS' ,3X,'STRENGTH TYPES'/,' TYPE' ,3X,'    AREA' ,2X,'  INERTIA' ,2X,'   MODULUS',2X,'BAR',6X,'KII',5X,'KJJ',5X,'KIJ',5X,' END I  END J'//)
220 FORMAT(I4,2X,2E11.3,E11.3,1X,F5.3,2X,3F8.3,3X,I4,2x,I6)

    !
    !     SECTION STRENGTH TYPE TABLE
    !
    READ (sr,*, end = 1006, err=1006) (N,YMP(N),YMN(N),ROTCP(N),ROTCN(N),M=1,NUMCST)
    write (sw,240) (N,YMP(N),YMN(N),ROTCP(N),ROTCN(N),N=1,NUMCST)

ULARC developed by Powell's group at UCB in the late 1960s, is a good program for quick and dirty analysis.  I am using it to look at some quick and dirty problems in a place a long way away where there is limited information.  

I was making some minor amendments to look at Structural Reliablity problems, just playing, and I noticed for the first time the difference in the input method in line2 and line 19, one is wrapped in an external do loop and one in an internal do loop.   Will they generate equivalent assemby code?  

 

0 Kudos
14 Replies
jimdempseyatthecove
Black Belt
763 Views

I think you meant line 17?

Also, line 17 local iterator index M, whereas the subscripts are using index N. This looks like an error in programming (unless you want to read forward NUMCST records overwriting the same variables at index N).

Jim Dempsey

 

JohnNichols
Valued Contributor II
718 Views

No, the blasted thing works, it has been like that since 1968.  It must read N set to 1 and then set YMP(1) etc.   and then set N to 2, all done in the one line, repeated for M which is never used except as a counter. 

Fortran must separate the reads in assembler so it does N first and then YMP(N) with N fully assigned.  I have programmed in assembler once and then decided life was to short.  I wrote a program that sounded like a machine gun.  

 

The first do  is only doing more work as I added the extra stuff,  

 

Powells' group at UCB were good Fortran programmers for the time.  The guy that wrote ULARC died in his 40's, I tracked down his wife and told her how good he was.  

 

My first boss did a structural masters at UCB and bought Powell's programs on a tape.  I had control data run the tape onto floppies for the programs I used.  It gave us a huge commerical advantage in modelling large coal bins. 

jimdempseyatthecove
Black Belt
706 Views

RE: READ (sr,*, end = 1006, err=1006) (N,YMP(N),YMN(N),ROTCP(N),ROTCN(N),M=1,NUMCST)

>>No, the blasted thing works, it has been like that since 1968. 

That very well have worked in 1968 pre-optimizing compilers, or now in Debug build, but this may be an issue with optimized code depending on the particulars of the Fortran standard regarding the volatility of indices in the read-in list. Note, this is not completely unlike redefining the loop control variable from within a DO loop. IOW, at what point in time is N evaluated?

 Perhaps Steve L. can respond to this?

 

Jim Dempsey

 

 

JohnNichols
Valued Contributor II
702 Views

Ah...........  I only use debug mode even when I put it on a far away computer.  Release is a pain.  

I just saw it yesterday, while I was trying to turn ULARC in a Monte Carlo system.   I am having some interesting issues with MKL and the Gaussian distributions.  

I have fixed it so it is proper in a modern sense.  

It is just fun to look at the olden days.  

jimdempseyatthecove
Black Belt
761 Views

As for efficiency, generate the assembly code (or use the debugger and examine the disassembly). Your line 1 loop is performing more work than simply reading in the arrays.

Jim Dempsey

Ron_Green
Moderator
759 Views

I think looking at the assembly with -S is the right answer. 

The optimizer is sure to get involved with the first DO loop.  So settings around optimization, vectorization, and FP model come into play and will affect the assembly for this loop.   there are FP ops in the DO loop, but not in the IO Implied Do on line 17 so the optimizer may just pass over it and leave alone and toss it to the FRTL. 

Our FRTL guru said about the same "only way to tell really is to look at the assembly" since there are things outside of the Fortran Front End at play here.

 

JohnNichols
Valued Contributor II
717 Views

Ron:

Programs become so complex, one person cannot know it all.  

Thanks 

I am going to change the code so both reads are inside full do loops. Makes it easier to read and remove the N. 

John

JohnNichols
Valued Contributor II
628 Views

Jim:

I downloaded the Ularc program from the UCB site and the manual.  They are attached.  

 

These files were updated in 1986 by someone at Peking University.  It is interesting to look at the old code.  

John

 

JohnNichols
Valued Contributor II
627 Views

I have always wondered why a natural logarithm is log   and not ln in Fortran? 

Steve_Lionel
Black Belt Retired Employee
617 Views

Both log and ln are used in math for this function. 

JohnNichols
Valued Contributor II
609 Views

We used log tables in high school and log meant base 10 and ln meant base e.  

mecej4
Black Belt
607 Views

The name "ln" is attributable to Irving Stringham; see Article 75 of his book, Uniplanar Algebra. Adoption of this notation across the pond was slow.

JohnNichols
Valued Contributor II
605 Views

My Kaplan and Lewis has a nice explanation on page 41, saying that Ln is modern and log is old fashioned for natural logarithm.  Book published in 1971 although I am sure there are old KL versions.  

I have always used KL for my math since Feb 1975. 

JohnNichols
Valued Contributor II
603 Views

Neat and thank you - a fun read, would have made an interesting textbook, a bit like my fluid mechanics in Physics 2. 

Reply