SCALE-RM
Functions/Subroutines | Variables
scale_atmos_grid_cartesc_metric Module Reference

module Atmosphere Grid CartesianC metirc More...

Functions/Subroutines

subroutine, public atmos_grid_cartesc_metric_setup
 Setup. More...
 
subroutine atmos_grid_cartesc_metric_rotcoef
 Calculate rotation coeffient. More...
 

Variables

real(rp), dimension(:,:,:,:), allocatable, public atmos_grid_cartesc_metric_mapf
 map factor More...
 
real(rp), dimension(:,:,:), allocatable, public atmos_grid_cartesc_metric_rotc
 rotation coefficient More...
 
real(rp), dimension(:,:,:,:), allocatable, public atmos_grid_cartesc_metric_gsqrt
 transformation metrics from Z to Xi, {G}^1/2 More...
 
real(rp), dimension(:,:,:,:), allocatable, public atmos_grid_cartesc_metric_j13g
 (1,3) element of Jacobian matrix * {G}^1/2 More...
 
real(rp), dimension(:,:,:,:), allocatable, public atmos_grid_cartesc_metric_j23g
 (2,3) element of Jacobian matrix * {G}^1/2 More...
 
real(rp), public atmos_grid_cartesc_metric_j33g
 (3,3) element of Jacobian matrix * {G}^1/2 More...
 
real(rp), dimension(:,:,:,:), allocatable, public atmos_grid_cartesc_metric_limyz
 flux limiter y-z face More...
 
real(rp), dimension(:,:,:,:), allocatable, public atmos_grid_cartesc_metric_limxz
 flux limiter x-z face More...
 
real(rp), dimension(:,:,:,:), allocatable, public atmos_grid_cartesc_metric_limxy
 flux limiter x-y face More...
 

Detailed Description

module Atmosphere Grid CartesianC metirc

Description
Map projection and Terrain-following metrics for the CaresianC grid
Author
Team SCALE
NAMELIST
  • PARAM_ATMOS_GRID_CARTESC_METRIC
    nametypedefault valuecomment
    ATMOS_GRID_CARTESC_METRIC_OUT_BASENAME character(len=H_LONG) '' basename of the output file
    ATMOS_GRID_CARTESC_METRIC_OUT_DTYPE character(len=H_SHORT) 'DEFAULT' REAL4 or REAL8
    ATMOS_GRID_CARTESC_METRIC_TOPO_TYPE character(len=H_SHORT) 'TERRAINFOLLOWING' topographical shceme
    ATMOS_GRID_CARTESC_METRIC_THINWALL_XDIV integer 50 number dividing quarter-cell (x)
    ATMOS_GRID_CARTESC_METRIC_THINWALL_YDIV integer 50 number dividing quarter-cell (y)

History Output
No history output

Function/Subroutine Documentation

◆ atmos_grid_cartesc_metric_setup()

subroutine, public scale_atmos_grid_cartesc_metric::atmos_grid_cartesc_metric_setup ( )

Setup.

Definition at line 72 of file scale_atmos_grid_cartesC_metric.F90.

References atmos_grid_cartesc_metric_gsqrt, atmos_grid_cartesc_metric_j13g, atmos_grid_cartesc_metric_j23g, atmos_grid_cartesc_metric_j33g, atmos_grid_cartesc_metric_limxy, atmos_grid_cartesc_metric_limxz, atmos_grid_cartesc_metric_limyz, atmos_grid_cartesc_metric_mapf, atmos_grid_cartesc_metric_rotc, atmos_grid_cartesc_metric_rotcoef(), scale_atmos_grid_cartesc_real::atmos_grid_cartesc_real_calc_areavol(), scale_atmos_grid_cartesc_real::atmos_grid_cartesc_real_lat, scale_atmos_grid_cartesc_real::atmos_grid_cartesc_real_latuv, scale_atmos_grid_cartesc_real::atmos_grid_cartesc_real_latuy, scale_atmos_grid_cartesc_real::atmos_grid_cartesc_real_latxv, scale_atmos_grid_cartesc_index::i_uv, scale_atmos_grid_cartesc_index::i_uy, scale_atmos_grid_cartesc_index::i_xv, scale_atmos_grid_cartesc_index::i_xy, scale_atmos_grid_cartesc_index::ia, scale_io::io_fid_conf, scale_atmos_grid_cartesc_index::ja, scale_atmos_grid_cartesc_index::ka, scale_mapprojection::mapprojection_mapfactor(), and scale_prc::prc_abort().

Referenced by mod_rm_driver::rm_driver(), and mod_rm_prep::rm_prep().

72  use scale_prc, only: &
73  prc_abort
74  implicit none
75 
76  namelist / param_atmos_grid_cartesc_metric / &
77  atmos_grid_cartesc_metric_out_basename, &
78  atmos_grid_cartesc_metric_out_dtype, &
79  atmos_grid_cartesc_metric_topo_type, &
80  atmos_grid_cartesc_metric_thinwall_xdiv, &
81  atmos_grid_cartesc_metric_thinwall_ydiv
82 
83  integer :: ierr
84  !---------------------------------------------------------------------------
85 
86  log_newline
87  log_info("ATMOS_GRID_CARTESC_METRIC_setup",*) 'Setup'
88 
89  !--- read namelist
90  rewind(io_fid_conf)
91  read(io_fid_conf,nml=param_atmos_grid_cartesc_metric,iostat=ierr)
92  if( ierr < 0 ) then !--- missing
93  log_info("ATMOS_GRID_CARTESC_METRIC_setup",*) 'Not found namelist. Default used.'
94  elseif( ierr > 0 ) then !--- fatal error
95  log_error("ATMOS_GRID_CARTESC_METRIC_setup",*) 'Not appropriate names in namelist PARAM_ATMOS_GRID_CARTESC_METRIC. Check!'
96  call prc_abort
97  endif
98  log_nml(param_atmos_grid_cartesc_metric)
99 
100  allocate( atmos_grid_cartesc_metric_mapf(ia,ja,2,4) )
101 
102  allocate( atmos_grid_cartesc_metric_rotc(ia,ja,2) )
103 
104  allocate( atmos_grid_cartesc_metric_gsqrt(ka,ia,ja,7) )
105  allocate( atmos_grid_cartesc_metric_j13g(ka,ia,ja,7) )
106  allocate( atmos_grid_cartesc_metric_j23g(ka,ia,ja,7) )
107 
108  atmos_grid_cartesc_metric_gsqrt(:,:,:,:) = 1.0_rp
109  atmos_grid_cartesc_metric_j13g(:,:,:,:) = 0.0_rp
110  atmos_grid_cartesc_metric_j23g(:,:,:,:) = 0.0_rp
111  atmos_grid_cartesc_metric_j33g = 1.0_rp
112 
113  allocate( atmos_grid_cartesc_metric_limyz(ka,ia,ja,7) )
114  allocate( atmos_grid_cartesc_metric_limxz(ka,ia,ja,7) )
115  allocate( atmos_grid_cartesc_metric_limxy(ka,ia,ja,7) )
116  atmos_grid_cartesc_metric_limyz(:,:,:,:) = 1.0_rp
117  atmos_grid_cartesc_metric_limxz(:,:,:,:) = 1.0_rp
118  atmos_grid_cartesc_metric_limxy(:,:,:,:) = 1.0_rp
119 
120  ! calc metrics for orthogonal curvelinear coordinate
121  call atmos_grid_cartesc_metric_mapfactor
122 
123  ! calc coeficient for rotaion of velocity vector
124  call atmos_grid_cartesc_metric_rotcoef
125 
126  ! calc metrics for terrain-following,step-mountain,thin-wall coordinate
127  log_newline
128  log_info("ATMOS_GRID_CARTESC_METRIC_setup",*) 'Terrain coordinate type : ', trim(atmos_grid_cartesc_metric_topo_type)
129  select case(atmos_grid_cartesc_metric_topo_type)
130  case('TERRAINFOLLOWING')
131  log_info_cont(*) '=> Terrain-following method'
132  call atmos_grid_cartesc_metric_terrainfollowing
133  case('STEPMOUNTAIN')
134  log_info_cont(*) '=> Step-mountain method'
135  call atmos_grid_cartesc_metric_thin_wall
136  call atmos_grid_cartesc_metric_step_mountain
137  case('THINWALL')
138  log_info_cont(*) '=> Thin-wall approximation method'
139  call atmos_grid_cartesc_metric_thin_wall
140  case default
141  log_error("ATMOS_GRID_CARTESC_METRIC_setup",*) 'Unsupported ATMOS_GRID_CARTESC_METRIC_TOPO_type. STOP'
142  call prc_abort
143  end select
144 
145  ! output metrics (for debug)
146  call atmos_grid_cartesc_metric_write
147 
148  return
real(rp), dimension(:,:,:,:), allocatable, public atmos_grid_cartesc_metric_gsqrt
transformation metrics from Z to Xi, {G}^1/2
integer, public ia
of whole cells: x, local, with HALO
integer, public ja
of whole cells: y, local, with HALO
integer, public io_fid_conf
Config file ID.
Definition: scale_io.F90:55
module PROCESS
Definition: scale_prc.F90:11
subroutine, public prc_abort
Abort Process.
Definition: scale_prc.F90:338
real(rp), dimension(:,:,:,:), allocatable, public atmos_grid_cartesc_metric_j23g
(2,3) element of Jacobian matrix * {G}^1/2
real(rp), dimension(:,:,:,:), allocatable, public atmos_grid_cartesc_metric_j13g
(1,3) element of Jacobian matrix * {G}^1/2
integer, public ka
of whole cells: z, local, with HALO
Here is the call graph for this function:
Here is the caller graph for this function:

◆ atmos_grid_cartesc_metric_rotcoef()

subroutine scale_atmos_grid_cartesc_metric::atmos_grid_cartesc_metric_rotcoef ( )

Calculate rotation coeffient.

Definition at line 182 of file scale_atmos_grid_cartesC_metric.F90.

References scale_atmos_grid_cartesc::atmos_grid_cartesc_cx, scale_atmos_grid_cartesc::atmos_grid_cartesc_cy, scale_atmos_grid_cartesc::atmos_grid_cartesc_cz, scale_atmos_grid_cartesc::atmos_grid_cartesc_fx, scale_atmos_grid_cartesc::atmos_grid_cartesc_fy, scale_atmos_grid_cartesc::atmos_grid_cartesc_fz, atmos_grid_cartesc_metric_gsqrt, atmos_grid_cartesc_metric_j13g, atmos_grid_cartesc_metric_j23g, atmos_grid_cartesc_metric_j33g, atmos_grid_cartesc_metric_limxy, atmos_grid_cartesc_metric_limxz, atmos_grid_cartesc_metric_limyz, atmos_grid_cartesc_metric_mapf, atmos_grid_cartesc_metric_rotc, scale_atmos_grid_cartesc::atmos_grid_cartesc_rcdx, scale_atmos_grid_cartesc::atmos_grid_cartesc_rcdy, scale_atmos_grid_cartesc::atmos_grid_cartesc_rcdz, scale_atmos_grid_cartesc_real::atmos_grid_cartesc_real_basepoint_lat, scale_atmos_grid_cartesc_real::atmos_grid_cartesc_real_basepoint_lon, scale_atmos_grid_cartesc_real::atmos_grid_cartesc_real_cz, scale_atmos_grid_cartesc_real::atmos_grid_cartesc_real_czuv, scale_atmos_grid_cartesc_real::atmos_grid_cartesc_real_czuy, scale_atmos_grid_cartesc_real::atmos_grid_cartesc_real_czxv, scale_atmos_grid_cartesc_real::atmos_grid_cartesc_real_fz, scale_atmos_grid_cartesc_real::atmos_grid_cartesc_real_fzuv, scale_atmos_grid_cartesc_real::atmos_grid_cartesc_real_fzuy, scale_atmos_grid_cartesc_real::atmos_grid_cartesc_real_fzxv, scale_atmos_grid_cartesc_real::atmos_grid_cartesc_real_lat, scale_atmos_grid_cartesc_real::atmos_grid_cartesc_real_lon, scale_atmos_grid_cartesc::atmos_grid_cartesc_rfdx, scale_atmos_grid_cartesc::atmos_grid_cartesc_rfdy, scale_atmos_grid_cartesc::atmos_grid_cartesc_rfdz, scale_const::const_radius, scale_atmos_grid_cartesc_index::i_fxy, scale_atmos_grid_cartesc_index::i_fxz, scale_atmos_grid_cartesc_index::i_fyz, scale_atmos_grid_cartesc_index::i_uv, scale_atmos_grid_cartesc_index::i_uvz, scale_atmos_grid_cartesc_index::i_uy, scale_atmos_grid_cartesc_index::i_uyw, scale_atmos_grid_cartesc_index::i_uyz, scale_atmos_grid_cartesc_index::i_xv, scale_atmos_grid_cartesc_index::i_xvw, scale_atmos_grid_cartesc_index::i_xvz, scale_atmos_grid_cartesc_index::i_xy, scale_atmos_grid_cartesc_index::i_xyw, scale_atmos_grid_cartesc_index::i_xyz, scale_atmos_grid_cartesc_index::ia, scale_atmos_grid_cartesc_index::ie, scale_atmos_grid_cartesc_index::is, scale_atmos_grid_cartesc_index::ja, scale_atmos_grid_cartesc_index::je, scale_atmos_grid_cartesc_index::js, scale_atmos_grid_cartesc_index::ka, scale_atmos_grid_cartesc_index::ke, scale_atmos_grid_cartesc_index::ks, scale_mapprojection::mapprojection_rotcoef(), scale_prc::prc_abort(), scale_topography::topo_zsfc, and scale_vector::vectr_distance().

Referenced by atmos_grid_cartesc_metric_setup().

182  use scale_mapprojection, only: &
184  use scale_atmos_grid_cartesc_real, only: &
187  implicit none
188  !---------------------------------------------------------------------------
189 
190  call mapprojection_rotcoef( ia, 1, ia, ja, 1, ja, &
191  atmos_grid_cartesc_real_lon(:,:), & ! [IN]
192  atmos_grid_cartesc_real_lat(:,:), & ! [IN]
193  atmos_grid_cartesc_metric_rotc(:,:,:) ) ! [OUT]
194 
195  return
integer, public ia
of whole cells: x, local, with HALO
subroutine, public mapprojection_rotcoef(IA, IS, IE, JA, JS, JE, lon, lat, rotc)
u(lat,lon) = cos u(x,y) - sin v(x,y) v(lat,lon) = sin u(x,y) + cos v(x,y)
real(rp), dimension(:,:), allocatable, public atmos_grid_cartesc_real_lat
latitude [rad,-pi,pi]
integer, public ja
of whole cells: y, local, with HALO
real(rp), dimension(:,:), allocatable, public atmos_grid_cartesc_real_lon
longitude [rad,0-2pi]
module Atmosphere GRID CartesC Real(real space)
module Map projection
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ atmos_grid_cartesc_metric_mapf

real(rp), dimension (:,:,:,:), allocatable, public scale_atmos_grid_cartesc_metric::atmos_grid_cartesc_metric_mapf

◆ atmos_grid_cartesc_metric_rotc

real(rp), dimension (:,:,:), allocatable, public scale_atmos_grid_cartesc_metric::atmos_grid_cartesc_metric_rotc

◆ atmos_grid_cartesc_metric_gsqrt

real(rp), dimension(:,:,:,:), allocatable, public scale_atmos_grid_cartesc_metric::atmos_grid_cartesc_metric_gsqrt

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

Definition at line 37 of file scale_atmos_grid_cartesC_metric.F90.

Referenced by scale_atmos_diagnostic_cartesc::atmos_diagnostic_cartesc_get_vel(), mod_atmos_dyn_driver::atmos_dyn_driver(), atmos_grid_cartesc_metric_rotcoef(), atmos_grid_cartesc_metric_setup(), and mod_atmos_phy_tb_driver::atmos_phy_tb_driver_calc_tendency().

37  real(RP), public, allocatable :: atmos_grid_cartesc_metric_gsqrt(:,:,:,:)
real(rp), dimension(:,:,:,:), allocatable, public atmos_grid_cartesc_metric_gsqrt
transformation metrics from Z to Xi, {G}^1/2

