Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
75 Views

Problem with Error #6362

Jump to solution

Hello! I have an issue regarding Error #6362 while building a Fortran library, using these instructions: http://projects.ce.berkeley.edu/feap/feappv/README_IntelVS.txt

The files I got were from http://projects.ce.berkeley.edu/feap/feappv/

Now, regarding the issue, it says the following: "Error #6362: The data type(s) of the argument(s) are invalid. [FREE]"

Which I have no clue why it happens, it appears two times with the same line content: 

call free(adr(n))

But when I check before,

adr

 it is declared as: 

adr(n) = malloc(length*ipa)

 

I haven't used Fortran in a while so it seems correct to me, but I can't find why the error is popping, could you help me please?

0 Kudos

Accepted Solutions
Highlighted
New Contributor II
75 Views

Out of curiosity, I've had a look at this (I had never seen malloc/free used in Fortran).  I installed the source package and followed the build instructions for VS.  Selecting building for 64-bit pointers (a matter of choosing the include directory), adr is declared in w_int.h:

      integer*8      adr                        ! int8
      common /w_int/ adr(600)

Apparently malloc returns an integer, and I guessed that 64-bit pointers were needed. This gives the compile errors that the OP saw.

If I change to selecting 32-bit pointers (the include directory is: feappv-4.1i\include\integer4) those errors are not generated.  There are three other errors though, like this:

Error    1     error #6404: This name does not have a type, and must have an explicit type.   [HT1]    D:\Fortran\feappv-4.1i\program\pform.f    160    

I added this line in subroutine pform

      integer   ht1, ht2, ht3

and the library is built.

View solution in original post

0 Kudos
4 Replies
Highlighted
Black Belt
75 Views

Please clear up a couple of points of confusion. This is the Intel Fortran for Linux forum. There is a separate form for Intel Fortran on Windows, which is perhaps more relevant to your question.

You did not state which version of the Fortran compiler used, nor did you show the compiler options and commands used.

If the error messages that you reported resulted from compiling the file setmem.f in the Program directory, I can state that I was able to compile that file using Intel Fortran Version 19 as well as Version 14 on Windows 10.

More information from you, such as the build log, or a verbal description of the procedure, may help to resolve the errors.

0 Kudos
Highlighted
Black Belt Retired Employee
75 Views

Current Intel Fortran versions have malloc and free as intrinsics. You don't actually show the declaration of adr, you're showing an assignment. I am going to guess that you are using a 64-bit compiler and that either adr is not declared at all (and hence is REAL by default), or you declared it INTEGER without making it an address-sized integer. (I have not tried to find the place in the sources you reference where this might be.)

If it is declared INTEGER (exactly like that), change the declaration of adr to be INTEGER(INT_PTR_KIND())

0 Kudos
Highlighted
New Contributor II
76 Views

Out of curiosity, I've had a look at this (I had never seen malloc/free used in Fortran).  I installed the source package and followed the build instructions for VS.  Selecting building for 64-bit pointers (a matter of choosing the include directory), adr is declared in w_int.h:

      integer*8      adr                        ! int8
      common /w_int/ adr(600)

Apparently malloc returns an integer, and I guessed that 64-bit pointers were needed. This gives the compile errors that the OP saw.

If I change to selecting 32-bit pointers (the include directory is: feappv-4.1i\include\integer4) those errors are not generated.  There are three other errors though, like this:

Error    1     error #6404: This name does not have a type, and must have an explicit type.   [HT1]    D:\Fortran\feappv-4.1i\program\pform.f    160    

I added this line in subroutine pform

      integer   ht1, ht2, ht3

and the library is built.

View solution in original post

0 Kudos
Highlighted
Black Belt Retired Employee
75 Views

Ah, 32-bit with the pointer declared integer*8. Yes, that will do it.

0 Kudos