A. fortran90 里面一个conformable的错误
这个好理解。
① 主程序,用了parameter,那么就是一个常量,因此编译器编译的是,是静态的,直接替换,a=matmul(ft,f)和a=matmul(f,ft)先编译好,然后才是if逻辑判断(内部是一个表作跳转实现的),因此当a=matmul(,)时,其实已经被“换成”了a=(3,10)x(3,10),当然错了。
② 而subroutine,这个是动态的,因为编译器不知道会传递什么进去,因此只能在“运行”时刻作判断。所以你的编译可以通过。
③ 你可以作测试,让主程序也成为“动态”编译,那么就可以正常通过,比如:
...
implicitnone
integer,parameter::n=3,m=10
integer,parameter::mnh=min(m,n)
real,dimension(:,:),allocatable::f,ft,a
!dataf/10,15,29,15,46,13,23,21,30,11,9,35,&
!42,45,11,9,48,5,11,21,14,8,5,15,&
!11,12,21,21,20,25/
allocate(f(n,m))
allocate(ft(m,n))
allocate(a(mnh,mnh))
f=reshape((/10,15,29,15,46,13,23,21,30,11,9,35,&
42,45,11,9,48,5,11,21,14,8,5,15,&
11,12,21,21,20,25/),shape(f))
ft=transpose(f)
if(m<n)then
a=matmul(ft,f)
else
a=matmul(f,ft)
endif
!callmul(n,m,mnh,f,a)
...
B. FVCOM编译求助-PGI编译器
看你这样认真的问,真是同情,但是你来错地方了,你不知道网络知道上都是刷经验的傻x吗?真正有技术性的问题哪个是在网络知道上解决的,建议你多看看别的博客吧,CSDN上了等等的,本人也是学了linux,不过是web开发方面的的所以帮不了你,抱歉
C. pgf90 是pgi fortran吗
是PGI
不过linux下还是用gFortran吧, 网上有免费的
D. debian如何安装pgf90
. 首先安装pgi编译器,我在这里就不说了,网上应该很多资料。
2. 配置环境变量(因为要使用pgf90编译,因此必须设置一下环境变量)
# vi ~/.bashrc 编辑 .bashrc文件,在文件中添加以下几行
# source ~/.bashrc (为了确保设置生效,最好重新启动命令行)
3. 下载 mpich-3.2。tar.gz (网址:http://www.mpich.org/downloads/)到目录/home/legna/Doucument(这个路径可以自己指定,安装完成后,安装包可以删除,所以放哪个目录下都没有关系)
4. 解压mpich-3.2.tar.gz,得到mpich-3.2文件夹
# tar -zxvf mpich-3.2.tar.gz
5. 进入mpich-3.2目录
# cd mpich-3.2
6. 设置安装目录
# ./configure --prefix=/home/legna/mpich(这个目录也可以自己指定,而且要看一下输出的内容有没有出现error的,如果有,那么就不能进行下一步)
7. 编译
# make(这边应该也不会报错,如果报错,肯定是前面的步骤没有成功)
8. 安装
# make install
9. 配置环境变量
# vi ~/.bashrc 编辑 .bashrc文件,在文件中添加如下的一行
# source ~/.bashrc(为了确保设置生效,最好重新启动命令行)
10. 测试
自己写代码试试吧~~~
E. 请教ifort和pgf90编译差别的问题
方法一:
假如现在有两个Fortran程序1.f90和2.f90,其中1.f90是主程序,2.f90是在主程序中调用的子程序,将这两个程序传到Linux的一个目录下,使用fortran编译命令,如PGI的pgf90,Intel的ifort,命令如下:
pgf90 -o exe_name 1.f90 2.f90
ifort -o exe_name 1.f90 2.f90
方法二:
在主程序1.f90中加入include '2.f90'语句,然后在Linux下用fortran命令编译,命令如下:
pgf90 -o exe_name 1.f90
ifort -o exe_name 1.f90
F. Linux系统下如何安装Abinit5.6.4
一.首先了解DHCP的概念
DHCP是实现主机IP地址DNS等动态配置的网络协议. DNCP可以在多种操作系统中实现,包括最常用的linux系统和windows系统 DHCP网络服务的结构中具有服务器和客户机两个角色 DHCP服务器用于为网络中所有的DHCP客户机提供网络配置信息,在同一网络中, DHCP服务器通常是唯一存在在. 网络中的任何主机都可以配置成为DHCP客户机,向DHCP服务器发出配置请求并按照服务 器返回的信息进行网络配置
二.DHCP服务器能够提供的网络配置信息
1.网络接口的IP地址和子网掩码. 2.网络接口的IP地址对应的网络地址和广播地址 3.默认网关地址 4.DNS服务器地址
三.DHCP服务器的配置
1.安装DHCP服务器软件(在RHEL4系统的安装光盘中包括RPM格式的DHCP服务器软件包,包文件的名称是dhcp-3.0.1-12_EL.i386.rpm),在RHEL4的第4安装光盘中,在同一张安装盘中还包括与DHCP相关的其它软件包 # cd /media/cdrom/rehat/rpms/ #ks -l dhcp* dhcp-3.0.1-12_EL.i386,rpm在REL4中没有被默认安装,需要手动安装 #rpm -qa | grep dhcp #rpm -ivh dhcp-3.0.1-12_EL.i386.rpm
2.其中/usr/sbin/dhcpd 是DHCP服务器的执行文件,/etc/rc.d/init.d/dhcpd是DHCP服务器的启动脚本,虽然文件名都是DHCPD,但是文件位于不同的目录,功能也不一样. DHCPD.CONF配置文件以及建立配置文件和配置文件的格式 #ls /etc/dhcp* #vi /etc/dhcpd.conf
G. pgf是什么文件格式,什么意思
如果是PPSDS.PGF,那么它就是PPS的缓存文件.
在使用PPS的用户。在磁盘的根目录下会有一个ppsds.pgf文件。这个文件常有几百兆。直接删除的方法无法清除这个文件,下面介绍一下方法和生成这个文件的原因:
出现这个文件的原因是你使用了最新版PPSTREAM的点播功能。ppsds.pgf的作用用主要用于点播时的缓冲,使缓冲时间更短,打开点播视频更快。如果你安装了最新版的PPSTREM而不使用点播功能,ppsds.pgf不会出现。但只要你第一次使用PPSTREM的点播功能,就会在PPSTREM 安装硬盘根目录下生成隐藏文件ppsds.pgf有1G大小,硬盘空间不够大的要注意一下。个人感觉PPSTERM应该告诉大家这点,因为不注意根本找不到这个文件,要选择不隐藏系统文件属性,才能看到这个文件夹。这个文件不能用WINDOWS的垃圾清理自动清理,感觉有点“流氓”的味道。
这是PPS的点播缓存文件,程PPS序会搜索硬盘中剩余空间最大的分区生成 ppsds.pgf 文件,ppsds.pgf 的文件大小可能和虚拟内存大小设置有关系(自己的猜测)。ppsds.pgf 缓存文件中基本能缓存2部左右的点播电影,方便网络不流畅的用户,不会对你的机器造成危害。达到1G的时候会自动删除
1.打开注册表。开始--运行--regedit,然后依次展开
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\nvata
或 HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\nvatabus
...不使用点播功能,ppsds.pgf不会出现。.
经实践,还有一种更直接快捷的办法:
到任务管理器里把一个以PP开头的(类似PPAS。EXE)进程停了再删就没问题了!呵呵~
H. 请教:fortran程序中 北京时间 转换为 国际时间 的程序代码 如何写
北京时间减8小时就是世界时。 8小时=8*60*60=28800秒。 把下面的代码复制成get_new_time.f
然后编译:pgf90 -o get_new_time get_new_time.f
比如运行: get_new_time 2008071620 -28800 会输出2008071612_00:00
get_new_time.f:
program new_time
!yuanbing, 2006
character*16 ndate, odate, idt
character*19 odate1
character*256 cm,cn
real m,n
integer idts,method
odate=' '
numarg = iargc()
if(numarg<2) call help
if(numarg==2) method = 1
if(numarg==3) then
method = 2
endif
if(numarg==4) then
call getarg(4,cn)
read(cn,*) n
if(n>0) method = 3
if(n==0 ) call help
if(n<0 ) method = 4
endif
call getarg(1,odate1)
if(method == 3 .or. method == 4) then
odate(1:4)=odate1(1:4)
odate(5:6)=odate1(6:7)
odate(7:8)=odate1(9:10)
if(len(trim(odate1))>=13) odate(9:10)=odate1(12:13)
if(len(trim(odate1))>=16) then
odate(11:11)='_'
odate(12:13)=odate1(15:16)
endif
if(len(trim(odate1))>=19) then
odate(14:14)=':'
odate(15:16)=odate1(18:19)
endif
else
odate=odate1(1:16)
endif
call getarg(2,idt)
read(idt,*) idts
! print*,odate,method
call geth_newdate (ndate, odate, idts)
if(method == 1 .or. method == 4) then
write(*,"(a16)") ndate
else
write(*,"(a19)") ndate(1:4)//'-'//ndate(5:6)//'-'//ndate(7:8)//
- '_'//ndate(9:10)//':'//ndate(12:13)//':'//ndate(15:16)
endif
end
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
subroutine geth_newdate (ndate, odate, idts)
implicit none
!**********************************************************************
!
! purpose - from old date ('YYYYMMDDHH_MM:SS') and time in
! seconds, compute the new date.
!
! on entry - odate - the old hdate.
! idts - the change in time in seconds.
!
! on exit - ndate - the new hdate.
! idts - the change in time in seconds.
!
!**********************************************************************
integer idts
character*(*) ndate, odate
integer nlen, olen
!
! Local Variables
!
! yrold - indicates the year associated with "odate"
! moold - indicates the month associated with "odate"
! dyold - indicates the day associated with "odate"
! hrold - indicates the hour associated with "odate"
! miold - indicates the minute associated with "odate"
! scold - indicates the second associated with "odate"
!
! yrnew - indicates the year associated with "ndate"
! monew - indicates the month associated with "ndate"
! dynew - indicates the day associated with "ndate"
! hrnew - indicates the hour associated with "ndate"
! minew - indicates the minute associated with "ndate"
! scnew - indicates the second associated with "ndate"
!
! mday - a list assigning the number of days in each month
! dth - the number of hours represented by "idts"
! i - loop counter
! nday - the integer number of days represented by "idts"
! nhour - the integer number of hours in "idts" after taking out
! all the whole days
! nmin - the integer number of minutes in "idts" after taking out
! all the whole days and whole hours.
! nsec - the integer number of minutes in "idts" after taking out
! all the whole days, whole hours, and whole minutes.
!
integer yrnew, monew, dynew, hrnew, minew, scnew
integer yrold, moold, dyold, hrold, miold, scold
integer mday(12), nday, nhour, nmin, nsec, i
real dth
logical opass
!************************* Subroutine Begin *************************
!
! Assign the number of days in a months
!
mday( 1) = 31
mday( 2) = 28
mday( 3) = 31
mday( 4) = 30
mday( 5) = 31
mday( 6) = 30
mday( 7) = 31
mday( 8) = 31
mday( 9) = 30
mday(10) = 31
mday(11) = 30
mday(12) = 31
!
! Break down old hdate into parts
!
hrold = 0
miold = 0
scold = 0
olen = len(odate)
read(odate(1:4), '(I4)') yrold
read(odate(5:6), '(I2)') moold
read(odate(7:8), '(I2)') dyold
if (olen.ge.10) then
read(odate(9:10),'(I2)') hrold
if (olen.ge.13) then
read(odate(12:13),'(I2)') miold
if (olen.ge.16) then
read(odate(15:16),'(I2)') scold
endif
endif
endif
!
! Set the number of days in February for that year.
!
mday(2) = 28
if (mod(yrold,4).eq.0) then
mday(2) = 29
if (mod(yrold,100).eq.0) then
mday(2) = 28
if (mod(yrold,400).eq.0) then
mday(2) = 29
endif
endif
endif
!
! Check that ODATE makes sense.
!
opass = .TRUE.
! Check that the month of ODATE makes sense.
if ((moold.gt.12).or.(moold.lt.1)) then
print*, 'GETH_NEWDATE: Month of ODATE = ', moold
opass = .FALSE.
endif
! Check that the day of ODATE makes sense.
if ((dyold.gt.mday(moold)).or.(dyold.lt.1)) then
print*, 'GET_NEWDATE: Day of ODATE = ', dyold
opass = .FALSE.
endif
! Check that the hour of ODATE makes sense.
if ((hrold.gt.23).or.(hrold.lt.0)) then
print*, 'GET_NEWDATE: Hour of ODATE = ', hrold
opass = .FALSE.
endif
! Check that the minute of ODATE makes sense.
if ((miold.gt.59).or.(miold.lt.0)) then
print*, 'GET_NEWDATE: Minute of ODATE = ', miold
opass = .FALSE.
endif
! Check that the second of ODATE makes sense.
if ((scold.gt.59).or.(scold.lt.0)) then
print*, 'GET_NEWDATE: Second of ODATE = ', scold
opass = .FALSE.
endif
if (.not.opass) then
print*, 'Crazy ODATE: ', odate(1:olen), olen
STOP 'Error_odate'
! stop
endif
!
! Date Checks are completed. Continue.
!
!
! Compute the number of days, hours, minutes, and seconds in idts
!
if(idts>=0) then
nday = idts/86400 ! Integer number of days in delta-time
nhour = mod(idts,86400)/3600
nmin = mod(idts,3600)/60
nsec = mod(idts,60)
scnew = scold + nsec
if (scnew .ge. 60) then
scnew = scnew - 60
nmin = nmin + 1
end if
minew = miold + nmin
if (minew .ge. 60) then
minew = minew - 60
nhour = nhour + 1
end if
hrnew = hrold + nhour
if (hrnew .ge. 24) then
hrnew = hrnew - 24
nday = nday + 1
end if
dynew = dyold
monew = moold
yrnew = yrold
do i = 1, nday
dynew = dynew + 1
if (dynew.gt.mday(monew)) then
dynew = dynew - mday(monew)
monew = monew + 1
if (monew .gt. 12) then
monew = 1
yrnew = yrnew + 1
mday(2) = 28
if (mod(yrnew,4).eq.0) then
mday(2) = 29
if (mod(yrnew,100).eq.0) then
mday(2) = 28
if (mod(yrnew,400).eq.0) then
mday(2) = 29
endif
endif
endif
end if
endif
enddo
else
nday = -idts/86400
nhour = -mod(idts,86400)/3600
nmin = -mod(idts,3600)/60
nsec = -mod(idts,60)
scnew = scold - nsec
if (scnew .lt. 0) then
scnew = 60 + scnew
nmin = nmin + 1
end if
minew = miold - nmin
if (minew .lt. 0) then
minew = 60 + minew
nhour = nhour + 1
endif
hrnew = hrold - nhour
if (hrnew .lt. 0) then
hrnew = 24 + hrnew
nday = nday + 1
end if
dynew = dyold
monew = moold
yrnew = yrold
do i = 1, nday
dynew = dynew - 1
if (dynew.lt.1) then
monew = monew - 1
dynew = mday(monew) - abs(dynew)
if (monew .lt. 1) then
monew = 12
dynew = mday(monew) - abs(dynew)
yrnew = yrnew - 1
mday(2) = 28
if (mod(yrnew,4).eq.0) then
mday(2) = 29
if (mod(yrnew,100).eq.0) then
mday(2) = 28
if (mod(yrnew,400).eq.0) then
mday(2) = 29
endif
endif
endif
endif
endif
enddo
endif
!
! Now construct the new mdate
!
nlen = len(ndate)
if (nlen.ge.16) then
write(ndate,19) yrnew, monew, dynew, hrnew, minew, scnew
19 format(I4,I2.2,I2.2,I2.2,'_',I2.2,':',I2.2)
else if (nlen.eq.13) then
write(ndate,16) yrnew, monew, dynew, hrnew, minew
16 format(I4,I2.2,I2.2,I2.2,'_',I2.2)
else if (nlen.eq.10) then
write(ndate,13) yrnew, monew, dynew, hrnew
13 format(I4,I2.2,I2.2,I2.2)
else if (nlen.eq.8) then
write(ndate,10) yrnew, monew, dynew
10 format(I4,I2.2,I2.2)
endif
!************************** Subroutine End **************************
end
subroutine help
print*
print*,'usage: '
print*,' get_new_time.exe date_time idts [m] [n]'
print*
print*,'if m,n not given, date_time in YYYYMMDDHH_MM:SS'
print*,' ouput in YYYYMMDDHH_MM:SS'
print*
print*,'if m given,n not, date_time in YYYYMMDDHH_MM:SS'
print*,' ouput in YYYY-MM-DD_HH:MM:SS'
print*
print*,'if m,n given,n>0, date_time in YYYY-MM-DD_HH:MM:SS'
print*,' ouput in YYYY-MM-DD_HH:MM:SS'
print*
print*,'if m,n given,n<0, date_time in YYYY-MM-DD_HH:MM:SS'
print*,' ouput in YYYYMMDDHH_MM:SS'
print*
print*,'Here, idts means the time inteval in seconds. '
print*,' idts may be postive or negtive'
stop ' '
end
I. 什么是pgf格式文件如何打开pgf文件
1.什么是pgf?
pgf 是一个在tex系统中的画图宏包,tex,尤其是beamer中使用pgf作图,“作精确图还比较方便, 色彩锐丽”(huangzh73)。除了可以精确的作图外,对于某些不要求精确控制的图形绘制,如:流程图,树图,等等,也提供了简便易用的支持。
2.pgf的作者?
pgf也是beamer 的作者 Till Tantau 教授开发的. 起初只有 pgf, 后来有了 tikz and pgf 宏包的说法, 一般还是称为 pgf 宏包. 在使用中 \usepackage{tikz} 就自动加入了 pgf . 也许 tikz 可以认为是 pgf 进一步发展的产物.
正因为两者出自同一个牛人之手,所以beamer和pgf结合使用确实非常的完美。
3.pgf 下载地址: http://sourceforge.net/projects/pgf/
4.安装和更新的方法:
使用pgf,需要xcolor宏包的支持
如果你用的是 CTeX 套装, 在目录 C:\CTeX\texmf\tex\latex 下找到 pgf 文件夹, 删除该文件夹后, 粘贴上新版本的 pgf 宏包文件夹(直接粘就可以了, 不需要拆开). 记得要刷新.
如果你用的是Unix(like)系统,这样安装:
1)下载 xcolor 宏包, version 2.00 或者更高。解压放在TeXHOME/texmf/tex/latex/路径下。TeXHOME是你的TeX系统的根目录。
2) 下载pgf宏包,解压放在同样的目录下。
3) 更新TeX系统的数据库:mktexlsr
J. pgf格式的文件是什么类型的
笔者经过网上查找资料,才发现这个东东并不是什么可怕的东西,它只出现安装了PPS网络电视(ppstream)的机器上。之所以出现这个文件,原因是你使用了最新版PPS网络电视的点播功能。ppsds.pgf的作用主要用于点播时的缓冲,使缓冲时间更短,打开点播视频更快。如果你安装了最新版的PPS网络电视而不使用点播功能,ppsds.pgf不会出现。但只要你第一次使用PPS网络电视的点播功能,就会在PPSTREM安装硬盘根目录下生成隐藏文件ppsds.pgf,硬盘空间不够大的要注意一下。
这个1G的ppsds.pgf并不会对我们的系统造成什么不良的影响,唯一让人不爽的就是占用了将近1G的空间。这时我们可以通过显示系统文件的方式来找到它,删除。如果以后都不想出现这个文件,那么就不要使用PPS网络电视的点播功能,那样就没这种事了。
显示系统文件的步骤如下:
任何打开一个文件夹——点击菜单栏上的工具——选择文件夹选项——点击“查看”标签。然后在下面的高级设置框里,找到“隐藏受保护的操作系统文件”这项,把前面的勾去掉,这时系统会提示你,别理它,点“是”,再点确定。这样你就可以看到隐藏的系统文件了。