- Timestamp:
- 09/04/20 16:30:07 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/branches/trunk-larour-SLPS2020/src/c/classes/FemModel.cpp
r25361 r25534 4706 4706 #endif 4707 4707 #ifdef _HAVE_SEALEVELRISE_ 4708 void FemModel::SealevelriseEustatic(Vector<IssmDouble>* pRSLgi, IssmDouble* poceanarea, IssmDouble* p eustatic, SealevelMasks* masks) { /*{{{*/4708 void FemModel::SealevelriseEustatic(Vector<IssmDouble>* pRSLgi, IssmDouble* poceanarea, IssmDouble* pbslr,IssmDouble* pbslrice, IssmDouble* pbslrhydro, SealevelMasks* masks) { /*{{{*/ 4709 4709 4710 4710 /*serialized vectors:*/ 4711 IssmDouble eustatic = 0.; 4712 IssmDouble eustatic_cpu = 0.; 4713 IssmDouble eustatic_cpu_e = 0.; 4711 IssmDouble bslrice = 0.; 4712 IssmDouble bslrice_cpu = 0.; 4713 IssmDouble bslrhydro = 0.; 4714 IssmDouble bslrhydro_cpu = 0.; 4714 4715 IssmDouble area = 0.; 4715 4716 IssmDouble oceanarea = 0.; 4716 4717 IssmDouble oceanarea_cpu = 0.; 4718 int bp_compute_fingerprints= 0; 4717 4719 4718 4720 /*Initialize temporary vector that will be used to sum eustatic components … … 4733 4735 _assert_(oceanarea>0.); 4734 4736 4735 /*Call the sea level rise core: */ 4737 /*Call the sea level rise core for ice : */ 4738 bslrice_cpu=0; 4736 4739 for(int i=0;i<elements->Size();i++){ 4737 4740 Element* element=xDynamicCast<Element*>(elements->GetObjectByOffset(i)); 4738 element->SealevelriseEustatic(RSLgi,&eustatic_cpu_e,masks, oceanarea); 4739 eustatic_cpu+=eustatic_cpu_e; 4741 bslrice_cpu+=element->SealevelriseEustaticIce(RSLgi,masks, oceanarea); 4742 } 4743 4744 /*Call the sea level rise core for hydro: */ 4745 bslrhydro_cpu=0; 4746 for(int i=0;i<elements->Size();i++){ 4747 Element* element=xDynamicCast<Element*>(elements->GetObjectByOffset(i)); 4748 bslrhydro_cpu+=element->SealevelriseEustaticHydro(RSLgi,masks, oceanarea); 4749 } 4750 4751 /*Call the sea level rise core for bottom pressures: */ 4752 this->parameters->FindParam(&bp_compute_fingerprints,DslComputeFingerprintsEnum); 4753 if(bp_compute_fingerprints){ 4754 for(int i=0;i<elements->Size();i++){ 4755 Element* element=xDynamicCast<Element*>(elements->GetObjectByOffset(i)); 4756 element->SealevelriseEustaticBottomPressure(RSLgi,masks); 4757 } 4740 4758 } 4741 4759 … … 4745 4763 4746 4764 /*Sum all eustatic components from all cpus:*/ 4747 ISSM_MPI_Reduce (&eustatic_cpu,&eustatic,1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm() ); 4748 ISSM_MPI_Bcast(&eustatic,1,ISSM_MPI_DOUBLE,0,IssmComm::GetComm()); 4749 _assert_(!xIsNan<IssmDouble>(eustatic)); 4765 ISSM_MPI_Reduce (&bslrice_cpu,&bslrice,1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm() ); 4766 ISSM_MPI_Bcast(&bslrice,1,ISSM_MPI_DOUBLE,0,IssmComm::GetComm()); 4767 _assert_(!xIsNan<IssmDouble>(bslrice)); 4768 4769 ISSM_MPI_Reduce (&bslrhydro_cpu,&bslrhydro,1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm() ); 4770 ISSM_MPI_Bcast(&bslrhydro,1,ISSM_MPI_DOUBLE,0,IssmComm::GetComm()); 4771 _assert_(!xIsNan<IssmDouble>(bslrhydro)); 4750 4772 4751 4773 /*Free ressources:*/ … … 4755 4777 /*Assign output pointers:*/ 4756 4778 *poceanarea = oceanarea; 4757 *peustatic = eustatic; 4779 *pbslrice = bslrice; 4780 *pbslrhydro = bslrhydro; 4781 *pbslr=bslrhydro+bslrice; 4758 4782 4759 4783 }
Note:
See TracChangeset
for help on using the changeset viewer.