Fortran What is the purpose of the Fortran 77 DECK statement?

  • Thread starter Thread starter jf22901
  • Start date Start date
  • Tags Tags
    Fortran
AI Thread Summary
The discussion centers on the use of the DECK statement in Fortran 77 code, particularly in subroutines from an old weather forecasting model. Participants clarify that DECK is not a standard Fortran statement but is likely a directive from a source-code management system called NUPDATE, used historically in the UK, particularly at the Department of Meteorology. The DECK directive appears to serve as a marker for managing code versions or files. The asterisk preceding DECK indicates a comment, suggesting that the DECK lines do not affect code execution. Users can safely remove these directives unless they are using a system that requires them. The conversation highlights the challenges of working with legacy code and the importance of understanding its historical context.
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:
 
Technology news 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

Back
Top