Chapter7 - ComputerProgramming usingFortran77...

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
Computer Programming using Fortran 77 Chapter 7 - Subroutines
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Types of Subprograms 2 Types of sub-programs in Fortran Functions:   1) library (system supplied) 2) programmer defined Subroutines subroutine - a separate program unit designed to  perform a specific task
Background image of page 2
Subroutines vs. Functions Functions Subroutines How many values  returned return a single value to  the main pgm return 0 or more values  to the main pgm How to return the  values return a value via the  function name return a value(s) via the  args How to  invoke/reference referenced by function  name referenced by the CALL  stmt When to use a  function/subroutine? when you need to  return only one value when you need to return  0 or more than 1 value
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Subroutine Parts and Syntax Subroutine heading – syntax: SUBROUTINE  name   (formal-arg-list ) SUBROUTINE - Fortran 77 reserved word
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 05/18/2011 for the course CMPS 301 taught by Professor Staff during the Fall '08 term at University of Louisiana at Lafayette.

Page1 / 14

Chapter7 - ComputerProgramming usingFortran77...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online