Changeset 21412
- Timestamp:
- 11/22/16 07:04:11 (8 years ago)
- Location:
- issm/trunk-jpl/test/NightlyRun
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/test/NightlyRun/runme.py
r21408 r21412 54 54 #GET benchmark {{{ 55 55 if not benchmark in ['all','nightly','ismip','eismint','thermal','mesh','validation','tranforcing','adolc','slr']: 56 print "runme warning: benchmark '%s' not supported, defaulting to test 'nightly'." % benchmark56 print("runme warning: benchmark '{}' not supported, defaulting to test 'nightly'.".format(benchmark)) 57 57 benchmark='nightly' 58 58 # }}} 59 59 #GET procedure {{{ 60 60 if not procedure in ['check','update']: 61 print "runme warning: procedure '%s' not supported, defaulting to test 'check'." % procedure61 print("runme warning: procedure '{}' not supported, defaulting to test 'check'.".format(procedure)) 62 62 procedure='check' 63 63 # }}} 64 64 #GET output {{{ 65 65 if not output in ['nightly','none']: 66 print "runme warning: output '%s' not supported, defaulting to test 'none'." % output66 print("runme warning: output '{}' not supported, defaulting to test 'none'.".format(output)) 67 67 output='none' 68 68 # }}} … … 167 167 168 168 for k,fieldname in enumerate(field_names): 169 169 print fieldname 170 170 try: 171 print('getting {}'.format(fieldname)) 171 172 #Get field and tolerance 172 173 field=np.array(field_values[k]) … … 183 184 if archive == None: 184 185 raise NameError("Field name '"+archive_name+'_field'+str(k+1)+"' does not exist in archive file.") 185 error_diff=np.amax(np.abs(archive-field),axis=0)/ \ 186 (np.amax(np.abs(archive),axis=0)+float_info.epsilon) 186 error_diff=np.amax(np.abs(archive-field),axis=0)/(np.amax(np.abs(archive),axis=0)+float_info.epsilon) 187 187 188 188 #disp test result 189 189 if (np.any(error_diff>tolerance) or np.isnan(error_diff)): 190 print 'ERROR difference: %-7.2g > %7.2g test id: %i test name: %s field: %s' % \ 191 (error_diff,tolerance,id,id_string,fieldname) 190 print('ERROR difference: {} > {} test id: {} test name: {} field: {}'.format(error_diff,tolerance,id,id_string,fieldname)) 192 191 else: 193 print 'SUCCESS difference: %-7.2g < %7.2g test id: %i test name: %s field: %s' % \ 194 (error_diff,tolerance,id,id_string,fieldname) 192 print('SUCCESS difference: {} < {} test id: {} test name: {} field: {}'.format(error_diff,tolerance,id,id_string,fieldname)) 195 193 196 194 except Exception as message: … … 204 202 fid.write('\n------------------------------------------------------------------\n') 205 203 fid.close() 206 print 'FAILURE difference: N/A test id: %i test name: %s field: %s' % (id,id_string,fieldname)204 print('FAILURE difference: N/A test id: {} test name: {} field: {}'.format(id,id_string,fieldname)) 207 205 else: 208 print 'FAILURE difference: N/A test id: %i test name: %s field: %s' % (id,id_string,fieldname)206 print('FAILURE difference: N/A test id: {} test name: {} field: {}'.format(id,id_string,fieldname)) 209 207 raise RuntimeError(message) 210 208 … … 220 218 fid.write('\n------------------------------------------------------------------\n') 221 219 fid.close() 222 print 'FAILURE difference: N/A test id: %i test name: %s field: %s' % (id,id_string,'N/A')220 print('FAILURE difference: N/A test id: {} test name: {} field: {}'.format(id,id_string,'N/A')) 223 221 else: 224 print 'FAILURE difference: N/A test id: %i test name: %s field: %s' % (id,id_string,'N/A')222 print('FAILURE difference: N/A test id: {} test name: {} field: {}'.format(id,id_string,'N/A')) 225 223 raise RuntimeError(message) 226 224 … … 239 237 print "PYTHONSTARTUP error: ",e 240 238 else: 241 print "PYTHONSTARTUP file '%s' does not exist." % PYTHONSTARTUP239 print("PYTHONSTARTUP file '{}' does not exist.".format(PYTHONSTARTUP)) 242 240 243 241 parser = argparse.ArgumentParser(description='RUNME - test deck for ISSM nightly runs') -
issm/trunk-jpl/test/NightlyRun/test803.py
r21408 r21412 17 17 18 18 #Thermal model 19 pos_surf=np. nonzero(md.mesh.vertexonsurface)[0]19 pos_surf=np.where(md.mesh.vertexonsurface)[0] 20 20 md.thermal.spctemperature[pos_surf]=md.initialization.temperature[pos_surf] 21 21 md.thermal.isenthalpy=True -
issm/trunk-jpl/test/NightlyRun/test806.py
r21411 r21412 38 38 md.calving.coeff=4.89e13*np.ones((md.mesh.numberofvertices)) 39 39 md.calving.meltingrate=np.zeros((md.mesh.numberofvertices)) 40 md.levelset.spclevelset=np.n p.nan*np.ones((md.mesh.numberofvertices))40 md.levelset.spclevelset=np.nan*np.ones((md.mesh.numberofvertices)) 41 41 42 42 md.transient.requested_outputs=['default','StrainRateparallel','StrainRateperpendicular','Calvingratex','Calvingratey','CalvingCalvingrate'] -
issm/trunk-jpl/test/NightlyRun/test807.py
r21411 r21412 37 37 md.calving.calvingrate=np.zeros((md.mesh.numberofvertices)) 38 38 md.calving.meltingrate=10000*np.ones((md.mesh.numberofvertices)) 39 md.levelset.spclevelset=np.n p.nan*np.ones((md.mesh.numberofvertices))39 md.levelset.spclevelset=np.nan*np.ones((md.mesh.numberofvertices)) 40 40 41 41 md=solve(md,'Transient')
Note:
See TracChangeset
for help on using the changeset viewer.