SCALE-RM
scale_atmos_phy_rd_common.F90
Go to the documentation of this file.
1 !-------------------------------------------------------------------------------
10 !-------------------------------------------------------------------------------
11 #include "scalelib.h"
13  !-----------------------------------------------------------------------------
14  !
15  !++ used modules
16  !
17  use scale_precision
18  use scale_io
19  use scale_prof
20  !-----------------------------------------------------------------------------
21  implicit none
22  private
23  !-----------------------------------------------------------------------------
24  !
25  !++ Public procedure
26  !
28 
29  !-----------------------------------------------------------------------------
30  !
31  !++ Public parameters & variables
32  !
33  ! for direction
34  integer, public, parameter :: i_up = 1
35  integer, public, parameter :: i_dn = 2
36  ! for band region
37  integer, public, parameter :: i_lw = 1
38  integer, public, parameter :: i_sw = 2
39 
40  !-----------------------------------------------------------------------------
41  !
42  !++ Private procedure
43  !
44  !-----------------------------------------------------------------------------
45  !
46  !++ Private parameters & variables
47  !
48  !-----------------------------------------------------------------------------
49 contains
50  !-----------------------------------------------------------------------------
52  subroutine atmos_phy_rd_calc_heating( &
53  KA, KS, KE, IA, IS, IE, JA, JS, JE, &
54  flux_rad, &
55  DENS, TEMP, &
56  CVtot, &
57  FZ, &
58  RHOH, &
59  TEMP_t )
60  implicit none
61  integer, intent(in) :: KA, KS, KE
62  integer, intent(in) :: IA, IS, IE
63  integer, intent(in) :: JA, JS, JE
64 
65  real(RP), intent(in) :: flux_rad(ka,ia,ja,2,2)
66  real(RP), intent(in) :: DENS (ka,ia,ja)
67  real(RP), intent(in) :: TEMP (ka,ia,ja)
68  real(RP), intent(in) :: CVtot (ka,ia,ja)
69  real(RP), intent(in) :: FZ (0:ka,ia,ja)
70 
71  real(RP), intent(out) :: RHOH(ka,ia,ja)
72 
73  real(RP), intent(out), optional :: TEMP_t(ka,ia,ja,3)
74 
75  real(RP) :: RHOH_LW, RHOH_SW
76 
77  integer :: k, i, j
78  !---------------------------------------------------------------------------
79 
80  !$omp parallel do default(none) OMP_SCHEDULE_ collapse(2) &
81  !$omp private(i,j,k, &
82  !$omp RHOH_LW,RHOH_SW) &
83  !$omp shared(RHOH,TEMP_t,flux_rad,DENS,CVtot,FZ, &
84  !$omp KS,KE,IS,IE,JS,JE)
85  do j = js, je
86  do i = is, ie
87  do k = ks, ke
88 
89  rhoh_lw = ( ( flux_rad(k,i,j,i_lw,i_dn) - flux_rad(k-1,i,j,i_lw,i_dn) ) &
90  - ( flux_rad(k,i,j,i_lw,i_up) - flux_rad(k-1,i,j,i_lw,i_up) ) &
91  ) / ( fz(k,i,j) - fz(k-1,i,j) )
92 
93  rhoh_sw = ( ( flux_rad(k,i,j,i_sw,i_dn) - flux_rad(k-1,i,j,i_sw,i_dn) ) &
94  - ( flux_rad(k,i,j,i_sw,i_up) - flux_rad(k-1,i,j,i_sw,i_up) ) &
95  ) / ( fz(k,i,j) - fz(k-1,i,j) )
96 
97  rhoh(k,i,j) = rhoh_lw + rhoh_sw
98 
99  temp_t(k,i,j,i_lw) = rhoh_lw / dens(k,i,j) / cvtot(k,i,j) * 86400.0_rp ! [K/day]
100  temp_t(k,i,j,i_sw) = rhoh_sw / dens(k,i,j) / cvtot(k,i,j) * 86400.0_rp ! [K/day]
101 
102  temp_t(k,i,j,3) = temp_t(k,i,j,i_lw) + temp_t(k,i,j,i_sw)
103  enddo
104  enddo
105  enddo
106 
107  return
108  end subroutine atmos_phy_rd_calc_heating
109 
110 end module scale_atmos_phy_rd_common
integer, parameter, public i_lw
integer, parameter, public i_sw
integer, parameter, public i_dn
module profiler
Definition: scale_prof.F90:11
module PRECISION
module atmosphere / physics / radiation / common
subroutine, public atmos_phy_rd_calc_heating(KA, KS, KE, IA, IS, IE, JA, JS, JE, flux_rad, DENS, TEMP, CVtot, FZ, RHOH, TEMP_t)
Calc heating rate.
module STDIO
Definition: scale_io.F90:10
integer, parameter, public i_up