C This is an example of a FORTRAN code, which is the computer language I
C use in my models of the Archean Earth's atmosphere. Those "C's" at the
C left mark these lines as "comment lines," which are used to explain
C the code to users, and are ignored by the computer when compiling
C and running the code. While I normally won't be putting FORTRAN code
C on this website, I thought it was relevant for the first post on this
C site, for two reasons. First, "Hello World!" is the default title of
C the first post on a WordPress page, and is also the first program most
C people learn to write when learning a new computer language. The
C main point of this blog is to show people how modeling and the
C scientific method can be used to analyze things in varying aspects of
C life and society. Because I have a particular love for politics and
C sports, I'll use examples from those areas a LOT. Given my dorky
C nature, I though a "Hello world!" program was an appropriate start.
C But enough jibber-jabber... Here is a an example of a FORTRAN code
C that will get your computer to say: "Hello world!"

PROGRAM HELLO

Print *, ‘Hello, world!”

STOP

END

C That’s it! See, modeling is easy!

2 Comments

  1. As you have it written, though, the code will only compile as FORTRAN 90 code–and then only if you remove the comment line (as FORTRAN 90 uses ! instead to denote comments). Of course, you may have properly spaced your code for FORTRAN 77 only to have WordPress reformat it for you; disregard my comments if this is the case.

    Remember kids: friends don’t let friends write FORTRAN.

  2. Good catch, Jacob! I forgot about the change in commenting from “C” to “!” in FORTRAN 90. Oh, well…

    I suppose we’re not friends, then ;-)


One Trackback/Pingback

  1. By Hello world! « Colin’s Weblog on 17 Aug 2008 at 9:32 pm

    [...] should one right in a first post? The award for the most geeky must go to my collegue Shawn. I wouldn’t do something like that, honest. So instead, here is my most exciting discovery of [...]

Post a Comment