Running multiple subroutines for analysis
Running multiple subroutines for analysis
(OP)
I am trying to find some advice on running multiple subroutines for an abaqus analysis.
Should each subroutine have a seperate file or should be subroutines be placed in the same .for file? How should the subroutines be structured within the subroutine. Thanks.
Should each subroutine have a seperate file or should be subroutines be placed in the same .for file? How should the subroutines be structured within the subroutine. Thanks.





RE: Running multiple subroutines for analysis
RE: Running multiple subroutines for analysis
Subroutine One(args)
CODING
Return
End Subroutine One
Subroutine Two(args)
CODING
Return
End Subroutine Two
END
RE: Running multiple subroutines for analysis
if (mat="mat1") then
subroutine One
else (mat="mat2")
subrotuine Two
endif
I use this form and this run...i hope can help you!
RE: Running multiple subroutines for analysis
Do you place this about the two subroutines? As when I run this with my input file, it seems that the subroutine fails. I would appreciate some advice on the structure.
e.g.
PROGRAM PROG1
if (mat="mat1") then
subroutine One
else (mat="mat2")
subrotuine Two
endif
Subroutine One(args)
CODING
Return
End Subroutine One
Subroutine Two(args)
CODING
Return
End Subroutine Two
END
Also can this be done without a conditional statement, i.e. I would like both subroutines to run throughout the analysis.
RE: Running multiple subroutines for analysis
I would like join to discussion about multiply subroutine.
At the beginning we need to distinguish what kind of subroutine we want to use.
Is it abaqus subroutine (UDISP, UMAT, ...) or is it user subroutine wrote to perform specific tasks?
For Abaqus subroutine we have following limitation:
1. each subroutine can be call only one time (all distinguish between different materials
must be perform inside abaqus subroutine with conditional statements (IF, SELECT CASE).
We can do it like this:
CODE
...
if (cmname == 'MAT1') then
code for mat1 ...
else if (cmname == 'MAT2') then
code for mat2 ...
end if
...
end subroutine UMAT
CODE
...
if (cmname == 'MAT1') then
code for mat1
end if
...
end subroutine UMAT
subroutine UMAT(args)
...
if (cmname == 'MAT2') then
code for mat2
end if
...
end subroutine UMAT
2. we must not call one abaqus subroutine from another abaqus subroutine
Following source code is wrong, even FORTRAN compilator will not give us an error. Results for this combination are unpredictable.
CODE
...
call USDFLD(args)
...
end subroutine UMAT
subroutine USDFLD(args)
...
code for USDFLD
...
end subroutine USDFLD
Abaqus himself will call both subroutines.
CODE
...
code for UMAT
...
end subroutine UMAT
subroutine USDFLD(args)
...
code for USDFLD
...
end subroutine USDFLD(args)
CODE
...
if (cmname=='MAT1') then
call mySubMat1(args) ! call internal subroutine
else if (cmname=='MAT2') then
call mySubMat2(args) ! call external subroutine
end if
contains ! define internal subroutine
subroutine mySubMat1(args)
...
code for mySubMat1(args)
...
end subroutine mySubMat1
end subroutine UMAT
! define external subroutine
subroutine mySubMat2(args)
...
code for mySubMat2
...
end subroutine mySubMat2
But the same source code worked well with Intel fortran. Perhaps it's something with gfortran settings I do not know.
Regards,
Bartosz