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, public atmos_grid_cartesc_metric_finalize
 Finalize. 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 73 of file scale_atmos_grid_cartesC_metric.F90.

73  use scale_prc, only: &
74  prc_abort
75  use scale_prc_cartesc, only: &
76  prc_twod
77  implicit none
78 
79  namelist / param_atmos_grid_cartesc_metric / &
80  atmos_grid_cartesc_metric_out_basename, &
81  atmos_grid_cartesc_metric_out_dtype, &
82  atmos_grid_cartesc_metric_topo_type, &
83  atmos_grid_cartesc_metric_thinwall_xdiv, &
84  atmos_grid_cartesc_metric_thinwall_ydiv
85 
86  integer :: ierr
87  !---------------------------------------------------------------------------
88 
89  log_newline
90  log_info("ATMOS_GRID_CARTESC_METRIC_setup",*) 'Setup'
91 
92  !--- read namelist
93  rewind(io_fid_conf)
94  read(io_fid_conf,nml=param_atmos_grid_cartesc_metric,iostat=ierr)
95  if( ierr < 0 ) then !--- missing
96  log_info("ATMOS_GRID_CARTESC_METRIC_setup",*) 'Not found namelist. Default used.'
97  elseif( ierr > 0 ) then !--- fatal error
98  log_error("ATMOS_GRID_CARTESC_METRIC_setup",*) 'Not appropriate names in namelist PARAM_ATMOS_GRID_CARTESC_METRIC. Check!'
99  call prc_abort
100  endif
101  log_nml(param_atmos_grid_cartesc_metric)
102 
103  allocate( atmos_grid_cartesc_metric_mapf(ia,ja,2,4) )
104  atmos_grid_cartesc_metric_mapf(:,:,:,:) = 1.0_rp
105  !$acc enter data copyin(ATMOS_GRID_CARTESC_METRIC_MAPF) async
106 
107  allocate( atmos_grid_cartesc_metric_rotc(ia,ja,2) )
108  atmos_grid_cartesc_metric_rotc(:,:,1) = 1.0_rp
109  atmos_grid_cartesc_metric_rotc(:,:,1) = 0.0_rp
110  !$acc enter data copyin(ATMOS_GRID_CARTESC_METRIC_ROTC) async
111 
112  if ( prc_twod ) then
113  allocate( atmos_grid_cartesc_metric_gsqrt(ka,ia,ja,4) )
114  allocate( atmos_grid_cartesc_metric_j13g(ka,ia,ja,4) )
115  allocate( atmos_grid_cartesc_metric_j23g(ka,ia,ja,4) )
116  else
117  allocate( atmos_grid_cartesc_metric_gsqrt(ka,ia,ja,7) )
118  allocate( atmos_grid_cartesc_metric_j13g(ka,ia,ja,7) )
119  allocate( atmos_grid_cartesc_metric_j23g(ka,ia,ja,7) )
120  end if
121 
122  atmos_grid_cartesc_metric_gsqrt(:,:,:,:) = 1.0_rp
123  atmos_grid_cartesc_metric_j13g(:,:,:,:) = 0.0_rp
124  atmos_grid_cartesc_metric_j23g(:,:,:,:) = 0.0_rp
125  atmos_grid_cartesc_metric_j33g = 1.0_rp
126  !$acc enter data copyin(ATMOS_GRID_CARTESC_METRIC_GSQRT, ATMOS_GRID_CARTESC_METRIC_J13G, ATMOS_GRID_CARTESC_METRIC_J23G, ATMOS_GRID_CARTESC_METRIC_J33G) async
127 
128  allocate( atmos_grid_cartesc_metric_limyz(ka,ia,ja,7) )
129  allocate( atmos_grid_cartesc_metric_limxz(ka,ia,ja,7) )
130  allocate( atmos_grid_cartesc_metric_limxy(ka,ia,ja,7) )
131  atmos_grid_cartesc_metric_limyz(:,:,:,:) = 1.0_rp
132  atmos_grid_cartesc_metric_limxz(:,:,:,:) = 1.0_rp
133  atmos_grid_cartesc_metric_limxy(:,:,:,:) = 1.0_rp
134 ! !$acc enter data copyin(ATMOS_GRID_CARTESC_METRIC_LIMYZ, ATMOS_GRID_CARTESC_METRIC_LIMXZ, ATMOS_GRID_CARTESC_METRIC_LIMXY) async
135 
136  ! calc metrics for orthogonal curvelinear coordinate
137  call atmos_grid_cartesc_metric_mapfactor
138 
139  ! calc coeficient for rotaion of velocity vector
140  call atmos_grid_cartesc_metric_rotcoef
141 
142  ! calc metrics for terrain-following,step-mountain,thin-wall coordinate
143  log_newline
144  log_info("ATMOS_GRID_CARTESC_METRIC_setup",*) 'Terrain coordinate type : ', trim(atmos_grid_cartesc_metric_topo_type)
145  select case(atmos_grid_cartesc_metric_topo_type)
146  case('TERRAINFOLLOWING')
147  log_info_cont(*) '=> Terrain-following method'
148  call atmos_grid_cartesc_metric_terrainfollowing
149  case('STEPMOUNTAIN')
150  log_info_cont(*) '=> Step-mountain method'
151  call atmos_grid_cartesc_metric_thin_wall
152  call atmos_grid_cartesc_metric_step_mountain
153  case('THINWALL')
154  log_info_cont(*) '=> Thin-wall approximation method'
155  call atmos_grid_cartesc_metric_thin_wall
156  case default
157  log_error("ATMOS_GRID_CARTESC_METRIC_setup",*) 'Unsupported ATMOS_GRID_CARTESC_METRIC_TOPO_type. STOP'
158  call prc_abort
159  end select
160 
161  !$acc wait
162 
163  ! output metrics (for debug)
164  call atmos_grid_cartesc_metric_write
165 
166  return

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_index::ia, scale_io::io_fid_conf, scale_atmos_grid_cartesc_index::ja, scale_atmos_grid_cartesc_index::ka, scale_prc::prc_abort(), and scale_prc_cartesc::prc_twod.

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

