SCALE-RM
Functions/Subroutines | Variables
scale_atmos_grid_cartesc Module Reference

module atmosphere / grid / cartesC More...

Functions/Subroutines

subroutine, public atmos_grid_cartesc_setup (basename, aggregate)
 Setup. More...
 
subroutine, public atmos_grid_cartesc_allocate
 
subroutine, public atmos_grid_cartesc_generate (DZ, DX, DY, FZ, FZ_MAX, OFFSET_X, OFFSET_Y, BUFFER_DZ, BUFFER_DX, BUFFER_DY, BUFFER_NZ, BUFFER_NX, BUFFER_NY, BUFFFACT, BUFFFACT_Z, BUFFFACT_X, BUFFFACT_Y)
 Generate horizontal&vertical grid. More...
 
subroutine atmos_grid_cartesc_output_info
 Output information. More...
 

Variables

character(len=7), parameter, public atmos_grid_cartesc_name = 'cartesC'
 
real(rp), public dz
 
real(rp), public dx
 
real(rp), public dy
 
real(rp), dimension(:), allocatable, public atmos_grid_cartesc_cz
 center coordinate [m]: z, local More...
 
real(rp), dimension(:), allocatable, public atmos_grid_cartesc_fz
 face coordinate [m]: z, local More...
 
real(rp), dimension(:), allocatable, public atmos_grid_cartesc_cdz
 z-length of control volume [m] More...
 
real(rp), dimension(:), allocatable, public atmos_grid_cartesc_fdz
 z-length of grid(i+1) to grid(i) [m] More...
 
real(rp), dimension(:), allocatable, public atmos_grid_cartesc_rcdz
 reciprocal of center-dz More...
 
real(rp), dimension(:), allocatable, public atmos_grid_cartesc_rfdz
 reciprocal of face-dz More...
 
real(rp), dimension(:), allocatable, public atmos_grid_cartesc_cbfz
 center buffer factor (0-1): z More...
 
real(rp), dimension(:), allocatable, public atmos_grid_cartesc_fbfz
 face buffer factor (0-1): z More...
 
real(rp), dimension(:), allocatable, public atmos_grid_cartesc_lcz
 center coordinate [m]: z, local land More...
 
real(rp), dimension(:), allocatable, public atmos_grid_cartesc_lfz
 face coordinate [m]: z, local More...
 
real(rp), dimension(:), allocatable, public atmos_grid_cartesc_lcdz
 z-length of control volume [m] More...
 
real(rp), dimension(:), allocatable, public atmos_grid_cartesc_cx
 center coordinate [m]: x, local More...
 
real(rp), dimension(:), allocatable, public atmos_grid_cartesc_cy
 center coordinate [m]: y, local More...
 
real(rp), dimension(:), allocatable, public atmos_grid_cartesc_fx
 face coordinate [m]: x, local More...
 
real(rp), dimension(:), allocatable, public atmos_grid_cartesc_fy
 face coordinate [m]: y, local More...
 
real(rp), dimension(:), allocatable, public atmos_grid_cartesc_cdx
 x-length of control volume [m] More...
 
real(rp), dimension(:), allocatable, public atmos_grid_cartesc_cdy
 y-length of control volume [m] More...
 
real(rp), dimension(:), allocatable, public atmos_grid_cartesc_fdx
 x-length of grid(i+1) to grid(i) [m] More...
 
real(rp), dimension(:), allocatable, public atmos_grid_cartesc_fdy
 y-length of grid(j+1) to grid(j) [m] More...
 
real(rp), dimension(:), allocatable, public atmos_grid_cartesc_rcdx
 reciprocal of center-dx More...
 
real(rp), dimension(:), allocatable, public atmos_grid_cartesc_rcdy
 reciprocal of center-dy More...
 
real(rp), dimension(:), allocatable, public atmos_grid_cartesc_rfdx
 reciprocal of face-dx More...
 
real(rp), dimension(:), allocatable, public atmos_grid_cartesc_rfdy
 reciprocal of face-dy More...
 
real(rp), dimension(:), allocatable, public atmos_grid_cartesc_cbfx
 center buffer factor (0-1): x More...
 
real(rp), dimension(:), allocatable, public atmos_grid_cartesc_cbfy
 center buffer factor (0-1): y More...
 
real(rp), dimension(:), allocatable, public atmos_grid_cartesc_fbfx
 face buffer factor (0-1): x More...
 
real(rp), dimension(:), allocatable, public atmos_grid_cartesc_fbfy
 face buffer factor (0-1): y More...
 
real(rp), dimension(:), allocatable, public atmos_grid_cartesc_cxg
 center coordinate [m]: x, global More...
 
real(rp), dimension(:), allocatable, public atmos_grid_cartesc_cyg
 center coordinate [m]: y, global More...
 
real(rp), dimension(:), allocatable, public atmos_grid_cartesc_fxg
 face coordinate [m]: x, global More...
 
real(rp), dimension(:), allocatable, public atmos_grid_cartesc_fyg
 face coordinate [m]: y, global More...
 
real(rp), dimension(:), allocatable, public atmos_grid_cartesc_cdxg
 center coordinate [m]: x, global More...
 
real(rp), dimension(:), allocatable, public atmos_grid_cartesc_cdyg
 center coordinate [m]: y, global More...
 
real(rp), dimension(:), allocatable, public atmos_grid_cartesc_fdxg
 center coordinate [m]: x, global More...
 
real(rp), dimension(:), allocatable, public atmos_grid_cartesc_fdyg
 center coordinate [m]: y, global More...
 
real(rp), dimension(:), allocatable, public atmos_grid_cartesc_cbfxg
 center buffer factor (0-1): x, global More...
 
real(rp), dimension(:), allocatable, public atmos_grid_cartesc_cbfyg
 center buffer factor (0-1): y, global More...
 
real(rp), dimension(:), allocatable, public atmos_grid_cartesc_fbfxg
 face buffer factor (0-1): x, global More...
 
real(rp), dimension(:), allocatable, public atmos_grid_cartesc_fbfyg
 face buffer factor (0-1): y, global More...
 
real(rp), public atmos_grid_cartesc_domain_center_x
 center position of global domain [m]: x More...
 
real(rp), public atmos_grid_cartesc_domain_center_y
 center position of global domain [m]: y More...
 

Detailed Description

module atmosphere / grid / cartesC

Description
Atmospheric grid module for the cartesianC coordinate
Author
Team SCALE
NAMELIST
  • PARAM_ATMOS_GRID_CARTESC
    nametypedefault valuecomment
    ATMOS_GRID_CARTESC_IN_BASENAME character(len=H_LONG) ''
    ATMOS_GRID_CARTESC_IN_AGGREGATE logical
    DZ real(RP)
    DX real(RP)
    DY real(RP)
    BUFFER_DZ real(RP)
    BUFFER_DX real(RP)
    BUFFER_DY real(RP)
    BUFFER_NZ integer
    BUFFER_NX integer
    BUFFER_NY integer
    BUFFFACT real(RP)
    BUFFFACT_Z real(RP)
    BUFFFACT_X real(RP)
    BUFFFACT_Y real(RP)
    FZ real(RP), dimension(:)
    OFFSET_X real(RP)
    OFFSET_Y real(RP)

History Output
No history output

Function/Subroutine Documentation

◆ atmos_grid_cartesc_setup()

subroutine, public scale_atmos_grid_cartesc::atmos_grid_cartesc_setup ( character(len=*), intent(in), optional  basename,
logical, intent(in), optional  aggregate 
)

Setup.

Definition at line 108 of file scale_atmos_grid_cartesC.F90.

References atmos_grid_cartesc_allocate(), atmos_grid_cartesc_generate(), atmos_grid_cartesc_output_info(), dx, dy, dz, scale_file::file_aggregate, scale_io::io_fid_conf, scale_atmos_grid_cartesc_index::kmax, and scale_prc::prc_abort().

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

