Changeset 2483 in lmdz_wrf for trunk/tools
- Timestamp:
- Apr 29, 2019, 8:51:11 PM (7 years ago)
- File:
-
- 1 edited
-
trunk/tools/nc_var_tools.py (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/nc_var_tools.py
r2481 r2483 2584 2584 self.unitsval = units 2585 2585 2586 if not gen.searchInlist(attvar, 'calendar'): 2586 if not gen.searchInlist(attvar, 'calendar') or \ 2587 not gen.searchInlist(attvar, 'calendar_type'): 2587 2588 print warnmsg 2588 2589 print ' ' + fname + ": time variable '", tname, "' does not " + \ … … 2591 2592 cal = 'gregorian' 2592 2593 else: 2593 self.calendar = times.getncattr('calendar') 2594 atimes = times.ncattrs() 2595 if gen.searchInlist(atimes, 'calendar'): 2596 self.calendar = times.getncattr('calendar') 2597 elif gen.searchInlist(atimes, 'calendar_type'): 2598 self.calendar = times.getncattr('calendar_type') 2594 2599 cal = times.getncattr('calendar') 2595 2600 … … 25557 25562 # Checking calendar consistency 25558 25563 if calendar != timec: 25559 print err msg25564 print errormsg 25560 25565 print ' ' + fname + ": different calendars found !!" 25561 25566 print " input calendar: '" + calendar + "' calendar in data '" +timec + "'" … … 31721 31726 'since [YYYY]-[MM]-[DD] [HH]:[MM]:[SS]' 31722 31727 quit(-1) 31723 if not gen.searchInlist(timeattrs,'calendar'): 31728 if not gen.searchInlist(timeattrs,'calendar') or \ 31729 not gen.searchInlist(timeattrs,'calendar_type'): 31724 31730 print warnmsg 31725 31731 print ' ' + fname + ": time variable '" + variable + "' without calendar !!" … … 31728 31734 origcal = 'gregorian' 31729 31735 else: 31730 origcal = otime.getncattr('calendar') 31736 if gen.searchInlist(timeattrs,'calendar'): 31737 origcal = otime.getncattr('calendar') 31738 if gen.searchInlist(timeattrs,'calendar_type'): 31739 origcal = otime.getncattr('calendar_type') 31740 otime.delncattr('calendar_type') 31741 otime.setncattr('calendar',origcal) 31731 31742 31732 31743 for opn in operations:
Note: See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/LMDZ_WRF/chrome/site/your_project_logo.png)