Changeset bf48c8a in flex_extract.git for source/python/classes/EcFlexpart.py
- Timestamp:
- Dec 14, 2018, 11:27:42 AM (5 years ago)
- Branches:
- master, ctbto, dev
- Children:
- 1eca806
- Parents:
- 524ac32
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
source/python/classes/EcFlexpart.py
r092aaf1 rbf48c8a 92 92 from GribUtil import GribUtil 93 93 from mods.tools import (init128, to_param_id, silent_remove, product, 94 my_error, make_dir, get_informations, get_dimensions) 94 my_error, make_dir, get_informations, get_dimensions, 95 execute_subprocess) 95 96 from MarsRetrieval import MarsRetrieval 96 97 import mods.disaggregation as disaggregation … … 1427 1428 1428 1429 # Fortran program creates file fort.15 (with u,v,etadot,t,sp,q) 1429 p = subprocess.check_call([os.path.join( 1430 c.exedir, _config.FORTRAN_EXECUTABLE)], shell=True) 1430 execute_subprocess([os.path.join(c.exedir, 1431 _config.FORTRAN_EXECUTABLE)], 1432 error_msg='FORTRAN PROGRAM FAILED!')#shell=True) 1433 1431 1434 os.chdir(pwd) 1432 1435 #============================================================================================ … … 1507 1510 1508 1511 if c.format.lower() == 'grib2': 1509 p = subprocess.check_call(['grib_set', '-s', 'edition=2,', 1510 'productDefinitionTemplateNumber=8', 1511 ofile, ofile + '_2']) 1512 p = subprocess.check_call(['mv', ofile + '_2', ofile]) 1512 execute_subprocess(['grib_set', '-s', 'edition=2,' + 1513 'productDefinitionTemplateNumber=8', 1514 ofile, ofile + '_2'], 1515 error_msg='GRIB2 CONVERSION FAILED!') 1516 1517 execute_subprocess(['mv', ofile + '_2', ofile], 1518 error_msg='RENAMING FOR NEW GRIB2 FORMAT ' 1519 'FILES FAILED!') 1513 1520 1514 1521 if c.ectrans and not c.ecapi: 1515 p = subprocess.check_call(['ectrans', '-overwrite', '-gateway', 1516 c.gateway, '-remote', c.destination, 1517 '-source', ofile]) 1522 execute_subprocess(['ectrans', '-overwrite', '-gateway', 1523 c.gateway, '-remote', c.destination, 1524 '-source', ofile], 1525 error_msg='TRANSFER TO LOCAL SERVER FAILED!') 1518 1526 1519 1527 if c.ecstorage and not c.ecapi: 1520 p = subprocess.check_call(['ecp', '-o', ofile, 1521 os.path.expandvars(c.ecfsdir)]) 1528 execute_subprocess(['ecp', '-o', ofile, 1529 os.path.expandvars(c.ecfsdir)], 1530 error_msg='COPY OF FILES TO ECSTORAGE ' 1531 'AREA FAILED!') 1522 1532 1523 1533 if c.outputdir != c.inputdir: 1524 p = subprocess.check_call(['mv', 1525 os.path.join(c.inputdir, ofile), 1526 c.outputdir]) 1534 execute_subprocess(['mv', os.path.join(c.inputdir, ofile), 1535 c.outputdir], 1536 error_msg='RELOCATION OF OUTPUT FILES ' 1537 'TO OUTPUTDIR FAILED!') 1527 1538 1528 1539 return … … 1604 1615 # afterwards switch back to the working dir 1605 1616 os.chdir(c.outputdir) 1606 p = subprocess.check_call([1607 os.path.expandvars(os.path.expanduser(c.flexpartdir))1608 + '/../FLEXPART_PROGRAM/grib2flexpart', 'useAvailable', '.'])1617 cmd = [os.path.expandvars(os.path.expanduser(c.flexpartdir)) + 1618 '/../FLEXPART_PROGRAM/grib2flexpart', 'useAvailable', '.'] 1619 execute_subprocess(cmd) 1609 1620 os.chdir(pwd) 1610 1621
Note: See TracChangeset
for help on using the changeset viewer.