Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Subroutine within subroutine / global variable

Status
Not open for further replies.

Hajakala

Mechanical
Mar 23, 2017
16
Hey All,

I am running a weld model on ABAQUS using DFLUX subroutine and wanted to request HBF (heat body flux) as a field output . However, since Flux(1) cannot be requested as an output according to the documentation (surface and element based loading output variables do not include contributions from loads applied through user subroutines), I am trying different ways to show the input heat flux in the visualization module.

1. I have been able to print it to the dat file using:
if (npt.eq.1) then
write (6,*) 'flux @',noel,'=',flux(1),'@t=',time(1)
endif

2. Another way that I tried (not working) was using a second user subroutine, UVARM. I tried to use module in both DFLUX and UVRAM; in DFLUX saved the flux value in the module and in UVARM you read it from the module and store it into the user subroutine, which then can be contour plotted (simplified). Also, how can integrate the heat power?

module shareVars
double precision, SAVE :: fluxval
end module shareVars

subroutine DFLUX
use shareVars
FLUX(1) = X
fluxval = FLUX(1)

SUBROUTINE UVARM
use shareVars
UVAR(1)= fluxval

But, after doing this, I don't get the right flux contour plot in my odb. What I see is a random pattern throughout my model.
Is there something wrong with the way I used module and UVARM? Or possibly due to using more than 1 cpu?

3. I am also trying to call UVARM within DFLUX (simplified):

module shareVars

REAL, SAVE :: fluxval

contains
SUBROUTINE UVARM

UVAR(1)= flux val
end subroutine UVARM

end module shareVars

SUBROUTINE DFLUX

call UVARM

But I get an error saying:

error #6631: A non-optional actual argument must be present when invoking a procedure with an explicit interface.

Would anyone please give me an advice?

Thanks a lot.

Hajakala

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor