PUBLIC INTERFACE / ROUTINES / NAMELIST / ERRORS


module atmosphere_mod

     Contact:   B. Wyman
     Reviewers:
     Change history: WebCVS Log for coupled/atmosphere.f90


OVERVIEW


     Atmospheric driver for the B-grid dynamics and modular column physics.
     This module provides an interface to the B-grid dynamical core
     and a B-grid interface to the modular column physics. 
     A similar interface for the spectral dynamical core exists
     that may be easily switched with this interface.


OTHER MODULES USED


   bgrid_core_driver_mod
   bgrid_prog_var_mod
   bgrid_horiz_mod
   bgrid_vert_mod
   bgrid_change_grid_mod
   bgrid_physics_mod
   time_manager_mod
   fms_mod
   mpp_domains_mod
   field_manager_mod
   tracer_manager_mod


PUBLIC INTERFACE


  use atmosphere_mod [,only: atmosphere_init,       atmosphere_end,
                             atmosphere_down,       atmosphere_up,
                             atmosphere_resolution, atmosphere_boundary,
                             get_bottom_mass,       get_bottom_wind,
                             get_atmosphere_axes,   atmosphere_domain,
                             surf_diff_type       ]

  NOTES

     Optional namelist interface &atmosphere_nml may be
     read from file input.nml.
                                

PUBLIC DATA


     type(surf_diff_type)

     Data structure containing surface terms computed by the
     vertical diffusion scheme.  The surface terms are needed
     for energy conservation when coupling component models.
     See the documentation of the vert_diff module for details
     on the contents of this variable.


PUBLIC ROUTINES


call atmosphere_init ( Time_init, Time, Time_step, Surf_diff )

DESCRIPTION
   Initialization routine for atmosphere_mod.
   This routine must be called before calling subroutine atmosphere.

INPUT
   Time_init   The base (or initial) time of the experiment.
                  [time_type]

   Time        The current time.  [time_type]

   Time_step   The atmospheric model/physics time step.  [time_type]

INPUT/OUTPUT
   Surf_diff   The surface terms for vertical diffusion that are exchanged
               with other component models. On input fields have not been
               allocated, on output all arrays are allocated.
                 [type(surf_diff_type)]



