Force Fortran - The Force Project

Monday, August 30, 2010

Download links updated

I realized that many of you were downloading the old version 2.0.8 instead of 2.0.9 of Force. The old version is incompatible with Windows Vista/7 and 64 bit versions. It was only a matter of changing the Links section to point to the post with the newest versions.

Friday, July 31, 2009

Fortran by Fortran: Character to Integer, Float... and vice-versa

Yesterday I received an e-mail with a really tricky problem: How to convert from String (character sequence) to Integer in Fortran?. The first time I were in front of this problem I searched by some intrinsic function and didn't found anything. Then, I made my own function that reads char by char and converts it to the relative Integer value. Some day after, I found another solution to this problem and it was really simple. You can use the READ and WRITE statements to deal with conversions between characters to anything else and vice-versa. Take a look at the codes below.

CONVERTING TO AND FROM CHARACTERS:


program characterconversions

character*50 s
integer i
double precision d
logical t,f

s = '1234'
read (s,*) i

s = '1234.5678'
read (s,*) d

s = 'T' !TRUE
read (s,*) t

s = 'F' !FALSE
read (s,*) f

print *,i
print *,d
print *,t
print *,f

write (s, *) i
print *,s

write (s, *) d
print *,s

write (s, *) t
print *,s

write (s, *) f
print *,s

print '("Press any key to exit... "$)'
read (*,*)

end

THE OUTPUT IS:

1234
1234.5678
T
F
1234
1234.5678
T
F
Press any key to exit...

Tuesday, May 19, 2009

Feedback Needed

One of the most important things that I need is feedback. I have forgotten the times when someone has come to me and has told - just by curiosity - that something has been wrong for a while in Force but he/she just skirts the error and keep going living with it. Instead of keeping it I would love to receive e-mails about it. Let's improve Force together!

Below are some items I think will be helpful to everyone.

1. Have you found something wrong?
2. Have you found a bug or misplaced functionality?
3. Have you found a typo somewhere?
4. What's the most annoying thing in Force for you?
5. What's the best thing in Force for you?
6. Have you had an idea to share?
7. And suggestions?
8. Anything else?

Contact me by e-mail at: lepsch@gmail.com

Thank you!

Tuesday, May 5, 2009

Downloads

Just released version 2.0.9 and 3.0 beta 3!

FilenameSizeDescription
Force209GFortranSetup.exe10.6 MBForce 2.0.9 plus GNU Fortran (GFortran)
Force209G95Setup.exe3.55 MBForce 2.0.9 plus G95 Fortran (G95)
Force209G77Setup.exe2.03 MBForce 2.0.9 plus GNU Fortran 77 (G77)
Force3beta3Setup.exe2.19 MBForce 3.0 b3 plus GNU Fortran 77 (G77)

Vista Problem Solved

A million thanks to the people that have reported me about Vista problems, in special to Boris. Because of that I have figured out the bug that affected all versions of Force, until version 2.0.8 and 3.0b2. I don't know exactly why but the problem occurs on machines with Office 2007 installed.

I have uploaded two new versions, the Force 2.0.9 and Force 3.0 beta 3.

Thank you all!

Saturday, April 25, 2009

Force plus Fortran 90 compiler

I have made two installers packed each one with a different Fortran 90 compiler and Force 2.0.8. One of the installers come with the GNU Fortran from GNU Compiler Collection and the other one come with the independent G95 Fortran. Both of them are capable of compiling Fortran 90/95/2003 and possibly 2008.

UPDATE: Download here






























FilenameSizeDescription
Force208GFortranSetup.exe10.6 MBForce 2.0.8 plus GNU Fortran (GFortran)
Force208G95Setup.exe3.55 MBForce 2.0.8 plus G95 Fortran (G95)
Force208G77Setup.exe2.03 MBForce 2.0.8 plus GNU Fortran 77 (G77)
Force3beta2Setup.exe2.23 MBForce 3.0 plus GNU Fortran 77 (G77)

Thursday, April 16, 2009

Fortran by Fortran: The Format statement

One of the things in Fortran I always have some doubt is the format specification fields of FORMAT statement. Time to time I see myself looking for its specification fields. PRINT, WRITE, READ and FORMAT are the ones that uses the formating specifications. Here is the list of the most important ones.

FORMAT SPECIFICATION FIELDS:

Format fieldPropertiesData type
Iw[.m]w - width
m - leading zeros
Integer values
Fw.dw - width
d - decimal point precision
Float values
Ew.d[Ee]w - width
d - decimal point precision
e - optional exponent width
Float values (Engineering mode)
Ew.d[Ee]w - width
d - decimal point precision
e - optional exponent width
Float values (Engineering mode)
Dw.dw - width
d - decimal point precision
Double precision values
Lww - widthLogical values
A[w]w - widthString values
Zww - widthHexadecimal values
Ow[.m]w - width
m - leading zeros
Octal values
"a" or 'a'a - string sequenceOutputs the string sequence
nXn - number of spacesOutputs n space characters
nHn - number of charsHollerith constant - Outputs the next n characters
$
Doesn't output line break


HOW TO USE:

How to use the format statement and its format specification fields? One way you declare a FORMAT statement is something like below:

r FORMAT (f1,f2,...,fn)

r - Label number
f1,f2,...,fn - format specification fields

Its easy to use it, the only thing you must remember is the label number r.

PRINT r,e1,e2,...,en
WRITE (unit, r) e1,e2,...,en
READ r,e1,e2,...,en
READ (unit, r),e1,e2,...,en

Where e1,e2,...,en are expressions matching each one a format specification field.

The other way to declare the format specification fields is explicitly writing it. You change the label number by a quoted format specifications fields like below.

PRINT '(f1,f2,...,fn)',e1,e2,...,en

Labels: , ,