Ignore:
Timestamp:
09/04/20 16:30:07 (5 years ago)
Author:
Eric.Larour
Message:

CHG: added output of bslr, bslrice and bslrhydro, as well as cumulated values.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/branches/trunk-larour-SLPS2020/src/c/classes/FemModel.cpp

    r25361 r25534  
    47064706#endif
    47074707#ifdef _HAVE_SEALEVELRISE_
    4708 void FemModel::SealevelriseEustatic(Vector<IssmDouble>* pRSLgi, IssmDouble* poceanarea, IssmDouble* peustatic, SealevelMasks* masks) { /*{{{*/
     4708void FemModel::SealevelriseEustatic(Vector<IssmDouble>* pRSLgi, IssmDouble* poceanarea, IssmDouble* pbslr,IssmDouble* pbslrice, IssmDouble* pbslrhydro, SealevelMasks* masks) { /*{{{*/
    47094709
    47104710        /*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.;
    47144715        IssmDouble  area      = 0.;
    47154716        IssmDouble  oceanarea      = 0.;
    47164717        IssmDouble  oceanarea_cpu  = 0.;
     4718        int bp_compute_fingerprints= 0;
    47174719
    47184720   /*Initialize temporary vector that will be used to sum eustatic components
     
    47334735        _assert_(oceanarea>0.);
    47344736
    4735         /*Call the sea level rise core: */
     4737        /*Call the sea level rise core for ice : */
     4738        bslrice_cpu=0;
    47364739        for(int i=0;i<elements->Size();i++){
    47374740                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                }
    47404758        }
    47414759
     
    47454763
    47464764        /*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));
    47504772
    47514773        /*Free ressources:*/
     
    47554777        /*Assign output pointers:*/
    47564778        *poceanarea = oceanarea;
    4757         *peustatic  = eustatic;
     4779        *pbslrice  = bslrice;
     4780        *pbslrhydro  = bslrhydro;
     4781        *pbslr=bslrhydro+bslrice;
    47584782
    47594783}
Note: See TracChangeset for help on using the changeset viewer.