Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Arrays in Fortran

mechprog
Beginner
2,488 Views
Hello all,

I am using Intel Fortran to compile User Subroutines to be used with Simulia Abaqus FEA. I have posted on here before, but still having some issues with the Subroutine. It is the aim that progressing bit by bit with the help of the combination of Fortran and Engineering experts, I hope to solve the problems i am currently dealing with.

My current question is regarding the arrays in Fortran, are there any predefined ARRAY rules, I should be aware of in Fortran? I assume the ARRAY(1), ARRAY(2) and ARRAY(3) in this case will call the ARRAY declared in Abaqus and not some other predefined ARRAY in Fortran?

[fxfortran]      CPRESS = ARRAY(1)
      CSHEAR = SQRT(ARRAY(2)**2+ARRAY(3)**2)
      write (7,*) 'cshear is', CSHEAR
      write (7,*) 'cpress is', CSTRESS[/fxfortran]

Thanks
0 Kudos
16 Replies
bmchenry
New Contributor II
2,488 Views
i don't believe ARRAY is a predefined variable in fortran. so it all comes down to defining the link to the external Abaqus module. How are you defining ARRAY in the sample you have provided? since if you simply declare it as something like Real ARRAY() it will assume it is a local variable.
0 Kudos
Andrew_Smith
Valued Contributor I
2,488 Views
Please post more of the code so that we can see the declaration for ARRAY. It it a local variable, dummy argument or a function reference?

There is no intrinsic function called ARRAY in Fortran
0 Kudos
mechprog
Beginner
2,488 Views
Thank you both for your responses, please find attachedtheportion of the code relevant to this problem. I hope this helps to clarify my question. I know the problem I am having with the ARRAY values has something to do with how I am trying to call the results form Abaqus. Because when I manually check the results through the Abaqus results file the results are what I expect. I have been stuck on this for a while and would really appreciate your help. Thanks.

If there is any other information I can provide, please do not hesitate to let me know.
0 Kudos
mecej4
Honored Contributor III
2,488 Views
Inspection of Code.for reveals that ARRAY is a catch-all local array that is used to hold the results retrieved from Abaqus when the subroutineGETVRMAVGATNODE is called.
I know nothing about the usage of user subroutines with Abaqus, but this line is questionable:
CALL GETPARTINFO(NODE,0,CPNAME,LOCNUM,JRCD)
C CALL GETPARTINFO(NODE, JTYP, CPNAME, LOCNUM, JRCD)
If Abaqus changes the second argument, after this call the memory containing the integer constant (supposedly) zero will no longer be zero. Subsequent use of an integer zero in places such as
if (ldebug.ne.0) then
may fail to work correctly.
Please consult the Abaqus documentation as to the calling conventions.
0 Kudos
mechprog
Beginner
2,488 Views

Thanks mecej4,

If I do not define the following as:

CALL GETPARTINFO(NODE,0,CPNAME,LOCNUM,JRCD)

then I seem to get warnings and error messages such as:

***NOTE: Message from utility routine GETPARTINFO: Utility routine GETPARTINFO
was called with an incorrect value of the flag, jtyp=4063924. The
flag must be equal to 0 to look up a node or 1 to look up an element.

***WARNING: NODE NUMBER 0 SPECIFIED IN UTILITY ROUTINE GETVRMAVGATNODE IS NOT
AVAILABLE IN THE ADAPTIVE MESH DOMAIN.
cslip is 5.567171222590833E-318
COPEN is 3.489682493443309E-317
***WARNING: NODE NUMBER 0 SPECIFIED IN UTILITY ROUTINE GETVRMAVGATNODE IS NOT
AVAILABLE IN THE ADAPTIVE MESH DOMAIN.
cshear is 0.000000000000000E+000
cpress is -7.748604185489346E-304

I have uploaded the .msg file after the analysis with the subroutine has been completed.

Unfortunetly, the help in the Abaqus documentation is very limited. This is somethingI have raised to there technical team. I hope this will improve in the future.

This does not seem to affect the reason why I seem to be getting values so massively different to the actually results in the results files. i.e. cpress is -7.748604185489346E-304???

Any more input or ideas would be very much appreciated.

FYI, JYPT is a variable to be provided the utility routine, where:
JYPT is the Integer flag indicating if INTNUM is a node of element number
If JTYP = 0, look up node number. If JTYP = 1 look up element number
(this should be set by the user)

