Ignore:
Timestamp:
01/23/19 13:41:28 (6 years ago)
Author:
youngmc3
Message:

NEW: add new class md.frontalforcings

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/classes/FemModel.cpp

    r23644 r23652  
    14961496
    14971497}/*}}}*/
     1498void FemModel::IcefrontAreax(){/*{{{*/
     1499
     1500        int numvertices      = this->GetElementsWidth();
     1501        int numbasins;
     1502        IssmDouble* BasinId   = xNew<IssmDouble>(numvertices);
     1503        this->parameters->FindParam(&numbasins,FrontalForcingsNumberofBasinsEnum);
     1504        IssmDouble* basin_icefront_area           = xNewZeroInit<IssmDouble>(numbasins);
     1505
     1506        for(int basin=1;basin<numbasins+1;basin++){
     1507                IssmDouble local_icefront_area = 0;
     1508                IssmDouble total_icefront_area;
     1509
     1510                for(int i=0;i<this->elements->Size();i++){
     1511                        Element* element=xDynamicCast<Element*>(this->elements->GetObjectByOffset(i));
     1512                        element->GetInputListOnVertices(BasinId,FrontalForcingsBasinIdEnum);
     1513                        for(int j=0;j<numvertices;j++){
     1514                                if(BasinId[j]==basin){
     1515                                        local_icefront_area+=element->GetIcefrontArea();
     1516                                        break;
     1517                                }
     1518                        }
     1519                }
     1520                ISSM_MPI_Reduce(&local_icefront_area,&total_icefront_area,1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm());
     1521                ISSM_MPI_Bcast(&total_icefront_area,1,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
     1522       
     1523                basin_icefront_area[basin-1]=total_icefront_area;
     1524        }
     1525       
     1526        this->parameters->AddObject(new DoubleVecParam(FrontalForcingsBasinIcefrontAreaEnum,basin_icefront_area,numbasins));
     1527       
     1528        xDelete<IssmDouble>(basin_icefront_area);
     1529}/*}}}*/
    14981530void FemModel::IceMassx(IssmDouble* pM, bool scaled){/*{{{*/
    14991531
     
    23902422}
    23912423/*}}}*/
     2424void FemModel::RignotMeltParameterizationx(){/*{{{*/
     2425
     2426        for(int i=0;i<elements->Size();i++){
     2427                Element* element=dynamic_cast<Element*>(this->elements->GetObjectByOffset(i));
     2428                element->RignotMeltParameterization();
     2429        }
     2430}
     2431/*}}}*/
    23922432void FemModel::StrainRateparallelx(){/*{{{*/
    23932433
Note: See TracChangeset for help on using the changeset viewer.