Changeset 14874


Ignore:
Timestamp:
05/03/13 15:55:08 (12 years ago)
Author:
Mathieu Morlighem
Message:

CHG: reverted back (but removed check on np>1 if no petsc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/m/solve/solve.py

    r14872 r14874  
     1import datetime
     2import os
     3import shutil
     4from pairoptions import *
     5from process_solve_options import *
     6from EnumDefinitions import *
     7from EnumToString import EnumToString
     8from ismodelselfconsistent import *
     9from marshall import *
     10from ispetsc import *
     11from waitonlock import *
     12from loadresultsfromcluster import *
     13
     14def solve(md,solutionenum,*args):
     15        """
     16        SOLVE - apply solution sequence for this model
     17 
     18           Usage:
     19              md=solve(md,solutionenum,varargin)
     20              where varargin is a list of paired arguments of string OR enums
     21 
     22           solution types available comprise:
     23              - DiagnosticSolutionEnum
     24              - PrognosticSolutionEnum
     25              - ThermalSolutionEnum
     26              - SteadystateSolutionEnum
     27              - TransientSolutionEnum...
     28              - BalancethicknessSolutionEnum
     29              - BedSlopeSolutionEnum
     30              - SurfaceSlopeSolutionEnum
     31              - HydrologySolutionEnum
     32              - FlaimSolutionEnum
     33 
     34           extra options:
     35              - loadonly : does not solve. only load results
     36 
     37           Examples:
     38              md=solve(md,DiagnosticSolutionEnum);
     39        """
     40
     41        #recover and process solve options
     42        options=pairoptions('solution_type',solutionenum,*args)
     43        options=process_solve_options(options)
     44
     45        #recover some fields
     46        md.private.solution=options['solution_type']
     47        cluster=md.cluster
     48
     49        #check model consistency
     50        print "checking model consistency"
     51        if solutionenum == FlaimSolutionEnum():
     52                md.private.isconsistent=True
     53                md.mesh.checkconsistency(md,solutionenum)
     54                md.flaim.checkconsistency(md,solutionenum)
     55                if not md.private.isconsistent:
     56                        raise RuntimeError("Model not consistent, see messages above.")
     57        else:
     58                ismodelselfconsistent(md)
     59
     60        #First, build a runtime name that is unique
     61        c=datetime.datetime.now()
     62        md.private.runtimename="%s-%02i-%02i-%04i-%02i-%02i-%02i-%i" % (md.miscellaneous.name,c.month,c.day,c.year,c.hour,c.minute,c.second,os.getpid())
     63
     64        #if running qmu analysis, some preprocessing of dakota files using models
     65        #fields needs to be carried out.
     66        if md.qmu.isdakota:
     67                md=preqmu(md,options)
     68
     69        #flaim analysis
    170        if options['solution_type'] == FlaimSolutionEnum():
    271                md=flaim_sol(md,options)
Note: See TracChangeset for help on using the changeset viewer.