ソースコード読み解き

JAGURS.f90

メインのコード.各モジュールを合わせて,初期条件等を読み解き,時間発展を解く.
mod_grid の data_grids 構造体は dgrid と定義されている.

mod_grid.f90

変数の定義.グリッド情報を格納する色々な構造体が定義されている.

data_grids

各計算領域の水深や水位,wetdry などの基本的な情報が諸々含まれる構造体.計算領域の数が data_grids の配列要素の数になる.
data_grids 構造体の中にも色々な構造体があり,wave_arrays という構造体で wave_field という変数,depth_arrays という構造体で depth_field という変数がある.
Cartesian 座標系で MPI を使わない場合の cpp で見てみると以下の通り.

type data_grids
   type(grid_info) :: parent
   type(grid_info) :: my
   type(wave_arrays) :: wave_field
   type(depth_arrays) :: depth_field
   real(kind=8), allocatable, dimension(:,:) :: ts_field
   real(kind=8), allocatable, dimension(:,:) :: zz
   type(boundary_arrays) :: ubnd
   type(boundary_arrays) :: hbnd
   real(kind=8), allocatable, dimension(:,:) :: hzmax
! === To add max velocity output. by tkato 2012/10/02 ==========================
   real(kind=8), allocatable, dimension(:,:) :: vmax
! ==============================================================================
   integer(kind=4), allocatable, dimension(:,:) :: wod_flags
   character(len=256) :: wod_file
   real(kind=8), allocatable, dimension(:,:) :: wod_field
   character(len=256) :: bcf_file
   character(len=256) :: bank_file
   real(kind=8), allocatable, dimension(:,:) :: bcf_field
   type(interp_info) :: fxo
   type(interp_info) :: fyo
   type(interp_info) :: fxi
   type(interp_info) :: fyi
   type(interp_info) :: hzi
   type(interp_info) :: dzi
! === copy2coarse for hz =======================================================
   type(interp_info) :: hzo
! ==============================================================================
! === Support multiple ruptures. ===============================================
   integer(kind=4) :: nrupt, irupt, jrupt ! nrupt = number of rupture time steps
   character(len=256), allocatable, dimension(:) :: ruptgrd
! ==============================================================================
! === Do not repeat allocate/deallocate! ========================================
! ==============================================================================
end type data_grids

grid_info

領域ごとの配列のサイズや入出力ファイル名の情報.

type grid_info
   integer(kind=4) :: id = 1
   real(kind=8) :: mlon0
   real(kind=8) :: mlat0
   real(kind=8) :: dh
   real(kind=8) :: th0
   real(kind=8) :: dth
   integer(kind=4) :: nx
   integer(kind=4) :: ny
   integer(kind=4) :: linear_flag
   character(len=256) :: base_name
   character(len=256) :: bath_file
   character(len=256) :: disp_file
   integer(kind=4) :: nr
   integer(kind=4) :: bigNX
   integer(kind=4) :: bigNY
   integer(kind=4) :: zeroIX
   integer(kind=4) :: zeroIY
   integer(kind=4) :: nconvout
end type grid_info

wave_arrays

fx, fy はフラックス(線流量).
hz は水位(eta)?

type wave_arrays
   real(kind=8), allocatable, dimension(:,:) :: fx
   real(kind=8), allocatable, dimension(:,:) :: fy
   real(kind=8), allocatable, dimension(:,:) :: hz
! === Flood Change =============================================================
   real(kind=8), allocatable, dimension(:,:) :: hz_old
! ==============================================================================
! === DEBUG for wave height gap on nest boundary. 2012/10/30 ===================
! real(kind=8), allocatable, dimension(:) :: fx_old
   real(kind=8), allocatable, dimension(:,:) :: fx_old
! ==============================================================================
! === DEBUG for wave height gap on nest boundary. 2012/10/30 ===================
! real(kind=8), allocatable, dimension(:) :: fy_old
   real(kind=8), allocatable, dimension(:,:) :: fy_old
! ==============================================================================
! === Dispersive ===============================================================
   real(kind=8), allocatable, dimension(:,:) :: yu, yv ! RHS
   real(kind=8), allocatable, dimension(:,:) :: cu, cv ! Coefficient
! ==============================================================================
! === Absorbing boundary condition =============================================
   real(kind=8), allocatable, dimension(:,:) :: abc
! ==============================================================================
! === Optimization =============================================================
   real(kind=8), allocatable, dimension(:,:) :: tdx, tdy
! ==============================================================================
! === Arrival time =============================================================
   integer(kind=4), allocatable, dimension(:,:) :: arrivedat
   real(kind=8), allocatable, dimension(:,:) :: arrival_time
! ==============================================================================
   integer(kind=4), allocatable, dimension(:,:) :: ir
   real(kind=8), allocatable, dimension(:,:) :: btx, bty
   integer(kind=4), allocatable, dimension(:,:) :: brokenx, brokeny
end type wave_arrays

depth_arrays

dz は水深 (dx, dy は半メッシュズレた水深?).
wave_arrays の hz と depth_arrays の dz を足すとで全水深?

type depth_arrays
   real(kind=8), allocatable, dimension(:,:) :: dx
   real(kind=8), allocatable, dimension(:,:) :: dy
   real(kind=8), allocatable, dimension(:,:) :: dz
   real(kind=8), allocatable, dimension(:,:) :: dx_old
   real(kind=8), allocatable, dimension(:,:) :: dy_old
   real(kind=8), allocatable, dimension(:,:) :: dxbx
   real(kind=8), allocatable, dimension(:,:) :: dyby
end type depth_arrays

Front page   Edit Diff Attach Copy Rename Reload   New List of pages Search Recent changes   Help   RSS of recent changes
Last-modified: 2023-12-15 (Fri) 00:32:51 (134d)