SCALE-RM
Functions/Subroutines | Variables
scale_grid_real Module Reference

module GRID (real space) More...

Functions/Subroutines

subroutine, public real_setup
 Setup. More...
 
subroutine, public real_update_z
 Re-setup with updated topography. More...
 
subroutine, public real_calc_areavol (MAPF)
 Calc control area/volume. More...
 

Variables

real(rp), dimension(:,:), allocatable, public real_lon
 longitude [rad,0-2pi] More...
 
real(rp), dimension(:,:), allocatable, public real_lat
 latitude [rad,-pi,pi] More...
 
real(rp), dimension(:,:,:), allocatable, public real_cz
 geopotential height [m] (cell center) More...
 
real(rp), dimension(:,:,:), allocatable, public real_fz
 geopotential height [m] (cell face ) More...
 
real(rp), public real_basepoint_lon
 position of base point in real world [rad,0-2pi] More...
 
real(rp), public real_basepoint_lat
 position of base point in real world [rad,-pi,pi] More...
 
real(rp), dimension(:,:), allocatable, public real_lonx
 longitude at staggered point (uy) [rad,0-2pi] More...
 
real(rp), dimension(:,:), allocatable, public real_lony
 longitude at staggered point (xv) [rad,0-2pi] More...
 
real(rp), dimension(:,:), allocatable, public real_lonxy
 longitude at staggered point (uv) [rad,0-2pi] More...
 
real(rp), dimension(:,:), allocatable, public real_latx
 latitude at staggered point (uy) [rad,-pi,pi] More...
 
real(rp), dimension(:,:), allocatable, public real_laty
 latitude at staggered point (xv) [rad,-pi,pi] More...
 
real(rp), dimension(:,:), allocatable, public real_latxy
 latitude at staggered point (uv) [rad,-pi,pi] More...
 
real(rp), dimension(:,:), allocatable, public real_dlon
 delta longitude More...
 
real(rp), dimension(:,:), allocatable, public real_dlat
 delta latitude More...
 
real(rp), dimension(:,:), allocatable, public real_z1
 Height of the lowermost grid from surface (cell center) [m]. More...
 
real(rp), public real_aspect_max
 maximum aspect ratio of the grid cell More...
 
real(rp), public real_aspect_min
 minimum aspect ratio of the grid cell More...
 
real(rp), dimension(:,:,:), allocatable, public real_phi
 geopotential [m2/s2] (cell center) More...
 
real(rp), dimension(:,:), allocatable, public real_area
 horizontal area [m2] More...
 
real(rp), dimension(:,:,:), allocatable, public real_vol
 control volume [m3] More...
 
real(rp), dimension(:,:,:), allocatable, public real_domain_catalogue
 domain latlon catalogue [rad] More...
 
real(rp), public real_totarea
 total area (local) [m2] More...
 
real(rp), public real_totvol
 total volume (local) [m3] More...
 

Detailed Description

module GRID (real space)

Description
Grid module for orthogonal curvelinear, terrain-following coordinate
Author
Team SCALE
History
  • 2011-10-24 (H.Yashiro) [new] reconstruction from scale_REAL & scale_topography
NAMELIST
  • PARAM_DOMAIN_CATALOGUE
    nametypedefault valuecomment
    DOMAIN_CATALOGUE_FNAME character(len=H_LONG) 'latlon_domain_catalogue.txt' metadata files for lat-lon domain for all processes
    DOMAIN_CATALOGUE_OUTPUT logical .false.

History Output
No history output

Function/Subroutine Documentation

◆ real_setup()

subroutine, public scale_grid_real::real_setup ( )

Setup.

Definition at line 85 of file scale_grid_real.F90.

References scale_fileio::fileio_set_coordinates(), scale_grid::grid_domain_center_x, scale_grid::grid_domain_center_y, scale_grid_index::ia, scale_stdio::io_fid_log, scale_stdio::io_l, scale_grid_index::ja, scale_grid_index::ka, scale_mapproj::mprj_setup(), scale_process::prc_mpistop(), scale_process::prc_nprocs, real_area, real_cz, real_dlat, real_dlon, real_domain_catalogue, real_fz, real_lat, real_latx, real_latxy, real_laty, real_lon, real_lonx, real_lonxy, real_lony, real_phi, real_vol, and real_z1.

Referenced by mod_rm_driver::scalerm(), and mod_rm_prep::scalerm_prep().

85  use scale_process, only: &
86  prc_nprocs, &
88  use scale_grid, only: &
91  use scale_mapproj, only: &
93  use scale_fileio, only: &
95  implicit none
96 
97  !---------------------------------------------------------------------------
98 
99  if( io_l ) write(io_fid_log,*)
100  if( io_l ) write(io_fid_log,*) '+++ Module[REAL]/Categ[GRID]'
101 
102  allocate( real_lon(ia,ja) )
103  allocate( real_lat(ia,ja) )
104  allocate( real_lonx(ia,ja) )
105  allocate( real_lony(ia,ja) )
106  allocate( real_lonxy(ia,ja) )
107  allocate( real_latx(ia,ja) )
108  allocate( real_laty(ia,ja) )
109  allocate( real_latxy(ia,ja) )
110  allocate( real_dlon(ia,ja) )
111  allocate( real_dlat(ia,ja) )
112 
113  allocate( real_cz( ka,ia,ja) )
114  allocate( real_fz(0:ka,ia,ja) )
115  allocate( real_z1( ia,ja) )
116  allocate( real_phi( ka,ia,ja) )
117 
118  allocate( real_area( ia,ja) )
119  allocate( real_vol(ka,ia,ja) )
120 
121  allocate( real_domain_catalogue(prc_nprocs,4,2) )
122 
123  ! setup map projection
125 
126  ! calc longitude & latitude
127  call real_calc_latlon
128 
129  ! calc real height
130  call real_calc_z
131 
132  ! calc control area & volume
133  ! call REAL_calc_areavol ! must be called after GTRANS_setup
134 
135  ! set latlon and z to fileio module
136  call fileio_set_coordinates( real_lon, real_lonx, real_lony, real_lonxy, &
137  real_lat, real_latx, real_laty, real_latxy, &
138  real_cz, real_fz )
139 
140  return
real(rp), public grid_domain_center_x
center position of global domain [m]: x
subroutine, public prc_mpistop
Abort MPI.
module FILE I/O (netcdf)
integer, public ia
of x whole cells (local, with HALO)
integer, public ka
of z whole cells (local, with HALO)
module PROCESS
module GRID (cartesian)
real(rp), dimension(:,:,:), allocatable, public real_domain_catalogue
domain latlon catalogue [rad]
real(rp), public grid_domain_center_y
center position of global domain [m]: y
subroutine, public fileio_set_coordinates(LON, LONX, LONY, LONXY, LAT, LATX, LATY, LATXY, CZ, FZ)
set latlon and z
subroutine, public mprj_setup(DOMAIN_CENTER_X, DOMAIN_CENTER_Y)
Setup.
integer, public prc_nprocs
myrank in local communicator
module Map projection
integer, public ja
of y whole cells (local, with HALO)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ real_update_z()

subroutine, public scale_grid_real::real_update_z ( )

Re-setup with updated topography.

Definition at line 146 of file scale_grid_real.F90.

References scale_const::const_d2r, scale_const::const_grav, scale_fileio::fileio_set_coordinates(), scale_grid::grid_cdx, scale_grid::grid_cdy, scale_grid::grid_cx, scale_grid::grid_cy, scale_grid::grid_cz, scale_grid::grid_domain_center_x, scale_grid::grid_domain_center_y, scale_grid::grid_fx, scale_grid::grid_fy, scale_grid::grid_fz, scale_grid_index::ia, scale_grid_index::ie, scale_stdio::io_fid_conf, scale_stdio::io_fid_log, scale_stdio::io_get_available_fid(), scale_stdio::io_l, scale_stdio::io_lnml, scale_grid_index::is, scale_grid_index::ja, scale_grid_index::je, scale_grid_index::js, scale_grid_index::ka, scale_grid_index::ke, scale_grid_index::ks, scale_mapproj::mprj_basepoint_lat, scale_mapproj::mprj_basepoint_lon, scale_mapproj::mprj_xy2lonlat(), scale_process::prc_ismaster, scale_process::prc_mpistop(), scale_process::prc_nprocs, real_aspect_max, real_aspect_min, real_basepoint_lat, real_basepoint_lon, real_cz, real_dlat, real_dlon, real_domain_catalogue, real_fz, real_lat, real_latx, real_latxy, real_laty, real_lon, real_lonx, real_lonxy, real_lony, real_phi, real_z1, and scale_topography::topo_zsfc.

