Exemplo n.º 1
0
from numpy import *

Ndays = 5.0  # Total length of run (days)

kwargs = {}
kwargs["lat"] = ["1.", "2."]
kwargs["solin"] = ["300.", "310."]
kwargs["dt"] = 60.0 * 10.0
# kwargs['RestartFile']     = 'two_column.nc'
kwargs["OutputFile"] = "two_column.nc"
kwargs["OutputFreq"] = 60 * 10.0
# kwargs['MonitorFields']   = ['U','T','q']
# kwargs['MonitorFreq']     = 60 *60.*4.

# Set up federation
dyn = climt.dynamics(scheme="two_column")
tur = climt.turbulence()
rad = climt.radiation(scheme="cam3")
con = climt.convection(scheme="hard")
oce = climt.ocean()
fed = climt.federation(dyn, tur, rad, con, oce, **kwargs)

# Run
fed.step(Ndays * 86400.0)

try:
    from matplotlib.pylab import *

    show()
except:
    pass
Exemplo n.º 2
0
from numpy import *

Ndays         = 5.  # Total length of run (days)

kwargs={}
kwargs['lat']            = ['1.','2.']
kwargs['solin']            = ['300.','310.']
kwargs['dt']              = 60.*10.
#kwargs['RestartFile']     = 'two_column.nc'
kwargs['OutputFile']      = 'two_column.nc'
kwargs['OutputFreq']      = 60*10.
#kwargs['MonitorFields']   = ['U','T','q']
#kwargs['MonitorFreq']     = 60 *60.*4.

# Set up federation
dyn  = climt.dynamics(scheme='two_column')
tur  = climt.turbulence()
rad  = climt.radiation(scheme='cam3')
con  = climt.convection(scheme='hard')
oce  = climt.ocean()
fed  = climt.federation(dyn,tur,rad,con,oce, **kwargs)

# Run
fed.step(Ndays*86400.)

try:
    from matplotlib.pylab import *
    show()
except:
    pass
Exemplo n.º 3
0
kwargs['dt']              = 60.*5.
#kwargs['RestartFile']     = 'held_hou.nc'
kwargs['OutputFile']      = 'held_hou.nc'
kwargs['OutputFreq']      = 86400. * 5.
kwargs['MonitorFields']   = ['psi','U','T','q']
kwargs['MonitorFreq']     = 60 *60.*4.
kwargs['do_srf_lat_flx']  = 0
kwargs['do_srf_sen_flx']  = 0

# Grid
kwargs['lat'] = (arange(nlat)+0.5)*(MaxLat-MinLat)/nlat + MinLat
kwargs['lev'] = (arange(nlev)+0.5)*(MaxLev-MinLev)/nlev + MinLev

kwargs['q'] = zeros((nlev,nlat,1)) + 1.e-9
kwargs['q'][nlev*4/5,:] =1.

# Set up federation
dyn  = climt.dynamics(scheme='axisymmetric')
tur  = climt.turbulence()
fed  = climt.federation(dyn,tur, **kwargs)

# Run
fed.step(Ndays*86400.)

try:
    from matplotlib.pylab import *
    show()
except:
    pass

Exemplo n.º 4
0
kwargs['Fixed']           = ['q']

# Initial fields
kwargs['T'] = zeros((nlev,nlat)) + 100.
kwargs['q'] = zeros((nlev,nlat)) + 1.e-9

# Run length (days)
Ndays  = 3000  
########################## End user adjustble

kwargs['lat']  = (arange(nlat)+0.5)*(MaxLat-MinLat)/nlat + MinLat
kwargs['lev']  = (arange(nlev)+0.5)*(MaxLev-MinLev)/nlev + MinLev

# Set up federation
tur = climt.turbulence()
dyn = climt.dynamics()
ocn = climt.ocean()
con = climt.convection()
fed  = climt.federation(dyn, tur, ocn, con, **kwargs)

# Run
Nsteps = int(Ndays*86400./kwargs['dt'])
ins = climt.insolation(lat=kwargs['lat'], avg='annual')
CoolingRate = 0./86400.

for l in range(Nsteps):
    fed.State['SrfRadFlx'] = ins.State['solin']*0.5 - fed['stebol']*fed.State['Ts']**4
    fed.step()
    fed.State['T'][4:nlev,:,:] -= CoolingRate*kwargs['dt']*ones((nlev-4,nlat,1))

try: