source:
issm/oecreview/Archive/19101-20495/ISSM-20043-20044.diff
Last change on this file was 20498, checked in by , 9 years ago | |
---|---|
File size: 2.0 KB |
-
../trunk-jpl/src/c/analyses/SealevelriseAnalysis.cpp
70 70 iomodel->FetchData(°acc,SealevelriseDegaccEnum); 71 71 M=reCast<int,IssmDouble>(180./degacc+1.); 72 72 G_elastic=xNew<IssmDouble>(M); 73 74 /*compute combined legendre + love number (elastic green function:*/ 75 #ifdef _HAVE_ADOLC_ 76 for(int i=0;i<M;i++){ 77 IssmDouble alpha,x; 78 alpha= reCast<IssmDouble>(i)*degacc * PI / 180.0; 73 79 74 /*compute combined legendre + love number (elastic green function:*/ 80 G_elastic[i]= (love_k[nl-1]-love_h[nl-1])/2.0/sin(alpha/2.0); 81 for (int n=0;n<nl;n++) { 82 IssmDouble Pn,Pn1,Pn2; 83 IssmDouble deltalove; 84 85 deltalove = (love_k[n]-love_k[nl-1]-love_h[n]+love_h[nl-1]); 86 87 if(n==0)Pn=1; 88 else if(n==1)Pn=cos(alpha); 89 else Pn= ( (2*n-1)*cos(alpha)*Pn1 - (n-1)*Pn2 ) /n; 90 Pn2=Pn1; Pn1=Pn; 91 92 G_elastic[i] += deltalove*Pn; 93 } 94 } 95 #else 75 96 m=DetermineLocalSize(M,IssmComm::GetComm()); 76 97 GetOwnershipBoundariesFromRange(&lower_row,&upper_row,m,IssmComm::GetComm()); 77 98 G_elastic_local=xNew<IssmDouble>(m); … … 113 134 xDelete<int>(displs); 114 135 115 136 /*}}}*/ 137 #endif 116 138 117 /*Old code: {{{*/118 /*for(int i=0;i<M;i++){119 IssmDouble alpha,x;120 alpha= reCast<IssmDouble>(i)*degacc * PI / 180.0;121 122 G_elastic[i]= (love_k[nl-1]-love_h[nl-1])/2.0/sin(alpha/2.0);123 for (int n=0;n<nl;n++) {124 IssmDouble Pn,Pn1,Pn2;125 IssmDouble deltalove;126 127 deltalove = (love_k[n]-love_k[nl-1]-love_h[n]+love_h[nl-1]);128 129 if(n==0)Pn=1;130 else if(n==1)Pn=cos(alpha);131 else Pn= ( (2*n-1)*cos(alpha)*Pn1 - (n-1)*Pn2 ) /n;132 Pn2=Pn1; Pn1=Pn;133 134 G_elastic[i] += deltalove*Pn;135 }136 }*/137 /*}}}*/138 139 139 /*Avoid singularity at 0: */ 140 140 G_elastic[0]=G_elastic[1]; 141 141 parameters->AddObject(new DoubleVecParam(SealevelriseGElasticEnum,G_elastic,M));
Note:
See TracBrowser
for help on using the repository browser.