Changeset 739 in lmdz_wrf


Ignore:
Timestamp:
May 2, 2016, 8:26:14 PM (9 years ago)
Author:
lfita
Message:

Adding to `sellonlatbox', permanent output of longitude and latitude variables
file name with '-', instead of ',', when multiple variables are selected

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/nc_var_tools.py

    r738 r739  
    93099309    check_arguments(fname,values,arguments,',')
    93109310
    9311     ofile = 'sellonlatbox_' + varn + '.nc'
    93129311
    93139312    lonn = values.split(',')[0]
     
    93439342    if varn == 'all':
    93449343        varns = objfile.variables
     9344        filevarn = varn
    93459345    elif varn.find(',') != -1:
    93469346        varns = varn.split(',')
     9347        filevarn = varn.replace(',','-')
    93479348    else:
    93489349        varns = [varn]
     9350        filevarn = varn
     9351
     9352    ofile = 'sellonlatbox_' + filevarn + '.nc'
    93499353
    93509354# Lon/lat box
     
    94469450    newdim = newncobj.createDimension(lonn, newdimx)
    94479451    newdim = newncobj.createDimension(latn, newdimy)
     9452
     9453# Adding lonn/latn to the output file
     9454    if not searchInlist(varns,lonn): varns.append(lonn)
     9455    if not searchInlist(varns,latn): varns.append(latn)
    94489456
    94499457    for vn in varns:
Note: See TracChangeset for help on using the changeset viewer.