Ignore:
Timestamp:
10/12/16 12:16:21 (8 years ago)
Author:
adhikari
Message:

NEW: added new ESA capability to compute 3D elastostatic crustal deformation

File:
1 edited

Legend:

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

    r21159 r21261  
    625625                        break;
    626626               
     627                case EsaSolutionEnum:
     628                        analyses_temp[numanalyses++]=EsaAnalysisEnum;
     629                        break;
     630               
    627631                case SealevelriseSolutionEnum:
    628632                        analyses_temp[numanalyses++]=SealevelriseAnalysisEnum;
     
    638642
    639643                case TransientSolutionEnum:{
    640                         bool isSIA,isFS,isthermal,isenthalpy,ismasstransport,isgroundingline,isstressbalance,ismovingfront,ishydrology,isdamage,issmb,isslr,isgia;
     644                        bool isSIA,isFS,isthermal,isenthalpy,ismasstransport,isgroundingline,isstressbalance,ismovingfront,ishydrology,isdamage,issmb,isslr,isesa,isgia;
    641645                        iomodel->FindConstant(&isSIA,"md.flowequation.isSIA");
    642646                        iomodel->FindConstant(&isFS,"md.flowequation.isFS");
     
    651655                        iomodel->FindConstant(&issmb,"md.transient.issmb");
    652656                        iomodel->FindConstant(&isslr,"md.transient.isslr");
     657                        iomodel->FindConstant(&isesa,"md.transient.isesa");
    653658                        iomodel->FindConstant(&isgia,"md.transient.isgia");
    654659                        if(isstressbalance){
     
    694699                        if(isslr){
    695700                                analyses_temp[numanalyses++]=SealevelriseAnalysisEnum;
     701                        }
     702                        if(isesa){
     703                                analyses_temp[numanalyses++]=EsaAnalysisEnum;
    696704                        }
    697705                        if(isgia){
     
    22912299/*}}}*/
    22922300#endif
     2301#ifdef _HAVE_ESA_
     2302void FemModel::EsaGeodetic(Vector<IssmDouble>* pUp, Vector<IssmDouble>* pNorth, Vector<IssmDouble>* pEast, IssmDouble* latitude, IssmDouble* longitude, IssmDouble* radius, IssmDouble* xx, IssmDouble* yy, IssmDouble* zz){/*{{{*/
     2303
     2304        IssmDouble  eartharea=0;
     2305        IssmDouble  eartharea_cpu=0;
     2306
     2307        int         ns,nsmax;
     2308       
     2309        /*Go through elements, and add contribution from each element to the deflection vector wg:*/
     2310        ns = elements->Size();
     2311       
     2312        /*First, figure out the surface area of Earth: */
     2313        for(int i=0;i<ns;i++){
     2314                Element* element=xDynamicCast<Element*>(elements->GetObjectByOffset(i));
     2315                eartharea_cpu += element->GetAreaSpherical();
     2316        }
     2317        ISSM_MPI_Reduce (&eartharea_cpu,&eartharea,1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm() );
     2318        ISSM_MPI_Bcast(&eartharea,1,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
     2319
     2320        /*Figure out max of ns: */
     2321        ISSM_MPI_Reduce(&ns,&nsmax,1,ISSM_MPI_INT,ISSM_MPI_MAX,0,IssmComm::GetComm());
     2322        ISSM_MPI_Bcast(&nsmax,1,ISSM_MPI_INT,0,IssmComm::GetComm());
     2323
     2324        /*Call the esa geodetic core: */
     2325        for(int i=0;i<nsmax;i++){
     2326                if(i<ns){
     2327                        Element* element=xDynamicCast<Element*>(elements->GetObjectByOffset(i));
     2328                        element->EsaGeodetic(pUp,pNorth,pEast,latitude,longitude,radius,xx,yy,zz,eartharea);
     2329                }
     2330                if(i%100==0){
     2331                        pUp->Assemble();
     2332                        pNorth->Assemble();
     2333                        pEast->Assemble();
     2334                }
     2335        }
     2336       
     2337        /*One last time: */
     2338        pUp->Assemble();
     2339        pNorth->Assemble();
     2340        pEast->Assemble();
     2341
     2342        /*Free ressources:*/
     2343        xDelete<IssmDouble>(latitude);
     2344        xDelete<IssmDouble>(longitude);
     2345        xDelete<IssmDouble>(radius);
     2346        xDelete<IssmDouble>(xx);
     2347        xDelete<IssmDouble>(yy);
     2348        xDelete<IssmDouble>(zz);
     2349}
     2350/*}}}*/
     2351#endif
    22932352#ifdef _HAVE_SEALEVELRISE_
    22942353void FemModel::SealevelriseEustatic(Vector<IssmDouble>* pSgi, IssmDouble* peustatic, IssmDouble* latitude, IssmDouble* longitude, IssmDouble* radius) { /*{{{*/
Note: See TracChangeset for help on using the changeset viewer.