Changeset c77630a in flex_extract.git for Source/Python/Classes/EcFlexpart.py
- Timestamp:
- Aug 13, 2019, 12:32:22 PM (5 years ago)
- Branches:
- master, ctbto, dev
- Children:
- 0690a6c
- Parents:
- 33a4ccc
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Source/Python/Classes/EcFlexpart.py
r8c1d175 rc77630a 1094 1094 1095 1095 print("outputfile = " + fnout) 1096 f_handle = open(fnout, 'w ')1097 h_handle = open(hnout, 'w ')1098 g_handle = open(gnout, 'w ')1096 f_handle = open(fnout, 'wb') 1097 h_handle = open(hnout, 'wb') 1098 g_handle = open(gnout, 'wb') 1099 1099 1100 1100 # read message for message and store relevant data fields, where … … 1402 1402 # write original time step to flux file as usual 1403 1403 fluxfile = GribUtil(os.path.join(c.inputdir, fluxfilename)) 1404 fluxfile.set_keys(tmpfile, filemode='a ', strict=True,1404 fluxfile.set_keys(tmpfile, filemode='ab', strict=True, 1405 1405 wherekeynames=['paramId'], wherekeyvalues=[142], 1406 1406 keynames=['perturbationNumber','date','time','stepRange','values'], … … 1408 1408 date.hour*100, 0, lsp_new_np[inumb,:,it]], 1409 1409 ) 1410 fluxfile.set_keys(tmpfile, filemode='a ', strict=True,1410 fluxfile.set_keys(tmpfile, filemode='ab', strict=True, 1411 1411 wherekeynames=['paramId'], wherekeyvalues=[143], 1412 1412 keynames=['perturbationNumber','date','time','stepRange','values'], … … 1416 1416 1417 1417 # rr for first subgrid point is identified by step = 1 1418 fluxfile.set_keys(tmpfile, filemode='a ', strict=True,1418 fluxfile.set_keys(tmpfile, filemode='ab', strict=True, 1419 1419 wherekeynames=['paramId'], wherekeyvalues=[142], 1420 1420 keynames=['perturbationNumber','date','time','stepRange','values'], … … 1422 1422 date.hour*100, '1', lsp_new_np[inumb,:,it+1]] 1423 1423 ) 1424 fluxfile.set_keys(tmpfile, filemode='a ', strict=True,1424 fluxfile.set_keys(tmpfile, filemode='ab', strict=True, 1425 1425 wherekeynames=['paramId'], wherekeyvalues=[143], 1426 1426 keynames=['perturbationNumber','date','time','stepRange','values'], … … 1430 1430 1431 1431 # rr for second subgrid point is identified by step = 2 1432 fluxfile.set_keys(tmpfile, filemode='a ', strict=True,1432 fluxfile.set_keys(tmpfile, filemode='ab', strict=True, 1433 1433 wherekeynames=['paramId'], wherekeyvalues=[142], 1434 1434 keynames=['perturbationNumber','date','time','stepRange','values'], … … 1436 1436 date.hour*100, '2', lsp_new_np[inumb,:,it+2]] 1437 1437 ) 1438 fluxfile.set_keys(tmpfile, filemode='a ', strict=True,1438 fluxfile.set_keys(tmpfile, filemode='ab', strict=True, 1439 1439 wherekeynames=['paramId'], wherekeyvalues=[143], 1440 1440 keynames=['perturbationNumber','date','time','stepRange','values'], … … 1466 1466 1467 1467 gribfile.copy_dummy_msg(ifile, keynames=['paramId'], 1468 keyvalues=[142], filemode='w ')1468 keyvalues=[142], filemode='wb') 1469 1469 1470 1470 gribfile.copy_dummy_msg(ifile, keynames=['paramId'], 1471 keyvalues=[143], filemode='a ')1471 keyvalues=[143], filemode='ab') 1472 1472 1473 1473 return … … 1573 1573 fortfile = os.path.join(c.inputdir, 'fort.' + k) 1574 1574 silent_remove(fortfile) 1575 fdict[k] = open(fortfile, 'w ')1575 fdict[k] = open(fortfile, 'wb') 1576 1576 #============================================================================================ 1577 1577 # create correct timestamp from the three time informations … … 1608 1608 # if 'olddate' not in locals() or cdate != olddate: 1609 1609 # fwrf = open(os.path.join(c.outputdir, 1610 # 'WRF' + cdate + '.' + ctime + '.000.grb2'), 'w ')1610 # 'WRF' + cdate + '.' + ctime + '.000.grb2'), 'wb') 1611 1611 # olddate = cdate[:] 1612 1612 #============================================================================================
Note: See TracChangeset
for help on using the changeset viewer.