问题描述
我正在为ABAQUS 6.14编写DISP子例程,从小步骤开始-尝试打开并读取包含位移数据的文件.到目前为止,我有一个fortran脚本,该脚本在配置为独立程序时可以完美运行,但是在ABAQUS作为子例程运行该脚本时会崩溃.工作版本:
I am writing a DISP subroutine for ABAQUS 6.14, starting with small steps -- trying to open and read the file containing the displacement data. So far I have a fortran script which runs perfectly when configured as an independent program but crashes when ABAQUS runs it as a subroutine. The working version :
PROGRAM DISP
INTEGER nnodes, IOS
PARAMETER (nnodes = 5652)
REAL A(nnodes,4)
WRITE(*,*) 'hello world'
OPEN(UNIT=11,FILE ="displaced_shape.dat",IOSTAT=IOS)
WRITE(*,*) IOS
DO ix = 1,nnodes
READ(11,*) A(ix,:)
END DO
WRITE(*,*) A(2,3)
END PROGRAM DISP
该程序的输出为
hello world
0
5.4729998E-04
子例程:
SUBROUTINE DISP(U,KSTEP,KINC,TIME,NODE,NOEL,JDOF,COORDS)
INCLUDE 'ABA_PARAM.INC'
DIMENSION U(3),TIME(2),COORDS(3)
INTEGER nnodes, IOS
PARAMETER (nnodes = 5652)
REAL A(nnodes,4)
WRITE(*,*) 'hello world'
OPEN(UNIT=11,FILE ="displaced_shape.dat",IOSTAT=IOS)
WRITE(*,*) IOS
DO ix = 1,nnodes
READ(11,*) A(ix,:)
END DO
WRITE(*,*) A(2,3)
RETURN
END SUBROUTINE DISP
子程序的输出是
hello world
0
forrtl: severe (24): end-of-file during read, unit 11
如您所见,除了包装外,这些脚本是相同的.我从引用相同数据文件的同一文件夹中运行它们.可能是fortran版本的问题吗? ABAQUS文档对此非常含糊.
As you can see, the scripts are identical except for the wrapping. I run them from the same folder referencing the same data file. Could it be a matter of fortran version ? The ABAQUS documentation is pretty vague on this.
任何想法都将不胜感激,谢谢您的帮助.
Any ideas would be greatly appreciated, thanks for your help.
很明显,文件"displaced_shape.dat"的格式为
Edit : as may be obvious, the file "displaced_shape.dat" has the format
1 0.1 0.2 0.3
2 0.1 0.2 0.3
....
5652 0.1 0.2 0.3
推荐答案
该问题很可能是由于将文件单元号分配给应保留给Abaqus使用的值而引起的.根据docs 的简单修复:对于Abaqus/Standard,请使用文件单元号15-18或> 100.对于显式",请使用16-18或> 100,以5到9结尾(例如105).
The problem is very likely due to assigning your file unit number to a value that should be reserved for use by Abaqus. According to the docs there is a simple fix: For Abaqus/Standard, use a file unit number 15-18 or >100. For Explicit, use 16-18 or >100 ending in 5 through 9 (e.g. 105).
这篇关于ABAQUS子例程在配置为程序而不是子例程时运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!