Here is the call graph for this function:
Here is the caller graph for this function:

◆ atmos_grid_cartesc_metric_finalize()

subroutine, public scale_atmos_grid_cartesc_metric::atmos_grid_cartesc_metric_finalize

Finalize.

Definition at line 172 of file scale_atmos_grid_cartesC_metric.F90.

172  use scale_prc_cartesc, only: &
173  prc_twod
174  implicit none
175  !---------------------------------------------------------------------------
176 
177  log_newline
178  log_info("ATMOS_GRID_CARTESC_METRIC_finalize",*) 'Finalize'
179 
180  !$acc exit data delete(ATMOS_GRID_CARTESC_METRIC_MAPF)
181  deallocate( atmos_grid_cartesc_metric_mapf )
182 
183  !$acc exit data delete(ATMOS_GRID_CARTESC_METRIC_ROTC)
184  deallocate( atmos_grid_cartesc_metric_rotc )
185 
186  !$acc exit data delete(ATMOS_GRID_CARTESC_METRIC_GSQRT, ATMOS_GRID_CARTESC_METRIC_J13G, ATMOS_GRID_CARTESC_METRIC_J23G)
187  if ( prc_twod ) then
188  deallocate( atmos_grid_cartesc_metric_gsqrt )
189  deallocate( atmos_grid_cartesc_metric_j13g )
190  deallocate( atmos_grid_cartesc_metric_j23g )
191  else
192  deallocate( atmos_grid_cartesc_metric_gsqrt )
193  deallocate( atmos_grid_cartesc_metric_j13g )
194  deallocate( atmos_grid_cartesc_metric_j23g )
195  end if
196 
197  deallocate( atmos_grid_cartesc_metric_limyz )
198  deallocate( atmos_grid_cartesc_metric_limxz )
199  deallocate( atmos_grid_cartesc_metric_limxy )
200 
201  return

References atmos_grid_cartesc_metric_gsqrt, atmos_grid_cartesc_metric_j13g, atmos_grid_cartesc_metric_j23g, 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_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_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_prc_cartesc::prc_twod, and scale_topography::topography_calc_tan_slope().

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

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 271 of file scale_atmos_grid_cartesC_metric.F90.

