Changeset 24689


Ignore:
Timestamp:
04/03/20 11:57:14 (5 years ago)
Author:
schlegel
Message:

CHG: clean up some GEMB code and climatology for last time step, update Archives

Location:
issm/trunk-jpl
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/modules/SurfaceMassBalancex/Gembx.cpp

    r24683 r24689  
    7070                                IssmDouble time0     = Ta_input_tr->GetTimeByOffset(-1);
    7171                                IssmDouble timeend   = Ta_input_tr->GetTimeByOffset(offsetend);
     72                                timeend   = ceil(timeend/dt)*dt;
    7273                                if (time>time0 & timeend>time0){
    7374                                        delta=(time-time0) - (timeend-time0)*(reCast<int,IssmDouble>((time-time0)/(timeend-time0)));
     
    111112        #ifndef _HAVE_AD_  //avoid the round operation check!
    112113        if (dgpTop != round(dgpTop)){
    113                 _error_("top grid cell structure length does not go evenly into specified top structure depth, adjust dzTop or zTop");
     114                _error_("top grid cell structure length does not go evenly into specified top structure depth, adjust dzTop or zTop\n");
    114115        }
    115116        #endif
    116117        if(dzTop < 0.05){
    117                 _printf_("initial top grid cell length (dzTop) is < 0.05 m");
     118                _printf_("initial top grid cell length (dzTop) is < 0.05 m\n");
    118119        }
    119120        gpTop=reCast<int,IssmDouble>(dgpTop);
     
    282283
    283284        // Take forward differences on left and right edges
    284         dT[0] = (T[1] - T[0])/(zGPC[1]-zGPC[0]);
    285         if(m>1) dT[m-1] = (T[m-1] - T[m-2])/(zGPC[m-1]-zGPC[m-2]);
     285        if(m>1){
     286                dT[0] = (T[1] - T[0])/(zGPC[1]-zGPC[0]);
     287                dT[m-1] = (T[m-1] - T[m-2])/(zGPC[m-1]-zGPC[m-2]);
     288        }
    286289
    287290        //Take centered differences on interior points
     
    343346                        // higher than 15 degC m-1 (Brun et al., 1992)
    344347                        //When wet-snow grains (class 6) are submitted to a
    345                         // temperature gradient higher than degC m-1, their sphericity
     348                        // temperature gradient higher than 5 degC m-1, their sphericity
    346349                        // decreases according to Equations (4). When sphericity
    347350                        // reaches 0, their size increases according to the functions
    348351                        // determined by Marbouty. (Brun et al., 1992)
    349                         if(gsp[i]>0.0+Gdntol && gsp[i]<1.0-Gdntol && (dT[i]>15.0+Ttol || (T[i]>5.0+Ttol && W[i]>0.0+Wtol)) ){
    350                                 //determine coeff0icients
     352                        if(gsp[i]>0.0+Gdntol && gsp[i]<1.0-Gdntol && (dT[i]>15.0+Ttol || (dT[i]>5.0+Ttol && W[i]>0.0+Wtol)) ){
     353                                //determine coefficients
    351354                                IssmDouble C = (-2e8 * exp(-6e3 / T[i]) * dt) * pow(dT[i],.4);
    352355                                gsp[i] +=C;
    353356                                if (gsp[i]<0.0+Gdntol)gsp[i]=0.0;
     357                                //determine new grain size (mm)
     358                                gsz[i] = 0.35 + (0.5-gsp[i])*0.1;
    354359                        }
    355360                        /*Dry snow metamorphism (Marbouty, 1980) grouped model coefficents
    356361                         *from Marbouty, 1980: Figure 9*/
    357                         else if(W[i]<=0.0+Wtol || (gsp[i]<=0.0+Gdntol && dT[i]>15.0+Ttol) || (gsp[i]<=0.0+Gdntol && T[i]>5.0+Ttol && W[i]>0.0+Wtol)){
     362                        else if(W[i]<=0.0+Wtol || (gsp[i]<=0.0+Gdntol && dT[i]>15.0+Ttol) || (gsp[i]<=0.0+Gdntol && dT[i]>5.0+Ttol && W[i]>0.0+Wtol)){
    358363                                //_printf_("Nondendritic snow metamorphism\n");
    359364                                Q = Marbouty(T[i],d[i],dT[i]);
     
    366371                                //_printf_("Nondendritic wet snow metamorphism\n");
    367372                                //wet rate of change coefficient
    368                                 IssmDouble E = 1.28e-8 + (4.22e-10 * pow(lwc[i],3.0))* (dt *dts);   // [mm^3 s^-1]
     373                                IssmDouble E = (1.28e-8 + 4.22e-10 * pow(lwc[i],3.0))* (dt *dts);   // [mm^3 s^-1]
    369374
    370375                                // calculate change in grain volume and convert to grain size
Note: See TracChangeset for help on using the changeset viewer.