Ignore:
Timestamp:
07/13/18 10:18:25 (6 years ago)
Author:
sdipsl
Message:
  • Add option dr2xmlFilePrefix under the [Post] section of config.card. It will add the JobName? as the prefix of CMIP6 files produced by the WF.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libIGCM/libIGCM_post/xios_parser.py

    r1445 r1467  
    196196            if not elem.attrib.get('mode') == 'read': 
    197197                name=elem.attrib.get('name') 
    198                 elem.set('name', os.path.normpath(args.newPath[0]) + '/' + os.path.normpath(name)) 
     198                if args.filePrefix is not None: 
     199                    elem.set('name', os.path.normpath(args.newPath[0]) + '/' + args.filePrefix[0] + '_' + os.path.normpath(name)) 
     200                else: 
     201                    elem.set('name', os.path.normpath(args.newPath[0]) + '/' + os.path.normpath(name)) 
    199202                if args.verbosity >= 2: print elem.tag, elem.attrib 
    200  
     203                     
    201204        # Write out the results 
    202205        if args.verbosity >= 1: print '\nWriting dr2xml_def_xml=','modified.' + inputFile 
     
    310313        parser_check = subparsers.add_parser('modifyPath', help='Will make sure dr2xml write files where it should be') 
    311314        parser_check.add_argument('--newPath', nargs=1, required=True, help='Directory output for file produced from dr2xml_file type') 
     315        parser_check.add_argument('--filePrefix', nargs=1, required=False, help='Prefix to be added to file produced from dr2xml_file type') 
    312316        parser_check.add_argument('--file', nargs='+', required=True, help='XIOS xml dr2xml_file type') 
    313317        parser_check.set_defaults(func=modifyPath) 
Note: See TracChangeset for help on using the changeset viewer.