41 real(RP),
public ::
dz = 500.0_rp
42 real(RP),
public ::
dx = 500.0_rp
43 real(RP),
public ::
dy = 500.0_rp
56 real(RP),
public,
allocatable ::
grid_cz (:)
57 real(RP),
public,
allocatable ::
grid_cx (:)
58 real(RP),
public,
allocatable ::
grid_cy (:)
66 real(RP),
public,
allocatable ::
grid_fz (:)
67 real(RP),
public,
allocatable ::
grid_fx (:)
68 real(RP),
public,
allocatable ::
grid_fy (:)
102 character(len=H_LONG),
private :: grid_in_basename =
'' 103 character(len=H_LONG),
private :: grid_out_basename =
'' 104 real(RP),
private :: grid_offset_x = 0.0_rp
105 real(RP),
private :: grid_offset_y = 0.0_rp
107 integer,
private,
parameter :: kmax_user_lim = 300
108 real(RP),
private :: fz(kmax_user_lim)
110 logical,
private :: debug = .false.
121 namelist / param_grid / &
143 if(
io_l )
write(
io_fid_log,*)
'++++++ Module[GRID] / Categ[ATMOS-RM GRID] / Origin[SCALElib]' 151 if(
io_l )
write(
io_fid_log,*)
'*** Not found namelist. Default used.' 152 elseif( ierr > 0 )
then 153 write(*,*)
'xxx Not appropriate names in namelist PARAM_GRID. Check!' 163 if(
io_l )
write(
io_fid_log,*)
'*** Atmosphere grid information ***' 166 if ( grid_in_basename /=
'' )
then 169 if(
io_l )
write(
io_fid_log,*)
'*** Not found input grid file. Grid position is calculated.' 256 character(len=H_LONG) :: bname
262 write(bname,
'(A,A,F15.3)') trim(grid_in_basename)
298 end subroutine grid_read
315 real(RP),
allocatable :: buffz(:), buffx(:), buffy(:)
316 real(RP) :: bufftotz, bufftotx, bufftoty
318 integer :: kbuff, ibuff, jbuff
319 integer :: kmain, imain, jmain
321 integer :: k, i, j, ii, jj
330 allocate( buffx(0:iag) )
331 allocate( buffy(0:jag) )
342 bufftotx = bufftotx + buffx(i)
345 imain = iag - 2*ibuff - 2*
ihalo 347 if ( imain < 0 )
then 348 write(*,*)
'xxx Buffer size (', bufftotx*2.0_rp,
') must be smaller than global domain size (X). Use smaller BUFFER_DX!' 354 do i =
ihalo-1, 0, -1
362 if ( ibuff > 0 )
then 374 if ( ibuff > 0 )
then 375 do i =
ihalo+ibuff+imain+1,
ihalo+ibuff+imain+ibuff
394 if ( ibuff > 0 )
then 400 do i =
ihalo+ibuff+imain+1,
ihalo+ibuff+imain+ibuff
423 bufftoty = bufftoty + buffy(j)
426 jmain = jag - 2*jbuff - 2*
jhalo 428 if ( jmain < 0 )
then 429 write(*,*)
'xxx Buffer size (', bufftoty*2.0_rp,
') must be smaller than global domain size (Y). Use smaller BUFFER_DY!' 435 do j =
jhalo-1, 0, -1
443 if ( jbuff > 0 )
then 455 if ( jbuff > 0 )
then 456 do j =
jhalo+jbuff+jmain+1,
jhalo+jbuff+jmain+jbuff
475 if ( jbuff > 0 )
then 481 do j =
jhalo+jbuff+jmain+1,
jhalo+jbuff+jmain+jbuff
499 allocate( buffz(0:
ka) )
501 if ( minval(fz(1:
kmax)) > 0.0_rp )
then 502 if(
io_l )
write(
io_fid_log,*)
'*** Z coordinate is given from NAMELIST.' 505 write(*,*)
'xxx If you use FZ, KMAX must be larger than 1. Check!',
kmax 516 bufftotz = bufftotz + ( fz(k) - fz(k-1) )
521 if ( kmain < 0 )
then 522 write(*,*)
'xxx Buffer size (', bufftotz,
') must be smaller than domain size (z). Use smaller BUFFER_DZ!' 558 bufftotz = bufftotz + buffz(k)
561 kmain =
ke -
ks + 1 - kbuff
563 if ( kmain < 0 )
then 564 write(*,*)
'xxx Buffer size (', bufftotz,
') must be smaller than domain size (z). Use smaller BUFFER_DZ!' 578 do k =
ks,
ks+kmain-1
583 if ( kbuff > 0 )
then 600 if ( kbuff > 0 )
then 681 if(
io_l )
write(
io_fid_log,
'(1x,2(A,I6))')
' Z: buffer = ', kbuff,
' x 1, main = ',kmain
682 if(
io_l )
write(
io_fid_log,
'(1x,2(A,I6))')
' X: buffer = ', ibuff,
' x 2, main = ',imain
683 if(
io_l )
write(
io_fid_log,
'(1x,2(A,I6))')
' Y: buffer = ', jbuff,
' x 2, main = ',jmain
687 grid_fz(0) *1.e-3_rp,
' -HALO- ', &
691 grid_fz(
ke-kbuff)*1.e-3_rp,
' -buffer- ', &
695 grid_fxg(0) *1.e-3_rp,
' -HALO- ', &
704 grid_fyg(0) *1.e-3_rp,
' -HALO- ', &
713 if(
io_l )
write(
io_fid_log,*)
'*** Center Position of Grid (global) :' 720 '|============= Vertical Coordinate =============|' 722 '| k z zh dz buffer k |' 724 '| [m] [m] [m] factor |' 764 '|===============================================|' integer, public imax
of computational cells: x
integer, public prc_num_x
x length of 2D processor topology
integer, public is
start point of inner domain: x, local
real(rp), public buffer_dx
thickness of buffer region [m]: x
real(rp), public bufffact_z
strech factor for dz of buffer region
real(rp), public grid_domain_center_x
center position of global domain [m]: x
integer, public je
end point of inner domain: y, local
real(rp), dimension(:), allocatable, public grid_rcdy
reciprocal of center-dy
real(rp), public dy
length in the main region [m]: y
real(rp), dimension(:), allocatable, public grid_cyg
center coordinate [m]: y, global
subroutine, public prc_mpistop
Abort MPI.
real(rp), dimension(:), allocatable, public grid_cbfyg
center buffer factor [0-1]: y, global
real(rp), dimension(:), allocatable, public grid_cxg
center coordinate [m]: x, global
real(rp), dimension(:), allocatable, public grid_fdy
y-length of grid(j+1) to grid(j) [m]
real(rp), public dx
length in the main region [m]: x
logical, public io_l
output log or not? (this process)
real(rp), dimension(:), allocatable, public grid_rcdx
reciprocal of center-dx
real(rp), dimension(:), allocatable, public grid_cz
center coordinate [m]: z, local=global
real(rp), dimension(:), allocatable, public grid_fxg
face coordinate [m]: x, global
real(rp), dimension(:), allocatable, public grid_fbfy
face buffer factor [0-1]: y
integer, public ke
end point of inner domain: z, local
real(rp), public bufffact_x
strech factor for dx of buffer region
real(rp), dimension(:), allocatable, public grid_rfdy
reciprocal of face-dy
real(rp), dimension(:), allocatable, public grid_rcdz
reciprocal of center-dz
real(rp), public dz
length in the main region [m]: z
real(rp), dimension(:), allocatable, public grid_fx
face coordinate [m]: x, local
integer, public prc_num_y
y length of 2D processor topology
integer, public ia
of x whole cells (local, with HALO)
real(rp), dimension(:), allocatable, public grid_fbfx
face buffer factor [0-1]: x
real(rp), dimension(:), allocatable, public grid_fdz
z-length of grid(k+1) to grid(k) [m]
integer, public ka
of z whole cells (local, with HALO)
real(rp), dimension(:), allocatable, public grid_fbfxg
face buffer factor [0-1]: x, global
integer, public kmax
of computational cells: z
real(rp), dimension(:), allocatable, public grid_fz
face coordinate [m]: z, local=global
real(rp), dimension(:), allocatable, public grid_fbfz
face buffer factor [0-1]: z
integer, public jhalo
of halo cells: y
integer, public js
start point of inner domain: y, local
real(rp), dimension(:), allocatable, public grid_cbfx
center buffer factor [0-1]: x
real(rp), public bufffact_y
strech factor for dy of buffer region
real(rp), dimension(:), allocatable, public grid_fbfyg
face buffer factor [0-1]: y, global
subroutine, public grid_generate
Generate horizontal&vertical grid.
integer, public ks
start point of inner domain: z, local
real(rp), dimension(:), allocatable, public grid_cbfz
center buffer factor [0-1]: z
integer, public prc_myrank
process num in local communicator
real(rp), dimension(:), allocatable, public grid_cx
center coordinate [m]: x, local
real(rp), public buffer_dy
thickness of buffer region [m]: y
real(rp), public grid_domain_center_y
center position of global domain [m]: y
integer, public ie
end point of inner domain: x, local
real(rp), public buffer_dz
thickness of buffer region [m]: z
logical, public io_lnml
output log or not? (for namelist, this process)
integer, dimension(:,:), allocatable, public prc_2drank
node index in 2D topology
real(rp), dimension(:), allocatable, public grid_cdz
z-length of control volume [m]
real(rp), dimension(:), allocatable, public grid_fdx
x-length of grid(i+1) to grid(i) [m]
real(rp), dimension(:), allocatable, public grid_cdy
y-length of control volume [m]
real(rp), dimension(:), allocatable, public grid_cbfy
center buffer factor [0-1]: y
real(rp), dimension(:), allocatable, public grid_rfdx
reciprocal of face-dx
real(rp), dimension(:), allocatable, public grid_rfdz
reciprocal of face-dz
integer, public io_fid_conf
Config file ID.
integer, public io_fid_log
Log file ID.
subroutine, public grid_allocate
Allocate arrays.
real(rp), public bufffact
default strech factor for dx/dy/dz of buffer region
real(rp), dimension(:), allocatable, public grid_cdx
x-length of control volume [m]
integer, public jmax
of computational cells: y
real(rp), dimension(:), allocatable, public grid_fyg
face coordinate [m]: y, global
real(rp), dimension(:), allocatable, public grid_cy
center coordinate [m]: y, local
subroutine, public grid_setup
Setup.
real(rp), dimension(:), allocatable, public grid_cbfxg
center buffer factor [0-1]: x, global
integer, public ihalo
of halo cells: x
integer, public ja
of y whole cells (local, with HALO)
real(rp), dimension(:), allocatable, public grid_fy
face coordinate [m]: y, local