示例#1
0
 def get_component_instance(self, state_modification_func=lambda x: x):
     emanuel = EmanuelConvection()
     emanuel.current_time_step = timedelta(seconds=300)
     return emanuel
radiation_sw = RRTMGShortwave()
radiation_lw = RRTMGLongwave()
slab = SlabSurface()
simple_physics = SimplePhysics()

store_quantities = [
    'air_temperature', 'air_pressure', 'specific_humidity',
    'air_pressure_on_interface_levels',
    'air_temperature_tendency_from_convection',
    'air_temperature_tendency_from_longwave',
    'air_temperature_tendency_from_shortwave'
]
netcdf_monitor = NetCDFMonitor('rad_conv_eq.nc',
                               store_names=store_quantities,
                               write_on_store=True)
convection.current_time_step = timestep

state = get_default_state(
    [simple_physics, convection, radiation_lw, radiation_sw, slab])

state['air_temperature'].values[:] = 270
state['surface_albedo_for_direct_shortwave'].values[:] = 0.5
state['surface_albedo_for_direct_near_infrared'].values[:] = 0.5
state['surface_albedo_for_diffuse_shortwave'].values[:] = 0.5

state['zenith_angle'].values[:] = np.pi / 2.5
state['surface_temperature'].values[:] = 300.
state['ocean_mixed_layer_thickness'].values[:] = 5
state['area_type'].values[:] = 'sea'

time_stepper = AdamsBashforth([convection, radiation_lw, radiation_sw, slab])