Changeset 1467


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.
Location:
trunk/libIGCM
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/libIGCM/libIGCM_comp/libIGCM_comp.ksh

    r1449 r1467  
    15711571      eval IGCM_sys_Mkdir \${CMIP6_BUF_${comp}} 
    15721572      eval CMIP6_DIR=\${CMIP6_BUF_${comp}} 
    1573  
    15741573      # Modify path from dr2xml_{compname}.xml 
    1575       ${libIGCM}/libIGCM_post/xios_parser.py -v modifyPath --newPath ${CMIP6_DIR} --file dr2xml_${compname}.xml 
    1576  
     1574      if [ X${config_Post_dr2xmlFilePrefix} = XTRUE ]; then 
     1575        ${libIGCM}/libIGCM_post/xios_parser.py -v modifyPath --newPath ${CMIP6_DIR} --filePrefix ${config_UserChoices_JobName} --file dr2xml_${compname}.xml 
     1576      else 
     1577        ${libIGCM}/libIGCM_post/xios_parser.py -v modifyPath --newPath ${CMIP6_DIR} --file dr2xml_${compname}.xml 
     1578      fi 
    15771579      # Overwrite the original file 
    15781580      IGCM_sys_Mv modified.dr2xml_${compname}.xml dr2xml_${compname}.xml 
  • 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.