Changeset 25455 for issm/trunk-jpl/src/m/io
- Timestamp:
- 08/25/20 00:32:13 (5 years ago)
- Location:
- issm/trunk-jpl/src/m/io
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/io/loadmodel.m
r13007 r25455 1 1 function varargout=loadmodel(path) 2 %LOADMODEL - load a model using built-in load module 2 %LOADMODEL - load a model using built-in load module 3 3 % 4 4 % check that model prototype has not changed. if so, adapt to new model prototype. -
issm/trunk-jpl/src/m/io/loadmodel.py
r25346 r25455 1 1 from loadvars import loadvars 2 # hack to keep python 2 compatipility2 # Hack to keep python 2 compatibility 3 3 try: 4 #py3 import 5 from dbm import whichdb 4 from dbm import whichdb # Python 3 6 5 except ImportError: 7 #py2 import8 from whichdb import whichdb 6 from whichdb import whichdb # Python 2 7 9 8 from netCDF4 import Dataset 10 9 11 10 12 11 def loadmodel(path, onlylast=False): 13 """ 14 LOADMODEL - load a model using built - in load module 12 """LOADMODEL - load a model 15 13 16 check that model prototype has not changed. if so, adapt to new model prototype.14 Check that model prototype has not changed: if if has, adapt to new model prototype. 17 15 18 19 16 Usage: 17 md = loadmodel(path) 20 18 """ 21 19 -
issm/trunk-jpl/src/m/io/loadvars.py
r25346 r25455 1 1 from collections import OrderedDict 2 # Hack to keep python 2 compatibility 3 try: 4 from dbm import whichdb # Python 3 5 except ImportError: 6 from whichdb import whichdb # Python 2 7 from re import findall 8 import shelve 9 2 10 from netCDF4 import Dataset 3 11 import numpy as np 4 from re import findall5 import shelve6 12 7 13 from model import * 8 #hack to keep python 2 compatibility9 try:10 #py3 import11 from dbm import whichdb12 except ImportError:13 #py2 import14 from whichdb import whichdb15 14 16 15 17 16 def loadvars(*args, **kwargs): 18 """ 19 LOADVARS - function to load variables from a file. 17 """LOADVARS - function to load variables from a file 20 18 21 19 This function loads one or more variables from a file. The names of the
Note:
See TracChangeset
for help on using the changeset viewer.