import os
import RunAriane
def _make_namelist (minvalue, maxvalue, dir_name):
template_filename = 'namelist_template'
namelist_filename = 'namelist'
with open(os.path.join(dir_name, namelist_filename), 'wt') as namelist:
with open(os.path.join(dir_name, template_filename)) as template:
for line in template.readlines():
if line[2:6] == 'lmin':
namelist.writelines(' lmin= {},\n'.format(minvalue))
elif line[2:6] == 'lmax':
namelist.writelines(' lmax= {},\n'.format(maxvalue))
else:
namelist.writelines(line)
dir_name = './'
! pwd
#for nday in range(args.numberofdays):
for nday in range(1):
print ('Start', nday+1)
_make_namelist(nday+1, nday+2, dir_name)
RunAriane.run_ariane()
RunAriane.rename_results(nday=nday, labeltype='day')
print ('End', nday+1)
/ocean/sallen/allen/research/Meopar/Ariane/mixing_paper/base_jul/FluxesSouth Start 1 End 1
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument(
'numberofdays', help='Number of different dates to do', type=int)
args = parser.parse_args()
main(args)