Changeset 21742


Ignore:
Timestamp:
05/23/17 14:57:13 (8 years ago)
Author:
Eric.Larour
Message:

CHG: shield ensureContiguous statement.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/analyses/SealevelriseAnalysis.cpp

    r21741 r21742  
    9090                iomodel->FetchData(&degacc,"md.slr.degacc");
    9191                M=reCast<int,IssmDouble>(180./degacc+1.);
     92
     93                // AD performance is sensitive to calls to ensurecontiguous.
     94                // // Providing "t" will cause ensurecontiguous to be called.
     95                #ifdef _HAVE_AD_
    9296                G_elastic=xNew<IssmDouble>(M,"t");
    9397                U_elastic=xNew<IssmDouble>(M,"t");
    9498                H_elastic=xNew<IssmDouble>(M,"t");
     99                #else
     100                G_elastic=xNew<IssmDouble>(M);
     101                U_elastic=xNew<IssmDouble>(M);
     102                H_elastic=xNew<IssmDouble>(M);
     103                #endif
     104
    95105               
    96106                /*compute combined legendre + love number (elastic green function:*/
    97107                m=DetermineLocalSize(M,IssmComm::GetComm());
    98108                GetOwnershipBoundariesFromRange(&lower_row,&upper_row,m,IssmComm::GetComm());
     109                // AD performance is sensitive to calls to ensurecontiguous.
     110                // // Providing "t" will cause ensurecontiguous to be called.
     111                #ifdef _HAVE_AD_
    99112                G_elastic_local=xNew<IssmDouble>(m,"t");
    100113                U_elastic_local=xNew<IssmDouble>(m,"t");
    101114                H_elastic_local=xNew<IssmDouble>(m,"t");
     115                #else
     116                G_elastic_local=xNew<IssmDouble>(m);
     117                U_elastic_local=xNew<IssmDouble>(m);
     118                H_elastic_local=xNew<IssmDouble>(m);
     119                #endif
    102120
    103121                for(int i=lower_row;i<upper_row;i++){
Note: See TracChangeset for help on using the changeset viewer.