Changeset 2417
- Timestamp:
- 10/12/09 16:36:15 (15 years ago)
- Location:
- issm/trunk
- Files:
-
- 4 added
- 1 deleted
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/configs/linux64/linux64.sh
r2065 r2417 1 1 #!/bin/sh 2 2 3 ./configure --prefix=$ISSM_DIR --with-matlab-dir=$MATLAB_DIR --with-triangle-dir=$ISSM_DIR/externalpackages/triangle/install --with-metis-dir=$ISSM_DIR/externalpackages/metis/install --with-petsc-dir=$ISSM_DIR/externalpackages/petsc/install --with-mpi-include=$ISSM_DIR/externalpackages/mpich2/install/include --with-mpi-lib="-L$ISSM_DIR/externalpackages/mpich2/install/lib/ -lmpich" --with-petsc-arch=$ISSM_ARCH --with-dakota-dir=$ISSM_DIR/externalpackages/dakota/install --with-blas-lapack-dir=$ISSM_DIR/externalpackages/petsc/install/externalpackages/fblaslapack/$ISSM_ARCH --with-plapack-dir=$ISSM_DIR/externalpackages/petsc/install/externalpackages/PLAPACKR32/$ISSM_ARCH --with-blacs-dir=$ISSM_DIR/externalpackages/petsc/install/externalpackages/blacs-dev/$ISSM_ARCH --with-scalapack-dir=$ISSM_DIR/externalpackages/petsc/install/externalpackages/SCALAPACK/$ISSM_ARCH --with-mumps-dir=$ISSM_DIR/externalpackages/petsc/install/externalpackages/MUMPS_4.6.3/$ISSM_ARCH --with-fortran-lib="-L/usr/lib/gcc/x86_64-redhat-linux/4.1.1/ -lgfortran" --with-graphics-lib=/usr/lib64/libX11.so --with-cxxoptflags="-march=opteron -O2" 3 ./configure --prefix=$ISSM_DIR --with-matlab-dir=$MATLAB_DIR --with-triangle-dir=$ISSM_DIR/externalpackages/triangle/install --with-metis-dir=$ISSM_DIR/externalpackages/metis/install --with-petsc-dir=$ISSM_DIR/externalpackages/petsc/install --with-mpi-include=$ISSM_DIR/externalpackages/mpich2/install/include --with-mpi-lib="-L$ISSM_DIR/externalpackages/mpich2/install/lib/ -lmpich" --with-petsc-arch=$ISSM_ARCH --with-dakota-dir=$ISSM_DIR/externalpackages/dakota/install --with-blas-lapack-dir=$ISSM_DIR/externalpackages/petsc/install/externalpackages/fblaslapack/$ISSM_ARCH --with-plapack-dir=$ISSM_DIR/externalpackages/petsc/install/externalpackages/PLAPACKR32/$ISSM_ARCH --with-blacs-dir=$ISSM_DIR/externalpackages/petsc/install/externalpackages/blacs-dev/$ISSM_ARCH --with-scalapack-dir=$ISSM_DIR/externalpackages/petsc/install/externalpackages/SCALAPACK/$ISSM_ARCH --with-mumps-dir=$ISSM_DIR/externalpackages/petsc/install/externalpackages/MUMPS_4.6.3/$ISSM_ARCH --with-fortran-lib="-L/usr/lib/gcc/x86_64-redhat-linux/4.1.1/ -lgfortran" --with-graphics-lib=/usr/lib64/libX11.so --with-cxxoptflags="-march=opteron -O2" --with-numthreads=16 -
issm/trunk/m4/issm_options.m4
r2241 r2417 656 656 dnl %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%optimization-end%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 657 657 658 dnl %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%multithreading-beginning%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 659 AC_ARG_WITH([numthreads], 660 AS_HELP_STRING([--with-numthreads = NUMTHREADS_VALUE], 661 [numthreads, default is 1. ]), 662 [NUMTHREADS_VALUE=$withval],[NUMTHREADS_VALUE=1]) 663 AC_MSG_CHECKING(for number of threads) 664 dnl defaults 665 MULTITHREADING=no 666 MULTITHREADINLIB="" 667 if test "$NUMTHREADS_VALUE" != "1"; then 668 MULTITHREADINGLIB="-lpthread" 669 AC_DEFINE([_MULTITHREADING_],[1],[with numthreads enabled]) 670 AC_DEFINE_UNQUOTED([_NUMTHREADS_],[$NUMTHREADS_VALUE],[number of threads]) 671 fi 672 AC_SUBST([MULTITHREADINGLIB]) 673 AC_MSG_RESULT($NUMTHREADS_VALUE) 674 dnl %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%numthreads build-end%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 658 675 659 676 ]) -
issm/trunk/scripts/historyISSM.m
r2406 r2417 30 30 md=setelementstype(md,'pattyn','all','stokes','all'); 31 31 md=setelementstype(md,'macayeal','all'); 32 md=solve(md,'analysis_type','diagnostic','batch','yes'); 33 md=solve(md,'analysis_type','thermal'); 34 md=solve(md,'analysis_type','thermal','batch','yes'); 32 35 % -- plots -- 33 36 plotmodel(md,'data',md.results.diagnostic.vel) 34 37 print -dpng vel.png 38 % -- setup -- 39 md=model; 40 md=parameterize(md,'Antarctica.par'); 41 md=geography(md,'',''); 42 md=geography(md,'Iceshelves.exp','Islands.exp'); 43 md=extrude(md,8,1); 44 md=mesh(md,'DomainOutline.exp',5000); -
issm/trunk/src/c/InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.cpp
r2361 r2417 2 2 * \brief "c" core code for interpolating values from a structured grid. 3 3 */ 4 5 6 #ifdef HAVE_CONFIG_H 7 #include "config.h" 8 #else 9 #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!" 10 #endif 4 11 5 12 #include "./InterpFromMeshToMesh2dx.h" … … 8 15 #undef __FUNCT__ 9 16 #define __FUNCT__ "InterpFromMeshToMesh2dx" 10 11 int InterpFromMeshToMesh2dx( Vec* pdata_prime,double* index_data, double* x_data, double* y_data, int nods_data,int nels_data, double* data, int data_length, double* x_prime, double* y_prime, int nods_prime,double default_value) { 17 int InterpFromMeshToMesh2dx( Vec* pdata_prime,double* index_data, double* x_data, double* y_data, int nods_data,int nels_data, double* data, int data_length, double* x_prime, double* y_prime, int nods_prime,double default_value){ 12 18 13 19 /*Output*/ … … 15 21 16 22 /*Intermediary*/ 17 int i ,j;23 int i; 18 24 int interpolation_type; 19 25 bool debug; 20 double area;21 double area_1,area_2,area_3;22 double data_value;23 26 double x_prime_min,x_prime_max; 24 27 double y_prime_min,y_prime_max; 25 double x_tria_min,y_tria_min; 26 double x_tria_max,y_tria_max; 28 29 /*threading: */ 30 InterpFromMeshToMesh2dxThreadStruct gate; 31 const int num=_NUMTHREADS_; 27 32 28 33 /*some checks*/ … … 58 63 for (i=0;i<nods_prime;i++) VecSetValue(data_prime,i,default_value,INSERT_VALUES); 59 64 60 /*Loop over the elements*/ 61 if (debug) printf(" interpolation progress: %5.2lf %%",0.0); 62 for (i=0;i<nels_data;i++){ 65 /*initialize thread parameters: */ 66 gate.debug=debug; 67 gate.nods_prime=nods_prime; 68 gate.nels_data=nels_data; 69 gate.x_data=x_data; 70 gate.y_data=y_data; 71 gate.index_data=index_data; 72 gate.x_prime=x_prime; 73 gate.y_prime=y_prime; 74 gate.data=data; 75 gate.interpolation_type=interpolation_type; 76 gate.default_value=default_value; 77 gate.data_prime=data_prime; 78 gate.x_prime_min=x_prime_min; 79 gate.x_prime_max=x_prime_max; 80 gate.y_prime_min=y_prime_min; 81 gate.y_prime_max=y_prime_max; 63 82 64 /*display current iteration*/ 65 if (debug && fmod((double)i,(double)100)==0) printf("\b\b\b\b\b\b\b%5.2lf %%",(double)i/nels_data*100); 66 67 /*Get extrema coordinates of current elements*/ 68 x_tria_min=x_data[(int)index_data[3*i+0]-1]; x_tria_max=x_tria_min; 69 y_tria_min=y_data[(int)index_data[3*i+0]-1]; y_tria_max=y_tria_min; 70 for (j=1;j<3;j++){ 71 if(x_data[(int)index_data[3*i+j]-1]<x_tria_min) x_tria_min=x_data[(int)index_data[3*i+j]-1]; 72 if(x_data[(int)index_data[3*i+j]-1]>x_tria_max) x_tria_max=x_data[(int)index_data[3*i+j]-1]; 73 if(y_data[(int)index_data[3*i+j]-1]<y_tria_min) y_tria_min=y_data[(int)index_data[3*i+j]-1]; 74 if(y_data[(int)index_data[3*i+j]-1]>y_tria_max) y_tria_max=y_data[(int)index_data[3*i+j]-1]; 75 } 76 77 /*if there is no point inside the domain, go to next iteration*/ 78 if ( x_prime_max < x_tria_min ) continue; 79 if ( x_prime_min > x_tria_max ) continue; 80 if ( y_prime_max < y_tria_min ) continue; 81 if ( y_prime_min > y_tria_max ) continue; 82 83 /*get area of the current element (Jacobian = 2 * area)*/ 84 //area =x2 * y3 - y2*x3 + x1 * y2 - y1 * x2 + x3 * y1 - y3 * x1; 85 area=x_data[(int)index_data[3*i+1]-1]*y_data[(int)index_data[3*i+2]-1]-y_data[(int)index_data[3*i+1]-1]*x_data[(int)index_data[3*i+2]-1] 86 + x_data[(int)index_data[3*i+0]-1]*y_data[(int)index_data[3*i+1]-1]-y_data[(int)index_data[3*i+0]-1]*x_data[(int)index_data[3*i+1]-1] 87 + x_data[(int)index_data[3*i+2]-1]*y_data[(int)index_data[3*i+0]-1]-y_data[(int)index_data[3*i+2]-1]*x_data[(int)index_data[3*i+0]-1]; 88 89 /*loop over the prime nodes*/ 90 for (j=0;j<nods_prime;j++){ 91 92 /*if the current point is not in the triangle, continue*/ 93 if ( x_prime[j] < x_tria_min ) continue; 94 if ( x_prime[j] > x_tria_max ) continue; 95 if ( y_prime[j] < y_tria_min ) continue; 96 if ( y_prime[j] > y_tria_max ) continue; 97 98 /*Get first area coordinate = det(x-x3 x2-x3 ; y-y3 y2-y3)/area*/ 99 area_1=((x_prime[j]-x_data[(int)index_data[3*i+2]-1])*(y_data[(int)index_data[3*i+1]-1]-y_data[(int)index_data[3*i+2]-1]) 100 - (y_prime[j]-y_data[(int)index_data[3*i+2]-1])*(x_data[(int)index_data[3*i+1]-1]-x_data[(int)index_data[3*i+2]-1]))/area; 101 /*Get second area coordinate =det(x1-x3 x-x3 ; y1-y3 y-y3)/area*/ 102 area_2=((x_data[(int)index_data[3*i+0]-1]-x_data[(int)index_data[3*i+2]-1])*(y_prime[j]-y_data[(int)index_data[3*i+2]-1]) 103 - (y_data[(int)index_data[3*i+0]-1]-y_data[(int)index_data[3*i+2]-1])*(x_prime[j]-x_data[(int)index_data[3*i+2]-1]))/area; 104 /*Get third area coordinate = 1-area1-area2*/ 105 area_3=1-area_1-area_2; 106 107 /*is the current point in the current element?*/ 108 if (area_1>=0 && area_2>=0 && area_3>=0){ 109 110 /*Yes ! compute the value on the point*/ 111 if (interpolation_type==1){ 112 /*nodal interpolation*/ 113 data_value=area_1*data[(int)index_data[3*i+0]-1]+area_2*data[(int)index_data[3*i+1]-1]+area_3*data[(int)index_data[3*i+2]-1]; 114 } 115 else{ 116 /*element interpolation*/ 117 data_value=data[i]; 118 } 119 if (isnan(data_value)) data_value=default_value; 120 121 /*insert value and go to the next point*/ 122 VecSetValue(data_prime,j,data_value,INSERT_VALUES); 123 } 124 } 125 } 126 if (debug) printf("\b\b\b\b\b\b\b%5.2lf %%\n",100.0); 83 /*launch the thread manager with InterpFromMeshToMesh2dxt as a core: */ 84 LaunchThread(InterpFromMeshToMesh2dxt,(void*)&gate,num); 127 85 128 86 /*Assign output pointers:*/ 129 87 *pdata_prime=data_prime; 130 88 } 89 90 91 -
issm/trunk/src/c/InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.h
r2292 r2417 8 8 #include "../toolkits/toolkits.h" 9 9 10 11 12 /*threading: */ 13 typedef struct{ 14 15 int debug; 16 int nels_data; 17 double* x_data; 18 double* y_data; 19 double* index_data; 20 int nods_prime; 21 double* x_prime; 22 double* y_prime; 23 double* data; 24 int interpolation_type; 25 double default_value; 26 Vec data_prime; 27 double x_prime_min; 28 double x_prime_max; 29 double y_prime_min; 30 double y_prime_max; 31 32 } InterpFromMeshToMesh2dxThreadStruct; 33 34 10 35 int InterpFromMeshToMesh2dx( Vec* pdata_prime,double* index_data, double* x_data, double* y_data, int nods_data,int nels_data, double* data, int data_length, double* x_prime, double* y_prime, int nods_prime,double default_value); 36 void* InterpFromMeshToMesh2dxt(void* vInterpFromMeshToMesh2dxThreadStruct); 37 11 38 12 39 #endif /* _INTERPFROMMESHTOMESH2DX_H */ -
issm/trunk/src/c/Makefile.am
r2383 r2417 87 87 ./shared/Alloc/alloc.h\ 88 88 ./shared/Alloc/alloc.cpp\ 89 ./shared/Threads/issm_threads.h\ 90 ./shared/Threads/LaunchThread.cpp\ 89 91 ./shared/Matlab/matlabshared.h\ 90 92 ./shared/Matlab/PrintfFunction.cpp\ … … 248 250 ./InterpFromGridToMeshx/InterpFromGridToMeshx.h\ 249 251 ./InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.cpp\ 252 ./InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dxt.cpp\ 250 253 ./InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.h\ 251 254 ./InterpFromMeshToMesh3dx/InterpFromMeshToMesh3dx.cpp\ … … 381 384 ./DataSet/DataSet.h\ 382 385 ./shared/shared.h\ 386 ./shared/Threads/issm_threads.h\ 387 ./shared/Threads/LaunchThread.cpp\ 383 388 ./shared/Alloc/alloc.h\ 384 389 ./shared/Alloc/alloc.cpp\ … … 541 546 ./InterpFromGridToMeshx/InterpFromGridToMeshx.h\ 542 547 ./InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.cpp\ 548 ./InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dxt.cpp\ 543 549 ./InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.h\ 544 550 ./InterpFromMeshToMesh3dx/InterpFromMeshToMesh3dx.cpp\ -
issm/trunk/src/c/objects/Tria.cpp
r2355 r2417 3668 3668 3669 3669 /*Calculate scalar parameter*/ 3670 scalar_ocean=gauss_weight*Jdet*rho_water*mixed_layer_capacity*thermal_exchange_velocity* t_pmp/(heatcapacity*rho_ice);3670 scalar_ocean=gauss_weight*Jdet*rho_water*mixed_layer_capacity*thermal_exchange_velocity*(t_pmp)/(heatcapacity*rho_ice); 3671 3671 if(dt){ 3672 3672 scalar_ocean=dt*scalar_ocean; -
issm/trunk/src/c/shared/shared.h
r679 r2417 18 18 #include "Dofs/dofs.h" 19 19 #include "String/sharedstring.h" //to avoid confusion with <string.h> standard header file 20 #include "Threads/issm_threads.h" 20 21 21 22 -
issm/trunk/src/m/classes/public/basalstress.m
r1314 r2417 1 function [bx by b]=basalstress(md ,options_structure,width,i,type);1 function [bx by b]=basalstress(md) 2 2 %BASALSTRESS - compute basal stress from basal drag and geometric information. 3 3 % 4 4 % Usage: 5 % basalstress(md,options_structure,width,i,type);5 % [bx by b]=basalstress(md); 6 6 % 7 7 % See also: plot_basaldrag 8 8 9 %check layer10 if strcmpi(md.type,'3d')11 if options_structure.layer~=1,12 disp('plot_basaldrag warning: basal drag is displayed in the lower layer')13 options_structure.layer=1;14 end15 end16 9 17 10 %compute exponents -
issm/trunk/src/mex/Makefile.am
r2333 r2417 57 57 58 58 59 #LDADD = $(TRIANGLELIB) $(PETSCLIB) ../c/libISSM.a $(METISLIB) $(FLIBS) $(PLAPACKLIB) $(SCALAPACKLIB) $(BLASLAPACKLIB) $(MUMPSLIB) $(BLACSLIB) $(DAKOTALIB) $(MPILIB) $(MEXLIB) $(MATHLIB) $(FORTRANLIB) 60 61 LDADD = $(TRIANGLELIB) ../c/libISSM.a $(PETSCLIB) $(FLIBS) $(PLAPACKLIB) $(MUMPSLIB) $(SCALAPACKLIB) $(BLACSLIB) $(DAKOTALIB) $(METISLIB) $(BLASLAPACKLIB) $(MPILIB) $(MATHLIB) $(FORTRANLIB) $(GRAPHICSLIB) 59 LDADD = $(TRIANGLELIB) ../c/libISSM.a $(PETSCLIB) $(FLIBS) $(PLAPACKLIB) $(MUMPSLIB) $(SCALAPACKLIB) $(BLACSLIB) $(DAKOTALIB) $(METISLIB) $(BLASLAPACKLIB) $(MPILIB) $(MATHLIB) $(FORTRANLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) 62 60 63 61 AM_LDFLAGS = $(MEXLINK)
Note:
See TracChangeset
for help on using the changeset viewer.