Changeset 24689
- Timestamp:
- 04/03/20 11:57:14 (5 years ago)
- Location:
- issm/trunk-jpl
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/modules/SurfaceMassBalancex/Gembx.cpp
r24683 r24689 70 70 IssmDouble time0 = Ta_input_tr->GetTimeByOffset(-1); 71 71 IssmDouble timeend = Ta_input_tr->GetTimeByOffset(offsetend); 72 timeend = ceil(timeend/dt)*dt; 72 73 if (time>time0 & timeend>time0){ 73 74 delta=(time-time0) - (timeend-time0)*(reCast<int,IssmDouble>((time-time0)/(timeend-time0))); … … 111 112 #ifndef _HAVE_AD_ //avoid the round operation check! 112 113 if (dgpTop != round(dgpTop)){ 113 _error_("top grid cell structure length does not go evenly into specified top structure depth, adjust dzTop or zTop ");114 _error_("top grid cell structure length does not go evenly into specified top structure depth, adjust dzTop or zTop\n"); 114 115 } 115 116 #endif 116 117 if(dzTop < 0.05){ 117 _printf_("initial top grid cell length (dzTop) is < 0.05 m ");118 _printf_("initial top grid cell length (dzTop) is < 0.05 m\n"); 118 119 } 119 120 gpTop=reCast<int,IssmDouble>(dgpTop); … … 282 283 283 284 // Take forward differences on left and right edges 284 dT[0] = (T[1] - T[0])/(zGPC[1]-zGPC[0]); 285 if(m>1) dT[m-1] = (T[m-1] - T[m-2])/(zGPC[m-1]-zGPC[m-2]); 285 if(m>1){ 286 dT[0] = (T[1] - T[0])/(zGPC[1]-zGPC[0]); 287 dT[m-1] = (T[m-1] - T[m-2])/(zGPC[m-1]-zGPC[m-2]); 288 } 286 289 287 290 //Take centered differences on interior points … … 343 346 // higher than 15 degC m-1 (Brun et al., 1992) 344 347 //When wet-snow grains (class 6) are submitted to a 345 // temperature gradient higher than degC m-1, their sphericity348 // temperature gradient higher than 5 degC m-1, their sphericity 346 349 // decreases according to Equations (4). When sphericity 347 350 // reaches 0, their size increases according to the functions 348 351 // determined by Marbouty. (Brun et al., 1992) 349 if(gsp[i]>0.0+Gdntol && gsp[i]<1.0-Gdntol && (dT[i]>15.0+Ttol || ( T[i]>5.0+Ttol && W[i]>0.0+Wtol)) ){350 //determine coeff 0icients352 if(gsp[i]>0.0+Gdntol && gsp[i]<1.0-Gdntol && (dT[i]>15.0+Ttol || (dT[i]>5.0+Ttol && W[i]>0.0+Wtol)) ){ 353 //determine coefficients 351 354 IssmDouble C = (-2e8 * exp(-6e3 / T[i]) * dt) * pow(dT[i],.4); 352 355 gsp[i] +=C; 353 356 if (gsp[i]<0.0+Gdntol)gsp[i]=0.0; 357 //determine new grain size (mm) 358 gsz[i] = 0.35 + (0.5-gsp[i])*0.1; 354 359 } 355 360 /*Dry snow metamorphism (Marbouty, 1980) grouped model coefficents 356 361 *from Marbouty, 1980: Figure 9*/ 357 else if(W[i]<=0.0+Wtol || (gsp[i]<=0.0+Gdntol && dT[i]>15.0+Ttol) || (gsp[i]<=0.0+Gdntol && T[i]>5.0+Ttol && W[i]>0.0+Wtol)){362 else if(W[i]<=0.0+Wtol || (gsp[i]<=0.0+Gdntol && dT[i]>15.0+Ttol) || (gsp[i]<=0.0+Gdntol && dT[i]>5.0+Ttol && W[i]>0.0+Wtol)){ 358 363 //_printf_("Nondendritic snow metamorphism\n"); 359 364 Q = Marbouty(T[i],d[i],dT[i]); … … 366 371 //_printf_("Nondendritic wet snow metamorphism\n"); 367 372 //wet rate of change coefficient 368 IssmDouble E = 1.28e-8 + (4.22e-10 * pow(lwc[i],3.0))* (dt *dts); // [mm^3 s^-1]373 IssmDouble E = (1.28e-8 + 4.22e-10 * pow(lwc[i],3.0))* (dt *dts); // [mm^3 s^-1] 369 374 370 375 // calculate change in grain volume and convert to grain size
Note:
See TracChangeset
for help on using the changeset viewer.