SCALE-RM
mod_convert.F90
Go to the documentation of this file.
1 !-------------------------------------------------------------------------------
9 !-------------------------------------------------------------------------------
10 #include "scalelib.h"
12  !-----------------------------------------------------------------------------
13  !
14  !++ used modules
15  !
16  use scale_precision
17  use scale_io
18  use scale_prof
20  use scale_tracer
21  !-----------------------------------------------------------------------------
22  implicit none
23  private
24  !-----------------------------------------------------------------------------
25  !
26  !++ Public procedure
27  !
28  public :: convert_setup
29  public :: convert
30 
31  !-----------------------------------------------------------------------------
32  !
33  !++ Public parameters & variables
34  !
35  !-----------------------------------------------------------------------------
36  !
37  !++ Private procedure
38  !
39  !-----------------------------------------------------------------------------
40  !
41  !++ Private parameters & variables
42  !
43  logical :: CONVERT_TOPO = .false.
44  logical :: CONVERT_LANDUSE = .false.
45  logical :: CONVERT_USER = .false.
46 
47  !-----------------------------------------------------------------------------
48 contains
49  !-----------------------------------------------------------------------------
51  subroutine convert_setup
52  use scale_prc, only: &
53  prc_abort
54  use mod_cnvtopo, only: &
56  use mod_cnvlanduse, only: &
58  use mod_cnvuser, only: &
60  implicit none
61 
62  namelist / param_convert / &
63  convert_topo, &
64  convert_landuse, &
65  convert_user
66 
67  integer :: ierr
68  !---------------------------------------------------------------------------
69 
70  log_newline
71  log_info("CONVERT_setup",*) 'Setup'
72 
73  !--- read namelist
74  rewind(io_fid_conf)
75  read(io_fid_conf,nml=param_convert,iostat=ierr)
76  if( ierr < 0 ) then !--- missing
77  log_info("CONVERT_setup",*) 'Not found namelist. Default used.'
78  elseif( ierr > 0 ) then !--- fatal error
79  log_error("CONVERT_setup",*) 'Not appropriate names in namelist PARAM_CONVERT. Check!'
80  call prc_abort
81  endif
82  log_nml(param_convert)
83 
84  ! set up TOPO
85  if( convert_topo ) then
86  call cnvtopo_setup
87  end if
88 
89  ! set up LANDUSE
90  if( convert_landuse ) then
91  call cnvlanduse_setup
92  end if
93 
94  ! set up LANDUSE
95  if( convert_user ) then
96  call cnvuser_setup
97  end if
98 
99  return
100  end subroutine convert_setup
101 
102  !-----------------------------------------------------------------------------
104  subroutine convert
105  use scale_prc, only: &
106  prc_abort
107  use mod_cnvtopo, only: &
108  cnvtopo
109  use mod_cnvlanduse, only: &
110  cnvlanduse
111  use mod_cnvuser, only: &
112  cnvuser
113  implicit none
114  !---------------------------------------------------------------------------
115 
116  if ( convert_topo .OR. convert_landuse .OR. convert_user ) then
117  log_newline
118  log_progress(*) 'start convert boundary data'
119 
120  if( convert_landuse ) then
121  call cnvlanduse
122  end if
123 
124  if( convert_topo ) then
125  call cnvtopo
126  end if
127 
128  if( convert_user ) then
129  call cnvuser
130  end if
131 
132  log_progress(*) 'end convert boundary data'
133  else
134  log_newline
135  log_progress(*) 'skip convert boundary data'
136  endif
137 
138  return
139  end subroutine convert
140 
141 end module mod_convert
scale_prc::prc_abort
subroutine, public prc_abort
Abort Process.
Definition: scale_prc.F90:342
mod_cnvtopo::cnvtopo
subroutine, public cnvtopo
Driver.
Definition: mod_cnvtopo.F90:253
scale_precision
module PRECISION
Definition: scale_precision.F90:14
mod_cnvtopo
module Convert topography
Definition: mod_cnvtopo.F90:11
mod_cnvuser::cnvuser_setup
subroutine, public cnvuser_setup
Setup.
Definition: mod_cnvuser.F90:103
scale_prc
module PROCESS
Definition: scale_prc.F90:11
mod_convert
module CONVERT driver
Definition: mod_convert.F90:11
mod_cnvlanduse::cnvlanduse
subroutine, public cnvlanduse
Driver.
Definition: mod_cnvlanduse.F90:145
scale_io
module STDIO
Definition: scale_io.F90:10
mod_cnvuser
module Convert 2D user data
Definition: mod_cnvuser.F90:11
mod_cnvuser::cnvuser
subroutine, public cnvuser
Driver.
Definition: mod_cnvuser.F90:398
scale_atmos_grid_cartesc_index
module atmosphere / grid / cartesC index
Definition: scale_atmos_grid_cartesC_index.F90:12
scale_prof
module profiler
Definition: scale_prof.F90:11
scale_tracer
module TRACER
Definition: scale_tracer.F90:12
mod_convert::convert
subroutine, public convert
Driver.
Definition: mod_convert.F90:105
mod_convert::convert_setup
subroutine, public convert_setup
Setup.
Definition: mod_convert.F90:52
mod_cnvlanduse::cnvlanduse_setup
subroutine, public cnvlanduse_setup
Setup.
Definition: mod_cnvlanduse.F90:64
mod_cnvlanduse
module Convert LandUseIndex
Definition: mod_cnvlanduse.F90:11
mod_cnvtopo::cnvtopo_setup
subroutine, public cnvtopo_setup
Setup.
Definition: mod_cnvtopo.F90:76
scale_io::io_fid_conf
integer, public io_fid_conf
Config file ID.
Definition: scale_io.F90:56