Dynamic memory allocation in fortran77

二次信任 提交于 2019-12-06 15:21:29

The array size is about 50x10^6 entries, so roughly 400 MBytes in size for double precision. 9 such arrays will take up 3.6 GBytes of memory, so I assume that you have enough memory available to begin with?

Using large arrays in Fortran 77 could be problematic, as they are not allocated dynamically but put on the stack. I'm not sure what the limits are, I guess it depends on the operating system and architecture, but on a 32 bit system it will probably not work to use arrays that are that large on the stack. You could resort to allocatable arrays of Fortran 90, but then you have to use gfortran instead of g77.

If you need to stick to strict fortran 77, you can use the ma package which can be obtained as part of the global arrays toolkit (http://www.emsl.pnl.gov/docs/global/).

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!