108  use scale_prc, only: &
109  prc_abort
110  use scale_file, only: &
112  implicit none
113  character(len=*), intent(in), optional :: basename
114  logical, intent(in), optional :: aggregate
115 
116  character(len=H_LONG) :: atmos_grid_cartesc_in_basename = ''
117  logical :: atmos_grid_cartesc_in_aggregate
118 
119  real(RP) :: offset_x = 0.0_rp
120  real(RP) :: offset_y = 0.0_rp
121 
122  real(RP) :: buffer_dz = 0.0_rp
123  real(RP) :: buffer_dx = 0.0_rp
124  real(RP) :: buffer_dy = 0.0_rp
125  real(RP) :: bufffact = 1.0_rp
126  real(RP) :: bufffact_z = -1.0_rp
127  real(RP) :: bufffact_x = -1.0_rp
128  real(RP) :: bufffact_y = -1.0_rp
129 
130  integer :: buffer_nz = -1
131  integer :: buffer_nx = -1
132  integer :: buffer_ny = -1
133 
134  integer, parameter :: fz_max = 300
135  real(RP) :: fz(fz_max)
136 
137  namelist / param_atmos_grid_cartesc / &
138  atmos_grid_cartesc_in_basename, &
139  atmos_grid_cartesc_in_aggregate, &
140  dz, &
141  dx, &
142  dy, &
143  buffer_dz, &
144  buffer_dx, &
145  buffer_dy, &
146  buffer_nz, &
147  buffer_nx, &
148  buffer_ny, &
149  bufffact, &
150  bufffact_z, &
151  bufffact_x, &
152  bufffact_y, &
153  fz, &
154  offset_x, &
155  offset_y
156 
157  integer :: ierr
158  !---------------------------------------------------------------------------
159 
160  log_newline
161  log_info("ATMOS_GRID_CARTESC_setup",*) 'Setup'
162 
163  if ( kmax < 1 ) then
164  log_info("ATMOS_GRID_CARTESC_setup",*) 'Skip because KMAX < 1'
165  return
166  end if
167 
168  fz(:) = -1.0_rp
169 
170  if ( present(basename) ) atmos_grid_cartesc_in_basename = basename
171  if ( present(aggregate) ) then
172  atmos_grid_cartesc_in_aggregate = aggregate
173  else
174  atmos_grid_cartesc_in_aggregate = file_aggregate
175  end if
176 
177  !--- read namelist
178  rewind(io_fid_conf)
179  read(io_fid_conf,nml=param_atmos_grid_cartesc,iostat=ierr)
180  if( ierr < 0 ) then !--- missing
181  log_info("ATMOS_GRID_CARTESC_setup",*) 'Not found namelist. Default used.'
182  elseif( ierr > 0 ) then !--- fatal error
183  log_error("ATMOS_GRID_CARTESC_setup",*) 'Not appropriate names in namelist PARAM_ATMOS_GRID_CARTESC. Check!'
184  call prc_abort
185  endif
186  log_nml(param_atmos_grid_cartesc)
187 
188 
189  call atmos_grid_cartesc_allocate
190 
191  if ( atmos_grid_cartesc_in_basename /= '' ) then
192 
193  call atmos_grid_cartesc_read( atmos_grid_cartesc_in_basename, atmos_grid_cartesc_in_aggregate )
194 
195  else
196 
197  call atmos_grid_cartesc_generate( &
198  dz, dx, dy, fz(:), fz_max, &
199  offset_x, offset_y, &
200  buffer_dz, buffer_dx, buffer_dy, &
201  buffer_nz, buffer_nx, buffer_ny, &
202  bufffact, &
203  bufffact_z, bufffact_x, bufffact_y )
204 
205  end if
206 
207  call atmos_grid_cartesc_output_info
208 
209  return
logical, public file_aggregate
Definition: scale_file.F90:171
integer, public io_fid_conf
Config file ID.
Definition: scale_io.F90:55
module file
Definition: scale_file.F90:15
module PROCESS
Definition: scale_prc.F90:11
integer, public kmax
of computational cells: z, local
subroutine, public prc_abort
Abort Process.
Definition: scale_prc.F90:338
Here is the call graph for this function:
Here is the caller graph for this function:

◆ atmos_grid_cartesc_allocate()

subroutine, public scale_atmos_grid_cartesc::atmos_grid_cartesc_allocate ( )

Definition at line 217 of file scale_atmos_grid_cartesC.F90.

References atmos_grid_cartesc_cbfx, atmos_grid_cartesc_cbfxg, atmos_grid_cartesc_cbfy, atmos_grid_cartesc_cbfyg, atmos_grid_cartesc_cbfz, atmos_grid_cartesc_cdx, atmos_grid_cartesc_cdxg, atmos_grid_cartesc_cdy, atmos_grid_cartesc_cdyg, atmos_grid_cartesc_cdz, atmos_grid_cartesc_cx, atmos_grid_cartesc_cxg, atmos_grid_cartesc_cy, atmos_grid_cartesc_cyg, atmos_grid_cartesc_cz, atmos_grid_cartesc_domain_center_x, atmos_grid_cartesc_domain_center_y, atmos_grid_cartesc_fbfx, atmos_grid_cartesc_fbfxg, atmos_grid_cartesc_fbfy, atmos_grid_cartesc_fbfyg, atmos_grid_cartesc_fbfz, atmos_grid_cartesc_fdx, atmos_grid_cartesc_fdxg, atmos_grid_cartesc_fdy, atmos_grid_cartesc_fdyg, atmos_grid_cartesc_fdz, atmos_grid_cartesc_fx, atmos_grid_cartesc_fxg, atmos_grid_cartesc_fy, atmos_grid_cartesc_fyg, atmos_grid_cartesc_fz, atmos_grid_cartesc_rcdx, atmos_grid_cartesc_rcdy, atmos_grid_cartesc_rcdz, atmos_grid_cartesc_rfdx, atmos_grid_cartesc_rfdy, atmos_grid_cartesc_rfdz, scale_file::file_open(), scale_atmos_grid_cartesc_index::ia, scale_atmos_grid_cartesc_index::iag, scale_atmos_grid_cartesc_index::ihalo, scale_atmos_grid_cartesc_index::ja, scale_atmos_grid_cartesc_index::jag, scale_atmos_grid_cartesc_index::jhalo, scale_atmos_grid_cartesc_index::ka, and scale_prc::prc_myrank.

Referenced by atmos_grid_cartesc_setup().

217  implicit none
218  !---------------------------------------------------------------------------
219 
220  ! local domain
221  allocate( atmos_grid_cartesc_cz( ka) )
222  allocate( atmos_grid_cartesc_cx( ia) )
223  allocate( atmos_grid_cartesc_cy( ja) )
224  allocate( atmos_grid_cartesc_fz(0:ka) )
225  allocate( atmos_grid_cartesc_fx(0:ia) )
226  allocate( atmos_grid_cartesc_fy(0:ja) )
227 
228  allocate( atmos_grid_cartesc_cdz(ka) )
229  allocate( atmos_grid_cartesc_cdx(ia) )
230  allocate( atmos_grid_cartesc_cdy(ja) )
231  allocate( atmos_grid_cartesc_fdz(ka-1) )
232  allocate( atmos_grid_cartesc_fdx(ia-1) )
233  allocate( atmos_grid_cartesc_fdy(ja-1) )
234 
235  allocate( atmos_grid_cartesc_rcdz(ka) )
236  allocate( atmos_grid_cartesc_rcdx(ia) )
237  allocate( atmos_grid_cartesc_rcdy(ja) )
238  allocate( atmos_grid_cartesc_rfdz(ka-1) )
239  allocate( atmos_grid_cartesc_rfdx(ia-1) )
240  allocate( atmos_grid_cartesc_rfdy(ja-1) )
241 
242  allocate( atmos_grid_cartesc_cbfz( ka) )
243  allocate( atmos_grid_cartesc_cbfx( ia) )
244  allocate( atmos_grid_cartesc_cbfy( ja) )
245  allocate( atmos_grid_cartesc_fbfz(0:ka) )
246  allocate( atmos_grid_cartesc_fbfx(0:ia) )
247  allocate( atmos_grid_cartesc_fbfy(0:ja) )
248 
249  ! global domain
250  allocate( atmos_grid_cartesc_cxg( iag) )
251  allocate( atmos_grid_cartesc_cyg( jag) )
252  allocate( atmos_grid_cartesc_fxg(0:iag) )
253  allocate( atmos_grid_cartesc_fyg(0:jag) )
254 
255  allocate( atmos_grid_cartesc_cdxg(iag) )
256  allocate( atmos_grid_cartesc_cdyg(jag) )
257  allocate( atmos_grid_cartesc_fdxg(iag-1) )
258  allocate( atmos_grid_cartesc_fdyg(jag-1) )
259 
260  allocate( atmos_grid_cartesc_cbfxg( iag) )
261  allocate( atmos_grid_cartesc_cbfyg( jag) )
262  allocate( atmos_grid_cartesc_fbfxg(0:iag) )
263  allocate( atmos_grid_cartesc_fbfyg(0:jag) )
264 
265  return
integer, public ia
of whole cells: x, local, with HALO
integer, public iag
of computational grids
integer, public ja
of whole cells: y, local, with HALO
integer, public jag
of computational grids
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_generate()

subroutine, public scale_atmos_grid_cartesc::atmos_grid_cartesc_generate ( real(rp), intent(in)  DZ,
real(rp), intent(in)  DX,
real(rp), intent(in)  DY,
real(rp), dimension(:), intent(in), optional  FZ,
integer, intent(in), optional  FZ_MAX,
real(rp), intent(in), optional  OFFSET_X,
real(rp), intent(in), optional  OFFSET_Y,
real(rp), intent(in), optional  BUFFER_DZ,
real(rp), intent(in), optional  BUFFER_DX,
real(rp), intent(in), optional  BUFFER_DY,
integer, intent(in), optional  BUFFER_NZ,
integer, intent(in), optional  BUFFER_NX,
integer, intent(in), optional  BUFFER_NY,
real(rp), intent(in), optional  BUFFFACT,
real(rp), intent(in), optional  BUFFFACT_Z,
real(rp), intent(in), optional  BUFFFACT_X,
real(rp), intent(in), optional  BUFFFACT_Y 
)

