⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ctrig.f90

📁 基于linux操作下的fortran快速付立变换的程序
💻 F90
字号:
        subroutine ctrig(n,trig,after,before,now,isign,ic)!       RESTRICTIONS on USAGE!  Copyright (C) 2002-2005 Stefan Goedecker, CEA Grenoble!  This file is distributed under the terms of the!  GNU General Public License, see http://www.gnu.org/copyleft/gpl.txt .        implicit real*8 (a-h,o-z)        integer after,before        dimension now(7),after(7),before(7),trig(2,2048)        INTEGER, DIMENSION(7,104) :: idata ! The factor 6 is only allowed in the first place!        data ((idata(i,j),i=1,7),j=1,104) /                       &            3,   3, 1, 1, 1, 1, 1,       4,   4, 1, 1, 1, 1, 1,   &            5,   5, 1, 1, 1, 1, 1,       6,   6, 1, 1, 1, 1, 1,   &            8,   8, 1, 1, 1, 1, 1,       9,   3, 3, 1, 1, 1, 1,   &           10,   5, 2, 1, 1, 1, 1,                                &           12,   4, 3, 1, 1, 1, 1,      15,   5, 3, 1, 1, 1, 1,   &           16,   4, 4, 1, 1, 1, 1,      18,   6, 3, 1, 1, 1, 1,   &           20,   5, 4, 1, 1, 1, 1,      24,   8, 3, 1, 1, 1, 1,   &           25,   5, 5, 1, 1, 1, 1,      27,   3, 3, 3, 1, 1, 1,   &           30,   6, 5, 1, 1, 1, 1,      32,   8, 4, 1, 1, 1, 1,   &           36,   4, 3, 3, 1, 1, 1,      40,   8, 5, 1, 1, 1, 1,   &           45,   5, 3, 3, 1, 1, 1,      48,   4, 4, 3, 1, 1, 1,   &           50,   5, 5, 2, 1, 1, 1,                                &           54,   6, 3, 3, 1, 1, 1,      60,   5, 4, 3, 1, 1, 1,   &           64,   8, 8, 1, 1, 1, 1,      72,   8, 3, 3, 1, 1, 1,   &           75,   5, 5, 3, 1, 1, 1,      80,   5, 4, 4, 1, 1, 1,   &           81,   3, 3, 3, 3, 1, 1,      90,   6, 5, 3, 1, 1, 1,   &           96,   8, 4, 3, 1, 1, 1,     100,   5, 5, 4, 1, 1, 1,   &          108,   4, 3, 3, 3, 1, 1,     120,   8, 5, 3, 1, 1, 1,   &          125,   5, 5, 5, 1, 1, 1,     128,   8, 4, 4, 1, 1, 1,   &          135,   5, 3, 3, 3, 1, 1,     144,   6, 8, 3, 1, 1, 1,   &          150,   6, 5, 5, 1, 1, 1,     160,   8, 5, 4, 1, 1, 1,   &          162,   6, 3, 3, 3, 1, 1,     180,   5, 4, 3, 3, 1, 1,   &          192,   6, 8, 4, 1, 1, 1,     200,   8, 5, 5, 1, 1, 1,   &          216,   8, 3, 3, 3, 1, 1,     225,   5, 5, 3, 3, 1, 1,   &          240,   6, 8, 5, 1, 1, 1,     243,   3, 3, 3, 3, 3, 1,   &          250,   5, 5, 5, 2, 1, 1,                                &          256,   8, 8, 4, 1, 1, 1,     270,   6, 5, 3, 3, 1, 1,   &          288,   8, 4, 3, 3, 1, 1,     300,   5, 5, 4, 3, 1, 1,   &          320,   5, 4, 4, 4, 1, 1,     324,   4, 3, 3, 3, 3, 1,   &          360,   8, 5, 3, 3, 1, 1,     375,   5, 5, 5, 3, 1, 1,   &          384,   8, 4, 4, 3, 1, 1,     400,   5, 5, 4, 4, 1, 1,   &          405,   5, 3, 3, 3, 3, 1,     432,   4, 4, 3, 3, 3, 1,   &          450,   6, 5, 5, 3, 1, 1,     480,   8, 5, 4, 3, 1, 1,   &          486,   6, 3, 3, 3, 3, 1,     500,   5, 5, 5, 4, 1, 1,   &          512,   8, 8, 8, 1, 1, 1,     540,   5, 4, 3, 3, 3, 1,   &          576,   4, 4, 4, 3, 3, 1,     600,   8, 5, 5, 3, 1, 1,   &          625,   5, 5, 5, 5, 1, 1,     640,   8, 5, 4, 4, 1, 1,   &          648,   8, 3, 3, 3, 3, 1,     675,   5, 5, 3, 3, 3, 1,   &          720,   5, 4, 4, 3, 3, 1,     729,   3, 3, 3, 3, 3, 3,   &          750,   6, 5, 5, 5, 1, 1,     768,   4, 4, 4, 4, 3, 1,   &          800,   8, 5, 5, 4, 1, 1,     810,   6, 5, 3, 3, 3, 1,   &          864,   8, 4, 3, 3, 3, 1,     900,   5, 5, 4, 3, 3, 1,   &          960,   5, 4, 4, 4, 3, 1,     972,   4, 3, 3, 3, 3, 3,   &         1000,   8, 5, 5, 5, 1, 1,    1024,   4, 4, 4, 4, 4, 1,   &                                      1080,   8, 5, 3, 3, 3, 1,   &         1152,   8, 4, 4, 3, 3, 1,    1200,   5, 5, 4, 4, 3, 1,   &         1250,   5, 5, 5, 5, 2, 1,    1280,   5, 4, 4, 4, 4, 1,   &         1296,   4, 4, 3, 3, 3, 3,    1350,   6, 5, 5, 3, 3, 1,   &         1440,   6, 5, 4, 4, 3, 1,    1458,   6, 3, 3, 3, 3, 3,   &         1500,   5, 5, 5, 4, 3, 1,    1536,   8, 4, 4, 4, 3, 1,   &         1600,   8, 8, 5, 5, 1, 1,    1620,   5, 4, 3, 3, 3, 3,   &         1728,   8, 8, 3, 3, 3, 1,    1800,   8, 5, 5, 3, 3, 1,   &         1920,   8, 5, 4, 4, 3, 1,    1944,   8, 3, 3, 3, 3, 3,   &         2000,   5, 5, 5, 4, 4, 1,    2048,   8, 4, 4, 4, 4, 1    /          do 111,i=1,104        if (n.eq.idata(1,i)) then        ic=0        do 11,j=1,6        itt=idata(1+j,i)        if (itt.gt.1) then        ic=ic+1        now(j)=idata(1+j,i)        else        goto 1000        endif11        continue        goto 1000        endif111        continue        print*,'VALUE OF',n,'NOT ALLOWED FOR FFT, ALLOWED VALUES ARE:'37        format(15(i5))        write(6,37) (idata(1,i),i=1,104)        stop1000        continue        after(1)=1        before(ic)=1        do 22,i=2,ic        after(i)=after(i-1)*now(i-1)22        before(ic-i+1)=before(ic-i+2)*now(ic-i+2)12        format(6(i3))!        write(6,12) (after(i),i=1,ic)!        write(6,12) (now(i),i=1,ic)!        write(6,12) (before(i),i=1,ic)        twopi=6.283185307179586d0        angle=isign*twopi/n        if (mod(n,2).eq.0) then        nh=n/2        trig(1,1)=1.d0        trig(2,1)=0.d0        trig(1,nh+1)=-1.d0        trig(2,nh+1)=0.d0        do 40,i=1,nh-1        trigc=cos(i*angle)        trigs=sin(i*angle)        trig(1,i+1)=trigc        trig(2,i+1)=trigs        trig(1,n-i+1)=trigc        trig(2,n-i+1)=-trigs40      continue        else        nh=(n-1)/2        trig(1,1)=1.d0        trig(2,1)=0.d0        do 20,i=1,nh        trigc=cos(i*angle)        trigs=sin(i*angle)        trig(1,i+1)=trigc        trig(2,i+1)=trigs        trig(1,n-i+1)=trigc        trig(2,n-i+1)=-trigs20      continue        endif        return        end

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -