Changeset 25168


Ignore:
Timestamp:
06/26/20 23:28:36 (5 years ago)
Author:
jdquinn
Message:

BUG: Corrected high-level bugs for test2010.py

Location:
issm/trunk-jpl
Files:
14 edited

Legend:

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

    r25162 r25168  
    12631263                        md.calving          = calving();
    12641264                        md.frontalforcings  = frontalforcings();
    1265                         md.gia                          = giamme();
     1265                        md.gia              = giamme();
    12661266                        md.esa              = esa();
    12671267                        md.love             = fourierlove();
     
    12701270                        md.inversion        = inversion();
    12711271                        md.qmu              = qmu();
    1272                         md.amr                            = amr();
     1272                        md.amr              = amr();
    12731273                        md.radaroverlay     = radaroverlay();
    12741274                        md.results          = struct();
  • issm/trunk-jpl/src/m/classes/results.py

    r24213 r25168  
    33
    44class results(object):
    5     """
     5    '''
    66    RESULTS class definition
    77
    88       Usage:
    99          results = results()
    10     """
     10
     11        TODO:
     12        - Modify output so that it matches that of
     13
     14            disp(md.results.<<solutionstring>>)
     15
     16        where <<solutionstring>> is one of the values from solve.m
     17    '''
    1118
    1219    def __init__(self, *args):  # {{{
  • issm/trunk-jpl/src/m/classes/slr.m

    r25066 r25168  
    3131                horiz                  = 0;
    3232                planetradius           = planetradius('earth');
    33 
    3433                requested_outputs      = {};
    3534                transitions            = {};
  • issm/trunk-jpl/src/m/classes/slr.py

    r25163 r25168  
    3636        self.rotation = 0
    3737        self.ocean_area_scaling = 0
    38         self.steric_rate = 0  #rate of ocean expansion from steric effects.
    3938        self.hydro_rate = 0  #rate of steric expansion from hydrological effects.
    4039        self.geodetic_run_frequency = 1  #how many time steps we skip before we run the geodetic part of the solver during transient
     
    6867        string = "%s\n%s" % (string, fielddisplay(self, 'angular_velocity', 'mean rotational velocity of earth [per second]'))
    6968        string = "%s\n%s" % (string, fielddisplay(self, 'ocean_area_scaling', 'correction for model representation of ocean area [default: No correction]'))
    70         string = "%s\n%s" % (string, fielddisplay(self, 'steric_rate', 'rate of steric ocean expansion [mm / yr]'))
    7169        string = "%s\n%s" % (string, fielddisplay(self, 'hydro_rate', 'rate of hydrological expansion [mm / yr]'))
    72         string = "%s\n%s" % (string, fielddisplay(self, 'Ngia', 'rate of viscous (GIA) geoid expansion (in mm / yr)'))
    73         string = "%s\n%s" % (string, fielddisplay(self, 'Ugia', 'rate of viscous (GIA) bedrock uplift (in mm / yr)'))
    7470        string = "%s\n%s" % (string, fielddisplay(self, 'geodetic', 'compute geodetic SLR? (in addition to steric?) default 0'))
    7571        string = "%s\n%s" % (string, fielddisplay(self, 'geodetic_run_frequency', 'how many time steps we skip before we run SLR solver during transient (default: 1)'))
  • issm/trunk-jpl/src/m/solve/loadresultsfromcluster.py

    r24538 r25168  
    77
    88def loadresultsfromcluster(md, runtimename=False):
    9     """
     9    '''
    1010    LOADRESULTSFROMCLUSTER - load results of solution sequence from cluster
    1111
    1212       Usage:
    1313          md = loadresultsfromcluster(md, runtimename)
    14     """
     14    '''
    1515
    1616    #retrieve cluster, to be able to call its methods
     
    7474                TryRem('.bat', filename)
    7575
    76     # remove this for bin file debugging
     76        # remove this for bin file debugging
    7777        TryRem('.bin', filename)
    7878
  • issm/trunk-jpl/src/m/solve/loadresultsfromdisk.py

    r24540 r25168  
    66
    77def loadresultsfromdisk(md, filename):
    8     """
     8    '''
    99    LOADRESULTSFROMDISK - load results of solution sequence from disk file "filename"
    1010
    1111       Usage:
    1212          md = loadresultsfromdisk(md=False,filename=False);
    13     """
     13    '''
    1414    #check number of inputs/outputs
    1515    if not md or not filename:
     
    5353
    5454        #if only one solution, extract it from list for user friendliness
    55         if len(structure) == 1 and not structure[0].SolutionType == 'TransientSolution':
     55        if len(structure) == 1 and structure[0].SolutionType != 'TransientSolution':
    5656            setattr(md.results, structure[0].SolutionType, structure[0])
    5757
  • issm/trunk-jpl/src/m/solve/parseresultsfromdisk.m

    r24240 r25168  
    4040        %Add result
    4141        if(result.step==0),
    42                 %if we have a step = 0, this is a steady state solutoin, don't expect more steps.
     42                %if we have a step = 0, this is a steady state solution, don't expect more steps.
    4343                index = 1;
    4444                check_nomoresteps=1;
  • issm/trunk-jpl/src/m/solve/parseresultsfromdisk.py

    r24260 r25168  
    3434        if check_nomoresteps:
    3535            if loadres['step'] >= 1:
    36                 raise TypeError("parsing results for a steady - state core, which incorporates transient results!")
     36                raise TypeError("parsing results for a steady-state core, which incorporates transient results!")
    3737
    3838        #Check step, increase counter if this is a new step
     
    139139
    140140def ReadData(fid, md):  # {{{
    141     """
     141    '''
    142142    READDATA -
    143143
    144144        Usage:
    145145           field = ReadData(fid, md)
    146     """
     146    '''
    147147
    148148    #read field
     
    179179            raise TypeError("cannot read data of datatype {}".format(datatype))
    180180
    181     #Process units here FIXME: this should not be done here!
     181        #Process units here FIXME: this should not be done here!
    182182        yts = md.constants.yts
    183183        if fieldname == 'BalancethicknessThickeningRate':
     
    243243            degmax = md.love.sh_nmax
    244244            nfreq = md.love.nfreq
    245     #for numpy 1.8 + only
    246     #temp_field = np.full((degmax + 1, nfreq, nlayer + 1, 6), 0.0)
     245            #for numpy 1.8 + only
     246            #temp_field = np.full((degmax + 1, nfreq, nlayer + 1, 6), 0.0)
    247247            temp_field = np.empty((degmax + 1, nfreq, nlayer + 1, 6))
    248248            temp_field.fill(0.0)
  • issm/trunk-jpl/src/m/solve/solve.m

    r25161 r25168  
    77%
    88%   solution types available comprise:
    9 %                - 'Stressbalance'      or 'sb'
    10 %                - 'Masstransport'      or 'mt'
    11 %                - 'Thermal'            or 'th'
    12 %                - 'Steadystate'        or 'ss'
    13 %                - 'Transient'          or 'tr'
    14 %                - 'Balancethickness'   or 'mc'
     9%      - 'Stressbalance'      or 'sb'
     10%      - 'Masstransport'      or 'mt'
     11%      - 'Thermal'            or 'th'
     12%      - 'Steadystate'        or 'ss'
     13%      - 'Transient'          or 'tr'
     14%      - 'Balancethickness'   or 'mc'
    1515%      - 'Balancevelocity'    or 'bv'
    16 %                - 'BedSlope'           or 'bsl'
    17 %                - 'SurfaceSlope'       or 'ssl'
    18 %                - 'Hydrology'          or 'hy'
     16%      - 'BedSlope'           or 'bsl'
     17%      - 'SurfaceSlope'       or 'ssl'
     18%      - 'Hydrology'          or 'hy'
    1919%      - 'DamageEvolution'    or 'da'
    20 %                - 'Gia'                or 'gia'
    21 %                - 'Esa'                or 'esa'
    22 %                - 'Sealevelrise'       or 'slr'
    23 %                - 'Love'               or 'lv'
     20%      - 'Gia'                or 'gia'
     21%      - 'Love'               or 'lv'
     22%      - 'Esa'                or 'esa'
     23%      - 'Sealevelrise'       or 'slr'
    2424%
    2525%  extra options:
     
    8181md.private.solution=solutionstring;
    8282cluster=md.cluster;
    83 if strcmpi(getfieldvalue(options,'batch','no'),'yes') batch=1; else batch=0; end
     83if strcmpi(getfieldvalue(options,'batch','no'),'yes')
     84        batch=1;
     85else
     86        batch=0;
     87end
    8488
    8589%check model consistency
  • issm/trunk-jpl/src/m/solve/solve.py

    r24538 r25168  
    1212
    1313def solve(md, solutionstring, *args):
    14     """
     14    '''
    1515    SOLVE - apply solution sequence for this model
    1616
     
    4444          md = solve(md, 'Stressbalance')
    4545         md = solve(md, 'sb')
    46     """
     46    '''
    4747
    4848    #recover and process solve options
  • issm/trunk-jpl/src/m/solve/solveslm.m

    r22943 r25168  
    77%
    88%   solution types available comprise:
    9 %                - 'Sealevelrise'
    10 %                - 'Transient'
     9%      - 'Sealevelrise'
     10%      - 'Transient'
    1111%
    1212%  extra options:
  • issm/trunk-jpl/test/NightlyRun/runme.py

    r24711 r25168  
    5757            runme(exclude = 'Dakota', benchmark = 'all')
    5858            runme(id = [[101, 102], ['Dakota', 'Slr']])
     59
     60        TODO:
     61        - At '#disp test result', make sure precision of output matches
    5962        """
    6063    #Get ISSM_DIR variable
     
    185188                            field = field.T
    186189                            if np.shape(field) != np.shape(archive):
    187                                 raise RuntimeError("Field '{}'' from test is malformed; shape is {}, should be {} or {}".format(archive_name, np.shape(field.T), np.shape(archive), np.shape(archive.T)))
     190                                raise RuntimeError("Field '{}' from test is malformed; shape is {}, should be {} or {}".format(archive_name, np.shape(field.T), np.shape(archive), np.shape(archive.T)))
    188191
    189192                        error_diff = np.amax(np.abs(archive - field), axis=0) / (np.amax(np.abs(archive), axis=0) + float_info.epsilon)
     
    191194                            error_diff = error_diff[0]
    192195
    193                             #disp test result
     196                        #disp test result
    194197                        if (np.any(error_diff > tolerance) or np.isnan(error_diff)):
    195198                            print(('ERROR   difference: {} > {} test id: {} test name: {} field: {}'.format(error_diff, tolerance, id, id_string, fieldname)))
  • issm/trunk-jpl/test/NightlyRun/test2010.m

    r25163 r25168  
    6969%eustatic + rigid + elastic run:
    7070md.solidearth.settings.rigid=1;
    71 md.solidearth.settings.elastic=1; md.solidearth.settings.rotation=1;
     71md.solidearth.settings.elastic=1;
     72md.solidearth.settings.rotation=1;
    7273md.cluster=generic('name',oshostname(),'np',3);
    7374
  • issm/trunk-jpl/test/NightlyRun/test2010.py

    r25163 r25168  
    8080md.solidearth.settings.reltol = np.nan
    8181md.solidearth.settings.abstol = 1e-3
    82 md.solidearth.settings.geodetic = 1
     82md.solidearth.settings.computesealevelchange = 1
    8383# }}}
    8484
     
    109109field_names = ['eus', 'slr', 'moixz', 'moiyz', 'moizz']
    110110field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13, 1e-13]
    111 field_values = [eus, solidearth, moixz, moiyz, moizz]
     111field_values = [eus, slr, moixz, moiyz, moizz]
Note: See TracChangeset for help on using the changeset viewer.