[25834] | 1 | Index: ../trunk-jpl/src/c/classes/FemModel.cpp
|
---|
| 2 | ===================================================================
|
---|
| 3 | --- ../trunk-jpl/src/c/classes/FemModel.cpp (revision 24943)
|
---|
| 4 | +++ ../trunk-jpl/src/c/classes/FemModel.cpp (revision 24944)
|
---|
| 5 | @@ -4744,6 +4744,13 @@
|
---|
| 6 | int* indices = NULL;
|
---|
| 7 | int gsize;
|
---|
| 8 |
|
---|
| 9 | + bool computerigid = true;
|
---|
| 10 | + bool computeelastic= true;
|
---|
| 11 | +
|
---|
| 12 | + /*recover computational flags: */
|
---|
| 13 | + this->parameters->FindParam(&computerigid,SealevelriseRigidEnum);
|
---|
| 14 | + this->parameters->FindParam(&computeelastic,SealevelriseElasticEnum);
|
---|
| 15 | +
|
---|
| 16 | /*Initialize temporary vector that will be used to sum eustatic components on all local elements, prior
|
---|
| 17 | * to assembly:*/
|
---|
| 18 | gsize = this->nodes->NumberOfDofs(GsetEnum);
|
---|
| 19 | @@ -4753,10 +4760,12 @@
|
---|
| 20 | /*Serialize vectors from previous iteration:*/
|
---|
| 21 | RSLg_old=pRSLg_old->ToMPISerial();
|
---|
| 22 |
|
---|
| 23 | - /*Call the sea level rise core: */
|
---|
| 24 | - for(int i=0;i<elements->Size();i++){
|
---|
| 25 | - Element* element=xDynamicCast<Element*>(elements->GetObjectByOffset(i));
|
---|
| 26 | - element->SealevelriseNonEustatic(RSLgo,RSLg_old,masks, latitude,longitude,radius);
|
---|
| 27 | + /*Call the sea level rise non-eustatic core only if required: */
|
---|
| 28 | + if(computerigid | computeelastic){
|
---|
| 29 | + for(int i=0;i<elements->Size();i++){
|
---|
| 30 | + Element* element=xDynamicCast<Element*>(elements->GetObjectByOffset(i));
|
---|
| 31 | + element->SealevelriseNonEustatic(RSLgo,RSLg_old,masks, latitude,longitude,radius);
|
---|
| 32 | + }
|
---|
| 33 | }
|
---|
| 34 | pRSLgo->SetValues(gsize,indices,RSLgo,ADD_VAL);
|
---|
| 35 | pRSLgo->Assemble();
|
---|
| 36 | Index: ../trunk-jpl/src/c/classes/Elements/Tria.cpp
|
---|
| 37 | ===================================================================
|
---|
| 38 | --- ../trunk-jpl/src/c/classes/Elements/Tria.cpp (revision 24943)
|
---|
| 39 | +++ ../trunk-jpl/src/c/classes/Elements/Tria.cpp (revision 24944)
|
---|
| 40 | @@ -5583,29 +5583,45 @@
|
---|
| 41 | int gsize;
|
---|
| 42 | bool spherical=true;
|
---|
| 43 | IssmDouble llr_list[NUMVERTICES][3];
|
---|
| 44 | - IssmDouble area;
|
---|
| 45 | + IssmDouble area,eartharea;
|
---|
| 46 | IssmDouble I; //change in ice thickness or water level(Farrel and Clarke, Equ. 4)
|
---|
| 47 | - IssmDouble rho;
|
---|
| 48 | + IssmDouble rho_earth;
|
---|
| 49 | IssmDouble late,longe,re;
|
---|
| 50 | IssmDouble lati,longi,ri;
|
---|
| 51 | + IssmDouble constant;
|
---|
| 52 |
|
---|
| 53 | + IssmDouble* G=NULL;
|
---|
| 54 | + IssmDouble* G_elastic_precomputed=NULL;
|
---|
| 55 | + IssmDouble* G_rigid_precomputed=NULL;
|
---|
| 56 | +
|
---|
| 57 | /*elastic green function:*/
|
---|
| 58 | IssmDouble* indices=NULL;
|
---|
| 59 | int M;
|
---|
| 60 | - IssmDouble* dummypointer=NULL;
|
---|
| 61 |
|
---|
| 62 | /*Computational flags:*/
|
---|
| 63 | bool computerigid = true;
|
---|
| 64 | + bool computeelastic = true;
|
---|
| 65 |
|
---|
| 66 | - /*how many dofs are we working with here? */
|
---|
| 67 | + /*recover parameters: */
|
---|
| 68 | + rho_earth=FindParam(MaterialsEarthDensityEnum);
|
---|
| 69 | + this->parameters->FindParam(&computerigid,SealevelriseRigidEnum);
|
---|
| 70 | + this->parameters->FindParam(&computeelastic,SealevelriseElasticEnum);
|
---|
| 71 | this->parameters->FindParam(&gsize,MeshNumberofverticesEnum);
|
---|
| 72 | + this->parameters->FindParam(&eartharea,SealevelEarthAreaEnum);
|
---|
| 73 |
|
---|
| 74 | - /*recover size of indexed tables:*/
|
---|
| 75 | + /*recover precomputed green function kernels:*/
|
---|
| 76 | DoubleVecParam* parameter = static_cast<DoubleVecParam*>(this->parameters->FindParamObject(SealevelriseGRigidEnum)); _assert_(parameter);
|
---|
| 77 | - parameter->GetParameterValueByPointer(&dummypointer,&M);
|
---|
| 78 | + parameter->GetParameterValueByPointer(&G_rigid_precomputed,&M);
|
---|
| 79 |
|
---|
| 80 | + parameter = static_cast<DoubleVecParam*>(this->parameters->FindParamObject(SealevelriseGElasticEnum)); _assert_(parameter);
|
---|
| 81 | + parameter->GetParameterValueByPointer(&G_elastic_precomputed,&M);
|
---|
| 82 | +
|
---|
| 83 | /*allocate indices:*/
|
---|
| 84 | indices=xNew<IssmDouble>(gsize);
|
---|
| 85 | + G=xNewZeroInit<IssmDouble>(gsize);
|
---|
| 86 | +
|
---|
| 87 | + /*compute area:*/
|
---|
| 88 | + area=GetAreaSpherical();
|
---|
| 89 |
|
---|
| 90 | /* Where is the centroid of this element?:{{{*/
|
---|
| 91 |
|
---|
| 92 | @@ -5645,7 +5661,9 @@
|
---|
| 93 | late=late/180*PI;
|
---|
| 94 | longe=longe/180*PI;
|
---|
| 95 | /*}}}*/
|
---|
| 96 | -
|
---|
| 97 | +
|
---|
| 98 | + constant=3/rho_earth*area/eartharea;
|
---|
| 99 | +
|
---|
| 100 | for(int i=0;i<gsize;i++){
|
---|
| 101 | IssmDouble alpha;
|
---|
| 102 | IssmDouble delPhi,delLambda;
|
---|
| 103 | @@ -5654,14 +5672,26 @@
|
---|
| 104 | lati=latitude[i]/180*PI; longi=longitude[i]/180*PI;
|
---|
| 105 | delPhi=fabs(lati-late); delLambda=fabs(longi-longe);
|
---|
| 106 | alpha=2.*asin(sqrt(pow(sin(delPhi/2),2)+cos(lati)*cos(late)*pow(sin(delLambda/2),2)));
|
---|
| 107 | - indices[i]=reCast<int,IssmDouble>(alpha/PI*reCast<IssmDouble,int>(M-1));
|
---|
| 108 | + indices[i]=alpha/PI*reCast<IssmDouble,int>(M-1);
|
---|
| 109 | +
|
---|
| 110 | + /*Rigid earth gravitational perturbation: */
|
---|
| 111 | + if(computerigid){
|
---|
| 112 | + G[i]+=G_rigid_precomputed[reCast<int,IssmDouble>(indices[i])];
|
---|
| 113 | + }
|
---|
| 114 | + if(computeelastic){
|
---|
| 115 | + G[i]+=G_elastic_precomputed[reCast<int,IssmDouble>(indices[i])];
|
---|
| 116 | + }
|
---|
| 117 | + G[i]=G[i]*constant;
|
---|
| 118 | }
|
---|
| 119 |
|
---|
| 120 | /*Add in inputs:*/
|
---|
| 121 | this->inputs2->SetArrayInput(SealevelriseIndicesEnum,this->lid,indices,gsize);
|
---|
| 122 | + this->inputs2->SetArrayInput(SealevelriseGEnum,this->lid,G,gsize);
|
---|
| 123 | + this->inputs2->SetDoubleInput(AreaEnum,this->lid,area);
|
---|
| 124 |
|
---|
| 125 | - /*Another quantity, area:*/
|
---|
| 126 | - this->inputs2->SetDoubleInput(AreaEnum,this->lid,GetAreaSpherical());
|
---|
| 127 | + /*Free allocations:*/
|
---|
| 128 | + xDelete(indices);
|
---|
| 129 | + xDelete(G);
|
---|
| 130 |
|
---|
| 131 | return;
|
---|
| 132 | }
|
---|
| 133 | @@ -5689,22 +5719,14 @@
|
---|
| 134 | void Tria::SealevelriseEustaticIce(IssmDouble* Sgi, IssmDouble* peustatic, SealevelMasks* masks, IssmDouble* latitude,IssmDouble* longitude,IssmDouble* radius,IssmDouble oceanarea){ /*{{{*/
|
---|
| 135 |
|
---|
| 136 | /*diverse:*/
|
---|
| 137 | - int gsize,dummy;
|
---|
| 138 | - bool spherical=true;
|
---|
| 139 | - IssmDouble llr_list[NUMVERTICES][3];
|
---|
| 140 | - IssmDouble area,eartharea;
|
---|
| 141 | + int gsize;
|
---|
| 142 | + IssmDouble area;
|
---|
| 143 | + IssmDouble phi=1.0; //WARNING: do not touch this, default is entire elemnt contributes eustatic
|
---|
| 144 | IssmDouble I; //change in ice thickness or water level(Farrel and Clarke, Equ. 4)
|
---|
| 145 | - IssmDouble rho;
|
---|
| 146 | - IssmDouble late,longe,re;
|
---|
| 147 | - IssmDouble lati,longi,ri;
|
---|
| 148 | bool notfullygrounded=false;
|
---|
| 149 |
|
---|
| 150 | /*elastic green function:*/
|
---|
| 151 | - int index;
|
---|
| 152 | - IssmDouble* indices=NULL;
|
---|
| 153 | - IssmDouble* G_elastic_precomputed=NULL;
|
---|
| 154 | - IssmDouble* G_rigid_precomputed=NULL;
|
---|
| 155 | - int M;
|
---|
| 156 | + IssmDouble* G=NULL;
|
---|
| 157 |
|
---|
| 158 | /*ice properties: */
|
---|
| 159 | IssmDouble rho_ice,rho_water,rho_earth;
|
---|
| 160 | @@ -5722,7 +5744,9 @@
|
---|
| 161 |
|
---|
| 162 | /*early return if we are not on an ice cap:*/
|
---|
| 163 | if(!masks->isiceonly[this->lid]){
|
---|
| 164 | + #ifdef _ISSM_DEBUG_
|
---|
| 165 | constant=0; this->AddInput2(SealevelEustaticMaskEnum,&constant,P0Enum);
|
---|
| 166 | + #endif
|
---|
| 167 | *peustatic=0; //do not forget to assign this pointer, otherwise, global eustatic will be garbage!
|
---|
| 168 | return;
|
---|
| 169 | }
|
---|
| 170 | @@ -5729,7 +5753,10 @@
|
---|
| 171 |
|
---|
| 172 | /*early return if we are fully floating:*/
|
---|
| 173 | if (masks->isfullyfloating[this->lid]){
|
---|
| 174 | - constant=0; this->AddInput2(SealevelEustaticMaskEnum,&constant,P0Enum);
|
---|
| 175 | + constant=0;
|
---|
| 176 | + #ifdef _ISSM_DEBUG_
|
---|
| 177 | + this->AddInput2(SealevelEustaticMaskEnum,&constant,P0Enum);
|
---|
| 178 | + #endif
|
---|
| 179 | *peustatic=0; //do not forget to assign this pointer, otherwise, global eustatic will be garbage!
|
---|
| 180 | return;
|
---|
| 181 | }
|
---|
| 182 | @@ -5738,53 +5765,38 @@
|
---|
| 183 | if (masks->notfullygrounded[this->lid]) notfullygrounded=true; //used later on.
|
---|
| 184 |
|
---|
| 185 | /*Inform mask: */
|
---|
| 186 | - constant=1; this->AddInput2(SealevelEustaticMaskEnum,&constant,P0Enum);
|
---|
| 187 | + constant=1;
|
---|
| 188 | + #ifdef _ISSM_DEBUG_
|
---|
| 189 | + this->AddInput2(SealevelEustaticMaskEnum,&constant,P0Enum);
|
---|
| 190 | + #endif
|
---|
| 191 |
|
---|
| 192 | /*recover material parameters: */
|
---|
| 193 | rho_ice=FindParam(MaterialsRhoIceEnum);
|
---|
| 194 | rho_water=FindParam(MaterialsRhoSeawaterEnum);
|
---|
| 195 | - rho_earth=FindParam(MaterialsEarthDensityEnum);
|
---|
| 196 |
|
---|
| 197 | /*recover love numbers and computational flags: */
|
---|
| 198 | - this->parameters->FindParam(&computerigid,SealevelriseRigidEnum);
|
---|
| 199 | - this->parameters->FindParam(&computeelastic,SealevelriseElasticEnum);
|
---|
| 200 | this->parameters->FindParam(&scaleoceanarea,SealevelriseOceanAreaScalingEnum);
|
---|
| 201 |
|
---|
| 202 | - /*recover earth area: */
|
---|
| 203 | - this->parameters->FindParam(&eartharea,SealevelEarthAreaEnum);
|
---|
| 204 | + /*retrieve precomputed G:*/
|
---|
| 205 | + this->inputs2->GetArrayPtr(SealevelriseGEnum,this->lid,&G,&gsize);
|
---|
| 206 |
|
---|
| 207 | - /*recover precomputed green function kernels:*/
|
---|
| 208 | - DoubleVecParam* parameter = static_cast<DoubleVecParam*>(this->parameters->FindParamObject(SealevelriseGRigidEnum)); _assert_(parameter);
|
---|
| 209 | - parameter->GetParameterValueByPointer(&G_rigid_precomputed,&M);
|
---|
| 210 | -
|
---|
| 211 | - if(computeelastic){
|
---|
| 212 | - parameter = static_cast<DoubleVecParam*>(this->parameters->FindParamObject(SealevelriseGElasticEnum)); _assert_(parameter);
|
---|
| 213 | - parameter->GetParameterValueByPointer(&G_elastic_precomputed,&M);
|
---|
| 214 | - }
|
---|
| 215 | -
|
---|
| 216 | - /*how many dofs are we working with here? */
|
---|
| 217 | - this->parameters->FindParam(&gsize,MeshNumberofverticesEnum);
|
---|
| 218 | -
|
---|
| 219 | - /*retrieve indices:*/
|
---|
| 220 | - if(computerigid){this->inputs2->GetArrayPtr(SealevelriseIndicesEnum,this->lid,&indices,&dummy); _assert_(dummy==gsize);}
|
---|
| 221 | -
|
---|
| 222 | /*Get area of element: precomputed in the sealevelrise_core_geometry:*/
|
---|
| 223 | this->GetInput2Value(&area,AreaEnum);
|
---|
| 224 |
|
---|
| 225 | - if(notfullygrounded){
|
---|
| 226 | - IssmDouble phi=0;
|
---|
| 227 | + /*factor to reduce area if we are not fully grounded:*/
|
---|
| 228 | + if(notfullygrounded){ /*{{{*/
|
---|
| 229 | IssmDouble xyz_list[NUMVERTICES][3];
|
---|
| 230 | ::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES);
|
---|
| 231 |
|
---|
| 232 | phi=this->GetGroundedPortion(&xyz_list[0][0]); //watch out, this only works because of the Thales theorem! We are in 3D, but this routine is inherently for 2D trias
|
---|
| 233 | - area*=phi; //scale our load by the fraction of grounded area.
|
---|
| 234 | }
|
---|
| 235 | + /*}}}*/
|
---|
| 236 |
|
---|
| 237 | /*Compute ice thickness: */
|
---|
| 238 | Input2* deltathickness_input=this->GetInput2(SealevelriseDeltathicknessEnum);
|
---|
| 239 | if (!deltathickness_input)_error_("delta thickness input needed to compute sea level rise!");
|
---|
| 240 |
|
---|
| 241 | - /*If we are fully grounded, take the average over the element: */
|
---|
| 242 | + /*If we are fully grounded, take the average over the element: {{{*/
|
---|
| 243 | if(!notfullygrounded)deltathickness_input->GetInputAverage(&I);
|
---|
| 244 | else{
|
---|
| 245 | IssmDouble total_weight=0;
|
---|
| 246 | @@ -5809,37 +5821,21 @@
|
---|
| 247 | I=I/total_weight;
|
---|
| 248 | delete gauss;
|
---|
| 249 | }
|
---|
| 250 | + /*}}}*/
|
---|
| 251 |
|
---|
| 252 | /*Compute eustatic compoent:*/
|
---|
| 253 | _assert_(oceanarea>0.);
|
---|
| 254 | if(scaleoceanarea) oceanarea=3.619e+14; // use true ocean area, m^2
|
---|
| 255 | - eustatic += rho_ice*area*I/(oceanarea*rho_water);
|
---|
| 256 | + eustatic += rho_ice*area*phi*I/(oceanarea*rho_water);
|
---|
| 257 |
|
---|
| 258 | - if(computeelastic | computerigid){
|
---|
| 259 | - IssmDouble alpha;
|
---|
| 260 | - IssmDouble delPhi,delLambda;
|
---|
| 261 | - for(int i=0;i<gsize;i++){
|
---|
| 262 | + /*convert from m to kg/m^2:*/
|
---|
| 263 | + I=I*rho_ice*phi;
|
---|
| 264 |
|
---|
| 265 | - IssmDouble G_elastic=0; //do not remove =0!
|
---|
| 266 | + /*convolve:*/
|
---|
| 267 | + for(int i=0;i<gsize;i++) Sgi[i]+=G[i]*I;
|
---|
| 268 |
|
---|
| 269 | - /*Compute alpha angle between centroid and current vertex and index into precomputed tables: */
|
---|
| 270 | - /*lati=latitude[i]/180*PI; longi=longitude[i]/180*PI;
|
---|
| 271 | - delPhi=fabs(lati-late); delLambda=fabs(longi-longe);
|
---|
| 272 | - alpha=2.*asin(sqrt(pow(sin(delPhi/2),2.0)+cos(lati)*cos(late)*pow(sin(delLambda/2),2)));
|
---|
| 273 | - index=reCast<int,IssmDouble>(alpha/PI*reCast<IssmDouble,int>(M-1));*/
|
---|
| 274 | - index=reCast<int,IssmDouble>(indices[i]);
|
---|
| 275 | -
|
---|
| 276 | - //Elastic component (from Eq 17 in Adhikari et al, GMD 2015)
|
---|
| 277 | - if(computeelastic) G_elastic += G_elastic_precomputed[index];
|
---|
| 278 | -
|
---|
| 279 | - /*Add all components to the Sgi or Sgo solution vectors:*/
|
---|
| 280 | - Sgi[i]+=3*rho_ice/rho_earth*area/eartharea*I*(G_rigid_precomputed[index]+G_elastic);
|
---|
| 281 | - }
|
---|
| 282 | - }
|
---|
| 283 | -
|
---|
| 284 | /*Assign output pointer:*/
|
---|
| 285 | _assert_(!xIsNan<IssmDouble>(eustatic));
|
---|
| 286 | - _assert_(!xIsInf<IssmDouble>(eustatic));
|
---|
| 287 | *peustatic=eustatic;
|
---|
| 288 | return;
|
---|
| 289 | }
|
---|
| 290 | @@ -5997,101 +5993,43 @@
|
---|
| 291 |
|
---|
| 292 | /*diverse:*/
|
---|
| 293 | int gsize,dummy;
|
---|
| 294 | - bool spherical=true;
|
---|
| 295 | - IssmDouble llr_list[NUMVERTICES][3];
|
---|
| 296 | - IssmDouble area,eartharea;
|
---|
| 297 | IssmDouble S; //change in water water level(Farrel and Clarke, Equ. 4)
|
---|
| 298 | - IssmDouble late,longe;
|
---|
| 299 | - IssmDouble lati,longi,ri;
|
---|
| 300 | - IssmDouble minlong=400;
|
---|
| 301 | - IssmDouble maxlong=-20;
|
---|
| 302 | IssmDouble constant=0;
|
---|
| 303 | + IssmDouble rho_water;
|
---|
| 304 | + IssmDouble* G=NULL;
|
---|
| 305 |
|
---|
| 306 | - /*precomputed elastic green functions:*/
|
---|
| 307 | - IssmDouble* G_rigid_precomputed = NULL;
|
---|
| 308 | - IssmDouble* G_elastic_precomputed = NULL;
|
---|
| 309 | - int M;
|
---|
| 310 | - int index;
|
---|
| 311 | - IssmDouble* indices=NULL;
|
---|
| 312 | - IssmDouble alpha;
|
---|
| 313 | - IssmDouble delPhi,delLambda;
|
---|
| 314 | -
|
---|
| 315 | /*optimization:*/
|
---|
| 316 | bool store_green_functions=false;
|
---|
| 317 | +
|
---|
| 318 | + rho_water=FindParam(MaterialsRhoSeawaterEnum);
|
---|
| 319 |
|
---|
| 320 | - /*ice properties: */
|
---|
| 321 | - IssmDouble rho_ice,rho_water,rho_earth;
|
---|
| 322 | -
|
---|
| 323 | - /*Computational flags:*/
|
---|
| 324 | - bool computerigid = true;
|
---|
| 325 | - bool computeelastic= true;
|
---|
| 326 | -
|
---|
| 327 | /*early return if we are not on the ocean:*/
|
---|
| 328 | if (!masks->isoceanin[this->lid]){
|
---|
| 329 | - constant=0; this->AddInput2(SealevelEustaticOceanMaskEnum,&constant,P0Enum);
|
---|
| 330 | + constant=0;
|
---|
| 331 | + #ifdef _ISSM_DEBUG_
|
---|
| 332 | + this->AddInput2(SealevelEustaticOceanMaskEnum,&constant,P0Enum);
|
---|
| 333 | + #endif
|
---|
| 334 | return;
|
---|
| 335 | }
|
---|
| 336 | - constant=1; this->AddInput2(SealevelEustaticOceanMaskEnum,&constant,P0Enum);
|
---|
| 337 | + constant=1;
|
---|
| 338 | + #ifdef _ISSM_DEBUG_
|
---|
| 339 | + this->AddInput2(SealevelEustaticOceanMaskEnum,&constant,P0Enum);
|
---|
| 340 | + #endif
|
---|
| 341 |
|
---|
| 342 | - /*recover computational flags: */
|
---|
| 343 | - this->parameters->FindParam(&computerigid,SealevelriseRigidEnum);
|
---|
| 344 | - this->parameters->FindParam(&computeelastic,SealevelriseElasticEnum);
|
---|
| 345 | -
|
---|
| 346 | - /*recover earth area: */
|
---|
| 347 | - this->parameters->FindParam(&eartharea,SealevelEarthAreaEnum);
|
---|
| 348 | -
|
---|
| 349 | - /*early return if rigid or elastic not requested:*/
|
---|
| 350 | - if(!computerigid && !computeelastic) return;
|
---|
| 351 | -
|
---|
| 352 | - /*recover material parameters: */
|
---|
| 353 | - rho_water=FindParam(MaterialsRhoSeawaterEnum);
|
---|
| 354 | - rho_earth=FindParam(MaterialsEarthDensityEnum);
|
---|
| 355 | -
|
---|
| 356 | /*how many dofs are we working with here? */
|
---|
| 357 | this->parameters->FindParam(&gsize,MeshNumberofverticesEnum);
|
---|
| 358 | +
|
---|
| 359 | + /*retrieve precomputed G:*/
|
---|
| 360 | + this->inputs2->GetArrayPtr(SealevelriseGEnum,this->lid,&G,&dummy); _assert_(dummy==gsize);
|
---|
| 361 |
|
---|
| 362 | - /*retrieve indices:*/
|
---|
| 363 | - if(computerigid){this->inputs2->GetArrayPtr(SealevelriseIndicesEnum,this->lid,&indices,&dummy); _assert_(dummy==gsize);}
|
---|
| 364 | -
|
---|
| 365 | /*From Sg_old, recover water sea level rise:*/
|
---|
| 366 | S=0; for(int i=0;i<NUMVERTICES;i++) S+=Sg_old[this->vertices[i]->Sid()]/NUMVERTICES;
|
---|
| 367 |
|
---|
| 368 | - /*Get area of element: precomputed in the sealevelrise_core_geometry:*/
|
---|
| 369 | - this->GetInput2Value(&area,AreaEnum);
|
---|
| 370 | + /*convert to SI: */
|
---|
| 371 | + S=S*rho_water;
|
---|
| 372 |
|
---|
| 373 | - /*recover rigid and elastic green functions:*/
|
---|
| 374 | - DoubleVecParam* parameter = static_cast<DoubleVecParam*>(this->parameters->FindParamObject(SealevelriseGRigidEnum)); _assert_(parameter);
|
---|
| 375 | - parameter->GetParameterValueByPointer(&G_rigid_precomputed,&M);
|
---|
| 376 | + for(int i=0;i<gsize;i++) Sgo[i]+=G[i]*S;
|
---|
| 377 |
|
---|
| 378 | - if(computeelastic){
|
---|
| 379 | - /*recover elastic green function:*/
|
---|
| 380 | - parameter = static_cast<DoubleVecParam*>(this->parameters->FindParamObject(SealevelriseGElasticEnum)); _assert_(parameter);
|
---|
| 381 | - parameter->GetParameterValueByPointer(&G_elastic_precomputed,&M);
|
---|
| 382 | - }
|
---|
| 383 | -
|
---|
| 384 | -
|
---|
| 385 | - for(int i=0;i<gsize;i++){
|
---|
| 386 | -
|
---|
| 387 | - /*Compute alpha angle between centroid and current vertex : */
|
---|
| 388 | - /*lati=latitude[i]/180*PI; longi=longitude[i]/180*PI;
|
---|
| 389 | - delPhi=fabs(lati-late); delLambda=fabs(longi-longe);
|
---|
| 390 | - alpha=2.*asin(sqrt(pow(sin(delPhi/2),2.0)+cos(lati)*cos(late)*pow(sin(delLambda/2),2)));
|
---|
| 391 | - index=reCast<int,IssmDouble>(alpha/PI*(M-1));*/
|
---|
| 392 | -
|
---|
| 393 | - index=reCast<int,IssmDouble>(indices[i]);
|
---|
| 394 | -
|
---|
| 395 | - /*Rigid earth gravitational perturbation: */
|
---|
| 396 | - if(computerigid){
|
---|
| 397 | - Sgo[i]+=3*rho_water/rho_earth*area/eartharea*S*G_rigid_precomputed[index];
|
---|
| 398 | - }
|
---|
| 399 | -
|
---|
| 400 | - /*Elastic component (from Eq 17 in Adhikari et al, GMD 2015): */
|
---|
| 401 | - if(computeelastic){
|
---|
| 402 | - Sgo[i]+=3*rho_water/rho_earth*area/eartharea*S*G_elastic_precomputed[index];
|
---|
| 403 | - }
|
---|
| 404 | - }
|
---|
| 405 | -
|
---|
| 406 | -
|
---|
| 407 | return;
|
---|
| 408 | }
|
---|
| 409 | /*}}}*/
|
---|
| 410 | Index: ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h
|
---|
| 411 | ===================================================================
|
---|
| 412 | --- ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h (revision 24943)
|
---|
| 413 | +++ ../trunk-jpl/src/c/shared/Enum/EnumDefinitions.h (revision 24944)
|
---|
| 414 | @@ -681,6 +681,7 @@
|
---|
| 415 | SealevelriseSpcthicknessEnum,
|
---|
| 416 | SealevelriseHydroRateEnum,
|
---|
| 417 | SealevelriseIndicesEnum,
|
---|
| 418 | + SealevelriseGEnum,
|
---|
| 419 | SedimentHeadEnum,
|
---|
| 420 | SedimentHeadOldEnum,
|
---|
| 421 | SedimentHeadSubstepEnum,
|
---|
| 422 | Index: ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp
|
---|
| 423 | ===================================================================
|
---|
| 424 | --- ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp (revision 24943)
|
---|
| 425 | +++ ../trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp (revision 24944)
|
---|
| 426 | @@ -686,6 +686,7 @@
|
---|
| 427 | case SealevelriseSpcthicknessEnum : return "SealevelriseSpcthickness";
|
---|
| 428 | case SealevelriseHydroRateEnum : return "SealevelriseHydroRate";
|
---|
| 429 | case SealevelriseIndicesEnum : return "SealevelriseIndices";
|
---|
| 430 | + case SealevelriseGEnum : return "SealevelriseG";
|
---|
| 431 | case SedimentHeadEnum : return "SedimentHead";
|
---|
| 432 | case SedimentHeadOldEnum : return "SedimentHeadOld";
|
---|
| 433 | case SedimentHeadSubstepEnum : return "SedimentHeadSubstep";
|
---|
| 434 | Index: ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp
|
---|
| 435 | ===================================================================
|
---|
| 436 | --- ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp (revision 24943)
|
---|
| 437 | +++ ../trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp (revision 24944)
|
---|
| 438 | @@ -701,6 +701,7 @@
|
---|
| 439 | else if (strcmp(name,"SealevelriseSpcthickness")==0) return SealevelriseSpcthicknessEnum;
|
---|
| 440 | else if (strcmp(name,"SealevelriseHydroRate")==0) return SealevelriseHydroRateEnum;
|
---|
| 441 | else if (strcmp(name,"SealevelriseIndices")==0) return SealevelriseIndicesEnum;
|
---|
| 442 | + else if (strcmp(name,"SealevelriseG")==0) return SealevelriseGEnum;
|
---|
| 443 | else if (strcmp(name,"SedimentHead")==0) return SedimentHeadEnum;
|
---|
| 444 | else if (strcmp(name,"SedimentHeadOld")==0) return SedimentHeadOldEnum;
|
---|
| 445 | else if (strcmp(name,"SedimentHeadSubstep")==0) return SedimentHeadSubstepEnum;
|
---|
| 446 | @@ -750,11 +751,11 @@
|
---|
| 447 | else if (strcmp(name,"SmbHref")==0) return SmbHrefEnum;
|
---|
| 448 | else if (strcmp(name,"SmbIsInitialized")==0) return SmbIsInitializedEnum;
|
---|
| 449 | else if (strcmp(name,"SmbMAdd")==0) return SmbMAddEnum;
|
---|
| 450 | - else if (strcmp(name,"SmbMassBalanceClimate")==0) return SmbMassBalanceClimateEnum;
|
---|
| 451 | else stage=7;
|
---|
| 452 | }
|
---|
| 453 | if(stage==7){
|
---|
| 454 | - if (strcmp(name,"SmbMassBalance")==0) return SmbMassBalanceEnum;
|
---|
| 455 | + if (strcmp(name,"SmbMassBalanceClimate")==0) return SmbMassBalanceClimateEnum;
|
---|
| 456 | + else if (strcmp(name,"SmbMassBalance")==0) return SmbMassBalanceEnum;
|
---|
| 457 | else if (strcmp(name,"SmbMassBalanceSubstep")==0) return SmbMassBalanceSubstepEnum;
|
---|
| 458 | else if (strcmp(name,"SmbMassBalanceTransient")==0) return SmbMassBalanceTransientEnum;
|
---|
| 459 | else if (strcmp(name,"SmbMeanLHF")==0) return SmbMeanLHFEnum;
|
---|
| 460 | @@ -873,11 +874,11 @@
|
---|
| 461 | else if (strcmp(name,"Outputdefinition1")==0) return Outputdefinition1Enum;
|
---|
| 462 | else if (strcmp(name,"Outputdefinition10")==0) return Outputdefinition10Enum;
|
---|
| 463 | else if (strcmp(name,"Outputdefinition11")==0) return Outputdefinition11Enum;
|
---|
| 464 | - else if (strcmp(name,"Outputdefinition12")==0) return Outputdefinition12Enum;
|
---|
| 465 | else stage=8;
|
---|
| 466 | }
|
---|
| 467 | if(stage==8){
|
---|
| 468 | - if (strcmp(name,"Outputdefinition13")==0) return Outputdefinition13Enum;
|
---|
| 469 | + if (strcmp(name,"Outputdefinition12")==0) return Outputdefinition12Enum;
|
---|
| 470 | + else if (strcmp(name,"Outputdefinition13")==0) return Outputdefinition13Enum;
|
---|
| 471 | else if (strcmp(name,"Outputdefinition14")==0) return Outputdefinition14Enum;
|
---|
| 472 | else if (strcmp(name,"Outputdefinition15")==0) return Outputdefinition15Enum;
|
---|
| 473 | else if (strcmp(name,"Outputdefinition16")==0) return Outputdefinition16Enum;
|
---|
| 474 | @@ -996,11 +997,11 @@
|
---|
| 475 | else if (strcmp(name,"BalancevelocityAnalysis")==0) return BalancevelocityAnalysisEnum;
|
---|
| 476 | else if (strcmp(name,"BalancevelocitySolution")==0) return BalancevelocitySolutionEnum;
|
---|
| 477 | else if (strcmp(name,"BasalforcingsIsmip6")==0) return BasalforcingsIsmip6Enum;
|
---|
| 478 | - else if (strcmp(name,"BasalforcingsPico")==0) return BasalforcingsPicoEnum;
|
---|
| 479 | else stage=9;
|
---|
| 480 | }
|
---|
| 481 | if(stage==9){
|
---|
| 482 | - if (strcmp(name,"BeckmannGoosseFloatingMeltRate")==0) return BeckmannGoosseFloatingMeltRateEnum;
|
---|
| 483 | + if (strcmp(name,"BasalforcingsPico")==0) return BasalforcingsPicoEnum;
|
---|
| 484 | + else if (strcmp(name,"BeckmannGoosseFloatingMeltRate")==0) return BeckmannGoosseFloatingMeltRateEnum;
|
---|
| 485 | else if (strcmp(name,"BedSlopeSolution")==0) return BedSlopeSolutionEnum;
|
---|
| 486 | else if (strcmp(name,"BoolExternalResult")==0) return BoolExternalResultEnum;
|
---|
| 487 | else if (strcmp(name,"BoolInput")==0) return BoolInputEnum;
|
---|
| 488 | @@ -1119,11 +1120,11 @@
|
---|
| 489 | else if (strcmp(name,"Hydrologypism")==0) return HydrologypismEnum;
|
---|
| 490 | else if (strcmp(name,"Hydrologyshakti")==0) return HydrologyshaktiEnum;
|
---|
| 491 | else if (strcmp(name,"Hydrologyshreve")==0) return HydrologyshreveEnum;
|
---|
| 492 | - else if (strcmp(name,"IceMass")==0) return IceMassEnum;
|
---|
| 493 | else stage=10;
|
---|
| 494 | }
|
---|
| 495 | if(stage==10){
|
---|
| 496 | - if (strcmp(name,"IceMassScaled")==0) return IceMassScaledEnum;
|
---|
| 497 | + if (strcmp(name,"IceMass")==0) return IceMassEnum;
|
---|
| 498 | + else if (strcmp(name,"IceMassScaled")==0) return IceMassScaledEnum;
|
---|
| 499 | else if (strcmp(name,"IceVolumeAboveFloatation")==0) return IceVolumeAboveFloatationEnum;
|
---|
| 500 | else if (strcmp(name,"IceVolumeAboveFloatationScaled")==0) return IceVolumeAboveFloatationScaledEnum;
|
---|
| 501 | else if (strcmp(name,"IceVolume")==0) return IceVolumeEnum;
|
---|
| 502 | @@ -1242,11 +1243,11 @@
|
---|
| 503 | else if (strcmp(name,"P2xP4")==0) return P2xP4Enum;
|
---|
| 504 | else if (strcmp(name,"Paterson")==0) return PatersonEnum;
|
---|
| 505 | else if (strcmp(name,"Pengrid")==0) return PengridEnum;
|
---|
| 506 | - else if (strcmp(name,"Penpair")==0) return PenpairEnum;
|
---|
| 507 | else stage=11;
|
---|
| 508 | }
|
---|
| 509 | if(stage==11){
|
---|
| 510 | - if (strcmp(name,"Penta")==0) return PentaEnum;
|
---|
| 511 | + if (strcmp(name,"Penpair")==0) return PenpairEnum;
|
---|
| 512 | + else if (strcmp(name,"Penta")==0) return PentaEnum;
|
---|
| 513 | else if (strcmp(name,"PentaInput")==0) return PentaInputEnum;
|
---|
| 514 | else if (strcmp(name,"Profiler")==0) return ProfilerEnum;
|
---|
| 515 | else if (strcmp(name,"ProfilingCurrentFlops")==0) return ProfilingCurrentFlopsEnum;
|
---|
| 516 | Index: ../trunk-jpl/src/c/shared/Enum/Enum.vim
|
---|
| 517 | ===================================================================
|
---|
| 518 | --- ../trunk-jpl/src/c/shared/Enum/Enum.vim (revision 24943)
|
---|
| 519 | +++ ../trunk-jpl/src/c/shared/Enum/Enum.vim (revision 24944)
|
---|
| 520 | @@ -684,6 +684,7 @@
|
---|
| 521 | syn keyword cConstant SealevelriseSpcthicknessEnum
|
---|
| 522 | syn keyword cConstant SealevelriseHydroRateEnum
|
---|
| 523 | syn keyword cConstant SealevelriseIndicesEnum
|
---|
| 524 | +syn keyword cConstant SealevelriseGEnum
|
---|
| 525 | syn keyword cConstant SedimentHeadEnum
|
---|
| 526 | syn keyword cConstant SedimentHeadOldEnum
|
---|
| 527 | syn keyword cConstant SedimentHeadSubstepEnum
|
---|