


# check if all COSMO output files are in project folder


from datetime import datetime, timedelta
import os
import sys


root = '/project/d73/output/production_run_02'
sub_folder = 'cosmo_output'


#root = '/scratch/snx1600/gkuhl/smartcarb/mother'
#sub_folder = 'cosmo/output'


starttime = datetime(2015,7,1)
hstart = 0
hstop = 72

for i in range(100):
    hstart = 72 * i
    hstop = hstart + 72

    path = '2015%02d0100_%d_%d' % (starttime.month, hstart, hstop)
    print(path)

    for hours in range(hstart, hstop):

        time = starttime + timedelta(hours=hours)
        fn = time.strftime('lffd%Y%m%d%H.nc')
        fn = os.path.join(root, path, sub_folder, fn)

        if not os.path.exists(fn):
            print(fn)
            sys.exit(1)