Generate horizontal&vertical grid.

Definition at line 351 of file scale_atmos_grid_cartesC.F90.

References atmos_grid_cartesc_cbfx, atmos_grid_cartesc_cbfxg, atmos_grid_cartesc_cbfy, atmos_grid_cartesc_cbfyg, atmos_grid_cartesc_cbfz, atmos_grid_cartesc_cdx, atmos_grid_cartesc_cdxg, atmos_grid_cartesc_cdy, atmos_grid_cartesc_cdyg, atmos_grid_cartesc_cdz, atmos_grid_cartesc_cx, atmos_grid_cartesc_cxg, atmos_grid_cartesc_cy, atmos_grid_cartesc_cyg, atmos_grid_cartesc_cz, atmos_grid_cartesc_domain_center_x, atmos_grid_cartesc_domain_center_y, atmos_grid_cartesc_fbfx, atmos_grid_cartesc_fbfxg, atmos_grid_cartesc_fbfy, atmos_grid_cartesc_fbfyg, atmos_grid_cartesc_fbfz, atmos_grid_cartesc_fdx, atmos_grid_cartesc_fdxg, atmos_grid_cartesc_fdy, atmos_grid_cartesc_fdyg, atmos_grid_cartesc_fdz, atmos_grid_cartesc_fx, atmos_grid_cartesc_fxg, atmos_grid_cartesc_fy, atmos_grid_cartesc_fyg, atmos_grid_cartesc_fz, atmos_grid_cartesc_rcdx, atmos_grid_cartesc_rcdy, atmos_grid_cartesc_rcdz, atmos_grid_cartesc_rfdx, atmos_grid_cartesc_rfdy, atmos_grid_cartesc_rfdz, scale_atmos_grid_cartesc_index::ia, scale_atmos_grid_cartesc_index::iag, scale_atmos_grid_cartesc_index::ihalo, scale_atmos_grid_cartesc_index::imax, scale_atmos_grid_cartesc_index::imaxg, scale_atmos_grid_cartesc_index::ja, scale_atmos_grid_cartesc_index::jag, scale_atmos_grid_cartesc_index::jhalo, scale_atmos_grid_cartesc_index::jmax, scale_atmos_grid_cartesc_index::jmaxg, scale_atmos_grid_cartesc_index::ka, scale_atmos_grid_cartesc_index::ke, scale_atmos_grid_cartesc_index::kmax, scale_atmos_grid_cartesc_index::ks, scale_prc_cartesc::prc_2drank, scale_prc::prc_abort(), scale_prc::prc_myrank, scale_prc_cartesc::prc_num_x, and scale_prc_cartesc::prc_num_y.

Referenced by atmos_grid_cartesc_setup().

