New Reply

Fortran - Allocate array in subroutine

 
Share Thread Thread Tools
May6-12, 08:22 PM   #1
 

Fortran - Allocate array in subroutine


I try to write a small program to allocate a variable in small subroutine and i've passed it, now i allocate array in a loop or many loops but i don't have any ideas about it.
Has anyone done like me , can share some experiences ??
 
PhysOrg.com
PhysOrg
science news on PhysOrg.com

>> 'Whodunnit' of Irish potato famine solved
>> The mammoth's lament: Study shows how cosmic impact sparked devastating climate change
>> Curiosity Mars rover drills second rock target
May6-12, 09:20 PM   #2
 
luonganh89:

Welcome to the forum.

Please make another attempt to ask your question more clearly.

Maybe, if you are having a problem implementing something in fortran, post the source code, tell what you are trying to do, and how you think it should be done, etc.
 
May6-12, 09:31 PM   #3
 
Thank your attention !

I've just passed it . My project is coupling 2 software together: abaqus and CFD code. I've controlled abaqus by using fortran. now i've tried to control CFD code (written by Fortran). I'm writting a sample code , if it runs succefully, i will apply it to my CFD code
 
May7-12, 02:38 AM   #4
 

Fortran - Allocate array in subroutine


Hi !!!
Have you ever coded in Abaqus about Allocating Array !!! Can share me some experience ???
 
May7-12, 12:51 PM   #5
 
I don't use Abaqus.

You may want to consider visiting an Abaqus/CFD forum, if you don't get an answer here.
 
May7-12, 10:37 PM   #6
 
It seems to be simple, But i can't explain how it run wrongly

I use statement:
ALLOCATE( CV(100), STAT = AllocateStatus)
IF (AllocateStatus /= 0) STOP "*** Not enough memory ***"
and

DEALLOCATE( CV, STAT = DeAllocateStatus)
IF (DeAllocateStatus /= 0) STOP "*** Trouble deallocating ***"
Abaqus always announces "*** Trouble deallocating ***" but
- when i don't use " IF (DeAllocateStatus /= 0) STOP "*** Trouble deallocating ***" it run successfully.
- when i don't use "DEALLOCATE( CV, STAT = DeAllocateStatus) IF (DeAllocateStatus /= 0) STOP "*** Trouble deallocating ***" it announces "Not enough memory"

can you explain something ???
 
May8-12, 06:59 AM   #7
 
Is your code very large? can you post it? (use code tags if you do).

Are both status variables AllocateStatus and DeAllocateStatus explicitely declared integers?
 
New Reply
Thread Tools


Similar Threads for: Fortran - Allocate array in subroutine
Thread Forum Replies
FORTRAN 90 subroutine Programming & Comp Sci 3
Fortran, subroutine with allocatable, intent(out) array Programming & Comp Sci 2
How to pass array element form a subroutine to main function Programming & Comp Sci 14
Looking for fortran code or subroutine ,please help!!! Programming & Comp Sci 0
Quantile subroutine, Fortran 90 Programming & Comp Sci 2