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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified 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
Note: See TracChangeset for help on using the changeset viewer.