作者garyer (gary)
看板Fortran
标题[问题] 请问一下 我不能跑
时间Mon Aug 22 15:33:28 2011
请问各位大大
以下是我的程式编辑内容
因为我不是很懂fortran
老板又要我把以下的内容转成c++
我有大约了解过各种指令的意义 但是这个还是不能跑
也找过f2c转译软体
但是就是不能跑
可以请各位高手解惑一下麽
缩网址
http://pastie.org/2354079
program main
implicit real*8 (a-h,o-z)
implicit integer*4 (i-n)
c freqmin and freqmax denote the range of energies (in eV) of interest
parameter (freqmin=2.01d0)
parameter (freqmax=7.5d0)
c nplot is the number of points to plot: recommend (freqmax-freqmin)*100+1
parameter (nplot=15001)
c numfreq is the maximum number of transitions to read from the input file
parameter (numfreq=100)
c sigma is the width of the gaussian broadening function in eV
c parameter (sigma=1.2d0)
c parameter (sigma=1.0d0)
c parameter (sigma=0.8d0)
c parameter (sigma=0.6d0)
c parameter (sigma=0.4d0)
c parameter (sigma=0.2d0)
c parameter (sigma=0.18d0)
parameter (sigma=0.1d0)
c parameter (sigma=0.05d0)
c scale is used primarily for vibrational frequencies as indicated below
c use the following statement for HF frequencies with minimal basis
c parameter (scale=0.893d0)
c use the following statement for HF frequencies with pVDZ basis
c parameter (scale=0.9135d0)
c use the following statement for HF frequencies with pVTZ basis
c parameter (scale=0.9248d0)
c use the following statement for B3LYP frequencies with 6-31GD basis
c parameter (scale=0.9614d0)
parameter (scale=1.d0)
dimension w(numfreq),a(numfreq),v(numfreq),b(numfreq)
c
fnplot1=nplot-1
delf=(freqmax-freqmin)/fnplot1
fwhm=sigma
c
open(unit=1,file='input.dat',status='old')
c read(1,*)
c read(1,*)
do i=1,numfreq
read(1,*,end=10) idum,w(i),v(i),a(i)
c w(i)=scale*w(i)
end do
go to 11
10 continue
npts=i-1
go to 12
11 continue
npts=numfreq
write(*,*) 'maximum number of frequencies read:',numfreq
12 continue
close(unit=1)
c
do i=1,nplot
fi=i-1
x=freqmin+fi*delf
sum=0.d0
sums=0.d0
do j=1,npts
sum=sum+a(j)*exp(-(x-w(j))**2/(2.d0*fwhm**2))
c sums=sums+b(j)*exp(-(x-v(j))**2/(2.d0*fwhm**2))
end do
x=8065.54099*x
y=1.d7/x
write(*,*) i,x,y,sum
end do
c
end
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 118.231.24.32
※ 编辑: garyer 来自: 118.231.24.32 (08/22 15:34)
1F:推 philodi:好手好脚的为甚麽不能跑呢 08/22 16:24
2F:→ garyer:应该是说我不懂FORTRAN 也没有相关编辑器 我只能从字面上 08/22 16:31
3F:→ garyer:的意思去转编辑成C++,可是里面还是有些东西不懂 08/22 16:32
4F:推 YCTzeng:我用ifort编译成功了,但是没有input.dat这个档,所以卡关。 08/22 22:01
5F:推 terryys:你是fortran的不能跑还是c++的不能跑?fortran这个版本你 08/22 23:11
6F:→ terryys:都明白是在干什麽吗? 08/22 23:11
7F:→ garyer:说实在的我不明白 我需要知道其中的东西 并转成c++ 08/23 01:03
8F:→ egg9:这偷懒偷太大吧... 08/25 00:03