Changeset 2425 in lmdz_wrf


Ignore:
Timestamp:
Mar 26, 2019, 4:13:38 PM (6 years ago)
Author:
lfita
Message:

Fixing last changes tacking into account calnder attribute

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/generic_tools.py

    r2424 r2425  
    719719            removeleap = False
    720720            newdate = advance_cfDate(refdate, timeval, tunits)
    721             print newdate, 'leap Feb;', days_month(newdate.year,2)
    722721            if days_month(newdate.year,2) == 29:
    723                 if newdate.mon == 2 and newdate.day == 28:
     722                if newdate.month == 2 and newdate.day == 28:
    724723                    removeleap = True
    725                 elif newdate.mon > 2: removeleap = True
     724                elif newdate.month > 2: removeleap = True
    726725
    727726        if tunits == 'weeks':
     
    939938            removeleap = False
    940939            if days_month(newdate.year,2) == 29:
    941                 if datei.mon == 2 and datei.day == 28:
     940                if datei.month == 2 and datei.day == 28:
    942941                    totsecs = totsecs - 24.*3600.
    943                 if datei.mon > 2:
     942                if datei.month > 2:
    944943                    totsecs = totsecs - 24.*3600.
    945944
     
    10411040
    10421041    return dateYmdHMS
    1043 
    1044 print datetimeStr_conversion(str(137880),'cfTimeCal,minutes since 1979-12-01_00:00:00,noleap','Y/m/d H-M-S')
    1045 quit()
    1046 
    10471042
    10481043def period_information(idate, edate, totunits):
Note: See TracChangeset for help on using the changeset viewer.