Referenced by mod_rm_prep::scalerm_prep().

146  use scale_process, only: &
148  use scale_fileio, only: &
150  implicit none
151  !---------------------------------------------------------------------------
152 
153  ! calc real height
154  call real_calc_z
155 
156  ! set latlon and z to fileio module
157  call fileio_set_coordinates( real_lon, real_lonx, real_lony, real_lonxy, &
158  real_lat, real_latx, real_laty, real_latxy, &
159  real_cz, real_fz )
160 
161  return
subroutine, public prc_mpistop
Abort MPI.
module FILE I/O (netcdf)
module PROCESS
subroutine, public fileio_set_coordinates(LON, LONX, LONY, LONXY, LAT, LATX, LATY, LATXY, CZ, FZ)
set latlon and z
Here is the call graph for this function:
Here is the caller graph for this function:

◆ real_calc_areavol()

subroutine, public scale_grid_real::real_calc_areavol ( real(rp), dimension(ia,ja,2), intent(in)  MAPF)

Calc control area/volume.

Definition at line 386 of file scale_grid_real.F90.

References scale_const::const_radius, scale_grid::dx, scale_grid::dy, scale_grid::dz, scale_grid_index::ie, scale_grid_index::is, scale_grid_index::je, scale_grid_index::js, scale_grid_index::ke, scale_grid_index::ks, real_area, real_fz, real_totarea, real_totvol, and real_vol.

Referenced by scale_gridtrans::gtrans_setup().

386  use scale_const, only: &
387  radius => const_radius
388  use scale_grid, only: &
389  dz, &
390  dx, &
391  dy
392  implicit none
393  real(RP), intent(in) :: mapf(ia,ja,2)
394 
395  integer :: k, i, j
396  !---------------------------------------------------------------------------
397 
398  real_totarea = 0.0_rp
399  real_area(:,:) = 0.0_rp
400  do j = js, je
401  do i = is, ie
402  real_area(i,j) = dx * dy / ( mapf(i,j,1) * mapf(i,j,2) )
403  real_totarea = real_totarea + real_area(i,j)
404  enddo
405  enddo
406 
407  real_totvol = 0.0_rp
408  real_vol(:,:,:) = 0.0_rp
409  do j = js, je
410  do i = is, ie
411  do k = ks, ke
412  real_vol(k,i,j) = ( real_fz(k,i,j) - real_fz(k-1,i,j) ) * real_area(i,j)
413  real_totvol = real_totvol + real_vol(k,i,j)
414  enddo
415  enddo
416  enddo
417 
418  return
integer, public is
start point of inner domain: x, local
integer, public je
end point of inner domain: y, local
real(rp), public dy
length in the main region [m]: y
real(rp), public dx
length in the main region [m]: x
real(rp), public const_radius
radius of the planet [m]
Definition: scale_const.F90:46
integer, public ke
end point of inner domain: z, local
real(rp), public dz
length in the main region [m]: z
integer, public ia
of x whole cells (local, with HALO)
integer, public js
start point of inner domain: y, local
module CONSTANT
Definition: scale_const.F90:14
integer, public ks
start point of inner domain: z, local
module GRID (cartesian)
integer, public ie
end point of inner domain: x, local
integer, public ja
of y whole cells (local, with HALO)
Here is the caller graph for this function:

Variable Documentation

◆ real_lon

real(rp), dimension(:,:), allocatable, public scale_grid_real::real_lon

◆ real_lat

