Log in

16 March 2009 @ 01:51 pm
Just some self-advertising)
I don't know if it will be useful for anyone, but if you have to work with ASCII data-tables, than I have something for You. This tool is doing some everyday tasks, like finding data minimums/maximums, median, average values, building histograms, linear fits and so on. You may say, that there is AWK and many other tools but I would say, that my tool is much smaller and faster.
You can download it here:

Why in this community? Well, it is written in FORTRAN90, huh)
11 March 2009 @ 11:33 am
Hello Fortran LJ group! I've been programming for 20+ years, and have been using fortran for most of them, and I have yet to find an elegant solution to this problem:

Many ASCII-based geometry file formats are picky about spaces: no leading spaces, no spaces between some number and a control character, etc. I specifically mean .vtk and .obj:

v 0.0 0.1 1.0
v 1.0 0.0 1.0
v 1.0 0.1 1.0
vn 0 0 1
f 1//1 2//1 3//1

Throw in some spaces, and most programs bomb.

Anyways, the only way that I've found to get rid of that awful leading first space is by putting text right into the format string:

write(99,'("v ",e12.6,1x,e12.6,1x,e12.6)') x(:,i)

Gotta love all those redundant characters.

But the real problem arises when trying to write the f 1//1 strings. Do I really need to print each integer to a character array using its own write statement, then adjustl each of them and concatenate them into a single string, THEN cram those onto a single line with a specially-made format string? This is beyond silly.

  integer :: i1,i2,i3,i4,i5,i6
  character(len=7) :: str1,str2
  character(len=18) :: stra,strb,strc
  character(len=57) :: str
  character(len=10) :: fstr

  i1 = 41
  i2 = 2
  i3 = 42
  i4 = 2
  i5 = 43
  i6 = 3

  write(str1,'(i7)') i1
  write(str2,'(i7)') i2
  write(stra,*) (str1//"//"//adjustl(str2))

  write(str1,'(i7)') i3
  write(str2,'(i7)') i4
  write(strb,*) (str1//"//"//adjustl(str2))

  write(str1,'(i7)') i5
  write(str2,'(i7)') i6
  write(strc,*) (str1//"//"//adjustl(str2))

  write(str,*) (trim(adjustl(stra))//" "//trim(adjustl(strb))//" "//trim(adjustl(strc)))

  if (len_trim(str) > 99) then
    write(fstr,'("(a",i3,")")') len_trim(str)
  else if (len_trim(str) > 9) then
    write(fstr,'("(a",i2,")")') len_trim(str)
    write(fstr,'("(a",i1,")")') len_trim(str)
  write(*,fstr) str

% gfortran test.f90; a.out 
f 41//2 42//2 43//3

For real?
25 January 2007 @ 10:01 am
Could you be so kind to help me!

I'm just started working with FORTRAN (never tried before) though i have some experience with other languages. Now i need to modify some codes which is written in
Compaq Visual Fortran Professional 6.6.0

Where i can find a good manual for this version of FORTRAN?

Current Mood: cheerfulcheerful
19 October 2006 @ 02:44 pm
Im interested in learning fortran....so as there aren't any classes in the area i'd like to try to self teach myself....


I found that book and thought it looked appropriate as I am a Scientist....

So Im looking for a Windows based Compiler (if it exists?)... Ive tried to download a couple from a couple websites... thing is once I download and extract the file... I dont see any exe file to run the actual program....

Do I write my programs in like...notepad or Word or somewhere and then do a command at the Run prompt?...

Thanks for the help
09 September 2006 @ 10:51 pm
Does anyone know of any companies which provide on-site advanced Fortran classes for scientists and engineers?

I am putting together a class and it seems there aren't a lot of companies which provide this service.
26 June 2006 @ 10:58 am
I was wondering, does anyone know a good finite elements Fortran subroutine to find the Laplacian eigenvalues in a 2D arbitrary region, with boundary condition equal to zero?
(Sorry about my bad English)
Cross-posted in _scientists_ and mathematics
Thanks in advance.
20 June 2006 @ 04:50 pm
I'm writing a program to build .html documentation basing on Fortran (both f77/f90) sources. It's in Ruby language, and will be portable (at least Win/Linux).
The key point is that You need absolutely no modifications in Your code to get useful .html files...
At the moment it's still under development, but some preliminary results are already there...  Are You interested in things like that? Any suggestions are welcome.
21 May 2006 @ 01:12 am

I need to teach myself fortran over the summer. Do you have any recommendations for a good book on this subject? (My level of programming experience is putting together simple C programs.) Also, I see there are all these differnt version of fortran out there, I assume my best bet would be to go with 95 or 2003?

Also, Ill probably be using my Windows/Intel computer at home, I was thinking of picking up Intel Visual Fortran. Any experiences or opinions on this?
16 April 2006 @ 08:52 pm
I'm using fortran in astronomical application...
Using FORTRAN-77 makes me sick & bored, so I shifted to FORTRAN-90.
Very nice and useful language, I have already done lots of good things, but as soon as you decide to work with strings instead of numbers - you are in trouble... Luckily, there's not too much to do with strings in atronomy... But when I need to, I use Ruby or Bash-script...
21 February 2006 @ 01:09 pm

I'm an engineer of Sun Microsystems working on compiler's performance for AMD64 systems. If you are interested in discussion about SunStudio compilers and tools welcome to new community sunstudio

Michael Selehov.