示例#1
0
import logging

import numpy as np

from isca import IscaCodeBase, DryCodeBase, Experiment, DiagTable, Namelist, FailedRunError, log
from isca.util import exp_progress, run_cli

expname = 'held_suarez_basic'
cb = DryCodeBase(repo='https://github.com/execlim/isca', commit='v1.0')


NDAYS = 10
NRUNS = 4                    # total sim time = NDAYS*NRUNS
RESOLUTION = 'T42', 25

held_suarez_configuration = {
    # TEMPERATURE PROFILE
    't_zero': 315,     # maximum surface temperature forcing
    't_strat': 200,    # statospheric temperature constant
    'delh': 60,        # equator-pole temperature gradient
    'delv': 10.,       # vertical potential temperature gradient

    # RELAXATION TIMESCALES
    'ka': -20,         # Newtonian cooling timescale in atmosphere
    'ks': -5,          # Newtonian cooling timescale at surface
    'kf': -1,          # Rayleigh friction (pos. = seconds, neg. = days)
    }

namelist = Namelist({
    # model settings
    'main_nml': {
def setup_held_suarez_codebase():
    cb = DryCodeBase.from_directory(GFDL_BASE)
    # cb.compile()  # compile the source code to working directory $GFDL_WORK/codebase
    return cb
示例#3
0
import numpy as np

from isca import DryCodeBase, DiagTable, Experiment, Namelist, GFDL_BASE

NCORES = 16
RESOLUTION = 'T42', 25  # T42 horizontal resolution, 25 levels in pressure

# a CodeBase can be a directory on the computer,
# useful for iterative development
cb = DryCodeBase.from_directory(GFDL_BASE)

# or it can point to a specific git repo and commit id.
# This method should ensure future, independent, reproducibility of results.
# cb = DryCodeBase.from_repo(repo='https://github.com/isca/isca', commit='isca1.1')

# compilation depends on computer specific settings.  The $GFDL_ENV
# environment variable is used to determine which `$GFDL_BASE/src/extra/env` file
# is used to load the correct compilers.  The env file is always loaded from
# $GFDL_BASE and not the checked out git repo.

cb.compile(
)  # compile the source code to working directory $GFDL_WORK/codebase

# create an Experiment object to handle the configuration of model parameters
# and output diagnostics

exp_name = 'held_suarez_default'
exp = Experiment(exp_name, codebase=cb)

#Tell model how to write diagnostics
diag = DiagTable()
示例#4
0
def test_dry_codebase():
    cb = DryCodeBase.from_directory(GFDL_BASE)
    cb.compile()