[cig-commits] r15868 - mc/1D/hc/trunk
becker at geodynamics.org
becker at geodynamics.org
Thu Oct 22 21:06:01 PDT 2009
Author: becker
Date: 2009-10-22 21:06:00 -0700 (Thu, 22 Oct 2009)
New Revision: 15868
Modified:
mc/1D/hc/trunk/prem2dsm.c
mc/1D/hc/trunk/sh_extract_layer.c
Log:
Got rid of one gcc compiler warning.
Modified: mc/1D/hc/trunk/prem2dsm.c
===================================================================
--- mc/1D/hc/trunk/prem2dsm.c 2009-10-22 21:01:47 UTC (rev 15867)
+++ mc/1D/hc/trunk/prem2dsm.c 2009-10-23 04:06:00 UTC (rev 15868)
@@ -5,7 +5,7 @@
*/
-void main(int argc,char **argv)
+int main(int argc,char **argv)
{
int i,j;
double rlast;
@@ -46,4 +46,5 @@
rlast = prem->rb[i]/1000.;
}
+ return 0;
}
Modified: mc/1D/hc/trunk/sh_extract_layer.c
===================================================================
--- mc/1D/hc/trunk/sh_extract_layer.c 2009-10-22 21:01:47 UTC (rev 15867)
+++ mc/1D/hc/trunk/sh_extract_layer.c 2009-10-23 04:06:00 UTC (rev 15868)
@@ -14,7 +14,7 @@
struct sh_lms *exp=NULL;
HC_PREC unitya[3] = {1.0,1.0,1.0},*zdepth;
hc_boolean binary = FALSE, verbose = TRUE,
- short_format = FALSE,
+ short_format_in = FALSE,
short_format_output = FALSE;
/*
deal with parameters
@@ -28,17 +28,25 @@
case 4:
sscanf(argv[2],"%i",&ilayer);
sscanf(argv[3],"%i",&i);
- if(i)
- short_format_output = TRUE;
+ short_format_output = (i)?(TRUE):(FALSE);
break;
+ case 5:
+ sscanf(argv[2],"%i",&ilayer);
+ sscanf(argv[3],"%i",&i);
+ short_format_output = (i)?(TRUE):(FALSE);
+ sscanf(argv[4],"%i",&i);
+ short_format_in = (i)?(TRUE):(FALSE);
+ break;
default:
- fprintf(stderr,"%s: usage\n\n%s value.ab layer [short_format, %i]\n\n",argv[0],argv[0],short_format_output);
+ fprintf(stderr,"%s: usage\n\n%s value.ab layer [short_format_out, %i] [short_format_in, %i]\n\n",
+ argv[0],argv[0],short_format_output,short_format_in);
fprintf(stderr,"extracts one SH layer (e.g. for use in sh_syn) from a (long format, hc) spherical harmonic file value.ab\n");
fprintf(stderr,"layer: 1...nset\n");
fprintf(stderr,"\tif ilayer= 1..nset, will print one layer\n");
fprintf(stderr,"\t -1, will select nset\n");
- fprintf(stderr,"if short_format=1, will use short format output\n");
+ fprintf(stderr,"if short_format_out=1, will use short format output, else long\n");
+ fprintf(stderr,"if short_format_in= 1, will use short format input, else long\n");
exit(-1);
break;
}
@@ -49,7 +57,7 @@
/* start loop */
i = 0;
sh_read_parameters_from_file(&type,&lmax, &shps,&i,&nset,(zdepth+i),
- &ivec,in,short_format,binary,verbose);
+ &ivec,in,short_format_in,binary,verbose);
if(verbose)
fprintf(stderr,"sh_extract_layer: detected %i layers, vec: %i, type %i SH file, shps: %i, layer %i at depth %g\n",
nset,ivec,type,shps,i+1,zdepth[i]);
@@ -69,7 +77,7 @@
for(;i<nset;i++){
if(i != 0)
sh_read_parameters_from_file(&type,&lmax,&shps,&i,&nset,(zdepth+i),
- &ivec,in,short_format,binary,verbose);
+ &ivec,in,short_format_in,binary,verbose);
sh_read_coefficients_from_file((exp+i),shps,-1,in,binary,unitya,
verbose);
if(i == ilayer){ /* output */
More information about the CIG-COMMITS
mailing list