Changeset 871 in lmdz_wrf for trunk


Ignore:
Timestamp:
Jun 18, 2016, 2:35:15 PM (8 years ago)
Author:
lfita
Message:

Fixing printing of all values in a single line in ivars' and idims'

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/nc_var_tools.py

    r870 r871  
    15661566  ncvars = ncf.variables
    15671567  allvars=''
     1568  ivar = 0
    15681569  for var in ncvars:
    15691570      print var
    1570       allvars=allvars + ':' + var
    1571 
     1571      if ivar == 0:
     1572          allvars = var
     1573      else:
     1574          allvars = allvars + ':' + var
     1575      ivar = ivar + 1
    15721576  print '  # allvars= ' + allvars
    15731577  ncf.close()
     
    15891593  ncdims = ncf.dimensions
    15901594  alldims=''
     1595  idim = 0
    15911596  for dim in ncdims:
    15921597      print dim
    1593       alldims=alldims + ':' + dim
     1598      if idim == 0:
     1599          alldims=dim
     1600      else:
     1601          alldims = alldims + ':' + dim
     1602      idim = idim + 1
    15941603
    15951604  print '  # alldims= ' + alldims
Note: See TracChangeset for help on using the changeset viewer.