Changeset 2685 in lmdz_wrf for trunk


Ignore:
Timestamp:
Jul 26, 2019, 2:42:36 PM (5 years ago)
Author:
lfita
Message:

Adding new checks for 'varLN' and 'varU'

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/create_OBSnetcdf.py

    r2684 r2685  
    14761476
    14771477Nvariables=len(description['varN'])
     1478NlongN=len(description['varLN'])
     1479NvarU=len(description['varU'])
    14781480formats = description['varTYPE']
     1481
     1482if Nvariables != NlongN:
     1483    print errormsg
     1484    print '  ' + main + ': number of variables:', Nvariables,' and number of ' +     \
     1485      'long names', NlongN,' does not coincide!!'
     1486    print '    * what is found is _______'
     1487    if Nvariables > NlongN:
     1488        Nshow = NlongN
     1489        for ivar in range(Nshow):
     1490            print ivar,'      ',description['varN'][ivar],':', description['varLN'][ivar],\
     1491               '[', description['varU'][ivar], '] fmt:', formats[ivar]
     1492        print '      missing values for:', description['varN'][Nshow:Nvariables+1]
     1493    else:
     1494        Nshow = Nvariables
     1495        for ivar in range(Nshow):
     1496            print ivar,'      ',description['varN'][ivar],':', description['varLN'][ivar],\
     1497               '[', description['varU'][ivar], '] fmt:', formats[ivar]
     1498        print '      excess of long names for :', description['varLN'][Nshow:NlongN+1]
     1499
     1500    quit(-1)
     1501
     1502if Nvariables != NvarU:
     1503    print errormsg
     1504    print '  ' + main + ': number of variables:', Nvariables,' and number of ' +     \
     1505      'units', NvarU,' does not coincide!!'
     1506    print '    * what is found is _______'
     1507    if Nvariables > NvarU:
     1508        Nshow = NvarU
     1509        for ivar in range(Nshow):
     1510            print ivar,'      ',description['varN'][ivar],':', description['varLN'][ivar],\
     1511               '[', description['varU'][ivar], '] fmt:', formats[ivar]
     1512        print '      missing values for:', description['varN'][Nshow:Nvariables+1]
     1513    else:
     1514        Nshow = Nvariables
     1515        for ivar in range(Nshow):
     1516            print ivar,'      ',description['varN'][ivar],':', description['varLN'][ivar],\
     1517               '[', description['varU'][ivar], '] fmt:', formats[ivar]
     1518        print '      excess of units for :', description['varU'][Nshow:NvarU+1]
     1519
     1520    quit(-1)
     1521
     1522
     1523print 'Number of variables', Nvariables
     1524print 'Number of long names', len(description['varLN'])
     1525
    14791526
    14801527if len(formats) != Nvariables:
Note: See TracChangeset for help on using the changeset viewer.