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

Resources for list of statements

mechprog
Beginner
758 Views

Does anyone have any good available resources for summary of statements, structures, etc for FORTRAN 77,just like the link below, but something more full and complete. Thanks.

http://www.nsc.liu.se/~boein/f77to90/a2.html

0 Kudos
15 Replies
Steven_L_Intel1
Employee
758 Views
Is it specifically FORTRAN 77 you want, and if so, why? There are links to the two most recent Fortran standards on this forum's main page. You can also look at our Language Reference, part of the compiler documentation, also linked. It has an "A-Z reference" which summarizes statements and intrinsics.
0 Kudos
mechprog
Beginner
758 Views
Thanks Steve, Yes it is specifically fortran 77 I needed, as I am writing abaqus subroutines, which require the use of .FOR subroutines, which seems to be based on the FORTRAN 77 formats.
0 Kudos
TimP
Honored Contributor III
758 Views
There's no obvious reason why your requirements restrict you from using f95 code, provided that any interface blocks match Abaqus usage. Even if you restrict yourself to .for file names (with default fixed form source format), you aren't limited to F77.
0 Kudos
Steven_L_Intel1
Employee
758 Views
This is a common misconception. .FOR means fixed-form source, not any specific revision of the standard. Yes, with F77 that was your only choice, but you'll have a hard time finding a compiler that supports only F77 (unless you insist on using g77). You can write any Fortran 2008 program in fixed-form source, though fixed-form is "deprecated".

I would be quite surprised if Abaqus cared what the source form was.
0 Kudos
mechprog
Beginner
758 Views

It does seem that all Abaqus subroutines are written in the .FOR format and all the examples I have seen seem to exactly follow the Fotran 77 structure. I am currently using Intel Fortran 10.1 which abaqus recommend I use for the version of abaqus I am using. I have attached an example subroutine to this post. I was so confused at the beginning why I could not understand the syntax, but now I have loads of old FORTRAN 77 book the code starts to make more sense to me as I am not a programming by field.

Thanks.

0 Kudos
TimP
Honored Contributor III
758 Views
You might substitute some Fortran 90 syntax without affecting the results, e.g.

if(time <= 0.2) then
c = 1.113e-6 * h
else if( time(2) > 0.2 .and. time(2) <= 5.0 )then

From a pedantic viewpoint, the use of lower case didn't strictly conform to Fortran 77.

The use of default data typing is a practice held over from 50 years ago which was frowned upon even before Fortran 77 was introduced.

real flow(kflow),time(2),coords(3),c,h

would have the same effect with better maintainability, and that's Fortran 66.

I disagree with the comment about INCLUDE as a reason for fixed format. I do agree that you would not attempt to replace the INCLUDEs with a Fortran 90 equivalent (USE).

0 Kudos
Arjen_Markus
Honored Contributor I
758 Views
I suspect that one reason for the fixed form source code is that you need include file such as
"ABA_PARAMS.INC" in your example.

As Steve already mentioned, the source form (fixed form) is not tied to the standard. Having to
use fixed form still allows you to use Fortran 90/95 constructs (Intel Fortran 10.1 conforms to
that standard). So you could still use, say:

c Initialise the flow array
flow = 0.0

an array operation, because the flow array is dimensioned to kflow elements.

Regards,

Arjen
0 Kudos
Les_Neilson
Valued Contributor II
758 Views

To add to (and emphasise) what others have said.

F77 style coding is supported by modern compilers, it is a subset of the current Fortran standard.
Intel Fortran 10, while not exactly new :-) , is one of those compilers

A ".for" file means the contents of the file follow the rules for fixed format
In which case this means columns are important.

However theFortran code itselfcould be F95 -with whole array operations, allocatables, modules etc.
By all means learn Fortran from the resources you have, just do not think that you are constrained to do things the F77 way. Fortran has improved over the last 40 years.

Les

0 Kudos
mechprog
Beginner
758 Views
Thanks for your advice and input everyone, remember I am approaching this as a mechanical engineer and not a Fortran programmer, so I am trying to keep things simple and consistent i.e. stick to Fortran 77 or other in order to help me solve my problem. Whilst I thoroughly enjoy learning the programming side of things it is sometimes frustrating when the two get mixed up. This is not a criticism of Fortran or programming, but the challenges I am finding with getting to grips with it all.

Posting on this forum has been a massive help and I am sure there will be many posts to come :-)

P.S. I noticed that with abaqus it records all your actions in the GUI into a python script which you can later add to change, etc. Is there anything similar to this for fortran? I.e. where you can build a flow chart and it converts this to code? It's probably cheating though ;-)

Thanks.
0 Kudos
TimP
Honored Contributor III
758 Views
The example you cite has an obsolete practice from 50 years ago (default data typing), as well as obsolescent practices from 20 years ago. During that time, I too was a mechanical engineer, by degree and employment. I (and more so, my customers) retain a resistance to adoption of new Fortran syntax, but there is no reason here to avoid the aspects of current Fortran which clarify your task.
0 Kudos
mechprog
Beginner
758 Views

Thanks TimP, its nice to hear you are also from a Mechanical Engineering background, but quite clearly have contributed to the computer science arena :-). I completely agree, I would use new rather than old, the problem is SIMULIA still seem to think in "old money" when it comes to developing subroutines. This is not a criticism, its just that they are probably going by the philosophy "if it ain't broken, don't fix it".

I would like to take my programming to the current and future directions, i.e. I do not want to be learning 50 year old code, etc. Hence my question about new ways of writing codes and programmes... i.e. I have heardof flowbased programming, but notsure if thisthe sort of thing I am after.Does anyone input on this?

Thanks

0 Kudos
j_clausen
Beginner
758 Views
Hi mechprog

I am in civil engineering and I use Fortran with Abaqus from time to time. All the code I write for Abaqus is based on the 95 and later standards. So as the previous posts state there is absolutely no need to use Fortran 77, expecially if you are new to the language. Also, I have never had any problems with using newer versions of Intel Fortran with Abaqus, even though Abaqus recommends, for example, Ifort 10.1.


j_clausen
0 Kudos
mechprog
Beginner
758 Views

Hi J_clausen,

Thanks for your input on this. It's nice to know I can use 95 as well, although, both are just as new to me. It's been very steep learning curve so far.

In order to do this, do you need to make the changes to the .env file as you suggested in another post? (see link below):

http://software.intel.com/en-us/forums/showthread.php?t=86477

mechprog

0 Kudos
Wendy_Doerner__Intel
Valued Contributor I
758 Views
If you want to make sure the compiler is using only the Fortran 95 standard you can do so by following the excerpt below from the documentation. By default the compiler will accept 95 plus later features from 2003 and 2008 (see the documentation for a full list).

"You can ensure your program enforces the Fortran standard by using the -stand (Linux* OS and Mac OS* X) or /stand (Windows* OS) compiler option with the appropriate keyword (f90, f95, or f03) to flag extensions. The none keyword turns off enforcement of a particular Fortran standard. You can also use the following compiler options to set the Fortran standard: -std90 or /std90, -std95 or /std95, and -std03 or /std03. "

------

Wendy

Attaching or including files in a post

0 Kudos
j_clausen
Beginner
758 Views

To mechprog

No, you don't need to change the .env-file in order to use any Fortran standard. One of the nice things about Fortran is thatit's backward compatible.The mentioned change in the .env-file is only needed if you want to use free in stead of fixed form. (as mentioned by Steve in an earlier post, the free/fixed form is independent of the Fortran standard version)

Best regards
j_clausen

0 Kudos
Reply