351  use scale_prc, only: &
352  prc_abort, &
353  prc_myrank
354  use scale_prc_cartesc, only: &
355  prc_2drank, &
356  prc_num_x, &
357  prc_num_y
358  implicit none
359  real(RP), intent(in) :: dz, dx, dy
360  real(RP), intent(in), optional :: fz(:)
361  integer, intent(in), optional :: fz_max
362  real(RP), intent(in), optional :: offset_x, offset_y
363  real(RP), intent(in), optional :: buffer_dz, buffer_dx, buffer_dy
364  integer, intent(in), optional :: buffer_nz, buffer_nx, buffer_ny
365  real(RP), intent(in), optional :: bufffact
366  real(RP), intent(in), optional :: bufffact_z, bufffact_x, bufffact_y
367 
368  real(RP), allocatable :: buffz(:), buffx(:), buffy(:)
369  real(RP) :: bufftotz, bufftotx, bufftoty
370  real(RP) :: fact
371 
372  integer :: kbuff, ibuff, jbuff
373  integer :: kmain, imain, jmain
374 
375  real(RP) :: dz_tmp
376 
377  logical :: use_user_input
378 
379  integer :: k, i, j, ii, jj
380  !---------------------------------------------------------------------------
381 
382  !##### coordinate in global domain #####
383 
384  allocate( buffx(0:iag) )
385  allocate( buffy(0:jag) )
386 
387 
388  ! X-direction
389  ! calculate buffer grid size
390 
391  fact = -1.0_rp
392  if ( present(bufffact_x) ) fact = bufffact_x
393  if ( fact < 0.0_rp .and. present(bufffact) ) fact = bufffact
394  if ( fact < 0.0_rp ) fact = 1.0_rp
395 
396  buffx(0) = dx
397  bufftotx = 0.0_rp
398  ibuff = -1
399  if ( present(buffer_nx) ) ibuff = buffer_nx
400  if ( ibuff > 0 ) then
401  if ( 2*ibuff > imaxg ) then
402  log_error("ATMOS_GRID_CARTESC_generate",*) 'Buffer grid size (', ibuff, &
403  'x2) must be smaller than global domain size (X). Use smaller BUFFER_NX!'
404  call prc_abort
405  endif
406 
407  do i = 1, ibuff
408  buffx(i) = buffx(i-1) * fact
409  bufftotx = bufftotx + buffx(i)
410  enddo
411  imain = imaxg - 2*ibuff
412  else if ( present(buffer_dz) ) then
413  do i = 1, iag
414  if( bufftotx >= buffer_dx ) exit
415  buffx(i) = buffx(i-1) * fact
416  bufftotx = bufftotx + buffx(i)
417  enddo
418  ibuff = i - 1
419  imain = imaxg - 2*ibuff
420 
421  if ( imain < 0 ) then
422  log_error("ATMOS_GRID_CARTESC_generate",*) 'Buffer length (', bufftotx, &
423  'x2[m]) must be smaller than global domain size (X). Use smaller BUFFER_DX!'
424  call prc_abort
425  endif
426  else
427  ibuff = 0
428  imain = imaxg
429  endif
430 
431  ! horizontal coordinate (global domain)
432  if ( present(offset_x) ) then
433  atmos_grid_cartesc_fxg(ihalo) = offset_x
434  else
435  atmos_grid_cartesc_fxg(ihalo) = 0.0_rp
436  end if
437  do i = ihalo-1, 0, -1
438  atmos_grid_cartesc_fxg(i) = atmos_grid_cartesc_fxg(i+1) - buffx(ibuff)
439  enddo
440 
441  do i = 1, ihalo
442  atmos_grid_cartesc_cxg(i) = 0.5_rp * ( atmos_grid_cartesc_fxg(i)+atmos_grid_cartesc_fxg(i-1) )
443  enddo
444 
445  if ( ibuff > 0 ) then
446  do i = ihalo+1, ihalo+ibuff
447  atmos_grid_cartesc_fxg(i) = atmos_grid_cartesc_fxg(i-1) + buffx(ibuff+ihalo+1-i)
448  atmos_grid_cartesc_cxg(i) = 0.5_rp * ( atmos_grid_cartesc_fxg(i)+atmos_grid_cartesc_fxg(i-1) )
449  enddo
450  endif
451 
452  do i = ihalo+ibuff+1, ihalo+ibuff+imain
453  atmos_grid_cartesc_fxg(i) = atmos_grid_cartesc_fxg(i-1) + dx
454  atmos_grid_cartesc_cxg(i) = 0.5_rp * ( atmos_grid_cartesc_fxg(i)+atmos_grid_cartesc_fxg(i-1) )
455  enddo
456 
457  if ( ibuff > 0 ) then
458  do i = ihalo+ibuff+imain+1, ihalo+ibuff+imain+ibuff
459  atmos_grid_cartesc_fxg(i) = atmos_grid_cartesc_fxg(i-1) + buffx(i-ihalo-ibuff-imain)
460  atmos_grid_cartesc_cxg(i) = 0.5_rp * ( atmos_grid_cartesc_fxg(i)+atmos_grid_cartesc_fxg(i-1) )
461  enddo
462  endif
463 
464  do i = ihalo+ibuff+imain+ibuff+1, ihalo+ibuff+imain+ibuff+ihalo
465  atmos_grid_cartesc_fxg(i) = atmos_grid_cartesc_fxg(i-1) + buffx(ibuff)
466  atmos_grid_cartesc_cxg(i) = 0.5_rp * ( atmos_grid_cartesc_fxg(i)+atmos_grid_cartesc_fxg(i-1) )
467  enddo
468 
469  do i = 1, iag
470  atmos_grid_cartesc_cdxg(i) = atmos_grid_cartesc_fxg(i) - atmos_grid_cartesc_fxg(i-1)
471  end do
472  do i = 1, iag-1
473  atmos_grid_cartesc_fdxg(i) = atmos_grid_cartesc_cxg(i+1)-atmos_grid_cartesc_cxg(i)
474  end do
475 
476  ! calc buffer factor (global domain)
477  atmos_grid_cartesc_cbfxg(:) = 0.0_rp
478  atmos_grid_cartesc_fbfxg(:) = 0.0_rp
479  do i = 1, ihalo
480  atmos_grid_cartesc_cbfxg(i) = 1.0_rp
481  enddo
482  do i = 0, ihalo
483  atmos_grid_cartesc_fbfxg(i) = 1.0_rp
484  enddo
485 
486  if ( ibuff > 0 ) then
487  do i = ihalo+1, ihalo+ibuff
488  atmos_grid_cartesc_cbfxg(i) = (bufftotx+atmos_grid_cartesc_fxg(ihalo)-atmos_grid_cartesc_cxg(i)) / bufftotx
489  atmos_grid_cartesc_fbfxg(i) = (bufftotx+atmos_grid_cartesc_fxg(ihalo)-atmos_grid_cartesc_fxg(i)) / bufftotx
490  enddo
491 
492  do i = ihalo+ibuff+imain+1, ihalo+ibuff+imain+ibuff
493  atmos_grid_cartesc_cbfxg(i) = (bufftotx-atmos_grid_cartesc_fxg(iag-ihalo)+atmos_grid_cartesc_cxg(i)) / bufftotx
494  atmos_grid_cartesc_fbfxg(i) = (bufftotx-atmos_grid_cartesc_fxg(iag-ihalo)+atmos_grid_cartesc_fxg(i)) / bufftotx
495  enddo
496  endif
497 
498  do i = ihalo+ibuff+imain+ibuff+1, ihalo+ibuff+imain+ibuff+ihalo
499  atmos_grid_cartesc_cbfxg(i) = 1.0_rp
500  atmos_grid_cartesc_fbfxg(i) = 1.0_rp
501  enddo
502 
503  atmos_grid_cartesc_cbfxg(:) = max( min( atmos_grid_cartesc_cbfxg(:), 1.0_rp ), 0.0_rp )
504  atmos_grid_cartesc_fbfxg(:) = max( min( atmos_grid_cartesc_fbfxg(:), 1.0_rp ), 0.0_rp )
505 
506  ! Y-direction
507  ! calculate buffer grid size
508 
509  fact = -1.0_rp
510  if ( present(bufffact_y) ) fact = bufffact_y
511  if ( fact < 0.0_rp .and. present(bufffact) )fact = bufffact
512  if ( fact < 0.0_rp ) fact = 1.0_rp
513 
514  buffy(0) = dy
515  bufftoty = 0.0_rp
516  jbuff = -1
517  if ( present(buffer_ny) ) jbuff = buffer_ny
518  if ( jbuff > 0 ) then
519  if ( 2*jbuff > jmaxg ) then
520  log_error("ATMOS_GRID_CARTESC_generate",*) 'Buffer grid size (', jbuff, &
521  'x2) must be smaller than global domain size (Y). Use smaller BUFFER_NY!'
522  call prc_abort
523  endif
524 
525  do j = 1, jbuff
526  buffy(j) = buffy(j-1) * fact
527  bufftoty = bufftoty + buffy(j)
528  enddo
529  jmain = jmaxg - 2*jbuff
530  else if ( present(buffer_dy) ) then
531  do j = 1, jag
532  if( bufftoty >= buffer_dy ) exit
533  buffy(j) = buffy(j-1) * fact
534  bufftoty = bufftoty + buffy(j)
535  enddo
536  jbuff = j - 1
537  jmain = jmaxg - 2*jbuff
538 
539  if ( jmain < 0 ) then
540  log_error("ATMOS_GRID_CARTESC_generate",*) 'Buffer length (', bufftoty, &
541  'x2[m]) must be smaller than global domain size (Y). Use smaller BUFFER_DY!'
542  call prc_abort
543  endif
544  else
545  jbuff = 0
546  jmain = jmaxg
547  endif
548 
549  ! horizontal coordinate (global domain)
550  if ( present(offset_y) ) then
551  atmos_grid_cartesc_fyg(jhalo) = offset_y
552  else
553  atmos_grid_cartesc_fyg(jhalo) = 0.0_rp
554  end if
555  do j = jhalo-1, 0, -1
556  atmos_grid_cartesc_fyg(j) = atmos_grid_cartesc_fyg(j+1) - buffy(jbuff)
557  enddo
558 
559  do j = 1, jhalo
560  atmos_grid_cartesc_cyg(j) = 0.5_rp * ( atmos_grid_cartesc_fyg(j)+atmos_grid_cartesc_fyg(j-1) )
561  enddo
562 
563  if ( jbuff > 0 ) then
564  do j = jhalo+1, jhalo+jbuff
565  atmos_grid_cartesc_fyg(j) = atmos_grid_cartesc_fyg(j-1) + buffy(jbuff+jhalo+1-j)
566  atmos_grid_cartesc_cyg(j) = 0.5_rp * ( atmos_grid_cartesc_fyg(j)+atmos_grid_cartesc_fyg(j-1) )
567  enddo
568  endif
569 
570  do j = jhalo+jbuff+1, jhalo+jbuff+jmain
571  atmos_grid_cartesc_fyg(j) = atmos_grid_cartesc_fyg(j-1) + dy
572  atmos_grid_cartesc_cyg(j) = 0.5_rp * ( atmos_grid_cartesc_fyg(j)+atmos_grid_cartesc_fyg(j-1) )
573  enddo
574 
575  if ( jbuff > 0 ) then
576  do j = jhalo+jbuff+jmain+1, jhalo+jbuff+jmain+jbuff
577  atmos_grid_cartesc_fyg(j) = atmos_grid_cartesc_fyg(j-1) + buffy(j-jhalo-jbuff-jmain)
578  atmos_grid_cartesc_cyg(j) = 0.5_rp * ( atmos_grid_cartesc_fyg(j)+atmos_grid_cartesc_fyg(j-1) )
579  enddo
580  endif
581 
582  do j = jhalo+jbuff+jmain+jbuff+1, jhalo+jbuff+jmain+jbuff+jhalo
583  atmos_grid_cartesc_fyg(j) = atmos_grid_cartesc_fyg(j-1) + buffy(jbuff)
584  atmos_grid_cartesc_cyg(j) = 0.5_rp * ( atmos_grid_cartesc_fyg(j)+atmos_grid_cartesc_fyg(j-1) )
585  enddo
586 
587  do j = 1, jag
588  atmos_grid_cartesc_cdyg(j) = atmos_grid_cartesc_fyg(j) - atmos_grid_cartesc_fyg(j-1)
589  end do
590  do j = 1, jag-1
591  atmos_grid_cartesc_fdyg(j) = atmos_grid_cartesc_cyg(j+1)-atmos_grid_cartesc_cyg(j)
592  end do
593 
594  ! calc buffer factor (global domain)
595  atmos_grid_cartesc_cbfyg(:) = 0.0_rp
596  atmos_grid_cartesc_fbfyg(:) = 0.0_rp
597  do j = 1, jhalo
598  atmos_grid_cartesc_cbfyg(j) = 1.0_rp
599  enddo
600  do j = 0, jhalo
601  atmos_grid_cartesc_fbfyg(j) = 1.0_rp
602  enddo
603 
604  if ( jbuff > 0 ) then
605  do j = jhalo+1, jhalo+jbuff
606  atmos_grid_cartesc_cbfyg(j) = (bufftoty+atmos_grid_cartesc_fyg(jhalo)-atmos_grid_cartesc_cyg(j)) / bufftoty
607  atmos_grid_cartesc_fbfyg(j) = (bufftoty+atmos_grid_cartesc_fyg(jhalo)-atmos_grid_cartesc_fyg(j)) / bufftoty
608  enddo
609 
610  do j = jhalo+jbuff+jmain+1, jhalo+jbuff+jmain+jbuff
611  atmos_grid_cartesc_cbfyg(j) = (bufftoty-atmos_grid_cartesc_fyg(jag-jhalo)+atmos_grid_cartesc_cyg(j)) / bufftoty
612  atmos_grid_cartesc_fbfyg(j) = (bufftoty-atmos_grid_cartesc_fyg(jag-jhalo)+atmos_grid_cartesc_fyg(j)) / bufftoty
613  enddo
614  endif
615 
616  do j = jhalo+jbuff+jmain+jbuff+1, jhalo+jbuff+jmain+jbuff+jhalo
617  atmos_grid_cartesc_cbfyg(j) = 1.0_rp
618  atmos_grid_cartesc_fbfyg(j) = 1.0_rp
619  enddo
620  atmos_grid_cartesc_cbfyg(:) = max( min( atmos_grid_cartesc_cbfyg(:), 1.0_rp ), 0.0_rp )
621  atmos_grid_cartesc_fbfyg(:) = max( min( atmos_grid_cartesc_fbfyg(:), 1.0_rp ), 0.0_rp )
622 
623  deallocate( buffx )
624  deallocate( buffy )
625 
626  !##### coordinate in local domain #####
627 
628  allocate( buffz(0:ka) )
629 
630  use_user_input = .false.
631  if ( present(fz) ) then
632  if ( maxval(fz(:)) > 0.0_rp ) then ! try to use input from namelist
633  log_info("ATMOS_GRID_CARTESC_generate",*) 'Z coordinate is given from NAMELIST.'
634 
635  if ( kmax < 2 ) then
636  log_error("ATMOS_GRID_CARTESC_generate",*) 'KMAX must be larger than 1. Check!', kmax
637  call prc_abort
638  endif
639 
640  if ( kmax > fz_max ) then
641  log_error("ATMOS_GRID_CARTESC_generate",*) 'KMAX must be smaller than ', fz_max, '. Check!', kmax
642  call prc_abort
643  endif
644 
645  if ( minval(fz(1:kmax)) <= 0.0_rp ) then
646  log_error("ATMOS_GRID_CARTESC_generate",*) 'FZ must be positive. Check! minval(FZ(1:KMAX))=', minval(fz(1:kmax))
647  call prc_abort
648  endif
649 
650  use_user_input = .true.
651  endif
652  end if
653 
654  if ( use_user_input ) then ! input from namelist
655 
656  ! Z-direction
657  ! calculate buffer grid size
658 
659  kbuff = -1
660  if ( present(buffer_nz) ) kbuff = buffer_nz
661  if ( kbuff > 0 ) then
662  if ( kbuff > kmax ) then
663  log_error("ATMOS_GRID_CARTESC_generate",*) 'Buffer grid size (', kbuff, &
664  ') must be smaller than global domain size (Z). Use smaller BUFFER_NZ!'
665  call prc_abort
666  endif
667 
668  bufftotz = 0.0_rp
669  do k = kmax, kmax-kbuff+1, -1
670  bufftotz = bufftotz + ( fz(k) - fz(k-1) )
671  enddo
672  kmain = kmax - kbuff
673  else if ( present(buffer_dz) ) then
674  if ( buffer_dz > fz(kmax) ) then
675  log_error("ATMOS_GRID_CARTESC_generate",*) 'Buffer length (', buffer_dz, &
676  '[m]) must be smaller than global domain size (Z). Use smaller BUFFER_DZ!'
677  call prc_abort
678  endif
679 
680  bufftotz = 0.0_rp
681  do k = kmax, 2, -1
682  if( bufftotz >= buffer_dz ) exit
683  bufftotz = bufftotz + ( fz(k) - fz(k-1) )
684  enddo
685  kbuff = kmax - k
686  kmain = k
687  else
688  bufftotz = 0.0_rp
689  kbuff = 0
690  kmain = kmax
691  endif
692 
693  ! vertical coordinate (local=global domain)
694  atmos_grid_cartesc_fz(ks-1) = 0.0_rp
695 
696  dz_tmp = fz(1)
697  do k = ks-2, 0, -1
698  atmos_grid_cartesc_fz(k) = atmos_grid_cartesc_fz(k+1) - dz_tmp
699  enddo
700 
701  do k = ks, ke
702  atmos_grid_cartesc_fz(k) = fz(k-ks+1)
703  enddo
704 
705  dz_tmp = fz(kmax) - fz(kmax-1)
706  do k = ke+1, ka
707  atmos_grid_cartesc_fz(k) = atmos_grid_cartesc_fz(k-1) + dz_tmp
708  enddo
709 
710  do k = 1, ka
711  atmos_grid_cartesc_cz(k) = 0.5_rp * ( atmos_grid_cartesc_fz(k)+atmos_grid_cartesc_fz(k-1) )
712  enddo
713 
714  else ! calc using DZ
715 
716  ! Z-direction
717  ! calculate buffer grid size
718 
719  fact = -1.0_rp
720  if ( present(bufffact_z) ) fact = bufffact_z
721  if ( fact < 0.0_rp .and. present(bufffact) ) fact = bufffact
722  if ( fact < 0.0_rp ) fact = 1.0_rp
723 
724  buffz(0) = dz
725  bufftotz = 0.0_rp
726  kbuff = -1
727  if ( present(buffer_nz) ) kbuff = buffer_nz
728  if ( kbuff > 0 ) then
729  if ( kbuff > kmax ) then
730  log_error("ATMOS_GRID_CARTESC_generate",*) 'Buffer grid size (', kbuff, &
731  ') must be smaller than global domain size (Z). Use smaller BUFFER_NZ!'
732  call prc_abort
733  endif
734 
735  do k = 1, kbuff
736  buffz(k) = buffz(k-1) * fact
737  bufftotz = bufftotz + buffz(k)
738  enddo
739  kmain = kmax - kbuff
740  else if ( present(buffer_dz) ) then
741  do k = 1, ka
742  if( bufftotz >= buffer_dz ) exit
743  buffz(k) = buffz(k-1) * fact
744  bufftotz = bufftotz + buffz(k)
745  enddo
746  kbuff = k - 1
747  kmain = kmax - kbuff
748 
749  if ( kmain < 0 ) then
750  log_error("ATMOS_GRID_CARTESC_generate",*) 'Buffer length (', bufftotz, &
751  '[m]) must be smaller than global domain size (Z). Use smaller BUFFER_DZ!'
752  call prc_abort
753  endif
754  else
755  kbuff = 0
756  kmain = kmax
757  endif
758 
759  ! vertical coordinate (local=global domain)
760  atmos_grid_cartesc_fz(ks-1) = 0.0_rp
761  do k = ks-2, 0, -1
762  atmos_grid_cartesc_fz(k) = atmos_grid_cartesc_fz(k+1) - dz
763  enddo
764 
765  do k = 1, ks-1
766  atmos_grid_cartesc_cz(k) = 0.5_rp * ( atmos_grid_cartesc_fz(k)+atmos_grid_cartesc_fz(k-1) )
767  enddo
768 
769  do k = ks, ks+kmain-1
770  atmos_grid_cartesc_fz(k) = atmos_grid_cartesc_fz(k-1) + dz
771  atmos_grid_cartesc_cz(k) = 0.5_rp * ( atmos_grid_cartesc_fz(k)+atmos_grid_cartesc_fz(k-1) )
772  enddo
773 
774  if ( kbuff > 0 ) then
775  do k = ks+kmain, ke
776  atmos_grid_cartesc_fz(k) = atmos_grid_cartesc_fz(k-1) + buffz(k-ks-kmain+1)
777  atmos_grid_cartesc_cz(k) = 0.5_rp * ( atmos_grid_cartesc_fz(k)+atmos_grid_cartesc_fz(k-1) )
778  enddo
779  endif
780 
781  do k = ke+1, ka
782  atmos_grid_cartesc_fz(k) = atmos_grid_cartesc_fz(k-1) + buffz(kbuff)
783  atmos_grid_cartesc_cz(k) = 0.5_rp * ( atmos_grid_cartesc_fz(k)+atmos_grid_cartesc_fz(k-1) )
784  enddo
785 
786  endif
787 
788  ! calc buffer factor (global domain)
789  atmos_grid_cartesc_cbfz(:) = 0.0_rp
790  atmos_grid_cartesc_fbfz(:) = 0.0_rp
791  if ( kbuff > 0 ) then
792  do k = ks+kmain, ke
793  atmos_grid_cartesc_cbfz(k) = (bufftotz-atmos_grid_cartesc_fz(ke)+atmos_grid_cartesc_cz(k)) / bufftotz
794  atmos_grid_cartesc_fbfz(k) = (bufftotz-atmos_grid_cartesc_fz(ke)+atmos_grid_cartesc_fz(k)) / bufftotz
795  enddo
796  endif
797 
798  do k = ke+1, ka
799  atmos_grid_cartesc_cbfz(k) = 1.0_rp
800  atmos_grid_cartesc_fbfz(k) = 1.0_rp
801  enddo
802  atmos_grid_cartesc_cbfz(:) = max( min( atmos_grid_cartesc_cbfz(:), 1.0_rp ), 0.0_rp )
803  atmos_grid_cartesc_fbfz(:) = max( min( atmos_grid_cartesc_fbfz(:), 1.0_rp ), 0.0_rp )
804 
805  deallocate( buffz )
806 
807  ! vertical coordinate (local domain)
808  do k = 1, ka
809  atmos_grid_cartesc_cdz(k) = atmos_grid_cartesc_fz(k) - atmos_grid_cartesc_fz(k-1)
810  atmos_grid_cartesc_rcdz(k) = 1.0_rp / atmos_grid_cartesc_cdz(k)
811  enddo
812 
813  do k = 1, ka-1
814  atmos_grid_cartesc_fdz(k) = atmos_grid_cartesc_cz(k+1)-atmos_grid_cartesc_cz(k)
815  atmos_grid_cartesc_rfdz(k) = 1.0_rp / atmos_grid_cartesc_fdz(k)
816  enddo
817 
818  ! X-direction
819  ! horizontal coordinate (local domain)
820  do i = 0, ia
821  ii = i + prc_2drank(prc_myrank,1) * imax
822 
823  atmos_grid_cartesc_fx(i) = atmos_grid_cartesc_fxg(ii)
824  enddo
825 
826  ii = prc_2drank(prc_myrank,1) * imax
827  atmos_grid_cartesc_fbfx(0) = atmos_grid_cartesc_fbfxg(ii)
828  do i = 1, ia
829  ii = i + prc_2drank(prc_myrank,1) * imax
830 
831  atmos_grid_cartesc_cx(i) = atmos_grid_cartesc_cxg(ii)
832  atmos_grid_cartesc_cbfx(i) = atmos_grid_cartesc_cbfxg(ii)
833  atmos_grid_cartesc_fbfx(i) = atmos_grid_cartesc_fbfxg(ii)
834 
835  atmos_grid_cartesc_cdx(i) = atmos_grid_cartesc_fx(i) - atmos_grid_cartesc_fx(i-1)
836  atmos_grid_cartesc_rcdx(i) = 1.0_rp / atmos_grid_cartesc_cdx(i)
837  enddo
838 
839  do i = 1, ia-1
840  atmos_grid_cartesc_fdx(i) = atmos_grid_cartesc_cx(i+1)-atmos_grid_cartesc_cx(i)
841  atmos_grid_cartesc_rfdx(i) = 1.0_rp / atmos_grid_cartesc_fdx(i)
842  enddo
843 
844  ! Y-direction
845  ! horizontal coordinate (local domain)
846  do j = 0, ja
847  jj = j + prc_2drank(prc_myrank,2) * jmax
848 
849  atmos_grid_cartesc_fy(j) = atmos_grid_cartesc_fyg(jj)
850  enddo
851 
852  jj = prc_2drank(prc_myrank,2) * jmax
853  atmos_grid_cartesc_fbfy(0) = atmos_grid_cartesc_fbfyg(jj)
854  do j = 1, ja
855  jj = j + prc_2drank(prc_myrank,2) * jmax
856 
857  atmos_grid_cartesc_cy(j) = atmos_grid_cartesc_cyg(jj)
858  atmos_grid_cartesc_cbfy(j) = atmos_grid_cartesc_cbfyg(jj)
859  atmos_grid_cartesc_fbfy(j) = atmos_grid_cartesc_fbfyg(jj)
860 
861  atmos_grid_cartesc_cdy(j) = atmos_grid_cartesc_fy(j) - atmos_grid_cartesc_fy(j-1)
862  atmos_grid_cartesc_rcdy(j) = 1.0_rp / atmos_grid_cartesc_cdy(j)
863  enddo
864 
865  do j = 1, ja-1
866  atmos_grid_cartesc_fdy(j) = atmos_grid_cartesc_cy(j+1)-atmos_grid_cartesc_cy(j)
867  atmos_grid_cartesc_rfdy(j) = 1.0_rp / atmos_grid_cartesc_fdy(j)
868  enddo
869 
870  atmos_grid_cartesc_domain_center_x = 0.5_rp * ( atmos_grid_cartesc_fxg(ihalo) + atmos_grid_cartesc_fxg(iag-ihalo) )
871  atmos_grid_cartesc_domain_center_y = 0.5_rp * ( atmos_grid_cartesc_fyg(jhalo) + atmos_grid_cartesc_fyg(jag-jhalo) )
872 
873  ! report
874  log_newline
875  log_info("ATMOS_GRID_CARTESC_generate",*) 'Grid information '
876  log_info_cont('(1x,A,3(1x,F9.3))') 'delta Z, X, Y [m] :', dz, dx, dy
877 
878  log_newline
879  log_info("ATMOS_GRID_CARTESC_generate",*) 'Main/buffer Grid (global) :'
880  log_info_cont('(1x,2(A,I6))') 'Z: buffer = ', kbuff,' x 1, main = ',kmain
881  log_info_cont('(1x,2(A,I6))') 'X: buffer = ', ibuff,' x 2, main = ',imain
882  log_info_cont('(1x,2(A,I6))') 'Y: buffer = ', jbuff,' x 2, main = ',jmain
883 
884  log_newline
885  log_info("ATMOS_GRID_CARTESC_generate",*) 'Domain size [km] (global) :'
886  log_info_cont('(1x,7(A,F9.3))') 'Z:', &
887  atmos_grid_cartesc_fz(0) *1.e-3_rp, ' -HALO- ', &
888  atmos_grid_cartesc_fz(ks-1) *1.e-3_rp, ' | ', &
889  atmos_grid_cartesc_cz(ks) *1.e-3_rp, ' - ', &
890  atmos_grid_cartesc_cz(ke-kbuff)*1.e-3_rp, ' | ', &
891  atmos_grid_cartesc_fz(ke-kbuff)*1.e-3_rp, ' -buffer- ', &
892  atmos_grid_cartesc_fz(ke) *1.e-3_rp, ' -HALO- ', &
893  atmos_grid_cartesc_fz(ka) *1.e-3_rp
894  log_info_cont('(1x,8(A,F9.3))') 'X:', &
895  atmos_grid_cartesc_fxg(0) *1.e-3_rp, ' -HALO- ', &
896  atmos_grid_cartesc_fxg(ihalo) *1.e-3_rp, ' -buffer- ', &
897  atmos_grid_cartesc_fxg(ihalo+ibuff) *1.e-3_rp, ' | ', &
898  atmos_grid_cartesc_cxg(ihalo+ibuff+1) *1.e-3_rp, ' - ', &
899  atmos_grid_cartesc_cxg(iag-ihalo-ibuff)*1.e-3_rp, ' | ', &
900  atmos_grid_cartesc_fxg(iag-ihalo-ibuff)*1.e-3_rp, ' -buffer- ', &
901  atmos_grid_cartesc_fxg(iag-ihalo) *1.e-3_rp, ' -HALO- ', &
902  atmos_grid_cartesc_fxg(iag) *1.e-3_rp
903  log_info_cont('(1x,8(A,F9.3))') 'Y:', &
904  atmos_grid_cartesc_fyg(0) *1.e-3_rp, ' -HALO- ', &
905  atmos_grid_cartesc_fyg(jhalo) *1.e-3_rp, ' -buffer- ', &
906  atmos_grid_cartesc_fyg(jhalo+jbuff) *1.e-3_rp, ' | ', &
907  atmos_grid_cartesc_cyg(jhalo+jbuff+1) *1.e-3_rp, ' - ', &
908  atmos_grid_cartesc_cyg(jag-jhalo-jbuff)*1.e-3_rp, ' | ', &
909  atmos_grid_cartesc_fyg(jag-jhalo-jbuff)*1.e-3_rp, ' -buffer- ', &
910  atmos_grid_cartesc_fyg(jag-jhalo) *1.e-3_rp, ' -HALO- ', &
911  atmos_grid_cartesc_fyg(jag) *1.e-3_rp
912 
913  return
integer, public jmax
of computational cells: y, local
integer, public imax
of computational cells: x, local
integer, public ia
of whole cells: x, local, with HALO
integer, public iag
of computational grids
integer, public ja
of whole cells: y, local, with HALO
module process / cartesC
integer, public jmaxg
of computational cells: y, global
integer, public ke
end point of inner domain: z, local
module PROCESS
Definition: scale_prc.F90:11
integer, public ks
start point of inner domain: z, local
integer, public prc_myrank
process num in local communicator
Definition: scale_prc.F90:89
integer, dimension(:,:), allocatable, public prc_2drank
node index in 2D topology
integer, public kmax
of computational cells: z, local
subroutine, public prc_abort
Abort Process.
Definition: scale_prc.F90:338
integer, public jag
of computational grids
integer, public prc_num_y
y length of 2D processor topology
integer, public imaxg
of computational cells: x, global
integer, public ka
of whole cells: z, local, with HALO
integer, public prc_num_x
x length of 2D processor topology
Here is the call graph for this function:
Here is the caller graph for this function:

