SCALE-RM
mod_atmos_admin.f90
Go to the documentation of this file.
1 !-------------------------------------------------------------------------------
9 !-------------------------------------------------------------------------------
11  !-----------------------------------------------------------------------------
12  !
13  !++ used modules
14  !
15  use scale_precision
16  use scale_stdio
17  use scale_prof
18  !-----------------------------------------------------------------------------
19  implicit none
20  private
21  !-----------------------------------------------------------------------------
22  !
23  !++ Public procedure
24  !
25  public :: atmos_admin_setup
26  public :: atmos_admin_getscheme
27 
28  !-----------------------------------------------------------------------------
29  !
30  !++ Public parameters & variables
31  !
32  logical, public :: atmos_do = .true. ! main switch for the model
33 
34  character(len=H_SHORT), public :: atmos_dyn_type = 'NONE'
35  character(len=H_SHORT), public :: atmos_phy_mp_type = 'NONE'
36  character(len=H_SHORT), public :: atmos_phy_ae_type = 'NONE'
37  character(len=H_SHORT), public :: atmos_phy_ch_type = 'NONE'
38  character(len=H_SHORT), public :: atmos_phy_rd_type = 'NONE'
39  character(len=H_SHORT), public :: atmos_phy_sf_type = 'NONE'
40  character(len=H_SHORT), public :: atmos_phy_tb_type = 'NONE'
41  character(len=H_SHORT), public :: atmos_phy_cp_type = 'NONE'
42 
43  logical, public :: atmos_use_average = .false.
44 
45  logical, public :: atmos_sw_dyn
46  logical, public :: atmos_sw_phy_mp
47  logical, public :: atmos_sw_phy_ae
48  logical, public :: atmos_sw_phy_ch
49  logical, public :: atmos_sw_phy_rd
50  logical, public :: atmos_sw_phy_sf
51  logical, public :: atmos_sw_phy_tb
52  logical, public :: atmos_sw_phy_cp
53 
54  !-----------------------------------------------------------------------------
55  !
56  !++ Private procedure
57  !
58  !-----------------------------------------------------------------------------
59  !
60  !++ Private parameters & variables
61  !
62  !-----------------------------------------------------------------------------
63 contains
64  !-----------------------------------------------------------------------------
66  subroutine atmos_admin_setup
67  use scale_process, only: &
69  implicit none
70 
71  namelist / param_atmos / &
72  atmos_do, &
82 
83  integer :: ierr
84  !---------------------------------------------------------------------------
85 
86  if( io_l ) write(io_fid_log,*)
87  if( io_l ) write(io_fid_log,*) '++++++ Module[ADMIN] / Categ[ATMOS] / Origin[SCALE-RM]'
88 
89  !--- read namelist
90  rewind(io_fid_conf)
91  read(io_fid_conf,nml=param_atmos,iostat=ierr)
92  if( ierr < 0 ) then !--- missing
93  if( io_l ) write(io_fid_log,*) '*** Not found namelist. Default used.'
94  elseif( ierr > 0 ) then !--- fatal error
95  write(*,*) 'xxx Not appropriate names in namelist PARAM_ATMOS. Check!'
96  call prc_mpistop
97  endif
98  if( io_nml ) write(io_fid_nml,nml=param_atmos)
99 
100  !-----< module component check >-----
101 
102  if( io_l ) write(io_fid_log,*)
103  if( io_l ) write(io_fid_log,*) '*** Atmosphere model components ***'
104 
105  if ( atmos_do ) then
106  if( io_l ) write(io_fid_log,*) '*** Atmosphere model : ON'
107  else
108  if( io_l ) write(io_fid_log,*) '*** Atmosphere model : OFF'
109  endif
110 
111  if( io_l ) write(io_fid_log,*) '*** Dynamics...'
112 
113  if ( atmos_dyn_type == 'OFF' ) then
114  if( io_l ) write(io_fid_log,*) '*** + Dynamical core : OFF'
115  if( io_l ) write(io_fid_log,*) '*** + Advection : OFF'
116  atmos_sw_dyn = .false.
117  elseif( atmos_dyn_type == 'NONE' ) then
118  ! The advection is disbled
119  ! The tendencies calculated by physical processed are added
120  if( io_l ) write(io_fid_log,*) '*** + Dynamical core : ON, ', trim(atmos_dyn_type)
121  if( io_l ) write(io_fid_log,*) '*** + Advection : OFF'
122  atmos_sw_dyn = .true.
123  else ! default
124  if( io_l ) write(io_fid_log,*) '*** + Dynamical core : ON, ', trim(atmos_dyn_type)
125  if( io_l ) write(io_fid_log,*) '*** + Advection : ON'
126  atmos_sw_dyn = .true.
127  endif
128 
129  if( io_l ) write(io_fid_log,*) '*** Physics...'
130 
131  if ( atmos_phy_mp_type /= 'OFF' .AND. atmos_phy_mp_type /= 'NONE' ) then
132  if( io_l ) write(io_fid_log,*) '*** + Cloud Microphysics : ON, ', trim(atmos_phy_mp_type)
133  atmos_sw_phy_mp = .true.
134  else
135  if( io_l ) write(io_fid_log,*) '*** + Cloud Microphysics : OFF'
136  atmos_sw_phy_mp = .false.
137  endif
138 
139  if ( atmos_phy_ae_type /= 'OFF' .AND. atmos_phy_ae_type /= 'NONE' ) then
140  if( io_l ) write(io_fid_log,*) '*** + Aerosol Microphysics : ON, ', trim(atmos_phy_ae_type)
141  atmos_sw_phy_ae = .true.
142  else
143  if( io_l ) write(io_fid_log,*) '*** + Aerosol Microphysics : OFF'
144  atmos_sw_phy_ae = .false.
145  endif
146 
147  if ( atmos_phy_ch_type /= 'OFF' .AND. atmos_phy_ch_type /= 'NONE' ) then
148  if( io_l ) write(io_fid_log,*) '*** + Chemistry : ON, ', trim(atmos_phy_ch_type)
149  atmos_sw_phy_ch = .true.
150  else
151  if( io_l ) write(io_fid_log,*) '*** + Chemistry : OFF'
152  atmos_sw_phy_ch = .false.
153  endif
154 
155  if ( atmos_phy_rd_type /= 'OFF' .AND. atmos_phy_rd_type /= 'NONE' ) then
156  if( io_l ) write(io_fid_log,*) '*** + Radiative transfer : ON, ', trim(atmos_phy_rd_type)
157  atmos_sw_phy_rd = .true.
158  else
159  if( io_l ) write(io_fid_log,*) '*** + Radiative transfer : OFF'
160  atmos_sw_phy_rd = .false.
161  endif
162 
163  if ( atmos_phy_sf_type /= 'OFF' .AND. atmos_phy_sf_type /= 'NONE' ) then
164  if( io_l ) write(io_fid_log,*) '*** + Surface Flux : ON, ', trim(atmos_phy_sf_type)
165  atmos_sw_phy_sf = .true.
166  else
167  if( io_l ) write(io_fid_log,*) '*** + Surface Flux : OFF'
168  atmos_sw_phy_sf = .false.
169  endif
170 
171  if ( atmos_phy_tb_type /= 'OFF' .AND. atmos_phy_tb_type /= 'NONE' ) then
172  if( io_l ) write(io_fid_log,*) '*** + Sub-grid Turbulence : ON, ', trim(atmos_phy_tb_type)
173  atmos_sw_phy_tb = .true.
174  else
175  if( io_l ) write(io_fid_log,*) '*** + Sub-grid Turbulence : OFF'
176  atmos_sw_phy_tb = .false.
177  endif
178 
179  if ( atmos_phy_cp_type /= 'OFF' .AND. atmos_phy_cp_type /= 'NONE' ) then
180  if( io_l ) write(io_fid_log,*) '*** + Convection Param. : ON, ', trim(atmos_phy_cp_type)
181  atmos_sw_phy_cp = .true.
182  else
183  if( io_l ) write(io_fid_log,*) '*** + Convection Param. : OFF'
184  atmos_sw_phy_cp = .false.
185  endif
186 
187  if ( atmos_use_average ) then
188  if( io_l ) write(io_fid_log,*) '*** + Use time-averaging value for physics? : YES'
189  else
190  if( io_l ) write(io_fid_log,*) '*** + Use time-averaging value for physics? : NO'
191  endif
192 
193  return
194  end subroutine atmos_admin_setup
195 
196  !-----------------------------------------------------------------------------
198  subroutine atmos_admin_getscheme( &
199  component_name, &
200  scheme_name )
201  use scale_process, only: &
203  implicit none
204 
205  character(len=*), intent(in) :: component_name
206  character(len=H_SHORT), intent(out) :: scheme_name
207  !---------------------------------------------------------------------------
208 
209  select case(component_name)
210  case("DYN")
211  scheme_name = atmos_dyn_type
212  case("PHY_MP")
213  scheme_name = atmos_phy_mp_type
214  case("PHY_AE")
215  scheme_name = atmos_phy_ae_type
216  case("PHY_CH")
217  scheme_name = atmos_phy_ch_type
218  case("PHY_RD")
219  scheme_name = atmos_phy_rd_type
220  case("PHY_SF")
221  scheme_name = atmos_phy_sf_type
222  case("PHY_TB")
223  scheme_name = atmos_phy_tb_type
224  case("PHY_CP")
225  scheme_name = atmos_phy_cp_type
226  case default
227  write(*,*) 'xxx Unsupported component_name. Check!', trim(component_name)
228  call prc_mpistop
229  end select
230 
231  return
232  end subroutine atmos_admin_getscheme
233 
234 end module mod_atmos_admin
module ATMOS admin
logical, public atmos_sw_phy_cp
subroutine, public prc_mpistop
Abort MPI.
logical, public atmos_sw_phy_rd
logical, public io_l
output log or not? (this process)
Definition: scale_stdio.F90:61
subroutine, public atmos_admin_getscheme(component_name, scheme_name)
Get name of scheme for each component.
module STDIO
Definition: scale_stdio.F90:12
character(len=h_short), public atmos_phy_cp_type
logical, public atmos_sw_phy_ae
character(len=h_short), public atmos_phy_ae_type
character(len=h_short), public atmos_phy_rd_type
character(len=h_short), public atmos_phy_ch_type
character(len=h_short), public atmos_phy_sf_type
logical, public io_nml
output log or not? (for namelist, this process)
Definition: scale_stdio.F90:62
logical, public atmos_sw_phy_tb
logical, public atmos_sw_dyn
logical, public atmos_do
module PROCESS
logical, public atmos_sw_phy_sf
logical, public atmos_sw_phy_ch
character(len=h_short), public atmos_phy_tb_type
logical, public atmos_sw_phy_mp
character(len=h_short), public atmos_phy_mp_type
module profiler
Definition: scale_prof.F90:10
module PRECISION
subroutine, public atmos_admin_setup
Setup.
character(len=h_short), public atmos_dyn_type
integer, public io_fid_conf
Config file ID.
Definition: scale_stdio.F90:55
integer, public io_fid_log
Log file ID.
Definition: scale_stdio.F90:56
integer, public io_fid_nml
Log file ID (only for output namelist)
Definition: scale_stdio.F90:57
logical, public atmos_use_average