real(rp), dimension(:,:), allocatable, public scale_grid_real::real_lat

◆ real_cz

real(rp), dimension (:,:,:), allocatable, public scale_grid_real::real_cz

◆ real_fz

real(rp), dimension (:,:,:), allocatable, public scale_grid_real::real_fz

◆ real_basepoint_lon

real(rp), public scale_grid_real::real_basepoint_lon

position of base point in real world [rad,0-2pi]

Definition at line 43 of file scale_grid_real.F90.

Referenced by scale_atmos_solarins::atmos_solarins_setup(), and real_update_z().

43  real(RP), public :: real_basepoint_lon

◆ real_basepoint_lat

real(rp), public scale_grid_real::real_basepoint_lat

position of base point in real world [rad,-pi,pi]

Definition at line 44 of file scale_grid_real.F90.

Referenced by scale_atmos_phy_rd_mstrnx::atmos_phy_rd_mstrnx(), scale_atmos_phy_rd_mstrnx::atmos_phy_rd_mstrnx_setup(), scale_atmos_solarins::atmos_solarins_setup(), and real_update_z().

44  real(RP), public :: real_basepoint_lat

◆ real_lonx

real(rp), dimension (:,:), allocatable, public scale_grid_real::real_lonx

longitude at staggered point (uy) [rad,0-2pi]

Definition at line 46 of file scale_grid_real.F90.

Referenced by mod_cnvlanduse::cnvlanduse(), mod_cnvtopo::cnvtopo(), scale_history::hist_switch(), scale_grid_nest::nest_domain_shape(), scale_grid_nest::nest_setup(), real_setup(), and real_update_z().

46  real(RP), public, allocatable :: real_lonx (:,:)

◆ real_lony

real(rp), dimension (:,:), allocatable, public scale_grid_real::real_lony

longitude at staggered point (xv) [rad,0-2pi]

Definition at line 47 of file scale_grid_real.F90.

Referenced by scale_history::hist_switch(), scale_grid_nest::nest_domain_shape(), scale_grid_nest::nest_setup(), real_setup(), and real_update_z().

47  real(RP), public, allocatable :: real_lony (:,:)

◆ real_lonxy

real(rp), dimension(:,:), allocatable, public scale_grid_real::real_lonxy

longitude at staggered point (uv) [rad,0-2pi]

Definition at line 48 of file scale_grid_real.F90.

Referenced by scale_history::hist_switch(), scale_grid_nest::nest_setup(), real_setup(), and real_update_z().

48  real(RP), public, allocatable :: real_lonxy(:,:)

◆ real_latx

real(rp), dimension (:,:), allocatable, public scale_grid_real::real_latx

latitude at staggered point (uy) [rad,-pi,pi]

Definition at line 49 of file scale_grid_real.F90.

Referenced by scale_gridtrans::gtrans_setup(), scale_history::hist_switch(), scale_grid_nest::nest_domain_shape(), scale_grid_nest::nest_setup(), real_setup(), and real_update_z().

49  real(RP), public, allocatable :: real_latx (:,:)

◆ real_laty

real(rp), dimension (:,:), allocatable, public scale_grid_real::real_laty

latitude at staggered point (xv) [rad,-pi,pi]

Definition at line 50 of file scale_grid_real.F90.

Referenced by mod_cnvlanduse::cnvlanduse(), mod_cnvtopo::cnvtopo(), scale_gridtrans::gtrans_setup(), scale_history::hist_switch(), scale_grid_nest::nest_domain_shape(), scale_grid_nest::nest_setup(), real_setup(), and real_update_z().

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

◆ real_latxy

real(rp), dimension(:,:), allocatable, public scale_grid_real::real_latxy

latitude at staggered point (uv) [rad,-pi,pi]

Definition at line 51 of file scale_grid_real.F90.

Referenced by scale_gridtrans::gtrans_setup(), scale_history::hist_switch(), scale_grid_nest::nest_setup(), real_setup(), and real_update_z().

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

◆ real_dlon

real(rp), dimension (:,:), allocatable, public scale_grid_real::real_dlon

delta longitude

