- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I can not understand the error in the following code:
CODE
1 WRITE(6,*) 'REQUEST ERROR IN USDFLD FOR ELEMENT NUMBER ',
2 NOEL,'INTEGRATION POINT NUMBER ',NPT
I obtain the following error messages, but do not fully under it:
ERROR MESSAGE
cyclic_fatigue_B_Reduced.for(65) : Error: Syntax error, found IDENTIFIER 'WRITE' when expecting one of:
1 WRITE(6,*) 'REQUEST ERROR IN USDFLD FOR ELEMENT NUMBER ',
--------^
cyclic_fatigue_B_Reduced.for(65) : Error: Syntax error, found CHARACTER_CONSTANT 'REQUEST ERROR IN USDFLD FOR ELEMENT NUMBER ' when expecting one of: => = . ( %
1 WRITE(6,*) 'REQUEST ERROR IN USDFLD FOR ELEMENT NUMBER ',
-------------------^
cyclic_fatigue_B_Reduced.for(66) : Error: Syntax error, found END-OF-STATEMENT when expecting one of: :: , : )
2 NOEL,'INTEGRATION POINT NUMBER ',NPT
------------------------------------------------^
Any input would be much appreciated. Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday's discussion) so itcontinues the first line. But that is already complete.
Remove that "1" and it will probably work.
Regards,
Arjen
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday's discussion) so itcontinues the first line. But that is already complete.
Remove that "1" and it will probably work.
Regards,
Arjen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I already had the column thing sorted in my code (I just copy and pasted the code on the OP which lost the formatting).
Problem solved!
Code changed to
IF(JRCD.NE.0)THEN
WRITE(6,*) 'REQUEST ERROR IN USDFLD FOR ELEMENT NUMBER ',
1 NOEL,'INTEGRATION POINT NUMBER ',NPT
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
DIMENSION
ARRAY(15)
"DIMENSION" defines an array, in this case ARRAY(15), why is it not just called "ARRAY" and not "DIMENSION"?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I do not know the historical background for using the word "DIMENSION", but to me it
seems quite apt.
Regards,
Arjen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
DIMENSION ARRAY(15)
This might need a separate type declaration statement if implicit typing was not to be used.
or, in more modern Fortran, in a comma list of attributes:
REAL, DIMENSION(15) :: ARRAY
One can also use:
REAL ARRAY(15)
DIMENSION is one of those attributes where you don't have to use the keyword. In more modern code I'd expect to find it in a comma list of attributes for a single declaration. The DIMENSION statement is a holdover from very early Fortran.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have created an empty text file called STATEV.txt and am trying to write the data stored in STATEV(1) (produced during Abaqus analysis)into the text file. The text fileremains blank. Can anyone help? Thanks.
SUBROUTINE
USDFLD (FIELD,STATEV,PNEWDT,DIRECT,T,CELENT,TIME,DTIME,CMNAME,ORNAME,
NFIELD,NSTATV,NOEL,NPT,LAYER,KSPT,KSTEP,KINC,NDI,NSHR,
COORD,JMAC,JMATYP,MATLAYO,LACCFLA)
c
INCLUDE 'ABA_PARAM.INC'
c
CHARACTER*80
CMNAME,ORNAME
CHARACTER*3FLGRAY(15)
DIMENSION FIELD(NFIELD),STATEV(NSTATV),DIRECT(3,3),T(3,3),TIME
DIMENSION ARRAY(15),JARRAY(15),JMAC(*),JMATYP(*),COORD(*)
c
CALL GETVRM('E',ARRAY,JARRAY,FLGRAY,JRCD,JMAC,JMATYP,
MATLAYO,LACCFLA)
EPS=ABS(ARRAY(1))
c
FIELD(1)=EPS
c
STATEV(1)=FIELD(1)
c
OPEN (unit=1, file='STATEV.txt')
WRITE (1),STATEV(1)
c
RETURN
END
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What is in STATEV? What type is STATEV (INCLUDE 'ABA_PARAM.INC' may have declared STATEV as character)
Are you looking in the correct directory for STATEV.txt?
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ABA_PARAM.INC is an internal file which includes one of the following in the user subroutine based on the fact that the solver is SINGLE or DOUBLE PRECISION:
parameter (nprecd=1)
or
implicit real*8(a-h,o-z)
parameter (nprecd=2)
I am using this code as a subroutine during and SIMULIA abaqus analysis, so i am not sure how I can use a break point to see what STATEV(1) actually looks like during the analysis?
STATEV(1) is defined as "An array containing the solution-dependant state variable" produced during an analysis run.
In terms of the directory of STATEV(1) I have include the path C:\......\STATEV(1) and still recieve a blank text file at the end of an analysis.
Thanks again for all your help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Then this means that STATEV is either a REAL*4 or REAL*8 array.
The code you provided should have
a) created an output file of the name specified within the current directory at the time of the OPEN
b) written a floating point value, presumably non-blank
c) closed the file
The important factor is "what was the current directory" at the time of the OPEN?
The current directory is not necessarily the directory where the execuitable is located. In fact the file (as specified in your program) is opened: within the current directory .AND. within the current drive
Each are seperately settable.
It would appear the the file you are looking at is not the file written.
IOW this may have been an older empty file generated at some other time in the location you are looking at (but not the location where the current file is written).
How are you launching the program? If from IDE you can check the properties (default is project folder .NOT. execuitable folder).
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am not sure what you mean by ""what was the current directory" at the time of the OPEN?"? I have created a STATEV.txt file and placed this into the working directory of the analysis with ABAQUS.
The program is being launch by ABAQUS which calls the subrotuine I have written above during an analysis run. I use the following command in the ABAQUS Command Window to launch the analysis input file (.inp) and subroutine (.for):
abaqus job=model_1 user=Cyclic_Fatigue_B_Reduced
Thanks for all you help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Your subroutine is not closing the file STATEV.txt. The WRITE is buffered. Should you examine STATEV.txt prior to close then it may be empty. If STATEV.txt is required to remain open (more state variables to be written) consider adding FLUSH(1).
Consider changing the I/O unit number for STATEV.txt from 1 to some number greater than 9. Lower unit numbers are typically reserved for legacy I/O devices. Ignore this if ABAQUS requires STATEV.txt to be located on unit 1. Also, do not use literal unit numbers. Use parameters from shared header or module.
integer, parameter :: uSTATEV = 10
...
OPEN(UNIT=uSTATEV, FILE='STATEV.txt', STATUS='REPLACE')
** or STATUS='OLD' if that is the case
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi everyone,
Still having problems with this, I have updated this in line with the advice from the forum and reference to the following text:
Structured Fortran 77 for engineers and scientists (5th Ed.) Delores M.Etter
INTEGER, PARAMETER :: uSTATEV = 105
101 FORMAT (F12.6)
OPEN (UNIT=105,
1 FILE='C:\.....\STATEV.txt',
2 STATUS='NEW')
WRITE(105,101) STATEV(1)
CLOSE (UNIT=105)
Please note. I have taken into account the .for column formatting in the code.
I would really appreciate any further input or advice. Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
FILE='C:\.....\STATEV.txt',
I have just shorterned the text on the forum post to make it easier to read. In the real code I have tried both including the full FILE path as well as trying just:
FILE='STATEV.txt',
Still not sure whereI am going wrong. Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The syntax is
IF ( CONDITION ) THEN
Statements to execute if CONDITION is .TRUE.
ENDIF
Note that the first and last lines are complete statements by themselves. Likewise, the statements in the IF...ENDIF block are complete statements.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks mecej4, my WRITE STATEMENT does not have a continuation character in COL-6.
Sorry, did I misunderstand your post?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
IF(JRCD.NE.0)THEN
1 WRITE(6,*) 'REQUEST ERROR IN USDFLD FOR ELEMENT NUMBER ',
2 NOEL,'INTEGRATION POINT NUMBER ',NPTIf these are the statements in your program, the '1' at the beginning of the second line should not be there. The error message from the compiler is consistent with such a continuation character having been scanned.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
[bash] 101 FORMAT (F12.6) OPEN (UNIT=uSTATEV, 1 FILE='STATEV.txt', 2 STATUS='NEW') WRITE (uSTATEV,101) STATEV(1) CLOSE (UNIT=uSTATEV)
[/bash]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When you post code, please use the Syntax Highlighter Tool (the yellow pencil/pen icon).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
[fxfortran] SUBROUTINE USDFLD(FIELD,STATEV,PNEWDT,DIRECT,T,CELENT, 1 TIME,DTIME,CMNAME,ORNAME,NFIELD,NSTATV,NOEL,NPT,LAYER, 2 KSPT,KSTEP,KINC,NDI,NSHR,COORD,JMAC,JMATYP,MATLAYO,LACCFLA) c INCLUDE 'ABA_PARAM.INC' c CHARACTER*80 CMNAME,ORNAME CHARACTER*3 FLGRAY(15) DIMENSION FIELD(NFIELD),STATEV(NSTATV),DIRECT(3,3),T(3,3),TIME(2) DIMENSION ARRAY(15),JARRAY(15),JMAC(*),JMATYP(*),COORD(*) INTEGER, PARAMETER :: uSTATEV = 105 c c ~~ CALL VALUES FROM ABAQUS ~~ c c Absolute value of current strain 'E' c CALL GETVRM('E',ARRAY,JARRAY,FLGRAY,JRCD,JMAC,JMATYP, 1 MATLAYO,LACCFLA) E11=ARRAY(1) c c Use the strain as a field variable c FIELD(1)=E11 c c Store the strain as a solution dependent state variable c STATEV(1)=FIELD(1) c c Write the STATEV(1) data to file c 101 FORMAT (F12.6) c OPEN (UNIT=uSTATEV, 1 FILE='STATEV.txt', 2 STATUS='NEW') WRITE (uSTATEV,101) STATEV(1) CLOSE (UNIT=uSTATEV) c c ~~ REPORTING AN ERROR IF IT OCCURS ~~ c c If error, write comment to .DAT file: c IF(JRCD.NE.0)THEN WRITE(6,*) 'REQUEST ERROR IN USDFLD FOR ELEMENT NUMBER ', 1 NOEL,'INTEGRATION POINT NUMBER ',NPT c c - Return Code (0 - no error, 1 - output request error or all components of output request are zero) c ENDIF RETURN END[/fxfortran]

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page