<p><b>ringler@lanl.gov</b> 2010-11-26 20:57:39 -0700 (Fri, 26 Nov 2010)</p><p><br>
1. turn off some of the output in an attempt to keep file size manageable<br>
2. add vorticityCell, this the relative vorticity averaged to cell centers<br>
3. add ability to restore surface temperature and salinity to user-supplied temperature and salinity fields<br>
</p><hr noshade><pre><font color="gray">Modified: branches/ocean_projects/workspace_tdr/src/core_ocean/Registry
===================================================================
--- branches/ocean_projects/workspace_tdr/src/core_ocean/Registry        2010-11-27 03:27:39 UTC (rev 631)
+++ branches/ocean_projects/workspace_tdr/src/core_ocean/Registry        2010-11-27 03:57:39 UTC (rev 632)
@@ -7,6 +7,8 @@
namelist integer sw_model config_ntimesteps 7500
namelist integer sw_model config_output_interval 500
namelist integer sw_model config_stats_interval 100
+namelist logical sw_model config_surface_restore false
+namelist real sw_model config_restore_timescale 180.0
namelist character io config_input_name grid.nc
namelist character io config_output_name output.nc
namelist character io config_restart_name restart.nc
@@ -135,6 +137,8 @@
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 - -
+var persistent real temperatureRestore ( nCells ) 0 iro temperatureRestore mesh - -
+var persistent real salinityRestore ( nCells ) 0 iro salinityRestore mesh - -
# Prognostic variables: read from input, saved in restart, and written to output
var persistent real u ( nVertLevels nEdges Time ) 2 iro u state - -
@@ -142,8 +146,8 @@
var persistent real rho ( nVertLevels nCells Time ) 2 iro rho state - -
var persistent real temperature ( nVertLevels nCells Time ) 2 iro temperature state tracers dynamics
var persistent real salinity ( nVertLevels nCells Time ) 2 iro salinity state tracers dynamics
-var persistent real tracer1 ( nVertLevels nCells Time ) 2 iro tracer1 state tracers testing
-var persistent real tracer2 ( nVertLevels nCells Time ) 2 iro tracer2 state tracers testing
+var persistent real tracer1 ( nVertLevels nCells Time ) 2 ir- tracer1 state tracers testing
+var persistent real tracer2 ( nVertLevels nCells Time ) 2 ir- tracer2 state tracers testing
# Tendency variables: neither read nor written to any files
var persistent real tend_u ( nVertLevels nEdges Time ) 1 - u tend - -
@@ -156,7 +160,8 @@
# Diagnostic fields: only written to output
var persistent real v ( nVertLevels nEdges Time ) 2 - v state - -
var persistent real divergence ( nVertLevels nCells Time ) 2 o divergence state - -
-var persistent real vorticity ( nVertLevels nVertices Time ) 2 - vorticity state - -
+var persistent real vorticity ( nVertLevels nVertices Time ) 2 o vorticity state - -
+var persistent real vorticityCell ( nVertLevels nCells Time ) 2 o vorticityCell state - -
var persistent real pv_edge ( nVertLevels nEdges Time ) 2 - pv_edge state - -
var persistent real h_edge ( nVertLevels nEdges Time ) 2 - h_edge state - -
var persistent real h_vertex ( nVertLevels nVertices Time ) 2 - h_vertex state - -
@@ -164,13 +169,13 @@
var persistent real ke_edge ( nVertLevels nEdges Time ) 2 - ke_edge state - -
var persistent real pv_vertex ( nVertLevels nVertices Time ) 2 - pv_vertex state - -
var persistent real pv_cell ( nVertLevels nCells Time ) 2 o pv_cell state - -
-var persistent real uReconstructX ( nVertLevels nCells Time ) 2 o uReconstructX state - -
-var persistent real uReconstructY ( nVertLevels nCells Time ) 2 o uReconstructY state - -
-var persistent real uReconstructZ ( nVertLevels nCells Time ) 2 o uReconstructZ state - -
+var persistent real uReconstructX ( nVertLevels nCells Time ) 2 - uReconstructX state - -
+var persistent real uReconstructY ( nVertLevels nCells Time ) 2 - uReconstructY state - -
+var persistent real uReconstructZ ( nVertLevels nCells Time ) 2 - uReconstructZ state - -
var persistent real uReconstructZonal ( nVertLevels nCells Time ) 2 o uReconstructZonal state - -
var persistent real uReconstructMeridional ( nVertLevels nCells Time ) 2 o uReconstructMeridional state - -
-var persistent real MontPot ( nVertLevels nCells Time ) 2 o MontPot state - -
-var persistent real pressure ( nVertLevels nCells Time ) 2 o pressure state - -
+var persistent real MontPot ( nVertLevels nCells Time ) 2 - MontPot state - -
+var persistent real pressure ( nVertLevels nCells Time ) 2 - pressure state - -
var persistent real wTop ( nVertLevelsP1 nCells Time ) 2 o wTop state - -
# Other diagnostic variables: neither read nor written to any files
Modified: branches/ocean_projects/workspace_tdr/src/core_ocean/module_time_integration.F
===================================================================
--- branches/ocean_projects/workspace_tdr/src/core_ocean/module_time_integration.F        2010-11-27 03:27:39 UTC (rev 631)
+++ branches/ocean_projects/workspace_tdr/src/core_ocean/module_time_integration.F        2010-11-27 03:57:39 UTC (rev 632)
@@ -707,7 +707,7 @@
integer, dimension(:), pointer :: nEdgesOnCell, nEdgesOnEdge, &
maxLevelCell, maxLevelEdgeTop, maxLevelVertexBot
integer, dimension(:,:), pointer :: cellsOnEdge, boundaryCell
- real (kind=RKIND), dimension(:), pointer :: zTopZLevel
+ real (kind=RKIND), dimension(:), pointer :: zTopZLevel, temperatureRestore, salinityRestore
real (kind=RKIND), dimension(:,:), allocatable:: fluxVertTop, tracerTop, boundaryMask
real (kind=RKIND), dimension(:,:,:), allocatable::tr_flux, tr_div, delsq_tracer
@@ -744,12 +744,28 @@
deriv_two => grid % deriv_two % array
+ temperatureRestore => grid % temperatureRestore % array
+ salinityRestore => grid % salinityRestore % array
+
!
! initialize tracer tendency (RHS of tracer equation) to zero.
!
tend_tr(:,:,:) = 0.0
!
+ ! include surface restore on temperature and salinity
+ !
+ if(config_surface_restore) then
+ r = 1.0 / (config_restore_timescale * 86400.0)
+ do iCell=1,nCells
+ tend_tr(s % index_temperature,1,iCell) = tend_tr(s % index_temperature,1,iCell) - &
+ h(1,iCell)*(tracers(s % index_temperature,1,iCell) - temperatureRestore(iCell))*r
+ tend_tr(s % index_salinity,1,iCell) = tend_tr(s % index_salinity,1,iCell) - &
+ h(1,iCell)*(tracers(s % index_salinity,1,iCell) - salinityRestore(iCell))*r
+ enddo
+ endif
+
+ !
! tracer tendency: horizontal advection term -div( h \phi u)
!
! mrp 101115 note: in order to include flux boundary conditions, we will need to
@@ -1123,7 +1139,7 @@
weightsOnEdge, kiteAreasOnVertex, h_edge, h, u, v, w, pressure,&
circulation, vorticity, ke, ke_edge, MontPot, wTop, &
pv_edge, pv_vertex, pv_cell, gradPVn, gradPVt, divergence, &
- rho, temperature, salinity
+ rho, temperature, salinity, vorticityCell
real (kind=RKIND), dimension(:,:,:), pointer :: tracers
real (kind=RKIND), dimension(:), allocatable:: pTop
real (kind=RKIND), dimension(:,:), allocatable:: div_u
@@ -1148,6 +1164,7 @@
h_edge => s % h_edge % array
circulation => s % circulation % array
vorticity => s % vorticity % array
+ vorticityCell => s % vorticityCell % array
divergence => s % divergence % array
ke => s % ke % array
ke_edge => s % ke_edge % array
@@ -1426,6 +1443,23 @@
enddo
!
+ ! Compute vorticity at cell centers
+ ! ( this computes vorticityCell for all real cells and distance-1 ghost cells )
+ !
+ vorticityCell(:,:) = 0.0
+ do iVertex = 1,nVertices
+ do i=1,vertexDegree
+ iCell = cellsOnVertex(i,iVertex)
+ do k = 1,maxLevelCell(iCell)
+ vorticityCell(k,iCell) = vorticityCell(k,iCell) &
+ + kiteAreasOnVertex(i, iVertex) * vorticity(k, iVertex) &
+ / areaCell(iCell)
+ enddo
+ enddo
+ enddo
+
+
+ !
! Compute pv at the edges
! ( this computes pv_edge at all edges bounding real cells )
!
</font>
</pre>