I am using a Fortran user subroutine (UMAT) in Abaqus. I use it to run other Abaqus sub-calculations within my main calculation.
The sub-calculation names are variables, so I am defining them this way:
character (len=256) :: strJOB,strOLDJOB
character (len=256) :: strGoToWorkPath,strCommand,strCmdLine
character (len=256) :: temp, strNOEL, strNPT, striCalcs, striCalcsPrev
write(temp, '(i6)') NOEL
read(temp, *) strNOEL
temp = ''
write(temp, '(i6)') NPT
read(temp, *) strNPT
temp = ''
write(temp, '(i6)') iCalcs
read(temp, *) striCalcs
temp = ''
write(temp, '(i6)') (iCalcs-1)
read(temp, *) striCalcsPrev
temp = ''
strJOB = "micro_" // trim(strNOEL) //"_"// trim(strNPT) // "_" // trim(striCalcs)
strOLDJOB = "micro_" // trim(strNOEL) //"_"// trim(strNPT) //"_"// trim(striCalcsPrev)
strGoToWorkPath = "cd C:\AbaqusCalc"
strCommand = "abaqus interactive job=" // trim(strJOB) // " oldjob=" // trim(strOLDJOB)
strCmdLine = trim(strGoToWorkPath) // ' && ' // trim(strCommand)
And then I just use call system(trim(strCmdLine))
to run my sub-calculation.
What is making me mad is that this works for some sub calculations (sometimes just 1, sometimes 100, it's kinda random), but then I get some error of this kind:
Abaqus Error: The following file(s) could not be located: micro_1_1_1#.odb
where # is always a "strange" character (you can see an example here https://www.dropbox.com/s/82b7u7enlxpc62e/1.jpg?dl=0 ). I can confirm (via debug or writing on a file the character variable strCmdLine) that I am executing correctly with the argument "oldjob=micro_1_1_1", like this:
cd C:\AbaqusCalc && abaqus interactive job=micro_1_1_2 oldjob=micro_1_1_1
In some cases Abaqus can find and process the oldjob (file micro_1_1_1.odb), but in another cases he just sticks that strange character between the end of the filename and the ".odb" extension.
My questions would be:
- Is this related with the
call system()
function? - Can this be an error related with Abaqus and not with Fortran?
- Is there any other way that I can use to call my Abaqus calculations, instead of
call system
?