Elmerf90 - too big array (?) to compile module

Numerical methods and mathematical models of Elmer
Post Reply
Xan
Posts: 8
Joined: 25 Aug 2015, 12:18
Antispam: Yes

Elmerf90 - too big array (?) to compile module

Post by Xan »

Hello,

I am trying to use my own function as a description of magnetic permeability and electric conductivity. Simply said, I generate in Octave array of values and write them into the .f90 file. When I try to compile the module from the created .f90 file I receive a list of errors. They generally look like this:

Code: Select all

- Error: Non-numeric character in statement label at (1)
- Error: Zero is not a valid statement label at (1)
- Error: Missing exponent in real number at (1)
It looks like elmerf90 cannot take whole row from data array (array is 100x100) and cuts through it in the random (?) parts. I presume this is the reason, because during previous tests with 16x16 arrays I never had such a problem. Also when I modify the .f90 file for 16x16 array to have bigger (longer) numbers (eg. 1 becomes 100000000) I receive same errors.

Anyway my question is, if there is a data length limit for elmerf90?

With best regards,
Paweł
raback
Site Admin
Posts: 4812
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Elmerf90 - too big array (?) to compile module

Post by raback »

Hi

Yes, its 80.

"Continuation of line can be done be this character &
so that you can continue to next line"

-Peter
Xan
Posts: 8
Joined: 25 Aug 2015, 12:18
Antispam: Yes

Re: Elmerf90 - too big array (?) to compile module

Post by Xan »

Ok, thank you very much Peter!
Xan
Posts: 8
Joined: 25 Aug 2015, 12:18
Antispam: Yes

Re: Elmerf90 - too big array (?) to compile module

Post by Xan »

Hello again,

I have another problem connected with the previous one. Since I cannot set values of the array as previously (with the usage of DATA structure), I had an idea with declaring every value in the array seprarately. The code fragment looks like this:

Code: Select all


MODULE interpUtils

    Use DefUtils
    Implicit None
    INTEGER, PARAMETER :: arr_up_bnd = 100, arr_low_bnd = 1
    REAL(kind=dp), DIMENSION(arr_low_bnd:arr_up_bnd,arr_low_bnd:arr_up_bnd) :: perme_array, elcond_array
!Here goes data initialization (generated with F90WriteX):
   

perme_array(1,1)=1d0
perme_array(2,1)=1d0
perme_array(3,1)=1d0
perme_array(4,1)=1d0
...

When I try to compile the module I recive errors like:
"Error: Unexpected assignment statement in MODULE at (1)"

I googled the error and had found an explanation, that
"It is not allowed to have executable statements by themselves in a module. They need to be inside a procedure, or in the main program."
on the other hand I am using those variables (perme_array and elcond_array) in all subrutines my module so I would like to avoid need to decalre them separetly. Can anyone give some advice how to declare an 100x100 array once in whole module?

With best regards,
Paweł
Franz Pichler
Posts: 196
Joined: 29 Sep 2011, 12:25
Antispam: Yes

Re: Elmerf90 - too big array (?) to compile module

Post by Franz Pichler »

Hi there,

did you try to use the line continuation as peter sugested?

as in

Code: Select all

      
  CHARACTER TTL*16 
       REAL VEC(5), PAIR(2) ,VEC2(12)

 DATA TTL /'Arbitrary Titles'/, &
            M /9/, N /0/, &
            PAIR(1) /9.0/, &
            VEC /3*9.0, 0.1, 0.9/ &

            VEC2 /3*9.0, 0.1, 0.9, &
                            1.,1.,1.,1.,1.,1.&
                                             3./
best regards
Franz
Post Reply