Changeset 23707
- Timestamp:
- 02/11/19 04:11:43 (6 years ago)
- Location:
- issm/trunk-jpl/test
- Files:
-
- 38 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/test/NightlyRun/IdFromString.py
r23178 r23707 38 38 #Return if no test found 39 39 if not ids: 40 print "No test matches '%s'." % string40 print("No test matches '%s'." % string) 41 41 return ids 42 42 … … 48 48 49 49 if verbose: 50 print "%s tests match '%s':" % (len(ids),string)50 print("%s tests match '%s':" % (len(ids),string)) 51 51 for i in range(len(ids)): 52 print " %s : %s" % (ids[i],idnames[i])52 print(" %s : %s" % (ids[i],idnames[i])) 53 53 #else: 54 54 #print ids -
issm/trunk-jpl/test/NightlyRun/runme.py
r23535 r23707 7 7 from socket import gethostname 8 8 from GetIds import * 9 from parallelrange import parallelrange 10 from IdToName import IdToName 11 from arch import archread 12 from arch import archwrite 13 from arch import archdisp 9 14 10 15 def runme(id=None,exclude=None,benchmark='nightly',procedure='check',output='none',rank=1,numprocs=1): … … 49 54 runme(id=[[101,102],['Dakota','Slr']]) 50 55 """ 51 from parallelrange import parallelrange52 from IdToName import IdToName53 from arch import archread54 from arch import archwrite55 from arch import archdisp56 57 56 #Get ISSM_DIR variable 58 57 ISSM_DIR=os.environ['ISSM_DIR'] … … 61 60 #GET benchmark {{{ 62 61 if not benchmark in ['all','nightly','ismip','eismint','thermal','mesh','validation','tranforcing','adolc','slr','referential']: 63 print( "runme warning: benchmark '{}' not supported, defaulting to test 'nightly'.".format(benchmark))62 print(("runme warning: benchmark '{}' not supported, defaulting to test 'nightly'.".format(benchmark))) 64 63 benchmark='nightly' 65 64 # }}} 66 65 #GET procedure {{{ 67 66 if not procedure in ['check','update']: 68 print( "runme warning: procedure '{}' not supported, defaulting to test 'check'.".format(procedure))67 print(("runme warning: procedure '{}' not supported, defaulting to test 'check'.".format(procedure))) 69 68 procedure='check' 70 69 # }}} 71 70 #GET output {{{ 72 71 if not output in ['nightly','none']: 73 print( "runme warning: output '{}' not supported, defaulting to test 'none'.".format(output))72 print(("runme warning: output '{}' not supported, defaulting to test 'none'.".format(output))) 74 73 output='none' 75 74 # }}} … … 126 125 root=os.getcwd() 127 126 for id in test_ids: 128 print "----------------starting:%i-----------------------" % id127 print(("----------------starting:{}-----------------------".format(id))) 129 128 try: 130 129 … … 132 131 os.chdir(root) 133 132 id_string=IdToName(id) 134 exec file('test'+str(id)+'.py',globals())133 exec(compile(open('test'+str(id)+'.py').read(), 'test'+str(id)+'.py', 'exec'),globals()) 135 134 136 135 #UPDATE ARCHIVE? … … 151 150 # Matlab uses base 1, so use base 1 in labels 152 151 archwrite(archive_file,archive_name+'_field'+str(k+1),field) 153 print "File '%s' saved.\n" % os.path.join('..','Archives',archive_name+'.arch')152 print(("File {} saved. \n".format(os.path.join('..','Archives',archive_name+'.arch')))) 154 153 155 154 #ELSE: CHECK TEST … … 185 184 186 185 error_diff=np.amax(np.abs(archive-field),axis=0)/(np.amax(np.abs(archive),axis=0)+float_info.epsilon) 187 188 if not np.isscalar(error_diff):error_diff=error_diff[0]186 if not np.isscalar(error_diff): 187 error_diff=error_diff[0] 189 188 190 189 #disp test result 191 190 if (np.any(error_diff>tolerance) or np.isnan(error_diff)): 192 print( 'ERROR difference: {} > {} test id: {} test name: {} field: {}'.format(error_diff,tolerance,id,id_string,fieldname))191 print(('ERROR difference: {} > {} test id: {} test name: {} field: {}'.format(error_diff,tolerance,id,id_string,fieldname))) 193 192 else: 194 print( 'SUCCESS difference: {} < {} test id: {} test name: {} field: {}'.format(error_diff,tolerance,id,id_string,fieldname))193 print(('SUCCESS difference: {} < {} test id: {} test name: {} field: {}'.format(error_diff,tolerance,id,id_string,fieldname))) 195 194 196 195 except Exception as message: 197 196 198 197 #something went wrong, print failure message: 199 print format_exc()198 print((format_exc())) 200 199 directory=os.getcwd().split('/') # not used? 201 200 if output=='nightly': … … 204 203 fid.write('\n------------------------------------------------------------------\n') 205 204 fid.close() 206 print( 'FAILURE difference: N/A test id: {} test name: {} field: {}'.format(id,id_string,fieldname))205 print(('FAILURE difference: N/A test id: {} test name: {} field: {}'.format(id,id_string,fieldname))) 207 206 else: 208 print( 'FAILURE difference: N/A test id: {} test name: {} field: {}'.format(id,id_string,fieldname))207 print(('FAILURE difference: N/A test id: {} test name: {} field: {}'.format(id,id_string,fieldname))) 209 208 raise RuntimeError(message) 210 209 … … 213 212 214 213 #something went wrong, print failure message: 215 print format_exc()214 print((format_exc())) 216 215 directory=os.getcwd().split('/') # not used? 217 216 if output=='nightly': … … 220 219 fid.write('\n------------------------------------------------------------------\n') 221 220 fid.close() 222 print( 'FAILURE difference: N/A test id: {} test name: {} field: {}'.format(id,id_string,'N/A'))221 print(('FAILURE difference: N/A test id: {} test name: {} field: {}'.format(id,id_string,'N/A'))) 223 222 else: 224 print( 'FAILURE difference: N/A test id: {} test name: {} field: {}'.format(id,id_string,'N/A'))223 print(('FAILURE difference: N/A test id: {} test name: {} field: {}'.format(id,id_string,'N/A'))) 225 224 raise RuntimeError(message) 226 225 227 print "----------------finished:%i-----------------------" % id226 print(("----------------finished:{}-----------------------".format(id))) 228 227 return 229 228 … … 235 234 if os.path.exists(PYTHONSTARTUP): 236 235 try: 237 exec file(PYTHONSTARTUP)236 exec(compile(open(PYTHONSTARTUP).read(), PYTHONSTARTUP, 'exec')) 238 237 except Exception as e: 239 print "PYTHONSTARTUP error: ",e238 print(("PYTHONSTARTUP error: ",e)) 240 239 else: 241 print( "PYTHONSTARTUP file '{}' does not exist.".format(PYTHONSTARTUP))240 print(("PYTHONSTARTUP file '{}' does not exist.".format(PYTHONSTARTUP))) 242 241 243 242 parser = argparse.ArgumentParser(description='RUNME - test deck for ISSM nightly runs') … … 256 255 257 256 if args.output=='nightly': 258 print "PYTHONEXITEDCORRECTLY"257 print("PYTHONEXITEDCORRECTLY") 259 258 260 259 exit(md) -
issm/trunk-jpl/test/NightlyRun/test101.py
r23577 r23707 15 15 md=setflowequation(md,'SSA','all') 16 16 md.cluster=generic('name',gethostname(),'np',3) 17 17 md.verbose=verbose('all') 18 md.verbose.solver=True 18 19 #outputs 19 20 md.stressbalance.requested_outputs=['default','DeviatoricStressxx','DeviatoricStressyy','DeviatoricStressxy','MassFlux1','MassFlux2','MassFlux3','MassFlux4','MassFlux5','MassFlux6'] -
issm/trunk-jpl/test/NightlyRun/test1104.py
r22868 r23707 44 44 45 45 md.stressbalance.vertex_pairing=np.vstack((np.vstack((posx+1,posx2+1)).T,np.vstack((posy+1,posy2+1)).T)) 46 print np.shape(md.stressbalance.vertex_pairing)46 print(np.shape(md.stressbalance.vertex_pairing)) 47 47 #Compute the stressbalance 48 48 md.stressbalance.abstol=np.nan -
issm/trunk-jpl/test/NightlyRun/test1201.py
r21411 r23707 17 17 results=[] 18 18 19 for stabilization in xrange(1,4):19 for stabilization in range(1,4): 20 20 #The goal is to test the masstransport model 21 21 md=bamg(model(),'domain','../Exp/SquareEISMINT.exp','hmax',3000.) … … 26 26 md.cluster=generic('name',gethostname(),'np',8) 27 27 28 print " initial velocity"28 print(" initial velocity") 29 29 md.initialization.vx=np.zeros((md.mesh.numberofvertices)) 30 30 md.initialization.vy=-400.*np.ones((md.mesh.numberofvertices)) -
issm/trunk-jpl/test/NightlyRun/test1205.py
r21408 r23707 50 50 vel=np.zeros((md.mesh.numberofvertices2d)) 51 51 52 for i in xrange(0,md.mesh.numberofvertices2d):52 for i in range(0,md.mesh.numberofvertices2d): 53 53 node_vel=0. 54 for j in xrange(0,md.mesh.numberoflayers-1):54 for j in range(0,md.mesh.numberoflayers-1): 55 55 node_vel=node_vel+1./(2.*(md.mesh.numberoflayers-1))*(np.sqrt(vx[i+(j+1)*md.mesh.numberofvertices2d,0]**2+vy[i+(j+1)*md.mesh.numberofvertices2d,0]**2)+np.sqrt(vx[i+j*md.mesh.numberofvertices2d,0]**2+vy[i+j*md.mesh.numberofvertices2d,0]**2)) 56 56 vel[i]=node_vel -
issm/trunk-jpl/test/NightlyRun/test1206.py
r21408 r23707 50 50 vel=np.zeros((md.mesh.numberofvertices2d)) 51 51 52 for i in xrange(0,md.mesh.numberofvertices2d):52 for i in range(0,md.mesh.numberofvertices2d): 53 53 node_vel=0. 54 for j in xrange(0,md.mesh.numberoflayers-1):54 for j in range(0,md.mesh.numberoflayers-1): 55 55 node_vel=node_vel+1./(2.*(md.mesh.numberoflayers-1))*\ 56 56 (np.sqrt(vx[i+(j+1)*md.mesh.numberofvertices2d,0]**2+vy[i+(j+1)*md.mesh.numberofvertices2d,0]**2)+\ -
issm/trunk-jpl/test/NightlyRun/test1207.py
r21408 r23707 50 50 vel=np.zeros((md.mesh.numberofvertices2d)) 51 51 52 for i in xrange(0,md.mesh.numberofvertices2d):52 for i in range(0,md.mesh.numberofvertices2d): 53 53 node_vel=0. 54 for j in xrange(0,md.mesh.numberoflayers-1):54 for j in range(0,md.mesh.numberoflayers-1): 55 55 node_vel=node_vel+1./(2.*(md.mesh.numberoflayers-1))*\ 56 56 (np.sqrt(vx[i+(j+1)*md.mesh.numberofvertices2d,0]**2+vy[i+(j+1)*md.mesh.numberofvertices2d,0]**2)+\ -
issm/trunk-jpl/test/NightlyRun/test1501.py
r21408 r23707 31 31 md=solve(md,'Masstransport') 32 32 33 for i in xrange(1,11):33 for i in range(1,11): 34 34 md=solve(md,'Masstransport') 35 35 md.smb.mass_balance= md.smb.mass_balance - ((md.results.MasstransportSolution.Thickness)-md.geometry.thickness) -
issm/trunk-jpl/test/NightlyRun/test1502.py
r21408 r23707 32 32 md=solve(md,'Masstransport') 33 33 34 for i in xrange(1,11):34 for i in range(1,11): 35 35 md=solve(md,'Masstransport') 36 36 md.smb.mass_balance= md.smb.mass_balance - ((md.results.MasstransportSolution.Thickness)-md.geometry.thickness) -
issm/trunk-jpl/test/NightlyRun/test1601.py
r21632 r23707 35 35 vel1=md.results.StressbalanceSolution.Vel 36 36 #plotmodel(md,'data',vel0,'data',vel1,'data',vel1-vel0,'title','Cartesian CS','title','Rotated CS','title','difference') 37 print "Error between Cartesian and rotated CS: %g" % (np.max(np.abs(vel0-vel1))/(np.max(np.abs(vel0))+sys.float_info.epsilon))37 print("Error between Cartesian and rotated CS: %g" % (np.max(np.abs(vel0-vel1))/(np.max(np.abs(vel0))+sys.float_info.epsilon))) 38 38 39 39 #Now, put CS back to normal except on the side where the spc are applied … … 46 46 47 47 #plotmodel(md,'data',vel0,'data',vel2,'data',vel2-vel0,'title','Cartesian CS','title','Rotated CS','title','difference') 48 print "Error between Cartesian and rotated CS: %g" % (np.max(np.abs(vel0-vel2))/(np.max(np.abs(vel0))+sys.float_info.epsilon))48 print("Error between Cartesian and rotated CS: %g" % (np.max(np.abs(vel0-vel2))/(np.max(np.abs(vel0))+sys.float_info.epsilon))) 49 49 50 50 #Fields and tolerances to track changes -
issm/trunk-jpl/test/NightlyRun/test1602.py
r21614 r23707 37 37 38 38 #plotmodel(md,'data',vel0,'data',vel1,'data',vel1-vel0,'title','Cartesian CS','title','Rotated CS','title','difference','view#all',2) 39 print "Error between Cartesian and rotated CS: %g" % (np.max(np.abs(vel0-vel1))/(np.max(np.abs(vel0))+sys.float_info.epsilon))39 print("Error between Cartesian and rotated CS: %g" % (np.max(np.abs(vel0-vel1))/(np.max(np.abs(vel0))+sys.float_info.epsilon))) 40 40 41 41 #Fields and tolerances to track changes -
issm/trunk-jpl/test/NightlyRun/test234.py
r23231 r23707 3 3 import scipy.io as spio 4 4 from os import getcwd 5 from IssmConfig import IssmConfig 5 6 from model import * 6 7 from socket import gethostname -
issm/trunk-jpl/test/NightlyRun/test235.py
r23231 r23707 4 4 from os import getcwd 5 5 from model import * 6 from IssmConfig import IssmConfig 6 7 from socket import gethostname 7 8 from triangle import * -
issm/trunk-jpl/test/NightlyRun/test236.py
r22864 r23707 32 32 md.smb.temperatures_presentday=np.zeros((md.mesh.numberofvertices+1,12)) 33 33 md.smb.temperatures_lgm=np.zeros((md.mesh.numberofvertices+1,12)) 34 for imonth in xrange(0,12):34 for imonth in range(0,12): 35 35 md.smb.temperatures_presentday[0:md.mesh.numberofvertices,imonth]=tmonth[imonth] 36 36 md.smb.temperatures_lgm[0:md.mesh.numberofvertices,imonth]=tmonth[imonth]-20. … … 51 51 md.smb.precipitations_presentday=np.zeros((md.mesh.numberofvertices+1,12)) 52 52 md.smb.precipitations_lgm=np.zeros((md.mesh.numberofvertices+1,12)) 53 for imonth in xrange(0,12):53 for imonth in range(0,12): 54 54 md.smb.precipitations_presentday[0:md.mesh.numberofvertices,imonth]=-0.4*10**(-6)*md.mesh.y+0.5 55 55 md.smb.precipitations_presentday[md.mesh.numberofvertices,imonth]=((float(imonth)+1.)/12.) -
issm/trunk-jpl/test/NightlyRun/test237.py
r22864 r23707 30 30 md.smb.temperatures_presentday=np.zeros((md.mesh.numberofvertices+1,12)) 31 31 md.smb.temperatures_lgm=np.zeros((md.mesh.numberofvertices+1,12)) 32 for imonth in xrange(0,12):32 for imonth in range(0,12): 33 33 md.smb.temperatures_presentday[0:md.mesh.numberofvertices,imonth]=tmonth[imonth] 34 34 md.smb.temperatures_lgm[0:md.mesh.numberofvertices,imonth]=tmonth[imonth]-20. … … 49 49 md.smb.precipitations_presentday=np.zeros((md.mesh.numberofvertices+1,12)) 50 50 md.smb.precipitations_lgm=np.zeros((md.mesh.numberofvertices+1,12)) 51 for imonth in xrange(0,12):51 for imonth in range(0,12): 52 52 md.smb.precipitations_presentday[0:md.mesh.numberofvertices,imonth]=-0.4*10**(-6)*md.mesh.y+0.5 53 53 md.smb.precipitations_presentday[md.mesh.numberofvertices,imonth]=((float(imonth)+1.)/12.) … … 59 59 md.smb.Tdiff=np.zeros((2,fsize)) 60 60 md.smb.sealev=np.zeros((2,fsize)) 61 for iint in xrange(0,fsize):61 for iint in range(0,fsize): 62 62 # Interpolation factors 63 63 md.smb.Pfac[0,iint]=0.15*(iint+1) -
issm/trunk-jpl/test/NightlyRun/test238.py
r21408 r23707 27 27 tmonth=np.ones(12)*(238.15+20.) 28 28 md.smb.temperatures_presentday=np.zeros((md.mesh.numberofvertices+1,12)) 29 for imonth in xrange(0,12):29 for imonth in range(0,12): 30 30 md.smb.temperatures_presentday[0:md.mesh.numberofvertices,imonth]=tmonth[imonth] 31 31 # Time for the last line: … … 40 40 # creating precipitation 41 41 md.smb.precipitations_presentday=np.zeros((md.mesh.numberofvertices+1,12)) 42 for imonth in xrange(0,12):42 for imonth in range(0,12): 43 43 md.smb.precipitations_presentday[0:md.mesh.numberofvertices,imonth]=-0.4*10**(-6)*md.mesh.y+0.5 44 44 md.smb.precipitations_presentday[md.mesh.numberofvertices,imonth]=(float(imonth)/12.) -
issm/trunk-jpl/test/NightlyRun/test239.py
r21408 r23707 27 27 tmonth=np.ones(12)*(238.15+20.) 28 28 md.smb.temperatures_presentday=np.zeros((md.mesh.numberofvertices+1,12)) 29 for imonth in xrange(0,12):29 for imonth in range(0,12): 30 30 md.smb.temperatures_presentday[0:md.mesh.numberofvertices,imonth]=tmonth[imonth] 31 31 # Time for the last line: … … 40 40 # creating precipitation 41 41 md.smb.precipitations_presentday=np.zeros((md.mesh.numberofvertices+1,12)) 42 for imonth in xrange(0,12):42 for imonth in range(0,12): 43 43 md.smb.precipitations_presentday[0:md.mesh.numberofvertices,imonth]=-0.4*10**(-6)*md.mesh.y+0.5 44 44 md.smb.precipitations_presentday[md.mesh.numberofvertices,imonth]=((float(imonth)+1.)/12.) -
issm/trunk-jpl/test/NightlyRun/test240.py
r21408 r23707 27 27 tmonth=np.ones(12)*(238.15+20.) 28 28 md.smb.temperatures_presentday=np.zeros((md.mesh.numberofvertices+1,12)) 29 for imonth in xrange(0,12):29 for imonth in range(0,12): 30 30 md.smb.temperatures_presentday[0:md.mesh.numberofvertices,imonth]=tmonth[imonth] 31 31 # Time for the last line: … … 40 40 # creating precipitation 41 41 md.smb.precipitations_presentday=np.zeros((md.mesh.numberofvertices+1,12)) 42 for imonth in xrange(0,12):42 for imonth in range(0,12): 43 43 md.smb.precipitations_presentday[0:md.mesh.numberofvertices,imonth]=-0.4*10**(-6)*md.mesh.y+0.5 44 44 md.smb.precipitations_presentday[md.mesh.numberofvertices,imonth]=((float(imonth)+1.)/12.) -
issm/trunk-jpl/test/NightlyRun/test243.py
r23468 r23707 20 20 md.smb = SMBgemb() 21 21 md.smb.setdefaultparameters(md.mesh,md.geometry) 22 md.smb.dsnowIdx = 0 22 md.smb.dsnowIdx = 0 23 23 24 24 #load hourly surface forcing date from 1979 to 2009: 25 inputs = np.load('../Data/gemb_input.npy' ).item()25 inputs = np.load('../Data/gemb_input.npy',encoding='bytes').item() 26 26 27 27 #setup the inputs: 28 md.smb.Ta = np.append(np.tile(np.conjugate(inputs[ 'Ta0']),(md.mesh.numberofelements,1)),np.conjugate([inputs['dateN']]),axis=0)29 md.smb.V = np.append(np.tile(np.conjugate(inputs[ 'V0']),(md.mesh.numberofelements,1)),np.conjugate([inputs['dateN']]),axis=0)30 md.smb.dswrf = np.append(np.tile(np.conjugate(inputs[ 'dsw0']),(md.mesh.numberofelements,1)),np.conjugate([inputs['dateN']]),axis=0)31 md.smb.dlwrf = np.append(np.tile(np.conjugate(inputs[ 'dlw0']),(md.mesh.numberofelements,1)),np.conjugate([inputs['dateN']]),axis=0)32 md.smb.P = np.append(np.tile(np.conjugate(inputs[ 'P0']),(md.mesh.numberofelements,1)),np.conjugate([inputs['dateN']]),axis=0)33 md.smb.eAir = np.append(np.tile(np.conjugate(inputs[ 'eAir0']),(md.mesh.numberofelements,1)),np.conjugate([inputs['dateN']]),axis=0)34 md.smb.pAir = np.append(np.tile(np.conjugate(inputs[ 'pAir0']),(md.mesh.numberofelements,1)),np.conjugate([inputs['dateN']]),axis=0)35 md.smb.pAir = np.append(np.tile(np.conjugate(inputs[ 'pAir0']),(md.mesh.numberofelements,1)),np.conjugate([inputs['dateN']]),axis=0)36 md.smb.Vz = np.tile(np.conjugate(inputs[ 'LP']['Vz']),(md.mesh.numberofelements,1)).flatten()37 md.smb.Tz = np.tile(np.conjugate(inputs[ 'LP']['Tz']),(md.mesh.numberofelements,1)).flatten()38 md.smb.Tmean = np.tile(np.conjugate(inputs[ 'LP']['Tmean']),(md.mesh.numberofelements,1)).flatten()39 md.smb.C = np.tile(np.conjugate(inputs[ 'LP']['C']),(md.mesh.numberofelements,1)).flatten()28 md.smb.Ta = np.append(np.tile(np.conjugate(inputs[b'Ta0']),(md.mesh.numberofelements,1)),np.conjugate([inputs[b'dateN']]),axis=0) 29 md.smb.V = np.append(np.tile(np.conjugate(inputs[b'V0']),(md.mesh.numberofelements,1)),np.conjugate([inputs[b'dateN']]),axis=0) 30 md.smb.dswrf = np.append(np.tile(np.conjugate(inputs[b'dsw0']),(md.mesh.numberofelements,1)),np.conjugate([inputs[b'dateN']]),axis=0) 31 md.smb.dlwrf = np.append(np.tile(np.conjugate(inputs[b'dlw0']),(md.mesh.numberofelements,1)),np.conjugate([inputs[b'dateN']]),axis=0) 32 md.smb.P = np.append(np.tile(np.conjugate(inputs[b'P0']),(md.mesh.numberofelements,1)),np.conjugate([inputs[b'dateN']]),axis=0) 33 md.smb.eAir = np.append(np.tile(np.conjugate(inputs[b'eAir0']),(md.mesh.numberofelements,1)),np.conjugate([inputs[b'dateN']]),axis=0) 34 md.smb.pAir = np.append(np.tile(np.conjugate(inputs[b'pAir0']),(md.mesh.numberofelements,1)),np.conjugate([inputs[b'dateN']]),axis=0) 35 md.smb.pAir = np.append(np.tile(np.conjugate(inputs[b'pAir0']),(md.mesh.numberofelements,1)),np.conjugate([inputs[b'dateN']]),axis=0) 36 md.smb.Vz = np.tile(np.conjugate(inputs[b'LP']['Vz']),(md.mesh.numberofelements,1)).flatten() 37 md.smb.Tz = np.tile(np.conjugate(inputs[b'LP']['Tz']),(md.mesh.numberofelements,1)).flatten() 38 md.smb.Tmean = np.tile(np.conjugate(inputs[b'LP']['Tmean']),(md.mesh.numberofelements,1)).flatten() 39 md.smb.C = np.tile(np.conjugate(inputs[b'LP']['C']),(md.mesh.numberofelements,1)).flatten() 40 40 41 41 #smb settings -
issm/trunk-jpl/test/NightlyRun/test274.py
r21411 r23707 24 24 25 25 md.cluster=generic('name',gethostname(),'np',3) 26 print md.rifts.riftstruct[0]['fill']26 print(md.rifts.riftstruct[0]['fill']) 27 27 md=solve(md,'Stressbalance') 28 28 -
issm/trunk-jpl/test/NightlyRun/test3015.py
r21925 r23707 88 88 dVdh_ad=md.results.MasstransportSolution.AutodiffJacobian 89 89 90 print "dV/dh: analytical: %16.16g\n using adolc: %16.16g\n" % (dVdh_an,dVdh_ad)90 print("dV/dh: analytical: %16.16g\n using adolc: %16.16g\n" % (dVdh_an,dVdh_ad)) 91 91 92 92 #Fields and tolerances to track changes -
issm/trunk-jpl/test/NightlyRun/test3020.py
r21408 r23707 94 94 dMaxVdh_ad=md.results.TransientSolution[0].AutodiffJacobian[1] 95 95 96 print "dV/dh: analytical: %16.16g\n using adolc: %16.16g\n" % (dVdh_an,dVdh_ad)97 print "dMaxV/dh: analytical: %16.16g\n using adolc: %16.16g\n" % (dMaxVdh_an,dMaxVdh_ad)96 print("dV/dh: analytical: %16.16g\n using adolc: %16.16g\n" % (dVdh_an,dVdh_ad)) 97 print("dMaxV/dh: analytical: %16.16g\n using adolc: %16.16g\n" % (dMaxVdh_an,dMaxVdh_ad)) 98 98 99 99 #Fields and tolerances to track changes -
issm/trunk-jpl/test/NightlyRun/test333.py
r22900 r23707 17 17 md.transient=transient.setallnullparameters(md.transient) 18 18 md.transient.ishydrology=True 19 md.transient.issmb=True19 #md.transient.issmb=True 20 20 md=setflowequation(md,'SSA','all') 21 21 md.cluster=generic('name',gethostname(),'np',1) … … 47 47 md.timestepping.final_time=2.0 48 48 49 #md.debug.valgrind=True 49 50 md=solve(md,'Transient') 50 51 -
issm/trunk-jpl/test/NightlyRun/test436.py
r22883 r23707 25 25 field_values = [] 26 26 for i in ['LliboutryDuval', 'CuffeyTemperate']: 27 print ' '28 print '====== Testing rheology law: ' + i + ' ====='27 print(' ') 28 print('====== Testing rheology law: ' + i + ' =====') 29 29 30 30 md.materials.rheology_law = i -
issm/trunk-jpl/test/NightlyRun/test701.py
r23339 r23707 62 62 #md.initialization.pressure = md.constants.g*md.materials.rho_ice*(md.geometry.surface-md.mesh.y) 63 63 for i in ['MINI','MINIcondensed','TaylorHood','LATaylorHood','CrouzeixRaviart','LACrouzeixRaviart']: 64 print ' '65 print '======Testing ' +i+ ' Full-Stokes Finite element====='64 print(' ') 65 print('======Testing ' +i+ ' Full-Stokes Finite element=====') 66 66 md.flowequation.fe_FS = i 67 67 md = solve(md,'Stressbalance') -
issm/trunk-jpl/test/NightlyRun/test702.py
r23339 r23707 72 72 field_values = [] 73 73 for i in ['MINI','MINIcondensed','TaylorHood','XTaylorHood','LATaylorHood']: 74 print ' '75 print '======Testing ' +i+ ' Full-Stokes Finite element====='74 print(' ') 75 print('======Testing ' +i+ ' Full-Stokes Finite element=====') 76 76 md.flowequation.fe_FS = i 77 77 md = solve(md,'Stressbalance') -
issm/trunk-jpl/test/Par/ISMIPA.py
r21409 r23707 4 4 #Ok, start defining model parameters here 5 5 6 print " creating thickness"6 print(" creating thickness") 7 7 md.geometry.surface=-md.mesh.x*numpy.tan(0.5*numpy.pi/180.) 8 8 md.geometry.base=md.geometry.surface-1000.+500.*numpy.sin(md.mesh.x*2.*numpy.pi/numpy.max(md.mesh.x))*numpy.sin(md.mesh.y*2.*numpy.pi/numpy.max(md.mesh.x)) 9 9 md.geometry.thickness=md.geometry.surface-md.geometry.base 10 10 11 print " creating drag"11 print(" creating drag") 12 12 md.friction.coefficient=200.*numpy.ones((md.mesh.numberofvertices)) 13 13 md.friction.coefficient[numpy.nonzero(md.mask.groundedice_levelset<0.)[0]]=0. … … 15 15 md.friction.q=numpy.ones((md.mesh.numberofelements)) 16 16 17 print " creating flow law parameter"17 print(" creating flow law parameter") 18 18 md.materials.rheology_B=6.8067*10**7*numpy.ones((md.mesh.numberofvertices)) 19 19 md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements)) 20 20 21 print " boundary conditions for stressbalance model"21 print(" boundary conditions for stressbalance model") 22 22 #Create node on boundary first (because we cannot use mesh) 23 23 md=SetIceSheetBC(md) -
issm/trunk-jpl/test/Par/ISMIPB.py
r21409 r23707 4 4 #Ok, start defining model parameters here 5 5 6 print " creating thickness"6 print(" creating thickness") 7 7 md.geometry.surface=-md.mesh.x*numpy.tan(0.5*numpy.pi/180.) 8 8 md.geometry.base=md.geometry.surface-1000.+500.*numpy.sin(md.mesh.x*2.*numpy.pi/numpy.max(md.mesh.x)) 9 9 md.geometry.thickness=md.geometry.surface-md.geometry.base 10 10 11 print " creating drag"11 print(" creating drag") 12 12 md.friction.coefficient=200.*numpy.ones((md.mesh.numberofvertices)) 13 13 md.friction.coefficient[numpy.nonzero(md.mask.groundedice_levelset<0.)[0]]=0. … … 15 15 md.friction.q=numpy.ones((md.mesh.numberofelements)) 16 16 17 print " creating flow law parameter"17 print(" creating flow law parameter") 18 18 md.materials.rheology_B=6.8067*10**7*numpy.ones((md.mesh.numberofvertices)) 19 19 md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements)) 20 20 21 print " boundary conditions for stressbalance model"21 print(" boundary conditions for stressbalance model") 22 22 #Create node on boundary first (because we cannot use mesh) 23 23 md=SetIceSheetBC(md) -
issm/trunk-jpl/test/Par/ISMIPC.py
r21409 r23707 4 4 #Ok, start defining model parameters here 5 5 6 print " creating thickness"6 print(" creating thickness") 7 7 md.geometry.surface=2000.-md.mesh.x*numpy.tan(0.1*numpy.pi/180.) #to have z>0 8 8 md.geometry.base=md.geometry.surface-1000. 9 9 md.geometry.thickness=md.geometry.surface-md.geometry.base 10 10 11 print " creating drag"11 print(" creating drag") 12 12 #md.friction.coefficient=sqrt(md.constants.yts.*(1000.+1000.*sin(md.mesh.x*2.*pi/max(md.mesh.x/2.)).*sin(md.mesh.y*2.*pi/max(md.mesh.x/2.)))./(md.constants.g*(md.materials.rho_ice*md.geometry.thickness+md.materials.rho_water*md.geometry.base))); 13 13 md.friction.coefficient=numpy.sqrt(md.constants.yts*(1000.+1000.*numpy.sin(md.mesh.x*2.*numpy.pi/numpy.max(md.mesh.x))*numpy.sin(md.mesh.y*2.*numpy.pi/numpy.max(md.mesh.x)))) … … 16 16 md.friction.q=numpy.zeros((md.mesh.numberofelements)) 17 17 18 print " creating flow law parameter"18 print(" creating flow law parameter") 19 19 md.materials.rheology_B=6.8067*10**7*numpy.ones((md.mesh.numberofvertices)) 20 20 md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements)) 21 21 22 print " boundary conditions for stressbalance model:"22 print(" boundary conditions for stressbalance model:") 23 23 #Create node on boundary first (because we can not use mesh) 24 24 md=SetIceSheetBC(md) -
issm/trunk-jpl/test/Par/ISMIPD.py
r21409 r23707 4 4 #Ok, start defining model parameters here 5 5 6 print " creating thickness"6 print(" creating thickness") 7 7 md.geometry.surface=2000.-md.mesh.x*numpy.tan(0.1*numpy.pi/180.) #to have z>0 8 8 md.geometry.base=md.geometry.surface-1000. 9 9 md.geometry.thickness=md.geometry.surface-md.geometry.base 10 10 11 print " creating drag"11 print(" creating drag") 12 12 md.friction.coefficient=numpy.sqrt(md.constants.yts*(1000.+1000.*numpy.sin(md.mesh.x*2.*numpy.pi/numpy.max(md.mesh.x)))) 13 13 md.friction.coefficient[numpy.nonzero(md.mask.groundedice_levelset<0.)[0]]=0. … … 15 15 md.friction.q=numpy.zeros((md.mesh.numberofelements)) 16 16 17 print " creating flow law parameter"17 print(" creating flow law parameter") 18 18 md.materials.rheology_B=6.8067*10**7*numpy.ones((md.mesh.numberofvertices)) 19 19 md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements)) 20 20 21 print " boundary conditions for stressbalance model:"21 print(" boundary conditions for stressbalance model:") 22 22 #Create node on boundary first (because we can not use mesh) 23 23 md=SetIceSheetBC(md) -
issm/trunk-jpl/test/Par/ISMIPE.py
r22267 r23707 5 5 #Ok, start defining model parameters here 6 6 7 print " creating thickness"7 print(" creating thickness") 8 8 data = numpy.array(archread('../Data/ISMIPE.arch','data')); 9 9 md.geometry.surface=numpy.zeros((md.mesh.numberofvertices)) 10 10 md.geometry.base=numpy.zeros((md.mesh.numberofvertices)) 11 for i in xrange(0,md.mesh.numberofvertices):11 for i in range(0,md.mesh.numberofvertices): 12 12 y=md.mesh.y[i] 13 13 point1=numpy.floor(y/100.) … … 21 21 md.geometry.base=md.geometry.surface-md.geometry.thickness 22 22 23 print " creating drag"23 print(" creating drag") 24 24 md.friction.coefficient=numpy.zeros((md.mesh.numberofvertices)) 25 25 md.friction.p=numpy.ones((md.mesh.numberofelements)) 26 26 md.friction.q=numpy.ones((md.mesh.numberofelements)) 27 27 28 print " creating flow law parameter"28 print(" creating flow law parameter") 29 29 md.materials.rheology_B=6.8067*10**7*numpy.ones((md.mesh.numberofvertices)) 30 30 md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements)) 31 31 32 print " boundary conditions for stressbalance model:"32 print(" boundary conditions for stressbalance model:") 33 33 #Create node on boundary first (because we can not use mesh) 34 34 md=SetIceSheetBC(md) -
issm/trunk-jpl/test/Par/ISMIPF.py
r21409 r23707 5 5 md.verbose=2 6 6 7 print " creating thickness"7 print(" creating thickness") 8 8 md.geometry.surface=-md.mesh.x*numpy.tan(3.*numpy.pi/180.) 9 9 #md.geometry.base=md.geometry.surface-1000. … … 11 11 md.geometry.thickness=md.geometry.surface-md.geometry.base 12 12 13 print " creating drag"13 print(" creating drag") 14 14 md.friction.coefficient=numpy.sqrt(md.constants.yts/(2.140373*10**-7*1000.))*numpy.ones((md.mesh.numberofvertices)) 15 15 md.friction.p=numpy.ones((md.mesh.numberofelements)) 16 16 md.friction.q=numpy.zeros((md.mesh.numberofelements)) 17 17 18 print " creating flow law parameter"18 print(" creating flow law parameter") 19 19 md.materials.rheology_B=1.4734*10**14*numpy.ones((md.mesh.numberofvertices)) 20 20 md.materials.rheology_n=1.*numpy.ones((md.mesh.numberofelements)) 21 21 md.materials.rheology_law='None' 22 22 23 print " boundary conditions for stressbalance model"23 print(" boundary conditions for stressbalance model") 24 24 #Create node on boundary first (because we cannot use mesh) 25 25 md=SetIceSheetBC(md) -
issm/trunk-jpl/test/Par/RoundSheetEISMINT.py
r21409 r23707 3 3 4 4 #Ok, start defining model parameters here 5 print " creating thickness"5 print(" creating thickness") 6 6 md.geometry.thickness=10.*numpy.ones((md.mesh.numberofvertices)) 7 7 md.geometry.base=numpy.zeros((md.mesh.numberofvertices)) 8 8 md.geometry.surface=md.geometry.base+md.geometry.thickness 9 9 10 print " creating drag"10 print(" creating drag") 11 11 md.friction.coefficient=20.*numpy.ones((md.mesh.numberofvertices)) 12 12 md.friction.p=numpy.ones((md.mesh.numberofelements)) 13 13 md.friction.q=numpy.ones((md.mesh.numberofelements)) 14 14 15 print " creating temperatures"15 print(" creating temperatures") 16 16 tmin=238.15 #K 17 17 st=1.67*10**-2/1000. #k/m … … 20 20 md.basalforcings.geothermalflux=4.2*10**-2*numpy.ones((md.mesh.numberofvertices)) 21 21 22 print " creating flow law parameter"22 print(" creating flow law parameter") 23 23 md.materials.rheology_B=6.81*10**7*numpy.ones((md.mesh.numberofvertices)) #to have the same B as the analytical solution 24 24 md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements)) 25 25 26 print " creating surface mass balance"26 print(" creating surface mass balance") 27 27 smb_max=0.5 #m/yr 28 28 sb=10**-2/1000. #m/yr/m … … 30 30 md.smb.mass_balance=numpy.minimum(smb_max*numpy.ones_like(radius),sb*(rel-radius)) 31 31 32 print " creating velocities"32 print(" creating velocities") 33 33 constant=0.3 34 34 md.inversion.vx_obs=constant/2.*md.mesh.x*(md.geometry.thickness)**-1 … … 41 41 42 42 #Deal with boundary conditions: 43 print " boundary conditions for stressbalance model:"43 print(" boundary conditions for stressbalance model:") 44 44 md=SetMarineIceSheetBC(md,'../Exp/RoundFrontEISMINT.exp') 45 45 -
issm/trunk-jpl/test/Par/RoundSheetStaticEISMINT.py
r21409 r23707 2 2 from SetMarineIceSheetBC import SetMarineIceSheetBC 3 3 4 print " creating thickness"4 print(" creating thickness") 5 5 hmin=0.01 6 6 hmax=2756.7 … … 12 12 md.geometry.surface=md.geometry.base+md.geometry.thickness 13 13 14 print " creating drag"14 print(" creating drag") 15 15 md.friction.coefficient=20.*numpy.ones((md.mesh.numberofvertices)) 16 16 md.friction.coefficient[numpy.nonzero(md.mask.groundedice_levelset<0.)[0]]=0. … … 18 18 md.friction.q=numpy.ones((md.mesh.numberofelements)) 19 19 20 print " creating temperatures"20 print(" creating temperatures") 21 21 tmin=238.15 #K 22 22 st=1.67*10**-2/1000. #k/m … … 24 24 md.basalforcings.geothermalflux=4.2*10**-2*numpy.ones((md.mesh.numberofvertices)) 25 25 26 print " creating flow law parameter"26 print(" creating flow law parameter") 27 27 md.materials.rheology_B=6.81*10**7*numpy.ones((md.mesh.numberofvertices)) #to have the same B as the analytical solution 28 28 md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements)) 29 29 30 print " creating surface mass balance"30 print(" creating surface mass balance") 31 31 smb_max=0.5 #m/yr 32 32 sb=10**-2/1000. #m/yr/m … … 34 34 md.smb.mass_balance=numpy.minimum(smb_max*numpy.ones_like(radius),sb*(rel-radius)) 35 35 36 print " creating velocities"36 print(" creating velocities") 37 37 constant=0.3 38 38 md.inversion.vx_obs=constant/2.*md.mesh.x*(md.geometry.thickness)**-1 … … 45 45 46 46 #Deal with boundary conditions: 47 print " boundary conditions for stressbalance model:"47 print(" boundary conditions for stressbalance model:") 48 48 md=SetMarineIceSheetBC(md,'../Exp/RoundFrontEISMINT.exp') 49 49 -
issm/trunk-jpl/test/Par/SquareEISMINT.py
r21409 r23707 4 4 #Ok, start defining model parameters here 5 5 6 print " creating thickness"6 print(" creating thickness") 7 7 ymin=numpy.min(md.mesh.y) 8 8 ymax=numpy.max(md.mesh.y) … … 11 11 md.geometry.surface=md.geometry.base+md.geometry.thickness 12 12 13 print " creating drag"13 print(" creating drag") 14 14 md.friction.coefficient=200.*numpy.ones((md.mesh.numberofvertices)) 15 15 md.friction.coefficient[numpy.nonzero(md.mask.groundedice_levelset<0.)[0]]=0. … … 17 17 md.friction.q=numpy.ones((md.mesh.numberofelements)) 18 18 19 print " creating initial values"19 print(" creating initial values") 20 20 md.initialization.temperature=(273.-20.)*numpy.ones((md.mesh.numberofvertices)) 21 21 md.initialization.vx=numpy.zeros((md.mesh.numberofvertices)) … … 25 25 md.initialization.pressure=numpy.zeros((md.mesh.numberofvertices)) 26 26 27 print " creating flow law parameter"27 print(" creating flow law parameter") 28 28 md.materials.rheology_B=1.7687*10**8*numpy.ones((md.mesh.numberofvertices)) 29 29 md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements)) 30 30 31 print " creating surface mass balance"31 print(" creating surface mass balance") 32 32 md.smb.mass_balance=0.2*numpy.ones((md.mesh.numberofvertices)) #0m/a 33 33 md.basalforcings.floatingice_melting_rate=0.*numpy.ones((md.mesh.numberofvertices)) #0m/a 34 34 md.basalforcings.groundedice_melting_rate=0.*numpy.ones((md.mesh.numberofvertices)) #0m/a 35 35 36 print " boundary conditions"36 print(" boundary conditions") 37 37 md=SetMarineIceSheetBC(md,'../Exp/SquareFrontEISMINT.exp') 38 38 -
issm/trunk-jpl/test/Par/SquareShelfConstrained.py
r22575 r23707 1 1 import os.path 2 from arch import *2 from arch import archread 3 3 import numpy as np 4 4 import inspect … … 21 21 md.geometry.bed=md.geometry.base-10; 22 22 23 #Initial velocity 24 #x = np.reshape(np.array(archread('../Data/SquareShelfConstrained.arch','x')),(-1)) 25 #y = np.reshape(np.array(archread('../Data/SquareShelfConstrained.arch','y')),(-1)) 23 #Initial velocity 26 24 x = np.array(archread('../Data/SquareShelfConstrained.arch','x')) 27 25 y = np.array(archread('../Data/SquareShelfConstrained.arch','y')) … … 52 50 53 51 #Numerical parameters 54 md.masstransport.stabilization=1 .55 md.thermal.stabilization=1 .52 md.masstransport.stabilization=1 53 md.thermal.stabilization=1 56 54 md.verbose = verbose(0) 57 55 md.settings.waitonlock=30 -
issm/trunk-jpl/test/Par/SquareThermal.py
r22993 r23707 8 8 md.groundingline.migration='None' 9 9 10 print " creating thickness"10 print(" creating thickness") 11 11 h=1000. 12 12 md.geometry.thickness=h*numpy.ones((md.mesh.numberofvertices)) … … 14 14 md.geometry.surface=md.geometry.base+md.geometry.thickness; 15 15 16 print " creating velocities"16 print(" creating velocities") 17 17 md.initialization.vx=numpy.zeros((md.mesh.numberofvertices)) 18 18 md.initialization.vy=numpy.zeros((md.mesh.numberofvertices)) 19 19 md.initialization.vz=numpy.zeros((md.mesh.numberofvertices)) 20 20 21 print " creating drag"21 print(" creating drag") 22 22 md.friction.coefficient=200.*numpy.ones((md.mesh.numberofvertices)) 23 23 md.friction.coefficient[numpy.nonzero(md.mask.groundedice_levelset<0.)[0]]=0. … … 25 25 md.friction.q=numpy.ones((md.mesh.numberofelements)) 26 26 27 print " creating temperatures"27 print(" creating temperatures") 28 28 md.initialization.temperature=(273.-20.)*numpy.ones((md.mesh.numberofvertices)) 29 29 md.initialization.pressure=numpy.zeros((md.mesh.numberofvertices,)) … … 31 31 md.initialization.watercolumn=numpy.zeros((md.mesh.numberofvertices,)) 32 32 33 print " creating flow law parameter"33 print(" creating flow law parameter") 34 34 md.materials.rheology_B=paterson(md.initialization.temperature) 35 35 md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements)) 36 36 37 print " creating surface mass balance"37 print(" creating surface mass balance") 38 38 md.smb.mass_balance=numpy.ones((md.mesh.numberofvertices))/md.constants.yts #1m/a 39 39 #md.basalforcings.melting_rate=0.*numpy.ones((md.mesh.numberofvertices))/md.constants.yts #1m/a … … 43 43 #Deal with boundary conditions: 44 44 45 print " boundary conditions for stressbalance model"45 print(" boundary conditions for stressbalance model") 46 46 md=SetMarineIceSheetBC(md,'../Exp/SquareFront.exp') 47 47 48 print " boundary conditions for thermal model"48 print(" boundary conditions for thermal model") 49 49 md.thermal.spctemperature[:]=md.initialization.temperature 50 50 md.basalforcings.geothermalflux=numpy.zeros((md.mesh.numberofvertices))
Note:
See TracChangeset
for help on using the changeset viewer.