[cig-commits] commit: add usage statement

Mercurial hg at geodynamics.org
Tue Sep 20 12:13:06 PDT 2011


changeset:   10:751057cf5019
user:        Sylvain Barbot <sylbar.vainbot at gmail.com>
date:        Tue Apr 26 16:31:14 2011 -0700
files:       getopt.f90 relax.f90
description:
add usage statement


diff -r 7596917b8776 -r 751057cf5019 getopt.f90
--- a/getopt.f90	Tue Apr 26 15:00:49 2011 -0700
+++ b/getopt.f90	Tue Apr 26 16:31:14 2011 -0700
@@ -172,7 +172,7 @@ character function process_long( longopt
 					call getarg( optind, optarg )
 					optind = optind + 1
 				elseif ( opterr ) then
-					 print '(a,a,a)', "Error: option '", trim(arg), "' requires an argument"
+					 WRITE (0,'(a,a,a)')  "error: option '", trim(arg), "' requires an argument"
 				endif
 			endif
 			return
@@ -181,7 +181,7 @@ character function process_long( longopt
 	! else not found
 	process_long = '?'
 	if ( opterr ) then
-		print '(a,a,a)', "Error: unrecognized option '", trim(arg), "'"
+		WRITE (0,'(a,a,a)'), "error: unrecognized option '", trim(arg), "'"
 	endif
 end function process_long
 
@@ -217,7 +217,7 @@ character function process_short( optstr
 			call getarg( optind, optarg )
 			optind = optind + 1
 		elseif ( opterr ) then
-			print '(a,a,a)', "Error: option '-", optopt, "' requires an argument"
+			WRITE (0,'(a,a,a)') "error: option '-", optopt, "' requires an argument"
 		endif
 		grpind = 2
 	elseif ( arglen > grpind ) then
diff -r 7596917b8776 -r 751057cf5019 relax.f90
--- a/relax.f90	Tue Apr 26 15:00:49 2011 -0700
+++ b/relax.f90	Tue Apr 26 16:31:14 2011 -0700
@@ -156,6 +156,7 @@ PROGRAM relax
   !                  (02-28-11) - add constraints on the broad direction of 
   !                               afterslip, export faults to GMT xy format
   !                               and allow scaling of computed time steps.
+  !                  (04-26-11) - include command-line arguments
   !-----------------------------------------------------------------------
 
   USE types
@@ -204,6 +205,8 @@ PROGRAM relax
   ! read input parameters
   CALL init(in)
 
+  ! abort calculation after help message
+  ! or for dry runs
   IF (in%isdryrun) THEN
      PRINT '("abort calculation")'
   END IF



More information about the CIG-COMMITS mailing list