271  use scale_mapprojection, only: &
272  mapprojection_rotcoef
273  use scale_atmos_grid_cartesc_real, only: &
276  implicit none
277  !---------------------------------------------------------------------------
278 
279  call mapprojection_rotcoef( ia, 1, ia, ja, 1, ja, &
280  atmos_grid_cartesc_real_lon(:,:), & ! [IN]
281  atmos_grid_cartesc_real_lat(:,:), & ! [IN]
282  atmos_grid_cartesc_metric_rotc(:,:,1), & ! [OUT]
283  atmos_grid_cartesc_metric_rotc(:,:,2) ) ! [OUT]
284 
285  !$acc update device(ATMOS_GRID_CARTESC_METRIC_ROTC)
286 
287  return

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_prc::prc_abort(), scale_prc_cartesc::prc_twod, scale_topography::topography_zsfc, and scale_vector::vectr_distance().

Referenced by atmos_grid_cartesc_metric_setup().

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

◆ atmos_grid_cartesc_metric_j13g

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

◆ atmos_grid_cartesc_metric_j23g

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

◆ atmos_grid_cartesc_metric_j33g

real(rp), public scale_atmos_grid_cartesc_metric::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 43 of file scale_atmos_grid_cartesC_metric.F90.

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

Referenced by atmos_grid_cartesc_metric_finalize(), atmos_grid_cartesc_metric_rotcoef(), and atmos_grid_cartesc_metric_setup().

◆ 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 44 of file scale_atmos_grid_cartesC_metric.F90.

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

Referenced by atmos_grid_cartesc_metric_finalize(), atmos_grid_cartesc_metric_rotcoef(), and atmos_grid_cartesc_metric_setup().

◆ 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 45 of file scale_atmos_grid_cartesC_metric.F90.

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

Referenced by atmos_grid_cartesc_metric_finalize(), atmos_grid_cartesc_metric_rotcoef(), and atmos_grid_cartesc_metric_setup().

scale_prc::prc_abort
subroutine, public prc_abort
Abort Process.
Definition: scale_prc.F90:350
scale_atmos_grid_cartesc_real
module Atmosphere GRID CartesC Real(real space)
Definition: scale_atmos_grid_cartesC_real.F90:11
scale_atmos_grid_cartesc_real::atmos_grid_cartesc_real_lon
real(rp), dimension(:,:), allocatable, public atmos_grid_cartesc_real_lon
longitude [rad,0-2pi]
Definition: scale_atmos_grid_cartesC_real.F90:49
scale_prc
module PROCESS
Definition: scale_prc.F90:11
scale_mapprojection
module Map projection
Definition: scale_mapprojection.F90:12
scale_atmos_grid_cartesc_metric::atmos_grid_cartesc_metric_gsqrt
real(rp), dimension(:,:,:,:), allocatable, public atmos_grid_cartesc_metric_gsqrt
transformation metrics from Z to Xi, {G}^1/2
Definition: scale_atmos_grid_cartesC_metric.F90:38
scale_prc_cartesc
module process / cartesC
Definition: scale_prc_cartesC.F90:11
scale_atmos_grid_cartesc_metric::atmos_grid_cartesc_metric_j23g
real(rp), dimension(:,:,:,:), allocatable, public atmos_grid_cartesc_metric_j23g
(2,3) element of Jacobian matrix * {G}^1/2
Definition: scale_atmos_grid_cartesC_metric.F90:40
scale_atmos_grid_cartesc_real::atmos_grid_cartesc_real_lat
real(rp), dimension(:,:), allocatable, public atmos_grid_cartesc_real_lat
latitude [rad,-pi,pi]
Definition: scale_atmos_grid_cartesC_real.F90:53
scale_atmos_grid_cartesc_metric::atmos_grid_cartesc_metric_j13g
real(rp), dimension(:,:,:,:), allocatable, public atmos_grid_cartesc_metric_j13g
(1,3) element of Jacobian matrix * {G}^1/2
Definition: scale_atmos_grid_cartesC_metric.F90:39
scale_prc_cartesc::prc_twod
logical, public prc_twod
2D experiment
Definition: scale_prc_cartesC.F90:56