58 use scale_prc, only: prc_abort
61 implicit none
62
63 class(AtmDynSpongeLayer), target, intent(inout) :: this
64 class(MeshBase3D), target, intent(in) :: mesh3D
65 real(RP), intent(in) :: dtsec
66
67 real(RP) :: SL_WDAMP_TAU = -1.0_rp
68 real(RP) :: SL_WDAMP_HEIGHT = -1.0_rp
69 integer :: SL_WDAMP_LAYER = -1
70 logical :: SL_HORIVELDAMP_FLAG = .false.
71
72 namelist /param_atmos_dyn_spongelayer/ &
73 sl_wdamp_tau, &
74 sl_wdamp_height, &
75 sl_wdamp_layer, &
76 sl_horiveldamp_flag
77
78 class(LocalMesh3D), pointer :: lcmesh3D
79 class(ElementBase3D), pointer :: elem3D
80
81 integer :: NeGZ
82 integer :: ierr
83
84
85 rewind(io_fid_conf)
86 read(io_fid_conf,nml=param_atmos_dyn_spongelayer,iostat=ierr)
87 if( ierr < 0 ) then
88 log_info("ATMOS_DYN_setup_spongelayer",*) 'Not found namelist. Default used.'
89 else if( ierr > 0 ) then
90 log_error("ATMOS_DYN_setup_spongelayer",*) 'Not appropriate names in namelist PARAM_ATMOS_DYN_SPONGELAYER. Check!'
91 call prc_abort
92 end if
93 log_nml(param_atmos_dyn_spongelayer)
94
95 this%wdamp_tau = sl_wdamp_tau
96 this%wdamp_height = sl_wdamp_height
97
98 lcmesh3d => mesh3d%lcmesh_list(1)
99 elem3d => lcmesh3d%refElem3D
100 select type(mesh3d)
102 negz = mesh3d%NeGZ
104 negz = mesh3d%NeGZ
105 end select
106
107 if ( sl_wdamp_layer > negz ) then
108 log_error("ATMOS_DYN_setup_spongelayer",*) 'SL_wdamp_layer should be less than total of vertical elements (NeGZ). Check!'
109 call prc_abort
110 else if( sl_wdamp_layer > 0 ) then
111 this%wdamp_height = lcmesh3d%pos_en(1,1+(sl_wdamp_layer-1)*lcmesh3d%NeX*lcmesh3d%NeY,3)
112 end if
113 if ( this%wdamp_tau < 0.0_rp ) then
114 this%wdamp_tau = dtsec * 10.0_rp
115 else if ( this%wdamp_tau < dtsec ) then
116 log_error("ATMOS_DYN_setup_spongelayer",*) 'SL_wdamp_tau should be larger than TIME_DT (ATMOS_DYN). Check!'
117 call prc_abort
118 end if
119
120 this%hveldamp_flag = sl_horiveldamp_flag
121
122 return
module FElib / Mesh / Cubic 3D domain
module FElib / Mesh / Cubed-sphere 3D domain