# Path: rvic/core/share.py
# TIMEUNITS = 'days since ' + REFERENCE_STRING  # do not change (MUST BE DAYS)!
# 
# SECSPERDAY = HOURSPERDAY * SECSPERHOUR
# 
# MINSPERDAY = HOURSPERDAY * MINSPERHOUR
# 
# HOURSPERDAY = 24.
# 
# TIMESTAMPFORM = '%Y-%m-%d-%H'
# 
# Path: rvic/core/log.py
# LOG_NAME = 'rvic'


import numpy as np
from netCDF4 import num2date, date2num
from datetime import datetime
from dateutil.relativedelta import relativedelta
from .share import TIMEUNITS, SECSPERDAY, MINSPERDAY, HOURSPERDAY, \
    TIMESTAMPFORM
from logging import getLogger
from .log import LOG_NAME
                flag = True
        elif self.stop_option == 'end':
            if self.timestamp >= self.end:
                flag = True
        else:
            raise ValueError('unknown stop_option '
                             '{0}'.format(self.stop_option))
        return flag
    # ---------------------------------------------------------------- #

    # ---------------------------------------------------------------- #
    # Time to write restart?
    def __rest(self):
        flag = False
        if self.rest_option in ['nsteps', 'nstep']:
            if self.timesteps >= self.rest_n:
                flag = True
        elif self.rest_option == 'nseconds':
            if (self.timesteps * self.dt / SECSPERDAY) % self.rest_n == 0.0:
                flag = True
        elif self.rest_option == 'nsecond':
            if (self.timesteps * self.dt / SECSPERDAY) >= self.rest_n:
                flag = True
        elif self.rest_option == 'nminutes':
            if (self.timesteps * self.dt / MINSPERDAY) % self.rest_n == 0.0:
                flag = True
        elif self.rest_option == 'nminute':
            if (self.timesteps * self.dt / MINSPERDAY) >= self.rest_n:
                flag = True
        elif self.rest_option == 'nhours':

# Path: rvic/core/share.py
# TIMEUNITS = 'days since ' + REFERENCE_STRING  # do not change (MUST BE DAYS)!
# 
# SECSPERDAY = HOURSPERDAY * SECSPERHOUR
# 
# MINSPERDAY = HOURSPERDAY * MINSPERHOUR
# 
# HOURSPERDAY = 24.
# 
# TIMESTAMPFORM = '%Y-%m-%d-%H'
# 
# Path: rvic/core/log.py
# LOG_NAME = 'rvic'


# Path: rvic/core/time_utility.py
import numpy as np
from netCDF4 import num2date, date2num
from datetime import datetime
from dateutil.relativedelta import relativedelta
from .share import TIMEUNITS, SECSPERDAY, MINSPERDAY, HOURSPERDAY, \
    TIMESTAMPFORM
from logging import getLogger
from .log import LOG_NAME

                flag = True
        elif self.stop_option == 'end':
            if self.timestamp >= self.end:
                flag = True
        else:
            raise ValueError('unknown stop_option '
                             '{0}'.format(self.stop_option))
        return flag
    # ---------------------------------------------------------------- #

    # ---------------------------------------------------------------- #
    # Time to write restart?
    def __rest(self):
        flag = False
        if self.rest_option in ['nsteps', 'nstep']:
            if self.timesteps >= self.rest_n:
                flag = True
        elif self.rest_option == 'nseconds':
            if (self.timesteps * self.dt / SECSPERDAY) % self.rest_n == 0.0:
                flag = True
        elif self.rest_option == 'nsecond':
            if (self.timesteps * self.dt / SECSPERDAY) >= self.rest_n:
                flag = True
        elif self.rest_option == 'nminutes':
            if (self.timesteps * self.dt / MINSPERDAY) % self.rest_n == 0.0:
                flag = True
        elif self.rest_option == 'nminute':
            if (self.timesteps * self.dt / MINSPERDAY) >= self.rest_n:
                flag = True
        elif self.rest_option == 'nhours':

            if (self.timesteps * self.dt / HOURSPERDAY) % self.rest_n == 0.0: