SCALE-RM
mod_urban_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  use scale_debug
19  !-----------------------------------------------------------------------------
20  implicit none
21  private
22  !-----------------------------------------------------------------------------
23  !
24  !++ Public procedure
25  !
26  public :: urban_admin_setup
27  public :: urban_admin_getscheme
28 
29  !-----------------------------------------------------------------------------
30  !
31  !++ Public parameters & variables
32  !
33  logical, public :: urban_do = .true. ! main switch for the model
34 
35  character(len=H_SHORT), public :: urban_type = 'NONE'
36 
37  logical, public :: urban_sw
38 
39  !-----------------------------------------------------------------------------
40  !
41  !++ Private procedure
42  !
43  !-----------------------------------------------------------------------------
44  !
45  !++ Private parameters & variables
46  !
47  !-----------------------------------------------------------------------------
48 contains
49  !-----------------------------------------------------------------------------
51  subroutine urban_admin_setup
52  use scale_process, only: &
54  implicit none
55 
56  namelist / param_urban / &
57  urban_do, &
59  integer :: ierr
60  !---------------------------------------------------------------------------
61 
62  if( io_l ) write(io_fid_log,*)
63  if( io_l ) write(io_fid_log,*) '++++++ Module[ADMIN] / Categ[URBAN] / Origin[SCALE-RM]'
64 
65  !--- read namelist
66  rewind(io_fid_conf)
67  read(io_fid_conf,nml=param_urban,iostat=ierr)
68  if( ierr < 0 ) then !--- missing
69  if( io_l ) write(io_fid_log,*) '*** Not found namelist. Default used.'
70  elseif( ierr > 0 ) then !--- fatal error
71  write(*,*) 'xxx Not appropriate names in namelist PARAM_URBAN. Check!'
72  call prc_mpistop
73  endif
74  if( io_lnml ) write(io_fid_log,nml=param_urban)
75 
76  !-----< module component check >-----
77 
78  if( io_l ) write(io_fid_log,*)
79  if( io_l ) write(io_fid_log,*) '*** Urban model components ***'
80 
81  if ( urban_type == 'OFF' .OR. urban_type == 'NONE' ) then
82  urban_do = .false. ! force off
83  endif
84 
85  if ( urban_do ) then
86  if( io_l ) write(io_fid_log,*) '*** Urban model : ON'
87  else
88  if( io_l ) write(io_fid_log,*) '*** Urban model : OFF'
89  endif
90 
91  if ( urban_type /= 'OFF' .AND. urban_type /= 'NONE' ) then
92  if( io_l ) write(io_fid_log,*) '*** + Urban physics : ON, ', trim(urban_type)
93  urban_sw = .true.
94  else
95  if( io_l ) write(io_fid_log,*) '*** + Urban physics : OFF'
96  urban_sw = .false.
97  endif
98 
99  return
100  end subroutine urban_admin_setup
101 
102  !-----------------------------------------------------------------------------
104  subroutine urban_admin_getscheme( &
105  scheme_name )
106  use scale_process, only: &
108  implicit none
109 
110  character(len=H_SHORT), intent(out) :: scheme_name
111  !---------------------------------------------------------------------------
112 
113  scheme_name = urban_type
114 
115  return
116  end subroutine urban_admin_getscheme
117 
118 end module mod_urban_admin
module DEBUG
Definition: scale_debug.F90:13
logical, public urban_sw
subroutine, public prc_mpistop
Abort MPI.
logical, public io_l
output log or not? (this process)
Definition: scale_stdio.F90:59
module STDIO
Definition: scale_stdio.F90:12
module PROCESS
character(len=h_short), public urban_type
module profiler
Definition: scale_prof.F90:10
logical, public io_lnml
output log or not? (for namelist, this process)
Definition: scale_stdio.F90:60
module PRECISION
integer, public io_fid_conf
Config file ID.
Definition: scale_stdio.F90:55
subroutine, public urban_admin_setup
Setup.
subroutine, public urban_admin_getscheme(scheme_name)
Get name of scheme for each component.
integer, public io_fid_log
Log file ID.
Definition: scale_stdio.F90:56
module Urban admin
logical, public urban_do