SCALE-RM
Functions/Subroutines | Variables
scale_gridtrans Module Reference

module GRIDTRANS More...

Functions/Subroutines

subroutine, public gtrans_setup
 Setup. More...
 
subroutine gtrans_rotcoef
 Calculate rotation coeffient. More...
 

Variables

real(rp), dimension(:,:,:,:), allocatable, public gtrans_mapf
 map factor More...
 
real(rp), dimension(:,:,:), allocatable, public gtrans_rotc
 rotation coefficient More...
 
real(rp), dimension(:,:,:,:), allocatable, public gtrans_gsqrt
 transformation metrics from Z to Xi, {G}^1/2 More...
 
real(rp), dimension(:,:,:,:), allocatable, public gtrans_j13g
 (1,3) element of Jacobian matrix * {G}^1/2 More...
 
real(rp), dimension(:,:,:,:), allocatable, public gtrans_j23g
 (2,3) element of Jacobian matrix * {G}^1/2 More...
 
real(rp), public gtrans_j33g
 (3,3) element of Jacobian matrix * {G}^1/2 More...
 
real(rp), dimension(:,:,:,:), allocatable, public gtrans_limyz
 flux limiter y-z face More...
 
real(rp), dimension(:,:,:,:), allocatable, public gtrans_limxz
 flux limiter x-z face More...
 
real(rp), dimension(:,:,:,:), allocatable, public gtrans_limxy
 flux limiter x-y face More...
 
integer, public i_xyz = 1
 
integer, public i_xyw = 2
 
integer, public i_uyw = 3
 
integer, public i_xvw = 4
 
integer, public i_uyz = 5
 
integer, public i_xvz = 6
 
integer, public i_uvz = 7
 
integer, public i_xy = 1
 
integer, public i_uy = 2
 
integer, public i_xv = 3
 
integer, public i_uv = 4
 
integer, public i_fyz = 1
 
integer, public i_fxz = 2
 
integer, public i_fxy = 3
 

Detailed Description

module GRIDTRANS

Description
Grid transfer module Map projection and Terrain-following metrics
Author
Team SCALE
History

Function/Subroutine Documentation

◆ gtrans_setup()

subroutine, public scale_gridtrans::gtrans_setup ( )

Setup.

Definition at line 93 of file scale_gridtrans.F90.

References gtrans_gsqrt, gtrans_j13g, gtrans_j23g, gtrans_j33g, gtrans_limxy, gtrans_limxz, gtrans_limyz, gtrans_mapf, gtrans_rotc, gtrans_rotcoef(), i_uv, i_uy, i_xv, i_xy, scale_grid_index::ia, scale_stdio::io_fid_conf, scale_stdio::io_fid_log, scale_stdio::io_l, scale_stdio::io_lnml, scale_grid_index::ja, scale_grid_index::ka, scale_mapproj::mprj_mapfactor(), scale_process::prc_mpistop(), scale_grid_real::real_calc_areavol(), scale_grid_real::real_lat, scale_grid_real::real_latx, scale_grid_real::real_latxy, and scale_grid_real::real_laty.

Referenced by mod_rm_driver::scalerm(), and mod_rm_prep::scalerm_prep().

93  use scale_process, only: &
95  implicit none
96 
97  namelist / param_gtrans / &
98  gtrans_out_basename, &
99  gtrans_out_dtype, &
100  gtrans_topo_type, &
101  gtrans_thinwall_xdiv, &
102  gtrans_thinwall_ydiv, &
103  debug
104 
105  integer :: ierr
106  !---------------------------------------------------------------------------
107 
108  if( io_l ) write(io_fid_log,*)
109  if( io_l ) write(io_fid_log,*) '++++++ Module[GRIDTRANS] / Categ[ATMOS-RM GRID] / Origin[SCALElib]'
110 
111  !--- read namelist
112  rewind(io_fid_conf)
113  read(io_fid_conf,nml=param_gtrans,iostat=ierr)
114  if( ierr < 0 ) then !--- missing
115  if( io_l ) write(io_fid_log,*) '*** Not found namelist. Default used.'
116  elseif( ierr > 0 ) then !--- fatal error
117  write(*,*) 'xxx Not appropriate names in namelist PARAM_GTRANS. Check!'
118  call prc_mpistop
119  endif
120  if( io_lnml ) write(io_fid_log,nml=param_gtrans)
121 
122  allocate( gtrans_mapf(ia,ja,2,4) )
123 
124  allocate( gtrans_rotc(ia,ja,2) )
125 
126  allocate( gtrans_gsqrt(ka,ia,ja,7) )
127  allocate( gtrans_j13g(ka,ia,ja,7) )
128  allocate( gtrans_j23g(ka,ia,ja,7) )
129 
130  gtrans_gsqrt(:,:,:,:) = 1.0_rp
131  gtrans_j13g(:,:,:,:) = 0.0_rp
132  gtrans_j23g(:,:,:,:) = 0.0_rp
133  gtrans_j33g = 1.0_rp
134 
135  allocate( gtrans_limyz(ka,ia,ja,7) )
136  allocate( gtrans_limxz(ka,ia,ja,7) )
137  allocate( gtrans_limxy(ka,ia,ja,7) )
138  gtrans_limyz(:,:,:,:) = 1.0_rp
139  gtrans_limxz(:,:,:,:) = 1.0_rp
140  gtrans_limxy(:,:,:,:) = 1.0_rp
141 
142  ! calc metrics for orthogonal curvelinear coordinate
143  call gtrans_mapfactor
144 
145  ! calc coeficient for rotaion of velocity vector
146  call gtrans_rotcoef
147 
148  ! calc metrics for terrain-following,step-mountain,thin-wall coordinate
149  select case(gtrans_topo_type)
150  case ('TERRAINFOLLOWING')
151  if( io_l ) write(io_fid_log,*) '=> Use terrain-following coordinate'
152  call gtrans_terrainfollowing
153  case ('STEPMOUNTAIN')
154  if( io_l ) write(io_fid_log,*) '=> Use step mountain method'
155  call gtrans_thin_wall
156  call gtrans_step_mountain
157  case ('THINWALL')
158  if( io_l ) write(io_fid_log,*) '=> Use thin-wall approximation'
159  call gtrans_thin_wall
160  case default
161  write(*,*) 'xxx Not appropriate name for GTRANS_TOPO_TYPE : ', trim(gtrans_topo_type)
162  call prc_mpistop
163  end select
164 
165  ! output metrics (for debug)
166  call gtrans_write
167 
168  return
subroutine, public prc_mpistop
Abort MPI.
integer, public ia
of x whole cells (local, with HALO)
integer, public ka
of z whole cells (local, with HALO)
module PROCESS
real(rp), dimension(:,:,:), allocatable, public gtrans_rotc
rotation coefficient
integer, public io_fid_conf
Config file ID.
Definition: scale_stdio.F90:55
integer, public ja
of y whole cells (local, with HALO)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gtrans_rotcoef()