Definition at line 52 of file scale_grid_real.F90.

Referenced by mod_cnvlanduse::cnvlanduse_setup(), mod_cnvtopo::cnvtopo_setup(), real_setup(), and real_update_z().

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

◆ real_dlat

real(rp), dimension (:,:), allocatable, public scale_grid_real::real_dlat

delta latitude

Definition at line 53 of file scale_grid_real.F90.

Referenced by mod_cnvlanduse::cnvlanduse_setup(), mod_cnvtopo::cnvtopo_setup(), real_setup(), and real_update_z().

53  real(RP), public, allocatable :: real_dlat (:,:)

◆ real_z1

real(rp), dimension (:,:), allocatable, public scale_grid_real::real_z1

Height of the lowermost grid from surface (cell center) [m].

Definition at line 55 of file scale_grid_real.F90.

Referenced by mod_atmos_phy_sf_driver::atmos_phy_sf_driver(), mod_atmos_driver::atmos_surface_set(), mod_land_phy_driver::land_phy_driver(), mod_ocean_phy_driver::ocean_phy_driver(), real_setup(), real_update_z(), and mod_urban_phy_driver::urban_phy_driver().

55  real(RP), public, allocatable :: real_z1 (:,:)

◆ real_aspect_max

real(rp), public scale_grid_real::real_aspect_max

maximum aspect ratio of the grid cell

Definition at line 56 of file scale_grid_real.F90.

Referenced by real_update_z().

56  real(RP), public :: real_aspect_max

◆ real_aspect_min

real(rp), public scale_grid_real::real_aspect_min

minimum aspect ratio of the grid cell

Definition at line 57 of file scale_grid_real.F90.

Referenced by real_update_z().

57  real(RP), public :: real_aspect_min

◆ real_phi

real(rp), dimension (:,:,:), allocatable, public scale_grid_real::real_phi

geopotential [m2/s2] (cell center)

Definition at line 59 of file scale_grid_real.F90.

Referenced by mod_atmos_dyn_driver::atmos_dyn_driver(), scale_atmos_refstate::atmos_refstate_calc3d(), real_setup(), and real_update_z().

59  real(RP), public, allocatable :: real_phi (:,:,:)

◆ real_area

real(rp), dimension(:,:), allocatable, public scale_grid_real::real_area

horizontal area [m2]

Definition at line 61 of file scale_grid_real.F90.

Referenced by real_calc_areavol(), real_setup(), and scale_rm_statistics::stat_total_2d().

61  real(RP), public, allocatable :: real_area(:,:)

◆ real_vol

real(rp), dimension (:,:,:), allocatable, public scale_grid_real::real_vol

control volume [m3]

Definition at line 62 of file scale_grid_real.F90.

Referenced by scale_atmos_dyn::atmos_dyn(), scale_atmos_dyn_tstep_large_fvm_heve::check_mass(), real_calc_areavol(), real_setup(), and scale_rm_statistics::stat_total_3d().

62  real(RP), public, allocatable :: real_vol (:,:,:)

◆ real_domain_catalogue

real(rp), dimension(:,:,:), allocatable, public scale_grid_real::real_domain_catalogue

domain latlon catalogue [rad]

Definition at line 64 of file scale_grid_real.F90.

Referenced by scale_grid_nest::nest_comm_nestdown(), scale_grid_nest::nest_domain_shape(), scale_grid_nest::nest_setup(), real_setup(), and real_update_z().

64  real(RP), public, allocatable :: real_domain_catalogue(:,:,:)
real(rp), dimension(:,:,:), allocatable, public real_domain_catalogue
domain latlon catalogue [rad]

◆ real_totarea

real(rp), public scale_grid_real::real_totarea

total area (local) [m2]

Definition at line 66 of file scale_grid_real.F90.

Referenced by real_calc_areavol().

66  real(RP), public :: real_totarea

◆ real_totvol

real(rp), public scale_grid_real::real_totvol

total volume (local) [m3]

Definition at line 67 of file scale_grid_real.F90.

Referenced by real_calc_areavol().

67  real(RP), public :: real_totvol