Skip to content

Commit 0ebe953

Browse files
committed
Fix mppnccombine indents
1 parent 24c6d70 commit 0ebe953

File tree

1 file changed

+115
-115
lines changed

1 file changed

+115
-115
lines changed

mppnccombine.c

+115-115
Original file line numberDiff line numberDiff line change
@@ -301,21 +301,21 @@ int main(int argc, char *argv[])
301301
else if (!strcmp(argv[a],"-64"))
302302
format=(NC_NOCLOBBER | NC_64BIT_OFFSET);
303303
else if (!strcmp(argv[a], "-n4"))
304-
format=(NC_NOCLOBBER | NC_NETCDF4 | NC_CLASSIC_MODEL);
304+
format=(NC_NOCLOBBER | NC_NETCDF4 | NC_CLASSIC_MODEL);
305305
else if (!strcmp(argv[a],"-m")) missing=1;
306306
else if (!strcmp(argv[a], "-d"))
307-
{
308-
a++;
309-
if ( a < argc)
310-
{
311-
deflate = 1;
312-
deflation = atoi(argv[a]);
313-
}
314-
else
315-
{
316-
usage(); return(1);
317-
}
318-
}
307+
{
308+
a++;
309+
if ( a < argc)
310+
{
311+
deflate = 1;
312+
deflation = atoi(argv[a]);
313+
}
314+
else
315+
{
316+
usage(); return(1);
317+
}
318+
}
319319
else if (!strcmp(argv[a],"-s")) shuffle=1;
320320
else
321321
{
@@ -346,35 +346,35 @@ int main(int argc, char *argv[])
346346
ncopts=0;
347347

348348
if (!mem_dry_run) {
349-
/* Create a new netCDF output file */
350-
if ((ncoutfile=(struct fileinfo *)malloc(sizeof(struct fileinfo)))==NULL)
351-
{
352-
fprintf(stderr,"Error: cannot allocate enough memory!\n"); return(1);
353-
}
354-
if (!appendnc)
355-
{
356-
if (stat(outfilename,&statbuf)==0)
357-
{
358-
fprintf(stderr,"Error: output file seems to exist already!\n");
359-
free(ncoutfile); return(1);
360-
}
361-
status = nc__create(outfilename, format, 0, &blksz, &ncoutfile->ncfid);
362-
if (status==(-1))
363-
{
364-
fprintf(stderr,"Error: cannot create the output netCDF file!\n");
365-
free(ncoutfile); return(1);
366-
}
367-
ncsetfill(ncoutfile->ncfid,NC_NOFILL);
368-
}
369-
/* Open an existing netCDF file for appending */
370-
else
371-
{
372-
if ((ncoutfile->ncfid=ncopen(outfilename,NC_WRITE))==(-1))
373-
{
374-
fprintf(stderr,"Error: cannot open the output netCDF file for appending!\n");
375-
free(ncoutfile); return(1);
376-
}
377-
}
349+
/* Create a new netCDF output file */
350+
if ((ncoutfile=(struct fileinfo *)malloc(sizeof(struct fileinfo)))==NULL)
351+
{
352+
fprintf(stderr,"Error: cannot allocate enough memory!\n"); return(1);
353+
}
354+
if (!appendnc)
355+
{
356+
if (stat(outfilename,&statbuf)==0)
357+
{
358+
fprintf(stderr,"Error: output file seems to exist already!\n");
359+
free(ncoutfile); return(1);
360+
}
361+
status = nc__create(outfilename, format, 0, &blksz, &ncoutfile->ncfid);
362+
if (status==(-1))
363+
{
364+
fprintf(stderr,"Error: cannot create the output netCDF file!\n");
365+
free(ncoutfile); return(1);
366+
}
367+
ncsetfill(ncoutfile->ncfid,NC_NOFILL);
368+
}
369+
/* Open an existing netCDF file for appending */
370+
else
371+
{
372+
if ((ncoutfile->ncfid=ncopen(outfilename,NC_WRITE))==(-1))
373+
{
374+
fprintf(stderr,"Error: cannot open the output netCDF file for appending!\n");
375+
free(ncoutfile); return(1);
376+
}
377+
}
378378
}
379379

380380
/* No input files are specified on the command-line */
@@ -388,27 +388,27 @@ int main(int argc, char *argv[])
388388
f=0;
389389
for (a=nstart; a <= nend; a++)
390390
{
391-
if (peWidth<0)
392-
{
393-
sprintf(infilename,"%s.%04d",outfilename,a);
394-
if (stat(infilename,&statbuf)==0)
395-
{
396-
peWidth=4;
397-
}
398-
else
399-
{
400-
sprintf(infilename,"%s.%06d",outfilename,a);
401-
if (stat(infilename,&statbuf)==0)
402-
{
403-
peWidth=6;
404-
}
405-
else
406-
{
407-
continue;
408-
}
409-
}
410-
}
411-
sprintf(infilename,"%s.%0*d",outfilename,peWidth,a);
391+
if (peWidth<0)
392+
{
393+
sprintf(infilename,"%s.%04d",outfilename,a);
394+
if (stat(infilename,&statbuf)==0)
395+
{
396+
peWidth=4;
397+
}
398+
else
399+
{
400+
sprintf(infilename,"%s.%06d",outfilename,a);
401+
if (stat(infilename,&statbuf)==0)
402+
{
403+
peWidth=6;
404+
}
405+
else
406+
{
407+
continue;
408+
}
409+
}
410+
}
411+
sprintf(infilename,"%s.%0*d",outfilename,peWidth,a);
412412
if (stat(infilename,&statbuf)!=0){
413413
if (force==0) {
414414
printf("ERROR: missing at least %s from the input fileset. Exiting.\n", infilename);
@@ -467,27 +467,27 @@ int main(int argc, char *argv[])
467467
f=0;
468468
for (a=nstart; a < nend; a++)
469469
{
470-
if (peWidth<0)
471-
{
472-
sprintf(infilename,"%s.%04d",outfilename,a);
473-
if (stat(infilename,&statbuf)==0)
474-
{
475-
peWidth=4;
476-
}
477-
else
478-
{
479-
sprintf(infilename,"%s.%06d",outfilename,a);
480-
if (stat(infilename,&statbuf)==0)
481-
{
482-
peWidth=6;
483-
}
484-
else
485-
{
486-
continue;
487-
}
488-
}
489-
}
490-
sprintf(infilename,"%s.%0*d",outfilename,peWidth,a);
470+
if (peWidth<0)
471+
{
472+
sprintf(infilename,"%s.%04d",outfilename,a);
473+
if (stat(infilename,&statbuf)==0)
474+
{
475+
peWidth=4;
476+
}
477+
else
478+
{
479+
sprintf(infilename,"%s.%06d",outfilename,a);
480+
if (stat(infilename,&statbuf)==0)
481+
{
482+
peWidth=6;
483+
}
484+
else
485+
{
486+
continue;
487+
}
488+
}
489+
}
490+
sprintf(infilename,"%s.%0*d",outfilename,peWidth,a);
491491
if (stat(infilename,&statbuf)!=0){
492492
if (force==0) {
493493
printf("ERROR: missing at least %s from the input fileset. Exiting.\n", infilename);
@@ -599,27 +599,27 @@ int main(int argc, char *argv[])
599599
// occasionally nfiles may be wrongly set to zero,
600600
// and yet the user wants to remove the input files in a range.
601601
//if (++f > nfiles) break;
602-
if (peWidth<0)
603-
{
604-
sprintf(infilename,"%s.%04d",outfilename,a);
605-
if (stat(infilename,&statbuf)==0)
606-
{
607-
peWidth=4;
608-
}
609-
else
610-
{
611-
sprintf(infilename,"%s.%06d",outfilename,a);
612-
if (stat(infilename,&statbuf)==0)
613-
{
614-
peWidth=6;
615-
}
616-
else
617-
{
618-
continue;
619-
}
620-
}
621-
}
622-
sprintf(infilename,"%s.%0*d",outfilename,peWidth,a);
602+
if (peWidth<0)
603+
{
604+
sprintf(infilename,"%s.%04d",outfilename,a);
605+
if (stat(infilename,&statbuf)==0)
606+
{
607+
peWidth=4;
608+
}
609+
else
610+
{
611+
sprintf(infilename,"%s.%06d",outfilename,a);
612+
if (stat(infilename,&statbuf)==0)
613+
{
614+
peWidth=6;
615+
}
616+
else
617+
{
618+
continue;
619+
}
620+
}
621+
}
622+
sprintf(infilename,"%s.%0*d",outfilename,peWidth,a);
623623
if (stat(infilename,&statbuf)!=0) continue;
624624
if (verbose) printf("Removing \"%s\"\n",infilename);
625625
unlink(infilename);
@@ -911,16 +911,16 @@ int process_file(char *ncname, unsigned char appendnc,
911911
}
912912

913913
if (deflate==1 && deflation>0)
914-
{
915-
for (v=0; v < ncinfile->nvars; v++)
916-
{
917-
if ( nc_def_var_deflate(ncoutfile->ncfid,v,shuffle,deflate,deflation) != NC_NOERR )
918-
{
919-
fprintf(stderr,"Error: nc_def_var_deflate failed! Are you setting NETCDF4?\n");
920-
usage();
921-
}
922-
}
923-
}
914+
{
915+
for (v=0; v < ncinfile->nvars; v++)
916+
{
917+
if ( nc_def_var_deflate(ncoutfile->ncfid,v,shuffle,deflate,deflation) != NC_NOERR )
918+
{
919+
fprintf(stderr,"Error: nc_def_var_deflate failed! Are you setting NETCDF4?\n");
920+
usage();
921+
}
922+
}
923+
}
924924

925925

926926
/* Definitions done */

0 commit comments

Comments
 (0)