Changeset 14825


Ignore:
Timestamp:
04/30/13 19:27:50 (12 years ago)
Author:
Mathieu Morlighem
Message:

CHG: added gia to python model and fixed consistency of gia

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

Legend:

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

    r14813 r14825  
    3232                        %be sure that if we are running a prognostic ice flow model coupled with gia, that thickness forcings
    3333                        %are not provided into the future.
    34                         if md.transient.isprognostic,
    35                                 thickness=md.geometry.thickness;
     34                        if solution==TransientSolutionEnum() & md.transient.isprognostic & md.transient.isgia,
    3635                                %figure out if thickness is a transient forcing:
    37                                 s=size(thickness);
    38                                 if s(1)>=md.mesh.numberofvertices,
     36                                if size(md.geometry.thickness,1)==md.mesh.numberofvertices+1,
    3937                                        %recover the furthest time "in time":
    40                                         time=thickness(end,end);
    41                                         if(time~=md.timestepping.start_time),
    42                                                 error('if isprognostic is on, transient thickness forcing for the gia model should not be provided in the future. Synchronize your start_time to correspond to the most recent transient thickness forcing timestep');
     38                                        if(thickness(end,end)~=md.timestepping.start_time),
     39                                                md = checkmessage(md,'if isprognostic is on, transient thickness forcing'...
     40                                                        ' for the gia model should not be provided in the future.'...
     41                                                        ' Synchronize your start_time to correspond to the most recent transient'...
     42                                                        ' thickness forcing timestep');
    4343                                        end
    4444                                end
  • issm/trunk-jpl/src/m/classes/gia.py

    r14824 r14825  
    4949                #be sure that if we are running a prognostic ice flow model coupled with gia, that thickness forcings
    5050                #are not provided into the future.
    51                 if md.transient.isprognostic:
    52                         thickness=md.geometry.thickness
    53                         #figure out if thickness is a transient forcing:
    54                         s=size(thickness)
    55                         if s(1)>=md.mesh.numberofvertices:
    56                                 #recover the furthest time "in time":
    57                                 time=thickness(end,end)
    58                                 if not time==md.timestepping.start_time:
    59                                         raise RunetimeError("if isprognostic is on, transient thickness forcing for the gia model should not be provided in the future. Synchronize your start_time to correspond to the most recent transient thickness forcing timestep")
    6051
    6152                return md
  • issm/trunk-jpl/src/m/classes/model/model.py

    r14621 r14825  
    2828from steadystate import steadystate
    2929from transient import transient
     30from gia import gia
    3031from autodiff import autodiff
    3132from flaim import flaim
     
    5051class model(object):
    5152        #properties
    52         def __init__(self):
    53                 # {{{ Properties
     53        def __init__(self):#{{{
    5454                self.mesh             = mesh()
    5555                self.mask             = mask()
     
    7979                self.steadystate      = steadystate()
    8080                self.transient        = transient()
     81                self.gia              = gia()
    8182
    8283                self.autodiff         = autodiff()
     
    9091                self.private          = private()
    9192                #}}}
    92 
    9393        def properties(self):    # {{{
    9494                # ordered list of properties since vars(self) is random
     
    127127                        'private']
    128128        # }}}
    129 
    130         def __repr__(obj):
    131                 # {{{ Display
    132 
     129        def __repr__(obj): #{{{
    133130                #print "Here %s the number: %d" % ("is", 37)
    134131                string="%19s: %-22s -- %s" % ("mesh","[%s,%s]" % ("1x1",obj.mesh.__class__.__name__),"mesh properties")
     
    166163                return string
    167164        # }}}
    168 
    169165        def checkmessage(self,string):    # {{{
    170166                print ("model not consistent: %s" % string)
     
    172168                return self
    173169        # }}}
    174 
    175170        def extract(md,area):    # {{{
    176171                """
     
    446441                return md2
    447442        # }}}
    448 
    449443        def extrude(md,*args):    # {{{
    450444                """
     
    654648                md.geometry.surface=project3d(md,'vector',md.geometry.surface,'type','node')
    655649                md.geometry.thickness=project3d(md,'vector',md.geometry.thickness,'type','node')
     650                md.gia.lithosphere_thickness=project3d(md,'vector',md.gia.lithosphere_thickness,'type','node')
    656651                md.geometry.hydrostatic_ratio=project3d(md,'vector',md.geometry.hydrostatic_ratio,'type','node')
    657652                md.geometry.bed=project3d(md,'vector',md.geometry.bed,'type','node')
     
    694689                return md
    695690                # }}}
    696 
Note: See TracChangeset for help on using the changeset viewer.