call atmosphere_end ( Time ) DESCRIPTION Termination routine for atmosphere_mod. INPUT Time The current time. [time_type]
call atmosphere_down ( Time, frac_land, t_surf, albedo, rough_mom, u_star, b_star, q_star, dtau_du, dtau_dv, tau_x, tau_y, gust, coszen, flux_sw, flux_sw_dir, flux_sw_dif, flux_sw_down_vis_dir, flux_sw_down_total_dir, flux_sw_down_vis_dif, flux_sw_down_total_dif, flux_sw_vis, flux_sw_vis_dir, flux_sw_vis_dif, flux_lw, Surf_diff ) DESCRIPTION This routine calls the bgrid dynamical core and the "downward pass" of the atmospheric physics. It should only be called once per time step and before calling atmosphere_up. INPUT Time The current time. [type(time_type)] frac_land The fraction (0. to 1.) of the Earth's surface beneath a grid box that is covered by land. The remaining fraction is assumed to be covered by open ocean or sea ice. [real, dimension(:,:)] t_surf The mean surface (skin) temperature (in deg k). [real, dimension(:,:)] albedo The mean surface albedo. [real, dimension(:,:)] rough_mom surface roughness for momentum (m) [real, dimension(:,:)] u_star friction velocity [real, dimension(:,:)] b_star buoyancy scale [real, dimension(:,:)] q_star moisture scale [real, dimension(:,:)] dtau_du derivative of surface stress w.r.t. the lowest level zonal wind speed [real, dimension(:,:)] dtau_dv derivative of surface stress w.r.t. the lowest level meridional wind speed [real, dimension(:,:)] INPUT/OUTPUT tau_x zonal wind stress [real, dimension(:,:)] tau_y meridional wind stress [real, dimension(:,:)] Surf_diff surface diffusion terms computed by the vertical diffusion scheme [type(surf_diff_type)] OUTPUT gust wind gustiness [real, dimension(:,:)] coszen cosine of the zenith angle [real, dimension(:,:)] flux_sw net shortwave surface flux (down minus up) (in watts/m**2) [real, dimension(:,:)] flux_lw downward longwave surface flux (in watts/m**2) [real, dimension(:,:)] NOTE All two-dimenional fields must have the same size. They are typically dimensioned for the compute domain (i.e., no halos).
call atmosphere_up ( Time, frac_land, Surf_diff, lprec, fprec ) DESCRIPTION This routine calls the "upward pass" of the atmospheric physics, B-grid diagnostics, and time differencing. The prognostic variables are advanced to the next time step. It should only be called once per time step and after calling atmosphere_down. INPUT Time The current time. [type(time_type)] frac_land The fraction (0. to 1.) of the Earth's surface beneath a grid box that is covered by land. The remaining fraction is assumed to be covered by open ocean or sea ice. [real, dimension(:,:)] INPUT/OUTPUT Surf_diff surface diffusion terms computed by the vertical diffusion scheme [type(surf_diff_type)] OUTPUT lprec liquid precipitation rate (rain) in kg/m2/s [real, dimension(:,:)] fprec frozen precipitation rate (snow) in kg/m2/s [real, dimension(:,:)] NOTE All two-dimenional fields must have the same size. They are typically dimensioned for the compute domain (i.e., no halos).
call get_bottom_mass ( t_bot, q_bot, p_bot, z_bot, p_surf ) DESCRIPTION Returns quantities at the lowest model level and the surface. The fields are dimensioned for the mass grid's compute domain. OUTPUT t_bot temperature at lowest model level (deg k) [real, dimension(:,:)] q_bot specific humidity at lowest model level (kg/kg) [real, dimension(:,:)] p_bot pressure at lowest model level (pa) [real, dimension(:,:)] z_bot height above the surface for the lowest model level (m) [real, dimension(:,:)] p_surf surface pressure (pa) [real, dimension(:,:)]
call get_bottom_wind ( u_bot, v_bot ) DESCRIPTION Returns quantities at the lowest model level. The fields are dimensioned for the velocity grid's compute domain. OUTPUT u_bot zonal wind component at lowest model level (m/s) [real, dimension(:,:)] v_bot meridional wind component at lowest model level (m/s) [real, dimension(:,:)]
call get_atmosphere_axes ( axes ) OUTPUT axes The axis identifiers for the atmospheric grids. The size of axes must be least 1 but not greater than 4. The axes are returned in the order (/ x, y, p_full, p_half /). [integer, dimension(:)]
call atmosphere_resolution ( nlon, nlat [, global] ) DESCRIPTION Returns the resolution of compute domain for either the current processor or the global domain. OUTPUT nlon The number of longitude points in the compute domain. [integer] nlat The number of latitude points in the compute domain. [integer] OPTIONAL INPUT global Flag that specifies whether the returned compute domain size is for the global grid (TRUE) or for the current processor (FALSE). [logical, default: FALSE]
call atmosphere_boundary ( blon, blat [, global] ) DESCRIPTION Returns the grid box edges of compute domain for either the current processor or the global domain. OUTPUT blon The west-to-east longitude edges of grid boxes (in radians). [real, dimension(nlon+1)] blat The south-to-north latitude edges of grid boxes (in radians). [real, dimension(nlat+1)] OPTIONAL INPUT global Flag that specifies whether the returned grid box edges are for the global grid (TRUE) or for the current processor (FALSE). [logical, default: FALSE] NOTE The size of the output arguments, blon and blat, must be +1 more than the output arguments for call atmosphere_resolution, nlon+1 and nlat+1, respectively.
call atmosphere_domain ( Domain ) OUTPUT Domain The domain2d variable describing the grid used for coupling. For the B-grid, this corresponds to the temperature grid without halos. [type(domain2d)]

NAMELIST


&atmosphere_nml

 physics_window  The number of "i" and "j" rows processed each time the
                 modular physics is called. To process the entire domain
                 use physics_window = 0,0.
                    [integer, default: physics_window = 0,1]


ERROR MESSAGES


FATAL errors from get_atmosphere_axes in atmosphere_mod

    size of argument is incorrect
        The size of the argument to get_atmosphere_axes must be
        between 1 and 4.