subroutine scale_gridtrans::gtrans_rotcoef ( )

Calculate rotation coeffient.

Definition at line 198 of file scale_gridtrans.F90.

References scale_grid::grid_cx, scale_grid::grid_cy, scale_grid::grid_cz, scale_grid::grid_fx, scale_grid::grid_fy, scale_grid::grid_fz, scale_grid::grid_rcdx, scale_grid::grid_rcdy, scale_grid::grid_rcdz, scale_grid::grid_rfdx, scale_grid::grid_rfdy, scale_grid::grid_rfdz, gtrans_gsqrt, gtrans_j13g, gtrans_j23g, gtrans_j33g, gtrans_limxy, gtrans_limxz, gtrans_limyz, gtrans_mapf, gtrans_rotc, i_fxy, i_fxz, i_fyz, i_uv, i_uvz, i_uy, i_uyw, i_uyz, i_xv, i_xvw, i_xvz, i_xy, i_xyw, i_xyz, scale_grid_index::ia, scale_grid_index::ie, scale_stdio::io_fid_log, scale_stdio::io_l, scale_grid_index::is, scale_grid_index::ja, scale_grid_index::je, scale_grid_index::js, scale_grid_index::ka, scale_grid_index::ke, scale_grid_index::ks, scale_process::prc_mpistop(), scale_grid_real::real_cz, scale_grid_real::real_fz, scale_grid_real::real_lat, scale_grid_real::real_lon, and scale_topography::topo_zsfc.

Referenced by gtrans_setup().

198  use scale_mapproj, only: &
199  mprj_rotcoef
200  use scale_grid_real, only: &
201  real_lon, &
202  real_lat
203  implicit none
204  !---------------------------------------------------------------------------
205 
206  call mprj_rotcoef( gtrans_rotc(:,:,:), & ! [OUT]
207  real_lon(:,:), & ! [IN]
208  real_lat(:,:) ) ! [IN]
209 
210  return
module GRID (real space)
real(rp), dimension(:,:,:), allocatable, public gtrans_rotc
rotation coefficient
real(rp), dimension(:,:), allocatable, public real_lon
longitude [rad,0-2pi]
real(rp), dimension(:,:), allocatable, public real_lat
latitude [rad,-pi,pi]
module Map projection
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ gtrans_mapf

real(rp), dimension (:,:,:,:), allocatable, public scale_gridtrans::gtrans_mapf

map factor

Definition at line 37 of file scale_gridtrans.F90.

Referenced by mod_atmos_dyn_driver::atmos_dyn_driver(), mod_atmos_phy_tb_driver::atmos_phy_tb_driver(), mod_atmos_vars::atmos_vars_monitor(), gtrans_rotcoef(), and gtrans_setup().

37  real(RP), public, allocatable :: gtrans_mapf (:,:,:,:)

◆ gtrans_rotc

real(rp), dimension (:,:,:), allocatable, public scale_gridtrans::gtrans_rotc

rotation coefficient

Definition at line 38 of file scale_gridtrans.F90.

Referenced by gtrans_rotcoef(), gtrans_setup(), scale_grid_nest::nest_comm_nestdown(), mod_realinput_scale::parentatominputscale(), and mod_realinput::parentatomsetup().

