Changeset 25374


Ignore:
Timestamp:
08/11/20 17:32:58 (5 years ago)
Author:
schlegel
Message:

CHG: were not testing melt conditions for pdd, or changing of pdd factors before. Now added for SMBpdd and SMBd18opdd

Location:
issm/trunk-jpl
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/analyses/SmbAnalysis.cpp

    r25317 r25374  
    7878                        iomodel->FindConstant(&isdelta18o,"md.smb.isdelta18o");
    7979                        iomodel->FindConstant(&ismungsm,"md.smb.ismungsm");
     80                        iomodel->FindConstant(&issetpddfac,"md.smb.issetpddfac");
    8081                        iomodel->FetchDataToInput(inputs2,elements,"md.thermal.spctemperature",ThermalSpctemperatureEnum);
    8182                        iomodel->FetchDataToInput(inputs2,elements,"md.smb.s0p",SmbS0pEnum);
     
    8990                                iomodel->FetchDataToDatasetInput(inputs2,elements,"md.smb.precipitation",SmbPrecipitationEnum);
    9091                                iomodel->FetchDataToDatasetInput(inputs2,elements,"md.smb.monthlytemperatures",SmbMonthlytemperaturesEnum);
     92                        }
     93                        if(issetpddfac){
     94                                iomodel->FetchDataToInput(inputs2,elements,"md.smb.pddfac_snow",SmbPddfacSnowEnum,-1.);
     95                                iomodel->FetchDataToInput(inputs2,elements,"md.smb.pddfac_ice",SmbPddfacIceEnum,-1.);
    9196                        }
    9297                        break;
  • issm/trunk-jpl/src/m/classes/SMBd18opdd.m

    r24806 r25374  
    4747                        if(self.istemperaturescaled==0),self.temperatures_reconstructed=project3d(md,'vector',self.temperatures_reconstructed,'type','node');end
    4848                        if(self.isprecipscaled==0),self.precipitations_reconstructed=project3d(md,'vector',self.precipitations_reconstructed,'type','node');end
    49                         if(self.issetpddfac), self.pddfac_snow=project3d(md,'vector',self.pddfac_snow,'type','node');end
    50                         if(self.issetpddfac), self.pddfac_ice=project3d(md,'vector',self.pddfac_ice,'type','node');end
    5149                        self.s0p=project3d(md,'vector',self.s0p,'type','node');
    5250                        self.s0t=project3d(md,'vector',self.s0t,'type','node');
     
    124122                        disp(sprintf('\n   PDD and deltaO18 parameters:'));
    125123                        fielddisplay(self,'isd18opd','is delta18o parametrisation from present day temperature and precipitation activated (0 or 1, default is 0)');
    126                         fielddisplay(self,'issetpddfac','is user passing in defined pdd factors at each vertex (0 or 1, default is 0)');
     124                        fielddisplay(self,'issetpddfac','is user passing in defined pdd factors (0 or 1, default is 0)');
    127125                        fielddisplay(self,'desfac','desertification elevation factor (between 0 and 1, default is 0.5) [m]');
    128126                        fielddisplay(self,'s0p','should be set to elevation from precip source (between 0 and a few 1000s m, default is 0) [m]');
     
    145143                        end
    146144                        if(self.issetpddfac==1)
    147                                 fielddisplay(self,'pddfac_snow','Pdd factor for snow, at each vertex [mm ice equiv/day/degree C]');
    148                                 fielddisplay(self,'pddfac_ice','Pdd factor for ice, at each vertex [mm ice equiv/day/degree C]');
     145                                fielddisplay(self,'pddfac_snow','Pdd factor for snow for all the domain [mm ice equiv/day/degree C]');
     146                                fielddisplay(self,'pddfac_ice','Pdd factor for ice for all the domain [mm ice equiv/day/degree C]');
    149147                        end
    150148                        fielddisplay(self, 'steps_per_step', 'number of smb steps per time step');
  • issm/trunk-jpl/src/m/classes/SMBd18opdd.py

    r24793 r25374  
    4848
    4949        string = "%s\n%s" % (string, fielddisplay(self, 'isd18opd', 'is delta18o parametrisation from present day temperature and precipitation activated (0 or 1, default is 0)'))
    50         string = "%s\n%s" % (string, fielddisplay(self, 'issetpddfac', 'is user passing in defined pdd factors at each vertex (0 or 1, default is 0)'))
     50        string = "%s\n%s" % (string, fielddisplay(self, 'issetpddfac', 'is user passing in defined pdd factors (0 or 1, default is 0)'))
    5151        string = "%s\n%s" % (string, fielddisplay(self, 'desfac', 'desertification elevation factor (between 0 and 1, default is 0.5) [m]'))
    5252        string = "%s\n%s" % (string, fielddisplay(self, 's0p', 'should be set to elevation from precip source (between 0 and a few 1000s m, default is 0) [m]'))
     
    7070
    7171        if self.issetpddfac == 1:
    72             string = "%s\n%s" % (string, fielddisplay(self, 'pddfac_snow', 'Pdd factor for snow, at each vertex [mm ice equiv/day/degree C]'))
    73             string = "%s\n%s" % (string, fielddisplay(self, 'pddfac_ice', 'Pdd factor for ice, at each vertex [mm ice equiv/day/degree C]'))
     72            string = "%s\n%s" % (string, fielddisplay(self, 'pddfac_snow', 'Pdd factor for snow for all the domain [mm ice equiv/day/degree C]'))
     73            string = "%s\n%s" % (string, fielddisplay(self, 'pddfac_ice', 'Pdd factor for ice for all the domain [mm ice equiv/day/degree C]'))
    7474        string = "%s\n%s" % (string, fielddisplay(self, 'steps_per_step', 'number of smb steps per time step'))
    7575        string = "%s\n%s" % (string, fielddisplay(self, 'averaging', 'averaging methods from short to long steps'))
     
    9494        if self.isd18opd:
    9595            self.precipitations_presentday = project3d(md, 'vector', self.precipitations_presentday, 'type', 'node')
    96         if self.issetpddfac:
    97             self.pddfac_snow = project3d(md, 'vector', self.pddfac_snow, 'type', 'node')
    98         if self.issetpddfac:
    99             self.pddfac_ice = project3d(md, 'vector', self.pddfac_ice, 'type', 'node')
    10096        self.s0p = project3d(md, 'vector', self.s0p, 'type', 'node')
    10197        self.s0t = project3d(md, 'vector', self.s0t, 'type', 'node')
  • issm/trunk-jpl/src/m/classes/SMBpdd.m

    r24806 r25374  
    2525                precipitations_presentday = NaN;
    2626                precipitations_lgm        = NaN;
     27                pddfac_snow               = NaN;
     28                pddfac_ice                = NaN;
    2729                steps_per_step            = 1;
    2830                averaging                 = 0;
     
    7577                  self.rlaps      = 6.5;
    7678                  self.rlapslgm   = 6.5;
     79                  self.issetpddfac = 0;
    7780
    7881                end % }}}
     
    106109                                        md = checkfield(md,'fieldname','smb.sealev','NaN',1,'Inf',1,'size',[2,NaN],'singletimeseries',1);
    107110                                end
     111                                if(self.issetpddfac==1)
     112                                        md = checkfield(md,'fieldname','smb.pddfac_snow','>=',0,'NaN',1,'Inf',1);
     113                                        md = checkfield(md,'fieldname','smb.pddfac_ice','>=',0,'NaN',1,'Inf',1);
     114                                end
    108115                        end
    109116                        md = checkfield(md,'fieldname','smb.steps_per_step','>=',1,'numel',[1]);
     
    118125                        fielddisplay(self,'isdelta18o','is temperature and precipitation delta18o parametrisation activated (0 or 1, default is 0)');
    119126                        fielddisplay(self,'ismungsm','is temperature and precipitation mungsm parametrisation activated (0 or 1, default is 0)');
     127                        fielddisplay(self,'issetpddfac','is user passing in defined pdd factors (0 or 1, default is 0)');
    120128                        fielddisplay(self,'desfac','desertification elevation factor (between 0 and 1, default is 0.5) [m]');
    121129                        fielddisplay(self,'s0p','should be set to elevation from precip source (between 0 and a few 1000s m, default is 0) [m]');
     
    143151                                fielddisplay(self,'Tdiff','time interpolation parameter for temperature, 1D(year), required if mungsm is activated');
    144152                                fielddisplay(self,'sealev','sea level [m], 1D(year), required if mungsm is activated');
     153                        end
     154                        if(self.issetpddfac==1)
     155                                fielddisplay(self,'pddfac_snow','Pdd factor for snow for all the domain [mm ice equiv/day/degree C]');
     156                                fielddisplay(self,'pddfac_ice','Pdd factor for ice for all the domain [mm ice equiv/day/degree C]');
    145157                        end
    146158                        fielddisplay(self, 'steps_per_step', 'number of smb steps per time step');
     
    190202                                WriteData(fid,prefix,'object',self,'class','smb','fieldname','sealev','format','DoubleMat','mattype',1,'timeserieslength',2,'yts',md.constants.yts);
    191203                        end
     204                        if self.issetpddfac==1
     205                                WriteData(fid,prefix,'object',self,'class','smb','fieldname','pddfac_snow','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
     206                                WriteData(fid,prefix,'object',self,'class','smb','fieldname','pddfac_ice','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts);
     207                        end
    192208
    193209                        %process requested outputs
  • issm/trunk-jpl/src/m/classes/SMBpdd.py

    r24793 r25374  
    3434        self.precipitations_presentday = float('NaN')
    3535        self.precipitations_lgm = float('NaN')
     36        self.pddfac_snow = float('NaN')
     37        self.pddfac_ice = float('NaN')
    3638        self.steps_per_step = 1
    3739        self.averaging = 0
     
    4749        string = "%s\n%s" % (string, fielddisplay(self, 'isdelta18o', 'is temperature and precipitation delta18o parametrisation activated (0 or 1, default is 0)'))
    4850        string = "%s\n%s" % (string, fielddisplay(self, 'ismungsm', 'is temperature and precipitation mungsm parametrisation activated (0 or 1, default is 0)'))
     51        string = "%s\n%s" % (string, fielddisplay(self, 'issetpddfac', 'is user passing in defined pdd factors (0 or 1, default is 0)'))
    4952        string = "%s\n%s" % (string, fielddisplay(self, 'desfac', 'desertification elevation factor (between 0 and 1, default is 0.5) [m]'))
    5053        string = "%s\n%s" % (string, fielddisplay(self, 's0p', 'should be set to elevation from precip source (between 0 and a few 1000s m, default is 0) [m]'))
     
    7376                string = "%s\n%s" % (string, fielddisplay(self, 'Tdiff', 'time interpolation parameter for temperature, 1D(year), required if mungsm is activated'))
    7477                string = "%s\n%s" % (string, fielddisplay(self, 'sealev', 'sea level [m], 1D(year), required if mungsm is activated'))
    75 
     78               
    7679        string = "%s\n%s" % (string, fielddisplay(self, 'steps_per_step', 'number of smb steps per time step'))
    7780        string = "%s\n%s" % (string, fielddisplay(self, 'averaging', 'averaging methods from short to long steps'))
     
    101104            self.precipitations_presentday = project3d(md, 'vector', self.precipitations_presentday, 'type', 'node')
    102105            self.precipitations_lgm = project3d(md, 'vector', self.precipitations_lgm, 'type', 'node')
    103 
     106       
     107        if self.issetpddfac:
     108            self.pddfac_snow = project3d(md, 'vector', self.pddfac_snow, 'type', 'node')
     109        if self.issetpddfac:
     110            self.pddfac_ice = project3d(md, 'vector', self.pddfac_ice, 'type', 'node')
    104111        self.s0p = project3d(md, 'vector', self.s0p, 'type', 'node')
    105112        self.s0t = project3d(md, 'vector', self.s0t, 'type', 'node')
     
    130137        self.rlaps = 6.5
    131138        self.rlapslgm = 6.5
     139        self.issetpddfac = 0
    132140
    133141        return self
     
    164172                md = checkfield(md, 'fieldname', 'smb.sealev', 'NaN', 1, 'Inf', 1, 'size', [2, np.nan], 'singletimeseries', 1)
    165173
     174            if self.issetpddfac:
     175                md = checkfield(md, 'fieldname', 'smb.pddfac_snow', '>=', 0, 'NaN', 1, 'Inf', 1)
     176                md = checkfield(md, 'fieldname', 'smb.pddfac_ice', '>=', 0, 'NaN', 1, 'Inf', 1)
     177
    166178        md = checkfield(md, 'fieldname', 'smb.steps_per_step', '>=', 1, 'numel', [1])
    167179        md = checkfield(md, 'fieldname', 'smb.averaging', 'numel', [1], 'values', [0, 1, 2])
     
    206218            WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'Tdiff', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', 2, 'yts', md.constants.yts)
    207219            WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'sealev', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', 2, 'yts', md.constants.yts)
     220       
     221        if self.issetpddfac:
     222            WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'pddfac_snow', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
     223            WriteData(fid, prefix, 'object', self, 'class', 'smb', 'fieldname', 'pddfac_ice', 'format', 'DoubleMat', 'mattype', 1, 'timeserieslength', md.mesh.numberofvertices + 1, 'yts', md.constants.yts)
    208224
    209225        #process requested outputs
  • issm/trunk-jpl/test/NightlyRun/test237.m

    r24584 r25374  
    1818% creating Present day and lgm temperatures
    1919% Same temperature over the all region:
    20 tmonth(1:12)=238.15+20.;
     20curve=sin(0:pi/11:pi);
     21tmonth(1:12)=238.15+20.0+20.0*curve;
    2122for imonth=0:11
    2223    md.smb.temperatures_presentday(1:md.mesh.numberofvertices,imonth+1)=tmonth(imonth+1);
     
    4849    md.smb.sealev(2,iint)=(iint-1)*20;
    4950end
     51
     52md.smb.issetpddfac=1;
     53md.smb.pddfac_snow=2;
     54md.smb.pddfac_ice=2;
    5055
    5156md=extrude(md,3,1);
  • issm/trunk-jpl/test/NightlyRun/test239.m

    r24584 r25374  
    1919% creating Present day  temperatures
    2020% Same temperature over the all region:
    21 tmonth(1:12)=238.15+20.;
     21curve=sin(0:pi/11:pi);
     22tmonth(1:12)=238.15+20.0+20.0*curve;
    2223for imonth=0:11
    2324    md.smb.temperatures_presentday(1:md.mesh.numberofvertices,imonth+1)=tmonth(imonth+1);
     
    4041md.settings.output_frequency=1;
    4142md.timestepping.final_time=2;
     43
     44md.smb.issetpddfac = 1;
     45md.smb.pddfac_snow = 3;
     46md.smb.pddfac_ice = 3;
    4247
    4348md=setflowequation(md,'SSA','all');
  • issm/trunk-jpl/test/NightlyRun/test247.m

    r24624 r25374  
    1919% creating Present day  temperatures
    2020% Same temperature over the all region:
    21 tmonth(1:12)=238.15+20.;
     21curve=sin(0:pi/11:pi);
     22tmonth(1:12)=238.15+20.0+20.0*curve;
    2223for imonth=0:11
    2324        md.smb.temperatures_presentday(1:md.mesh.numberofvertices,imonth+1)=tmonth(imonth+1);
     
    5657md.smb.s0t = (max(md.geometry.surface,0));
    5758md.smb.issetpddfac = 1;
    58 md.smb.pddfac_snow =4.3;
    59 md.smb.pddfac_ice = 8.3;
     59md.smb.pddfac_snow = 8;
     60md.smb.pddfac_ice = 10;
    6061
    6162md=extrude(md,5,1.2);
Note: See TracChangeset for help on using the changeset viewer.