Author Topic: ERROR ALLOCATING ARRAY  (Read 6492 times)

M. Kurdi

  • Full Member
  • ***
  • Posts: 149
ERROR ALLOCATING ARRAY
« on: January 07, 2014, 12:49:25 PM »
Hello,
I am generating macros to be used in optimization. I generated two arrays already for these umacr0.f and umacr1.f. When trying to generate third array for umacr2.f I get an error in allocating the array?
*ERROR* No allocation for user array number 3 named: ICCC

Any clue why this is the case. For some reason the macro executes even when it is not called in input.dat

Thanks for any ideas you have,

Mohammad

Prof. R.L. Taylor

  • Administrator
  • FEAP Guru
  • *****
  • Posts: 2649
Re: ERROR ALLOCATING ARRAY
« Reply #1 on: January 07, 2014, 12:59:50 PM »
Are you using allocatable arrays in Fortran, malloc (n C or Fortran), or feap allocations?  Answer to your question depends on how you are doing arrays.  Feap alllocations do not know anything about ICCC???

M. Kurdi

  • Full Member
  • ***
  • Posts: 149
Re: ERROR ALLOCATING ARRAY
« Reply #2 on: January 07, 2014, 01:03:04 PM »
I'm using FEAP allocations
ualloc(3,'ICCC',2*numel+2,2). The array is referred to by the ualloc.f. See attached.

I was successful at creating 2 arrays already and was able to store, retrieve data from but the third array is causing errors. I tried setting the size to smaller, changing name of array, changing name of calling macro but to no use.
It seems the error originates from setmem.f

c       Error indicator

        setmem = .false.
        if(num.le.llist) then
          write(  *,3000) num,dname
          write(iow,3000) num,dname
        else
          write(  *,3001) num-llist,dname
          write(iow,3001) num-llist,dname
        endif

      endif

c     Formats

2000  format(' **ERROR** Insufficient storage to allocate ',a/,
     &              11x,'Required size =',i12/,
     &       '           Check data or choose other option.')

2001  format(' *ERROR* No more room in dictionary for ',a5)

3000  format(' *ERROR* No allocation for array number',i4,' named: ',a)

3001  format(' *ERROR* No allocation for user array number',i4,
     &       ' named: ',a)


Thanks again.
« Last Edit: January 07, 2014, 07:18:37 PM by M. Kurdi »

M. Kurdi

  • Full Member
  • ***
  • Posts: 149
Re: ERROR ALLOCATING ARRAY
« Reply #3 on: January 08, 2014, 08:58:19 AM »
Hello,
Following up on the memory allocation error I tried to debug to see if the error is due to generating a third array or a third macro. In my second macro I generated a third array while disabling the third macro. The third array is allocated as required with no problems if it is in a second macro. For some reason allocating an array in third macro is not possible. This could be due to a bug in the program setmem.f. Would it be possible to check on this to correct this bug?

Thanks for your help,

Mohammad

M. Kurdi

  • Full Member
  • ***
  • Posts: 149
Re: ERROR ALLOCATING ARRAY
« Reply #4 on: January 08, 2014, 03:05:54 PM »
My apologies I figured out my mistake
In the user macro I was making this wrong call

if(pcomp(uct,'mac1',4)) in umacr3 I needed to use if(pcomp(uct,'mac3',4))