38  real(RP), public, allocatable :: gtrans_rotc (:,:,:)
real(rp), dimension(:,:,:), allocatable, public gtrans_rotc
rotation coefficient

◆ gtrans_gsqrt

real(rp), dimension(:,:,:,:), allocatable, public scale_gridtrans::gtrans_gsqrt

transformation metrics from Z to Xi, {G}^1/2

Definition at line 40 of file scale_gridtrans.F90.

Referenced by mod_atmos_dyn_driver::atmos_dyn_driver(), mod_atmos_phy_sf_driver::atmos_phy_sf_driver(), mod_atmos_phy_tb_driver::atmos_phy_tb_driver(), gtrans_rotcoef(), and gtrans_setup().

40  real(RP), public, allocatable :: gtrans_gsqrt(:,:,:,:)

◆ gtrans_j13g

real(rp), dimension (:,:,:,:), allocatable, public scale_gridtrans::gtrans_j13g

(1,3) element of Jacobian matrix * {G}^1/2

Definition at line 41 of file scale_gridtrans.F90.

Referenced by mod_atmos_dyn_driver::atmos_dyn_driver(), mod_atmos_phy_tb_driver::atmos_phy_tb_driver(), gtrans_rotcoef(), and gtrans_setup().

41  real(RP), public, allocatable :: gtrans_j13g (:,:,:,:)

◆ gtrans_j23g

real(rp), dimension (:,:,:,:), allocatable, public scale_gridtrans::gtrans_j23g

(2,3) element of Jacobian matrix * {G}^1/2

Definition at line 42 of file scale_gridtrans.F90.

Referenced by mod_atmos_dyn_driver::atmos_dyn_driver(), mod_atmos_phy_tb_driver::atmos_phy_tb_driver(), gtrans_rotcoef(), and gtrans_setup().

42  real(RP), public, allocatable :: gtrans_j23g (:,:,:,:)

◆ gtrans_j33g

real(rp), public scale_gridtrans::gtrans_j33g

(3,3) element of Jacobian matrix * {G}^1/2

Definition at line 43 of file scale_gridtrans.F90.

Referenced by mod_atmos_dyn_driver::atmos_dyn_driver(), scale_atmos_phy_mp_common::atmos_phy_mp_precipitation(), mod_atmos_phy_tb_driver::atmos_phy_tb_driver(), gtrans_rotcoef(), and gtrans_setup().

43  real(RP), public :: gtrans_j33g

◆ gtrans_limyz

real(rp), dimension(:,:,:,:), allocatable, public scale_gridtrans::gtrans_limyz

flux limiter y-z face

Definition at line 45 of file scale_gridtrans.F90.

Referenced by gtrans_rotcoef(), and gtrans_setup().

45  real(RP), public, allocatable :: gtrans_limyz(:,:,:,:)

◆ gtrans_limxz

real(rp), dimension(:,:,:,:), allocatable, public scale_gridtrans::gtrans_limxz

flux limiter x-z face

Definition at line 46 of file scale_gridtrans.F90.

Referenced by gtrans_rotcoef(), and gtrans_setup().

46  real(RP), public, allocatable :: gtrans_limxz(:,:,:,:)

◆ gtrans_limxy

real(rp), dimension(:,:,:,:), allocatable, public scale_gridtrans::gtrans_limxy

flux limiter x-y face

Definition at line 47 of file scale_gridtrans.F90.

Referenced by gtrans_rotcoef(), and gtrans_setup().

47  real(RP), public, allocatable :: gtrans_limxy(:,:,:,:)

◆ i_xyz

integer, public scale_gridtrans::i_xyz = 1

◆ i_xyw

integer, public scale_gridtrans::i_xyw = 2

◆ i_uyw

integer, public scale_gridtrans::i_uyw = 3

◆ i_xvw

integer, public scale_gridtrans::i_xvw = 4

◆ i_uyz

integer, public scale_gridtrans::i_uyz = 5

◆ i_xvz

integer, public scale_gridtrans::i_xvz = 6

◆ i_uvz

integer, public scale_gridtrans::i_uvz = 7

◆ i_xy

integer, public scale_gridtrans::i_xy = 1

◆ i_uy

integer, public scale_gridtrans::i_uy = 2

◆ i_xv

integer, public scale_gridtrans::i_xv = 3

◆ i_uv

integer, public scale_gridtrans::i_uv = 4

◆ i_fyz

integer, public scale_gridtrans::i_fyz = 1

Definition at line 62 of file scale_gridtrans.F90.

Referenced by gtrans_rotcoef().

62  integer, public :: i_fyz = 1 ! y-z face limiting x-flux

◆ i_fxz

integer, public scale_gridtrans::i_fxz = 2

Definition at line 63 of file scale_gridtrans.F90.

Referenced by gtrans_rotcoef().

63  integer, public :: i_fxz = 2 ! x-z face limiting y-flux

◆ i_fxy

integer, public scale_gridtrans::i_fxy = 3

Definition at line 64 of file scale_gridtrans.F90.

Referenced by gtrans_rotcoef().

64  integer, public :: i_fxy = 3 ! x-y face limiting z-flux