Using subroutines written in Fortran 90 with Abaqus Standard

Deadly 提交于 2019-12-12 09:04:21

问题


I am using Abaqus with user-defined subroutines. To the best of my knowledge, Abaqus Standard or Explicit can be used with subroutines written specifically in Fortran 77 language, not the improved Fortran 90/95 language! Is there a way how to use Fortran 90 and later with Abaqus?


回答1:


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

1 Of course, I haven't tested every language feature, and so I'm hedging here. But I do say "just about" because there definitely seem to be some features that cause problems. For example, my subroutines with parameterized derived types always seem to crash, much to my chagrin. If any readers have been able to use them successfully, I'd love to hear about it.



来源:https://stackoverflow.com/questions/49040255/using-subroutines-written-in-fortran-90-with-abaqus-standard

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!