CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

Dynamical memory allocation for multiblock?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 16, 2002, 04:49
Default Dynamical memory allocation for multiblock?
  #1
peter.zhao
Guest
 
Posts: n/a
Dear everyone:

I want to use memory dynamical allocation of Fortran90 for multiblock calculation in order to save memory, but I encounter a problem. As for coordinates of every block, if I use the below statement,

real,allocatable::x(:,:,:,

allocate(nblock,ni,nj,nk,stat=err)

where nblock denotes number of blocks,ni,nj,nk are the dimension of a block. I must allocate same dimension ni,nj and nk for every block, which leads to redundant memory allocation especially when the differences of sizes of blocks are very remarkable.

Does anyone have a better method to deal with this situation? All comments are appreciated!

Thanks in advance.
  Reply With Quote

Old   May 16, 2002, 07:22
Default Re: Dynamical memory allocation for multiblock?
  #2
Petri Majander
Guest
 
Posts: n/a
Hello !

I think that it is a common practise to allocate the variables as one-dimensional table(s). This way you do not need to waste memory space. I use 1-D tables in the whole code but it is possible to use 3-D tables in the subroutines even if the memory space is allocated as 1-D table(s) in the main program.

Best regards

Petri M
  Reply With Quote

Old   May 20, 2002, 05:58
Default Re: Dynamical memory allocation for multiblock?
  #3
peter.zhao
Guest
 
Posts: n/a
Petri Majander, Thank you very much!
  Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
about numeca harmonic method Memory allocation failed uqzcpo Fidelity CFD 2 October 7, 2011 23:10
Memory allocation problem Ammar Abdilghanie FLUENT 5 February 19, 2007 19:15
CFX CPU time & real time Nick Strantzias CFX 8 July 23, 2006 18:50
Memory allocation problem shhe CFX 4 January 7, 2004 00:00
memory allocation strudl CFX 1 October 5, 2003 11:26


All times are GMT -4. The time now is 02:27.