3 ! Updated to CESM1.0.3 (CAM5.1.01) by Balwinder.Singh@pnnl.gov
6 !---------------------------------------------------------------------------------
7 ! Module to compute the upper boundary condition for temperature (dry static energy)
8 ! and trace gases. The standard CAM version does nothing.
10 ! original code by Stacy Walters
11 ! adapted by B. A. Boville
12 !---------------------------------------------------------------------------------
14 use shr_kind_mod, only: r8 => shr_kind_r8
16 use ppgrid, only: pcols, pverp
17 use constituents, only: pcnst
19 use module_cam_support, only: pcols, pverp, pcnst =>pcnst_runtime
28 public :: ubc_defaultopts ! set default values of namelist variables
29 public :: ubc_setopts ! get namelist input
30 public :: ubc_init ! global initialization
32 public :: ubc_timestep_init ! time step initialization
34 public :: ubc_get_vals ! get ubc values for this step
36 !================================================================================================
38 !================================================================================================
40 subroutine ubc_defaultopts(tgcm_ubc_file_out, snoe_ubc_file_out)
41 !-----------------------------------------------------------------------
42 ! Purpose: Return default runtime options
43 !-----------------------------------------------------------------------
45 character(len=*), intent(out), optional :: tgcm_ubc_file_out
46 character(len=*), intent(out), optional :: snoe_ubc_file_out
47 !-----------------------------------------------------------------------
49 end subroutine ubc_defaultopts
51 !================================================================================================
53 subroutine ubc_setopts(tgcm_ubc_file_in, snoe_ubc_file_in)
54 !-----------------------------------------------------------------------
55 ! Purpose: Set runtime options
56 !-----------------------------------------------------------------------
58 character(len=*), intent(in), optional :: tgcm_ubc_file_in
59 character(len=*), intent(in), optional :: snoe_ubc_file_in
60 !-----------------------------------------------------------------------
62 end subroutine ubc_setopts
64 !===============================================================================
67 !-----------------------------------------------------------------------
68 ! Initialization of time independent fields for the upper boundary condition
69 ! Calls initialization routine for MSIS, TGCM and SNOE
70 !-----------------------------------------------------------------------
72 end subroutine ubc_init
74 !===============================================================================
76 subroutine ubc_timestep_init(state)
77 use physics_types,only : physics_state
78 use ppgrid, only : begchunk, endchunk
80 !-----------------------------------------------------------------------
81 ! timestep dependent setting
82 !-----------------------------------------------------------------------
84 type(physics_state), intent(in):: state(begchunk:endchunk)
86 end subroutine ubc_timestep_init
88 !===============================================================================
90 subroutine ubc_get_vals (lchnk, ncol, ntop_molec, pint, zi, msis_temp, ubc_mmr)
91 !-----------------------------------------------------------------------
92 ! interface routine for vertical diffusion and pbl scheme
93 !-----------------------------------------------------------------------
95 !------------------------------Arguments--------------------------------
96 integer, intent(in) :: lchnk ! chunk identifier
97 integer, intent(in) :: ncol ! number of atmospheric columns
98 integer, intent(in) :: ntop_molec ! top of molecular diffusion region (=1)
99 real(r8), intent(in) :: pint(pcols,pverp) ! interface pressures
100 real(r8), intent(in) :: zi(pcols,pverp) ! interface geoptl height above sfc
102 real(r8), intent(out) :: ubc_mmr(pcols,pcnst) ! upper bndy mixing ratios (kg/kg)
103 real(r8), intent(out) :: msis_temp(pcols) ! upper bndy temperature (K)
105 end subroutine ubc_get_vals