source:
issm/oecreview/Archive/24684-25833/ISSM-24971-24972.diff
Last change on this file was 25834, checked in by , 4 years ago | |
---|---|
File size: 3.6 KB |
-
../trunk-jpl/src/c/classes/Elements/Tria.cpp
5930 5930 5931 5931 /*diverse:*/ 5932 5932 int gsize,dummy; 5933 IssmDouble S ; //change in water water level(Farrel and Clarke, Equ. 4)5933 IssmDouble S,BP, Stotal; //change in water water level(Farrel and Clarke, Equ. 4) 5934 5934 IssmDouble constant=0; 5935 5935 IssmDouble rho_water; 5936 5936 IssmDouble* G=NULL; 5937 int bp_compute_fingerprints= 0; 5937 5938 5938 /*optimization:*/ 5939 bool store_green_functions=false; 5940 5939 /*retrieve parameters:*/ 5940 this->parameters->FindParam(&bp_compute_fingerprints,DslComputeFingerprintsEnum); 5941 5941 rho_water=FindParam(MaterialsRhoSeawaterEnum); 5942 5942 5943 5943 /*early return if we are not on the ocean:*/ … … 5962 5962 /*From Sg_old, recover water sea level rise:*/ 5963 5963 S=0; for(int i=0;i<NUMVERTICES;i++) S+=Sg_old[this->vertices[i]->Sid()]/NUMVERTICES; 5964 5964 5965 /*If we have bottom pressure fingerprinting requested, retrieve BP: */ 5966 if(bp_compute_fingerprints){ 5967 Input2* bottompressure_change_input=this->GetInput2(DslSeaWaterPressureChangeAtSeaFloor); 5968 if (!bottompressure_change_input)_error_("bottom pressure input needed to compute sea level rise fingerprint!"); 5969 bottompressure_change_input->GetInputAverage(&BP); 5970 5971 } else BP=0; 5972 5965 5973 /*convert to kg/m^2: */ 5966 5974 S=S*rho_water; 5975 BP=BP*rho_water; 5967 5976 5968 for(int i=0;i<gsize;i++) Sgo[i]+=G[i]*S; 5969 //cblas_daxpy(gsize,S,&G[0],1,&Sgo[0],1); //for later. 5977 Stotal=S+BP; 5970 5978 5979 for(int i=0;i<gsize;i++) Sgo[i]+=G[i]*Stotal; 5980 5971 5981 return; 5972 5982 } 5973 5983 /*}}}*/ … … 5975 5985 5976 5986 /*diverse:*/ 5977 5987 int gsize; 5978 IssmDouble I, S ; //change in relative ice thickness and sea level5988 IssmDouble I, S, BP, Stotal; //change in relative ice thickness and sea level 5979 5989 IssmDouble rho_ice,rho_water; 5980 5990 int horiz; 5991 int bp_compute_fingerprints= 0; 5981 5992 5982 5993 /*precomputed elastic green functions:*/ 5983 5994 IssmDouble* GU=NULL; … … 5996 6007 /*recover parameters:*/ 5997 6008 this->parameters->FindParam(&computeelastic,SealevelriseElasticEnum); 5998 6009 this->parameters->FindParam(&horiz,SealevelriseHorizEnum); 6010 this->parameters->FindParam(&bp_compute_fingerprints,DslComputeFingerprintsEnum); 5999 6011 6000 6012 /*early return if elastic not requested:*/ 6001 6013 if(!computeelastic) return; … … 6018 6030 if (!deltathickness_input)_error_("delta thickness input needed to compute sea level rise!"); 6019 6031 deltathickness_input->GetInputAverage(&I); 6020 6032 6033 /*convert to kg/m^2*/ 6034 I=I*rho_ice; 6035 6021 6036 for(int i=0;i<gsize;i++){ 6022 Up[i]+= rho_ice*I*GU[i];6037 Up[i]+=I*GU[i]; 6023 6038 if(horiz){ 6024 North[i]+= rho_ice*I*GN[i];6025 East[i]+= rho_ice*I*GE[i];6039 North[i]+=I*GN[i]; 6040 East[i]+=I*GE[i]; 6026 6041 } 6027 6042 } 6028 6043 } … … 6030 6045 /*From Sg, recover water sea level rise:*/ 6031 6046 S=0; for(int i=0;i<NUMVERTICES;i++) S+=Sg[this->vertices[i]->Sid()]/NUMVERTICES; 6032 6047 6048 /*If we have bottom pressure fingerprinting requested, retrieve BP: */ 6049 if(bp_compute_fingerprints){ 6050 Input2* bottompressure_change_input=this->GetInput2(DslSeaWaterPressureChangeAtSeaFloor); 6051 if (!bottompressure_change_input)_error_("bottom pressure input needed to compute sea level rise fingerprint!"); 6052 bottompressure_change_input->GetInputAverage(&BP); 6053 } else BP=0; 6054 6055 /*convert to kg/m^2:*/ 6056 S=rho_water*S; 6057 BP=rho_water*BP; 6058 Stotal=S+BP; 6059 6033 6060 for(int i=0;i<gsize;i++){ 6034 Up[i]+= rho_water*S*GU[i];6061 Up[i]+=Stotal*GU[i]; 6035 6062 if(horiz){ 6036 North[i]+= rho_water*S*GN[i];6037 East[i]+= rho_water*S*GE[i];6063 North[i]+=Stotal*GN[i]; 6064 East[i]+=Stotal*GE[i]; 6038 6065 } 6039 6066 } 6040 6067 }
Note:
See TracBrowser
for help on using the repository browser.