◆ atmos_grid_cartesc_output_info()

subroutine scale_atmos_grid_cartesc::atmos_grid_cartesc_output_info ( )

Output information.

Definition at line 919 of file scale_atmos_grid_cartesC.F90.

References atmos_grid_cartesc_cbfz, atmos_grid_cartesc_cdz, atmos_grid_cartesc_cx, atmos_grid_cartesc_cy, atmos_grid_cartesc_cz, atmos_grid_cartesc_domain_center_x, atmos_grid_cartesc_domain_center_y, atmos_grid_cartesc_fbfz, atmos_grid_cartesc_fx, atmos_grid_cartesc_fy, atmos_grid_cartesc_fz, 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, and scale_atmos_grid_cartesc_index::ks.

Referenced by atmos_grid_cartesc_setup().

919  integer :: k
920 
921  log_newline
922  log_info("ATMOS_GRID_CARTESC_output_info",*) 'Center Position of Grid (global) :'
923  log_info_cont('(1x,A,F12.3)') 'X: ', atmos_grid_cartesc_domain_center_x
924  log_info_cont('(1x,A,F12.3)') 'Y: ', atmos_grid_cartesc_domain_center_y
925 
926 
927  log_newline
928  log_info("ATMOS_GRID_CARTESC_output_info",*) 'Domain size [km] (local) :'
929  log_info_cont('(1x,6(A,F9.3))') 'X:', &
930  atmos_grid_cartesc_fx(0) *1.e-3_rp, ' -HALO- ', atmos_grid_cartesc_fx(is-1)*1.e-3_rp, ' | ', &
931  atmos_grid_cartesc_cx(is)*1.e-3_rp, ' - ', atmos_grid_cartesc_cx(ie) *1.e-3_rp, ' | ', &
932  atmos_grid_cartesc_fx(ie)*1.e-3_rp, ' -HALO- ', atmos_grid_cartesc_fx(ia) *1.e-3_rp
933  log_info_cont('(1x,6(A,F9.3))') 'Y:', &
934  atmos_grid_cartesc_fy(0) *1.e-3_rp, ' -HALO- ', atmos_grid_cartesc_fy(js-1)*1.e-3_rp, ' | ', &
935  atmos_grid_cartesc_cy(js)*1.e-3_rp, ' - ', atmos_grid_cartesc_cy(je) *1.e-3_rp, ' | ', &
936  atmos_grid_cartesc_fy(je)*1.e-3_rp, ' -HALO- ', atmos_grid_cartesc_fy(ja) *1.e-3_rp
937 
938 
939  log_newline
940  log_info("ATMOS_GRID_CARTESC_output_info",'(1x,A)') 'Vertical Coordinate'
941  log_info_cont('(1x,A)') '|===============================================|'
942  log_info_cont('(1x,A)') '| k z zh dz buffer k |'
943  log_info_cont('(1x,A)') '| [m] [m] [m] factor |'
944 
945  do k = ka, ke+1, -1
946  log_info_cont('(1x,A,F9.2,A,F9.2,I5,A)') '| ',atmos_grid_cartesc_fz(k),' ', atmos_grid_cartesc_fbfz(k),k,' |'
947  log_info_cont('(1x,A,I5,F9.2,A,2F9.2,A)') '|',k,atmos_grid_cartesc_cz(k),' ',atmos_grid_cartesc_cdz(k), atmos_grid_cartesc_cbfz(k),' |'
948  enddo
949 
950  k = ke
951  log_info_cont('(1x,A,F9.2,A,F9.2,I5,A)') '| ',atmos_grid_cartesc_fz(k),' ', atmos_grid_cartesc_fbfz(k),k,' | KE = TOA'
952  log_info_cont('(1x,A,I5,F9.2,A,2F9.2,A)') '|',k,atmos_grid_cartesc_cz(k),' ',atmos_grid_cartesc_cdz(k), atmos_grid_cartesc_cbfz(k),' |'
953 
954  do k = ke-1, ks, -1
955  log_info_cont('(1x,A,F9.2,A,F9.2,I5,A)') '| ',atmos_grid_cartesc_fz(k),' ', atmos_grid_cartesc_fbfz(k),k,' |'
956  log_info_cont('(1x,A,I5,F9.2,A,2F9.2,A)') '|',k,atmos_grid_cartesc_cz(k),' ',atmos_grid_cartesc_cdz(k), atmos_grid_cartesc_cbfz(k),' |'
957  enddo
958 
959  k = ks-1
960  log_info_cont('(1x,A,F9.2,A,F9.2,I5,A)') '| ',atmos_grid_cartesc_fz(k),' ', atmos_grid_cartesc_fbfz(k),k,' | KS-1 = surface'
961  log_info_cont('(1x,A,I5,F9.2,A,2F9.2,A)') '|',k,atmos_grid_cartesc_cz(k),' ',atmos_grid_cartesc_cdz(k), atmos_grid_cartesc_cbfz(k),' |'
962 
963  do k = ks-2, 1, -1
964  log_info_cont('(1x,A,F9.2,A,F9.2,I5,A)') '| ',atmos_grid_cartesc_fz(k),' ', atmos_grid_cartesc_fbfz(k),k,' |'
965  log_info_cont('(1x,A,I5,F9.2,A,2F9.2,A)') '|',k,atmos_grid_cartesc_cz(k),' ',atmos_grid_cartesc_cdz(k), atmos_grid_cartesc_cbfz(k),' |'
966  enddo
967 
968  k = 0
969  log_info_cont('(1x,A,F9.2,A,F9.2,I5,A)') '| ',atmos_grid_cartesc_fz(k),' ', atmos_grid_cartesc_fbfz(k),k,' |'
970 
971  log_info_cont('(1x,A)') '|===============================================|'
972 
973 
974  return
integer, public ia
of whole cells: x, local, with HALO
integer, public ja
of whole cells: y, local, with HALO
integer, public is
start point of inner domain: x, local
integer, public ie
end point of inner domain: x, local
integer, public ke
end point of inner domain: z, local
integer, public je
end point of inner domain: y, local
integer, public ks
start point of inner domain: z, local
integer, public js
start point of inner domain: y, local
integer, public ka
of whole cells: z, local, with HALO
Here is the caller graph for this function:

