Changeset 24195


Ignore:
Timestamp:
10/02/19 14:37:57 (6 years ago)
Author:
schlegel
Message:

CHG: clean up some GEMB logical statements to tie down tols

File:
1 edited

Legend:

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

    r24191 r24195  
    123123        IssmDouble F = 0.0, H=0.0, G=0.0;
    124124        const IssmDouble E = 0.09;        //[mm d-1] model time growth constant E
    125         // convert T from K to ºC
     125        // convert T from K to degC
    126126        T = T - CtoK;
    127127
     
    219219
    220220        //set maximum water content by mass to 9 percent (Brun, 1980)
    221         for(int i=0;i<m;i++)if(lwc[i]>9.0-Wtol) lwc[i]=9.0;
     221        for(int i=0;i<m;i++)if(lwc[i]>9.0+Wtol) lwc[i]=9.0;
    222222
    223223        /* Calculate temperature gradiant across grid cells
     
    280280                                gsp[i] += D;
    281281                        }
    282                                  // dendricity and sphericity can not be > 1 or < 0
    283          if (gdn[i]<0.0+Wtol)gdn[i]=0.0;
    284          if (gsp[i]<0.0+Wtol)gsp[i]=0.0;
    285          if (gdn[i]>1.0-Wtol)gdn[i]=1.0;
    286          if (gsp[i]>1.0-Wtol)gsp[i]=1.0;
     282                        // dendricity and sphericity can not be > 1 or < 0
     283         if (gdn[i]<0.0+Gdntol)gdn[i]=0.0;
     284         if (gsp[i]<0.0+Gdntol)gsp[i]=0.0;
     285         if (gdn[i]>1.0-Gdntol)gdn[i]=1.0;
     286         if (gsp[i]>1.0-Gdntol)gsp[i]=1.0;
    287287
    288288         // determine new grain size (mm)
     
    304304                                IssmDouble C = (-2e8 * exp(-6e3 / T[i]) * dt) * pow(dT[i],.4);
    305305                                gsp[i] +=C;
    306                                 if (gsp[i]<0.0+Wtol)gsp[i]=0.0;
     306                                if (gsp[i]<0.0+Gdntol)gsp[i]=0.0;
    307307                        }
    308308                        /*Dry snow metamorphism (Marbouty, 1980) grouped model coefficents
     
    11721172
    11731173                case 4: // Kuipers Munneke and others (2015), Greenland
    1174                         dSnow = 481.0 + 4.834*(Tmean-CtoK+Ttol);
     1174                        dSnow = 481.0 + 4.834*(Tmean-CtoK);
    11751175                        break;
    11761176        }
Note: See TracChangeset for help on using the changeset viewer.