由买买提看人间百态

topics

全部话题 - 话题: fortran
首页 上页 1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)
b****e
发帖数: 906
1
FORTRAN中不容许用户定义数组的大小,必须预先开好空间,这一步是在编译的时候完
成的,如果你要在执行的时候生成数组,可以用allocate函数
m*****g
发帖数: 278
2
刚刚接触fortran,不知道哪个debug软件比较好用呢,比如想设置断点,实时观察变量
赋值,或者可以一步一步运行程序。linux或者windows都可以。
谢谢大家!
t****1
发帖数: 232
3
小弟是vs的生生生生手,最近刚开始用vs+ivf写fortran,但是debug的时候总会有跳出
对话框project out of date,然后rebuild就会说console.exe文件找不到。网上找了
很久也找不到解决办法,不知道哪位大牛能帮帮忙,跪谢了!
t****g
发帖数: 35582
4
watcom fortran 不是free的么?
c****n
发帖数: 271
5
谢谢楼上的
有个专业软件要在
intel fortran基础上运行
很多人试过其他编译器好像有问题
所以想下一个
3x
G*****7
发帖数: 1759
6
google intel fortran and get a 30 day trial.
l**t
发帖数: 452
7
【 以下文字转载自 Programming 讨论区,原文如下 】
发信人: leot (leot), 信区: Programming
标 题: 如何用Fortran 或者c, java读excel文件?
发信站: The unknown SPACE (Tue Jul 1 23:28:54 2003) WWW-POST
好像总是有些小地方读得不太准确.
有一批这样的文件,所以又不能用excel导出成txt.
大家有什么办法解决? thank you!!!
k*****c
发帖数: 6
8
Write a vb program to save the excel files as text files.
But actually your question confused me. You want to use either Fortran, or C,
or Java to read excel files? Better to re-think your design.
j******7
发帖数: 8
9
来自主题: Linux版 - 跪问:intel fortran
大家好,
我今天在装intel fortran时,总遇到一个错误,文件libstdc++.so.5 is missing,软
件是在网上下的free的non-commercial的,各位大侠指点迷津,急用ifort,快气死了,弄
了一天,死活装不上.
r*********w
发帖数: 119
10
来自主题: Linux版 - Fortran complier
intel fortran 是免费的吧?正在用。
p**o
发帖数: 3409
11
synology nas,用的是下面这个源,toolchan里缺个fortran编译器
http://ipkg.nslu2-linux.org/feeds/optware/syno-i686/cross/unsta
有何变通的办法?
m***r
发帖数: 294
12
来自主题: Programming版 - Fortran question: FORMAT(3HXY=3I)
Suppose number 123 is printed by a PRINT statement in Fortran that uses the
above format.
What is output?
h**i
发帖数: 57
13
来自主题: Programming版 - Fortran question in PLC?
Suppose that the number 123 is printed by a PRINT statement that uses the
following FORMAT:
FORMAT(3HXY=3I)
What output will the PRINT statement produce?
This is a question in PLC.(suppose we use the 1956 version of the Fortran)
m****r
发帖数: 51
14
来自主题: Programming版 - Fortran question in PLC?
这个是不是不同的compiler会给不同的结果?fortran的portable很差的
c***y
发帖数: 367
15
我有36条curve要那到Excel里快速显示一下
想输出文件成如下格式
X Curve1 Cuvev2 Curve3.... Curve36
X1 Z1 Z1 of C2 Z1 of C3
X2 Z2 Z2 of C2 Z2 of C3 Z2 of C36
......
X825 Z825 Z825ofC2 Z825 of C3 Z825 of C36
发现fortan 的write语句总喜欢自动换行
除非显式指定个数
like write(4,'(F15.7, 36F15.7)'
不过我的curve数目不定,没法用这个方法.
请问,fortran里有类似Pascal的write, writeln 控制语句吗?
还有,我发现Excel的column 数不能多于825 :)
k****z
发帖数: 550
16
来自主题: Programming版 - any way to use regex in Fortran?
use some script language to pre-process it and call fortran in backend.
that'll be a nicer combination.
j**r
发帖数: 68
17
来自主题: Programming版 - fortran中dm有什么特殊含义吗
fortran不是好多implicit申明的么
O******e
发帖数: 734
18
来自主题: Programming版 - fortran中dm有什么特殊含义吗
Fortran has no reserved words.
P********e
发帖数: 2610
19
c++的 double size可能和Fortran不一样
and be aware of header

