import exoplasim as exo

model = exo.Model(workdir='model_run', modelname='model', outputtype='.nc',
                  resolution='T21', layers=10, ncpus=4, precision=8, crashtolerant=True)

model.configure(timestep=45, runsteps=11520, otherargs={'NSTPW@plasim_namelist':'160'},
                physicsfilter='gp|exp|sp', restarfile=,
                flux=1367, startemp=5780,
                year=360, eccentricity=0.016715, fixedorbit=True,
                rotationperiod=1, obliquity=23.441, lonvernaleq=102.7,
                synchronous=False, substellarlon=180, desync=0, tlcontrast=0,
                gravity=9.80665, radius=1,
                landmap=, topomap=,
                pN2=0.7809, pO2=0.2095, pAr=0.0093, pCO2=300e-6, ozone=True,
                pH2=0, pHe=0, pNe=0, pKr=0, pH2O=0,
                wetsoil=True, vegetation=2, vegaccel=1, initgrowth=0.5,
                glaciers={'toggle': True, 'mindepth': 2, 'initialh': -1}
               )

model.cfgpostprocessor(times=12,extension='.nc')

model.exportcfg()

model.runtobalance(baseline=10, maxyears=300, minyears=20, timelimit=480, clean=True)

model.finalize('model_out', allyears=True, clean=True, keeprestarts=True)

model.save()