My question is pretty simple. I have inherited some old Fortran code and I am looking through it to get a general feel for it. I noticed that it uses the STRUCTURE instead of TYPE. Is there any practical difference between the two? Are there any other benefits to using TYPE other than being more up-to-standard?
This question is of a more philosphical kind. I (think I) know what rewriting code means in terms of testing etc, so I am not looking for that "is it really worth it" kind of answer. More of a technical one.
I read up a bit on STRUCTURE and TYPE, the first on the interwebs, the second in "Modern Fortran explained", but I did not find more information other than "this is how it was done before Fortran 90, this is how we do it today".
STRUCTURE/RECORD is a DEC Fortran extension from the mid 1980s, predating the Fortran 90 standard and derived types. In general terms, the two differ in one major way - STRUCTUREs can have UNIONs, standard Fortran has no such concept.
How many newer standard features you can use in STRUCTUREs depends on the particular compiler. The DEC-heritage compilers (Compaq and Intel) pretty much treat these as equivalents, with some minor exceptions. (You can't say SEQUENCE in a STRUCTURE, for example.) Other compilers may be more restrictive.
My advice is to use the standard derived type syntax unless you must have unions, and then recognize your code's portability is minimized.