l*G
2 楼
对于自己定义的数据(结构)的成员打印格式居然出问题。有兴趣的看一下为何主程序
最后两行打印结果不一样?gfortran and ifort give same results on linux.
=====save to test.f90, and then "ifort test.f90" and then "./a.out" to run=====
module numz
integer, parameter:: b8 = selected_real_kind(14)
integer,allocatable :: a_gene(:),many_genes(:,:)
end module
module galapagos
use numz
type thefit !the name of the type
sequence ! sequence forces the data elements
real(b8) :: val
integer index
end type thefit
end module
module face
interface fitness
function fitness(vector)
use numz
implicit none
real(b8) fitness
integer, dimension(:) :: vector
end function fitness
end interface
end module
program darwin
use numz
use galapagos
use face
implicit none
type (thefit),allocatable ,target :: results(:)
type (thefit) best
integer,allocatable :: genes(:,:)
integer j
integer num_genes,gene_size
real(b8) :: junk
num_genes=3
gene_size=10
allocate(results(num_genes))
allocate(genes(num_genes,gene_size))
!call init_genes(genes)
genes=3 !set to 3
write(*,'("input")')
do j=1,num_genes
results(j)%index=j
results(j)%val=fitness(genes(j,:))
write(*,*)results(j)%val,results(j)%index
write(*,"(f10.8,i5)")results(j)%val,results(j)%index
! This one does not work WHY???
enddo
end program
function fitness(vector)
use numz
implicit none
real(b8) fitness
integer, dimension(:):: vector ! must match interface
fitness=sum(vector)
end function
=====
最后两行打印结果不一样?gfortran and ifort give same results on linux.
=====save to test.f90, and then "ifort test.f90" and then "./a.out" to run=====
module numz
integer, parameter:: b8 = selected_real_kind(14)
integer,allocatable :: a_gene(:),many_genes(:,:)
end module
module galapagos
use numz
type thefit !the name of the type
sequence ! sequence forces the data elements
real(b8) :: val
integer index
end type thefit
end module
module face
interface fitness
function fitness(vector)
use numz
implicit none
real(b8) fitness
integer, dimension(:) :: vector
end function fitness
end interface
end module
program darwin
use numz
use galapagos
use face
implicit none
type (thefit),allocatable ,target :: results(:)
type (thefit) best
integer,allocatable :: genes(:,:)
integer j
integer num_genes,gene_size
real(b8) :: junk
num_genes=3
gene_size=10
allocate(results(num_genes))
allocate(genes(num_genes,gene_size))
!call init_genes(genes)
genes=3 !set to 3
write(*,'("input")')
do j=1,num_genes
results(j)%index=j
results(j)%val=fitness(genes(j,:))
write(*,*)results(j)%val,results(j)%index
write(*,"(f10.8,i5)")results(j)%val,results(j)%index
! This one does not work WHY???
enddo
end program
function fitness(vector)
use numz
implicit none
real(b8) fitness
integer, dimension(:):: vector ! must match interface
fitness=sum(vector)
end function
=====
G*p
3 楼
【 以下文字转载自 Windows 讨论区 】
发信人: Gump ((Forrest)), 信区: Windows
标 题: 求救:移动文件后读不出来
发信站: BBS 未名空间站 (Sun Aug 24 04:09:11 2008)
Windows下把一些文件从一个硬盘C:的Desktop移动到另外一个硬盘F:后读不出来,
但F盘从Internet下载的文件没半点问题.
怎么办呢?还能把数据恢复么?
发信人: Gump ((Forrest)), 信区: Windows
标 题: 求救:移动文件后读不出来
发信站: BBS 未名空间站 (Sun Aug 24 04:09:11 2008)
Windows下把一些文件从一个硬盘C:的Desktop移动到另外一个硬盘F:后读不出来,
但F盘从Internet下载的文件没半点问题.
怎么办呢?还能把数据恢复么?
l*G
5 楼
对于自己定义的数据(结构)的成员打印格式居然出问题。有兴趣的看一下为何主程序
最后两行打印结果不一样?gfortran and ifort give same results on linux.
=====save to test.f90, and then "ifort test.f90" and then "./a.out" to run=====
module numz
integer, parameter:: b8 = selected_real_kind(14)
integer,allocatable :: a_gene(:),many_genes(:,:)
end module
module galapagos
use numz
type thefit !the name of the type
sequence ! sequence forces the data elements
real(b8) :: val
integer index
end type thefit
end module
module face
interface fitness
function fitness(vector)
use numz
implicit none
real(b8) fitness
integer, dimension(:) :: vector
end function fitness
end interface
end module
program darwin
use numz
use galapagos
use face
implicit none
type (thefit),allocatable ,target :: results(:)
type (thefit) best
integer,allocatable :: genes(:,:)
integer j
integer num_genes,gene_size
real(b8) :: junk
num_genes=3
gene_size=10
allocate(results(num_genes))
allocate(genes(num_genes,gene_size))
!call init_genes(genes)
genes=3 !set to 3
write(*,'("input")')
do j=1,num_genes
results(j)%index=j
results(j)%val=fitness(genes(j,:))
write(*,*)results(j)%val,results(j)%index
write(*,"(f10.8,i5)")results(j)%val,results(j)%index
! This one does not work WHY???
enddo
end program
function fitness(vector)
use numz
implicit none
real(b8) fitness
integer, dimension(:):: vector ! must match interface
fitness=sum(vector)
end function
=====
最后两行打印结果不一样?gfortran and ifort give same results on linux.
=====save to test.f90, and then "ifort test.f90" and then "./a.out" to run=====
module numz
integer, parameter:: b8 = selected_real_kind(14)
integer,allocatable :: a_gene(:),many_genes(:,:)
end module
module galapagos
use numz
type thefit !the name of the type
sequence ! sequence forces the data elements
real(b8) :: val
integer index
end type thefit
end module
module face
interface fitness
function fitness(vector)
use numz
implicit none
real(b8) fitness
integer, dimension(:) :: vector
end function fitness
end interface
end module
program darwin
use numz
use galapagos
use face
implicit none
type (thefit),allocatable ,target :: results(:)
type (thefit) best
integer,allocatable :: genes(:,:)
integer j
integer num_genes,gene_size
real(b8) :: junk
num_genes=3
gene_size=10
allocate(results(num_genes))
allocate(genes(num_genes,gene_size))
!call init_genes(genes)
genes=3 !set to 3
write(*,'("input")')
do j=1,num_genes
results(j)%index=j
results(j)%val=fitness(genes(j,:))
write(*,*)results(j)%val,results(j)%index
write(*,"(f10.8,i5)")results(j)%val,results(j)%index
! This one does not work WHY???
enddo
end program
function fitness(vector)
use numz
implicit none
real(b8) fitness
integer, dimension(:):: vector ! must match interface
fitness=sum(vector)
end function
=====
a*1
8 楼
you results(j)%index is equal to 35.00
f10.8 means 10 positions (including all digits and decimal point) to be used
and 8 digits to the right of decimal point. You can revise this format into
f10.7 or f11.8
f10.8 means 10 positions (including all digits and decimal point) to be used
and 8 digits to the right of decimal point. You can revise this format into
f10.7 or f11.8
l*G
11 楼
thanks, I overlooked that...
X*o
15 楼
羌族?
r*z
23 楼
1、 彝 族 2、 白 族 3、 藏 族 4、 傣 族 5、 佤 族 6、 侗 族
7、 哈尼族 8、 苗 族 9、 拉祜族 10、纳西族 11、景颇族 12、水 族
13、怒 族 14、傈僳族 15、独龙族 16、布朗族 17、基诺族 18、羌 族
19、门巴族 20、德昂族 21、阿昌族 22、普米族 23、布依族 24、珞巴族
25、仡佬族 26、回 族 27、东乡族 28、撒拉族 29、保安族 30、维吾尔族
31、土 族 32、裕固族 33、锡伯族 34、俄罗斯族 35、塔塔尔族 36、哈萨克族
37、柯尔克孜族 38、塔吉克族 39、乌孜别克族 40、高山族 41、畲 族 42、黎 族
43、壮 族 44、瑶 族 45、京 族 46、仫佬族 47、毛南族 48、土家族
49、满 族 50、朝鲜族 51、赫哲族 52、蒙古族 53、达斡尔族 54、鄂温克族
55、鄂伦春族 56、汉 族
7、 哈尼族 8、 苗 族 9、 拉祜族 10、纳西族 11、景颇族 12、水 族
13、怒 族 14、傈僳族 15、独龙族 16、布朗族 17、基诺族 18、羌 族
19、门巴族 20、德昂族 21、阿昌族 22、普米族 23、布依族 24、珞巴族
25、仡佬族 26、回 族 27、东乡族 28、撒拉族 29、保安族 30、维吾尔族
31、土 族 32、裕固族 33、锡伯族 34、俄罗斯族 35、塔塔尔族 36、哈萨克族
37、柯尔克孜族 38、塔吉克族 39、乌孜别克族 40、高山族 41、畲 族 42、黎 族
43、壮 族 44、瑶 族 45、京 族 46、仫佬族 47、毛南族 48、土家族
49、满 族 50、朝鲜族 51、赫哲族 52、蒙古族 53、达斡尔族 54、鄂温克族
55、鄂伦春族 56、汉 族
相关阅读
招聘,硬件设计和FPGA编程请教一个关于oscillator的问题,AM,FM modulationResearch Associate Opportunity at Washington State UniversityGoogle硬件这么放羊啊?招人 * job openings可以帮助内推RF IC设计工程师, 在大波士顿地区黑客攻击用的最短代码是什么?高压端信号变低压的问题需要biomedical sensing审稿的请回复真诚求review 机会北京大学电子学系教授招聘宣讲 10/04/2017 MIT (转载)果子的能量真大有无人知道哪里有卖这种材料?FPGA-based DNNs (转载)Postdoctoral Fellowship Position in Medical Physics and Engineering实习职位: Computational Intelligence in RF Circuit Design (转载)offer选择纠结求文献:IEEE Transactions on Circuits and Systems for Video Technology工作选择 process跟设备(SCI, 2017-5-31) Remote Sensing Big Data: Theory, Methods and Applications