Changeset 12917


Ignore:
Timestamp:
08/06/12 16:36:15 (13 years ago)
Author:
cborstad
Message:

CHG: added surface and basal temp enums, updated function to calculate depth-average ice shelf temp

Location:
issm/branches/trunk-jpl-damage/src
Files:
2 added
8 edited

Legend:

Unmodified
Added
Removed
  • issm/branches/trunk-jpl-damage/src/c/EnumDefinitions/EnumDefinitions.h

    r12878 r12917  
    362362        TemperatureOldEnum,
    363363        TemperaturePicardEnum,
     364        TemperatureSurfaceEnum,
     365        TemperatureBasalEnum,
    364366        ThicknessAbsMisfitEnum,
    365367        TypeEnum,
  • issm/branches/trunk-jpl-damage/src/c/modules/EnumToStringx/EnumToStringx.cpp

    r12878 r12917  
    353353                case TemperatureOldEnum : return "TemperatureOld";
    354354                case TemperaturePicardEnum : return "TemperaturePicard";
     355                case TemperatureSurfaceEnum : return "TemperatureSurface";
     356                case TemperatureBasalEnum : return "TemperatureBasal";
    355357                case ThicknessAbsMisfitEnum : return "ThicknessAbsMisfit";
    356358                case TypeEnum : return "Type";
  • issm/branches/trunk-jpl-damage/src/c/modules/StringToEnumx/StringToEnumx.cpp

    r12878 r12917  
    360360              else if (strcmp(name,"TemperatureOld")==0) return TemperatureOldEnum;
    361361              else if (strcmp(name,"TemperaturePicard")==0) return TemperaturePicardEnum;
     362              else if (strcmp(name,"TemperatureSurface")==0) return TemperatureSurfaceEnum;
     363              else if (strcmp(name,"TemperatureBasal")==0) return TemperatureBasalEnum;
    362364              else if (strcmp(name,"ThicknessAbsMisfit")==0) return ThicknessAbsMisfitEnum;
    363365              else if (strcmp(name,"Type")==0) return TypeEnum;
     
    382384              else if (strcmp(name,"ThicknessAbsGradient")==0) return ThicknessAbsGradientEnum;
    383385              else if (strcmp(name,"StepResponses")==0) return StepResponsesEnum;
    384               else if (strcmp(name,"IntMatParam")==0) return IntMatParamEnum;
    385               else if (strcmp(name,"RheologyBbarAbsGradient")==0) return RheologyBbarAbsGradientEnum;
    386386         else stage=4;
    387387   }
    388388   if(stage==4){
    389               if (strcmp(name,"DragCoefficientAbsGradient")==0) return DragCoefficientAbsGradientEnum;
     389              if (strcmp(name,"IntMatParam")==0) return IntMatParamEnum;
     390              else if (strcmp(name,"RheologyBbarAbsGradient")==0) return RheologyBbarAbsGradientEnum;
     391              else if (strcmp(name,"DragCoefficientAbsGradient")==0) return DragCoefficientAbsGradientEnum;
    390392              else if (strcmp(name,"TransientInput")==0) return TransientInputEnum;
    391393              else if (strcmp(name,"Outputfilename")==0) return OutputfilenameEnum;
  • issm/branches/trunk-jpl-damage/src/m/classes/initialization.m

    r12878 r12917  
    1212                pressure      = NaN;
    1313                temperature   = NaN;
     14                surfacetemp   = NaN;
     15                basaltemp     = NaN;
    1416                watercolumn   = NaN;
    1517                waterfraction = NaN;
     
    6870                        fielddisplay(obj,'pressure','pressure field');
    6971                        fielddisplay(obj,'temperature','temperature in Kelvins');
     72                        fielddisplay(obj,'surfacetemp','surface temperature in Kelvins');
     73                        fielddisplay(obj,'basaltemp','basal temperature in Kelvins');
    7074                        fielddisplay(obj,'watercolumn','thickness of subglacial water');
    7175                        fielddisplay(obj,'waterfraction','fraction of water in the ice');
     
    7882                        WriteData(fid,'data',obj.pressure,'format','DoubleMat','mattype',1,'enum',PressureEnum);
    7983                        WriteData(fid,'data',obj.temperature,'format','DoubleMat','mattype',1,'enum',TemperatureEnum);
     84                        WriteData(fid,'data',obj.surfacetemp,'format','DoubleMat','mattype',1,'enum',TemperatureSurfaceEnum);
     85                        WriteData(fid,'data',obj.basaltemp,'format','DoubleMat','mattype',1,'enum',TemperatureBasalEnum);
    8086                        WriteData(fid,'data',obj.watercolumn,'format','DoubleMat','mattype',1,'enum',WatercolumnEnum);
    8187                        WriteData(fid,'data',obj.waterfraction,'format','DoubleMat','mattype',1,'enum',WaterfractionEnum);
  • issm/branches/trunk-jpl-damage/src/m/enum/EnumDefinitions.py

    r12878 r12917  
    33673367        return StringToEnum('TemperaturePicard')
    33683368
     3369def TemperatureSurfaceEnum():
     3370        """
     3371        TEMPERATURESURFACEENUM - Enum of TemperatureSurface
     3372
     3373           Usage:
     3374              macro=TemperatureSurfaceEnum()
     3375        """
     3376
     3377        return StringToEnum('TemperatureSurface')
     3378
     3379def TemperatureBasalEnum():
     3380        """
     3381        TEMPERATUREBASALENUM - Enum of TemperatureBasal
     3382
     3383           Usage:
     3384              macro=TemperatureBasalEnum()
     3385        """
     3386
     3387        return StringToEnum('TemperatureBasal')
     3388
    33693389def ThicknessAbsMisfitEnum():
    33703390        """
     
    45954615        """
    45964616
    4597         return 458
    4598 
     4617        return 460
     4618
  • issm/branches/trunk-jpl-damage/src/m/enum/MaximumNumberOfEnums.m

    r12878 r12917  
    99%      macro=MaximumNumberOfEnums()
    1010
    11 macro=458;
     11macro=460;
  • issm/branches/trunk-jpl-damage/src/m/model/plot/applyoptions.m

    r12878 r12917  
    121121c = getcolormap(options);
    122122h = colormap(c);
    123 
    124                 c = hsv(64);
    125                 c = rgb2hsv(c);
    126                 c(:,2) = max(min( abs(c(:,1)-0.5)/0.5 ,1),0);
    127                 c(1:32,1)   = 0.7;
    128                 c(33:end,1) = 1;
    129                 c = hsv2rgb(c);
    130 
    131         elseif strcmpi(cname,'Rignot'),
    132                 c = hsv;
    133 
    134                 %adjust saturation
    135                 c = rgb2hsv(c);
    136                 alpha=getfieldvalue(options,'alpha',1);
    137                 c(:,2) = max(min( (0.1+c(:,1)).^(1/alpha) ,1),0);
    138                 c = hsv2rgb(c);
    139 
    140         elseif strcmpi(cname,'Rignot2'),
    141                 c = hsv;
    142 
    143                 %adjust saturation
    144                 c = rgb2hsv(c);
    145                 alpha=getfieldvalue(options,'alpha',1);
    146                 c(:,2) = max(min( (0.1+c(:,1)).^(1/alpha) ,1),0);
    147                 c = hsv2rgb(c);
    148 
    149                 c=flipud(c);
    150 
    151         elseif strcmpi(cname,'damage'),
    152                 c=hsv(64);
    153                 c(:,3)=1;
    154                 a=1:-(1/35):0.1;
    155                 c(1:32,2)=a;
    156                 c(33:end,2)=fliplr(a);
    157                 c(1:32,1)=2/3;
    158                 c(33:end,1)=0.07;
    159                 c=hsv2rgb(c);
    160 
    161         else
    162                 c = cname;
    163         end
    164         h=colormap(c);
    165 else
    166         h=colormap(jet(60));
    167 end
    168123
    169124%wrapping
  • issm/branches/trunk-jpl-damage/src/m/model/steadystateiceshelftemp.m

    r12563 r12917  
    88%
    99%        In addition to supplying md, the surface and basal temperatures of the ice shelf must
    10 %        be supplied to the function IN DEGREES CELSIUS.  These temperatures can be supplied at
    11 %        each vertex of the mesh or as a single constant value to be used at every vertex. 
     10%        be supplied in degrees Kelvin.
    1211%
    1312%        The model md must also contain the fields:
     
    1615
    1716%   Usage:
    18 %      temperature=steadystateiceshelftemp(md)
     17%      temperature=steadystateiceshelftemp(md,surfacetemp,basaltemp)
    1918
    2019if (length(md.geometry.thickness)~=md.mesh.numberofvertices)
     
    2322
    2423%surface and basal temperatures in degrees C
    25 if (length(surfacetemp)==md.mesh.numberofvertices)
    26         Ts=surfacetemp;
    27 elseif (length(surfacetemp)==1)
    28         Ts=surfacetemp*ones(md.mesh.numberofvertices,1);
    29 else
    30         error(['steadystateiceshelftemp error message: surfacetemp should have a length of 1 or ' num2str(md.mesh.numberofvertices)])
     24if (length(surfacetemp)~=md.mesh.numberofvertices)
     25        error(['steadystateiceshelftemp error message: surfacetemp should have a length of ' num2str(md.mesh.numberofvertices)])
    3126end
    3227
    33 if (length(basaltemp)==md.mesh.numberofvertices)
    34         Tb=basaltemp;
    35 elseif (length(basaltemp)==1)
    36         Tb=basaltemp*ones(md.mesh.numberofvertices,1);
    37 else
    38         error(['steadystateiceshelftemp error message: basaltemp should have a length of 1 or ' num2str(md.mesh.numberofvertices)])
     28if (length(basaltemp)~=md.mesh.numberofvertices)
     29        error(['steadystateiceshelftemp error message: basaltemp should have a length of ' num2str(md.mesh.numberofvertices)])
    3930end
     31
     32% Convert temps to Celsius for Holland and Jenkins equation
     33Ts=-273+surfacetemp;
     34Tb=-273+basaltemp;
    4035
    4136Hi=md.geometry.thickness;
    4237ki=1.14e-6*md.constants.yts; % ice shelf thermal diffusivity from Holland and Jenkins (1999) converted to m^2/yr
    4338
    44 %vertical velocity of ice shelf, positive for melting (thus minus sign)
    45 wi=-md.materials.rho_water/md.materials.rho_ice.*md.basalforcings.melting_rate;
     39%vertical velocity of ice shelf, calculated from melting rate
     40wi=md.materials.rho_water/md.materials.rho_ice.*md.basalforcings.melting_rate;
    4641
    4742%temperature profile is linear if melting rate is zero, depth-averaged temp is simple average in this case
    48 md.initialization.temperature=(Ts+Tb)/2;  % where wi~=0
     43temperature=(Ts+Tb)/2;  % where wi~=0
    4944
    5045pos=find(abs(wi)>=1e-4); % to avoid division by zero
    5146
    52 %calculate depth-averaged temperature
     47%calculate depth-averaged temperature (in Celsius)
    5348temperature(pos)=-( (Tb(pos)-Ts(pos))*ki./wi(pos) + Hi(pos).*Tb(pos) - (Hi(pos).*Ts(pos) + (Tb(pos)-Ts(pos))*ki./wi(pos)).*exp(Hi(pos).*wi(pos)/ki) )./( Hi(pos).*(exp(Hi(pos).*wi(pos)/ki)-1));
    5449
Note: See TracChangeset for help on using the changeset viewer.