#author("2023-12-15T09:32:51+09:00","default:Miyashita","Miyashita") #author("2024-01-17T16:51:33+09:00","default:Miyashita","Miyashita") *ソースコード読み解き [#o9260f59] **JAGURS.f90 [#ec49b13e] メインのコード.各モジュールを合わせて,初期条件等を読み解き,時間発展を解く.~ mod_grid の data_grids 構造体は dgrid と定義されている.~ ~ **mod_grid.f90 [#z9bdf87d] 変数の定義.グリッド情報を格納する色々な構造体が定義されている. *** data_grids [#q1c31d73] 各計算領域の水深や水位,wetdry などの基本的な情報が諸々含まれる構造体.計算領域の数が data_grids の配列要素の数になる.~ data_grids 構造体の中にも色々な構造体があり,wave_arrays という構造体で wave_field という変数,depth_arrays という構造体で depth_field という変数がある.~ Cartesian 座標系で MPI を使わない場合の cpp で見てみると以下の通り. #codeprettify(lang-fortran){{ 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 [#vcdf7ebd] 領域ごとの配列のサイズや入出力ファイル名の情報. #codeprettify(lang-fortran){{ 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 [#o0a40fc7] fx, fy はフラックス(線流量).~ hz は水位(eta)? #codeprettify(lang-fortran){{ 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 [#e9e21b6a] dz は水深 (dx, dy は半メッシュズレた水深?)〜 dz は水深 (dx, dy は半メッシュズレた水深?).~ wave_arrays の hz と depth_arrays の dz を足すとで全水深? #codeprettify(lang-fortran){{ 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 }}