SCALE-RM
scale_atmos_phy_cp_common.F90
Go to the documentation of this file.
1 !-------------------------------------------------------------------------------
11 !-------------------------------------------------------------------------------
12 #include "scalelib.h"
14  !-----------------------------------------------------------------------------
15  !
16  !++ used modules
17  !
18  use scale_precision
19  use scale_io
20  use scale_prof
21  !-----------------------------------------------------------------------------
22  implicit none
23  private
24  !-----------------------------------------------------------------------------
25  !
26  !++ Public procedure
27  !
30 
31  !-----------------------------------------------------------------------------
32  !
33  !++ Public parameters & variables
34  !
35  !-----------------------------------------------------------------------------
36  !
37  !++ Private procedure
38  !
39  !-----------------------------------------------------------------------------
40  !
41  !++ Private parameters & variables
42  !
43  !-----------------------------------------------------------------------------
44  ! tuning parameter
45  logical, private :: PARAM_ATMOS_PHY_CP_wadapt = .true.
46  integer, private :: PARAM_ATMOS_PHY_CP_w_time = 16
47  !------------------------------------------------------------------------------
48 contains
49  !------------------------------------------------------------------------------
51  subroutine atmos_phy_cp_common_setup
52  use scale_prc, only: &
53  prc_abort
54  implicit none
55 
56  namelist / param_atmos_phy_cp_common / &
57  param_atmos_phy_cp_wadapt, &
58  param_atmos_phy_cp_w_time
59 
60  integer :: ierr
61  !---------------------------------------------------------------------------
62 
63  log_newline
64  log_info("ATMOS_PHY_CP_common_setup",*) 'Setup'
65  log_info("ATMOS_PHY_CP_common_setup",*) 'CP-COMMON'
66 
67  !--- read namelist
68  rewind(io_fid_conf)
69  read(io_fid_conf,nml=param_atmos_phy_cp_common,iostat=ierr)
70  if( ierr < 0 ) then !--- missing
71  log_info("ATMOS_PHY_CP_common_setup",*) 'Not found namelist. Default used.'
72  elseif( ierr > 0 ) then !--- fatal error
73  log_error("ATMOS_PHY_CP_common_setup",*) 'Not appropriate names in namelist PARAM_ATMOS_PHY_CP_COMMON. Check!'
74  call prc_abort
75  endif
76  log_nml(param_atmos_phy_cp_common)
77 
78  ! output parameter lists
79  log_newline
80  log_info("ATMOS_PHY_CP_common_setup",*) "Use running mean of w in adaptive timestep? : ", param_atmos_phy_cp_wadapt
81  log_info("ATMOS_PHY_CP_common_setup",*) "Fixed time scale for running mean of w : ", param_atmos_phy_cp_w_time
82 
83  return
84  end subroutine atmos_phy_cp_common_setup
85 
86  !-----------------------------------------------------------------------------
96  !-----------------------------------------------------------------------------
97  subroutine atmos_phy_cp_common_wmean( &
98  KA, KS, KE, IA, IS, IE, JA, JS, JE, &
99  W, &
100  TIME_DTSEC, CP_DTSEC, &
101  W0_mean )
102  implicit none
103  integer, intent(in) :: ka, ks, ke
104  integer, intent(in) :: ia, is, ie
105  integer, intent(in) :: ja, js, je
106 
107  real(rp), intent(in) :: w(ka,ia,ja)
108  real(dp), intent(in) :: time_dtsec
109  real(dp), intent(in) :: cp_dtsec
110 
111  real(rp), intent(inout) :: w0_mean(ka,ia,ja)
112 
113  real(rp) :: fact_w0_mean, fact_w0
114 
115  integer :: k, i, j
116  !---------------------------------------------------------------------------
117 
118  if ( param_atmos_phy_cp_wadapt ) then
119  fact_w0_mean = 2.0_rp * max(cp_dtsec,time_dtsec) - time_dtsec
120  fact_w0 = time_dtsec
121  else ! w_time is tuning parameter
122  fact_w0_mean = real(param_atmos_phy_cp_w_time,rp)
123  fact_w0 = 1.0_rp
124  endif
125 
126  do j = js, je
127  do i = is, ie
128  do k = ks, ke
129  w0_mean(k,i,j) = ( w0_mean(k,i,j) * fact_w0_mean &
130  + w(k,i,j) * fact_w0 ) / ( fact_w0_mean + fact_w0 )
131  enddo
132  enddo
133  enddo
134 
135  return
136  end subroutine atmos_phy_cp_common_wmean
137 
138 end module scale_atmos_phy_cp_common
scale_atmos_grid_cartesc_index::ke
integer, public ke
end point of inner domain: z, local
Definition: scale_atmos_grid_cartesC_index.F90:52
scale_prc::prc_abort
subroutine, public prc_abort
Abort Process.
Definition: scale_prc.F90:342
scale_atmos_phy_cp_common
module atmosphere / physics / cumulus / Common
Definition: scale_atmos_phy_cp_common.F90:13
scale_precision
module PRECISION
Definition: scale_precision.F90:14
scale_atmos_grid_cartesc_index::ka
integer, public ka
Definition: scale_atmos_grid_cartesC_index.F90:47
scale_prc
module PROCESS
Definition: scale_prc.F90:11
scale_precision::rp
integer, parameter, public rp
Definition: scale_precision.F90:41
scale_atmos_grid_cartesc_index::ie
integer, public ie
end point of inner domain: x, local
Definition: scale_atmos_grid_cartesC_index.F90:54
scale_io
module STDIO
Definition: scale_io.F90:10
scale_tracer::k
real(rp), public k
Definition: scale_tracer.F90:44
scale_atmos_grid_cartesc_index::ia
integer, public ia
Definition: scale_atmos_grid_cartesC_index.F90:48
scale_prof
module profiler
Definition: scale_prof.F90:11
scale_atmos_grid_cartesc_index::is
integer, public is
start point of inner domain: x, local
Definition: scale_atmos_grid_cartesC_index.F90:53
scale_precision::dp
integer, parameter, public dp
Definition: scale_precision.F90:32
scale_atmos_grid_cartesc_index::ja
integer, public ja
Definition: scale_atmos_grid_cartesC_index.F90:49
scale_atmos_grid_cartesc_index::ks
integer, public ks
start point of inner domain: z, local
Definition: scale_atmos_grid_cartesC_index.F90:51
scale_atmos_phy_cp_common::atmos_phy_cp_common_wmean
subroutine, public atmos_phy_cp_common_wmean(KA, KS, KE, IA, IS, IE, JA, JS, JE, W, TIME_DTSEC, CP_DTSEC, W0_mean)
ATMOS_PHY_CP_wmean running mean vertical wind velocity comment for W0 imported from WRF.
Definition: scale_atmos_phy_cp_common.F90:102
scale_atmos_grid_cartesc_index::js
integer, public js
start point of inner domain: y, local
Definition: scale_atmos_grid_cartesC_index.F90:55
scale_atmos_phy_cp_common::atmos_phy_cp_common_setup
subroutine, public atmos_phy_cp_common_setup
Setup.
Definition: scale_atmos_phy_cp_common.F90:52
scale_io::io_fid_conf
integer, public io_fid_conf
Config file ID.
Definition: scale_io.F90:56
scale_atmos_grid_cartesc_index::je
integer, public je
end point of inner domain: y, local
Definition: scale_atmos_grid_cartesC_index.F90:56