Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Fortran 77 DECK statement

  1. May 7, 2012 #1
    Hi all.

    I am using some Fortran 77 code that was originally written in the early 90s, and some of the subroutines start with DECK or *DECK. I have tried searching the internet but cannot find anything relevant. As an example, say the main program calls two subroutines SUBONE and SUBTWO. One of these subroutines is of the form

    Code (Text):

    DECK SUBONE1
          SUBROUTINE SUBONE(arguments)
          <code for rest of subroutine follows>
     
    and the other is of the form
    Code (Text):

    *DECK SUBTWO1
          SUBROUTINE SUBTWO(arguments)
          <code for rest of subroutine follows>
     
    Can anyone enlighten me to what the DECK statement is for, and why some subroutines have an asterisk in front of it? I'm guessing that the 'SUBONE1, SUBTWO1' is the name of the relevant 'DECK', but that's as much as I can work out!

    Thanks in advance. :smile:
     
  2. jcsd
  3. May 7, 2012 #2

    Mark44

    Staff: Mentor

    As far as I know, there is no DECK statement in Fortran. I couldn't find any reference to it in a web search. In your second example, the line with *DECK in it is a comment. If DECK appears without a preceding * or C, as you show, I have no idea what it means.
     
  4. May 7, 2012 #3
    Thanks Mark.

    Good to know it wasn't just my useless web searching skills! :smile:

    The code all compiles ok, so it's not as if they are causing a problem - I was just wondering what they were there for. After a further look, the DECK statements only appear in subroutines that call additional subroutines. The code is from an old weather forecasting model, so it might be something specific they have added themselves, and not a standard Fortran thing.

    Thanks again.
     
  5. May 7, 2012 #4

    jtbell

    User Avatar

    Staff: Mentor

  6. May 7, 2012 #5
    Thanks jtbell, that's brilliant! It's an old UK Met. Office model I'm using (to model Mars' atmosphere), and I guess it was developed partly at Reading.

    How did you stumble on that website? I tried loads of search combinations and still found nothing!
     
  7. May 7, 2012 #6

    jtbell

    User Avatar

    Staff: Mentor

    It comes out at the top of a search for "fortran deck directive". I figured "directive" might be an appropriate generic term for it, since it's not an actual FORTRAN statement.

    You can probably simply delete those DECK directives, unless you're using a system that actually uses them.
     
  8. May 7, 2012 #7

    AlephZero

    User Avatar
    Science Advisor
    Homework Helper

    Or, put the code that follows
    *DECK foo
    in file foo.f, if you want to preserve the original file structure for some reason.

    This stuff probably dates from when a "file system" was a big metal rack full of trays of punched cards, with about 2000 cards per tray, not something on a thumb drive.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Fortran 77 DECK statement
  1. Fortran 77 (Replies: 1)

Loading...