Ubuntu :: Changing Fortran Code To Python?
Aug 19, 2011
I have a big fortran code for FE analysis. I want to change the code to python. I am curious to know, whether I will get any advantage over speed, If not at least the speed should not be less than what fortran gives. Should I go for it.
View 2 Replies
ADVERTISEMENT
Apr 15, 2009
I'm trying to call some Fortran 95 code in C, but I'm having problems with integers not having the same value in C as in Fortran, and changing values upon each run of the program. I think it has to do with the integer type, but I don't know how to fix it. I'm running Gentoo x86. Here are the files I've got:
foo.c:
Code:
#include <stdio.h>
extern int qux_();
main() {
[code]....
View 2 Replies
View Related
May 18, 2011
I can compile an old fortran program on my macbook using the Absoft fortran compiler and the command:f90 'W132 C SOURCECODE.flU77lV77
Unfortunately I cannot find f90 for linux. I can, however, find gfortran. However, gfortran does not recognize the flag -W132 and when I remove -W132 the compiler thinks all lines end after a certain number of characters. Does anyone know what flags call the equivalent type of compilation using gfortran? Is it possible I need to use f90? If so, is there a free version of f90 for linux?
View 8 Replies
View Related
Jun 10, 2009
I'm not a Fortran coder but I need to call the sub-routine ADAPT.f from a c code.This subroutine calculates a multiple integral of a given function.My problem is that the c code works with no problem in a 32 bit machine but it does not in a 64 bit machine, and the problem seems to be related to adapt, which calculations gives a NA rather than the result of integration.Since fortran is quite obscure for me, I don't know why is this happening. Maybe I should change some data type (from real to double), but I'm not sure. Does anyone have a clue?
View 3 Replies
View Related
Mar 10, 2011
I am dealing with one FORTRAN 90 code, have made small changes.
milenko@milenkons:~/mt4$ make mt4
make: 'mt4' is up to date.
milenko@milenkons:~/mt4$ ifort -c MT2DDIB1.FOR
milenko@milenkons:~/mt4$ make mt4
make: 'mt4' is up to date.
milenko@milenkons:~/mt4$ make mt4
make: 'mt4' is up to date.
milenko@milenkons:~/mt4$ make mt4
make: 'mt4' is up to date.
I go for make command but it does not see that the source code has been modified.Than I do compilation from command line,try make again but no use.
F95=ifort
FFLAFGS= -O1
mt3: driver_mt2ddi.o constants.o settings.o params.o mt2dmod.o fdsystem.o mt2ddat.o mt2dsens.o
$(F95) -o $(FFLAGS) mt3 constants.o settings.o params.o mt2dmod.o fdsystem.o mt2ddat.o mt2dsens.o driver_mt2ddi.o
driver_mt2ddi.o: driver_mt2ddi.for constants.o settings.o params.o mt2dmod.o fdsystem.o mt2ddat.o mt2dsens.o
$(F95) -c $(FFLAGS) driver_mt2ddi.for
View 2 Replies
View Related
Jul 27, 2011
I am looking for a text editor that does 1) syntax highlighting2) code folding3) it would be a bonus if I could set which macros were defined and it would show me the source I have tried geany, and codeblocks. Both incorrectly code fold around preprocessor #ifdef and #endif. The gedit plugin doesn't seem to work at all
View 7 Replies
View Related
Apr 18, 2011
I am trying to write a script (especially C-shell) to execute a fortran code that reads in parameters from keyboard typing. I will have to process this .F code for many times with the parameters the same for all my data files, therefore, I don't have to type in everytime I execute the .F code. But I don't know what is the command in c shell to read in a text files that contains all the parameters I want and can make the shell read in appropriately to feed the .F code.
View 3 Replies
View Related
Dec 2, 2008
I synthesized a seismogram by using Fortran codes, I need plot the synthesized seismogram and the data together, so I can verify the accuracy of code. Now I encounter a question: how to read the SAC data by Fortran code, I have searched some codes on Internet, the details as follow:the velr12a.sac is my data file.
Code:
c read sac file
PROGRAM RSAC
PARAMETER (MAX=1000)
DIMENSION YARRAY(MAX)
CHARACTER*10 KNAME
[Code]....
View 2 Replies
View Related
Jan 15, 2010
I have the simple fortran codes as:
Code:
integer :: i1=2455121, i2=2455121
real :: s1=0.19123840, s2=0.20749992
real*8 :: a1, a2
a1=i1+s1; a2=i2+s2
[Code]....
When s1 and s2 are stated with 'real*8', the 64bit and 32bit systems get the same results.
View 6 Replies
View Related
Dec 2, 2010
I have written a backup script backing up the data I have worked during the day with rsync and sends me a log in my email. now it works perfect but i want to execute it each time i shutdown my computer in the evening not during reboot or logout.It seems that i can not run it by putting it in init.d and softlinking in rc0.d as K00backup. I think it is because script uses many services like python or smtplib, gnome-keyrings that in that time might have been already shutdown.
View 2 Replies
View Related
Dec 16, 2008
i have attached a word doucment with black jack code, i want to know what things are wrong with it, and why it does not run, in python, as it keeps displying error messages such as "invalid syntax"
View 14 Replies
View Related
Jun 28, 2010
I've taken the source code for Zlib1.2.3, built and installed in a 64 Bit linux machine. Then when i downloaded Python 2.5.4 source and tried to build(make), i got the following error
gcc -pthread -shared build/temp.linux-x86_64-2.5/opt/cinecert/Python-2.5.4/Modules/zlibmodule.o -L/usr/local/lib -lz -o build/lib.linux-x86_64-2.5/zlib.so /usr/bin/ld: /usr/local/lib/libz.a(adler32.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC /usr/local/lib/libz.a: could not read symbols: Bad value collect2: ld returned 1 exit status
View 3 Replies
View Related
Apr 9, 2010
The system is Debian Squeeze/Sid with apt.conf set to Squeeze as the default. Most packages are from Squeeze.
I ran apt-get upgrade and it returned an error-code.
It might be it is this bug: Bug#574153: python-pkg-resources: Missing file leaves it unconfigured
I tried aptitude install -f, to hold it and to remove the package python-pkg-resources, but i am getting told the package would be in a very bad stage, and i should re-install it. That doesn't work.
View 1 Replies
View Related
Sep 17, 2010
how you change the default version of python in Lucid. Lucid comes packaged with 2.6 but we use 2.5 where I work. I didn't see much of anything on the web for this topic so figured I'd post something. If you are installing python2.5 on Lucid version 10.04 (comes package with 2.6 only)
View 1 Replies
View Related
Jan 13, 2010
I usually develop python code with emacs, emacs being in python code. On my desktop a version is installed and/or configured that way, so I easily can choose a region in the code and simply click on a menu option to comment out this block of code (i.e. at the begin of each line in the selected code two '##' are put). That is very convenient.
However, on my Laptop, running F12 and emacs 23.1.1, this menu option is missing! I searched within google and found the hint that by pressing 'C-c #' I also can comment out a selected region. But on my emacs it says: 'C-c # is undefined'. Am I missing something? Anyone any idea how to fix/install/update/solve this problem, so I can easily choose a couple of python lines and comment them out?
View 3 Replies
View Related
Dec 11, 2010
I have a Python program looks like this one :
Code: import os
import time
process = os.popen("top").readlines()
[code]...
View 2 Replies
View Related
Feb 3, 2010
I have this one last task for this app I've been working on (should have picked something easier for my first project)
It has working "def sav_scr_vars" and "def AddEntry" but these save to a fixed filename when save as defults or ok button is clicked. This is fine but I want to be able to save via the same proccess to a named ~/bin/settings/xxx.set file what I did is clone the to above def's and try to edit them I got the "read file" to work fine from a saved file in this manner. but I can't seem to get the save to filename to work without errors. The cloned def's are "save_as" and inmain.py "write_config2"
the camm2.defaults file goes in ~/.hpgl
copy and paste this to ~/.hpgl/camm2.conf
~/.hpgl/camm2.defaults
The file is always to have a .set extension and only read and write to ~/bin/settings
View 1 Replies
View Related
Jul 3, 2010
What are some major rolling release distros? I know I've heard Debian testing is/can be, is this just a matter of changing "code-name whatever" to stable/testing? Arch was good but it just seemed a little to bleeding edge for my tastes (Though the documentation is far and away the best I've seen) What are some other rolling release distros?
View 10 Replies
View Related
Mar 22, 2009
I want to be able to do
sudo ./program.py
instead of always having to do
sudo python program.py
What do I need to change?
View 5 Replies
View Related
Nov 30, 2009
I've already used line split stuff to transform my data into something like this in a text file:
Code:
['1', '1', '3', '20.7505207']
['2', '1', '3', '23.0488319']
['3', '1', '3', '-1.5768747']
['4', '1', '3', '-26.4772491']
[code]....
How can I get this on a python program so I can manipulate it as an array?
View 3 Replies
View Related
Oct 27, 2010
in ubuntu 10.10, I have installed python 2.7. I would like to use apt-get to install packages to this version of python but I haven't been able to figure out howThings I have tried without success:changing the symlink at /usr/bin/python to point to /usr/bin/python2.7 - even after doing this apt-get still installs stuff to python2.6.Set up python2.7 as the primary alternative using update-alternatives - doesn't work
View 3 Replies
View Related
Jul 17, 2010
Python 3 want situation for python 2?Python 2 become stop?
View 1 Replies
View Related
Jan 7, 2011
yum dependency problem please? I am running Centos 5.5. I need to install python-devel, but when I do so I get:
[Code]....
View 2 Replies
View Related
Mar 4, 2010
I have a function definition in a Python 2.x script which take a tuple as one of its arguments, but 2to3 has no answers nor any of my searching on how to represent the same in Python 3.x
Code:
def blah(self, (string1, string2))
View 4 Replies
View Related
Mar 30, 2011
How can I upgrade python-2.4.3 to python-2.5?
View 1 Replies
View Related
Mar 30, 2011
I need to rewrite the selenium java code into its equivalent php code.
View 5 Replies
View Related
Apr 14, 2011
I've a FORTRAN program that I would like to compile in my machine. I've gfortran installed, so I issue the command: gfortran asc2bin.f write_geogrid.o
but this error are displayed
Code:
asc2bin.f:3.72:
INTEGER isigned,i,j,endian,wordsize,nx,ny,xllcorner,yllcorner,
1
Error: Invalid character in name at (1)
[Code].....
View 1 Replies
View Related
Jun 14, 2010
I have a problem when I want to run executable program,I get this:
./xtramp: error while loading shared libraries: libf2c.so.2: cannot open shared object file: No such file or directory. My machine is x86_64,may be ere is problem.Anu ideas how to solve this?
View 6 Replies
View Related
Sep 1, 2011
is everytime i reboot , my keyboard is reset to USA. im in canada & it pisses me off each time i need to change it also.all my options on EMESENE is the same issue always RESET.it's like if nothing keeps the changes once rebooted.
View 1 Replies
View Related
Jun 22, 2011
Can we open *vtk files in fortran?If yes,How?I have written my code as below:I keep getting error: bad real number in item 1 of list input
program work_file
implicit none
integer:: open_status,ln
[code]...
View 3 Replies
View Related