[問題] 請問一下 我不能跑

看板Fortran作者 (gary)時間12年前 (2011/08/22 15:33), 編輯推噓3(305)
留言8則, 5人參與, 最新討論串1/2 (看更多)
請問各位大大 以下是我的程式編輯內容 因為我不是很懂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)

08/22 16:24, , 1F
好手好腳的為甚麼不能跑呢
08/22 16:24, 1F

08/22 16:31, , 2F
應該是說我不懂FORTRAN 也沒有相關編輯器 我只能從字面上
08/22 16:31, 2F

08/22 16:32, , 3F
的意思去轉編輯成C++,可是裡面還是有些東西不懂
08/22 16:32, 3F

08/22 22:01, , 4F
我用ifort編譯成功了,但是沒有input.dat這個檔,所以卡關。
08/22 22:01, 4F

08/22 23:11, , 5F
你是fortran的不能跑還是c++的不能跑?fortran這個版本你
08/22 23:11, 5F

08/22 23:11, , 6F
都明白是在幹什麼嗎?
08/22 23:11, 6F

08/23 01:03, , 7F
說實在的我不明白 我需要知道其中的東西 並轉成c++
08/23 01:03, 7F

08/25 00:03, , 8F
這偷懶偷太大吧...
08/25 00:03, 8F
文章代碼(AID): #1EKWPApO (Fortran)
文章代碼(AID): #1EKWPApO (Fortran)