following
q****2
发帖数: 7
e**e
发帖数: 3
21
Did the Fortran program use "direct access" or "sequential access" to
write the binary file?
If "sequential access", each write statement will produce one record
in the data file, and the record is prefixed and postfixed with the
integer value that is the length of that record. For example
open(unit=..., file="...", access="sequential", form="unformatted")
write(unit=...)1.23d0
will write the four-byte integer "8", the eight-byte double "1.23d0",
and again the four-byte integer "8". The "8
y*w
发帖数: 238
22
只会matlab找不到工作
其实只会fortran估计也找不到,:)
y*w
发帖数: 238
23
一般来说,个人随手写写的code基本上用啥效率都比不过用matlab
如果seriously的好好按照书上讲的写一些计算方法,那c/fortran就比matlab快了
如果是多个计算方法合在一起的复杂算法,有design的实际问题要考虑,那基本matlab
就不行了
O******e
发帖数: 734
24
Dynamic allocation in heap memory using Fortran 90/95:
integer,dimension(:),allocatable::p2i
integer::size
integer::alloc_stat
read(some_file,some_format)size
allocate(p2i(1:size),stat=alloc_stat)
if(alloc_stat.ne.0)stop"error allocating p2i"
...
deallocate(p2i,stat=alloc_stat)
if(alloc_stat.ne.0)stop"error deallocating p2i"
If you want to call a subroutine to allocate p2i, return from that
subroutine, use p2i elsewhere, then call another subroutine to deallocate
p2i, you will need to declare p2
O******e
发帖数: 734
25
The :: is just the new syntax for declarations in Fortran 90/95/2003.
In F77 you would write
INTEGER X
DIMENSION X(1:N)
or more compactly
INTGETER X(1:N)
and in F90+ you would write
integer,dimension(1:n)::x
The :: separates the type and properties from the list of variables.
It does not have the same meaning as :: in C++.
You can probably even omit the :: (at least in some cases you can).
I have gotten into the habit of always writing the :: where possible.
d****n
发帖数: 12
26
来自主题: Programming版 - 各位推荐一些fortran的教材
本人有c与c++编程基础,最近想学fortran,各位推荐一些基础教程,最好是电子版的
d****n
发帖数: 12
27
来自主题: Programming版 - 各位推荐一些fortran的教材
人品貌似不够,自定一下。各位大侠能推荐一些学习fortran的基础教材么,电子版的最
好,因为想从网上下载。
o*****t
发帖数: 72
28
来自主题: Programming版 - 各位推荐一些fortran的教材
intel fortran ?
c******y
发帖数: 96
29
一个很弱的问题。
我有两个文件要输入,一个是默认的地址,放在当前目录,另外一个是要用语句说明的
,比如 在unix下命令是这样运行的,XXX -i abc,请问在isual fortran 下应该如何
运行,多谢!
p*********7
发帖数: 147
30
我有个程序用Compaq Visual Fortran 6 写的,但是发现在Windows Vista 不兼容,运行
不了,请问有办法解决吗? 查了一下,发现Visual Studio 6 与 Windows Vista不兼容.
l********r
发帖数: 175
31
I wrote Fortran program to calculate the average and standard deviations of
a large number of data. It turned out that the instantaneous results are
always positive, then the last several sets of average values became
negative. I think it is because the total sum of those data reached the
limit of computer. So it began to show negative results.
I define the type of data as double precision. Is there anyone knows how to
solve the problem? Thanks a lot.
l***8
发帖数: 149
32
I bet it is not the fault of "double precision" data. The "double precision"
data are floating point. Their range is extremely wide (IEEE double can be
up to 1e307) and it is not possible to overflow from positive to negative (
you will only get a +NaN).
I think you're seeing negative numbers because the "count" is an integer and
FORTRAN calculates the average as (double)"sum" / (int)"count". If you have
more than 2 billion data entries (or 4 billion if the "count" is unsigned),
you'll see negat
k****f
发帖数: 3794
33
来自主题: Programming版 - 问个c调用fortran函数的问题
fortran函数的一个参数是derived data type,定义为:
TYPE, PUBLIC :: data_type
PRIVATE
INTEGER :: iter
INTEGER :: itmax
REAL ( KIND = working ) :: alpha
REAL ( KIND = working ) :: stop
REAL ( KIND = working ) :: diag
REAL ( KIND = working ) :: xmx
LOGICAL :: printi
REAL ( KIND = working ), POINTER, DIMENSION( : ) :: P, D, Z, W
END TYPE
怎么变成C的结构??
我写了
struct data_type{
int iter,itmax;
double alpha,stop,diag,xmx;
i
k****f
发帖数: 3794
34
来自主题: Programming版 - 问个c调用fortran函数的问题
谢谢了,我最后就是重新写个fortran接口,
把derived type包装了一下,
不用pointer,而直接用数组传递数据,结果都正确了
gw
发帖数: 2175
35
有一段大概这样的Fortran code,
subroutine A

Part B
do i=1,N1

Part C1
enddo
do i=1,N2

Part C2
enddo
contains

function d1

subrounine e1
endsubroutine A
这里面 part B, C1, C2都用到了contains里的functions and subroutines.其中C1和
C2是一段比较长的代码,并且有很大的相似性,但功能有一点不同。直接这样写,看着
这个程序总有点别扭,因为C1,C2两大段总让人有重复的感觉。于是想写一个新的
subroutine C来取代这两部分,使整个程序变成这样的。
subroutine A

Part B
do i=1,N1

call C(1)
enddo
do i=1,N2

call C(2)
enddo
contains

function d1

su
h*****d
发帖数: 788
36
来自主题: Programming版 - FORTRAN 90 菜鸟问题
Thank you! Fortran getting more more complicated...
x********3
发帖数: 566
37
现在有一个比较大的Fortran程序,好几百个个common块被在不同组合后,被好几百个
子程序使用,现在需要改写这个程序,每次这些common块都比较麻烦,改变一个往往的
一个一个子程序找着挨个儿改。想用module封装一下,可是觉得这样做了之后觉得每个
module里就列出几十个全局变量,似乎也没有好很多。而且工作量似乎很大,因为每个
common块在不同子程序中的变量名可能不一样,比如
在子程序A: common /blk1/ v1,v2,v3
在子程序B: common /blk1/ u1,u2,u3
这样一来,觉得动作还是比较大的,不知道有没有好的办法,大家给指点一下。谢谢了
k**f
发帖数: 372
38
Not sure about Fortran, but in c/c++, you can use the system() function from
.
http://www.cplusplus.com/reference/clibrary/cstdlib/system.html
r*********r
发帖数: 3195
39
来自主题: Programming版 - 在C/Fortran之间传递2维数组
是练手还是实用?
要实用的, boost::multi_array 不错.
可以规定内存用fortran的方式存放.
i****d
发帖数: 255
40
来自主题: Programming版 - 在C/Fortran之间传递2维数组
谢谢二位!
实用。自己的C程序和别人的Fortran程序。
k******n
发帖数: 35
41
来自主题: Programming版 - 在C/Fortran之间传递2维数组
I believe most people use Fortran for some computational libs. In these
cases, you do not need two dimensional array. One dimensional will serve
most purposes.
g*****t
发帖数: 394
42
来自主题: Programming版 - FORTRAN读文件时这样的错误怎么办?
读入二进制文件(.gdat,.dat)时,经常会出现这样的问题,电脑的操作系统是linux
, 用pgf77编译:
attempt to read non-existent record
或者: past the end of the file
或者就是specifiers conflict
我不断的修改access,form, status,recl等设置,从来没有把错误调通过,很是郁闷。
请问大家这是怎么回事?虽然很
简单,很基础,如果能介绍介绍本书或者网站也行,谢谢了!
以前在国内的时候在windows下用fortran读文件,感觉很简单,从来没有遇到过这样的
问题。
更诡异的是,同样的数据,我自己单独写个程序用同样的设置读入没问题,但是在一个
大程序中同样的写入,就会出
现类似的问题。
d****y
发帖数: 1650
43
来自主题: Programming版 - 一个fortran问题:
CHARACTER(3) SNAME
这个用法是哪个版本的fortran里的?g77认识,但是我在fortran77里的文档里都没找到。
SUBROUTINE XERBLA_ARRAY(SRNAME_ARRAY, SRNAME_LEN, INFO)
CHARACTER(1) SRNAME_ARRAY(SRNAME_LEN)
...
...
比如这里的语句,SRNAME_ARRAY是个多大的数组?
多谢
O******e
发帖数: 734
44
来自主题: Programming版 - [合集] LINUX下FORTRAN编程疑问
The error message said it: "Reference to unimplemented intrinsic 'TRIM' at .
. ."
The compiler recognizes "TRIM" as the name of an intrinsic function, but the
TRIM function was not defined in the compiler's run-time library, or the
Fortran run-time library containing TRIM is not being linked. Either a
problem with the installation, or the compiler is not standard compliant.
O******e
发帖数: 734
45
来自主题: Programming版 - fortran里面common的问题
A common block is similar to a pointer to a contiguous
block global-access memory. In Fortran 77, a common
block is either named or unnamed. There can be only one
unnamed common block, but multiple named common blocks
in a program. Each common block is a separate chunk of
global memory.
In the program you showed, there is only one unnamed
common block, and this common block points to a single-
precision real array of four elements. This array is
referenced as DSTRESS in subroutine A, and ref
s******u
发帖数: 179
46
在fortran 90中,我将一个稀疏矩阵存成下面的数据格式:
TYPE:: rsm !Real sparse matrix
integer:: numbers !number of nonzero value in the matrix
integer,dimension(:),pointer::rows
integer,dimension(:),pointer::columns
real ,dimension(:),pointer::values
END TYPE rsm
然后用指针读取这个矩阵
TYPE:: rsmptr
type(rsm),pointer::p
END TYPE rsmptr
每次读取都是从第一个到后一个顺序读取。后面的程序中要对这个矩阵多次重复的读取(且是在内存中)
,这样的存法,读取的效率不怎么高。我也试过把一个矩阵中的元素存成一个node的数
据结构:
type:: node
integer :: rows
integer
O******e
发帖数: 734
47
The meaning of the terminology "pointer" is different
in Fortran 9x and C.
In C, a pointer refers directly to an address.
In F9x, a pointer is actually a complicated data structure.
This is the essence of your problem--misuse of the F9x "pointer".
Before I get into all the details, how well do you understand the
following F9x concepts:
1. array subsection
2. copy-in and copy-out of actual array arguments
3. argument passing by reference in F9x, or passing by pointer in C
c******d
发帖数: 906
48
我想在老板的机子上跑fortran,是Darwin的os
对应linux下的ifort语句,不知道mac下的语句是啥?
另外我用linux下编译好的executable file,在Darwin下无法运行
cannot execute binary file,这个如何解决?
谢谢
v****c
发帖数: 32
49
来自主题: Programming版 - Fortran大虾们请帮帮忙
fortran大虾们请帮帮忙,下面这段程序是否有死循环?程序不结束,输出文件中没有
内容。谢谢
K******C
发帖数: 230
50
来自主题: Programming版 - MPI xl fortran problem on Blue Gene
我的
code 基本上是用frotran 77 和mpi library 写的.以前用GNU 的编译的,一直没有什
么问题:
mpif77 -r8 -o code.f
现在我把code 移到了blue gene上,用了xl fortran编译,就出现在问题了
mpixlf77 -O2 -qrealsize=8 code.f
我在code里面用了common block 定义全局变量
有一个全局变量不应该在 运行过程中变化的,后来我把这个变量 在所有的subroutine
里面print out。发现每当call 某个 subroutine以后,这个值就变化了,奇怪的是在
这个subroutine 里面 ,我没有定义这个变量所在的common block. 而且这个值从以来
的的‘4‘,一下变成了 ’2XXXX‘ ,而且每次call这个subroutine 就继续变大。
我估计是不在编译的时候设定环境变量有问题,但不知道怎么改。 不是高手有什么好
主意?
BTW:我的code 里面还定义了 double presicion的变量
首页 上页 1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)