~ubuntu-branches/debian/sid/lammps/sid

« back to all changes in this revision

Viewing changes to src/dump.cpp

  • Committer: Package Import Robot
  • Author(s): Anton Gladky
  • Date: 2013-11-20 22:41:36 UTC
  • mfrom: (1.2.2)
  • Revision ID: package-import@ubuntu.com-20131120224136-tzx7leh606fqnckm
Tags: 0~20131119.git7162cf0-1
* [e65b919] Imported Upstream version 0~20131119.git7162cf0
* [f7bddd4] Fix some problems, introduced by upstream recently.
* [3616dfc] Use wrap-and-sort script.
* [7e92030] Ignore quilt dir

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
#include "output.h"
26
26
#include "memory.h"
27
27
#include "error.h"
 
28
#include "force.h"
28
29
 
29
30
using namespace LAMMPS_NS;
30
31
 
403
404
#ifdef LAMMPS_GZIP
404
405
      char gzip[128];
405
406
      sprintf(gzip,"gzip -6 > %s",filecurrent);
 
407
#ifdef _WIN32
 
408
      fp = _popen(gzip,"wb");
 
409
#else
406
410
      fp = popen(gzip,"w");
 
411
#endif
407
412
#else
408
413
      error->one(FLERR,"Cannot open gzipped file");
409
414
#endif
667
672
        strcpy(output->var_dump[idump],&arg[iarg+1][2]);
668
673
        n = 0;
669
674
      } else {
670
 
        n = atoi(arg[iarg+1]);
 
675
        n = force->inumeric(FLERR,arg[iarg+1]);
671
676
        if (n <= 0) error->all(FLERR,"Illegal dump_modify command");
672
677
      }
673
678
      output->every_dump[idump] = n;
684
689
      if (!multiproc)
685
690
        error->all(FLERR,"Cannot use dump_modify fileper "
686
691
                   "without % in dump file name");
687
 
      int nper = atoi(arg[iarg+1]);
 
692
      int nper = force->inumeric(FLERR,arg[iarg+1]);
688
693
      if (nper <= 0) error->all(FLERR,"Illegal dump_modify command");
689
694
      
690
695
      multiproc = nprocs/nper;
730
735
      if (!multiproc)
731
736
        error->all(FLERR,"Cannot use dump_modify nfile "
732
737
                   "without % in dump file name");
733
 
      int nfile = atoi(arg[iarg+1]);
 
738
      int nfile = force->inumeric(FLERR,arg[iarg+1]);
734
739
      if (nfile <= 0) error->all(FLERR,"Illegal dump_modify command");
735
740
      nfile = MIN(nfile,nprocs);
736
741
 
760
765
 
761
766
    } else if (strcmp(arg[iarg],"pad") == 0) {
762
767
      if (iarg+2 > narg) error->all(FLERR,"Illegal dump_modify command");
763
 
      padflag = atoi(arg[iarg+1]);
 
768
      padflag = force->inumeric(FLERR,arg[iarg+1]);
764
769
      if (padflag < 0) error->all(FLERR,"Illegal dump_modify command");
765
770
      iarg += 2;
766
771
    } else if (strcmp(arg[iarg],"sort") == 0) {
772
777
        sortorder = ASCEND;
773
778
      } else {
774
779
        sort_flag = 1;
775
 
        sortcol = atoi(arg[iarg+1]);
 
780
        sortcol = force->inumeric(FLERR,arg[iarg+1]);
776
781
        sortorder = ASCEND;
777
782
        if (sortcol == 0) error->all(FLERR,"Illegal dump_modify command");
778
783
        if (sortcol < 0) {