I have been following the book by Stephen J chapman - Fortran for scientist and engineers (2017 edition). I have some interesting concepts in it, but I wonder if those things would be applicable in Abaqus User-sub-routines as I am unaware of the version of Fortran used by the latest versions of Abaqus such as 2021. Currently, I able to use DO LOOP constructs with EXIT & CYCLE statements, that means somehow, I able to use Fortran 90 standards. So, can I also use WHERE & FORALL constructs in my subroutines? Please shed some light on this topic. Thank you!
Through Internet searches I have found following answers.
i) Users can program subroutine with fix or free format as they like. Fix format is the default format which follows Fortran77. When user change the environment file to enable the free format, the Fortran95 program can be identified by Abaqus. The file suffix is not important. (reference: (16) Which Version of Fortran (Fortran77,90 or 95) does Abaqus support for running user subroutines? | ResearchGate)
ii) By default, Abaqus expects user subroutines to be written in the older fixed-format style. However, you can use just about any modern language feature supported by your compiler.1 This includes using modules, new Intrinsics, derived types, etc., as long as you adhere to the fixed-format style.
But if you find the fixed-format restrictive, like I do, then you have options. To use the free-format style, you may either:
1. Modify the abaqus environment file: The environment file is a system-wide settings file that affects all users. You may change settings here, but you should not do it without consulting your team first. Alternatively, make a copy of the .env file and put it in your work directory so that any changes are localized to your analyses only (your coworkers will thank you).
Find the compile_fortran variable. Add '/free' (windows) or '-free' (linux) to the list. If you see '/extend-source' there, you will probably need to remove it.
2.Use a compiler directive: Rather than modifying the .env file, you can place a compiler directive at the beginning of your subroutine. In my experience, this allows my subroutines to compile and run anywhere they are used.
Assuming you are using Intel Fortran, the directive is: !DIR\$ FREEFORM
(reference: Using subroutines written in Fortran 90 with Abaqus Standard - Stack Overflow)