NERSC logo National Energy Research Scientific Computing Center
  A DOE Office of Science User Facility
  at Lawrence Berkeley National Laboratory
 

A project

We'll illustrate the use and usefulness of make with a little project. This project does nothing more than print out the current version of the program.

This project has three source code files

project.f
The main program, which calls a subroutine, print_project_info
print_project_info.f
Contains the subroutine print_project_info
project_info.f
Contains parameter definitions in a Fortran 90 module that are used by the subroutine print_project_info
!	FILENAME: project.f
!
PROGRAM project

	IMPLICIT NONE

	CALL print_project_info

	STOP
	
END PROGRAM project

!	FILENAME: print_project_info.f
!
SUBROUTINE print_project_info

	USE project_info
	IMPLICIT NONE

	PRINT *,"This is version",MAJOR_VERSION,".",MINOR_VERSION

END SUBROUTINE print_project_info

!	FILENAME: project_info.f
!
MODULE project_info 

	IMPLICIT NONE
	SAVE

	INTEGER, PARAMETER:: MAJOR_VERSION=0, MINOR_VERSION=2

END MODULE project_info 

LBNL Home
Page last modified: Fri, 21 May 2004 22:28:00 GMT
Page URL: http://www.nersc.gov/nusers/help/tutorials/make/project.php
Web contact: webmaster@nersc.gov
Computing questions: consult@nersc.gov

Privacy and Security Notice
DOE Office of Science