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
NAMELIST
  • PARAM_GTRANS
    nametypedefault valuecomment
    GTRANS_OUT_BASENAME character(len=H_LONG) '' basename of the output file
    GTRANS_OUT_DTYPE character(len=H_SHORT) 'DEFAULT' REAL4 or REAL8
    GTRANS_TOPO_TYPE character(len=H_SHORT) 'TERRAINFOLLOWING' topographical shceme
    GTRANS_THINWALL_XDIV integer 50 number dividing quarter-cell (x)
    GTRANS_THINWALL_YDIV integer 50 number dividing quarter-cell (y)
    DEBUG logical .false.

History Output
No history output

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_fid_nml, scale_stdio::io_l, scale_stdio::io_nml, 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_nml ) write(io_fid_nml,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  if( io_l ) write(io_fid_log,*)
150  if( io_l ) write(io_fid_log,*) '*** Terrain coordinate type : ', trim(gtrans_topo_type)
151  select case(gtrans_topo_type)
152  case('TERRAINFOLLOWING')
153  if( io_l ) write(io_fid_log,*) '*** => Terrain-following method'
154  call gtrans_terrainfollowing
155  case('STEPMOUNTAIN')
156  if( io_l ) write(io_fid_log,*) '*** => Step-mountain method'
157  call gtrans_thin_wall
158  call gtrans_step_mountain
159  case('THINWALL')
160  if( io_l ) write(io_fid_log,*) '*** => Thin-wall approximation method'
161  call gtrans_thin_wall
162  case default
163  write(*,*) 'xxx Unsupported GTRANS_TOPO_type. STOP'
164  call prc_mpistop
165  end select
166 
167  ! output metrics (for debug)
168  call gtrans_write
169 
170  return
subroutine, public prc_mpistop
Abort MPI.
module PROCESS
real(rp), dimension(:,:,:), allocatable, public gtrans_rotc
rotation coefficient
integer, public io_fid_conf
Config file ID.
Definition: scale_stdio.F90:55
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 200 of file scale_gridtrans.F90.

References scale_const::const_radius, 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::ie, scale_stdio::io_fid_log, scale_stdio::io_l, scale_grid_index::is, scale_grid_index::je, scale_grid_index::js, scale_grid_index::ke, scale_grid_index::ks, scale_mapproj::mprj_lonlat2xy(), scale_process::prc_mpistop(), scale_grid_real::real_basepoint_lat, scale_grid_real::real_basepoint_lon, scale_grid_real::real_cz, scale_grid_real::real_fz, scale_grid_real::real_lat, scale_grid_real::real_lon, scale_topography::topo_zsfc, and scale_vector::vectr_distance().

Referenced by gtrans_setup().

200  use scale_mapproj, only: &
201  mprj_rotcoef
202  use scale_grid_real, only: &
203  real_lon, &
204  real_lat
205  implicit none
206  !---------------------------------------------------------------------------
207 
208  call mprj_rotcoef( gtrans_rotc(:,:,:), & ! [OUT]
209  real_lon(:,:), & ! [IN]
210  real_lat(:,:) ) ! [IN]
211 
212  return
module GRID (real space)
real(rp), dimension(:,:,:), allocatable, public gtrans_rotc
rotation coefficient
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 (:,:,:)

◆ 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 scale_atmos_diagnostic::atmos_diagnostic_get(), 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 scale_atmos_diagnostic::atmos_diagnostic_get(), 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 scale_atmos_diagnostic::atmos_diagnostic_get(), 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