使用allocate语句而不是类型语句(?!)

时间:2014-03-11 18:50:02

标签: fortran

因此,我正在修复并添加一些遗留代码(它是自由形式的Fortran 77或Fortran 90,不完全确定差异是什么)。我遇到了一些非常离奇的东西,幸运的是,它没有使用英特尔Fortran编译器进行编译,但显然已经在我们的代码库中编译了很长时间。

SUBROUTINE TAKESTEPAMBER(JP,y,movableatomlist,nmovableatoms,ligmovet,mdstept1,randomseedt2,blockmovet,nblocks,atomsinblock)
use modamber9
use commons, only : natoms, change_temp, newres_temp
use nblist, only : nbflag, skinnb
use porfuncs

implicit none


integer JP, itime1, now(3), nmovableatoms,i,j,movableatomlist(nmovableatoms),nblocks,atomsinblock(nblocks),offset1,k
allocate(y(3*natoms), grad(3*natoms), ereal,ligandcentre(3),ligandcoords(3),ligandcoordsrotated(3))
allocate(rotationmatrix(nblocks,3,3),twopi,pi,DPRAND,randomphi,randompsi,randomtheta,DIST, dummyz)
allocate(st,ct,sph,cph,sps,cps, VECBAX, VECBAY, VECBAZ, randomx, randomy, randomz, dummyx, dummyy)
allocate(atomblockcentre(nblocks,3),distancematrix(natoms,natoms))
allocate(ligmovet,mdstept1,randomseedt2,reschangedt(nres),blockmovet,overlapt)
allocate(datechar,timechar,zonechar)
allocate(values(8),iostatus,restemp,i1,currentresidue,resnumber,overlaparray(natoms,natoms))
allocate(overlaparraysave(natoms,natoms))
allocate(rotmaxchangestr,rotpselectstr,rotcutoffstr,rotcentrestr,rotoccuwstr)

<...execution stuff using all of those variables up there...>

END SUBROUTINE TAKESTEPAMBER

我的问题是,是否有人知道发生了什么以及这可能如何发挥作用。变量是各种不同的类型,我不知道编译器如何能够解决这个问题。

是否可以从各种包含的模块文件中获取类型规范?

是的,不要担心,我们知道它很可怕,我只是觉得有人可能能够解释这一点奇怪。这本身并不是问题,因为我会用适当的类型规格替换所有东西。

谢谢,

凯尔

0 个答案:

没有答案