Changeset 12640 for issm/trunk/src/c/objects/Elements/Penta.cpp
- Timestamp:
- 07/17/12 09:11:29 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/objects/Elements/Penta.cpp
r12630 r12640 2258 2258 void Penta::PositiveDegreeDay(double* pdds,double* pds,double signorm){ 2259 2259 2260 int i,iqj,imonth; 2261 double agd[NUMVERTICES]; // surface mass balance 2262 double saccu[NUMVERTICES] = {0}; // yearly surface accumulation 2263 double smelt[NUMVERTICES] = {0}; // yearly melt 2264 double precrunoff[NUMVERTICES]; // yearly runoff 2265 double prect; // total precipitation during 1 year taking into account des. ef. 2266 double water; //water=rain + snowmelt 2267 double runoff; //meltwater only, does not include rain 2268 double sconv; //rhow_rain/rhoi / 12 months 2269 2270 double rho_water,rho_ice,density; 2271 double lapser=6.5/1000., sealev=0.; // lapse rate. degrees per meter. 7.5 lev's 99 paper, 9 Marshall 99 paper 2272 double desfac = 0.5; //desert elevation factor 2273 double s0p[NUMVERTICES]={0}; //should be set to elevation from precip source 2274 double s0t[NUMVERTICES]={0}; //should be set to elevation from temperature source 2275 double st; // elevation between altitude of the temp record and current altitude 2276 double sp; // elevation between altitude of the prec record and current altitude 2277 2278 // PDD and PD constants and variables 2279 double siglim; // sigma limit for the integration which is equal to 2.5 sigmanorm 2280 double signormc = signorm - 0.5; // sigma of the temperature distribution for cloudy day 2281 double siglimc, siglim0, siglim0c; 2282 double PDup, pddsig, PDCUT = 2.0; // PDcut: rain/snow cutoff temperature (C) 2283 double DT = 0.02; 2284 double pddt, pd; // pd: snow/precip fraction, precipitation falling as snow 2285 2286 double q, qmpt; // q is desert/elev. fact, hnpfac is huybrect fact, and pd is normal dist. 2287 double qm[NUMVERTICES] = {0}; // snow part of the precipitation 2288 double qmt[NUMVERTICES] = {0}; // precipitation without desertification effect adjustment 2289 double qmp[NUMVERTICES] = {0}; // desertification taken into account 2290 double pdd[NUMVERTICES] = {0}; 2291 double frzndd[NUMVERTICES] = {0}; 2292 2293 double tstar; // monthly mean surface temp 2294 double Tsum[NUMVERTICES]= {0}; // average summer (JJA) temperature 2295 double Tsurf[NUMVERTICES] = {0}; // average annual temperature 2296 2297 double h[NUMVERTICES],s[NUMVERTICES]; // ,b[NUMVERTICES] 2260 double agd[NUMVERTICES]; // surface mass balance 2298 2261 double monthlytemperatures[NUMVERTICES][12],monthlyprec[NUMVERTICES][12]; 2299 double deltm=1./12.; 2300 int ismon[12]={11,0,1,2,3,4,5,6,7,8,9,10}; 2301 2302 double snwm; // snow that could have been melted in a year. 2303 double snwmf; // ablation factor for snow per positive degree day. 2304 double smf; // ablation factor for ice per pdd (Braithwaite 1995 from tarasov 2002). 2305 2306 double dfrz=1.5, CovrLm=2009./3.35e+5, dCovrLm=dfrz*CovrLm; //m*J kg^-1 C^-1 /(J kg^-1)=m/C yr 2307 double supice,supcap,diffndd; 2308 double fsupT=0.5, fsupndd=0.5; // Tsurf mode factors for supice 2309 double pddtj[NUMVERTICES], hmx2; 2310 2311 //printf("ok1p\n"); 2312 if(!IsOnBed()) return; 2262 double h[NUMVERTICES],s[NUMVERTICES]; // ,b 2263 double rho_water,rho_ice; 2264 int i; 2313 2265 2314 2266 /*Recover monthly temperatures and precipitation*/ … … 2328 2280 } 2329 2281 } 2330 /*Recover info a the vertices: */ 2331 GetInputListOnVertices(&h[0],ThicknessEnum); 2332 GetInputListOnVertices(&s[0],SurfaceEnum); 2333 2334 //printf("ok2p\n"); 2335 2336 /*Get material parameters :*/ 2337 rho_ice=matpar->GetRhoIce(); 2338 rho_water=matpar->GetRhoFreshwater(); 2339 2340 sconv=(rho_water/rho_ice)/12.; //rhow_rain/rhoi / 12 months 2341 2342 /*PDD constant*/ 2343 siglim = 2.5*signorm; 2344 siglimc = 2.5*signormc; 2345 siglim0 = siglim/DT + 0.5; 2346 siglim0c = siglimc/DT + 0.5; 2347 PDup = siglimc+PDCUT; 2348 2349 // seasonal loop 2350 for (iqj = 0; iqj < 12; iqj++){ 2351 imonth = ismon[iqj]; 2352 for (i = 0; i < NUMVERTICES; i++){ 2353 st=(s[i]-s0t[i])/1000.; 2354 tstar = monthlytemperatures[i][imonth] - lapser *max(st,sealev); 2355 Tsurf[i] = tstar*deltm+Tsurf[i]; 2356 2357 /*********compute PD ****************/ 2358 if (tstar < PDup){ 2359 pd = 1.; 2360 if (tstar >= -siglimc){ pd = pds[int(tstar/DT + siglim0c)];}} 2361 else { 2362 pd = 0.;} 2363 2364 /******exp des/elev precip reduction*******/ 2365 sp=(s[i]-s0p[i])/1000.; // deselev effect is wrt chng in topo 2366 if (sp>0.0){q = exp(-desfac*sp);} 2367 else {q = 1.0;} 2368 2369 qmt[i]= qmt[i] + monthlyprec[i][imonth]*sconv; //*sconv to convert in m of ice equivalent per month 2370 qmpt= q*monthlyprec[i][imonth]*sconv; 2371 qmp[i]= qmp[i] + qmpt; 2372 qm[i]= qm[i] + qmpt*pd; 2373 2374 /*********compute PDD************/ 2375 // ndd(month)=-(tstar-pdd(month)) since ndd+pdd gives expectation of 2376 // gaussian=T_m, so ndd=-(Tsurf-pdd) 2377 if (iqj>5 && iqj<9){ Tsum[i]=Tsum[i]+tstar;} 2378 if (tstar >= siglim) {pdd[i] = pdd[i] + tstar*deltm;} 2379 else if (tstar> -siglim){ 2380 pddsig=pdds[int(tstar/DT + siglim0)]; 2381 pdd[i] = pdd[i] + pddsig*deltm; 2382 frzndd[i] = frzndd[i] - (tstar-pddsig)*deltm;} 2383 else{frzndd[i] = frzndd[i] - tstar*deltm; } 2384 } 2385 } // end of seasonal loop 2386 2387 //****************************************************************** 2388 for(i=0;i<NUMVERTICES;i++){ 2389 saccu[i] = qm[i]; 2390 prect = qmp[i]; // total precipitation during 1 year taking into account des. ef. 2391 Tsum[i]=Tsum[i]/3; 2392 2393 /***** determine PDD factors *****/ 2394 if(Tsum[i]< -1.) { 2395 snwmf=2.65*0.001; // ablation factor for snow per positive degree day.*0.001 to go from mm to m/ppd 2396 smf=17.22*0.001; // ablation factor for ice per pdd (Braithwaite 1995 from tarasov 2002) 2397 } 2398 else if(Tsum[i]< 10){ 2399 snwmf = (0.15*Tsum[i] + 2.8)*0.001; 2400 smf = (0.0067*pow((10.-Tsum[i]),3) + 8.3)*0.001; 2401 } 2402 else{ 2403 snwmf=4.3*0.001; 2404 smf=8.3*0.001; 2405 } 2406 snwmf=0.95*snwmf; 2407 smf=0.95*smf; 2408 2409 /***** compute PDD ablation and refreezing *****/ 2410 pddt = pdd[i] *365; 2411 snwm = snwmf*pddt; // snow that could have been melted in a year 2412 hmx2 = min(h[i],dfrz); // refreeze active layer max depth: dfrz 2413 2414 if(snwm < saccu[i]) { 2415 water=prect-saccu[i] + snwm; //water=rain + snowmelt 2416 // l 2.2= capillary factor 2417 // Should refreezing be controlled by frzndd or by mean annual Tsurf? 2418 // dCovrLm concept is of warming of active layer (thickness =d@=1- 2419 // >2m) 2420 // problem with water seepage into ice: should be sealed after 2421 // refreezing 2422 // so everything needs to be predicated on 1 year scale, except for 2423 // thermal 2424 // conductivity through ice 2425 // also, need to account that melt season has low accum, so what's 2426 // going to 2427 // hold the meltwater around for refreezing? And melt-time will have 2428 // low seasonal frzndd 2429 2430 // Superimposed ice : Pfeffer et al. 1991, Tarasov 2002 2431 2432 supice= min(hmx2*CovrLm*frzndd[i]+2.2*(saccu[i]-snwm), water); // superimposed ice 2433 supcap=min(2.2*(saccu[i]-snwm),water); 2434 runoff=snwm - supice; //meltwater only, does not include rain 2435 } 2436 else { //all snow melted 2437 supice= min(hmx2*CovrLm*frzndd[i], prect ); 2438 runoff= saccu[i] + smf*(pddt-saccu[i]/snwmf) - supice; 2439 supcap=0; 2440 } 2441 // pdd melting doesn't cool Tsurf, so ndd refreeze shouldn't warm it 2442 // except pdd melt heat source is atmosphere, while refreeze is 2443 // ground/ice stored interim 2444 // assume pdd=ndd, then melt should equal refreeze and Tsurf should=0 2445 // assume ndd=2*pdd, then all supice is refrozen, but Tsurf should be 2446 // <0 2447 // assume ndd>pdd, little melt => little supice 2448 // bottom line: compare for Tsurf<0 : supice and no supice case, 2449 // expect Tsurf difference 2450 // except some of cooling flux comes from atmosphere// 2451 // 1 dm supice should not raise Tsurf by 1/dCovrLm = 16.675C 2452 // does supice make sense when H< 0.1m? then d=thermoactive ice layer //// 2453 // < 0.1 2454 2455 // make more sense to just use residual pdd-ndd except that pdd 2456 // residual not clear yet 2457 // frzndd should not be used up by refreezing in snow, so stick in 2458 // supcap. 2459 diffndd=0; 2460 if (frzndd[i]>0) { 2461 diffndd=fsupndd*min((supice-supcap)/dCovrLm ,frzndd[i]); 2462 frzndd[i]=frzndd[i]-diffndd; 2463 } 2464 if(runoff<0){ 2465 saccu[i]= saccu[i] -runoff; 2466 smelt[i] = 0; 2467 precrunoff[i]=prect-saccu[i]; 2468 //here assume pdd residual is 0, => 2469 Tsurf[i]= max(Tsurf[i],-frzndd[i]); 2470 } 2471 else { 2472 smelt[i] = runoff; 2473 precrunoff[i]=prect-max(0.,supice)-saccu[i];} 2474 //here really need pdd balance, try 0.5 fudge factor? 2475 //at least runoff>0 => it's fairly warm, so Tsurf is !<<0, 2476 //yet from site plots, can be ice free with Tsurf=-5.5C 2477 if(Tsurf[i]<0) { 2478 Tsurf[i]= min(Tsurf[i]+fsupT*diffndd , 0.);} 2479 2480 agd[i] = -smelt[i]+saccu[i]; 2481 agd[i] = agd[i]/yts; 2482 pddtj[i]=pddt; 2483 }//end of the for loop over the vertices 2484 2485 /*Update inputs*/ 2486 this->inputs->AddInput(new PentaP1Input(SurfaceforcingsMassBalanceEnum,&agd[0])); 2487 //this->inputs->AddInput(new PentaVertexInput(ThermalSpcTemperatureEnum,&Tsurf[0])); 2488 this->InputExtrude(SurfaceforcingsMassBalanceEnum,ElementEnum); 2282 2283 /*Recover info at the vertices: */ 2284 GetInputListOnVertices(&h[0],ThicknessEnum); 2285 GetInputListOnVertices(&s[0],SurfaceEnum); 2286 2287 /*Get material parameters :*/ 2288 rho_ice=matpar->GetRhoIce(); 2289 rho_water=matpar->GetRhoFreshwater(); 2290 2291 /*measure the surface mass balance*/ 2292 for (i = 0; i < NUMVERTICES; i++){ 2293 agd[i]=PddSurfaceMassBlance(&monthlytemperatures[0][0], &monthlyprec[0][0], i, pdds, pds, signorm, yts, h[i], s[i], rho_ice, rho_water); 2294 } 2295 2296 /*Update inputs*/ 2297 this->inputs->AddInput(new PentaP1Input(SurfaceforcingsMassBalanceEnum,&agd[0])); 2298 //this->inputs->AddInput(new PentaVertexInput(ThermalSpcTemperatureEnum,&Tsurf[0])); 2299 this->InputExtrude(SurfaceforcingsMassBalanceEnum,ElementEnum); 2489 2300 } 2490 2301 /*}}}*/
Note:
See TracChangeset
for help on using the changeset viewer.