Changeset 16360
- Timestamp:
- 10/10/13 07:29:57 (12 years ago)
- Location:
- issm/trunk-jpl
- Files:
-
- 8 edited
-
src/c/modules/PostprocessingEnthalpyx/PostprocessingEnthalpyx.cpp (modified) (1 diff)
-
src/c/shared/Elements/DrainageFunctionWaterfraction.cpp (modified) (1 diff)
-
test/Archives/Archive121.nc (modified) ( previous)
-
test/Archives/Archive122.nc (modified) ( previous)
-
test/Archives/Archive326.nc (modified) ( previous)
-
test/Archives/Archive327.nc (modified) ( previous)
-
test/Archives/Archive431.nc (modified) ( previous)
-
test/Archives/Archive432.nc (modified) ( previous)
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/modules/PostprocessingEnthalpyx/PostprocessingEnthalpyx.cpp
r16322 r16360 19 19 20 20 /*drain excess water fraction: */ 21 for (i=0;i<femmodel->elements->Size();i++){21 /*for (i=0;i<femmodel->elements->Size();i++){ 22 22 element=dynamic_cast<Element*>(femmodel->elements->GetObjectByOffset(i)); 23 23 element->DrainWaterfraction(); 24 24 } 25 */ 25 26 26 27 /*Update basal dirichlet BCs for enthalpy: */ -
issm/trunk-jpl/src/c/shared/Elements/DrainageFunctionWaterfraction.cpp
r16359 r16360 9 9 /*FUNCTION IssmDouble DrainageFunctionWaterfraction()*/ 10 10 IssmDouble DrainageFunctionWaterfraction(IssmDouble waterfraction, IssmDouble dt=0.){ 11 /* DrainageFunctionWaterfraction returns how much of the waterfraction is drained per year */12 _assert_(waterfraction>=0.);13 _assert_(dt>=0.);11 /* DrainageFunctionWaterfraction returns how much of the waterfraction is drained per year */ 12 _assert_(waterfraction>=0.); 13 _assert_(dt>=0.); 14 14 15 IssmDouble w0=0.01, w1=0.02, w2=0.03;16 IssmDouble Dret, D0=0, D1=0.005, D2=0.05;17 IssmDouble yts=365*24*60*60;18 dt/=yts;15 IssmDouble w0=0.01, w1=0.02, w2=0.03; 16 IssmDouble Dret, D0=0, D1=0.005, D2=0.05; 17 IssmDouble yts=365*24*60*60; 18 dt/=yts; 19 19 20 /*get drainage function value*/21 if((w0==w1)||(w1==w2)||(w0==w2))22 _error_("Error: equal ordinates in DrainageFunctionWaterfraction -> division by zero. Abort");23 if(waterfraction<=w0)24 Dret=D0;25 if((waterfraction>w0) && (waterfraction<=w1))26 Dret=(D1-D0)/(w1-w0)*(waterfraction-w0)+D0;27 if((waterfraction>w1) && (waterfraction<=w2))28 Dret=(D2-D1)/(w2-w1)*(waterfraction-w1)+D1;29 else30 Dret=D2;20 /*get drainage function value*/ 21 if((w0==w1)||(w1==w2)||(w0==w2)) 22 _error_("Error: equal ordinates in DrainageFunctionWaterfraction -> division by zero. Abort"); 23 if(waterfraction<=w0) 24 Dret=D0; 25 if((waterfraction>w0) && (waterfraction<=w1)) 26 Dret=(D1-D0)/(w1-w0)*(waterfraction-w0)+D0; 27 if((waterfraction>w1) && (waterfraction<=w2)) 28 Dret=(D2-D1)/(w2-w1)*(waterfraction-w1)+D1; 29 else 30 Dret=D2; 31 31 32 /*check if dt*Dret>waterfraction. If so, drain whole waterfraction*/33 if(dt==0.){34 if(Dret>waterfraction)35 return waterfraction;36 else37 return Dret;38 }39 else{40 if(dt*Dret>waterfraction)41 return waterfraction;42 else43 return dt*Dret;44 }32 /*check if dt*Dret>waterfraction. If so, drain whole waterfraction*/ 33 if(dt==0.){ 34 if(Dret>waterfraction) 35 return waterfraction; 36 else 37 return Dret; 38 } 39 else{ 40 if(dt*Dret>waterfraction) 41 return waterfraction; 42 else 43 return dt*Dret; 44 } 45 45 }
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/trac/issm/chrome/common/trac_banner.png)