Changeset 24023
- Timestamp:
- 06/17/19 02:41:45 (6 years ago)
- Location:
- issm/trunk-jpl/src/c
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/classes/Elements/Element.cpp
r24014 r24023 2172 2172 void Element::Ismip6FloatingiceMeltingRate(){/*{{{*/ 2173 2173 2174 if(!this->IsIceInElement() || !this->IsFloating()) return; 2175 2176 const int NUM_VERTICES = this->GetNumberOfVertices(); 2174 if(!this->IsIceInElement() || !this->IsFloating() || !this->IsOnBase()) return; 2177 2175 2178 2176 int basinid,num_basins,M,N; 2179 2177 IssmDouble tf,gamma0,base,delta_t_basin,mean_tf_basin,absval; 2180 IssmDouble* basalmeltrate = xNew<IssmDouble>(NUM_VERTICES);2181 2178 bool islocal; 2182 2179 IssmDouble* delta_t = NULL; 2183 2180 IssmDouble* mean_tf = NULL; 2184 2181 IssmDouble* depths = NULL; 2182 2183 /*Allocate some arrays*/ 2184 const int numvertices = this->GetNumberOfVertices(); 2185 IssmDouble* basalmeltrate = xNew<IssmDouble>(numvertices); 2185 2186 2186 2187 /*Get variables*/ … … 2208 2209 /*Compute melt rate for Local and Nonlocal parameterizations*/ 2209 2210 Gauss* gauss=this->NewGauss(); 2210 for(int i=0;i< NUM_VERTICES;i++){2211 for(int i=0;i<numvertices;i++){ 2211 2212 gauss->GaussVertex(i); 2212 2213 tf_input->GetInputValue(&tf,gauss); … … 2214 2215 absval = mean_tf_basin+delta_t_basin; 2215 2216 if (absval<0) {absval = -1.*absval;} 2216 basalmeltrate[i] = gamma0*pow((rhow*cp)/(rhoi*lf),2)*(tf+delta_t_basin)*absval;} 2217 else {basalmeltrate[i] = gamma0*pow((rhow*cp)/(rhoi*lf),2)*pow(max(tf+delta_t_basin,0.),2);} 2217 basalmeltrate[i] = gamma0*pow((rhow*cp)/(rhoi*lf),2)*(tf+delta_t_basin)*absval; 2218 } 2219 else{ 2220 basalmeltrate[i] = gamma0*pow((rhow*cp)/(rhoi*lf),2)*pow(max(tf+delta_t_basin,0.),2); 2221 } 2218 2222 } 2219 2223 … … 2226 2230 xDelete<IssmDouble>(mean_tf); 2227 2231 xDelete<IssmDouble>(depths); 2232 xDelete<IssmDouble>(basalmeltrate); 2228 2233 2229 2234 }/*}}}*/ -
issm/trunk-jpl/src/c/cores/bmb_core.cpp
r23460 r24023 35 35 /*Call module now*/ 36 36 FloatingiceMeltingRatex(femmodel); 37 38 /*Extrude basal melt*/ 39 femmodel->parameters->SetParam(BasalforcingsFloatingiceMeltingRateEnum,InputToExtrudeEnum); 40 extrudefrombase_core(femmodel); 37 41 } -
issm/trunk-jpl/src/c/modules/FloatingiceMeltingRatex/FloatingiceMeltingRatex.cpp
r24022 r24023 154 154 for(int i=0;i<femmodel->elements->Size();i++){ 155 155 Element* element=xDynamicCast<Element*>(femmodel->elements->GetObjectByOffset(i)); 156 if(!element->IsOnBase() ) continue;156 if(!element->IsOnBase() || !element->IsIceInElement() || !element->IsFloating()) continue; 157 157 /*Spawn basal element if on base to compute element area*/ 158 158 Element* basalelement = element->SpawnBasalElement(); 159 if(!basalelement->IsIceInElement() || !basalelement->IsFloating()) continue;160 159 Input* tf_input=basalelement->GetInput(BasalforcingsIsmp6TfShelfEnum); _assert_(tf_input); 161 160 basalelement->inputs->GetInputValue(&basinid,BasalforcingsIsmp6BasinIdEnum);
Note:
See TracChangeset
for help on using the changeset viewer.