What is the purpose of the Fortran 77 DECK statement?

  • Context: Fortran 
  • Thread starter Thread starter jf22901
  • Start date Start date
  • Tags Tags
    Fortran
jf22901
Messages
55
Reaction score
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:
DECK SUBONE1
      SUBROUTINE SUBONE(arguments)
      <code for rest of subroutine follows>
and the other is of the form
Code:
*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:
 
on Phys.org
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.
 
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.
 
jtbell said:
DECK appears to be a directive for a source-code management system called NUPDATE that was (maybe still is) used in the UK, e.g. at the Department of Meteorology (aha!) at Reading:

http://www.met.reading.ac.uk/~mike/dyn_models/nupdate/nupdate_doc.txt

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!
 
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.
 
jtbell said:
You can probably simply delete those DECK directives, unless you're using a system that actually uses them.

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.
 

Similar threads

  • · Replies 8 ·
Replies
8
Views
5K
  • · Replies 2 ·
Replies
2
Views
3K
Replies
11
Views
16K
  • · Replies 18 ·
Replies
18
Views
7K
  • · Replies 3 ·
Replies
3
Views
4K
Replies
5
Views
4K
  • · Replies 3 ·
Replies
3
Views
11K
  • · Replies 1 ·
Replies
1
Views
6K
  • · Replies 25 ·
Replies
25
Views
9K
  • · Replies 3 ·
Replies
3
Views
2K