SCALE-RM
mod_convert.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
19  use scale_tracer
20  !-----------------------------------------------------------------------------
21  implicit none
22  private
23  !-----------------------------------------------------------------------------
24  !
25  !++ Public procedure
26  !
27  public :: convert_setup
28  public :: convert
29 
30  !-----------------------------------------------------------------------------
31  !
32  !++ Public parameters & variables
33  !
34  !-----------------------------------------------------------------------------
35  !
36  !++ Private procedure
37  !
38  !-----------------------------------------------------------------------------
39  !
40  !++ Private parameters & variables
41  !
42  logical :: convert_none = .false.
43  logical :: convert_topo = .false.
44  logical :: convert_landuse = .false.
45 
46  !-----------------------------------------------------------------------------
47 contains
48  !-----------------------------------------------------------------------------
50  subroutine convert_setup
51  use scale_process, only: &
53  use mod_cnvtopo, only: &
55  use mod_cnvlanduse, only: &
57  implicit none
58 
59  namelist / param_convert / &
60  convert_none, &
61  convert_topo, &
62  convert_landuse
63 
64  integer :: ierr
65  !---------------------------------------------------------------------------
66 
67  if( io_l ) write(io_fid_log,*)
68  if( io_l ) write(io_fid_log,*) '++++++ Module[convert] / Categ[preprocess] / Origin[SCALE-RM]'
69 
70  !--- read namelist
71  rewind(io_fid_conf)
72  read(io_fid_conf,nml=param_convert,iostat=ierr)
73  if( ierr < 0 ) then !--- missing
74  if( io_l ) write(io_fid_log,*) '*** Not found namelist. Default used.'
75  elseif( ierr > 0 ) then !--- fatal error
76  write(*,*) 'xxx Not appropriate names in namelist PARAM_CONVERT. Check!'
77  call prc_mpistop
78  endif
79  if( io_lnml ) write(io_fid_log,nml=param_convert)
80 
81  ! set up TOPO
82  if( convert_topo ) then
83  call cnvtopo_setup
84  end if
85 
86  ! set up LANDUSE
87  if( convert_landuse ) then
88  call cnvlanduse_setup
89  end if
90 
91  return
92  end subroutine convert_setup
93 
94  !-----------------------------------------------------------------------------
96  subroutine convert
97  use scale_process, only: &
99  use mod_cnvtopo, only: &
100  cnvtopo
101  use mod_cnvlanduse, only: &
102  cnvlanduse
103  implicit none
104  !---------------------------------------------------------------------------
105 
106  if ( convert_none ) then
107  if( io_l ) write(io_fid_log,*)
108  if( io_l ) write(io_fid_log,*) '++++++ SKIP CONVERT BOUNDARY DATA ++++++'
109  else
110  if( io_l ) write(io_fid_log,*)
111  if( io_l ) write(io_fid_log,*) '++++++ START CONVERT BOUNDARY DATA ++++++'
112 
113  if( convert_topo ) then
114  call cnvtopo
115  end if
116 
117  if( convert_landuse ) then
118  call cnvlanduse
119  end if
120 
121  if( io_l ) write(io_fid_log,*) '++++++ END CONVERT BOUNDARY DATA ++++++'
122  endif
123 
124  return
125  end subroutine convert
126 
127 end module mod_convert
subroutine, public prc_mpistop
Abort MPI.
logical, public io_l
output log or not? (this process)
Definition: scale_stdio.F90:59
module Convert topography
Definition: mod_cnvtopo.f90:10
subroutine, public convert
Driver.
Definition: mod_convert.f90:97
module STDIO
Definition: scale_stdio.F90:12
module CONVERT driver
Definition: mod_convert.f90:10
subroutine, public cnvlanduse
Driver.
subroutine, public convert_setup
Setup.
Definition: mod_convert.f90:51
module grid index
module TRACER
module PROCESS
subroutine, public cnvtopo_setup
Setup.
Definition: mod_cnvtopo.f90:70
module Convert LandUseIndex
subroutine, public cnvtopo
Driver.
module profiler
Definition: scale_prof.F90:10
subroutine, public cnvlanduse_setup
Setup.
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
integer, public io_fid_log
Log file ID.
Definition: scale_stdio.F90:56