Variable Documentation

◆ atmos_grid_cartesc_name

character(len=7), parameter, public scale_atmos_grid_cartesc::atmos_grid_cartesc_name = 'cartesC'

Definition at line 36 of file scale_atmos_grid_cartesC.F90.

Referenced by scale_file_cartesc::file_cartesc_put_globalattributes(), and scale_file_history_cartesc::file_history_cartesc_truncate_3d().

36  character(len=7), public, parameter :: atmos_grid_cartesc_name = 'cartesC'

◆ dz

real(rp), public scale_atmos_grid_cartesc::dz

Definition at line 38 of file scale_atmos_grid_cartesC.F90.

Referenced by atmos_grid_cartesc_setup().

38  real(RP), public :: dz, dx, dy

◆ dx

real(rp), public scale_atmos_grid_cartesc::dx

◆ dy

real(rp), public scale_atmos_grid_cartesc::dy

◆ atmos_grid_cartesc_cz

real(rp), dimension (:), allocatable, public scale_atmos_grid_cartesc::atmos_grid_cartesc_cz

◆ atmos_grid_cartesc_fz

real(rp), dimension (:), allocatable, public scale_atmos_grid_cartesc::atmos_grid_cartesc_fz

◆ atmos_grid_cartesc_cdz

real(rp), dimension (:), allocatable, public scale_atmos_grid_cartesc::atmos_grid_cartesc_cdz

