Changeset 24551


Ignore:
Timestamp:
02/07/20 10:12:27 (5 years ago)
Author:
Mathieu Morlighem
Message:

CHG: integrating Josh's commit

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/classes/Loads/Friction.cpp

    r24367 r24551  
    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
     
    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*/
     
    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.;
    407 
    408         /*Compute scaling parameter*/
    409         alpha2 = alpha2 * exp((deltaTref - deltaT)/(2*gamma));
    410 
    411         /*Assign output pointers:*/
    412         *palpha2=alpha2;
     406
     407        ref = exp(deltaTref/gamma);
     408        alp_new = ref/exp(deltaT/gamma);
     409
     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
     415        /*Assign output pointers:*/
     416        *palpha2=alp_new;
    413417}/*}}}*/
    414418void Friction::GetAlpha2Viscous(IssmDouble* palpha2, Gauss* gauss){/*{{{*/
Note: See TracChangeset for help on using the changeset viewer.