41 real(RP),
public ::
dz = 500.0_rp
42 real(RP),
public ::
dx = 500.0_rp
43 real(RP),
public ::
dy = 500.0_rp
53 real(RP),
public,
allocatable ::
grid_cz (:)
54 real(RP),
public,
allocatable ::
grid_cx (:)
55 real(RP),
public,
allocatable ::
grid_cy (:)
63 real(RP),
public,
allocatable ::
grid_fz (:)
64 real(RP),
public,
allocatable ::
grid_fx (:)
65 real(RP),
public,
allocatable ::
grid_fy (:)
99 character(len=H_LONG),
private :: grid_in_basename =
'' 100 character(len=H_LONG),
private :: grid_out_basename =
'' 101 real(RP),
private :: grid_offset_x = 0.0_rp
102 real(RP),
private :: grid_offset_y = 0.0_rp
104 integer,
private,
parameter :: kmax_user_lim = 300
105 real(RP),
private :: fz(kmax_user_lim)
107 logical,
private :: debug = .false.
118 namelist / param_grid / &
137 if(
io_l )
write(
io_fid_log,*)
'++++++ Module[GRID] / Categ[ATMOS-RM GRID] / Origin[SCALElib]' 145 if(
io_l )
write(
io_fid_log,*)
'*** Not found namelist. Default used.' 146 elseif( ierr > 0 )
then 147 write(*,*)
'xxx Not appropriate names in namelist PARAM_GRID. Check!' 153 if(
io_l )
write(
io_fid_log,*)
'*** Atmosphere grid information ***' 156 if ( grid_in_basename /=
'' )
then 159 if(
io_l )
write(
io_fid_log,*)
'*** Not found input grid file. Grid position is calculated.' 246 character(len=H_LONG) :: bname
252 write(bname,
'(A,A,F15.3)') trim(grid_in_basename)
288 end subroutine grid_read
305 real(RP),
allocatable :: buffz(:), buffx(:), buffy(:)
306 real(RP) :: bufftotz, bufftotx, bufftoty
308 integer :: kbuff, ibuff, jbuff
309 integer :: kmain, imain, jmain
311 integer :: k, i, j, ii, jj
320 allocate( buffx(0:iag) )
321 allocate( buffy(0:jag) )
332 bufftotx = bufftotx + buffx(i)
335 imain = iag - 2*ibuff - 2*
ihalo 337 if ( imain < 1 )
then 338 write(*,*)
'xxx Buffer size (', bufftotx*2.0_rp,
') must be smaller than global domain size (X). Use smaller BUFFER_DX!' 344 do i =
ihalo-1, 0, -1
352 if ( ibuff > 0 )
then 364 if ( ibuff > 0 )
then 365 do i =
ihalo+ibuff+imain+1,
ihalo+ibuff+imain+ibuff
384 if ( ibuff > 0 )
then 390 do i =
ihalo+ibuff+imain+1,
ihalo+ibuff+imain+ibuff
413 bufftoty = bufftoty + buffy(j)
416 jmain = jag - 2*jbuff - 2*
jhalo 418 if ( jmain < 1 )
then 419 write(*,*)
'xxx Buffer size (', bufftoty*2.0_rp,
') must be smaller than global domain size (Y). Use smaller BUFFER_DY!' 425 do j =
jhalo-1, 0, -1
433 if ( jbuff > 0 )
then 445 if ( jbuff > 0 )
then 446 do j =
jhalo+jbuff+jmain+1,
jhalo+jbuff+jmain+jbuff
465 if ( jbuff > 0 )
then 471 do j =
jhalo+jbuff+jmain+1,
jhalo+jbuff+jmain+jbuff
489 allocate( buffz(0:
ka) )
491 if ( minval(fz(1:
kmax)) > 0.0_rp )
then 492 if(
io_l )
write(
io_fid_log,*)
'*** Z coordinate is given from NAMELIST.' 495 write(*,*)
'xxx If you use FZ, KMAX must be larger than 1. Check!',
kmax 506 bufftotz = bufftotz + ( fz(k) - fz(k-1) )
511 if ( kmain == 1 )
then 512 write(*,*)
'xxx Buffer size (', bufftotz,
') must be smaller than domain size (z). Use smaller BUFFER_DZ!' 548 bufftotz = bufftotz + buffz(k)
551 kmain =
ke -
ks + 1 - kbuff
553 if ( kmain < 1 )
then 554 write(*,*)
'xxx Buffer size (', bufftotz,
') must be smaller than domain size (z). Use smaller BUFFER_DZ!' 568 do k =
ks,
ks+kmain-1
573 if ( kbuff > 0 )
then 590 if ( kbuff > 0 )
then 671 if(
io_l )
write(
io_fid_log,
'(1x,2(A,I6))')
' Z: buffer = ', kbuff,
' x 1, main = ',kmain
672 if(
io_l )
write(
io_fid_log,
'(1x,2(A,I6))')
' X: buffer = ', ibuff,
' x 2, main = ',imain
673 if(
io_l )
write(
io_fid_log,
'(1x,2(A,I6))')
' Y: buffer = ', jbuff,
' x 2, main = ',jmain
677 grid_fz(0) *1.e-3_rp,
' -HALO- ', &
681 grid_fz(
ke-kbuff)*1.e-3_rp,
' -buffer- ', &
685 grid_fxg(0) *1.e-3_rp,
' -HALO- ', &
694 grid_fyg(0) *1.e-3_rp,
' -HALO- ', &
703 if(
io_l )
write(
io_fid_log,*)
'*** Center Position of Grid (global) :' 710 '|============= Vertical Coordinate =============|' 712 '| k z zh dz buffer k |' 714 '| [m] [m] [m] factor |' 754 '|===============================================|' 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 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), 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), 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
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