Changeset 20010
- Timestamp:
- 01/27/16 22:18:21 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/classes/FemModel.cpp
r20007 r20010 2216 2216 IssmDouble eartharea=0; 2217 2217 IssmDouble eartharea_cpu=0; 2218 int ns ;2218 int ns,nsmax; 2219 2219 2220 2220 /*Go through elements, and add contribution from each element to the deflection vector wg:*/ … … 2233 2233 ISSM_MPI_Bcast(&eartharea,1,ISSM_MPI_DOUBLE,0,IssmComm::GetComm()); 2234 2234 2235 /*Figure out max of ns: */ 2236 ISSM_MPI_Reduce(&ns,&nsmax,1,ISSM_MPI_INT,ISSM_MPI_MAX,0,IssmComm::GetComm()); 2237 ISSM_MPI_Bcast(&nsmax,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 2238 2235 2239 /*Call the sea level rise core: */ 2236 for(int i=0;i<ns;i++){ 2240 for(int i=0;i<nsmax;i++){ 2241 if(i<ns){ 2237 2242 2238 if(IssmComm::GetRank()==0)if(VerboseConvergence())if(i%1000)_printf_("\r" << " convolution progress: " << (float)i/(float)ns*100 << "\%"); 2239 2240 Element* element=xDynamicCast<Element*>(elements->GetObjectByOffset(i)); 2241 element->SealevelriseEustatic(pSgi,&eustatic_cpu_e,latitude,longitude,radius,oceanarea,eartharea); 2242 eustatic_cpu+=eustatic_cpu_e; 2243 if(IssmComm::GetRank()==0)if(VerboseConvergence())if(i%1000)_printf_("\r" << " convolution progress: " << (float)i/(float)ns*100 << "\%"); 2244 2245 Element* element=xDynamicCast<Element*>(elements->GetObjectByOffset(i)); 2246 element->SealevelriseEustatic(pSgi,&eustatic_cpu_e,latitude,longitude,radius,oceanarea,eartharea); 2247 eustatic_cpu+=eustatic_cpu_e; 2248 } 2249 pSgi->Assemble(); 2243 2250 } 2244 2251 if(IssmComm::GetRank()==0)if(VerboseConvergence())_printf_("\n"); … … 2263 2270 IssmDouble eartharea_cpu=0; 2264 2271 2265 int ns ;2272 int ns,nsmax; 2266 2273 2267 2274 /*Serialize vectors from previous iteration:*/ … … 2270 2277 /*Go through elements, and add contribution from each element to the deflection vector wg:*/ 2271 2278 ns = elements->Size(); 2272 2279 2273 2280 /*First, figure out the area of the ocean, which is needed to compute the eustatic component: */ 2274 2281 for(int i=0;i<ns;i++){ … … 2283 2290 ISSM_MPI_Bcast(&eartharea,1,ISSM_MPI_DOUBLE,0,IssmComm::GetComm()); 2284 2291 2292 /*Figure out max of ns: */ 2293 ISSM_MPI_Reduce(&ns,&nsmax,1,ISSM_MPI_INT,ISSM_MPI_MAX,0,IssmComm::GetComm()); 2294 ISSM_MPI_Bcast(&nsmax,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 2295 2285 2296 /*Call the sea level rise core: */ 2286 for(int i=0;i<ns;i++){ 2287 2288 if(verboseconvolution)if(IssmComm::GetRank()==0)if(VerboseConvergence())if(i%1000)_printf_("\r" << " convolution progress: " << (float)i/(float)ns*100 << "\%"); 2289 2290 Element* element=xDynamicCast<Element*>(elements->GetObjectByOffset(i)); 2291 element->SealevelriseNonEustatic(pSgo, Sg_old,latitude,longitude,radius,oceanarea,eartharea); 2297 for(int i=0;i<nsmax;i++){ 2298 if(i<ns){ 2299 2300 if(verboseconvolution)if(IssmComm::GetRank()==0)if(VerboseConvergence())if(i%1000)_printf_("\r" << " convolution progress: " << (float)i/(float)ns*100 << "\%"); 2301 2302 Element* element=xDynamicCast<Element*>(elements->GetObjectByOffset(i)); 2303 element->SealevelriseNonEustatic(pSgo, Sg_old,latitude,longitude,radius,oceanarea,eartharea); 2304 } 2305 pSgo->Assemble(); 2292 2306 } 2293 2307 if(verboseconvolution)if(IssmComm::GetRank()==0)if(VerboseConvergence())_printf_("\n"); 2294 2295 2308 2296 2309 /*Free ressources:*/
Note:
See TracChangeset
for help on using the changeset viewer.