Thank you very much for all your help everyone.
0 Kudos
mecej4
Honored Contributor III
2,488 Views
When writing Fortran code that is to be interfaced with packages such as Abaqus for which no source code is available, you must take great care that the specifications for the subroutines (arguments, types and lengths, and whether they are input or output or both) must be known and followed precisely. In particular, the conventions for passing string arguments differ between compilers.

The messages that you obtained indicate that one or more subroutine arguments are not being passed correctly. For example, -7.748604185489346E-304 has the same bit representation as the integer (in hexadecimal) 8101010101010100. The simplicity of this pattern suggests that some uninitialized memory location is being read, because of errors in the subroutine arguments.

You must take up these questions at some Abaqus support forum/site.
0 Kudos
mechprog
Beginner
2,488 Views

I wonder if I can manually feed the results into the subroutine, I don't know if this would mean having to change the code very much to get this to work? Seems like the wrong data is being pulled into the subroutine, but I don't know why?

Unfortunetly, this problem seems to go beyond the help that can be provided by most Abaqus users (I have tried a few forums on this) and our research centre can not afford the support Abaqus directly.

0 Kudos
mechprog
Beginner
2,488 Views
I would really appreciate some help with them, I have been stuck on this for so long and I know the problem lies in my Fortran coding.

I have tried the following but still no further in solving the problem:

1) Running all files and analysis from the C: drive directly
2) Making adjustments to the coding and running these variations, but the same problem still exists.
3) Checking through the code many times
4) Reading through the Abaqus manuals and asking who I can to provide help and input
5) Posting on Abaqus forums, but no feedback has been provided thus far.
6) Breaking the code down into and checking each part individually
7) Checking line by line
8) Simplifying the model

I have uploaded the latest code and output .msg file, and tried to explain different parts of the code... I am running out of ideas.. need some inspiration. Any input is much appreciated.

As mentioned above the problem still remains to be the following "CPRESS"output result which a strange number (nothing like in the Abaqus output results .odb file):

cslip is 0.000000000000000E+000
COPEN is -1.000000000000000E+036
cshear is 0.000000000000000E+000
cpress is 4.243991582424610E-314

Thanks everyone. I look forward to your input.
0 Kudos
TimP
Honored Contributor III
2,488 Views
I think you're ignoring previous responses. You are trying to learn how to use a commercial application without dealing with the vendor's current licensing and training. This forum can't bypass those requirements.
You're still showing us numbers like E+36 which look like a result of an uninitialized default real somewhere, and e-314 which look like uninitialized real(8), or possibly a data storage over-run.
0 Kudos
mecej4
Honored Contributor III
2,488 Views
> numbers like E+36 which look like a result of an uninitialized default real somewhere, and e-314

Quite so; a second cause of such numbers can be passing integers where reals should have been passed, and the converse.
0 Kudos
mecej4
Honored Contributor III
2,488 Views
The Intel software forums should not be expected to provide support for Abaqus or to make up for deficiencies in Abaqus support.

You need to obtain the Abaqus API documentation for the version that you are using and make sure that your code adheres to the requirements of the API.
0 Kudos
mechprog
Beginner
2,488 Views
Thanks for your input on this.

I have been through the standard training of using subroutines with Abaqus and familiar with using Abaqus. I feel my weakness is with programming (especially with fortran), writing subroutines and software skills.

The ideal solution would be that we can have tech support with Abaqus, but unfortunetly our research budget will not allow for this. So I am having to learn the hard way. I would also prefer not to use any commercial software, but this also does not seem possible at the moment.

I really appreciate your input and critisisms, and will take a look at uninitialized defaults as suggested, as currently this is something I know nothing about and not sure why this would cause me problems in my code.

Many Thanks.
0 Kudos
jimdempseyatthecove
Honored Contributor III
2,488 Views
Or passing reference when value is required.
0 Kudos
mechprog
Beginner
2,488 Views

Thanks jimdempseyatthevoce,

Would you mind expanding on this a little? As I could not find anything about this in Fortran User manual or Compiler manual. Thanks.

0 Kudos
mecej4
Honored Contributor III
2,488 Views
Search forATTRIBUTES REFERENCE and VALUE in the online Fortran User Guide.

Although this is a common source of error in calling C from Fortran, I doubt that Abaqus would call a subroutine designated to be written in Fortran 77 with any arguments passed by value.

0 Kudos
mechprog
Beginner
2,488 Views

Hi everyone,

I solved this problem, the worrying thing is that I still don't know exactly what was causing the problem. The approach I am going to take now will be to add more and more detail to the code and hopefully debug as I go along. Thanks for your help, advice and patience.

0 Kudos
Reply