10 #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
13 #include "../classes.h"
60 _assert_(!xIsNan<IssmDouble>(*palpha_complement));
61 _assert_(!xIsInf<IssmDouble>(*palpha_complement));
89 alpha=(pow(q_exp-1,q_exp-1))/pow(q_exp,q_exp);
91 Chi = vmag/(pow(C_param,n)*pow(Neff,n)*As);
92 Gamma = (Chi/(1.+
alpha*pow(Chi,q_exp)));
94 if(vmag==0.) alpha_complement=0.;
95 else if(Neff==0.) alpha_complement=0.;
96 else alpha_complement=-(C_param*Neff/(n*vmag)) *
97 pow(Gamma,((1.-n)/n)) *
98 (Gamma/As - (
alpha*q_exp*pow(Chi,q_exp-1.)* Gamma * Gamma/As));
101 *palpha_complement=alpha_complement;
126 alpha_complement = alpha_complement/ (exp((T-Tpmp)/gamma)+1e-3);
129 *palpha_complement=alpha_complement;
157 if(vmag==0. && (s-1.)<0.) alpha_complement=0.;
158 else alpha_complement=pow(Neff,r)*pow(vmag,(s-1));
161 *palpha_complement=alpha_complement;
204 _error_(
"Friction law "<< this->
law <<
" not supported");
208 _assert_(!xIsNan<IssmDouble>(*palpha2));
209 _assert_(!xIsInf<IssmDouble>(*palpha2));
221 IssmDouble thickness,base,floatation_thickness,sealevel;
222 IssmDouble drag_coefficient,drag_coefficient_coulomb;
246 if(vmag==0. && (s-1.)<0.){
250 alpha2=drag_coefficient*drag_coefficient*pow(Neff,r)*pow(vmag,(s-1.));
253 floatation_thickness=0;
254 if(base<0) floatation_thickness=-(rho_water/rho_ice)*base;
259 alpha2_coulomb=drag_coefficient_coulomb*drag_coefficient_coulomb*rho_ice*gravity*
max(0.,thickness-floatation_thickness)/vmag;
262 if(alpha2_coulomb<alpha2) alpha2=alpha2_coulomb;
300 alpha=(pow(q_exp-1,q_exp-1))/pow(q_exp,q_exp);
302 Chi=vmag/(pow(C_param,n)*pow(Neff,n)*As);
303 Gamma=(Chi/(1. +
alpha * pow(Chi,q_exp)));
305 if(vmag==0.) alpha2=0.;
306 else if (Neff==0) alpha2=0.0;
307 else alpha2=Neff * C_param * pow(Gamma,1./n) * pow(vmag,-1);
334 pressure_ice = rho_ice*gravity*thickness;
335 pressure_water = rho_water*gravity*(head-base+sealevel);
336 Neff=pressure_ice-pressure_water;
339 alpha2=drag_coefficient*drag_coefficient*Neff;
367 alpha2 = alpha2 / (exp((T-Tpmp)/gamma)+1e-3);
381 IssmDouble T,Tpmp,deltaT,deltaTref,pressure,diff,drag_coefficient;
382 IssmDouble alpha2,time,gamma,ref,alp_new,alphascaled;
407 ref = exp(deltaTref/gamma);
408 alp_new = ref/exp(deltaT/gamma);
410 alphascaled = sqrt(alp_new)*drag_coefficient;
411 if (alphascaled > 300) alp_new = (300/drag_coefficient)*(300/drag_coefficient);
413 alp_new=alp_new*alpha2;
443 if(vmag==0. && (s-1.)<0.) alpha2=0.;
444 else alpha2=drag_coefficient*drag_coefficient*pow(Neff,r)*pow(vmag,(s-1.));
481 if(water_layer==0) Neff=gravity*rho_ice*thickness+gravity*rho_water*(base-sealevel);
482 else if(water_layer>0) Neff=gravity*rho_ice*thickness*F;
483 else _error_(
"negative water layer thickness");
489 if(vmag==0. && (s-1.)<0.) alpha2=0.;
490 else alpha2=drag_coefficient*drag_coefficient*pow(Neff,r)*pow(vmag,(s-1.));
511 if(vmag==0. && (1./m-1.)<0.) alpha2=0.;
512 else alpha2=pow(C,-1./m)*pow(vmag,(1./m-1.));
539 alpha2 = alpha2 / exp((T-Tpmp)/gamma);
571 P0 = gravity*rho_ice*thickness;
585 N = delta*P0*pow(10.,(e0/Cc)*(1.-W/Wmax));
605 IssmDouble alpha2 = tau_c/(pow(ub+1.e-10,1.-q)*pow(u0,q));
637 alpha2= (C*pow(ub,m-1.)) / pow(1.+ pow(C/(Cmax*N),1./m)*ub,m);
670 if(alpha2>f*N) alpha2 = f*N;
693 switch(coupled_flag){
701 p_ice = gravity*rho_ice*thickness;
702 p_water = rho_water*gravity*(sealevel-base);
703 Neff = p_ice - p_water;
710 p_ice = gravity*rho_ice*thickness;
712 Neff = p_ice - p_water;
722 p_ice = gravity*rho_ice*thickness;
723 p_water =
max(0.,rho_water*gravity*(sealevel-base));
724 Neff = p_ice - p_water;
732 p_ice = gravity*rho_ice*thickness;
740 p_ice = gravity*rho_ice*thickness;
748 if(Neff<Neff_limit*p_ice) Neff=Neff_limit*p_ice;
769 vmag=sqrt(vx*vx+vy*vy);
775 vmag=sqrt(vx*vx+vy*vy+vz*vz);