[cig-commits] r14662 - mc/1D/hc/trunk
tan2 at geodynamics.org
tan2 at geodynamics.org
Fri Apr 10 14:47:41 PDT 2009
Author: tan2
Date: 2009-04-10 14:47:40 -0700 (Fri, 10 Apr 2009)
New Revision: 14662
Modified:
mc/1D/hc/trunk/sh_power.c
Log:
add usage information to stderr output
Modified: mc/1D/hc/trunk/sh_power.c
===================================================================
--- mc/1D/hc/trunk/sh_power.c 2009-04-10 21:36:56 UTC (rev 14661)
+++ mc/1D/hc/trunk/sh_power.c 2009-04-10 21:47:40 UTC (rev 14662)
@@ -40,12 +40,31 @@
HC_PREC fac[3] = {1.,1.,1.},zlabel;
struct sh_lms *exp;
if(argc>1){
- sscanf(argv[1],"%i",&i);
- if(i)
- short_format = TRUE;
+ if((strcmp(argv[1],"-h")==0)||(strcmp(argv[1],"--help")==0)||(strcmp(argv[1],"-help")==0)){
+ fprintf(stderr,"usage: cat ab.sh_ana | %s [short_format, 0]\n", argv[0]);
+ fprintf(stderr,"read in a spherical harmonic expansion in Dahlen and Tromp normalization\n");
+ fprintf(stderr, "and computer power per degree and unit area\n\n");
+ fprintf(stderr,"if short format is 0, will expect\n");
+ fprintf(stderr," type lmax shps ilayer nset zlabel ivec\n");
+ fprintf(stderr," A-00 B-00\n");
+ fprintf(stderr," A-10 B-10\n");
+ fprintf(stderr," ...\n");
+ fprintf(stderr,"format.\n\n");
+ fprintf(stderr,"if short format is set, will expect\n");
+ fprintf(stderr," lmax\n");
+ fprintf(stderr," A-00 B-00\n");
+ fprintf(stderr," A-10 B-10\n");
+ fprintf(stderr," ...\n");
+ fprintf(stderr,"format.\n");
+ exit(-1);
+ }else{
+ sscanf(argv[1],"%i",&i);
+ if(i)
+ short_format = TRUE;
+ }
}
- fprintf(stderr,"%s: awaiting spherical harmonics expansion (%s) from stdin\n",
- argv[0],short_format ? "short format" : "long format");
+ fprintf(stderr,"%s: awaiting spherical harmonics expansion (%s) from stdin (use %s -h for help)\n",
+ argv[0],short_format ? "short format" : "long format",argv[0]);
while(sh_read_parameters_from_file(&type,&lmax,&shps,&ilayer,&nset,
&zlabel,&ivec,stdin,short_format,
binary,verbose)){
More information about the CIG-COMMITS
mailing list