◆ atmos_grid_cartesc_fdz

real(rp), dimension (:), allocatable, public scale_atmos_grid_cartesc::atmos_grid_cartesc_fdz

◆ atmos_grid_cartesc_rcdz

real(rp), dimension (:), allocatable, public scale_atmos_grid_cartesc::atmos_grid_cartesc_rcdz

◆ atmos_grid_cartesc_rfdz

real(rp), dimension (:), allocatable, public scale_atmos_grid_cartesc::atmos_grid_cartesc_rfdz

◆ atmos_grid_cartesc_cbfz

real(rp), dimension (:), allocatable, public scale_atmos_grid_cartesc::atmos_grid_cartesc_cbfz

◆ atmos_grid_cartesc_fbfz

real(rp), dimension (:), allocatable, public scale_atmos_grid_cartesc::atmos_grid_cartesc_fbfz

◆ atmos_grid_cartesc_lcz

real(rp), dimension (:), allocatable, public scale_atmos_grid_cartesc::atmos_grid_cartesc_lcz

center coordinate [m]: z, local land

Definition at line 50 of file scale_atmos_grid_cartesC.F90.

50  real(RP), public, allocatable :: atmos_grid_cartesc_lcz (:)

◆ atmos_grid_cartesc_lfz

real(rp), dimension (:), allocatable, public scale_atmos_grid_cartesc::atmos_grid_cartesc_lfz

face coordinate [m]: z, local

Definition at line 51 of file scale_atmos_grid_cartesC.F90.

51  real(RP), public, allocatable :: atmos_grid_cartesc_lfz (:)

◆ atmos_grid_cartesc_lcdz

real(rp), dimension(:), allocatable, public scale_atmos_grid_cartesc::atmos_grid_cartesc_lcdz

z-length of control volume [m]

Definition at line 52 of file scale_atmos_grid_cartesC.F90.

52  real(RP), public, allocatable :: atmos_grid_cartesc_lcdz(:)

◆ atmos_grid_cartesc_cx

real(rp), dimension (:), allocatable, public scale_atmos_grid_cartesc::atmos_grid_cartesc_cx

◆ atmos_grid_cartesc_cy

real(rp), dimension (:), allocatable, public scale_atmos_grid_cartesc::atmos_grid_cartesc_cy

◆ atmos_grid_cartesc_fx

real(rp), dimension (:), allocatable, public scale_atmos_grid_cartesc::atmos_grid_cartesc_fx

◆ atmos_grid_cartesc_fy

real(rp), dimension (:), allocatable, public scale_atmos_grid_cartesc::atmos_grid_cartesc_fy

◆ atmos_grid_cartesc_cdx

real(rp), dimension (:), allocatable, public scale_atmos_grid_cartesc::atmos_grid_cartesc_cdx

◆ atmos_grid_cartesc_cdy

real(rp), dimension (:), allocatable, public scale_atmos_grid_cartesc::atmos_grid_cartesc_cdy

◆ atmos_grid_cartesc_fdx

real(rp), dimension (:), allocatable, public scale_atmos_grid_cartesc::atmos_grid_cartesc_fdx

◆ atmos_grid_cartesc_fdy

