将用Fortran 90编写的子例程与Abaqus Standard一起使用 [英] Using subroutines written in Fortran 90 with Abaqus Standard

查看:148
本文介绍了将用Fortran 90编写的子例程与Abaqus Standard一起使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将Abaqus与用户定义的子例程一起使用.据我所知,Abaqus Standard或Explicit可以与以专门语言编写的子例程一起使用,该子例程以Fortran 77语言编写,而不是改进后的Fortran 90/95语言!有没有办法将Fortran 90及更高版本与Abaqus一起使用?

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?

推荐答案

默认情况下,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. 修改abaqus环境文件:环境文件是影响所有用户的系统范围的设置文件. 您可以在此处更改设置,但是如果不先咨询您的团队,则不要这样做.或者,复制.env文件并将其放在您的工作目录中,以便所有更改仅本地化到您的分析中(您的同事将感谢您).

  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).

找到compile_fortran变量.将'/free'(windows)或'-free'(linux)添加到列表中.如果在其中看到'/extend-source',则可能需要将其删除.

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.

使用编译器指令:您可以在子例程的开头放置编译器指令,而不是修改.env文件.根据我的经验,这允许我的子例程在使用它们的任何位置进行编译和运行.

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.

假设您使用的是Intel Fortran,则伪指令为:!DIR$ FREEFORM

Assuming you are using Intel Fortran, the directive is: !DIR$ FREEFORM

1 当然,我并没有测试所有语言功能,因此我在这里进行对冲.但我确实说差不多"是因为肯定存在一些引起问题的功能.例如,带有参数化派生类型的子例程似乎总是崩溃,这令我非常恼火.如果有任何读者能够成功使用它们,我很想听听.

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.

这篇关于将用Fortran 90编写的子例程与Abaqus Standard一起使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