Changeset 14764


Ignore:
Timestamp:
04/26/13 08:08:20 (12 years ago)
Author:
Mathieu Morlighem
Message:

CHG: updated python surfaceforcings

Location:
issm/trunk-jpl/src/m/classes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified issm/trunk-jpl/src/m/classes/surfaceforcings.m

    r14742 r14764  
    4848                                md = checkfield(md,'surfaceforcings.issmbgradients','numel',[1],'values',[0 1]);
    4949                                if(obj.ispdd)
    50                                   md = checkfield(md,'surfaceforcings.desfac','<=',1);
    51                                   md = checkfield(md,'surfaceforcings.s0p','>=',0);
     50                                  md = checkfield(md,'surfaceforcings.desfac','<=',1,'numel',1);
     51                                  md = checkfield(md,'surfaceforcings.s0p','>=',0,'numel',1);
    5252                                        if(obj.isdelta18o==0)
    5353                                                md = checkfield(md,'surfaceforcings.monthlytemperatures','forcing',1,'NaN',1);
  • TabularUnified issm/trunk-jpl/src/m/classes/surfaceforcings.py

    r14751 r14764  
    2828                self.temperatures_lgm          = float('NaN')
    2929                self.precipitations_presentday = float('NaN')
     30                self.desfac                    = 0.
     31                self.s0p                       = 0.
    3032
    3133                #set defaults
     
    3941                string="%s\n%s"%(string,fielddisplay(self,'mass_balance','surface mass balance [m/yr ice eq]'))
    4042                string="%s\n%s"%(string,fielddisplay(self,'ispdd','is pdd activated (0 or 1, default is 0)'))
     43                string="%s\n%s"%(string,fielddisplay(self,'desfac','desertification elevation factor (between 0 and 1, default is 0.5) [m]'))
    4144                string="%s\n%s"%(string,fielddisplay(self,'isdelta18o','is temperature and precipitation delta18o parametrisation activated (0 or 1, default is 0)'))
     45                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]'))
    4246                string="%s\n%s"%(string,fielddisplay(self,'monthlytemperatures','monthly surface temperatures [K], required if pdd is activated and delta18o not activated'))
    4347                string="%s\n%s"%(string,fielddisplay(self,'precipitation','surface precipitation [m/yr water eq]'))
     
    6165                self.issmbgradients=0
    6266                self.isdelta18o=0
     67                self.desfac=0.5
     68                self.s0p=0.
    6369
    6470                return self
     
    7076                        md = checkfield(md,'surfaceforcings.issmbgradients','numel',[1],'values',[0,1])
    7177                        if   self.ispdd:
     78                                md = checkfield(md,'surfaceforcings.desfac','<=',1,'numel',[1]);
     79                                md = checkfield(md,'surfaceforcings.s0p','>=',0,'numel',[1]);
    7280                                if not self.isdelta18o:
    7381                                        md = checkfield(md,'surfaceforcings.monthlytemperatures','forcing',1,'NaN',1)
     
    99107
    100108                if self.ispdd:
     109                        WriteData(fid,'object',self,'fieldname','desfac','format','Double');
     110                        WriteData(fid,'object',self,'fieldname','s0p','format','Double');
    101111                        if self.isdelta18o:
    102112                                WriteData(fid,'object',self,'fieldname','temperatures_presentday','format','DoubleMat','mattype',1)
Note: See TracChangeset for help on using the changeset viewer.