Changeset 20044
- Timestamp:
- 01/31/16 21:22:36 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/analyses/SealevelriseAnalysis.cpp
r20036 r20044 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()); … … 114 135 115 136 /*}}}*/ 116 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 /*}}}*/ 137 #endif 138 138 139 139 /*Avoid singularity at 0: */
Note:
See TracChangeset
for help on using the changeset viewer.