real(rp), dimension (:), allocatable, public scale_atmos_grid_cartesc::atmos_grid_cartesc_fdy

◆ atmos_grid_cartesc_rcdx

real(rp), dimension (:), allocatable, public scale_atmos_grid_cartesc::atmos_grid_cartesc_rcdx

◆ atmos_grid_cartesc_rcdy

real(rp), dimension (:), allocatable, public scale_atmos_grid_cartesc::atmos_grid_cartesc_rcdy

◆ atmos_grid_cartesc_rfdx

real(rp), dimension (:), allocatable, public scale_atmos_grid_cartesc::atmos_grid_cartesc_rfdx

◆ atmos_grid_cartesc_rfdy

real(rp), dimension (:), allocatable, public scale_atmos_grid_cartesc::atmos_grid_cartesc_rfdy

◆ atmos_grid_cartesc_cbfx

real(rp), dimension (:), allocatable, public scale_atmos_grid_cartesc::atmos_grid_cartesc_cbfx

◆ atmos_grid_cartesc_cbfy

real(rp), dimension (:), allocatable, public scale_atmos_grid_cartesc::atmos_grid_cartesc_cbfy

◆ atmos_grid_cartesc_fbfx

real(rp), dimension (:), allocatable, public scale_atmos_grid_cartesc::atmos_grid_cartesc_fbfx

◆ atmos_grid_cartesc_fbfy

real(rp), dimension (:), allocatable, public scale_atmos_grid_cartesc::atmos_grid_cartesc_fbfy

◆ atmos_grid_cartesc_cxg

real(rp), dimension (:), allocatable, public scale_atmos_grid_cartesc::atmos_grid_cartesc_cxg

center coordinate [m]: x, global

Definition at line 75 of file scale_atmos_grid_cartesC.F90.

Referenced by atmos_grid_cartesc_allocate(), atmos_grid_cartesc_generate(), mod_copytopo::copytopo(), scale_file_cartesc::file_cartesc_write_axes(), and scale_file_history_cartesc::file_history_cartesc_truncate_3d().

75  real(RP), public, allocatable :: atmos_grid_cartesc_cxg (:)

◆ atmos_grid_cartesc_cyg

real(rp), dimension (:), allocatable, public scale_atmos_grid_cartesc::atmos_grid_cartesc_cyg

center coordinate [m]: y, global

Definition at line 76 of file scale_atmos_grid_cartesC.F90.

Referenced by atmos_grid_cartesc_allocate(), atmos_grid_cartesc_generate(), mod_copytopo::copytopo(), scale_file_cartesc::file_cartesc_write_axes(), and scale_file_history_cartesc::file_history_cartesc_truncate_3d().

76  real(RP), public, allocatable :: atmos_grid_cartesc_cyg (:)

◆ atmos_grid_cartesc_fxg

real(rp), dimension (:), allocatable, public scale_atmos_grid_cartesc::atmos_grid_cartesc_fxg

face coordinate [m]: x, global

Definition at line 77 of file scale_atmos_grid_cartesC.F90.

Referenced by atmos_grid_cartesc_allocate(), atmos_grid_cartesc_generate(), mod_copytopo::copytopo(), scale_file_cartesc::file_cartesc_write_axes(), and scale_file_history_cartesc::file_history_cartesc_truncate_3d().

77  real(RP), public, allocatable :: atmos_grid_cartesc_fxg (:)

◆ atmos_grid_cartesc_fyg

real(rp), dimension (:), allocatable, public scale_atmos_grid_cartesc::atmos_grid_cartesc_fyg

◆ atmos_grid_cartesc_cdxg

real(rp), dimension (:), allocatable, public scale_atmos_grid_cartesc::atmos_grid_cartesc_cdxg

center coordinate [m]: x, global

Definition at line 80 of file scale_atmos_grid_cartesC.F90.

Referenced by atmos_grid_cartesc_allocate(), atmos_grid_cartesc_generate(), scale_file_cartesc::file_cartesc_write_axes(), and scale_file_history_cartesc::file_history_cartesc_truncate_3d().

80  real(RP), public, allocatable :: atmos_grid_cartesc_cdxg (:)

◆ atmos_grid_cartesc_cdyg

real(rp), dimension (:), allocatable, public scale_atmos_grid_cartesc::atmos_grid_cartesc_cdyg

center coordinate [m]: y, global

Definition at line 81 of file scale_atmos_grid_cartesC.F90.

Referenced by atmos_grid_cartesc_allocate(), atmos_grid_cartesc_generate(), scale_file_cartesc::file_cartesc_write_axes(), and scale_file_history_cartesc::file_history_cartesc_truncate_3d().

81  real(RP), public, allocatable :: atmos_grid_cartesc_cdyg (:)

◆ atmos_grid_cartesc_fdxg

real(rp), dimension (:), allocatable, public scale_atmos_grid_cartesc::atmos_grid_cartesc_fdxg

center coordinate [m]: x, global

Definition at line 82 of file scale_atmos_grid_cartesC.F90.

Referenced by atmos_grid_cartesc_allocate(), atmos_grid_cartesc_generate(), scale_file_cartesc::file_cartesc_write_axes(), and scale_file_history_cartesc::file_history_cartesc_truncate_3d().

82  real(RP), public, allocatable :: atmos_grid_cartesc_fdxg (:)

◆ atmos_grid_cartesc_fdyg

real(rp), dimension (:), allocatable, public scale_atmos_grid_cartesc::atmos_grid_cartesc_fdyg

center coordinate [m]: y, global

Definition at line 83 of file scale_atmos_grid_cartesC.F90.

Referenced by atmos_grid_cartesc_allocate(), atmos_grid_cartesc_generate(), scale_file_cartesc::file_cartesc_write_axes(), and scale_file_history_cartesc::file_history_cartesc_truncate_3d().

83  real(RP), public, allocatable :: atmos_grid_cartesc_fdyg (:)

◆ atmos_grid_cartesc_cbfxg

real(rp), dimension(:), allocatable, public scale_atmos_grid_cartesc::atmos_grid_cartesc_cbfxg

center buffer factor (0-1): x, global

Definition at line 85 of file scale_atmos_grid_cartesC.F90.

Referenced by atmos_grid_cartesc_allocate(), atmos_grid_cartesc_generate(), mod_copytopo::copytopo(), scale_file_cartesc::file_cartesc_write_axes(), and scale_file_history_cartesc::file_history_cartesc_truncate_3d().

85  real(RP), public, allocatable :: atmos_grid_cartesc_cbfxg(:)

◆ atmos_grid_cartesc_cbfyg

real(rp), dimension(:), allocatable, public scale_atmos_grid_cartesc::atmos_grid_cartesc_cbfyg

center buffer factor (0-1): y, global

Definition at line 86 of file scale_atmos_grid_cartesC.F90.

Referenced by atmos_grid_cartesc_allocate(), atmos_grid_cartesc_generate(), mod_copytopo::copytopo(), scale_file_cartesc::file_cartesc_write_axes(), and scale_file_history_cartesc::file_history_cartesc_truncate_3d().

86  real(RP), public, allocatable :: atmos_grid_cartesc_cbfyg(:)

◆ atmos_grid_cartesc_fbfxg

real(rp), dimension(:), allocatable, public scale_atmos_grid_cartesc::atmos_grid_cartesc_fbfxg

face buffer factor (0-1): x, global

Definition at line 87 of file scale_atmos_grid_cartesC.F90.

Referenced by atmos_grid_cartesc_allocate(), atmos_grid_cartesc_generate(), scale_file_cartesc::file_cartesc_write_axes(), and scale_file_history_cartesc::file_history_cartesc_truncate_3d().

87  real(RP), public, allocatable :: atmos_grid_cartesc_fbfxg(:)

◆ atmos_grid_cartesc_fbfyg

real(rp), dimension(:), allocatable, public scale_atmos_grid_cartesc::atmos_grid_cartesc_fbfyg

face buffer factor (0-1): y, global

Definition at line 88 of file scale_atmos_grid_cartesC.F90.

Referenced by atmos_grid_cartesc_allocate(), atmos_grid_cartesc_generate(), scale_file_cartesc::file_cartesc_write_axes(), and scale_file_history_cartesc::file_history_cartesc_truncate_3d().

88  real(RP), public, allocatable :: atmos_grid_cartesc_fbfyg(:)

◆ atmos_grid_cartesc_domain_center_x

real(rp), public scale_atmos_grid_cartesc::atmos_grid_cartesc_domain_center_x

center position of global domain [m]: x

Definition at line 90 of file scale_atmos_grid_cartesC.F90.

Referenced by atmos_grid_cartesc_allocate(), atmos_grid_cartesc_generate(), atmos_grid_cartesc_output_info(), scale_atmos_grid_cartesc_real::atmos_grid_cartesc_real_setup(), and mod_mkinit::read_sounding().

90  real(RP), public :: atmos_grid_cartesc_domain_center_x

◆ atmos_grid_cartesc_domain_center_y

real(rp), public scale_atmos_grid_cartesc::atmos_grid_cartesc_domain_center_y