<p><b>duda</b> 2011-08-22 11:36:53 -0600 (Mon, 22 Aug 2011)</p><p>BRANCH COMMIT<br>
<br>
Add run-time configurable gravity wave absorbing layer to the<br>
non-hydrostatic core. Control of the absorbing layer is implemented via<br>
two new namelist variables in the new record &damping: config_zd is<br>
the geometric height at which the layer begins, and config_xnutr is the<br>
maximum damping coefficient at the top of the model (the damping profile<br>
follows a half-sine wave from 0 at zd to xnutr at ztop).<br>
<br>
<br>
M src/core_nhyd_atmos/Registry<br>
M src/core_nhyd_atmos/module_mpas_core.F<br>
</p><hr noshade><pre><font color="gray">Modified: branches/atmos_physics/src/core_nhyd_atmos/Registry
===================================================================
--- branches/atmos_physics/src/core_nhyd_atmos/Registry        2011-08-19 14:55:41 UTC (rev 950)
+++ branches/atmos_physics/src/core_nhyd_atmos/Registry        2011-08-22 17:36:53 UTC (rev 951)
@@ -33,6 +33,8 @@
namelist real nhyd_model config_smdiv 0.1
namelist real nhyd_model config_apvm_upwinding 0.5
namelist logical nhyd_model config_h_ScaleWithMesh false
+namelist real damping config_zd 22000.0
+namelist real damping config_xnutr 0.0
namelist integer dimensions config_nvertlevels 26
namelist character io config_input_name grid.nc
namelist character io config_sfc_update_name sfc_update.nc
Modified: branches/atmos_physics/src/core_nhyd_atmos/module_mpas_core.F
===================================================================
--- branches/atmos_physics/src/core_nhyd_atmos/module_mpas_core.F        2011-08-19 14:55:41 UTC (rev 950)
+++ branches/atmos_physics/src/core_nhyd_atmos/module_mpas_core.F        2011-08-22 17:36:53 UTC (rev 951)
@@ -122,6 +122,8 @@
call compute_mesh_scaling(mesh)
+ call compute_damping_coefs(mesh)
+
write(0,*) 'min/max of meshScalingDel2 = ', minval(mesh % meshScalingDel2 % array(1:mesh%nEdges)), &
maxval(mesh % meshScalingDel2 % array(1:mesh%nEdges))
write(0,*) 'min/max of meshScalingDel4 = ', minval(mesh % meshScalingDel4 % array(1:mesh%nEdges)), &
@@ -331,4 +333,37 @@
end subroutine compute_mesh_scaling
+
+ subroutine compute_damping_coefs(mesh)
+
+ use grid_types
+ use configure
+
+ implicit none
+
+ type (mesh_type), intent(inout) :: mesh
+
+ integer :: iCell, k
+ real (kind=RKIND) :: z, zt, m1, pii
+ real (kind=RKIND), dimension(:,:), pointer :: dss, zgrid
+
+ m1 = -1.0
+ pii = acos(m1)
+
+ dss => mesh % dss % array
+ zgrid => mesh % zgrid % array
+
+ dss(:,:) = 0.0
+ do iCell=1,mesh%nCells
+ zt = zgrid(mesh%nVertLevels+1,iCell)
+ do k=1,mesh%nVertLevels
+ z = 0.5*(zgrid(k,iCell) + zgrid(k+1,iCell))
+ if (z > config_zd) then
+ dss(k,iCell) = config_xnutr*sin(0.5*pii*(z-config_zd)/(zt-config_zd))**2.0
+ end if
+ end do
+ end do
+
+ end subroutine compute_damping_coefs
+
end module mpas_core
</font>
</pre>