Changeset 13975 for issm/trunk/src/c/solutions/kriging.cpp
- Timestamp:
- 11/16/12 08:10:16 (12 years ago)
- Location:
- issm/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk
- Property svn:mergeinfo changed
/issm/trunk-jpl merged: 13397-13398,13401,13407-13582,13584-13974
- Property svn:mergeinfo changed
-
issm/trunk/src
- Property svn:mergeinfo changed
-
issm/trunk/src/c/solutions/kriging.cpp
r13395 r13975 4 4 5 5 #include "../issm.h" 6 #include "../include/globals.h"7 6 8 7 /*Local prototypes*/ 9 8 void ProcessArguments2(char** pbinfilename,char** poutbinfilename,char** plockfilename,char** prootpath,int argc,char **argv); 10 9 void ProcessInputfile(IssmDouble **px,IssmDouble **py,IssmDouble **pdata,int *pnobs,IssmDouble **px_interp,IssmDouble **py_interp,int *pninterp,Options **poptions,FILE* fid); 10 11 int my_rank; 12 int num_procs; 11 13 12 14 int main(int argc,char **argv){ … … 23 25 char *rootpath = NULL; 24 26 27 MPI_Comm comm; 28 extern int my_rank; 29 extern int num_procs; 30 25 31 /*Input*/ 26 32 int ninterp,nobs; … … 36 42 IssmDouble *error = NULL; 37 43 38 ISSMBOOT(); 44 /*Initialize exception trapping: */ 45 ExceptionTrapBegin(); 39 46 40 /*Initialize environments: Petsc, MPI, etc...: */ 41 #ifdef _HAVE_PETSC_ 42 int ierr=PetscInitialize(&argc,&argv,(char*)0,""); 43 if(ierr) _error_("Could not initialize Petsc"); 44 #else 45 #ifdef _HAVE_MPI_ 46 MPI_Init(&argc,&argv); 47 #endif 48 #endif 47 /*Initialize environment (MPI, PETSC, MUMPS, etc ...)*/ 48 comm=EnvironmentInit(argc,argv); 49 49 50 /*Size and rank: */ 51 #ifdef _HAVE_MPI_ 52 MPI_Comm_rank(MPI_COMM_WORLD,&my_rank); 53 MPI_Comm_size(MPI_COMM_WORLD,&num_procs); 54 #endif 50 MPI_Comm_size(comm,&num_procs); 51 MPI_Comm_rank(comm,&my_rank); 55 52 56 53 /*First process inputs*/ … … 76 73 results->AddObject(new GenericExternalResult<double*>(results->Size()+1,1,error,ninterp,1,1,0)); 77 74 for(int i=0;i<results->Size();i++){ 78 ExternalResult* result= (ExternalResult*)results->GetObjectByOffset(i);75 ExternalResult* result=dynamic_cast<ExternalResult*>(results->GetObjectByOffset(i)); 79 76 result->WriteData(output_fid,1); 80 77 } … … 101 98 delete results; 102 99 103 #ifdef _HAVE_PETSC_ 104 _pprintLine_("closing MPI and Petsc"); 105 PetscFinalize(); 106 #else 107 #ifdef _HAVE_MPI_ 108 _pprintLine_("closing MPI and Petsc"); 109 MPI_Finalize(); 110 #endif 111 #endif 100 /*Finalize environment:*/ 101 EnvironmentFinalize(); 112 102 113 /* end module: */114 ISSMEND();103 /*Finalize exception trapping: */ 104 ExceptionTrapEnd(); 115 105 116 106 return 0; //unix success return; … … 166 156 Option *option = NULL; 167 157 168 int dummy,M,N;158 int M,N; 169 159 IoModel* iomodel = new IoModel(); 170 160 iomodel->fid=fid;
Note:
See TracChangeset
for help on using the changeset viewer.