◆ atmos_grid_cartesc_metric_j13g

real(rp), dimension (:,:,:,:), allocatable, public scale_atmos_grid_cartesc_metric::atmos_grid_cartesc_metric_j13g

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

Definition at line 38 of file scale_atmos_grid_cartesC_metric.F90.

Referenced by scale_atmos_diagnostic_cartesc::atmos_diagnostic_cartesc_get_vel(), mod_atmos_dyn_driver::atmos_dyn_driver(), atmos_grid_cartesc_metric_rotcoef(), atmos_grid_cartesc_metric_setup(), and mod_atmos_phy_tb_driver::atmos_phy_tb_driver_calc_tendency().

38  real(RP), public, allocatable :: atmos_grid_cartesc_metric_j13g (:,:,:,:)
real(rp), dimension(:,:,:,:), allocatable, public atmos_grid_cartesc_metric_j13g
(1,3) element of Jacobian matrix * {G}^1/2

◆ atmos_grid_cartesc_metric_j23g

real(rp), dimension (:,:,:,:), allocatable, public scale_atmos_grid_cartesc_metric::atmos_grid_cartesc_metric_j23g

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

Definition at line 39 of file scale_atmos_grid_cartesC_metric.F90.

Referenced by scale_atmos_diagnostic_cartesc::atmos_diagnostic_cartesc_get_vel(), mod_atmos_dyn_driver::atmos_dyn_driver(), atmos_grid_cartesc_metric_rotcoef(), atmos_grid_cartesc_metric_setup(), and mod_atmos_phy_tb_driver::atmos_phy_tb_driver_calc_tendency().

39  real(RP), public, allocatable :: atmos_grid_cartesc_metric_j23g (:,:,:,:)
real(rp), dimension(:,:,:,:), allocatable, public atmos_grid_cartesc_metric_j23g
(2,3) element of Jacobian matrix * {G}^1/2

◆ atmos_grid_cartesc_metric_j33g

real(rp), public scale_atmos_grid_cartesc_metric::atmos_grid_cartesc_metric_j33g

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

Definition at line 40 of file scale_atmos_grid_cartesC_metric.F90.

Referenced by mod_atmos_dyn_driver::atmos_dyn_driver(), atmos_grid_cartesc_metric_rotcoef(), atmos_grid_cartesc_metric_setup(), and mod_atmos_phy_tb_driver::atmos_phy_tb_driver_calc_tendency().

40  real(RP), public :: atmos_grid_cartesc_metric_j33g

◆ atmos_grid_cartesc_metric_limyz

real(rp), dimension(:,:,:,:), allocatable, public scale_atmos_grid_cartesc_metric::atmos_grid_cartesc_metric_limyz

flux limiter y-z face

Definition at line 42 of file scale_atmos_grid_cartesC_metric.F90.

Referenced by atmos_grid_cartesc_metric_rotcoef(), and atmos_grid_cartesc_metric_setup().

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

◆ atmos_grid_cartesc_metric_limxz

real(rp), dimension(:,:,:,:), allocatable, public scale_atmos_grid_cartesc_metric::atmos_grid_cartesc_metric_limxz

flux limiter x-z face

Definition at line 43 of file scale_atmos_grid_cartesC_metric.F90.

Referenced by atmos_grid_cartesc_metric_rotcoef(), and atmos_grid_cartesc_metric_setup().

43  real(RP), public, allocatable :: atmos_grid_cartesc_metric_limxz(:,:,:,:)

◆ atmos_grid_cartesc_metric_limxy

real(rp), dimension(:,:,:,:), allocatable, public scale_atmos_grid_cartesc_metric::atmos_grid_cartesc_metric_limxy

flux limiter x-y face

Definition at line 44 of file scale_atmos_grid_cartesC_metric.F90.

Referenced by atmos_grid_cartesc_metric_rotcoef(), and atmos_grid_cartesc_metric_setup().

44  real(RP), public, allocatable :: atmos_grid_cartesc_metric_limxy(:,:,:,:)