source: issm/oecreview/Archive/24307-24683/ISSM-24550-24551.diff@ 24684

Last change on this file since 24684 was 24684, checked in by Mathieu Morlighem, 5 years ago

CHG: added new review

File size: 1.8 KB
  • ../trunk-jpl/src/c/classes/Loads/Friction.cpp

     
    378378         */
    379379
    380380        /*Intermediaries: */
    381         IssmDouble  T,Tpmp,deltaT,deltaTref,pressure;
    382         IssmDouble  alpha2,time,gamma;
     381        IssmDouble  T,Tpmp,deltaT,deltaTref,pressure,diff,drag_coefficient;
     382        IssmDouble  alpha2,time,gamma,ref,alp_new,alphascaled;
    383383        const IssmDouble yts = 365*24*3600.;
    384384
    385385        /*Get viscous part*/
     
    387387
    388388        /*Get delta Refs*/
    389389        element->GetInputValue(&deltaTref,gauss,FrictionPressureAdjustedTemperatureEnum);
     390        element->GetInputValue(&drag_coefficient, gauss,FrictionCoefficientEnum);
     391        /*New*/
     392        /*element->GetInputValue(&deltaTrefsfc,gauss,FrictionSurfaceTemperatureEnum);
     393         *    element->GetInputValue(&Tpdd,gauss,TemperaturePDDEnum);
     394         *       */
    390395
    391396        /*Compute delta T*/
    392397        element->GetInputValue(&T,gauss,TemperatureEnum);
     
    394399        Tpmp = element->TMeltingPoint(pressure);
    395400        deltaT = T-Tpmp;
    396401
     402
    397403        /*Compute gamma*/
    398404        element->parameters->FindParam(&time,TimeEnum);
    399405        element->parameters->FindParam(&gamma,FrictionGammaEnum);
    400         //if(time<25e3*yts){
    401         //      gamma = 10.;
    402         //}
    403         //else{
    404         //      gamma = 5.;
    405         //}
    406         //gamma = 5.;
    407406
    408         /*Compute scaling parameter*/
    409         alpha2 = alpha2 * exp((deltaTref - deltaT)/(2*gamma));
     407        ref = exp(deltaTref/gamma);
     408        alp_new = ref/exp(deltaT/gamma);
    410409
     410        alphascaled = sqrt(alp_new)*drag_coefficient;
     411        if (alphascaled > 300) alp_new = (300/drag_coefficient)*(300/drag_coefficient);
     412
     413        alp_new=alp_new*alpha2;
     414
    411415        /*Assign output pointers:*/
    412         *palpha2=alpha2;
     416        *palpha2=alp_new;
    413417}/*}}}*/
    414418void Friction::GetAlpha2Viscous(IssmDouble* palpha2, Gauss* gauss){/*{{{*/
    415419
Note: See TracBrowser for help on using the repository browser.