s.ursa
s.ursa

Reputation: 9

ABAQUS fortran subroutine write command doesn't write anything

I need to save an Abaqus simulation output to an external file. To do this I tried to use a subroutines but I saw it doesn't print anything. I did some test using this code:

SUBROUTINE UMAT(STRESS,STATEV,DDSDDE,SSE,SPD,SCD,    
1 RPL,DDSDDT,DRPLDE,DRPLDT,                               
2 STRAN,DSTRAN,TIME,DTIME,TEMP,DTEMP,PREDEF,DPRED,CMNAME,      
3 NDI,NSHR,NTENS,NSTATV,PROPS,NPROPS,COORDS,DROT,PNEWDT,      
4 CELENT,DFGRD0,DFGRD1,NOEL,NPT,LAYER,KSPT,JSTEP,KINC)      
C                                                      
INCLUDE 'ABA_PARAM.INC'                        
C                                          
CHARACTER*80 CMNAME                                                
DIMENSION STRESS(NTENS),STATEV(NSTATV),            
1 DDSDDE(NTENS,NTENS),DDSDDT(NTENS),DRPLDE(NTENS),            
2 STRAN(NTENS),DSTRAN(NTENS),TIME(2),PREDEF(1),DPRED(1),            
3 PROPS(NPROPS),COORDS(3),DROT(3,3),DFGRD0(3,3),DFGRD1(3,3),            
4 JSTEP(4)   

C user coding to define DDSDDE, STRESS, STATEV, SSE, SPD, SCD      
C and, if necessary, RPL, DDSDDT, DRPLDE, DRPLDT, PNEWDT      
C      

OPEN (UNIT=1, FILE='D:\Temp\workspace\fortan\data_fortran.dat',      
1 STATUS='UNKNOWN', ACCESS='DIRECT',FORM='FORMATTED')      
WRITE (1,*) 'WRITE TEST'      
CLOSE (1)      

RETURN      
END 

-°-°-°-°-°-°-°-°-°-°-°-°-°-°-°-°-°-°-°-°-°-°-°-°-°-°-°-°-°-°-°-°-°-°-°-°-°-

SUBROUTINE UGENS(DDNDDE,FORCE,STATEV,SSE,SPD,PNEWDT,STRAN,               
1 DSTRAN,TSS,TIME,DTIME,TEMP,DTEMP,PREDEF,DPRED,CENAME,NDI,               
2 NSHR,NSECV,NSTATV,PROPS,JPROPS,NPROPS,NJPROP,COORDS,CELENT,               
3 THICK,DFGRD,CURV,BASIS,NOEL,NPT,KSTEP,KINC,NIT,LINPER)               
C               
INCLUDE 'ABA_PARAM.INC'               
C               
CHARACTER*80 CENAME               
DIMENSION DDNDDE(NSECV,NSECV),FORCE(NSECV),STATEV(NSTATV),               
1 STRAN(NSECV),DSTRAN(NSECV),TSS(2),TIME(2),PREDEF(*),               
2 DPRED(*),PROPS(*),JPROPS(*),COORDS(3),DFGRD(3,3),               
3 CURV(2,2),BASIS(3,3)

C 
logical, save :: isFileOpen = .FALSE.
C
CALL GETVRM('TEMP',ARRAY,JARRAY,FLGRAY,JRCD,JMAC,JMATYP,MATLAYO,
1LACCFLA)

C  IS THE FILE OPEN?                
if (.not. isFileOpen) then               
OPEN (UNIT=1, FILE='D:\Temp\workspace\fortan\data.txt',               
1 STATUS='NEW')  

C CHANGE FILE FLAG               
isFileOpen = .TRUE.               
end if       

write (1,*) 'WRITE TRY'  

RETURN               
END               

The simulation runs without any error but it doesn't write the file, regardless the results (it doesn't print a text).

I thought it could be a link error but everything seems to be ok:
I am using:

and all

abaqus verify -user_std               
abaqus info=system             
abaqus verify -all  

gave me PASS.

I don't really know where could be the error. Does anyone have any idea?

Upvotes: 0

Views: 2260

Answers (1)

Joao Ferreira
Joao Ferreira

Reputation: 56

I would try to write to an already available channel. For instance in UMAT, Write(6,) prints the Gauss Point info to the .dat file while write(7,) prints to the .msg file. Such procedure may seem a good approach while debugging . When you want info only at the end of each converged increment you may want to pass info to the uexternal routine by common blocks and loop over GP in that routine. An even better approach is to create SDVs and check them at the odb via UI. In that case you need to declare in the input file how many sdvs you want to pass to the the odb.

Upvotes: 1

Related Questions