<p><b>dwj07@fsu.edu</b> 2011-01-26 13:12:39 -0700 (Wed, 26 Jan 2011)</p><p><br>
        Adding Wind Stress, and Bottom Drag to the shallow water core.<br>
        Both are implemented exactly as they are in the ocean model.<br>
<br>
        Registry and namelist files are updated.<br>
        Two logicals are added to the namelist that allow the user to selectively turn on<br>
        and off either the wind stress or the bottom drag.<br>
<br>
        Wind stress field is read in from the u_src field in the grid/restart file.<br>
</p><hr noshade><pre><font color="gray">Modified: trunk/mpas/namelist.input.sw
===================================================================
--- trunk/mpas/namelist.input.sw        2011-01-26 17:53:01 UTC (rev 706)
+++ trunk/mpas/namelist.input.sw        2011-01-26 20:12:39 UTC (rev 707)
@@ -13,6 +13,8 @@
config_tracer_adv_order = 2
config_positive_definite = .false.
config_monotonic = .false.
+ config_wind_stress = .false.
+ config_bottom_drag = .false.
/
&io
Modified: trunk/mpas/src/core_sw/Registry
===================================================================
--- trunk/mpas/src/core_sw/Registry        2011-01-26 17:53:01 UTC (rev 706)
+++ trunk/mpas/src/core_sw/Registry        2011-01-26 20:12:39 UTC (rev 707)
@@ -15,6 +15,8 @@
namelist integer sw_model config_tracer_adv_order 2
namelist logical sw_model config_positive_definite false
namelist logical sw_model config_monotonic false
+namelist logical sw_model config_wind_stress                        false
+namelist logical sw_model config_bottom_drag                        false
namelist real sw_model config_apvm_upwinding 0.5
namelist character io config_input_name grid.nc
namelist character io config_output_name output.nc
@@ -112,6 +114,7 @@
var persistent integer boundaryEdge ( nVertLevels nEdges ) 0 iro boundaryEdge mesh - -
var persistent integer boundaryVertex ( nVertLevels nVertices ) 0 iro boundaryVertex mesh - -
var persistent integer boundaryCell ( nVertLevels nCells ) 0 iro boundaryCell mesh - -
+var persistent real u_src ( nVertLevels nEdges ) 0 iro u_src mesh - -
# Prognostic variables: read from input, saved in restart, and written to output
var persistent real u ( nVertLevels nEdges Time ) 2 iro u state - -
Modified: trunk/mpas/src/core_sw/module_time_integration.F
===================================================================
--- trunk/mpas/src/core_sw/module_time_integration.F        2011-01-26 17:53:01 UTC (rev 706)
+++ trunk/mpas/src/core_sw/module_time_integration.F        2011-01-26 20:12:39 UTC (rev 707)
@@ -269,8 +269,10 @@
real (kind=RKIND), allocatable, dimension(:,:) :: delsq_u
real (kind=RKIND), allocatable, dimension(:,:) :: delsq_circulation, delsq_vorticity
+ real (kind=RKIND), dimension(:,:), pointer :: u_src
+ real (kind=RKIND), parameter :: rho_ref = 1000.0
+ real (kind=RKIND) :: ke_edge
-
h => s % h % array
u => s % u % array
v => s % v % array
@@ -308,6 +310,7 @@
nVertices = grid % nVertices
nVertLevels = grid % nVertLevels
+ u_src => grid % u_src % array
!
! Compute height tendency for each cell
@@ -497,6 +500,28 @@
end if
+ ! Compute u (velocity) tendency from wind stress (u_src)
+ if(config_wind_stress) then
+ do iEdge=1,grid % nEdges
+ tend_u(1,iEdge) = tend_u(1,iEdge) &
+ + u_src(1,iEdge)/rho_ref/h_edge(1,iEdge)
+ end do
+ endif
+
+ if (config_bottom_drag) then
+ do iEdge=1,grid % nEdges
+ ! bottom drag is the same as POP:
+ ! -c |u| u where c is unitless and 1.0e-3.
+ ! see POP Reference guide, section 3.4.4.
+ ke_edge = 0.5 * ( ke(1,cellsOnEdge(1,iEdge)) &
+ + ke(1,cellsOnEdge(2,iEdge)))
+
+ tend_u(1,iEdge) = tend_u(1,iEdge) &
+ - 1.0e-3*u(1,iEdge) &
+ *sqrt(2.0*ke_edge)/h_edge(1,iEdge)
+ end do
+ endif
+
end subroutine compute_tend
</font>
</pre>