<p><b>dwj07@fsu.edu</b> 2013-04-18 12:02:53 -0600 (Thu, 18 Apr 2013)</p><p><br>
        -- TRUNK COMMIT --<br>
        core_ocean only<br>
<br>
        Merging variable name change branch to trunk.<br>
<br>
        This changes the names of several ocean variables.<br>
</p><hr noshade><pre><font color="gray">Index: trunk/mpas
===================================================================
--- trunk/mpas        2013-04-18 16:43:19 UTC (rev 2769)
+++ trunk/mpas        2013-04-18 18:02:53 UTC (rev 2770)
Property changes on: trunk/mpas
___________________________________________________________________
Modified: svn:mergeinfo
## -23,6 +23,7 ##
/branches/ocean_projects/sea_level_pressure:2488-2528
/branches/ocean_projects/split_explicit_mrp:1134-1138
/branches/ocean_projects/split_explicit_timestepping:1044-1097
+/branches/ocean_projects/variable_name_change:2689-2767
/branches/ocean_projects/vert_adv_mrp:704-745
/branches/ocean_projects/vol_cons_RK_imp_mix:1965-1992
/branches/ocean_projects/zstar_restart_new:1762-1770
\ No newline at end of property
Modified: trunk/mpas/namelist.input.ocean
===================================================================
--- trunk/mpas/namelist.input.ocean        2013-04-18 16:43:19 UTC (rev 2769)
+++ trunk/mpas/namelist.input.ocean        2013-04-18 18:02:53 UTC (rev 2770)
@@ -113,7 +113,7 @@
/
&pressure_gradient
        config_pressure_gradient_type = 'pressure_and_zmid'
-        config_rho0 = 1014.65
+        config_density0 = 1014.65
/
&eos
        config_eos_type = 'jm'
@@ -123,7 +123,7 @@
        config_eos_linear_beta = 7.64e-1
        config_eos_linear_Tref = 19.0
        config_eos_linear_Sref = 35.0
-        config_eos_linear_rhoref = 1025.022
+        config_eos_linear_densityref = 1025.022
/
&split_explicit_ts
        config_n_ts_iter = 2
@@ -132,11 +132,11 @@
        config_n_bcl_iter_end = 2
        config_n_btr_subcycles = 20
        config_n_btr_cor_iter = 2
-        config_u_correction = .true.
+        config_vel_correction = .true.
        config_btr_subcycle_loop_factor = 2
-        config_btr_gam1_uWt1 = 0.5
+        config_btr_gam1_velWt1 = 0.5
        config_btr_gam2_SSHWt1 = 1.0
-        config_btr_gam3_uWt2 = 1.0
+        config_btr_gam3_velWt2 = 1.0
        config_btr_solve_SSH2 = .false.
/
&debug
@@ -146,16 +146,16 @@
        config_prescribe_thickness = .false.
        config_include_KE_vertex = .false.
        config_check_tracer_monotonicity = .false.
-        config_disable_h_all_tend = .false.
-        config_disable_h_hadv = .false.
-        config_disable_h_vadv = .false.
-        config_disable_u_all_tend = .false.
-        config_disable_u_coriolis = .false.
-        config_disable_u_pgrad = .false.
-        config_disable_u_hmix = .false.
-        config_disable_u_windstress = .false.
-        config_disable_u_vmix = .false.
-        config_disable_u_vadv = .false.
+        config_disable_thick_all_tend = .false.
+        config_disable_thick_hadv = .false.
+        config_disable_thick_vadv = .false.
+        config_disable_vel_all_tend = .false.
+        config_disable_vel_coriolis = .false.
+        config_disable_vel_pgrad = .false.
+        config_disable_vel_hmix = .false.
+        config_disable_vel_windstress = .false.
+        config_disable_vel_vmix = .false.
+        config_disable_vel_vadv = .false.
        config_disable_tr_all_tend = .false.
        config_disable_tr_adv = .false.
        config_disable_tr_hmix = .false.
Index: trunk/mpas/src/core_ocean
===================================================================
--- trunk/mpas/src/core_ocean        2013-04-18 16:43:19 UTC (rev 2769)
+++ trunk/mpas/src/core_ocean        2013-04-18 18:02:53 UTC (rev 2770)
Property changes on: trunk/mpas/src/core_ocean
___________________________________________________________________
Modified: svn:mergeinfo
## -23,6 +23,7 ##
/branches/ocean_projects/sea_level_pressure/src/core_ocean:2488-2528
/branches/ocean_projects/split_explicit_mrp/src/core_ocean:1134-1138
/branches/ocean_projects/split_explicit_timestepping/src/core_ocean:1044-1097
+/branches/ocean_projects/variable_name_change/src/core_ocean:2689-2767
/branches/ocean_projects/vert_adv_mrp/src/core_ocean:704-745
/branches/ocean_projects/vol_cons_RK_imp_mix/src/core_ocean:1965-1992
/branches/ocean_projects/zstar_restart_new/src/core_ocean:1762-1770
\ No newline at end of property
Modified: trunk/mpas/src/core_ocean/Makefile
===================================================================
--- trunk/mpas/src/core_ocean/Makefile        2013-04-18 16:43:19 UTC (rev 2769)
+++ trunk/mpas/src/core_ocean/Makefile        2013-04-18 18:02:53 UTC (rev 2770)
@@ -15,21 +15,6 @@
mpas_ocn_vel_forcing_windstress.o \
mpas_ocn_vel_forcing_rayleigh.o \
mpas_ocn_vel_pressure_grad.o \
- mpas_ocn_tracer_vadv.o \
- mpas_ocn_tracer_vadv_spline.o \
- mpas_ocn_tracer_vadv_spline2.o \
- mpas_ocn_tracer_vadv_spline3.o \
- mpas_ocn_tracer_vadv_stencil.o \
- mpas_ocn_tracer_vadv_stencil2.o \
- mpas_ocn_tracer_vadv_stencil3.o \
- mpas_ocn_tracer_vadv_stencil4.o \
- mpas_ocn_tracer_hadv.o \
- mpas_ocn_tracer_hadv2.o \
- mpas_ocn_tracer_hadv3.o \
- mpas_ocn_tracer_hadv4.o \
- mpas_ocn_tracer_hmix.o \
- mpas_ocn_tracer_hmix_del2.o \
- mpas_ocn_tracer_hmix_del4.o \
mpas_ocn_vmix.o \
mpas_ocn_vmix_coefs_const.o \
mpas_ocn_vmix_coefs_rich.o \
@@ -37,6 +22,9 @@
mpas_ocn_restoring.o \
mpas_ocn_tendency.o \
mpas_ocn_diagnostics.o \
+         mpas_ocn_tracer_hmix.o \
+         mpas_ocn_tracer_hmix_del2.o \
+         mpas_ocn_tracer_hmix_del4.o \
mpas_ocn_tracer_advection.o \
mpas_ocn_tracer_advection_std.o \
mpas_ocn_tracer_advection_std_hadv.o \
@@ -104,30 +92,6 @@
mpas_ocn_vel_coriolis.o:
-mpas_ocn_tracer_hadv.o: mpas_ocn_tracer_hadv2.o mpas_ocn_tracer_hadv3.o mpas_ocn_tracer_hadv4.o
-
-mpas_ocn_tracer_hadv2.o:
-
-mpas_ocn_tracer_hadv3.o:
-
-mpas_ocn_tracer_hadv4.o:
-
-mpas_ocn_tracer_vadv.o: mpas_ocn_tracer_vadv_spline.o mpas_ocn_tracer_vadv_stencil.o
-
-mpas_ocn_tracer_vadv_spline.o: mpas_ocn_tracer_vadv_spline2.o mpas_ocn_tracer_vadv_spline3.o
-
-mpas_ocn_tracer_vadv_spline2.o:
-
-mpas_ocn_tracer_vadv_spline3.o:
-
-mpas_ocn_tracer_vadv_stencil.o: mpas_ocn_tracer_vadv_stencil2.o mpas_ocn_tracer_vadv_stencil3.o mpas_ocn_tracer_vadv_stencil4.o
-
-mpas_ocn_tracer_vadv_stencil2.o:
-
-mpas_ocn_tracer_vadv_stencil3.o:
-
-mpas_ocn_tracer_vadv_stencil4.o:
-
mpas_ocn_tracer_hmix.o: mpas_ocn_tracer_hmix_del2.o mpas_ocn_tracer_hmix_del4.o
mpas_ocn_tracer_hmix_del2.o:
@@ -183,18 +147,6 @@
mpas_ocn_vel_forcing.o \
mpas_ocn_vel_forcing_windstress.o \
mpas_ocn_vel_pressure_grad.o \
- mpas_ocn_tracer_vadv.o \
- mpas_ocn_tracer_vadv_spline.o \
- mpas_ocn_tracer_vadv_spline2.o \
- mpas_ocn_tracer_vadv_spline3.o \
- mpas_ocn_tracer_vadv_stencil.o \
- mpas_ocn_tracer_vadv_stencil2.o \
- mpas_ocn_tracer_vadv_stencil3.o \
- mpas_ocn_tracer_vadv_stencil4.o \
- mpas_ocn_tracer_hadv.o \
- mpas_ocn_tracer_hadv2.o \
- mpas_ocn_tracer_hadv3.o \
- mpas_ocn_tracer_hadv4.o \
mpas_ocn_tracer_hmix.o \
mpas_ocn_tracer_hmix_del2.o \
mpas_ocn_tracer_hmix_del4.o \
Modified: trunk/mpas/src/core_ocean/Registry.xml
===================================================================
--- trunk/mpas/src/core_ocean/Registry.xml        2013-04-18 16:43:19 UTC (rev 2769)
+++ trunk/mpas/src/core_ocean/Registry.xml        2013-04-18 18:02:53 UTC (rev 2770)
@@ -344,7 +344,7 @@
        </nml_record>
        <nml_record name="forcing">
                <nml_option name="config_use_monthly_forcing" type="logical" default_value=".false." units="unitless"
-                 description="Controls time frequency of forcing. If false, a constant forcing is used, provided by the input fields u_src, temperatureRestore, and salinityRestore. If true, forcing is interpolated between monthly fields given by windStressMonthly, temperatureRestoreMonthly, and salinityRestoreMonthly."
+                 description="Controls time frequency of forcing. If false, a constant forcing is used, provided by the input fields normalVelocityForcing, temperatureRestore, and salinityRestore. If true, forcing is interpolated between monthly fields given by windStressMonthly, temperatureRestoreMonthly, and salinityRestoreMonthly."
                 possible_values=".true. or .false."
                />
                <nml_option name="config_restoreTS" type="logical" default_value=".false." units="unitless"
@@ -393,7 +393,7 @@
                 description="Form of pressure gradient terms in momentum equation. For most applications, the gradient of pressure and layer mid-depth are appropriate. For isopycnal coordinates, one may use the gradient of the Montgomery potential."
                 possible_values="'pressure_and_zmid' or 'MontgomeryPotential'"
                />
-                <nml_option name="config_rho0" type="real" default_value="1014.65" units="kg m^{-3}"
+                <nml_option name="config_density0" type="real" default_value="1014.65" units="kg m^{-3}"
                 description="Density used as a coefficient of the pressure gradient terms, $\rho_0$. This is a constant due to the Boussinesq approximation."
                 possible_values="any positive real, but typically 1000-1035"
                />
@@ -421,7 +421,7 @@
                 description="Reference salinity"
                 possible_values="any real"
                />
-                <nml_option name="config_eos_linear_rhoref" type="real" default_value="1025.022" units="kg m^{-3}"
+                <nml_option name="config_eos_linear_densityref" type="real" default_value="1025.022" units="kg m^{-3}"
                 description="Reference density, i.e. density when T=Tref and S=Sref"
                 possible_values="any positive real"
                />
@@ -451,7 +451,7 @@
                 description="number of iterations of the velocity corrector step in stage 2"
                 possible_values="any positive integer, but typically 1, 2, or 3"
                />
-                <nml_option name="config_u_correction" type="logical" default_value=".true." units="unitless"
+                <nml_option name="config_vel_correction" type="logical" default_value=".true." units="unitless"
                 description="If true, the velocity correction term is included in the horizontal advection of thickness and tracers"
                 possible_values=".true. or .false."
                />
@@ -459,7 +459,7 @@
                 description="Barotropic subcycles proceed from $t$ to $t+n\Delta t$, where $n$ is this configuration option."
                 possible_values="Any positive integer, but typically 1 or 2"
                />
-                <nml_option name="config_btr_gam1_uWt1" type="real" default_value="0.5" units="unitless"
+                <nml_option name="config_btr_gam1_velWt1" type="real" default_value="0.5" units="unitless"
                 description="Weighting of velocity in the SSH predictor step in stage 2. When zero, previous subcycle time is used; when one, new subcycle time is used."
                 possible_values="between 0 and 1"
                />
@@ -467,7 +467,7 @@
                 description="Weighting of SSH in the velocity corrector step in stage 2. When zero, previous subcycle time is used; when one, new subcycle time is used."
                 possible_values="between 0 and 1"
                />
-                <nml_option name="config_btr_gam3_uWt2" type="real" default_value="1.0" units="unitless"
+                <nml_option name="config_btr_gam3_velWt2" type="real" default_value="1.0" units="unitless"
                 description="Weighting of velocity in the SSH corrector step in stage 2. When zero, previous subcycle time is used; when one, new subcycle time is used."
                 possible_values="between 0 and 1"
                />
@@ -501,43 +501,43 @@
                 description="Enables a change on tracer monotonicity at the end of the monotonic advection routine. Only used if config_monotonic is set to .true."
                 possible_values=".true. or .false."
                />
-                <nml_option name="config_disable_h_all_tend" type="logical" default_value=".false." units="unitless"
+                <nml_option name="config_disable_thick_all_tend" type="logical" default_value=".false." units="unitless"
                 description="Disables all tendencies on the thickness field."
                 possible_values=".true. or .false."
                />
-                <nml_option name="config_disable_h_hadv" type="logical" default_value=".false." units="unitless"
+                <nml_option name="config_disable_thick_hadv" type="logical" default_value=".false." units="unitless"
                 description="Disable tendencies on the thickness field from horizontal advection."
                 possible_values=".true. or .false."
                />
-                <nml_option name="config_disable_h_vadv" type="logical" default_value=".false." units="unitless"
+                <nml_option name="config_disable_thick_vadv" type="logical" default_value=".false." units="unitless"
                 description="Disables tendencies on the thickness field from vertical advection."
                 possible_values=".true. or .false."
                />
-                <nml_option name="config_disable_u_all_tend" type="logical" default_value=".false." units="unitless"
+                <nml_option name="config_disable_vel_all_tend" type="logical" default_value=".false." units="unitless"
                 description="Disables all tendencies on the velocity field."
                 possible_values=".true. or .false."
                />
-                <nml_option name="config_disable_u_coriolis" type="logical" default_value=".false." units="unitless"
+                <nml_option name="config_disable_vel_coriolis" type="logical" default_value=".false." units="unitless"
                 description="Diables tendencies on the velocity field from the Coriolis force."
                 possible_values=".true. or .false."
                />
-                <nml_option name="config_disable_u_pgrad" type="logical" default_value=".false." units="unitless"
+                <nml_option name="config_disable_vel_pgrad" type="logical" default_value=".false." units="unitless"
                 description="Disables tendencies on the velocity field from the horizontal pressure gradient."
                 possible_values=".true. or .false."
                />
-                <nml_option name="config_disable_u_hmix" type="logical" default_value=".false." units="unitless"
+                <nml_option name="config_disable_vel_hmix" type="logical" default_value=".false." units="unitless"
                 description="Disables tendencies on the velocity field from horizontal mixing."
                 possible_values=".true. or .false."
                />
-                <nml_option name="config_disable_u_windstress" type="logical" default_value=".false." units="unitless"
+                <nml_option name="config_disable_vel_windstress" type="logical" default_value=".false." units="unitless"
                 description="Disables tendencies on the velocity field from horizontal wind stress."
                 possible_values=".true. or .false."
                />
-                <nml_option name="config_disable_u_vmix" type="logical" default_value=".false." units="unitless"
+                <nml_option name="config_disable_vel_vmix" type="logical" default_value=".false." units="unitless"
                 description="Disables tendencies on the velocity field from vertical mixing."
                 possible_values=".true. or .false."
                />
-                <nml_option name="config_disable_u_vadv" type="logical" default_value=".false." units="unitless"
+                <nml_option name="config_disable_vel_vadv" type="logical" default_value=".false." units="unitless"
                 description="Disables tendencies on the velocity field from vertical advection."
                 possible_values=".true. or .false."
                />
@@ -573,40 +573,40 @@
                <var name="xtime" type="text" dimensions="Time" streams="ro" units="unitless"
                 description="model time, with format 'YYYY-MM-DD_HH:MM:SS'"
                />
-                <var name="u" type="real" dimensions="nVertLevels nEdges Time" streams="ir" units="m s^{-1}"
+                <var name="normalVelocity" type="real" dimensions="nVertLevels nEdges Time" streams="ir" units="m s^{-1}"
                 description="horizonal velocity, normal component to an edge"
                />
-                <var name="h" type="real" dimensions="nVertLevels nCells Time" streams="iro" units="m"
+                <var name="layerThickness" type="real" dimensions="nVertLevels nCells Time" streams="iro" units="m"
                 description="layer thickness"
                />
-                <var name="rho" type="real" dimensions="nVertLevels nCells Time" streams="iro" units="kg m^{-3}"
+                <var name="density" type="real" dimensions="nVertLevels nCells Time" streams="iro" units="kg m^{-3}"
                 description="density"
                />
-                <var name="uBtr" type="real" dimensions="nEdges Time" streams="r" units="m s^{-1}"
+                <var name="normalBarotropicVelocity" type="real" dimensions="nEdges Time" streams="r" units="m s^{-1}"
                 description="barotropic velocity, used in split-explicit time-stepping"
                />
                <var name="ssh" type="real" dimensions="nCells Time" streams="o" units="m"
                 description="sea surface height"
                />
-                <var name="uBtrSubcycle" type="real" dimensions="nEdges Time" units="m s^{-1}"
+                <var name="normalBarotropicVelocitySubcycle" type="real" dimensions="nEdges Time" units="m s^{-1}"
                 description="barotropic velocity, used in subcycling in stage 2 of split-explicit time-stepping"
                />
                <var name="sshSubcycle" type="real" dimensions="nCells Time" units="m"
                 description="sea surface height, used in subcycling in stage 2 of split-explicit time-stepping"
                />
-                <var name="FBtr" type="real" dimensions="nEdges Time" units="m^2 s^{-1}"
+                <var name="barotropicThicknessFlux" type="real" dimensions="nEdges Time" units="m^2 s^{-1}"
                 description="Barotropic thickness flux at each edge, used to advance sea surface height in each subcycle of stage 2 of the split-explicit algorithm."
                />
-                <var name="GBtrForcing" type="real" dimensions="nEdges Time" units="m s^{-2}"
+                <var name="barotropicForcing" type="real" dimensions="nEdges Time" units="m s^{-2}"
                 description="Barotropic tendency computed from the baroclinic equations in stage 1 of the split-explicit algorithm."
                />
-                <var name="uBcl" type="real" dimensions="nVertLevels nEdges Time" units="m s^{-1}"
+                <var name="normalBaroclinicVelocity" type="real" dimensions="nVertLevels nEdges Time" units="m s^{-1}"
                 description="baroclinic velocity, used in split-explicit time-stepping"
                />
                <var name="zMid" type="real" dimensions="nVertLevels nCells Time" units="m"
                 description="z-coordinate of the mid-depth of the layer"
                />
-                <var name="v" type="real" dimensions="nVertLevels nEdges Time" units="m s^{-1}"
+                <var name="tangentialVelocity" type="real" dimensions="nVertLevels nEdges Time" units="m s^{-1}"
                 description="horizontal velocity, tangential to an edge"
                />
                <var name="uTransport" type="real" dimensions="nVertLevels nEdges Time" units="m s^{-1}"
@@ -642,79 +642,79 @@
                <var name="divergence" type="real" dimensions="nVertLevels nCells Time" streams="o" units="s^{-1}"
                 description="divergence of horizonal velocity"
                />
-                <var name="vorticity" type="real" dimensions="nVertLevels nVertices Time" streams="o" units="s^{-1}"
+                <var name="relativeVorticity" type="real" dimensions="nVertLevels nVertices Time" streams="o" units="s^{-1}"
                 description="curl of horizontal velocity"
                />
-                <var name="Vor_edge" type="real" dimensions="nVertLevels nEdges Time" units="s^{-1}"
+                <var name="potentialVorticityEdge" type="real" dimensions="nVertLevels nEdges Time" units="s^{-1}"
                 description="vorticity averaged from vertices to edges"
                />
-                <var name="h_edge" type="real" dimensions="nVertLevels nEdges Time" units="m"
+                <var name="potentialVorticityVertex" type="real" dimensions="nVertLevels nVertices Time" units="s^{-1}"
+                 description="curl of horizontal velocity defined at vertices"
+                />
+                <var name="potentialVorticityCell" type="real" dimensions="nVertLevels nCells Time" streams="o" units="s^{-1}"
+                 description="curl of horizontal velocity defined at cell centers"
+                />
+                <var name="layerThicknessEdge" type="real" dimensions="nVertLevels nEdges Time" units="m"
                 description="layer thickness averaged from cell center to edges"
                />
-                <var name="h_vertex" type="real" dimensions="nVertLevels nVertices Time" units="m"
+                <var name="layerThicknessVertex" type="real" dimensions="nVertLevels nVertices Time" units="m"
                 description="layer thickness averaged from cell center to vertices"
                />
-                <var name="ke" type="real" dimensions="nVertLevels nCells Time" streams="o" units="m^2 s^{-2}"
+                <var name="kineticEnergy" type="real" dimensions="nVertLevels nCells Time" streams="o" units="m^2 s^{-2}"
                 description="kinetic energy of horizonal velocity"
                />
-                <var name="kev" type="real" dimensions="nVertLevels nVertices Time" streams="o" units="m^2 s^{-2}"
+                <var name="kineticEnergyVertex" type="real" dimensions="nVertLevels nVertices Time" streams="o" units="m^2 s^{-2}"
                 description="kinetic energy of horizonal velocity defined at vertices"
                />
-                <var name="kevc" type="real" dimensions="nVertLevels nCells Time" streams="o" units="m^2 s^{-2}"
+                <var name="kineticEnergyVertexOnCells" type="real" dimensions="nVertLevels nCells Time" streams="o" units="m^2 s^{-2}"
                 description="kinetic energy of horizonal velocity defined at vertices"
                />
-                <var name="ke_edge" type="real" dimensions="nVertLevels nEdges Time" units="m^2 s^{-2}"
+                <var name="kineticEnergyEdge" type="real" dimensions="nVertLevels nEdges Time" units="m^2 s^{-2}"
                 description="kinetic energy of horizonal velocity defined at edges"
                />
-                <var name="Vor_vertex" type="real" dimensions="nVertLevels nVertices Time" units="s^{-1}"
-                 description="curl of horizontal velocity defined at vertices"
-                />
-                <var name="Vor_cell" type="real" dimensions="nVertLevels nCells Time" streams="o" units="s^{-1}"
-                 description="curl of horizontal velocity defined at cell centers"
-                />
-                <var name="uReconstructX" type="real" dimensions="nVertLevels nCells Time" units="m s^{-1}"
+                <var name="normalVelocityX" type="real" dimensions="nVertLevels nCells Time" units="m s^{-1}"
                 description="component of horizontal velocity in the x-direction (cartesian)"
                />
-                <var name="uReconstructY" type="real" dimensions="nVertLevels nCells Time" units="m s^{-1}"
+                <var name="normalVelocityY" type="real" dimensions="nVertLevels nCells Time" units="m s^{-1}"
                 description="component of horizontal velocity in the y-direction (cartesian)"
                />
-                <var name="uReconstructZ" type="real" dimensions="nVertLevels nCells Time" units="m s^{-1}"
+                <var name="normalVelocityZ" type="real" dimensions="nVertLevels nCells Time" units="m s^{-1}"
                 description="component of horizontal velocity in the z-direction (cartesian)"
                />
-                <var name="uReconstructZonal" type="real" dimensions="nVertLevels nCells Time" streams="o" units="m s^{-1}"
+                <var name="normalVelocityZonal" type="real" dimensions="nVertLevels nCells Time" streams="o" units="m s^{-1}"
                 description="component of horizontal velocity in the eastward direction"
                />
-                <var name="uReconstructMeridional" type="real" dimensions="nVertLevels nCells Time" streams="o" units="m s^{-1}"
+                <var name="normalVelocityMeridional" type="real" dimensions="nVertLevels nCells Time" streams="o" units="m s^{-1}"
                 description="component of horizontal velocity in the northward"
                />
-                <var name="uSrcReconstructX" type="real" dimensions="nVertLevels nCells Time" units="N m^{-2}"
+                <var name="normalVelocityForcingReconstructX" type="real" dimensions="nVertLevels nCells Time" units="N m^{-2}"
                 description="wind stress in the x-direction (cartesian)"
                />
-                <var name="uSrcReconstructY" type="real" dimensions="nVertLevels nCells Time" units="N m^{-2}"
+                <var name="normalVelocityForcingReconstructY" type="real" dimensions="nVertLevels nCells Time" units="N m^{-2}"
                 description="wind stress in the y-direction (cartesian)"
                />
-                <var name="uSrcReconstructZ" type="real" dimensions="nVertLevels nCells Time" units="N m^{-2}"
+                <var name="normalVelocityForcingReconstructZ" type="real" dimensions="nVertLevels nCells Time" units="N m^{-2}"
                 description="wind stress in the z-direction (cartesian)"
                />
-                <var name="uSrcReconstructZonal" type="real" dimensions="nVertLevels nCells Time" streams="o" units="N m^{-2}"
+                <var name="normalVelocityForcingReconstructZonal" type="real" dimensions="nVertLevels nCells Time" streams="o" units="N m^{-2}"
                 description="wind stress in the eastward direction"
                />
-                <var name="uSrcReconstructMeridional" type="real" dimensions="nVertLevels nCells Time" streams="o" units="N m^{-2}"
+                <var name="normalVelocityForcingReconstructMeridional" type="real" dimensions="nVertLevels nCells Time" streams="o" units="N m^{-2}"
                 description="wind stress in the northward direction"
                />
-                <var name="MontPot" type="real" dimensions="nVertLevels nCells Time" units="m^2 s^{-2}"
+                <var name="montgomeryPotential" type="real" dimensions="nVertLevels nCells Time" units="m^2 s^{-2}"
                 description="Montgomery potential, may be used as the pressure for isopycnal coordinates."
                />
                <var name="pressure" type="real" dimensions="nVertLevels nCells Time" units="N m^{-2}"
                 description="pressure used in the momentum equation"
                />
-                <var name="wTop" type="real" dimensions="nVertLevelsP1 nCells Time" units="m s^{-1}"
+                <var name="vertTransportVelocityTop" type="real" dimensions="nVertLevelsP1 nCells Time" units="m s^{-1}"
                 description="vertical transport through the layer interface at the top of the cell"
                />
                <var name="vertVelocityTop" type="real" dimensions="nVertLevelsP1 nCells Time" units="m s^{-1}"
                 description="vertical velocity defined at center (horizonally) and top (vertically) of cell"
                />
-                <var name="rhoDisplaced" type="real" dimensions="nVertLevels nCells Time" units="kg m^{-3}"
+                <var name="displacedDensity" type="real" dimensions="nVertLevels nCells Time" units="kg m^{-3}"
                 description="potential density displaced to the mid-depth of top layer"
                />
                <var name="BruntVaisalaFreqTop" type="real" dimensions="nVertLevels nCells Time" streams="o" units="s^{-2}"
@@ -753,34 +753,34 @@
                <var name="CFLNumberGlobal" type="real" dimensions="Time" streams="o" units="unitless"
                 description="maximum CFL number over the full domain"
                />
-                <var name="nAccumulate" type="real" dimensions="Time" streams="o" units="unitless"
+                <var name="nAverage" type="real" dimensions="Time" streams="o" units="unitless"
                 description="number of timesteps in time-averaged variables"
                />
-                <var name="acc_ssh" type="real" dimensions="nCells Time" streams="o" units="m"
+                <var name="avgSsh" type="real" dimensions="nCells Time" streams="o" units="m"
                 description="time-averaged sea surface height"
                />
-                <var name="acc_sshVar" type="real" dimensions="nCells Time" streams="o" units="m"
+                <var name="varSsh" type="real" dimensions="nCells Time" streams="o" units="m"
                 description="variance of sea surface height"
                />
-                <var name="acc_uReconstructZonal" type="real" dimensions="nVertLevels nCells Time" streams="o" units="m s^{-1}"
+                <var name="avgNormalVelocityZonal" type="real" dimensions="nVertLevels nCells Time" streams="o" units="m s^{-1}"
                 description="time-averaged velocity in the eastward direction"
                />
-                <var name="acc_uReconstructMeridional" type="real" dimensions="nVertLevels nCells Time" streams="o" units="m s^{-1}"
+                <var name="avgNormalVelocityMeridional" type="real" dimensions="nVertLevels nCells Time" streams="o" units="m s^{-1}"
                 description="time-averaged velocity in the northward direction"
                />
-                <var name="acc_uReconstructZonalVar" type="real" dimensions="nVertLevels nCells Time" streams="o" units="m s^{-1}"
+                <var name="varNormalVelocityZonal" type="real" dimensions="nVertLevels nCells Time" streams="o" units="m s^{-1}"
                 description="variance of velocity in the eastward direction"
                />
-                <var name="acc_uReconstructMeridionalVar" type="real" dimensions="nVertLevels nCells Time" streams="o" units="m s^{-1}"
+                <var name="varNormalVelocityMeridional" type="real" dimensions="nVertLevels nCells Time" streams="o" units="m s^{-1}"
                 description="variance of velocity in the northward direction"
                />
-                <var name="acc_u" type="real" dimensions="nVertLevels nEdges Time" streams="o" units="m s^{-1}"
+                <var name="avgNormalVelocity" type="real" dimensions="nVertLevels nEdges Time" streams="o" units="m s^{-1}"
                 description="time-averaged velocity, normal to cell edge"
                />
-                <var name="acc_uVar" type="real" dimensions="nVertLevels nEdges Time" streams="o" units="m s^{-1}"
+                <var name="varNormalVelocity" type="real" dimensions="nVertLevels nEdges Time" streams="o" units="m s^{-1}"
                 description="variance of velocity, normal to cell edge"
                />
-                <var name="acc_vertVelocityTop" type="real" dimensions="nVertLevelsP1 nCells Time" streams="o" units="m s^{-1}"
+                <var name="avgVertVelocityTop" type="real" dimensions="nVertLevelsP1 nCells Time" streams="o" units="m s^{-1}"
                 description="time-averaged vertical velocity at top of cell"
                />
        </var_struct>
@@ -1001,7 +1001,7 @@
                <var name="cellMask" type="integer" dimensions="nVertLevels nCells" streams="o" units="unitless"
                 description="Mask on cells that determines if computations should be done on cell."
                />
-                <var name="u_src" type="real" dimensions="nVertLevels nEdges" streams="ir" units="N m^{-2}"
+                <var name="normalVelocityForcing" type="real" dimensions="nVertLevels nEdges" streams="ir" units="N m^{-2}"
                 description="Velocity forcing field. Defines a forcing at an edge."
                />
                <var name="temperatureRestore" type="real" dimensions="nCells" streams="ir" units="^\circ C"
@@ -1044,10 +1044,10 @@
                         description="time tendency of an arbitary tracer"
                        />
                </var_array>
-                <var name="tend_u" type="real" dimensions="nVertLevels nEdges Time" units="m s^{-2}" name_in_code="u"
+                <var name="tend_normalVelocity" type="real" dimensions="nVertLevels nEdges Time" units="m s^{-2}" name_in_code="normalVelocity"
                 description="time tendency of normal component of velocity"
                />
-                <var name="tend_h" type="real" dimensions="nVertLevels nCells Time" units="m s^{-1}" name_in_code="h"
+                <var name="tend_layerThickness" type="real" dimensions="nVertLevels nCells Time" units="m s^{-1}" name_in_code="layerThickness"
                 description="time tendency of layer thickness"
                />
                <var name="tend_ssh" type="real" dimensions="nCells Time" units="m s^{-1}" name_in_code="ssh"
Modified: trunk/mpas/src/core_ocean/mpas_ocn_diagnostics.F
===================================================================
--- trunk/mpas/src/core_ocean/mpas_ocn_diagnostics.F        2013-04-18 16:43:19 UTC (rev 2769)
+++ trunk/mpas/src/core_ocean/mpas_ocn_diagnostics.F        2013-04-18 18:02:53 UTC (rev 2770)
@@ -8,7 +8,7 @@
!> \version SVN:$Id:$
!> \details
!> This module contains the routines for computing
-!> diagnostic variables, and other quantities such as wTop.
+!> diagnostic variables, and other quantities such as vertTransportVelocityTop.
!
!-----------------------------------------------------------------------
@@ -41,10 +41,10 @@
!--------------------------------------------------------------------
public :: ocn_diagnostic_solve, &
- ocn_wtop, &
+ ocn_vert_transport_velocity_top, &
ocn_fuperp, &
- ocn_filter_btr_mode_u, &
- ocn_filter_btr_mode_tend_u, &
+ ocn_filter_btr_mode_vel, &
+ ocn_filter_btr_mode_tend_vel, &
ocn_diagnostics_init
!--------------------------------------------------------------------
@@ -92,42 +92,42 @@
verticesOnCell, edgeSignOnVertex, edgeSignOnCell, edgesOnCell
real (kind=RKIND) :: d2fdx2_cell1, d2fdx2_cell2, coef_3rd_order, r_tmp, &
- invAreaCell1, invAreaCell2, invAreaTri1, invAreaTri2, invLength, h_vertex, coef
+ invAreaCell1, invAreaCell2, invAreaTri1, invAreaTri2, invLength, layerThicknessVertex, coef
real (kind=RKIND), dimension(:), allocatable:: pTop, div_hu
real (kind=RKIND), dimension(:), pointer :: &
bottomDepth, fVertex, dvEdge, dcEdge, areaCell, areaTriangle, ssh, seaSurfacePressure
real (kind=RKIND), dimension(:,:), pointer :: &
- weightsOnEdge, kiteAreasOnVertex, h_edge, h, u, v, pressure,&
- circulation, vorticity, ke, ke_edge, MontPot, wTop, zMid, &
- Vor_edge, Vor_vertex, Vor_cell, gradVor_n, gradVor_t, divergence, &
- rho, rhoDisplaced, temperature, salinity, kev, kevc, uBolusGM, uTransport, &
+ weightsOnEdge, kiteAreasOnVertex, layerThicknessEdge, layerThickness, normalVelocity, tangentialVelocity, pressure,&
+ circulation, relativeVorticity, kineticEnergy, kineticEnergyEdge, montgomeryPotential, vertTransportVelocityTop, zMid, &
+ potentialVorticityEdge, potentialVorticityVertex, potentialVorticityCell, gradVor_n, gradVor_t, divergence, &
+ density, displacedDensity, temperature, salinity, kineticEnergyVertex, kineticEnergyVertexOnCells, uBolusGM, uTransport, &
vertVelocityTop, BruntVaisalaFreqTop
real (kind=RKIND), dimension(:,:,:), pointer :: tracers, deriv_two
character :: c1*6
- h => s % h % array
- u => s % u % array
+ layerThickness => s % layerThickness % array
+ normalVelocity => s % normalVelocity % array
uTransport => s % uTransport % array
uBolusGM => s % uBolusGM % array
- v => s % v % array
- h_edge => s % h_edge % array
+ tangentialVelocity => s % tangentialVelocity % array
+ layerThicknessEdge => s % layerThicknessEdge % array
circulation => s % circulation % array
- vorticity => s % vorticity % array
+ relativeVorticity => s % relativeVorticity % array
divergence => s % divergence % array
- ke => s % ke % array
- kev => s % kev % array
- kevc => s % kevc % array
- ke_edge => s % ke_edge % array
- Vor_edge => s % Vor_edge % array
- Vor_vertex => s % Vor_vertex % array
- Vor_cell => s % Vor_cell % array
+ kineticEnergy => s % kineticEnergy % array
+ kineticEnergyVertex => s % kineticEnergyVertex % array
+ kineticEnergyVertexOnCells => s % kineticEnergyVertexOnCells % array
+ kineticEnergyEdge => s % kineticEnergyEdge % array
+ potentialVorticityEdge => s % potentialVorticityEdge % array
+ potentialVorticityVertex => s % potentialVorticityVertex % array
+ potentialVorticityCell => s % potentialVorticityCell % array
gradVor_n => s % gradVor_n % array
gradVor_t => s % gradVor_t % array
- rho => s % rho % array
- rhoDisplaced=> s % rhoDisplaced % array
- MontPot => s % MontPot % array
+ density => s % density % array
+ displacedDensity=> s % displacedDensity % array
+ montgomeryPotential => s % montgomeryPotential % array
pressure => s % pressure % array
zMid => s % zMid % array
ssh => s % ssh % array
@@ -174,18 +174,18 @@
!
! Compute height on cell edges at velocity locations
- ! Namelist options control the order of accuracy of the reconstructed h_edge value
+ ! Namelist options control the order of accuracy of the reconstructed layerThicknessEdge value
!
- ! initialize h_edge to avoid divide by zero and NaN problems.
- h_edge = -1.0e34
+ ! initialize layerThicknessEdge to avoid divide by zero and NaN problems.
+ layerThicknessEdge = -1.0e34
coef_3rd_order = config_coef_3rd_order
do iEdge=1,nEdges
cell1 = cellsOnEdge(1,iEdge)
cell2 = cellsOnEdge(2,iEdge)
do k=1,maxLevelEdgeTop(iEdge)
- h_edge(k,iEdge) = 0.5 * (h(k,cell1) + h(k,cell2))
+ layerThicknessEdge(k,iEdge) = 0.5 * (layerThickness(k,cell1) + layerThickness(k,cell2))
end do
end do
@@ -193,26 +193,26 @@
! set the velocity and height at dummy address
! used -1e34 so error clearly occurs if these values are used.
!
- u(:,nEdges+1) = -1e34
- h(:,nCells+1) = -1e34
+ normalVelocity(:,nEdges+1) = -1e34
+ layerThickness(:,nCells+1) = -1e34
tracers(s % index_temperature,:,nCells+1) = -1e34
tracers(s % index_salinity,:,nCells+1) = -1e34
circulation(:,:) = 0.0
- vorticity(:,:) = 0.0
+ relativeVorticity(:,:) = 0.0
divergence(:,:) = 0.0
vertVelocityTop(:,:)=0.0
- ke(:,:) = 0.0
- v(:,:) = 0.0
+ kineticEnergy(:,:) = 0.0
+ tangentialVelocity(:,:) = 0.0
do iVertex = 1, nVertices
invAreaTri1 = 1.0 / areaTriangle(iVertex)
do i = 1, vertexDegree
iEdge = edgesOnVertex(i, iVertex)
do k = 1, maxLevelVertexBot(iVertex)
- r_tmp = dcEdge(iEdge) * u(k, iEdge)
+ r_tmp = dcEdge(iEdge) * normalVelocity(k, iEdge)
circulation(k, iVertex) = circulation(k, iVertex) + edgeSignOnVertex(i, iVertex) * r_tmp
- vorticity(k, iVertex) = vorticity(k, iVertex) + edgeSignOnVertex(i, iVertex) * r_tmp * invAreaTri1
+ relativeVorticity(k, iVertex) = relativeVorticity(k, iVertex) + edgeSignOnVertex(i, iVertex) * r_tmp * invAreaTri1
end do
end do
end do
@@ -224,11 +224,11 @@
do i = 1, nEdgesOnCell(iCell)
iEdge = edgesOnCell(i, iCell)
do k = 1, maxLevelCell(iCell)
- r_tmp = dvEdge(iEdge) * u(k, iEdge) * invAreaCell1
+ r_tmp = dvEdge(iEdge) * normalVelocity(k, iEdge) * invAreaCell1
divergence(k, iCell) = divergence(k, iCell) - edgeSignOnCell(i, iCell) * r_tmp
- div_hu(k) = div_hu(k) - h_edge(k, iEdge) * edgeSignOnCell(i, iCell) * r_tmp
- ke(k, iCell) = ke(k, iCell) + 0.25 * r_tmp * dcEdge(iEdge) * u(k,iEdge)
+ div_hu(k) = div_hu(k) - layerThicknessEdge(k, iEdge) * edgeSignOnCell(i, iCell) * r_tmp
+ kineticEnergy(k, iCell) = kineticEnergy(k, iCell) + 0.25 * r_tmp * dcEdge(iEdge) * normalVelocity(k,iEdge)
end do
end do
! Vertical velocity at bottom (maxLevelCell(iCell)+1) is zero, initialized above.
@@ -243,7 +243,7 @@
do i=1,nEdgesOnEdge(iEdge)
eoe = edgesOnEdge(i,iEdge)
do k = 1,maxLevelEdgeTop(iEdge)
- v(k,iEdge) = v(k,iEdge) + weightsOnEdge(i,iEdge) * u(k, eoe)
+ tangentialVelocity(k,iEdge) = tangentialVelocity(k,iEdge) + weightsOnEdge(i,iEdge) * normalVelocity(k, eoe)
end do
end do
end do
@@ -251,13 +251,13 @@
!
! Compute kinetic energy in each vertex
!
- kev(:,:) = 0.0; kevc(:,:) = 0.0
+ kineticEnergyVertex(:,:) = 0.0; kineticEnergyVertexOnCells(:,:) = 0.0
do iVertex = 1, nVertices*ke_vertex_flag
do i = 1, vertexDegree
iEdge = edgesOnVertex(i, iVertex)
r_tmp = dcEdge(iEdge) * dvEdge(iEdge) * 0.25 / areaTriangle(iVertex)
do k = 1, nVertLevels
- kev(k, iVertex) = kev(k, iVertex) + r_tmp * u(k, iEdge)**2
+ kineticEnergyVertex(k, iVertex) = kineticEnergyVertex(k, iVertex) + r_tmp * normalVelocity(k, iEdge)**2
end do
end do
end do
@@ -268,55 +268,55 @@
j = kiteIndexOnCell(i, iCell)
iVertex = verticesOnCell(i, iCell)
do k = 1, nVertLevels
- kevc(k, iCell) = kevc(k, iCell) + kiteAreasOnVertex(j, iVertex) * kev(k, iVertex) * invAreaCell1
+ kineticEnergyVertexOnCells(k, iCell) = kineticEnergyVertexOnCells(k, iCell) + kiteAreasOnVertex(j, iVertex) * kineticEnergyVertex(k, iVertex) * invAreaCell1
end do
end do
end do
!
- ! Compute kinetic energy in each cell by blending ke and kevc
+ ! Compute kinetic energy in each cell by blending kineticEnergy and kineticEnergyVertexOnCells
!
do iCell=1,nCells*ke_vertex_flag
do k=1,nVertLevels
- ke(k,iCell) = 5.0/8.0*ke(k,iCell) + 3.0/8.0*kevc(k,iCell)
+ kineticEnergy(k,iCell) = 5.0/8.0*kineticEnergy(k,iCell) + 3.0/8.0*kineticEnergyVertexOnCells(k,iCell)
end do
end do
!
- ! Compute ke on cell edges at velocity locations for quadratic bottom drag.
+ ! Compute kineticEnergy on cell edges at velocity locations for quadratic bottom drag.
!
do iEdge=1,nEdges
cell1 = cellsOnEdge(1,iEdge)
cell2 = cellsOnEdge(2,iEdge)
do k=1,maxLevelEdgeTop(iEdge)
- ke_edge(k,iEdge) = 0.5 * (ke(k,cell1) + ke(k,cell2))
+ kineticEnergyEdge(k,iEdge) = 0.5 * (kineticEnergy(k,cell1) + kineticEnergy(k,cell2))
end do
end do
!
! Compute height at vertices, pv at vertices, and average pv to edge locations
- ! ( this computes Vor_vertex at all vertices bounding real cells and distance-1 ghost cells )
+ ! ( this computes potentialVorticityVertex at all vertices bounding real cells and distance-1 ghost cells )
!
do iVertex = 1,nVertices
invAreaTri1 = 1.0 / areaTriangle(iVertex)
do k=1,maxLevelVertexBot(iVertex)
- h_vertex = 0.0
+ layerThicknessVertex = 0.0
do i=1,vertexDegree
- h_vertex = h_vertex + h(k,cellsOnVertex(i,iVertex)) * kiteAreasOnVertex(i,iVertex)
+ layerThicknessVertex = layerThicknessVertex + layerThickness(k,cellsOnVertex(i,iVertex)) * kiteAreasOnVertex(i,iVertex)
end do
- h_vertex = h_vertex * invAreaTri1
+ layerThicknessVertex = layerThicknessVertex * invAreaTri1
- Vor_vertex(k,iVertex) = (fCoef*fVertex(iVertex) + vorticity(k,iVertex)) / h_vertex
+ potentialVorticityVertex(k,iVertex) = (fCoef*fVertex(iVertex) + relativeVorticity(k,iVertex)) / layerThicknessVertex
end do
end do
- Vor_cell(:,:) = 0.0
- Vor_edge(:,:) = 0.0
+ potentialVorticityCell(:,:) = 0.0
+ potentialVorticityEdge(:,:) = 0.0
do iEdge = 1, nEdges
vertex1 = verticesOnEdge(1, iEdge)
vertex2 = verticesOnEdge(2, iEdge)
do k = 1, maxLevelEdgeBot(iEdge)
- Vor_edge(k, iEdge) = 0.5 * (Vor_vertex(k, vertex1) + Vor_vertex(k, vertex2))
+ potentialVorticityEdge(k, iEdge) = 0.5 * (potentialVorticityVertex(k, vertex1) + potentialVorticityVertex(k, vertex2))
end do
end do
@@ -327,7 +327,7 @@
j = kiteIndexOnCell(i, iCell)
iVertex = verticesOnCell(i, iCell)
do k = 1, maxLevelCell(iCell)
- Vor_cell(k, iCell) = Vor_cell(k, iCell) + kiteAreasOnVertex(j, iVertex) * Vor_vertex(k, iVertex) * invAreaCell1
+ potentialVorticityCell(k, iCell) = potentialVorticityCell(k, iCell) + kiteAreasOnVertex(j, iVertex) * potentialVorticityVertex(k, iVertex) * invAreaCell1
end do
end do
end do
@@ -342,14 +342,14 @@
! Compute gradient of PV in normal direction
! ( this computes gradVor_n for all edges bounding real cells )
do k=1,maxLevelEdgeTop(iEdge)
- gradVor_n(k,iEdge) = (Vor_cell(k,cell2) - Vor_cell(k,cell1)) * invLength
+ gradVor_n(k,iEdge) = (potentialVorticityCell(k,cell2) - potentialVorticityCell(k,cell1)) * invLength
enddo
invLength = 1.0 / dvEdge(iEdge)
! Compute gradient of PV in the tangent direction
! ( this computes gradVor_t at all edges bounding real cells and distance-1 ghost cells )
do k = 1,maxLevelEdgeBot(iEdge)
- gradVor_t(k,iEdge) = (Vor_vertex(k,vertex2) - Vor_vertex(k,vertex1)) * invLength
+ gradVor_t(k,iEdge) = (potentialVorticityVertex(k,vertex2) - potentialVorticityVertex(k,vertex1)) * invLength
enddo
enddo
@@ -359,9 +359,9 @@
!
do iEdge = 1,nEdges
do k = 1,maxLevelEdgeBot(iEdge)
- Vor_edge(k,iEdge) = Vor_edge(k,iEdge) &
- - config_apvm_scale_factor * dt* ( u(k,iEdge) * gradVor_n(k,iEdge) &
- + v(k,iEdge) * gradVor_t(k,iEdge) )
+ potentialVorticityEdge(k,iEdge) = potentialVorticityEdge(k,iEdge) &
+ - config_apvm_scale_factor * dt* ( normalVelocity(k,iEdge) * gradVor_n(k,iEdge) &
+ + tangentialVelocity(k,iEdge) * gradVor_t(k,iEdge) )
enddo
enddo
@@ -374,17 +374,17 @@
call mpas_timer_start("equation of state", .false., diagEOSTimer)
! compute in-place density
- call ocn_equation_of_state_rho(s, grid, 0, 'relative', err)
+ call ocn_equation_of_state_density(s, grid, 0, 'relative', err)
- ! compute rhoDisplaced, the potential density referenced to the top layer
- call ocn_equation_of_state_rho(s, grid, 1, 'relative', err)
+ ! compute displacedDensity, the potential density referenced to the top layer
+ call ocn_equation_of_state_density(s, grid, 1, 'relative', err)
call mpas_timer_stop("equation of state", diagEOSTimer)
endif
!
! Pressure
- ! This section must be after computing rho
+ ! This section must be after computing density
!
if (config_pressure_gradient_type.eq.'MontgomeryPotential') then
@@ -399,15 +399,15 @@
! For isopycnal mode, p is the Montgomery Potential.
! At top layer it is g*SSH, where SSH may be off by a
! constant (ie, bottomDepth can be relative to top or bottom)
- MontPot(1,iCell) = gravity &
- * (bottomDepth(iCell) + sum(h(1:nVertLevels,iCell)))
+ montgomeryPotential(1,iCell) = gravity &
+ * (bottomDepth(iCell) + sum(layerThickness(1:nVertLevels,iCell)))
do k=2,nVertLevels
- pTop(k) = pTop(k-1) + rho(k-1,iCell)*gravity* h(k-1,iCell)
+ pTop(k) = pTop(k-1) + density(k-1,iCell)*gravity* layerThickness(k-1,iCell)
- ! from delta M = p delta / rho
- MontPot(k,iCell) = MontPot(k-1,iCell) &
- + pTop(k)*(1.0/rho(k,iCell) - 1.0/rho(k-1,iCell))
+ ! from delta M = p delta / density
+ montgomeryPotential(k,iCell) = montgomeryPotential(k-1,iCell) &
+ + pTop(k)*(1.0/density(k,iCell) - 1.0/density(k-1,iCell))
end do
end do
@@ -419,26 +419,26 @@
! Pressure for generalized coordinates.
! Pressure at top surface may be due to atmospheric pressure
! or an ice-shelf depression.
- pressure(1,iCell) = seaSurfacePressure(iCell) + rho(1,iCell)*gravity &
- * 0.5*h(1,iCell)
+ pressure(1,iCell) = seaSurfacePressure(iCell) + density(1,iCell)*gravity &
+ * 0.5*layerThickness(1,iCell)
do k=2,maxLevelCell(iCell)
pressure(k,iCell) = pressure(k-1,iCell) &
- + 0.5*gravity*( rho(k-1,iCell)*h(k-1,iCell) &
- + rho(k ,iCell)*h(k ,iCell))
+ + 0.5*gravity*( density(k-1,iCell)*layerThickness(k-1,iCell) &
+ + density(k ,iCell)*layerThickness(k ,iCell))
end do
! Compute zMid, the z-coordinate of the middle of the layer.
- ! This is used for the rho g grad z momentum term.
+ ! This is used for the density g grad z momentum term.
! Note the negative sign, since bottomDepth is positive
! and z-coordinates are negative below the surface.
k = maxLevelCell(iCell)
- zMid(k:nVertLevels,iCell) = -bottomDepth(iCell) + 0.5*h(k,iCell)
+ zMid(k:nVertLevels,iCell) = -bottomDepth(iCell) + 0.5*layerThickness(k,iCell)
do k=maxLevelCell(iCell)-1, 1, -1
zMid(k,iCell) = zMid(k+1,iCell) &
- + 0.5*( h(k+1,iCell) &
- + h(k ,iCell))
+ + 0.5*( layerThickness(k+1,iCell) &
+ + layerThickness(k ,iCell))
end do
end do
@@ -448,11 +448,11 @@
!
! Brunt-Vaisala frequency
!
- coef = -gravity/config_rho0
+ coef = -gravity/config_density0
do iCell=1,nCells
BruntVaisalaFreqTop(1,iCell) = 0.0
do k=2,maxLevelCell(iCell)
- BruntVaisalaFreqTop(k,iCell) = coef * (rhoDisplaced(k-1,iCell) - rhoDisplaced(k,iCell)) &
+ BruntVaisalaFreqTop(k,iCell) = coef * (displacedDensity(k-1,iCell) - displacedDensity(k,iCell)) &
/ (zMid(k-1,iCell) - zMid(k,iCell))
end do
end do
@@ -466,7 +466,7 @@
! Note the negative sign, since bottomDepth is positive
! and z-coordinates are negative below the surface.
- ssh(iCell) = - bottomDepth(iCell) + sum(h(1:maxLevelCell(iCell),iCell))
+ ssh(iCell) = - bottomDepth(iCell) + sum(layerThickness(1:maxLevelCell(iCell),iCell))
end do
@@ -483,7 +483,7 @@
!***********************************************************************
!
-! routine ocn_wtop
+! routine ocn_vert_transport_velocity_top
!
!> \brief Computes vertical transport
!> \author Mark Petersen
@@ -494,7 +494,7 @@
!> cell.
!
!-----------------------------------------------------------------------
- subroutine ocn_wtop(grid,h,h_edge,u,wTop, err)!{{{
+ subroutine ocn_vert_transport_velocity_top(grid,layerThickness,layerThicknessEdge,normalVelocity,vertTransportVelocityTop, err)!{{{
!-----------------------------------------------------------------
!
@@ -506,13 +506,13 @@
grid !< Input: grid information
real (kind=RKIND), dimension(:,:), intent(in) :: &
- h !< Input: thickness
+ layerThickness !< Input: thickness
real (kind=RKIND), dimension(:,:), intent(in) :: &
- h_edge !< Input: h interpolated to an edge
+ layerThicknessEdge !< Input: layerThickness interpolated to an edge
real (kind=RKIND), dimension(:,:), intent(in) :: &
- u !< Input: transport
+ normalVelocity !< Input: transport
!-----------------------------------------------------------------
!
@@ -521,7 +521,7 @@
!-----------------------------------------------------------------
real (kind=RKIND), dimension(:,:), intent(out) :: &
- wTop !< Output: vertical transport at top of cell
+ vertTransportVelocityTop !< Output: vertical transport at top of cell
integer, intent(out) :: err !< Output: error flag
@@ -532,7 +532,7 @@
!-----------------------------------------------------------------
integer :: iEdge, iCell, iVertex, k, cell1, cell2, vertex1, vertex2, eoe, i, j, cov
- real (kind=RKIND) :: flux, vorticity_abs, h_vertex, workpv, rho0Inv, hSum, invAreaCell
+ real (kind=RKIND) :: flux, layerThicknessVertex, workpv, density0Inv, thicknessSum, invAreaCell
integer :: nCells, nEdges, nVertices, nVertLevels, vertexDegree
@@ -568,7 +568,7 @@
if (config_vert_coord_movement.eq.'isopycnal') then
! set vertical transport to zero in isopycnal case
- wTop=0.0
+ vertTransportVelocityTop=0.0
return
end if
@@ -582,39 +582,39 @@
do iCell=1,nCells
div_hu(:) = 0.0
div_hu_btr = 0.0
- hSum = 0.0
+ thicknessSum = 0.0
invAreaCell = 1.0 / areaCell(iCell)
do i = 1, nEdgesOnCell(iCell)
iEdge = edgesOnCell(i, iCell)
do k = 1, maxLevelEdgeBot(iEdge)
- flux = h_edge(k, iEdge) * u(k, iEdge) * dvEdge(iEdge) * edgeSignOnCell(i, iCell) * invAreaCell
+ flux = layerThicknessEdge(k, iEdge) * normalVelocity(k, iEdge) * dvEdge(iEdge) * edgeSignOnCell(i, iCell) * invAreaCell
div_hu(k) = div_hu(k) - flux
div_hu_btr = div_hu_btr - flux
end do
end do
do k = 1, maxLevelCell(iCell)
- h_tend_col(k) = - vertCoordMovementWeights(k) * h(k, iCell) * div_hu_btr
- hSum = hSum + vertCoordMovementWeights(k) * h(k, iCell)
+ h_tend_col(k) = - vertCoordMovementWeights(k) * layerThickness(k, iCell) * div_hu_btr
+ thicknessSum = thicknessSum + vertCoordMovementWeights(k) * layerThickness(k, iCell)
end do
- if(hSum > 0.0) then
- h_tend_col = h_tend_col / hSum
+ if(thicknessSum > 0.0) then
+ h_tend_col = h_tend_col / thicknessSum
end if
! Vertical transport through layer interface at top and bottom is zero.
- wTop(1,iCell) = 0.0
- wTop(maxLevelCell(iCell)+1,iCell) = 0.0
+ vertTransportVelocityTop(1,iCell) = 0.0
+ vertTransportVelocityTop(maxLevelCell(iCell)+1,iCell) = 0.0
do k=maxLevelCell(iCell),2,-1
- wTop(k,iCell) = wTop(k+1,iCell) - div_hu(k) - h_tend_col(k)
+ vertTransportVelocityTop(k,iCell) = vertTransportVelocityTop(k+1,iCell) - div_hu(k) - h_tend_col(k)
end do
end do
deallocate(div_hu, h_tend_col)
- end subroutine ocn_wtop!}}}
+ end subroutine ocn_vert_transport_velocity_top!}}}
!***********************************************************************
!
@@ -638,7 +638,7 @@
integer :: iEdge, cell1, cell2, eoe, i, j, k
integer :: nEdgesSolve
real (kind=RKIND), dimension(:), pointer :: fEdge
- real (kind=RKIND), dimension(:,:), pointer :: weightsOnEdge, u, uBcl
+ real (kind=RKIND), dimension(:,:), pointer :: weightsOnEdge, normalVelocity, normalBaroclinicVelocity
type (dm_info) :: dminfo
integer, dimension(:), pointer :: maxLevelEdgeTop, nEdgesOnEdge
@@ -646,8 +646,8 @@
call mpas_timer_start("ocn_fuperp")
- u => s % u % array
- uBcl => s % uBcl % array
+ normalVelocity => s % normalVelocity % array
+ normalBaroclinicVelocity => s % normalBaroclinicVelocity % array
weightsOnEdge => grid % weightsOnEdge % array
fEdge => grid % fEdge % array
maxLevelEdgeTop => grid % maxLevelEdgeTop % array
@@ -660,7 +660,7 @@
nEdgesSolve = grid % nEdgesSolve
!
- ! Put f*uBcl^{perp} in u as a work variable
+ ! Put f*normalBaroclinicVelocity^{perp} in u as a work variable
!
do iEdge=1,nEdgesSolve
cell1 = cellsOnEdge(1,iEdge)
@@ -668,10 +668,10 @@
do k=1,maxLevelEdgeTop(iEdge)
- u(k,iEdge) = 0.0
+ normalVelocity(k,iEdge) = 0.0
do j = 1,nEdgesOnEdge(iEdge)
eoe = edgesOnEdge(j,iEdge)
- u(k,iEdge) = u(k,iEdge) + weightsOnEdge(j,iEdge) * uBcl(k,eoe) * fEdge(eoe)
+ normalVelocity(k,iEdge) = normalVelocity(k,iEdge) + weightsOnEdge(j,iEdge) * normalBaroclinicVelocity(k,eoe) * fEdge(eoe)
end do
end do
end do
@@ -682,7 +682,7 @@
!***********************************************************************
!
-! routine ocn_filter_btr_mode_u
+! routine ocn_filter_btr_mode_vel
!
!> \brief filters barotropic mode out of the velocity variable.
!> \author Mark Petersen
@@ -692,60 +692,60 @@
!> This routine filters barotropic mode out of the velocity variable.
!
!-----------------------------------------------------------------------
- subroutine ocn_filter_btr_mode_u(s, grid)!{{{
+ subroutine ocn_filter_btr_mode_vel(s, grid)!{{{
implicit none
type (state_type), intent(inout) :: s
type (mesh_type), intent(in) :: grid
integer :: iEdge, k, nEdges
- real (kind=RKIND) :: vertSum, uhSum, hSum
- real (kind=RKIND), dimension(:,:), pointer :: h_edge, u
+ real (kind=RKIND) :: vertSum, normalThicknessFluxSum, thicknessSum
+ real (kind=RKIND), dimension(:,:), pointer :: layerThicknessEdge, normalVelocity
integer, dimension(:), pointer :: maxLevelEdgeTop
- call mpas_timer_start("ocn_filter_btr_mode_u")
+ call mpas_timer_start("ocn_filter_btr_mode_vel")
- u => s % u % array
- h_edge => s % h_edge % array
+ normalVelocity => s % normalVelocity % array
+ layerThicknessEdge => s % layerThicknessEdge % array
maxLevelEdgeTop => grid % maxLevelEdgeTop % array
nEdges = grid % nEdges
do iEdge=1,nEdges
- ! hSum is initialized outside the loop because on land boundaries
- ! maxLevelEdgeTop=0, but I want to initialize hSum with a
+ ! thicknessSum is initialized outside the loop because on land boundaries
+ ! maxLevelEdgeTop=0, but I want to initialize thicknessSum with a
! nonzero value to avoid a NaN.
- uhSum = h_edge(1,iEdge) * u(1,iEdge)
- hSum = h_edge(1,iEdge)
+ normalThicknessFluxSum = layerThicknessEdge(1,iEdge) * normalVelocity(1,iEdge)
+ thicknessSum = layerThicknessEdge(1,iEdge)
do k=2,maxLevelEdgeTop(iEdge)
- uhSum = uhSum + h_edge(k,iEdge) * u(k,iEdge)
- hSum = hSum + h_edge(k,iEdge)
+ normalThicknessFluxSum = normalThicknessFluxSum + layerThicknessEdge(k,iEdge) * normalVelocity(k,iEdge)
+ thicknessSum = thicknessSum + layerThicknessEdge(k,iEdge)
enddo
- vertSum = uhSum/hSum
+ vertSum = normalThicknessFluxSum/thicknessSum
do k=1,maxLevelEdgeTop(iEdge)
- u(k,iEdge) = u(k,iEdge) - vertSum
+ normalVelocity(k,iEdge) = normalVelocity(k,iEdge) - vertSum
enddo
enddo ! iEdge
- call mpas_timer_stop("ocn_filter_btr_mode_u")
+ call mpas_timer_stop("ocn_filter_btr_mode_vel")
- end subroutine ocn_filter_btr_mode_u!}}}
+ end subroutine ocn_filter_btr_mode_vel!}}}
!***********************************************************************
!
-! routine ocn_filter_btr_mode_tend_u
+! routine ocn_filter_btr_mode_tend_vel
!
-!> \brief ocn_filters barotropic mode out of the u tendency
+!> \brief ocn_filters barotropic mode out of the velocity tendency
!> \author Mark Petersen
!> \date 23 September 2011
!> \version SVN:$Id$
!> \details
-!> This routine filters barotropic mode out of the u tendency.
+!> This routine filters barotropic mode out of the velocity tendency.
!
!-----------------------------------------------------------------------
- subroutine ocn_filter_btr_mode_tend_u(tend, s, grid)!{{{
+ subroutine ocn_filter_btr_mode_tend_vel(tend, s, grid)!{{{
implicit none
type (tend_type), intent(inout) :: tend
@@ -753,40 +753,40 @@
type (mesh_type), intent(in) :: grid
integer :: iEdge, k, nEdges
- real (kind=RKIND) :: vertSum, uhSum, hSum
- real (kind=RKIND), dimension(:,:), pointer :: h_edge, tend_u
+ real (kind=RKIND) :: vertSum, normalThicknessFluxSum, thicknessSum
+ real (kind=RKIND), dimension(:,:), pointer :: layerThicknessEdge, tend_normalVelocity
integer, dimension(:), pointer :: maxLevelEdgeTop
- call mpas_timer_start("ocn_filter_btr_mode_tend_u")
+ call mpas_timer_start("ocn_filter_btr_mode_tend_vel")
- tend_u => tend % u % array
- h_edge => s % h_edge % array
+ tend_normalVelocity => tend % normalVelocity % array
+ layerThicknessEdge => s % layerThicknessEdge % array
maxLevelEdgeTop => grid % maxLevelEdgeTop % array
nEdges = grid % nEdges
do iEdge=1,nEdges
- ! hSum is initialized outside the loop because on land boundaries
- ! maxLevelEdgeTop=0, but I want to initialize hSum with a
+ ! thicknessSum is initialized outside the loop because on land boundaries
+ ! maxLevelEdgeTop=0, but I want to initialize thicknessSum with a
! nonzero value to avoid a NaN.
- uhSum = h_edge(1,iEdge) * tend_u(1,iEdge)
- hSum = h_edge(1,iEdge)
+ normalThicknessFluxSum = layerThicknessEdge(1,iEdge) * tend_normalVelocity(1,iEdge)
+ thicknessSum = layerThicknessEdge(1,iEdge)
do k=2,maxLevelEdgeTop(iEdge)
- uhSum = uhSum + h_edge(k,iEdge) * tend_u(k,iEdge)
- hSum = hSum + h_edge(k,iEdge)
+ normalThicknessFluxSum = normalThicknessFluxSum + layerThicknessEdge(k,iEdge) * tend_normalVelocity(k,iEdge)
+ thicknessSum = thicknessSum + layerThicknessEdge(k,iEdge)
enddo
- vertSum = uhSum/hSum
+ vertSum = normalThicknessFluxSum/thicknessSum
do k=1,maxLevelEdgeTop(iEdge)
- tend_u(k,iEdge) = tend_u(k,iEdge) - vertSum
+ tend_normalVelocity(k,iEdge) = tend_normalVelocity(k,iEdge) - vertSum
enddo
enddo ! iEdge
- call mpas_timer_stop("ocn_filter_btr_mode_tend_u")
+ call mpas_timer_stop("ocn_filter_btr_mode_tend_vel")
- end subroutine ocn_filter_btr_mode_tend_u!}}}
+ end subroutine ocn_filter_btr_mode_tend_vel!}}}
!***********************************************************************
!
Modified: trunk/mpas/src/core_ocean/mpas_ocn_equation_of_state.F
===================================================================
--- trunk/mpas/src/core_ocean/mpas_ocn_equation_of_state.F        2013-04-18 16:43:19 UTC (rev 2769)
+++ trunk/mpas/src/core_ocean/mpas_ocn_equation_of_state.F        2013-04-18 18:02:53 UTC (rev 2770)
@@ -36,7 +36,7 @@
!
!--------------------------------------------------------------------
- public :: ocn_equation_of_state_rho, &
+ public :: ocn_equation_of_state_density, &
ocn_equation_of_state_init
!--------------------------------------------------------------------
@@ -66,7 +66,7 @@
!
!-----------------------------------------------------------------------
- subroutine ocn_equation_of_state_rho(s, grid, k_displaced, displacement_type, err)!{{{
+ subroutine ocn_equation_of_state_density(s, grid, k_displaced, displacement_type, err)!{{{
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! This module contains routines necessary for computing the density
! from model temperature and salinity using an equation of state.
@@ -75,11 +75,11 @@
! s - state: tracers
! k_displaced
!
- ! If k_displaced==0, state % rho is returned with no displacement
+ ! If k_displaced==0, state % density is returned with no displacement
!
- ! If k_displaced~=0,the state % rhoDisplaced is returned, and is for
+ ! If k_displaced~=0,the state % displacedDensity is returned, and is for
! a parcel adiabatically displaced from its original level to level
- ! k_displaced. When using the linear EOS, state % rhoDisplaced is
+ ! k_displaced. When using the linear EOS, state % displacedDensity is
! still filled, but depth (i.e. pressure) does not modify the output.
!
! Output: s - state: computed density
@@ -93,7 +93,7 @@
character(len=*), intent(in) :: displacement_type
integer, dimension(:), pointer :: maxLevelCell
- real (kind=RKIND), dimension(:,:), pointer :: rho
+ real (kind=RKIND), dimension(:,:), pointer :: density
real (kind=RKIND), dimension(:,:,:), pointer :: tracers
integer :: nCells, iCell, k, indexT, indexS
type (dm_info) :: dminfo
@@ -106,24 +106,24 @@
indexT = s % index_temperature
indexS = s % index_salinity
- ! Choose to fill the array rho or rhoDisplaced
+ ! Choose to fill the array density or displacedDensity
if (k_displaced == 0) then
- rho => s % rho % array
+ density => s % density % array
else
- rho => s % rhoDisplaced % array
+ density => s % displacedDensity % array
endif
if (linearEos) then
- call ocn_equation_of_state_linear_rho(grid, indexT, indexS, tracers, rho, err)
+ call ocn_equation_of_state_linear_density(grid, indexT, indexS, tracers, density, err)
elseif (jmEos) then
- call ocn_equation_of_state_jm_rho(grid, k_displaced, displacement_type, indexT, indexS, tracers, rho, err)
+ call ocn_equation_of_state_jm_density(grid, k_displaced, displacement_type, indexT, indexS, tracers, density, err)
endif
- end subroutine ocn_equation_of_state_rho!}}}
+ end subroutine ocn_equation_of_state_density!}}}
!***********************************************************************
!
Modified: trunk/mpas/src/core_ocean/mpas_ocn_equation_of_state_jm.F
===================================================================
--- trunk/mpas/src/core_ocean/mpas_ocn_equation_of_state_jm.F        2013-04-18 16:43:19 UTC (rev 2769)
+++ trunk/mpas/src/core_ocean/mpas_ocn_equation_of_state_jm.F        2013-04-18 18:02:53 UTC (rev 2770)
@@ -34,7 +34,7 @@
!
!--------------------------------------------------------------------
- public :: ocn_equation_of_state_jm_rho, &
+ public :: ocn_equation_of_state_jm_density, &
ocn_equation_of_state_jm_init
!--------------------------------------------------------------------
@@ -49,7 +49,7 @@
!***********************************************************************
!
-! routine ocn_equation_of_state_jm_rho
+! routine ocn_equation_of_state_jm_density
!
!> \brief Calls JM equation of state
!> \author Doug Jacobsen
@@ -60,7 +60,7 @@
!
!-----------------------------------------------------------------------
- subroutine ocn_equation_of_state_jm_rho(grid, k_displaced, displacement_type, indexT, indexS, tracers, rho, err)!{{{
+ subroutine ocn_equation_of_state_jm_density(grid, k_displaced, displacement_type, indexT, indexS, tracers, density, err)!{{{
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! This module contains routines necessary for computing the density
! from model temperature and salinity using an equation of state.
@@ -98,7 +98,7 @@
real (kind=RKIND), dimension(:), pointer :: &
refBottomDepth, pRefEOS
real (kind=RKIND), dimension(:,:), intent(inout) :: &
- rho
+ density
real (kind=RKIND), dimension(:,:,:), intent(in) :: tracers
integer, dimension(:), pointer :: maxLevelCell
@@ -106,7 +106,7 @@
real (kind=RKIND) :: &
TQ,SQ, &! adjusted T,S
BULK_MOD, &! Bulk modulus
- RHO_S, &! density at the surface
+ density_S, &! density at the surface
DRDT0, &! d(density)/d(temperature), for surface
DRDS0, &! d(density)/d(salinity ), for surface
DKDT, &! d(bulk modulus)/d(pot. temp.)
@@ -280,7 +280,7 @@
(uns1t2 + uns1t3*TQ + uns1t4*T2)*T2
WORK2 = SQR*(unsqt0 + unsqt1*TQ + unsqt2*T2)
- RHO_S = unt1*TQ + (unt2 + unt3*TQ + (unt4 + unt5*TQ)*T2)*T2 &
+ density_S = unt1*TQ + (unt2 + unt3*TQ + (unt4 + unt5*TQ)*T2)*T2 &
+ (uns2t0*SQ + WORK1 + WORK2)*SQ
!***
@@ -304,13 +304,13 @@
DENOMK = 1.0/(BULK_MOD - p(k))
- rho(k,iCell) = (unt0 + RHO_S)*BULK_MOD*DENOMK
+ density(k,iCell) = (unt0 + density_S)*BULK_MOD*DENOMK
end do
end do
deallocate(pRefEOS,p,p2)
- end subroutine ocn_equation_of_state_jm_rho!}}}
+ end subroutine ocn_equation_of_state_jm_density!}}}
!***********************************************************************
!
Modified: trunk/mpas/src/core_ocean/mpas_ocn_equation_of_state_linear.F
===================================================================
--- trunk/mpas/src/core_ocean/mpas_ocn_equation_of_state_linear.F        2013-04-18 16:43:19 UTC (rev 2769)
+++ trunk/mpas/src/core_ocean/mpas_ocn_equation_of_state_linear.F        2013-04-18 18:02:53 UTC (rev 2770)
@@ -33,7 +33,7 @@
!
!--------------------------------------------------------------------
- public :: ocn_equation_of_state_linear_rho, &
+ public :: ocn_equation_of_state_linear_density, &
ocn_equation_of_state_linear_init
!--------------------------------------------------------------------
@@ -48,7 +48,7 @@
!***********************************************************************
!
-! routine ocn_equation_of_state_linear_rho
+! routine ocn_equation_of_state_linear_density
!
!> \brief Calls equation of state
!> \author Doug Jacobsen
@@ -59,7 +59,7 @@
!
!-----------------------------------------------------------------------
- subroutine ocn_equation_of_state_linear_rho(grid, indexT, indexS, tracers, rho, err)!{{{
+ subroutine ocn_equation_of_state_linear_density(grid, indexT, indexS, tracers, density, err)!{{{
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! This module contains routines necessary for computing the density
! from model temperature and salinity using an equation of state.
@@ -67,8 +67,8 @@
! Input: grid - grid metadata
! s - state: tracers
! k_displaced
- ! If k_displaced<=0, state % rho is returned with no displaced
- ! If k_displaced>0,the state % rhoDisplaced is returned, and is for
+ ! If k_displaced<=0, state % density is returned with no displaced
+ ! If k_displaced>0,the state % densityDisplaced is returned, and is for
! a parcel adiabatically displaced from its original level to level
! k_displaced. This does not effect the linear EOS.
!
@@ -77,7 +77,7 @@
implicit none
type (mesh_type), intent(in) :: grid
- real (kind=RKIND), dimension(:,:), intent(inout) :: rho
+ real (kind=RKIND), dimension(:,:), intent(inout) :: density
real (kind=RKIND), dimension(:,:,:), intent(in) :: tracers
integer, intent(in) :: indexT, indexS
integer, intent(out) :: err
@@ -94,13 +94,13 @@
do iCell=1,nCells
do k=1,maxLevelCell(iCell)
! Linear equation of state
- rho(k,iCell) = config_eos_linear_rhoref &
+ density(k,iCell) = config_eos_linear_densityref &
- config_eos_linear_alpha * (tracers(indexT,k,iCell)-config_eos_linear_Tref) &
+ config_eos_linear_beta * (tracers(indexS,k,iCell)-config_eos_linear_Sref)
end do
end do
- end subroutine ocn_equation_of_state_linear_rho!}}}
+ end subroutine ocn_equation_of_state_linear_density!}}}
!***********************************************************************
!
Modified: trunk/mpas/src/core_ocean/mpas_ocn_global_diagnostics.F
===================================================================
--- trunk/mpas/src/core_ocean/mpas_ocn_global_diagnostics.F        2013-04-18 16:43:19 UTC (rev 2769)
+++ trunk/mpas/src/core_ocean/mpas_ocn_global_diagnostics.F        2013-04-18 18:02:53 UTC (rev 2770)
@@ -24,7 +24,7 @@
! timeIndex is the current time step counter
! dt is the duration of each time step
- ! Sums of variables at vertices are not weighted by thickness (since h is not known at
+ ! Sums of variables at vertices are not weighted by thickness (since layerThickness is not known at
! vertices as it is at cell centers and at edges).
implicit none
@@ -46,8 +46,8 @@
real (kind=RKIND) :: volumeCellGlobal, volumeEdgeGlobal, CFLNumberGlobal, localCFL, localSum, areaCellGlobal, areaEdgeGlobal, areaTriangleGlobal
real (kind=RKIND), dimension(:), pointer :: areaCell, dcEdge, dvEdge, areaTriangle, areaEdge
- real (kind=RKIND), dimension(:,:), pointer :: h, u, v, h_edge, vorticity, ke, Vor_edge, Vor_vertex, &
- Vor_cell, gradVor_n, gradVor_t, pressure, MontPot, wTop, rho, tracerTemp
+ real (kind=RKIND), dimension(:,:), pointer :: layerThickness, normalVelocity, tangentialVelocity, layerThicknessEdge, relativeVorticity, kineticEnergy, potentialVorticityEdge, potentialVorticityVertex, &
+ potentialVorticityCell, gradVor_n, gradVor_t, pressure, montgomeryPotential, vertTransportVelocityTop, density, tracerTemp
real (kind=RKIND), dimension(:,:,:), pointer :: tracers
real (kind=RKIND), dimension(kMaxVariables) :: sums, mins, maxes, averages, verticalSumMins, verticalSumMaxes, reductions
@@ -85,27 +85,27 @@
allocate(areaEdge(1:nEdgesSolve))
areaEdge = dcEdge(1:nEdgesSolve)*dvEdge(1:nEdgesSolve)
- h => state % h % array
- u => state % u % array
- rho => state % rho % array
+ layerThickness => state % layerThickness % array
+ normalVelocity => state % normalVelocity % array
+ density => state % density % array
tracers => state % tracers % array
- v => state % v % array
- wTop => state % wTop % array
- h_edge => state % h_edge % array
- vorticity => state % vorticity % array
- ke => state % ke % array
- Vor_edge => state % Vor_edge % array
- Vor_vertex => state % Vor_vertex % array
- Vor_cell => state % Vor_cell % array
+ tangentialVelocity => state % tangentialVelocity % array
+ vertTransportVelocityTop => state % vertTransportVelocityTop % array
+ layerThicknessEdge => state % layerThicknessEdge % array
+ relativeVorticity => state % relativeVorticity % array
+ kineticEnergy => state % kineticEnergy % array
+ potentialVorticityEdge => state % potentialVorticityEdge % array
+ potentialVorticityVertex => state % potentialVorticityVertex % array
+ potentialVorticityCell => state % potentialVorticityCell % array
gradVor_n => state % gradVor_n % array
gradVor_t => state % gradVor_t % array
- MontPot => state % MontPot % array
+ montgomeryPotential => state % montgomeryPotential % array
pressure => state % pressure % array
variableIndex = 0
- ! h
+ ! layerThickness
variableIndex = variableIndex + 1
- call ocn_compute_field_area_weighted_local_stats(dminfo, nVertLevels, nCellsSolve, areaCell(1:nCellsSolve), h(:,1:nCellsSolve), &
+ call ocn_compute_field_area_weighted_local_stats(dminfo, nVertLevels, nCellsSolve, areaCell(1:nCellsSolve), layerThickness(:,1:nCellsSolve), &
sums_tmp(variableIndex), mins_tmp(variableIndex), maxes_tmp(variableIndex), verticalSumMins_tmp(variableIndex), verticalSumMaxes_tmp(variableIndex))
sums(variableIndex) = sums(variableIndex) + sums_tmp(variableIndex)
mins(variableIndex) = min(mins(variableIndex), mins_tmp(variableIndex))
@@ -113,10 +113,10 @@
verticalSumMins(variableIndex) = min(verticalSumMins(variableIndex), verticalSumMins_tmp(variableIndex))
verticalSumMaxes(variableIndex) = max(verticalSumMaxes(variableIndex), verticalSumMaxes_tmp(variableIndex))
- ! u
+ ! normalVelocity
variableIndex = variableIndex + 1
- call ocn_compute_field_volume_weighted_local_stats(dminfo, nVertLevels, nEdgesSolve, areaEdge(1:nEdgesSolve), h_edge(:,1:nEdgesSolve), &
- u(:,1:nEdgesSolve), sums_tmp(variableIndex), mins_tmp(variableIndex), maxes_tmp(variableIndex), verticalSumMins_tmp(variableIndex), &
+ call ocn_compute_field_volume_weighted_local_stats(dminfo, nVertLevels, nEdgesSolve, areaEdge(1:nEdgesSolve), layerThicknessEdge(:,1:nEdgesSolve), &
+ normalVelocity(:,1:nEdgesSolve), sums_tmp(variableIndex), mins_tmp(variableIndex), maxes_tmp(variableIndex), verticalSumMins_tmp(variableIndex), &
verticalSumMaxes_tmp(variableIndex))
sums(variableIndex) = sums(variableIndex) + sums_tmp(variableIndex)
mins(variableIndex) = min(mins(variableIndex), mins_tmp(variableIndex))
@@ -124,10 +124,10 @@
verticalSumMins(variableIndex) = min(verticalSumMins(variableIndex), verticalSumMins_tmp(variableIndex))
verticalSumMaxes(variableIndex) = max(verticalSumMaxes(variableIndex), verticalSumMaxes_tmp(variableIndex))
- ! v
+ ! tangentialVelocity
variableIndex = variableIndex + 1
- call ocn_compute_field_volume_weighted_local_stats(dminfo, nVertLevels, nEdgesSolve, areaEdge(1:nEdgesSolve), h_edge(:,1:nEdgesSolve), &
- v(:,1:nEdgesSolve), sums_tmp(variableIndex), mins_tmp(variableIndex), maxes_tmp(variableIndex), verticalSumMins_tmp(variableIndex), &
+ call ocn_compute_field_volume_weighted_local_stats(dminfo, nVertLevels, nEdgesSolve, areaEdge(1:nEdgesSolve), layerThicknessEdge(:,1:nEdgesSolve), &
+ tangentialVelocity(:,1:nEdgesSolve), sums_tmp(variableIndex), mins_tmp(variableIndex), maxes_tmp(variableIndex), verticalSumMins_tmp(variableIndex), &
verticalSumMaxes_tmp(variableIndex))
sums(variableIndex) = sums(variableIndex) + sums_tmp(variableIndex)
mins(variableIndex) = min(mins(variableIndex), mins_tmp(variableIndex))
@@ -135,9 +135,9 @@
verticalSumMins(variableIndex) = min(verticalSumMins(variableIndex), verticalSumMins_tmp(variableIndex))
verticalSumMaxes(variableIndex) = max(verticalSumMaxes(variableIndex), verticalSumMaxes_tmp(variableIndex))
- ! h_edge
+ ! layerThicknessEdge
variableIndex = variableIndex + 1
- call ocn_compute_field_area_weighted_local_stats(dminfo, nVertLevels, nEdgesSolve, areaEdge(1:nEdgesSolve), h_edge(:,1:nEdgesSolve), &
+ call ocn_compute_field_area_weighted_local_stats(dminfo, nVertLevels, nEdgesSolve, areaEdge(1:nEdgesSolve), layerThicknessEdge(:,1:nEdgesSolve), &
sums_tmp(variableIndex), mins_tmp(variableIndex), maxes_tmp(variableIndex), verticalSumMins_tmp(variableIndex), verticalSumMaxes_tmp(variableIndex))
sums(variableIndex) = sums(variableIndex) + sums_tmp(variableIndex)
mins(variableIndex) = min(mins(variableIndex), mins_tmp(variableIndex))
@@ -145,9 +145,9 @@
verticalSumMins(variableIndex) = min(verticalSumMins(variableIndex), verticalSumMins_tmp(variableIndex))
verticalSumMaxes(variableIndex) = max(verticalSumMaxes(variableIndex), verticalSumMaxes_tmp(variableIndex))
- ! vorticity
+ ! relativeVorticity
variableIndex = variableIndex + 1
- call ocn_compute_field_local_stats(dminfo, nVertLevels, nVerticesSolve, vorticity(:,1:nVerticesSolve), &
+ call ocn_compute_field_local_stats(dminfo, nVertLevels, nVerticesSolve, relativeVorticity(:,1:nVerticesSolve), &
sums_tmp(variableIndex), mins_tmp(variableIndex), maxes_tmp(variableIndex), verticalSumMins_tmp(variableIndex), verticalSumMaxes_tmp(variableIndex))
sums(variableIndex) = sums(variableIndex) + sums_tmp(variableIndex)
mins(variableIndex) = min(mins(variableIndex), mins_tmp(variableIndex))
@@ -155,9 +155,9 @@
verticalSumMins(variableIndex) = min(verticalSumMins(variableIndex), verticalSumMins_tmp(variableIndex))
verticalSumMaxes(variableIndex) = max(verticalSumMaxes(variableIndex), verticalSumMaxes_tmp(variableIndex))
- ! vorticity**2
+ ! relativeVorticity**2
allocate(enstrophy(nVertLevels,nVerticesSolve))
- enstrophy(:,:)=vorticity(:,1:nVerticesSolve)**2
+ enstrophy(:,:)=relativeVorticity(:,1:nVerticesSolve)**2
variableIndex = variableIndex + 1
call ocn_compute_field_area_weighted_local_stats(dminfo, nVertLevels, nVerticesSolve, areaTriangle(1:nVerticesSolve), &
enstrophy(:,:), sums_tmp(variableIndex), mins_tmp(variableIndex), maxes_tmp(variableIndex), &
@@ -169,10 +169,10 @@
verticalSumMins(variableIndex) = min(verticalSumMins(variableIndex), verticalSumMins_tmp(variableIndex))
verticalSumMaxes(variableIndex) = max(verticalSumMaxes(variableIndex), verticalSumMaxes_tmp(variableIndex))
- ! ke
+ ! kineticEnergy
variableIndex = variableIndex + 1
- call ocn_compute_field_volume_weighted_local_stats(dminfo, nVertLevels, nCellsSolve, areaCell(1:nCellsSolve), h(:,1:nCellsSolve), &
- ke(:,1:nCellsSolve), sums_tmp(variableIndex), mins_tmp(variableIndex), maxes_tmp(variableIndex), verticalSumMins_tmp(variableIndex), &
+ call ocn_compute_field_volume_weighted_local_stats(dminfo, nVertLevels, nCellsSolve, areaCell(1:nCellsSolve), layerThickness(:,1:nCellsSolve), &
+ kineticEnergy(:,1:nCellsSolve), sums_tmp(variableIndex), mins_tmp(variableIndex), maxes_tmp(variableIndex), verticalSumMins_tmp(variableIndex), &
verticalSumMaxes_tmp(variableIndex))
sums(variableIndex) = sums(variableIndex) + sums_tmp(variableIndex)
mins(variableIndex) = min(mins(variableIndex), mins_tmp(variableIndex))
@@ -180,10 +180,10 @@
verticalSumMins(variableIndex) = min(verticalSumMins(variableIndex), verticalSumMins_tmp(variableIndex))
verticalSumMaxes(variableIndex) = max(verticalSumMaxes(variableIndex), verticalSumMaxes_tmp(variableIndex))
- ! Vor_edge
+ ! potentialVorticityEdge
variableIndex = variableIndex + 1
- call ocn_compute_field_volume_weighted_local_stats(dminfo, nVertLevels, nEdgesSolve, areaEdge(1:nEdgesSolve), h_edge(:,1:nEdgesSolve), &
- Vor_edge(:,1:nEdgesSolve), sums_tmp(variableIndex), mins_tmp(variableIndex), maxes_tmp(variableIndex), verticalSumMins_tmp(variableIndex), &
+ call ocn_compute_field_volume_weighted_local_stats(dminfo, nVertLevels, nEdgesSolve, areaEdge(1:nEdgesSolve), layerThicknessEdge(:,1:nEdgesSolve), &
+ potentialVorticityEdge(:,1:nEdgesSolve), sums_tmp(variableIndex), mins_tmp(variableIndex), maxes_tmp(variableIndex), verticalSumMins_tmp(variableIndex), &
verticalSumMaxes_tmp(variableIndex))
sums(variableIndex) = sums(variableIndex) + sums_tmp(variableIndex)
mins(variableIndex) = min(mins(variableIndex), mins_tmp(variableIndex))
@@ -191,10 +191,10 @@
verticalSumMins(variableIndex) = min(verticalSumMins(variableIndex), verticalSumMins_tmp(variableIndex))
verticalSumMaxes(variableIndex) = max(verticalSumMaxes(variableIndex), verticalSumMaxes_tmp(variableIndex))
- ! Vor_vertex
+ ! potentialVorticityVertex
variableIndex = variableIndex + 1
call ocn_compute_field_area_weighted_local_stats(dminfo, nVertLevels, nVerticesSolve, areaTriangle(1:nVerticesSolve), &
- Vor_vertex(:,1:nVerticesSolve), sums_tmp(variableIndex), mins_tmp(variableIndex), maxes_tmp(variableIndex), &
+ potentialVorticityVertex(:,1:nVerticesSolve), sums_tmp(variableIndex), mins_tmp(variableIndex), maxes_tmp(variableIndex), &
verticalSumMins_tmp(variableIndex), verticalSumMaxes_tmp(variableIndex))
sums(variableIndex) = sums(variableIndex) + sums_tmp(variableIndex)
mins(variableIndex) = min(mins(variableIndex), mins_tmp(variableIndex))
@@ -202,10 +202,10 @@
verticalSumMins(variableIndex) = min(verticalSumMins(variableIndex), verticalSumMins_tmp(variableIndex))
verticalSumMaxes(variableIndex) = max(verticalSumMaxes(variableIndex), verticalSumMaxes_tmp(variableIndex))
- ! Vor_cell
+ ! potentialVorticityCell
variableIndex = variableIndex + 1
- call ocn_compute_field_volume_weighted_local_stats(dminfo, nVertLevels, nCellsSolve, areaCell(1:nCellsSolve), h(:,1:nCellsSolve), &
- Vor_cell(:,1:nCellsSolve), sums_tmp(variableIndex), mins_tmp(variableIndex), maxes_tmp(variableIndex), verticalSumMins_tmp(variableIndex), &
+ call ocn_compute_field_volume_weighted_local_stats(dminfo, nVertLevels, nCellsSolve, areaCell(1:nCellsSolve), layerThickness(:,1:nCellsSolve), &
+ potentialVorticityCell(:,1:nCellsSolve), sums_tmp(variableIndex), mins_tmp(variableIndex), maxes_tmp(variableIndex), verticalSumMins_tmp(variableIndex), &
verticalSumMaxes_tmp(variableIndex))
sums(variableIndex) = sums(variableIndex) + sums_tmp(variableIndex)
mins(variableIndex) = min(mins(variableIndex), mins_tmp(variableIndex))
@@ -215,7 +215,7 @@
! gradVor_n
variableIndex = variableIndex + 1
- call ocn_compute_field_volume_weighted_local_stats(dminfo, nVertLevels, nEdgesSolve, areaEdge(1:nEdgesSolve), h_edge(:,1:nEdgesSolve), &
+ call ocn_compute_field_volume_weighted_local_stats(dminfo, nVertLevels, nEdgesSolve, areaEdge(1:nEdgesSolve), layerThicknessEdge(:,1:nEdgesSolve), &
gradVor_n(:,1:nEdgesSolve), sums_tmp(variableIndex), mins_tmp(variableIndex), maxes_tmp(variableIndex), verticalSumMins_tmp(variableIndex), &
verticalSumMaxes_tmp(variableIndex))
sums(variableIndex) = sums(variableIndex) + sums_tmp(variableIndex)
@@ -226,7 +226,7 @@
! gradVor_t
variableIndex = variableIndex + 1
- call ocn_compute_field_volume_weighted_local_stats(dminfo, nVertLevels, nEdgesSolve, areaEdge(1:nEdgesSolve), h_edge(:,1:nEdgesSolve), &
+ call ocn_compute_field_volume_weighted_local_stats(dminfo, nVertLevels, nEdgesSolve, areaEdge(1:nEdgesSolve), layerThicknessEdge(:,1:nEdgesSolve), &
gradVor_t(:,1:nEdgesSolve), sums_tmp(variableIndex), mins_tmp(variableIndex), maxes_tmp(variableIndex), verticalSumMins_tmp(variableIndex), &
verticalSumMaxes_tmp(variableIndex))
sums(variableIndex) = sums(variableIndex) + sums_tmp(variableIndex)
@@ -237,7 +237,7 @@
! pressure
variableIndex = variableIndex + 1
- call ocn_compute_field_volume_weighted_local_stats(dminfo, nVertLevels, nCellsSolve, areaCell(1:nCellsSolve), h(:,1:nCellsSolve), &
+ call ocn_compute_field_volume_weighted_local_stats(dminfo, nVertLevels, nCellsSolve, areaCell(1:nCellsSolve), layerThickness(:,1:nCellsSolve), &
pressure(:,1:nCellsSolve), sums_tmp(variableIndex), mins_tmp(variableIndex), maxes_tmp(variableIndex), verticalSumMins_tmp(variableIndex), &
verticalSumMaxes_tmp(variableIndex))
sums(variableIndex) = sums(variableIndex) + sums_tmp(variableIndex)
@@ -246,10 +246,10 @@
verticalSumMins(variableIndex) = min(verticalSumMins(variableIndex), verticalSumMins_tmp(variableIndex))
verticalSumMaxes(variableIndex) = max(verticalSumMaxes(variableIndex), verticalSumMaxes_tmp(variableIndex))
- ! MontPot
+ ! montgomeryPotential
variableIndex = variableIndex + 1
- call ocn_compute_field_volume_weighted_local_stats(dminfo, nVertLevels, nCellsSolve, areaCell(1:nCellsSolve), h(:,1:nCellsSolve), &
- MontPot(:,1:nCellsSolve), sums_tmp(variableIndex), mins_tmp(variableIndex), maxes_tmp(variableIndex), verticalSumMins_tmp(variableIndex), &
+ call ocn_compute_field_volume_weighted_local_stats(dminfo, nVertLevels, nCellsSolve, areaCell(1:nCellsSolve), layerThickness(:,1:nCellsSolve), &
+ montgomeryPotential(:,1:nCellsSolve), sums_tmp(variableIndex), mins_tmp(variableIndex), maxes_tmp(variableIndex), verticalSumMins_tmp(variableIndex), &
verticalSumMaxes_tmp(variableIndex))
sums(variableIndex) = sums(variableIndex) + sums_tmp(variableIndex)
mins(variableIndex) = min(mins(variableIndex), mins_tmp(variableIndex))
@@ -257,10 +257,10 @@
verticalSumMins(variableIndex) = min(verticalSumMins(variableIndex), verticalSumMins_tmp(variableIndex))
verticalSumMaxes(variableIndex) = max(verticalSumMaxes(variableIndex), verticalSumMaxes_tmp(variableIndex))
- ! wTop vertical velocity
+ ! vertTransportVelocityTop vertical velocity
variableIndex = variableIndex + 1
- call ocn_compute_field_volume_weighted_local_stats(dminfo, nVertLevels+1, nCellsSolve, areaCell(1:nCellsSolve), h(:,1:nCellsSolve), &
- wTop(:,1:nCellsSolve), sums_tmp(variableIndex), mins_tmp(variableIndex), maxes_tmp(variableIndex), verticalSumMins_tmp(variableIndex), &
+ call ocn_compute_field_volume_weighted_local_stats(dminfo, nVertLevels+1, nCellsSolve, areaCell(1:nCellsSolve), layerThickness(:,1:nCellsSolve), &
+ vertTransportVelocityTop(:,1:nCellsSolve), sums_tmp(variableIndex), mins_tmp(variableIndex), maxes_tmp(variableIndex), verticalSumMins_tmp(variableIndex), &
verticalSumMaxes_tmp(variableIndex))
sums(variableIndex) = sums(variableIndex) + sums_tmp(variableIndex)
mins(variableIndex) = min(mins(variableIndex), mins_tmp(variableIndex))
@@ -273,7 +273,7 @@
do iTracer=1,num_tracers
variableIndex = variableIndex + 1
tracerTemp = Tracers(iTracer,:,1:nCellsSolve)
- call ocn_compute_field_volume_weighted_local_stats(dminfo, nVertLevels, nCellsSolve, areaCell(1:nCellsSolve), h(:,1:nCellsSolve), &
+ call ocn_compute_field_volume_weighted_local_stats(dminfo, nVertLevels, nCellsSolve, areaCell(1:nCellsSolve), layerThickness(:,1:nCellsSolve), &
tracerTemp, sums_tmp(variableIndex), mins_tmp(variableIndex), maxes_tmp(variableIndex), verticalSumMins_tmp(variableIndex), &
verticalSumMaxes_tmp(variableIndex))
sums(variableIndex) = sums(variableIndex) + sums_tmp(variableIndex)
@@ -309,7 +309,7 @@
localCFL = 0.0
do elementIndex = 1,nEdgesSolve
- localCFL = max(localCFL, maxval(dt*u(:,elementIndex)/dcEdge(elementIndex)))
+ localCFL = max(localCFL, maxval(dt*normalVelocity(:,elementIndex)/dcEdge(elementIndex)))
end do
nMaxes = nMaxes + 1
maxes(nMaxes) = localCFL
@@ -350,43 +350,43 @@
volumeEdgeGlobal = sums(4)
! compute the averages (slightly different depending on how the sum was computed)
variableIndex = 0
- ! h
+ ! layerThickness
variableIndex = variableIndex + 1
averages(variableIndex) = sums(variableIndex)/(areaCellGlobal*nVertLevels)
- ! u
+ ! normalVelocity
variableIndex = variableIndex + 1
averages(variableIndex) = sums(variableIndex)/volumeEdgeGlobal
- ! v
+ ! tangentialVelocity
variableIndex = variableIndex + 1
averages(variableIndex) = sums(variableIndex)/volumeEdgeGlobal
- ! h_edge
+ ! layerThicknessEdge
variableIndex = variableIndex + 1
averages(variableIndex) = sums(variableIndex)/(areaEdgeGlobal*nVertLevels)
- ! vorticity
+ ! relativeVorticity
variableIndex = variableIndex + 1
averages(variableIndex) = sums(variableIndex)/(nVerticesGlobal*nVertLevels)
- ! vorticity
+ ! relativeVorticity
variableIndex = variableIndex + 1
averages(variableIndex) = sums(variableIndex)/(areaTriangleGlobal*nVertLevels)
- ! ke
+ ! kineticEnergy
variableIndex = variableIndex + 1
averages(variableIndex) = sums(variableIndex)/volumeCellGlobal
- ! Vor_edge
+ ! potentialVorticityEdge
variableIndex = variableIndex + 1
averages(variableIndex) = sums(variableIndex)/volumeEdgeGlobal
- ! Vor_vertex
+ ! potentialVorticityVertex
variableIndex = variableIndex + 1
averages(variableIndex) = sums(variableIndex)/(areaTriangleGlobal*nVertLevels)
- ! Vor_cell
+ ! potentialVorticityCell
variableIndex = variableIndex + 1
averages(variableIndex) = sums(variableIndex)/volumeCellGlobal
@@ -402,11 +402,11 @@
variableIndex = variableIndex + 1
averages(variableIndex) = sums(variableIndex)/volumeCellGlobal
- ! MontPot
+ ! montgomeryPotential
variableIndex = variableIndex + 1
averages(variableIndex) = sums(variableIndex)/volumeCellGlobal
- ! wTop vertical velocity
+ ! vertTransportVelocityTop vertical velocity
variableIndex = variableIndex + 1
averages(variableIndex) = sums(variableIndex)/volumeCellGlobal
@@ -544,7 +544,7 @@
end subroutine ocn_compute_field_thickness_weighted_local_stats!}}}
- subroutine ocn_compute_field_volume_weighted_local_stats(dminfo, nVertLevels, nElements, areas, h, field, &!{{{
+ subroutine ocn_compute_field_volume_weighted_local_stats(dminfo, nVertLevels, nElements, areas, layerThickness, field, &!{{{
localSum, localMin, localMax, localVertSumMin, localVertSumMax)
implicit none
@@ -552,7 +552,7 @@
type (dm_info), intent(in) :: dminfo
integer, intent(in) :: nVertLevels, nElements
real (kind=RKIND), dimension(nElements), intent(in) :: areas
- real (kind=RKIND), dimension(nVertLevels, nElements), intent(in) :: h
+ real (kind=RKIND), dimension(nVertLevels, nElements), intent(in) :: layerThickness
real (kind=RKIND), dimension(nVertLevels, nElements), intent(in) :: field
real (kind=RKIND), intent(out) :: localSum, localMin, localMax, localVertSumMin, &
localVertSumMax
@@ -563,13 +563,13 @@
localSum = 0.0
do elementIndex = 1, nElements
- localSum = localSum + areas(elementIndex) * sum(h(:,elementIndex)*field(:,elementIndex))
+ localSum = localSum + areas(elementIndex) * sum(layerThickness(:,elementIndex)*field(:,elementIndex))
end do
localMin = minval(field)
localMax = maxval(field)
- localVertSumMin = minval(sum(h*field,1))
- localVertSumMax = maxval(sum(h*field,1))
+ localVertSumMin = minval(sum(layerThickness*field,1))
+ localVertSumMax = maxval(sum(layerThickness*field,1))
end subroutine ocn_compute_field_volume_weighted_local_stats!}}}
Modified: trunk/mpas/src/core_ocean/mpas_ocn_gm.F
===================================================================
--- trunk/mpas/src/core_ocean/mpas_ocn_gm.F        2013-04-18 16:43:19 UTC (rev 2769)
+++ trunk/mpas/src/core_ocean/mpas_ocn_gm.F        2013-04-18 18:02:53 UTC (rev 2770)
@@ -35,13 +35,13 @@
type(state_type), intent(inout) :: s
type(mesh_type), intent(in) :: grid
- real(kind=RKIND), dimension(:,:), pointer :: uBolusGM, hEddyFlux, h_edge
+ real(kind=RKIND), dimension(:,:), pointer :: uBolusGM, hEddyFlux, layerThicknessEdge
integer, dimension(:), pointer :: maxLevelEdgeTop
integer :: k, iEdge, nEdges
uBolusGM => s % uBolusGM % array
- h_edge => s % h_edge % array
+ layerThicknessEdge => s % layerThicknessEdge % array
hEddyFlux => s % hEddyFlux % array
maxLevelEdgeTop => grid % maxLevelEdgeTop % array
@@ -54,7 +54,7 @@
do iEdge = 1, nEdges
do k = 1, maxLevelEdgeTop(iEdge)
- uBolusGM(k,iEdge) = hEddyFlux(k,iEdge)/h_edge(k,iEdge)
+ uBolusGM(k,iEdge) = hEddyFlux(k,iEdge)/layerThicknessEdge(k,iEdge)
end do
end do
@@ -72,14 +72,14 @@
type(state_type), intent(inout) :: s
type(mesh_type), intent(in) :: grid
- real(kind=RKIND), dimension(:,:), pointer :: hEddyFlux, h
+ real(kind=RKIND), dimension(:,:), pointer :: hEddyFlux, layerThickness
real(kind=RKIND), dimension(:), pointer :: dcEdge
integer, dimension(:,:), pointer :: cellsOnEdge
integer, dimension(:), pointer :: maxLevelEdgeTop
integer :: k, cell1, cell2, iEdge, nEdges
hEddyFlux => s % hEddyFlux % array
- h => s % h % array
+ layerThickness => s % layerThickness % array
dcEdge => grid % dcEdge % array
cellsOnEdge => grid % cellsOnEdge % array
@@ -94,7 +94,7 @@
cell1 = cellsOnEdge(1,iEdge)
cell2 = cellsOnEdge(2,iEdge)
do k=1,maxLevelEdgeTop(iEdge)
- hEddyFlux(k,iEdge) = -config_h_kappa * (h(k,cell2) - h(k,cell1)) / dcEdge(iEdge)
+ hEddyFlux(k,iEdge) = -config_h_kappa * (layerThickness(k,cell2) - layerThickness(k,cell1)) / dcEdge(iEdge)
end do
end do
else
Modified: trunk/mpas/src/core_ocean/mpas_ocn_monthly_forcing.F
===================================================================
--- trunk/mpas/src/core_ocean/mpas_ocn_monthly_forcing.F        2013-04-18 16:43:19 UTC (rev 2769)
+++ trunk/mpas/src/core_ocean/mpas_ocn_monthly_forcing.F        2013-04-18 18:02:53 UTC (rev 2770)
@@ -102,7 +102,7 @@
real (kind=RKIND), dimension(:,:), pointer :: windStressMonthly
real (kind=RKIND), dimension(:), pointer :: temperatureRestore
real (kind=RKIND), dimension(:), pointer :: salinityRestore
- real (kind=RKIND), dimension(:,:), pointer :: u_src
+ real (kind=RKIND), dimension(:,:), pointer :: normalVelocityForcing
integer :: iCell, iEdge, nCells, nEdges, nMonths, k
integer :: iMonth, iMonthP1, iDayInMonth, ierr
real (kind=RKIND) :: data, dataP1, weight, weightP1
@@ -117,7 +117,7 @@
temperatureRestore => grid % temperatureRestore % array
salinityRestore => grid % salinityRestore % array
- u_src => grid % u_src % array
+ normalVelocityForcing => grid % normalVelocityForcing % array
temperatureRestoreMonthly => grid % temperatureRestoreMonthly % array
salinityRestoreMonthly => grid % salinityRestoreMonthly % array
@@ -146,7 +146,7 @@
! Interpolate between iMonth and iMonthP1 records, using iDayInMonth
data = windStressMonthly(iMonth,iEdge)
dataP1 = windStressMonthly(iMonthP1,iEdge)
- u_src(1,iEdge) = data * weight + dataP1 * weightP1
+ normalVelocityForcing(1,iEdge) = data * weight + dataP1 * weightP1
end do
!--------------------------------------------------------------------
Modified: trunk/mpas/src/core_ocean/mpas_ocn_mpas_core.F
===================================================================
--- trunk/mpas/src/core_ocean/mpas_ocn_mpas_core.F        2013-04-18 16:43:19 UTC (rev 2769)
+++ trunk/mpas/src/core_ocean/mpas_ocn_mpas_core.F        2013-04-18 18:02:53 UTC (rev 2770)
@@ -22,8 +22,6 @@
use ocn_vel_forcing
use ocn_vel_coriolis
- use ocn_tracer_hadv
- use ocn_tracer_vadv
use ocn_tracer_hmix
use ocn_gm
use ocn_restoring
@@ -85,10 +83,6 @@
call ocn_vel_forcing_init(err_tmp)
err = ior(err, err_tmp)
- call ocn_tracer_hadv_init(err_tmp)
- err = ior(err, err_tmp)
- call ocn_tracer_vadv_init(err_tmp)
- err = ior(err, err_tmp)
call ocn_tracer_hmix_init(err_tmp)
err = ior(err, err_tmp)
call ocn_restoring_init(err_tmp)
@@ -273,29 +267,29 @@
call ocn_diagnostic_solve(dt, block % state % time_levs(1) % state, mesh)
call mpas_timer_stop("diagnostic solve", initDiagSolveTimer)
- ! Compute velocity transport, used in advection terms of h and tracer tendency
+ ! Compute velocity transport, used in advection terms of layerThickness and tracer tendency
block % state % time_levs(1) % state % uTransport % array(:,:) &
- = block % state % time_levs(1) % state % u % array(:,:) &
+ = block % state % time_levs(1) % state % normalVelocity % array(:,:) &
+ block % state % time_levs(1) % state % uBolusGM % array(:,:)
call ocn_compute_mesh_scaling(mesh)
call mpas_rbf_interp_initialize(mesh)
call mpas_init_reconstruct(mesh)
- call mpas_reconstruct(mesh, block % state % time_levs(1) % state % u % array, &
- block % state % time_levs(1) % state % uReconstructX % array, &
- block % state % time_levs(1) % state % uReconstructY % array, &
- block % state % time_levs(1) % state % uReconstructZ % array, &
- block % state % time_levs(1) % state % uReconstructZonal % array, &
- block % state % time_levs(1) % state % uReconstructMeridional % array &
+ call mpas_reconstruct(mesh, block % state % time_levs(1) % state % normalVelocity % array, &
+ block % state % time_levs(1) % state % normalVelocityX % array, &
+ block % state % time_levs(1) % state % normalVelocityY % array, &
+ block % state % time_levs(1) % state % normalVelocityZ % array, &
+ block % state % time_levs(1) % state % normalVelocityZonal % array, &
+ block % state % time_levs(1) % state % normalVelocityMeridional % array &
)
- call mpas_reconstruct(mesh, mesh % u_src % array, &
- block % state % time_levs(1) % state % uSrcReconstructX % array, &
- block % state % time_levs(1) % state % uSrcReconstructY % array, &
- block % state % time_levs(1) % state % uSrcReconstructZ % array, &
- block % state % time_levs(1) % state % uSrcReconstructZonal % array, &
- block % state % time_levs(1) % state % uSrcReconstructMeridional % array &
+ call mpas_reconstruct(mesh, mesh % normalVelocityForcing % array, &
+ block % state % time_levs(1) % state % normalVelocityForcingReconstructX % array, &
+ block % state % time_levs(1) % state % normalVelocityForcingReconstructY % array, &
+ block % state % time_levs(1) % state % normalVelocityForcingReconstructZ % array, &
+ block % state % time_levs(1) % state % normalVelocityForcingReconstructZonal % array, &
+ block % state % time_levs(1) % state % normalVelocityForcingReconstructMeridional % array &
)
! initialize velocities and tracers on land to be zero.
@@ -303,11 +297,11 @@
block % mesh % areaCell % array(block % mesh % nCells+1) = -1.0e34
do iEdge=1,block % mesh % nEdges
- block % state % time_levs(1) % state % u % array( &
+ block % state % time_levs(1) % state % normalVelocity % array( &
block % mesh % maxLevelEdgeTop % array(iEdge)+1 &
:block % mesh % maxLevelEdgeBot % array(iEdge), iEdge) = 0.0
- block % state % time_levs(1) % state % u % array( &
+ block % state % time_levs(1) % state % normalVelocity % array( &
block % mesh % maxLevelEdgeBot % array(iEdge)+1: &
block % mesh % nVertLevels,iEdge) = 0.0
end do
@@ -552,14 +546,14 @@
type (block_type), pointer :: block
integer :: iTracer, cell, cell1, cell2
- real (kind=RKIND) :: uhSum, hSum, hEdge1, zMidPBC
+ real (kind=RKIND) :: normalThicknessFluxSum, thicknessSum, hEdge1, zMidPBC
integer, dimension(:), pointer :: maxLevelCell
real (kind=RKIND), dimension(:), pointer :: refBottomDepth, &
refBottomDepthTopOfCell, vertCoordMovementWeights, hZLevel, bottomDepth
real (kind=RKIND), dimension(:), allocatable :: minBottomDepth, minBottomDepthMid, zMidZLevel
- real (kind=RKIND), dimension(:,:), pointer :: h
+ real (kind=RKIND), dimension(:,:), pointer :: layerThickness
real (kind=RKIND), dimension(:,:,:), pointer :: tracers
integer :: nVertLevels
logical :: consistentSSH
@@ -568,8 +562,8 @@
block => domain % blocklist
do while (associated(block))
- h => block % state % time_levs(1) % state % h % array
- tracers => block % state % time_levs(1) % state % tracers % array
+ layerThickness => block % state % time_levs(1) % state % layerThickness % array
+ tracers => block % state % time_levs(1) % state % tracers % array
refBottomDepth => block % mesh % refBottomDepth % array
refBottomDepthTopOfCell => block % mesh % refBottomDepthTopOfCell % array
bottomDepth => block % mesh % bottomDepth % array
@@ -620,7 +614,7 @@
if (config_alter_ICs_for_pbcs.eq.'zlevel_pbcs_on') then
write (0,'(a)') ' Altering bottomDepth to avoid very thin cells.'
- write (0,'(a)') ' Altering h and tracer initial conditions to conform with partial bottom cells.'
+ write (0,'(a)') ' Altering layerThickness and tracer initial conditions to conform with partial bottom cells.'
allocate(minBottomDepth(nVertLevels),minBottomDepthMid(nVertLevels),zMidZLevel(nVertLevels))
@@ -650,7 +644,7 @@
k = maxLevelCell(iCell)
! Alter thickness of bottom level to account for PBC
- h(k,iCell) = bottomDepth(iCell) - refBottomDepthTopOfCell(k)
+ layerThickness(k,iCell) = bottomDepth(iCell) - refBottomDepthTopOfCell(k)
! Linearly interpolate the initial T&S for new location of bottom cell for PBCs
zMidPBC = -0.5*(bottomDepth(iCell) + refBottomDepthTopOfCell(k))
@@ -688,19 +682,19 @@
consistentSSH = .true.
do iCell = 1,nCells
! Check if abs(ssh)>2m. If so, print warning.
- if (abs(sum(h(1:maxLevelCell(iCell),iCell))-bottomDepth(iCell))>2.0) then
+ if (abs(sum(layerThickness(1:maxLevelCell(iCell),iCell))-bottomDepth(iCell))>2.0) then
consistentSSH = .false.
#ifdef MPAS_DEBUG
- write (0,'(a)') ' Warning: abs(sum(h)-bottomDepth)>2m. Most likely, initial h does not match bottomDepth.'
+ write (0,'(a)') ' Warning: abs(sum(h)-bottomDepth)>2m. Most likely, initial layerThickness does not match bottomDepth.'
write (0,*) ' iCell, K=maxLevelCell(iCell), bottomDepth(iCell),sum(h),bottomDepth,hZLevel(K),h(K): ', &
- iCell, maxLevelCell(iCell), bottomDepth(iCell),sum(h(1:maxLevelCell(iCell),iCell)),bottomDepth(iCell), &
- hZLevel(maxLevelCell(iCell)), h(maxLevelCell(iCell),iCell)
+ iCell, maxLevelCell(iCell), bottomDepth(iCell),sum(layerThickness(1:maxLevelCell(iCell),iCell)),bottomDepth(iCell), &
+ hZLevel(maxLevelCell(iCell)), layerThickness(maxLevelCell(iCell),iCell)
#endif
endif
enddo
if (.not. consistentSSH) then
- write(0,*) 'Warning: SSH is not consistent. Most likely, initial h does not match bottomDepth.'
+ write(0,*) 'Warning: SSH is not consistent. Most likely, initial layerThickness does not match bottomDepth.'
end if
endif
@@ -739,33 +733,33 @@
type (block_type), pointer :: block
integer :: iTracer, cell, cell1, cell2
- real (kind=RKIND) :: uhSum, hSum, hEdge1
+ real (kind=RKIND) :: normalThicknessFluxSum, layerThicknessSum, layerThicknessEdge1
real (kind=RKIND), dimension(:), pointer :: refBottomDepth
- real (kind=RKIND), dimension(:,:), pointer :: h
+ real (kind=RKIND), dimension(:,:), pointer :: layerThickness
integer :: nVertLevels
! Initialize z-level grid variables from h, read in from input file.
block => domain % blocklist
do while (associated(block))
- h => block % state % time_levs(1) % state % h % array
+ layerThickness => block % state % time_levs(1) % state % layerThickness % array
refBottomDepth => block % mesh % refBottomDepth % array
nVertLevels = block % mesh % nVertLevels
! Compute barotropic velocity at first timestep
! This is only done upon start-up.
if (trim(config_time_integrator) == 'unsplit_explicit') then
- block % state % time_levs(1) % state % uBtr % array(:) = 0.0
+ block % state % time_levs(1) % state % normalBarotropicVelocity % array(:) = 0.0
- block % state % time_levs(1) % state % uBcl % array(:,:) &
- = block % state % time_levs(1) % state % u % array(:,:)
+ block % state % time_levs(1) % state % normalBaroclinicVelocity % array(:,:) &
+ = block % state % time_levs(1) % state % normalVelocity % array(:,:)
elseif (trim(config_time_integrator) == 'split_explicit') then
if (config_filter_btr_mode) then
do iCell=1,block % mesh % nCells
- block % state % time_levs(1) % state % h % array(1,iCell) &
+ block % state % time_levs(1) % state % layerThickness % array(1,iCell) &
= block % mesh % refBottomDepth % array(1)
enddo
endif
@@ -774,53 +768,53 @@
cell1 = block % mesh % cellsOnEdge % array(1,iEdge)
cell2 = block % mesh % cellsOnEdge % array(2,iEdge)
- ! uBtr = sum(u)/sum(h) on each column
+ ! normalBarotropicVelocity = sum(u)/sum(h) on each column
! ocn_diagnostic_solve has not yet been called, so compute hEdge
! just for this edge.
- ! hSum is initialized outside the loop because on land boundaries
- ! maxLevelEdgeTop=0, but I want to initialize hSum with a
+ ! thicknessSum is initialized outside the loop because on land boundaries
+ ! maxLevelEdgeTop=0, but I want to initialize thicknessSum with a
! nonzero value to avoid a NaN.
- hEdge1 = 0.5*( &
- block % state % time_levs(1) % state % h % array(1,cell1) &
- + block % state % time_levs(1) % state % h % array(1,cell2) )
- uhSum = hEdge1*block % state % time_levs(1) % state % u % array(1,iEdge)
- hSum = hEdge1
+ layerThicknessEdge1 = 0.5*( &
+ block % state % time_levs(1) % state % layerThickness % array(1,cell1) &
+ + block % state % time_levs(1) % state % layerThickness % array(1,cell2) )
+ normalThicknessFluxSum = layerThicknessEdge1*block % state % time_levs(1) % state % normalVelocity % array(1,iEdge)
+ layerThicknessSum = layerThicknessEdge1
do k=2,block % mesh % maxLevelEdgeTop % array(iEdge)
! ocn_diagnostic_solve has not yet been called, so compute hEdge
! just for this edge.
- hEdge1 = 0.5*( &
- block % state % time_levs(1) % state % h % array(k,cell1) &
- + block % state % time_levs(1) % state % h % array(k,cell2) )
+ layerThicknessEdge1 = 0.5*( &
+ block % state % time_levs(1) % state % layerThickness % array(k,cell1) &
+ + block % state % time_levs(1) % state % layerThickness % array(k,cell2) )
- uhSum = uhSum &
- + hEdge1*block % state % time_levs(1) % state % u % array(k,iEdge)
- hSum = hSum + hEdge1
+ normalThicknessFluxSum = normalThicknessFluxSum &
+ + layerThicknessEdge1*block % state % time_levs(1) % state % normalVelocity % array(k,iEdge)
+ layerThicknessSum = layerThicknessSum + layerThicknessEdge1
enddo
- block % state % time_levs(1) % state % uBtr % array(iEdge) = uhSum/hsum
+ block % state % time_levs(1) % state % normalBarotropicVelocity % array(iEdge) = normalThicknessFluxSum/layerThicknessSum
- ! uBcl(k,iEdge) = u(k,iEdge) - uBtr(iEdge)
+ ! normalBaroclinicVelocity(k,iEdge) = normalVelocity(k,iEdge) - normalBarotropicVelocity(iEdge)
do k=1,block % mesh % maxLevelEdgeTop % array(iEdge)
- block % state % time_levs(1) % state % uBcl % array(k,iEdge) &
- = block % state % time_levs(1) % state % u % array(k,iEdge) &
- - block % state % time_levs(1) % state % uBtr % array(iEdge)
+ block % state % time_levs(1) % state % normalBaroclinicVelocity % array(k,iEdge) &
+ = block % state % time_levs(1) % state % normalVelocity % array(k,iEdge) &
+ - block % state % time_levs(1) % state % normalBarotropicVelocity % array(iEdge)
enddo
- ! uBcl=0, u=0 on land cells
+ ! normalBaroclinicVelocity=0, normalVelocity=0 on land cells
do k=block % mesh % maxLevelEdgeTop % array(iEdge)+1, block % mesh % nVertLevels
- block % state % time_levs(1) % state % uBcl % array(k,iEdge) = 0.0
- block % state % time_levs(1) % state % u % array(k,iEdge) = 0.0
+ block % state % time_levs(1) % state % normalBaroclinicVelocity % array(k,iEdge) = 0.0
+ block % state % time_levs(1) % state % normalVelocity % array(k,iEdge) = 0.0
enddo
enddo
if (config_filter_btr_mode) then
- ! filter uBtr out of initial condition
- block % state % time_levs(1) % state % u % array(:,:) &
- = block % state % time_levs(1) % state % uBcl % array(:,:)
+ ! filter normalBarotropicVelocity out of initial condition
+ block % state % time_levs(1) % state % normalVelocity % array(:,:) &
+ = block % state % time_levs(1) % state % normalBaroclinicVelocity % array(:,:)
- block % state % time_levs(1) % state % uBtr % array(:) = 0.0
+ block % state % time_levs(1) % state % normalBarotropicVelocity % array(:) = 0.0
endif
endif
Modified: trunk/mpas/src/core_ocean/mpas_ocn_restoring.F
===================================================================
--- trunk/mpas/src/core_ocean/mpas_ocn_restoring.F        2013-04-18 16:43:19 UTC (rev 2769)
+++ trunk/mpas/src/core_ocean/mpas_ocn_restoring.F        2013-04-18 18:02:53 UTC (rev 2770)
@@ -65,7 +65,7 @@
!
!-----------------------------------------------------------------------
- subroutine ocn_restoring_tend(grid, h, indexT, indexS, tracers, tend, err)!{{{
+ subroutine ocn_restoring_tend(grid, layerThickness, indexT, indexS, tracers, tend, err)!{{{
!-----------------------------------------------------------------
!
@@ -74,7 +74,7 @@
!-----------------------------------------------------------------
real (kind=RKIND), dimension(:,:), intent(in) :: &
- h !< Input: thickness
+ layerThickness !< Input: thickness
type (mesh_type), intent(in) :: &
grid !< Input: grid information
@@ -127,8 +127,8 @@
k = 1 ! restoring only in top layer
do iCell=1,nCellsSolve
- tend(indexT, k, iCell) = tend(indexT, k, iCell) - h(k,iCell)*(tracers(indexT, k, iCell) - temperatureRestore(iCell)) * invTemp
- tend(indexS, k, iCell) = tend(indexS, k, iCell) - h(k,iCell)*(tracers(indexS, k, iCell) - salinityRestore(iCell)) * invSalinity
+ tend(indexT, k, iCell) = tend(indexT, k, iCell) - layerThickness(k,iCell)*(tracers(indexT, k, iCell) - temperatureRestore(iCell)) * invTemp
+ tend(indexS, k, iCell) = tend(indexS, k, iCell) - layerThickness(k,iCell)*(tracers(indexS, k, iCell) - salinityRestore(iCell)) * invSalinity
! write(6,10) iCell, tracers(indexT, k, iCell), &
! temperatureRestore(iCell), tracers(indexT, k, iCell), &
Modified: trunk/mpas/src/core_ocean/mpas_ocn_tendency.F
===================================================================
--- trunk/mpas/src/core_ocean/mpas_ocn_tendency.F        2013-04-18 16:43:19 UTC (rev 2769)
+++ trunk/mpas/src/core_ocean/mpas_ocn_tendency.F        2013-04-18 18:02:53 UTC (rev 2770)
@@ -31,8 +31,6 @@
use ocn_vel_forcing
use ocn_vmix
- use ocn_tracer_hadv
- use ocn_tracer_vadv
use ocn_tracer_hmix
use ocn_restoring
@@ -56,8 +54,8 @@
!
!--------------------------------------------------------------------
- public :: ocn_tend_h, &
- ocn_tend_u, &
+ public :: ocn_tend_thick, &
+ ocn_tend_vel, &
ocn_tend_tracer, &
ocn_tendency_init
@@ -73,7 +71,7 @@
!***********************************************************************
!
-! routine ocn_tend_h
+! routine ocn_tend_thick
!
!> \brief Computes thickness tendency
!> \author Doug Jacobsen
@@ -84,31 +82,31 @@
!
!-----------------------------------------------------------------------
- subroutine ocn_tend_h(tend, s, grid)!{{{
+ subroutine ocn_tend_thick(tend, s, grid)!{{{
implicit none
type (tend_type), intent(inout) :: tend !< Input/Output: Tendency structure
type (state_type), intent(in) :: s !< Input: State information
type (mesh_type), intent(in) :: grid !< Input: Grid information
- real (kind=RKIND), dimension(:,:), pointer :: h_edge, wTop, tend_h, uTransport
+ real (kind=RKIND), dimension(:,:), pointer :: layerThicknessEdge, vertTransportVelocityTop, tend_layerThickness, uTransport
integer :: err
- call mpas_timer_start("ocn_tend_h")
+ call mpas_timer_start("ocn_tend_thick")
uTransport => s % uTransport % array
- wTop => s % wTop % array
- h_edge => s % h_edge % array
+ vertTransportVelocityTop => s % vertTransportVelocityTop % array
+ layerThicknessEdge => s % layerThicknessEdge % array
- tend_h => tend % h % array
+ tend_layerThickness => tend % layerThickness % array
!
! height tendency: start accumulating tendency terms
!
- tend_h = 0.0
+ tend_layerThickness = 0.0
- if(config_disable_h_all_tend) return
+ if(config_disable_thick_all_tend) return
!
! height tendency: horizontal advection term -</font>
<font color="gray">abla\cdot ( hu)
@@ -119,23 +117,23 @@
! QC Comment (3/15/12): need to make sure that uTranport is the right
! transport velocity here.
call mpas_timer_start("hadv", .false., thickHadvTimer)
- call ocn_thick_hadv_tend(grid, uTransport, h_edge, tend_h, err)
+ call ocn_thick_hadv_tend(grid, uTransport, layerThicknessEdge, tend_layerThickness, err)
call mpas_timer_stop("hadv", thickHadvTimer)
!
! height tendency: vertical advection term -d/dz(hw)
!
call mpas_timer_start("vadv", .false., thickVadvTimer)
- call ocn_thick_vadv_tend(grid, wtop, tend_h, err)
+ call ocn_thick_vadv_tend(grid, vertTransportVelocityTop, tend_layerThickness, err)
call mpas_timer_stop("vadv", thickVadvTimer)
- call mpas_timer_stop("ocn_tend_h")
+ call mpas_timer_stop("ocn_tend_thick")
- end subroutine ocn_tend_h!}}}
+ end subroutine ocn_tend_thick!}}}
!***********************************************************************
!
-! routine ocn_tend_u
+! routine ocn_tend_vel
!
!> \brief Computes velocity tendency
!> \author Doug Jacobsen
@@ -146,7 +144,7 @@
!
!-----------------------------------------------------------------------
- subroutine ocn_tend_u(tend, s, d, grid)!{{{
+ subroutine ocn_tend_vel(tend, s, d, grid)!{{{
implicit none
type (tend_type), intent(inout) :: tend !< Input/Output: Tendency structure
@@ -155,55 +153,55 @@
type (mesh_type), intent(in) :: grid !< Input: Grid information
real (kind=RKIND), dimension(:,:), pointer :: &
- h_edge, h, u, rho, zMid, pressure, &
- tend_u, circulation, vorticity, viscosity, ke, ke_edge, Vor_edge, &
- MontPot, wTop, divergence, vertViscTopOfEdge
+ layerThicknessEdge, h, normalVelocity, density, zMid, pressure, &
+ tend_normalVelocity, circulation, relativeVorticity, viscosity, kineticEnergy, kineticEnergyEdge, potentialVorticityEdge, &
+ montgomeryPotential, vertTransportVelocityTop, divergence, vertViscTopOfEdge
- real (kind=RKIND), dimension(:,:), pointer :: u_src
+ real (kind=RKIND), dimension(:,:), pointer :: normalVelocityForcing
integer :: err
- call mpas_timer_start("ocn_tend_u")
+ call mpas_timer_start("ocn_tend_vel")
- u => s % u % array
- rho => s % rho % array
- wTop => s % wTop % array
+ normalVelocity => s % normalVelocity % array
+ density => s % density % array
+ vertTransportVelocityTop => s % vertTransportVelocityTop % array
zMid => s % zMid % array
- h_edge => s % h_edge % array
+ layerThicknessEdge => s % layerThicknessEdge % array
viscosity => s % viscosity % array
- vorticity => s % vorticity % array
+ relativeVorticity => s % relativeVorticity % array
divergence => s % divergence % array
- ke => s % ke % array
- ke_edge => s % ke_edge % array
- Vor_edge => s % Vor_edge % array
- MontPot => s % MontPot % array
+ kineticEnergy => s % kineticEnergy % array
+ kineticEnergyEdge => s % kineticEnergyEdge % array
+ potentialVorticityEdge => s % potentialVorticityEdge % array
+ montgomeryPotential => s % montgomeryPotential % array
pressure => s % pressure % array
vertViscTopOfEdge => d % vertViscTopOfEdge % array
- tend_u => tend % u % array
+ tend_normalVelocity => tend % normalVelocity % array
- u_src => grid % u_src % array
+ normalVelocityForcing => grid % normalVelocityForcing % array
!
! velocity tendency: start accumulating tendency terms
!
- tend_u(:,:) = 0.0
+ tend_normalVelocity(:,:) = 0.0
- if(config_disable_u_all_tend) return
+ if(config_disable_vel_all_tend) return
!
! velocity tendency: nonlinear Coriolis term and grad of kinetic energy
!
call mpas_timer_start("coriolis", .false., velCorTimer)
- call ocn_vel_coriolis_tend(grid, Vor_edge, h_edge, u, ke, tend_u, err)
+ call ocn_vel_coriolis_tend(grid, potentialVorticityEdge, layerThicknessEdge, normalVelocity, kineticEnergy, tend_normalVelocity, err)
call mpas_timer_stop("coriolis", velCorTimer)
!
! velocity tendency: vertical advection term -w du/dz
!
call mpas_timer_start("vadv", .false., velVadvTimer)
- call ocn_vel_vadv_tend(grid, u, h_edge, wtop, tend_u, err)
+ call ocn_vel_vadv_tend(grid, normalVelocity, layerThicknessEdge, vertTransportVelocityTop, tend_normalVelocity, err)
call mpas_timer_stop("vadv", velVadvTimer)
!
@@ -211,19 +209,19 @@
!
call mpas_timer_start("pressure grad", .false., velPgradTimer)
if (config_pressure_gradient_type.eq.'MontgomeryPotential') then
- call ocn_vel_pressure_grad_tend(grid, MontPot, zMid, rho, tend_u, err)
+ call ocn_vel_pressure_grad_tend(grid, montgomeryPotential, zMid, density, tend_normalVelocity, err)
else
- call ocn_vel_pressure_grad_tend(grid, pressure, zMid, rho, tend_u, err)
+ call ocn_vel_pressure_grad_tend(grid, pressure, zMid, density, tend_normalVelocity, err)
end if
call mpas_timer_stop("pressure grad", velPgradTimer)
!
! velocity tendency: del2 dissipation, </font>
<font color="black">u_2 </font>
<font color="red">abla^2 u
- ! computed as </font>
<font color="black">u( </font>
<font color="black">abla divergence + k \times </font>
<font color="blue">abla vorticity )
+ ! computed as </font>
<font color="black">u( </font>
<font color="black">abla divergence + k \times </font>
<font color="gray">abla relativeVorticity )
! strictly only valid for config_mom_del2 == constant
!
call mpas_timer_start("hmix", .false., velHmixTimer)
- call ocn_vel_hmix_tend(grid, divergence, vorticity, viscosity, tend_u, err)
+ call ocn_vel_hmix_tend(grid, divergence, relativeVorticity, viscosity, tend_normalVelocity, err)
call mpas_timer_stop("hmix", velHmixTimer)
!
@@ -231,15 +229,15 @@
!
call mpas_timer_start("forcings", .false., velForceTimer)
- call ocn_vel_forcing_tend(grid, u, u_src, ke_edge, h_edge, tend_u, err)
+ call ocn_vel_forcing_tend(grid, normalVelocity, normalVelocityForcing, kineticEnergyEdge, layerThicknessEdge, tend_normalVelocity, err)
call mpas_timer_stop("forcings", velForceTimer)
!
! velocity tendency: vertical mixing d/dz( nu_v du/dz))
!
- call mpas_timer_stop("ocn_tend_u")
+ call mpas_timer_stop("ocn_tend_vel")
- end subroutine ocn_tend_u!}}}
+ end subroutine ocn_tend_vel!}}}
!***********************************************************************
!
@@ -263,7 +261,7 @@
real (kind=RKIND), intent(in) :: dt !< Input: Time step
real (kind=RKIND), dimension(:,:), pointer :: &
- uTransport, h,wTop, h_edge, vertDiffTopOfCell, tend_h, uh
+ uTransport, layerThickness,vertTransportVelocityTop, layerThicknessEdge, vertDiffTopOfCell, tend_layerThickness, normalThicknessFlux
real (kind=RKIND), dimension(:,:,:), pointer :: &
tracers, tend_tr
@@ -272,14 +270,14 @@
call mpas_timer_start("ocn_tend_tracer")
uTransport => s % uTransport % array
- h => s % h % array
- wTop => s % wTop % array
+ layerThickness => s % layerThickness % array
+ vertTransportVelocityTop => s % vertTransportVelocityTop % array
tracers => s % tracers % array
- h_edge => s % h_edge % array
+ layerThicknessEdge => s % layerThicknessEdge % array
vertDiffTopOfCell => d % vertDiffTopOfCell % array
tend_tr => tend % tracers % array
- tend_h => tend % h % array
+ tend_layerThickness => tend % layerThickness % array
!
! initialize tracer tendency (RHS of tracer equation) to zero.
@@ -288,30 +286,30 @@
if(config_disable_tr_all_tend) return
- allocate(uh(grid % nVertLevels, grid % nEdges+1))
+ allocate(normalThicknessFlux(grid % nVertLevels, grid % nEdges+1))
!
! QC Comment (3/15/12): need to make sure that uTransport is the right
! transport velocity for the tracer.
do iEdge = 1, grid % nEdges
do k = 1, grid % nVertLevels
- uh(k, iEdge) = uTransport(k, iEdge) * h_edge(k, iEdge)
+ normalThicknessFlux(k, iEdge) = uTransport(k, iEdge) * layerThicknessEdge(k, iEdge)
end do
end do
!
- ! tracer tendency: horizontal advection term -div( h \phi u)
+ ! tracer tendency: horizontal advection term -div( layerThickness \phi u)
!
! Monotonoic Advection, or standard advection
call mpas_timer_start("adv", .false., tracerHadvTimer)
- call mpas_ocn_tracer_advection_tend(tracers, uh, wTop, h, h, dt, grid, tend_h, tend_tr)
+ call mpas_ocn_tracer_advection_tend(tracers, normalThicknessFlux, vertTransportVelocityTop, layerThickness, layerThickness, dt, grid, tend_layerThickness, tend_tr)
call mpas_timer_stop("adv", tracerHadvTimer)
!
! tracer tendency: del2 horizontal tracer diffusion, div(h \kappa_2 </font>
<font color="gray">abla \phi)
!
call mpas_timer_start("hmix", .false., tracerHmixTimer)
- call ocn_tracer_hmix_tend(grid, h_edge, tracers, tend_tr, err)
+ call ocn_tracer_hmix_tend(grid, layerThicknessEdge, tracers, tend_tr, err)
call mpas_timer_stop("hmix", tracerHmixTimer)
!
@@ -319,13 +317,13 @@
!
call mpas_timer_start("restoring", .false., tracerRestoringTimer)
- call ocn_restoring_tend(grid, h, s%index_temperature, s%index_salinity, tracers, tend_tr, err)
+ call ocn_restoring_tend(grid, layerThickness, s%index_temperature, s%index_salinity, tracers, tend_tr, err)
call mpas_timer_stop("restoring", tracerRestoringTimer)
call mpas_timer_stop("ocn_tend_tracer")
- deallocate(uh)
+ deallocate(normalThicknessFlux)
end subroutine ocn_tend_tracer!}}}
Modified: trunk/mpas/src/core_ocean/mpas_ocn_thick_hadv.F
===================================================================
--- trunk/mpas/src/core_ocean/mpas_ocn_thick_hadv.F        2013-04-18 16:43:19 UTC (rev 2769)
+++ trunk/mpas/src/core_ocean/mpas_ocn_thick_hadv.F        2013-04-18 18:02:53 UTC (rev 2770)
@@ -62,7 +62,7 @@
!
!-----------------------------------------------------------------------
- subroutine ocn_thick_hadv_tend(grid, u, h_edge, tend, err)!{{{
+ subroutine ocn_thick_hadv_tend(grid, normalVelocity, layerThicknessEdge, tend, err)!{{{
!-----------------------------------------------------------------
!
@@ -71,10 +71,10 @@
!-----------------------------------------------------------------
real (kind=RKIND), dimension(:,:), intent(in) :: &
- u !< Input: velocity
+ normalVelocity !< Input: velocity
real (kind=RKIND), dimension(:,:), intent(in) :: &
- h_edge !< Input: thickness at edge
+ layerThicknessEdge !< Input: thickness at edge
type (mesh_type), intent(in) :: &
grid !< Input: grid information
@@ -142,7 +142,7 @@
do i = 1, nEdgesOnCell(iCell)
iEdge = edgesOnCell(i, iCell)
do k = 1, maxLevelEdgeBot(iEdge)
- flux = u(k, iEdge) * dvEdge(iEdge) * h_edge(k, iEdge)
+ flux = normalVelocity(k, iEdge) * dvEdge(iEdge) * layerThicknessEdge(k, iEdge)
tend(k, iCell) = tend(k, iCell) + edgeSignOnCell(i, iCell) * flux * invAreaCell
end do
end do
@@ -180,7 +180,7 @@
thickHadvOn = .true.
- if(config_disable_h_hadv) thickHadvOn = .false.
+ if(config_disable_thick_hadv) thickHadvOn = .false.
err = 0
Modified: trunk/mpas/src/core_ocean/mpas_ocn_thick_vadv.F
===================================================================
--- trunk/mpas/src/core_ocean/mpas_ocn_thick_vadv.F        2013-04-18 16:43:19 UTC (rev 2769)
+++ trunk/mpas/src/core_ocean/mpas_ocn_thick_vadv.F        2013-04-18 18:02:53 UTC (rev 2770)
@@ -62,7 +62,7 @@
!
!-----------------------------------------------------------------------
- subroutine ocn_thick_vadv_tend(grid, wTop, tend, err)!{{{
+ subroutine ocn_thick_vadv_tend(grid, vertTransportVelocityTop, tend, err)!{{{
!-----------------------------------------------------------------
!
@@ -71,7 +71,7 @@
!-----------------------------------------------------------------
real (kind=RKIND), dimension(:,:), intent(in) :: &
- wTop !< Input: vertical velocity on top layer
+ vertTransportVelocityTop !< Input: vertical velocity on top layer
type (mesh_type), intent(in) :: &
grid !< Input: grid information
@@ -121,7 +121,7 @@
do iCell=1,nCells
do k=1,maxLevelCell(iCell)
- tend(k,iCell) = tend(k,iCell) + wTop(k+1,iCell) - wTop(k,iCell)
+ tend(k,iCell) = tend(k,iCell) + vertTransportVelocityTop(k+1,iCell) - vertTransportVelocityTop(k,iCell)
end do
end do
@@ -157,7 +157,7 @@
thickVadvOn = .true.
- if(config_disable_h_vadv) thickVadvOn = .false.
+ if(config_disable_thick_vadv) thickVadvOn = .false.
err = 0
Modified: trunk/mpas/src/core_ocean/mpas_ocn_time_average.F
===================================================================
--- trunk/mpas/src/core_ocean/mpas_ocn_time_average.F        2013-04-18 16:43:19 UTC (rev 2769)
+++ trunk/mpas/src/core_ocean/mpas_ocn_time_average.F        2013-04-18 18:02:53 UTC (rev 2770)
@@ -11,35 +11,35 @@
subroutine ocn_time_average_init(state)!{{{
type (state_type), intent(inout) :: state
- real (kind=RKIND), pointer :: nAccumulate
+ real (kind=RKIND), pointer :: nAverage
- real (kind=RKIND), dimension(:), pointer :: acc_ssh, acc_sshVar
- real (kind=RKIND), dimension(:,:), pointer :: acc_uReconstructZonal, acc_uReconstructMeridional, acc_uReconstructZonalVar, acc_uReconstructMeridionalVar
- real (kind=RKIND), dimension(:,:), pointer :: acc_u, acc_uVar, acc_vertVelocityTop
+ real (kind=RKIND), dimension(:), pointer :: avgSSH, varSSH
+ real (kind=RKIND), dimension(:,:), pointer :: avgnormalVelocityZonal, avgnormalVelocityMeridional, varnormalVelocityZonal, varnormalVelocityMeridional
+ real (kind=RKIND), dimension(:,:), pointer :: avgNormalVelocity, varNormalVelocity, avgVertVelocityTop
- nAccumulate => state % nAccumulate % scalar
+ nAverage => state % nAverage % scalar
- acc_ssh => state % acc_ssh % array
- acc_sshVar => state % acc_sshVar % array
- acc_uReconstructZonal => state % acc_uReconstructZonal % array
- acc_uReconstructMeridional => state % acc_uReconstructMeridional % array
- acc_uReconstructZonalVar => state % acc_uReconstructZonalVar % array
- acc_uReconstructMeridionalVar => state % acc_uReconstructMeridionalVar % array
- acc_u => state % acc_u % array
- acc_uVar => state % acc_uVar % array
- acc_vertVelocityTop => state % acc_vertVelocityTop % array
+ avgSSH => state % avgSSH % array
+ varSSH => state % varSSH % array
+ avgnormalVelocityZonal => state % avgnormalVelocityZonal % array
+ avgnormalVelocityMeridional => state % avgnormalVelocityMeridional % array
+ varnormalVelocityZonal => state % varnormalVelocityZonal % array
+ varnormalVelocityMeridional => state % varnormalVelocityMeridional % array
+ avgNormalVelocity => state % avgNormalVelocity % array
+ varNormalVelocity => state % varNormalVelocity % array
+ avgVertVelocityTop => state % avgVertVelocityTop % array
- nAccumulate = 0
+ nAverage = 0
- acc_ssh = 0.0
- acc_sshVar = 0.0
- acc_uReconstructZonal = 0.0
- acc_uReconstructMeridional = 0.0
- acc_uReconstructZonalVar = 0.0
- acc_uReconstructMeridionalVar = 0.0
- acc_u = 0.0
- acc_uVar = 0.0
- acc_vertVelocityTop = 0.0
+ avgSSH = 0.0
+ varSSH = 0.0
+ avgnormalVelocityZonal = 0.0
+ avgnormalVelocityMeridional = 0.0
+ varnormalVelocityZonal = 0.0
+ varnormalVelocityMeridional = 0.0
+ avgNormalVelocity = 0.0
+ varNormalVelocity = 0.0
+ avgVertVelocityTop = 0.0
end subroutine ocn_time_average_init!}}}
@@ -47,92 +47,92 @@
type (state_type), intent(inout) :: state
type (state_type), intent(in) :: old_state
- real (kind=RKIND), pointer :: nAccumulate, old_nAccumulate
+ real (kind=RKIND), pointer :: nAverage, old_nAverage
real (kind=RKIND), dimension(:), pointer :: ssh
- real (kind=RKIND), dimension(:,:), pointer :: uReconstructZonal, uReconstructMeridional, u, vertVelocityTop
+ real (kind=RKIND), dimension(:,:), pointer :: normalVelocityZonal, normalVelocityMeridional, normalVelocity, vertVelocityTop
- real (kind=RKIND), dimension(:,:), pointer :: acc_u, acc_uVar, acc_vertVelocityTop
- real (kind=RKIND), dimension(:,:), pointer :: acc_uReconstructZonal, acc_uReconstructMeridional, acc_uReconstructZonalVar, acc_uReconstructMeridionalVar
- real (kind=RKIND), dimension(:), pointer :: acc_ssh, acc_sshVar
+ real (kind=RKIND), dimension(:,:), pointer :: avgNormalVelocity, varNormalVelocity, avgVertVelocityTop
+ real (kind=RKIND), dimension(:,:), pointer :: avgnormalVelocityZonal, avgnormalVelocityMeridional, varnormalVelocityZonal, varnormalVelocityMeridional
+ real (kind=RKIND), dimension(:), pointer :: avgSSH, varSSH
- real (kind=RKIND), dimension(:,:), pointer :: old_acc_u, old_acc_uVar, old_acc_vertVelocityTop
- real (kind=RKIND), dimension(:,:), pointer :: old_acc_uReconstructZonal, old_acc_uReconstructMeridional, old_acc_uReconstructZonalVar, old_acc_uReconstructMeridionalVar
- real (kind=RKIND), dimension(:), pointer :: old_acc_ssh, old_acc_sshVar
+ real (kind=RKIND), dimension(:,:), pointer :: old_avgNormalVelocity, old_varNormalVelocity, old_avgVertVelocityTop
+ real (kind=RKIND), dimension(:,:), pointer :: old_avgnormalVelocityZonal, old_avgnormalVelocityMeridional, old_varnormalVelocityZonal, old_varnormalVelocityMeridional
+ real (kind=RKIND), dimension(:), pointer :: old_avgSSH, old_varSSH
- old_nAccumulate => old_state % nAccumulate % scalar
- nAccumulate => state % nAccumulate % scalar
+ old_nAverage => old_state % nAverage % scalar
+ nAverage => state % nAverage % scalar
ssh => state % ssh % array
- uReconstructZonal => state % uReconstructZonal % array
- uReconstructMeridional => state % uReconstructMeridional % array
- u => state % u % array
+ normalVelocityZonal => state % normalVelocityZonal % array
+ normalVelocityMeridional => state % normalVelocityMeridional % array
+ normalVelocity => state % normalVelocity % array
vertVelocityTop => state % vertVelocityTop % array
- acc_ssh => state % acc_ssh % array
- acc_sshVar => state % acc_sshVar % array
- acc_uReconstructZonal => state % acc_uReconstructZonal % array
- acc_uReconstructMeridional => state % acc_uReconstructMeridional % array
- acc_uReconstructZonalVar => state % acc_uReconstructZonalVar % array
- acc_uReconstructMeridionalVar => state % acc_uReconstructMeridionalVar % array
- acc_u => state % acc_u % array
- acc_uVar => state % acc_uVar % array
- acc_vertVelocityTop => state % acc_vertVelocityTop % array
+ avgSSH => state % avgSSH % array
+ varSSH => state % varSSH % array
+ avgnormalVelocityZonal => state % avgnormalVelocityZonal % array
+ avgnormalVelocityMeridional => state % avgnormalVelocityMeridional % array
+ varnormalVelocityZonal => state % varnormalVelocityZonal % array
+ varnormalVelocityMeridional => state % varnormalVelocityMeridional % array
+ avgNormalVelocity => state % avgNormalVelocity % array
+ varNormalVelocity => state % varNormalVelocity % array
+ avgVertVelocityTop => state % avgVertVelocityTop % array
- old_acc_ssh => old_state % acc_ssh % array
- old_acc_sshVar => old_state % acc_sshVar % array
- old_acc_uReconstructZonal => old_state % acc_uReconstructZonal % array
- old_acc_uReconstructMeridional => old_state % acc_uReconstructMeridional % array
- old_acc_uReconstructZonalVar => old_state % acc_uReconstructZonalVar % array
- old_acc_uReconstructMeridionalVar => old_state % acc_uReconstructMeridionalVar % array
- old_acc_u => old_state % acc_u % array
- old_acc_uVar => old_state % acc_uVar % array
- old_acc_vertVelocityTop => old_state % acc_vertVelocityTop % array
+ old_avgSSH => old_state % avgSSH % array
+ old_varSSH => old_state % varSSH % array
+ old_avgnormalVelocityZonal => old_state % avgnormalVelocityZonal % array
+ old_avgnormalVelocityMeridional => old_state % avgnormalVelocityMeridional % array
+ old_varnormalVelocityZonal => old_state % varnormalVelocityZonal % array
+ old_varnormalVelocityMeridional => old_state % varnormalVelocityMeridional % array
+ old_avgNormalVelocity => old_state % avgNormalVelocity % array
+ old_varNormalVelocity => old_state % varNormalVelocity % array
+ old_avgVertVelocityTop => old_state % avgVertVelocityTop % array
- acc_ssh = old_acc_ssh + ssh
- acc_sshVar = old_acc_sshVar + ssh**2
- acc_uReconstructZonal = old_acc_uReconstructZonal + uReconstructZonal
- acc_uReconstructMeridional = old_acc_uReconstructMeridional + uReconstructMeridional
- acc_uReconstructZonalVar = old_acc_uReconstructZonalVar + uReconstructZonal**2
- acc_uReconstructMeridionalVar = old_acc_uReconstructMeridionalVar + uReconstructMeridional**2
- acc_u = old_acc_u + u
- acc_uVar = old_acc_uVar + u**2
- acc_vertVelocityTop = old_acc_vertVelocityTop + vertVelocityTop
+ avgSSH = old_avgSSH + ssh
+ varSSH = old_varSSH + ssh**2
+ avgnormalVelocityZonal = old_avgnormalVelocityZonal + normalVelocityZonal
+ avgnormalVelocityMeridional = old_avgnormalVelocityMeridional + normalVelocityMeridional
+ varnormalVelocityZonal = old_varnormalVelocityZonal + normalVelocityZonal**2
+ varnormalVelocityMeridional = old_varnormalVelocityMeridional + normalVelocityMeridional**2
+ avgNormalVelocity = old_avgNormalVelocity + normalVelocity
+ varNormalVelocity = old_varNormalVelocity + normalVelocity**2
+ avgVertVelocityTop = old_avgVertVelocityTop + vertVelocityTop
- nAccumulate = old_nAccumulate + 1
+ nAverage = old_nAverage + 1
end subroutine ocn_time_average_accumulate!}}}
subroutine ocn_time_average_normalize(state)!{{{
type (state_type), intent(inout) :: state
- real (kind=RKIND), pointer :: nAccumulate
+ real (kind=RKIND), pointer :: nAverage
- real (kind=RKIND), dimension(:), pointer :: acc_ssh, acc_sshVar
- real (kind=RKIND), dimension(:,:), pointer :: acc_uReconstructZonal, acc_uReconstructMeridional, acc_uReconstructZonalVar, acc_uReconstructMeridionalVar
- real (kind=RKIND), dimension(:,:), pointer :: acc_u, acc_uVar, acc_vertVelocityTop
+ real (kind=RKIND), dimension(:), pointer :: avgSSH, varSSH
+ real (kind=RKIND), dimension(:,:), pointer :: avgnormalVelocityZonal, avgnormalVelocityMeridional, varnormalVelocityZonal, varnormalVelocityMeridional
+ real (kind=RKIND), dimension(:,:), pointer :: avgNormalVelocity, varNormalVelocity, avgVertVelocityTop
- nAccumulate => state % nAccumulate % scalar
+ nAverage => state % nAverage % scalar
- acc_ssh => state % acc_ssh % array
- acc_sshVar => state % acc_sshVar % array
- acc_uReconstructZonal => state % acc_uReconstructZonal % array
- acc_uReconstructMeridional => state % acc_uReconstructMeridional % array
- acc_uReconstructZonalVar => state % acc_uReconstructZonalVar % array
- acc_uReconstructMeridionalVar => state % acc_uReconstructMeridionalVar % array
- acc_u => state % acc_u % array
- acc_uVar => state % acc_uVar % array
- acc_vertVelocityTop => state % acc_vertVelocityTop % array
+ avgSSH => state % avgSSH % array
+ varSSH => state % varSSH % array
+ avgnormalVelocityZonal => state % avgnormalVelocityZonal % array
+ avgnormalVelocityMeridional => state % avgnormalVelocityMeridional % array
+ varnormalVelocityZonal => state % varnormalVelocityZonal % array
+ varnormalVelocityMeridional => state % varnormalVelocityMeridional % array
+ avgNormalVelocity => state % avgNormalVelocity % array
+ varNormalVelocity => state % varNormalVelocity % array
+ avgVertVelocityTop => state % avgVertVelocityTop % array
- if(nAccumulate > 0) then
- acc_ssh = acc_ssh / nAccumulate
- acc_sshVar = acc_sshVar / nAccumulate
- acc_uReconstructZonal = acc_uReconstructZonal / nAccumulate
- acc_uReconstructMeridional = acc_uReconstructMeridional / nAccumulate
- acc_uReconstructZonalVar = acc_uReconstructZonalVar / nAccumulate
- acc_uReconstructMeridionalVar = acc_uReconstructMeridionalVar / nAccumulate
- acc_u = acc_u / nAccumulate
- acc_uVar = acc_uVar / nAccumulate
- acc_vertVelocityTop = acc_vertVelocityTop / nAccumulate
+ if(nAverage > 0) then
+ avgSSH = avgSSH / nAverage
+ varSSH = varSSH / nAverage
+ avgnormalVelocityZonal = avgnormalVelocityZonal / nAverage
+ avgnormalVelocityMeridional = avgnormalVelocityMeridional / nAverage
+ varnormalVelocityZonal = varnormalVelocityZonal / nAverage
+ varnormalVelocityMeridional = varnormalVelocityMeridional / nAverage
+ avgNormalVelocity = avgNormalVelocity / nAverage
+ varNormalVelocity = varNormalVelocity / nAverage
+ avgVertVelocityTop = avgVertVelocityTop / nAverage
end if
end subroutine ocn_time_average_normalize!}}}
Modified: trunk/mpas/src/core_ocean/mpas_ocn_time_integration.F
===================================================================
--- trunk/mpas/src/core_ocean/mpas_ocn_time_integration.F        2013-04-18 16:43:19 UTC (rev 2769)
+++ trunk/mpas/src/core_ocean/mpas_ocn_time_integration.F        2013-04-18 18:02:53 UTC (rev 2770)
@@ -100,7 +100,7 @@
do while (associated(block))
block % state % time_levs(2) % state % xtime % scalar = timeStamp
- nanCheck = sum(block % state % time_levs(2) % state % u % array)
+ nanCheck = sum(block % state % time_levs(2) % state % normalVelocity % array)
if (nanCheck /= nanCheck) then
write(0,*) 'Abort: NaN detected'
Modified: trunk/mpas/src/core_ocean/mpas_ocn_time_integration_rk4.F
===================================================================
--- trunk/mpas/src/core_ocean/mpas_ocn_time_integration_rk4.F        2013-04-18 16:43:19 UTC (rev 2769)
+++ trunk/mpas/src/core_ocean/mpas_ocn_time_integration_rk4.F        2013-04-18 18:02:53 UTC (rev 2770)
@@ -87,7 +87,7 @@
integer :: nCells, nEdges, nVertLevels, num_tracers
real (kind=RKIND) :: coef
real (kind=RKIND), dimension(:,:), pointer :: &
- u, h, h_edge, vertViscTopOfEdge, vertDiffTopOfCell, ke_edge
+ u, layerThickness, layerThicknessEdge, vertViscTopOfEdge, vertDiffTopOfCell, kineticEnergyEdge
real (kind=RKIND), dimension(:,:,:), pointer :: tracers
integer, dimension(:), pointer :: &
maxLevelCell, maxLevelEdgeTop
@@ -99,17 +99,17 @@
!
! Initialize time_levs(2) with state at current time
! Initialize first RK state
- ! Couple tracers time_levs(2) with h in time-levels
+ ! Couple tracers time_levs(2) with layerThickness in time-levels
! Initialize RK weights
!
block => domain % blocklist
do while (associated(block))
- block % state % time_levs(2) % state % u % array(:,:) = block % state % time_levs(1) % state % u % array(:,:)
- block % state % time_levs(2) % state % h % array(:,:) = block % state % time_levs(1) % state % h % array(:,:)
+ block % state % time_levs(2) % state % normalVelocity % array(:,:) = block % state % time_levs(1) % state % normalVelocity % array(:,:)
+ block % state % time_levs(2) % state % layerThickness % array(:,:) = block % state % time_levs(1) % state % layerThickness % array(:,:)
do iCell=1,block % mesh % nCells ! couple tracers to h
do k=1,block % mesh % maxLevelCell % array(iCell)
block % state % time_levs(2) % state % tracers % array(:,k,iCell) = block % state % time_levs(1) % state % tracers % array(:,k,iCell) &
- * block % state % time_levs(1) % state % h % array(k,iCell)
+ * block % state % time_levs(1) % state % layerThickness % array(k,iCell)
end do
end do
@@ -137,10 +137,10 @@
! --- update halos for diagnostic variables
call mpas_timer_start("RK4-diagnostic halo update")
- call mpas_dmpar_exch_halo_field(domain % blocklist % provis % Vor_edge)
+ call mpas_dmpar_exch_halo_field(domain % blocklist % provis % potentialVorticityEdge)
if (config_mom_del4 > 0.0) then
call mpas_dmpar_exch_halo_field(domain % blocklist % provis % divergence)
- call mpas_dmpar_exch_halo_field(domain % blocklist % provis % vorticity)
+ call mpas_dmpar_exch_halo_field(domain % blocklist % provis % relativeVorticity)
end if
call mpas_timer_stop("RK4-diagnostic halo update")
@@ -149,17 +149,17 @@
call mpas_timer_start("RK4-tendency computations")
block => domain % blocklist
do while (associated(block))
- ! advection of u uses u, while advection of h and tracers use uTransport.
- call ocn_wtop(block % mesh, block % provis % h % array, block % provis % h_edge % array, &
- block % provis % u % array, block % provis % wTop % array, err)
- call ocn_tend_u(block % tend, block % provis, block % diagnostics, block % mesh)
+ ! advection of u uses u, while advection of layerThickness and tracers use uTransport.
+ call ocn_vert_transport_velocity_top(block % mesh, block % provis % layerThickness % array, block % provis % layerThicknessEdge % array, &
+ block % provis % normalVelocity % array, block % provis % vertTransportVelocityTop % array, err)
+ call ocn_tend_vel(block % tend, block % provis, block % diagnostics, block % mesh)
- call ocn_wtop(block % mesh, block % provis % h % array, block % provis % h_edge % array, &
- block % provis % uTransport % array, block % provis % wTop % array, err)
- call ocn_tend_h(block % tend, block % provis, block % mesh)
+ call ocn_vert_transport_velocity_top(block % mesh, block % provis % layerThickness % array, block % provis % layerThicknessEdge % array, &
+ block % provis % uTransport % array, block % provis % vertTransportVelocityTop % array, err)
+ call ocn_tend_thick(block % tend, block % provis, block % mesh)
if (config_filter_btr_mode) then
- call ocn_filter_btr_mode_tend_u(block % tend, block % provis, block % mesh)
+ call ocn_filter_btr_mode_tend_vel(block % tend, block % provis, block % mesh)
endif
call ocn_tend_tracer(block % tend, block % provis, block % diagnostics, block % mesh, dt)
@@ -170,8 +170,8 @@
! --- update halos for prognostic variables
call mpas_timer_start("RK4-pronostic halo update")
- call mpas_dmpar_exch_halo_field(domain % blocklist % tend % u)
- call mpas_dmpar_exch_halo_field(domain % blocklist % tend % h)
+ call mpas_dmpar_exch_halo_field(domain % blocklist % tend % normalVelocity)
+ call mpas_dmpar_exch_halo_field(domain % blocklist % tend % layerThickness)
call mpas_dmpar_exch_halo_field(domain % blocklist % tend % tracers)
call mpas_timer_stop("RK4-pronostic halo update")
@@ -182,33 +182,33 @@
block => domain % blocklist
do while (associated(block))
- block % provis % u % array(:,:) = block % state % time_levs(1) % state % u % array(:,:) &
- + rk_substep_weights(rk_step) * block % tend % u % array(:,:)
+ block % provis % normalVelocity % array(:,:) = block % state % time_levs(1) % state % normalVelocity % array(:,:) &
+ + rk_substep_weights(rk_step) * block % tend % normalVelocity % array(:,:)
- block % provis % h % array(:,:) = block % state % time_levs(1) % state % h % array(:,:) &
- + rk_substep_weights(rk_step) * block % tend % h % array(:,:)
+ block % provis % layerThickness % array(:,:) = block % state % time_levs(1) % state % layerThickness % array(:,:) &
+ + rk_substep_weights(rk_step) * block % tend % layerThickness % array(:,:)
do iCell=1,block % mesh % nCells
do k=1,block % mesh % maxLevelCell % array(iCell)
- block % provis % tracers % array(:,k,iCell) = ( block % state % time_levs(1) % state % h % array(k,iCell) * &
+ block % provis % tracers % array(:,k,iCell) = ( block % state % time_levs(1) % state % layerThickness % array(k,iCell) * &
block % state % time_levs(1) % state % tracers % array(:,k,iCell) &
+ rk_substep_weights(rk_step) * block % tend % tracers % array(:,k,iCell) &
- ) / block % provis % h % array(k,iCell)
+ ) / block % provis % layerThickness % array(k,iCell)
end do
end do
if (config_prescribe_velocity) then
- block % provis % u % array(:,:) = block % state % time_levs(1) % state % u % array(:,:)
+ block % provis % normalVelocity % array(:,:) = block % state % time_levs(1) % state % normalVelocity % array(:,:)
end if
if (config_prescribe_thickness) then
- block % provis % h % array(:,:) = block % state % time_levs(1) % state % h % array(:,:)
+ block % provis % layerThickness % array(:,:) = block % state % time_levs(1) % state % layerThickness % array(:,:)
end if
call ocn_diagnostic_solve(dt, block % provis, block % mesh)
- ! Compute velocity transport, used in advection terms of h and tracer tendency
+ ! Compute velocity transport, used in advection terms of layerThickness and tracer tendency
block % provis % uTransport % array(:,:) &
- = block % provis % u % array(:,:) &
+ = block % provis % normalVelocity % array(:,:) &
+ block % provis % uBolusGM % array(:,:)
block => block % next
@@ -221,11 +221,11 @@
call mpas_timer_start("RK4-RK4 accumulate update")
block => domain % blocklist
do while (associated(block))
- block % state % time_levs(2) % state % u % array(:,:) = block % state % time_levs(2) % state % u % array(:,:) &
- + rk_weights(rk_step) * block % tend % u % array(:,:)
+ block % state % time_levs(2) % state % normalVelocity % array(:,:) = block % state % time_levs(2) % state % normalVelocity % array(:,:) &
+ + rk_weights(rk_step) * block % tend % normalVelocity % array(:,:)
- block % state % time_levs(2) % state % h % array(:,:) = block % state % time_levs(2) % state % h % array(:,:) &
- + rk_weights(rk_step) * block % tend % h % array(:,:)
+ block % state % time_levs(2) % state % layerThickness % array(:,:) = block % state % time_levs(2) % state % layerThickness % array(:,:) &
+ + rk_weights(rk_step) * block % tend % layerThickness % array(:,:)
do iCell=1,block % mesh % nCells
do k=1,block % mesh % maxLevelCell % array(iCell)
@@ -256,7 +256,7 @@
do iCell = 1, block % mesh % nCells
do k = 1, block % mesh % maxLevelCell % array(iCell)
block % state % time_levs(2) % state % tracers % array(:, k, iCell) = block % state % time_levs(2) % state % tracers % array(:, k, iCell) &
- / block % state % time_levs(2) % state % h % array(k, iCell)
+ / block % state % time_levs(2) % state % layerThickness % array(k, iCell)
end do
end do
block => block % next
@@ -268,7 +268,7 @@
! Call ocean diagnostic solve in preparation for vertical mixing. Note
! it is called again after vertical mixing, because u and tracers change.
- ! For Richardson vertical mixing, only rho, h_edge, and ke_edge need to
+ ! For Richardson vertical mixing, only density, layerThicknessEdge, and kineticEnergyEdge need to
! be computed. For kpp, more variables may be needed. Either way, this
! could be made more efficient by only computing what is needed for the
! implicit vmix routine that follows.
@@ -283,7 +283,7 @@
! conducted on tendencies, not on the velocity and tracer fields. So this update is required to
! communicate the change due to implicit vertical mixing across the boundary.
call mpas_timer_start("RK4-implicit vert mix halos")
- call mpas_dmpar_exch_halo_field(domain % blocklist % state % time_levs(2) % state % u)
+ call mpas_dmpar_exch_halo_field(domain % blocklist % state % time_levs(2) % state % normalVelocity)
call mpas_dmpar_exch_halo_field(domain % blocklist % state % time_levs(2) % state % tracers)
call mpas_timer_stop("RK4-implicit vert mix halos")
@@ -292,34 +292,34 @@
block => domain % blocklist
do while (associated(block))
if (config_prescribe_velocity) then
- block % state % time_levs(2) % state % u % array(:,:) = block % state % time_levs(1) % state % u % array(:,:)
+ block % state % time_levs(2) % state % normalVelocity % array(:,:) = block % state % time_levs(1) % state % normalVelocity % array(:,:)
end if
if (config_prescribe_thickness) then
- block % state % time_levs(2) % state % h % array(:,:) = block % state % time_levs(1) % state % h % array(:,:)
+ block % state % time_levs(2) % state % layerThickness % array(:,:) = block % state % time_levs(1) % state % layerThickness % array(:,:)
end if
call ocn_diagnostic_solve(dt, block % state % time_levs(2) % state, block % mesh)
- ! Compute velocity transport, used in advection terms of h and tracer tendency
+ ! Compute velocity transport, used in advection terms of layerThickness and tracer tendency
block % state % time_levs(2) % state % uTransport % array(:,:) &
- = block % state % time_levs(2) % state % u % array(:,:) &
+ = block % state % time_levs(2) % state % normalVelocity % array(:,:) &
+ block % state % time_levs(2) % state % uBolusGM % array(:,:)
- call mpas_reconstruct(block % mesh, block % state % time_levs(2) % state % u % array, &
- block % state % time_levs(2) % state % uReconstructX % array, &
- block % state % time_levs(2) % state % uReconstructY % array, &
- block % state % time_levs(2) % state % uReconstructZ % array, &
- block % state % time_levs(2) % state % uReconstructZonal % array, &
- block % state % time_levs(2) % state % uReconstructMeridional % array &
+ call mpas_reconstruct(block % mesh, block % state % time_levs(2) % state % normalVelocity % array, &
+ block % state % time_levs(2) % state % normalVelocityX % array, &
+ block % state % time_levs(2) % state % normalVelocityY % array, &
+ block % state % time_levs(2) % state % normalVelocityZ % array, &
+ block % state % time_levs(2) % state % normalVelocityZonal % array, &
+ block % state % time_levs(2) % state % normalVelocityMeridional % array &
)
- call mpas_reconstruct(block % mesh, block % mesh % u_src % array, &
- block % state % time_levs(2) % state % uSrcReconstructX % array, &
- block % state % time_levs(2) % state % uSrcReconstructY % array, &
- block % state % time_levs(2) % state % uSrcReconstructZ % array, &
- block % state % time_levs(2) % state % uSrcReconstructZonal % array, &
- block % state % time_levs(2) % state % uSrcReconstructMeridional % array &
+ call mpas_reconstruct(block % mesh, block % mesh % normalVelocityForcing % array, &
+ block % state % time_levs(2) % state % normalVelocityForcingReconstructX % array, &
+ block % state % time_levs(2) % state % normalVelocityForcingReconstructY % array, &
+ block % state % time_levs(2) % state % normalVelocityForcingReconstructZ % array, &
+ block % state % time_levs(2) % state % normalVelocityForcingReconstructZonal % array, &
+ block % state % time_levs(2) % state % normalVelocityForcingReconstructMeridional % array &
)
call ocn_time_average_accumulate(block % state % time_levs(2) % state, block % state % time_levs(1) % state)
Modified: trunk/mpas/src/core_ocean/mpas_ocn_time_integration_split.F
===================================================================
--- trunk/mpas/src/core_ocean/mpas_ocn_time_integration_split.F        2013-04-18 16:43:19 UTC (rev 2769)
+++ trunk/mpas/src/core_ocean/mpas_ocn_time_integration_split.F        2013-04-18 18:02:53 UTC (rev 2770)
@@ -49,8 +49,8 @@
public :: ocn_time_integrator_split
type (timer_node), pointer :: timer_main, timer_prep, timer_bcl_vel, timer_btr_vel, timer_diagnostic_update, timer_implicit_vmix, &
- timer_halo_diagnostic, timer_halo_ubtr, timer_halo_ssh, timer_halo_f, timer_halo_h, &
- timer_halo_tracers, timer_halo_ubcl
+ timer_halo_diagnostic, timer_halo_normalBarotropicVelocity, timer_halo_ssh, timer_halo_f, timer_halo_thickness, &
+ timer_halo_tracers, timer_halo_normalBaroclinicVelocity
contains
@@ -89,11 +89,11 @@
eoe, oldBtrSubcycleTime, newBtrSubcycleTime, uPerpTime, BtrCorIter, &
n_bcl_iter(config_n_ts_iter), stage1_tend_time
type (block_type), pointer :: block
- real (kind=RKIND) :: uhSum, hSum, flux, sshEdge, hEdge1, &
- CoriolisTerm, uCorr, temp, temp_h, coef, FBtr_coeff, sshCell1, sshCell2
+ real (kind=RKIND) :: normalThicknessFluxSum, thicknessSum, flux, sshEdge, hEdge1, &
+ CoriolisTerm, uCorr, temp, temp_h, coef, barotropicThicknessFlux_coeff, sshCell1, sshCell2
integer :: num_tracers, ucorr_coef, err
real (kind=RKIND), dimension(:,:), pointer :: &
- u, h, h_edge, ke_edge, vertViscTopOfEdge, vertDiffTopOfCell
+ u, h, layerThicknessEdge, kineticEnergyEdge, vertViscTopOfEdge, vertDiffTopOfCell
real (kind=RKIND), dimension(:,:,:), pointer :: tracers
integer, dimension(:), pointer :: &
maxLevelCell, maxLevelEdgeTop
@@ -117,22 +117,22 @@
! The baroclinic velocity needs be recomputed at the beginning of a
! timestep because the implicit vertical mixing is conducted on the
- ! total u. We keep uBtr from the previous timestep.
- ! Note that uBcl may now include a barotropic component, because the
- ! weights h have changed. That is OK, because the GBtrForcing variable
+ ! total u. We keep normalBarotropicVelocity from the previous timestep.
+ ! Note that normalBaroclinicVelocity may now include a barotropic component, because the
+ ! weights layerThickness have changed. That is OK, because the barotropicForcing variable
! subtracts out the barotropic component from the baroclinic.
- block % state % time_levs(1) % state % uBcl % array(k,iEdge) &
- = block % state % time_levs(1) % state % u % array(k,iEdge) &
- - block % state % time_levs(1) % state % uBtr % array( iEdge)
+ block % state % time_levs(1) % state % normalBaroclinicVelocity % array(k,iEdge) &
+ = block % state % time_levs(1) % state % normalVelocity % array(k,iEdge) &
+ - block % state % time_levs(1) % state % normalBarotropicVelocity % array( iEdge)
- block % state % time_levs(2) % state % u % array(k,iEdge) &
- = block % state % time_levs(1) % state % u % array(k,iEdge)
+ block % state % time_levs(2) % state % normalVelocity % array(k,iEdge) &
+ = block % state % time_levs(1) % state % normalVelocity % array(k,iEdge)
- block % state % time_levs(2) % state % uBcl % array(k,iEdge) &
- = block % state % time_levs(1) % state % uBcl % array(k,iEdge)
+ block % state % time_levs(2) % state % normalBaroclinicVelocity % array(k,iEdge) &
+ = block % state % time_levs(1) % state % normalBaroclinicVelocity % array(k,iEdge)
- block % state % time_levs(2) % state % h_edge % array(k,iEdge) &
- = block % state % time_levs(1) % state % h_edge % array(k,iEdge)
+ block % state % time_levs(2) % state % layerThicknessEdge % array(k,iEdge) &
+ = block % state % time_levs(1) % state % layerThicknessEdge % array(k,iEdge)
end do
end do
@@ -143,8 +143,8 @@
do iCell=1,block % mesh % nCells
do k=1,block % mesh % maxLevelCell % array(iCell)
- block % state % time_levs(2) % state % h % array(k,iCell) &
- = block % state % time_levs(1) % state % h % array(k,iCell)
+ block % state % time_levs(2) % state % layerThickness % array(k,iCell) &
+ = block % state % time_levs(1) % state % layerThickness % array(k,iCell)
block % state % time_levs(2) % state % tracers % array(:,k,iCell) &
= block % state % time_levs(1) % state % tracers % array(:,k,iCell)
@@ -167,10 +167,10 @@
! --- update halos for diagnostic variables
call mpas_timer_start("se halo diag", .false., timer_halo_diagnostic)
- call mpas_dmpar_exch_halo_field(domain % blocklist % state % time_levs(2) % state % Vor_edge)
+ call mpas_dmpar_exch_halo_field(domain % blocklist % state % time_levs(2) % state % potentialVorticityEdge)
if (config_mom_del4 > 0.0) then
call mpas_dmpar_exch_halo_field(domain % blocklist % state % time_levs(2) % state % divergence)
- call mpas_dmpar_exch_halo_field(domain % blocklist % state % time_levs(2) % state % vorticity)
+ call mpas_dmpar_exch_halo_field(domain % blocklist % state % time_levs(2) % state % relativeVorticity)
end if
call mpas_timer_stop("se halo diag", timer_halo_diagnostic)
@@ -188,14 +188,14 @@
stage1_tend_time = min(split_explicit_step,2)
- ! compute wTop. Use u (rather than uTransport) for momentum advection.
+ ! compute vertTransportVelocityTop. Use u (rather than uTransport) for momentum advection.
! Use the most recent time level available.
- call ocn_wtop(block % mesh, block % state % time_levs(stage1_tend_time) % state % h % array, &
- block % state % time_levs(stage1_tend_time) % state % h_edge % array, &
- block % state % time_levs(stage1_tend_time) % state % u % array, &
- block % state % time_levs(stage1_tend_time) % state % wTop % array, err)
+ call ocn_vert_transport_velocity_top(block % mesh, block % state % time_levs(stage1_tend_time) % state % layerThickness % array, &
+ block % state % time_levs(stage1_tend_time) % state % layerThicknessEdge % array, &
+ block % state % time_levs(stage1_tend_time) % state % normalVelocity % array, &
+ block % state % time_levs(stage1_tend_time) % state % vertTransportVelocityTop % array, err)
- call ocn_tend_u(block % tend, block % state % time_levs(stage1_tend_time) % state, block % diagnostics, block % mesh)
+ call ocn_tend_vel(block % tend, block % state % time_levs(stage1_tend_time) % state, block % diagnostics, block % mesh)
block => block % next
end do
@@ -216,7 +216,7 @@
do while (associated(block))
allocate(uTemp(block % mesh % nVertLevels))
- ! Put f*uBcl^{perp} in uNew as a work variable
+ ! Put f*normalBaroclinicVelocity^{perp} in uNew as a work variable
call ocn_fuperp(block % state % time_levs(2) % state , block % mesh)
do iEdge=1,block % mesh % nEdges
@@ -226,38 +226,38 @@
uTemp = 0.0 ! could put this after with uTemp(maxleveledgetop+1:nvertlevels)=0
do k=1,block % mesh % maxLevelEdgeTop % array(iEdge)
- ! uBclNew = uBclOld + dt*(-f*uBclPerp + T(u*,w*,p*) + g*grad(SSH*) )
- ! Here uNew is a work variable containing -fEdge(iEdge)*uBclPerp(k,iEdge)
- uTemp(k) = block % state % time_levs(1) % state % uBcl % array(k,iEdge) &
- + dt * (block % tend % u % array (k,iEdge) &
- + block % state % time_levs(2) % state % u % array (k,iEdge) & ! this is f*uBcl^{perp}
+ ! normalBaroclinicVelocityNew = normalBaroclinicVelocityOld + dt*(-f*normalBaroclinicVelocityPerp + T(u*,w*,p*) + g*grad(SSH*) )
+ ! Here uNew is a work variable containing -fEdge(iEdge)*normalBaroclinicVelocityPerp(k,iEdge)
+ uTemp(k) = block % state % time_levs(1) % state % normalBaroclinicVelocity % array(k,iEdge) &
+ + dt * (block % tend % normalVelocity % array (k,iEdge) &
+ + block % state % time_levs(2) % state % normalVelocity % array (k,iEdge) & ! this is f*normalBaroclinicVelocity^{perp}
+ split * gravity * ( block % state % time_levs(2) % state % ssh % array(cell2) &
- block % state % time_levs(2) % state % ssh % array(cell1) ) &
/block % mesh % dcEdge % array(iEdge) )
enddo
- ! hSum is initialized outside the loop because on land boundaries
- ! maxLevelEdgeTop=0, but I want to initialize hSum with a
+ ! thicknessSum is initialized outside the loop because on land boundaries
+ ! maxLevelEdgeTop=0, but I want to initialize thicknessSum with a
! nonzero value to avoid a NaN.
- uhSum = block % state % time_levs(2) % state % h_edge % array(1,iEdge) * uTemp(1)
- hSum = block % state % time_levs(2) % state % h_edge % array(1,iEdge)
+ normalThicknessFluxSum = block % state % time_levs(2) % state % layerThicknessEdge % array(1,iEdge) * uTemp(1)
+ thicknessSum = block % state % time_levs(2) % state % layerThicknessEdge % array(1,iEdge)
do k=2,block % mesh % maxLevelEdgeTop % array(iEdge)
- uhSum = uhSum + block % state % time_levs(2) % state % h_edge % array(k,iEdge) * uTemp(k)
- hSum = hSum + block % state % time_levs(2) % state % h_edge % array(k,iEdge)
+ normalThicknessFluxSum = normalThicknessFluxSum + block % state % time_levs(2) % state % layerThicknessEdge % array(k,iEdge) * uTemp(k)
+ thicknessSum = thicknessSum + block % state % time_levs(2) % state % layerThicknessEdge % array(k,iEdge)
enddo
- block % state % time_levs(1) % state % GBtrForcing % array(iEdge) = split*uhSum/hSum/dt
+ block % state % time_levs(1) % state % barotropicForcing % array(iEdge) = split*normalThicknessFluxSum/thicknessSum/dt
do k=1,block % mesh % maxLevelEdgeTop % array(iEdge)
! These two steps are together here:
!{\bf u}'_{k,n+1} = {\bf u}'_{k,n} - \Delta t {\overline {\bf G}}
!{\bf u}'_{k,n+1/2} = \frac{1}{2}\left({\bf u}^{'}_{k,n} +{\bf u}'_{k,n+1}\right)
- ! so that uBclNew is at time n+1/2
- block % state % time_levs(2) % state % uBcl % array(k,iEdge) &
+ ! so that normalBaroclinicVelocityNew is at time n+1/2
+ block % state % time_levs(2) % state % normalBaroclinicVelocity % array(k,iEdge) &
= 0.5*( &
- block % state % time_levs(1) % state % uBcl % array(k,iEdge) &
- + uTemp(k) - dt * block % state % time_levs(1) % state % GBtrForcing % array(iEdge))
+ block % state % time_levs(1) % state % normalBaroclinicVelocity % array(k,iEdge) &
+ + uTemp(k) - dt * block % state % time_levs(1) % state % barotropicForcing % array(iEdge))
enddo
@@ -268,9 +268,9 @@
block => block % next
end do
- call mpas_timer_start("se halo ubcl", .false., timer_halo_ubcl)
- call mpas_dmpar_exch_halo_field(domain % blocklist % state % time_levs(2) % state % uBcl)
- call mpas_timer_stop("se halo ubcl", timer_halo_ubcl)
+ call mpas_timer_start("se halo normalBaroclinicVelocity", .false., timer_halo_normalBaroclinicVelocity)
+ call mpas_dmpar_exch_halo_field(domain % blocklist % state % time_levs(2) % state % normalBaroclinicVelocity)
+ call mpas_timer_stop("se halo normalBaroclinicVelocity", timer_halo_normalBaroclinicVelocity)
end do ! do j=1,config_n_bcl_iter
@@ -296,20 +296,20 @@
block => domain % blocklist
do while (associated(block))
- ! For Split_Explicit unsplit, simply set uBtrNew=0, uBtrSubcycle=0, and uNew=uBclNew
- block % state % time_levs(2) % state % uBtr % array(:) = 0.0
+ ! For Split_Explicit unsplit, simply set normalBarotropicVelocityNew=0, normalBarotropicVelocitySubcycle=0, and uNew=normalBaroclinicVelocityNew
+ block % state % time_levs(2) % state % normalBarotropicVelocity % array(:) = 0.0
- block % state % time_levs(2) % state % u % array(:,:) = block % state % time_levs(2) % state % uBcl % array(:,:)
+ block % state % time_levs(2) % state % normalVelocity % array(:,:) = block % state % time_levs(2) % state % normalBaroclinicVelocity % array(:,:)
do iEdge=1,block % mesh % nEdges
do k=1,block % mesh % nVertLevels
- ! uTranport = uBcl + uBolus
- ! This is u used in advective terms for h and tracers
+ ! uTranport = normalBaroclinicVelocity + uBolus
+ ! This is u used in advective terms for layerThickness and tracers
! in tendency calls in stage 3.
block % state % time_levs(2) % state % uTransport % array(k,iEdge) &
= block % mesh % edgeMask % array(k,iEdge) &
- *( block % state % time_levs(2) % state % uBcl % array(k,iEdge) &
+ *( block % state % time_levs(2) % state % normalBaroclinicVelocity % array(k,iEdge) &
+ block % state % time_levs(1) % state % uBolusGM % array(k,iEdge) )
enddo
@@ -325,7 +325,7 @@
do while (associated(block))
if (config_filter_btr_mode) then
- block % state % time_levs(1) % state % GBtrForcing % array(:) = 0.0
+ block % state % time_levs(1) % state % barotropicForcing % array(:) = 0.0
endif
do iCell=1,block % mesh % nCells
@@ -336,16 +336,16 @@
do iEdge=1,block % mesh % nEdges
- ! uBtrSubcycleOld = uBtrOld
- block % state % time_levs(oldBtrSubcycleTime) % state % uBtrSubcycle % array(iEdge) &
- = block % state % time_levs(1) % state % uBtr % array(iEdge)
+ ! normalBarotropicVelocitySubcycleOld = normalBarotropicVelocityOld
+ block % state % time_levs(oldBtrSubcycleTime) % state % normalBarotropicVelocitySubcycle % array(iEdge) &
+ = block % state % time_levs(1) % state % normalBarotropicVelocity % array(iEdge)
- ! uBtrNew = BtrOld This is the first for the summation
- block % state % time_levs(2) % state % uBtr % array(iEdge) &
- = block % state % time_levs(1) % state % uBtr % array(iEdge)
+ ! normalBarotropicVelocityNew = BtrOld This is the first for the summation
+ block % state % time_levs(2) % state % normalBarotropicVelocity % array(iEdge) &
+ = block % state % time_levs(1) % state % normalBarotropicVelocity % array(iEdge)
- ! FBtr = 0
- block % state % time_levs(1) % state % FBtr % array(iEdge) = 0.0
+ ! barotropicThicknessFlux = 0
+ block % state % time_levs(1) % state % barotropicThicknessFlux % array(iEdge) = 0.0
end do
block => block % next
@@ -359,7 +359,7 @@
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! Barotropic subcycle: VELOCITY PREDICTOR STEP
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- if (config_btr_gam1_uWt1>1.0e-12) then ! only do this part if it is needed in next SSH solve
+ if (config_btr_gam1_velWt1>1.0e-12) then ! only do this part if it is needed in next SSH solve
uPerpTime = oldBtrSubcycleTime
block => domain % blocklist
@@ -376,28 +376,28 @@
eoe = block % mesh % edgesOnEdge % array(i,iEdge)
CoriolisTerm = CoriolisTerm &
+ block % mesh % weightsOnEdge % array(i,iEdge) &
- * block % state % time_levs(uPerpTime) % state % uBtrSubcycle % array(eoe) &
+ * block % state % time_levs(uPerpTime) % state % normalBarotropicVelocitySubcycle % array(eoe) &
* block % mesh % fEdge % array(eoe)
end do
- ! uBtrNew = uBtrOld + dt/J*(-f*uBtroldPerp - g*grad(SSH) + G)
- block % state % time_levs(newBtrSubcycleTime) % state % uBtrSubcycle % array(iEdge) &
- = (block % state % time_levs(oldBtrSubcycleTime) % state % uBtrSubcycle % array(iEdge) &
+ ! normalBarotropicVelocityNew = normalBarotropicVelocityOld + dt/J*(-f*normalBarotropicVelocityoldPerp - g*grad(SSH) + G)
+ block % state % time_levs(newBtrSubcycleTime) % state % normalBarotropicVelocitySubcycle % array(iEdge) &
+ = (block % state % time_levs(oldBtrSubcycleTime) % state % normalBarotropicVelocitySubcycle % array(iEdge) &
+ dt / config_n_btr_subcycles * (CoriolisTerm - gravity &
* (block % state % time_levs(oldBtrSubcycleTime) % state % sshSubcycle % array(cell2) &
- block % state % time_levs(oldBtrSubcycleTime) % state % sshSubcycle % array(cell1) ) &
/ block % mesh % dcEdge % array(iEdge) &
- + block % state % time_levs(1) % state % GBtrForcing % array(iEdge))) * block % mesh % edgeMask % array(1, iEdge)
+ + block % state % time_levs(1) % state % barotropicForcing % array(iEdge))) * block % mesh % edgeMask % array(1, iEdge)
end do
block => block % next
end do ! block
- ! boundary update on uBtrNew
- call mpas_timer_start("se halo ubtr", .false., timer_halo_ubtr)
- call mpas_dmpar_exch_halo_field(domain % blocklist % state % time_levs(newBtrSubcycleTime) % state % uBtrSubcycle)
- call mpas_timer_stop("se halo ubtr", timer_halo_ubtr)
- endif ! config_btr_gam1_uWt1>1.0e-12
+ ! boundary update on normalBarotropicVelocityNew
+ call mpas_timer_start("se halo normalBarotropicVelocity", .false., timer_halo_normalBarotropicVelocity)
+ call mpas_dmpar_exch_halo_field(domain % blocklist % state % time_levs(newBtrSubcycleTime) % state % normalBarotropicVelocitySubcycle)
+ call mpas_timer_stop("se halo normalBarotropicVelocity", timer_halo_normalBarotropicVelocity)
+ endif ! config_btr_gam1_velWt1>1.0e-12
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! Barotropic subcycle: SSH PREDICTOR STEP
@@ -408,18 +408,18 @@
block % tend % ssh % array(:) = 0.0
if (config_btr_solve_SSH2) then
- ! If config_btr_solve_SSH2=.true., then do NOT accumulate FBtr in this SSH predictor
+ ! If config_btr_solve_SSH2=.true., then do NOT accumulate barotropicThicknessFlux in this SSH predictor
! section, because it will be accumulated in the SSH corrector section.
- FBtr_coeff = 0.0
+ barotropicThicknessFlux_coeff = 0.0
else
- ! otherwise, DO accumulate FBtr in this SSH predictor section
- FBtr_coeff = 1.0
+ ! otherwise, DO accumulate barotropicThicknessFlux in this SSH predictor section
+ barotropicThicknessFlux_coeff = 1.0
endif
- ! config_btr_gam1_uWt1 sets the forward weighting of velocity in the SSH computation
- ! config_btr_gam1_uWt1= 1 flux = uBtrNew*H
- ! config_btr_gam1_uWt1=0.5 flux = 1/2*(uBtrNew+uBtrOld)*H
- ! config_btr_gam1_uWt1= 0 flux = uBtrOld*H
+ ! config_btr_gam1_velWt1 sets the forward weighting of velocity in the SSH computation
+ ! config_btr_gam1_velWt1= 1 flux = normalBarotropicVelocityNew*H
+ ! config_btr_gam1_velWt1=0.5 flux = 1/2*(normalBarotropicVelocityNew+normalBarotropicVelocityOld)*H
+ ! config_btr_gam1_velWt1= 0 flux = normalBarotropicVelocityOld*H
do iCell = 1, block % mesh % nCells
do i = 1, block % mesh % nEdgesOnCell % array(iCell)
@@ -432,21 +432,21 @@
+ block % state % time_levs(oldBtrSubcycleTime) % state % sshSubcycle % array(cell2) )
! method 0: orig, works only without pbc:
- !hSum = sshEdge + block % mesh % refBottomDepthTopOfCell % array (block % mesh % maxLevelEdgeTop % array(iEdge)+1)
+ !thicknessSum = sshEdge + block % mesh % refBottomDepthTopOfCell % array (block % mesh % maxLevelEdgeTop % array(iEdge)+1)
! method 1, matches method 0 without pbcs, works with pbcs.
- hSum = sshEdge + min(block % mesh % bottomDepth % array(cell1), &
+ thicknessSum = sshEdge + min(block % mesh % bottomDepth % array(cell1), &
block % mesh % bottomDepth % array(cell2))
! method 2: may be better than method 1.
! Take average of full thickness at two neighboring cells.
- !hSum = sshEdge + 0.5 *( block % mesh % bottomDepth % array(cell1) &
+ !thicknessSum = sshEdge + 0.5 *( block % mesh % bottomDepth % array(cell1) &
! + block % mesh % bottomDepth % array(cell2) )
- flux = ((1.0-config_btr_gam1_uWt1) * block % state % time_levs(oldBtrSubcycleTime) % state % uBtrSubcycle % array(iEdge) &
- + config_btr_gam1_uWt1 * block % state % time_levs(newBtrSubcycleTime) % state % uBtrSubcycle % array(iEdge)) &
- * hSum
+ flux = ((1.0-config_btr_gam1_velWt1) * block % state % time_levs(oldBtrSubcycleTime) % state % normalBarotropicVelocitySubcycle % array(iEdge) &
+ + config_btr_gam1_velWt1 * block % state % time_levs(newBtrSubcycleTime) % state % normalBarotropicVelocitySubcycle % array(iEdge)) &
+ * thicknessSum
block % tend % ssh % array(iCell) = block % tend % ssh % array(iCell) + block % mesh % edgeSignOncell % array(i, iCell) * flux &
* block % mesh % dvEdge % array(iEdge)
@@ -462,23 +462,23 @@
+ block % state % time_levs(oldBtrSubcycleTime) % state % sshSubcycle % array(cell2) )
! method 0: orig, works only without pbc:
- !hSum = sshEdge + block % mesh % refBottomDepthTopOfCell % array (block % mesh % maxLevelEdgeTop % array(iEdge)+1)
+ !thicknessSum = sshEdge + block % mesh % refBottomDepthTopOfCell % array (block % mesh % maxLevelEdgeTop % array(iEdge)+1)
! method 1, matches method 0 without pbcs, works with pbcs.
- hSum = sshEdge + min(block % mesh % bottomDepth % array(cell1), &
+ thicknessSum = sshEdge + min(block % mesh % bottomDepth % array(cell1), &
block % mesh % bottomDepth % array(cell2))
! method 2: may be better than method 1.
! take average of full thickness at two neighboring cells
- !hSum = sshEdge + 0.5 *( block % mesh % bottomDepth % array(cell1) &
+ !thicknessSum = sshEdge + 0.5 *( block % mesh % bottomDepth % array(cell1) &
! + block % mesh % bottomDepth % array(cell2) )
- flux = ((1.0-config_btr_gam1_uWt1) * block % state % time_levs(oldBtrSubcycleTime) % state % uBtrSubcycle % array(iEdge) &
- + config_btr_gam1_uWt1 * block % state % time_levs(newBtrSubcycleTime) % state % uBtrSubcycle % array(iEdge)) &
- * hSum
+ flux = ((1.0-config_btr_gam1_velWt1) * block % state % time_levs(oldBtrSubcycleTime) % state % normalBarotropicVelocitySubcycle % array(iEdge) &
+ + config_btr_gam1_velWt1 * block % state % time_levs(newBtrSubcycleTime) % state % normalBarotropicVelocitySubcycle % array(iEdge)) &
+ * thicknessSum
- block % state % time_levs(1) % state % FBtr % array(iEdge) = block % state % time_levs(1) % state % FBtr % array(iEdge) &
- + FBtr_coeff*flux
+ block % state % time_levs(1) % state % barotropicThicknessFlux % array(iEdge) = block % state % time_levs(1) % state % barotropicThicknessFlux % array(iEdge) &
+ + barotropicThicknessFlux_coeff*flux
end do
! SSHnew = SSHold + dt/J*(-div(Flux))
@@ -507,7 +507,7 @@
block => domain % blocklist
do while (associated(block))
allocate(utemp(block % mesh % nEdges+1))
- uTemp(:) = block % state % time_levs(newBtrSubcycleTime) % state % uBtrSubcycle % array(:)
+ uTemp(:) = block % state % time_levs(newBtrSubcycleTime) % state % normalBarotropicVelocitySubcycle % array(:)
do iEdge=1,block % mesh % nEdges
cell1 = block % mesh % cellsOnEdge % array(1,iEdge)
cell2 = block % mesh % cellsOnEdge % array(2,iEdge)
@@ -517,7 +517,7 @@
do i = 1,block % mesh % nEdgesOnEdge % array(iEdge)
eoe = block % mesh % edgesOnEdge % array(i,iEdge)
CoriolisTerm = CoriolisTerm + block % mesh % weightsOnEdge % array(i,iEdge) &
- !* block % state % time_levs(uPerpTime) % state % uBtrSubcycle % array(eoe) &
+ !* block % state % time_levs(uPerpTime) % state % normalBarotropicVelocitySubcycle % array(eoe) &
* uTemp(eoe) &
* block % mesh % fEdge % array(eoe)
end do
@@ -529,21 +529,21 @@
sshCell2 = (1-config_btr_gam2_SSHWt1)*block % state % time_levs(oldBtrSubcycleTime) % state % sshSubcycle % array(cell2) &
+ config_btr_gam2_SSHWt1 *block % state % time_levs(newBtrSubcycleTime) % state % sshSubcycle % array(cell2)
- ! uBtrNew = uBtrOld + dt/J*(-f*uBtroldPerp - g*grad(SSH) + G)
- block % state % time_levs(newBtrSubcycleTime) % state % uBtrSubcycle % array(iEdge) &
- = (block % state % time_levs(oldBtrSubcycleTime) % state % uBtrSubcycle % array(iEdge) &
+ ! normalBarotropicVelocityNew = normalBarotropicVelocityOld + dt/J*(-f*normalBarotropicVelocityoldPerp - g*grad(SSH) + G)
+ block % state % time_levs(newBtrSubcycleTime) % state % normalBarotropicVelocitySubcycle % array(iEdge) &
+ = (block % state % time_levs(oldBtrSubcycleTime) % state % normalBarotropicVelocitySubcycle % array(iEdge) &
+ dt/config_n_btr_subcycles *(CoriolisTerm - gravity *(sshCell2 - sshCell1) /block % mesh % dcEdge % array(iEdge) &
- + block % state % time_levs(1) % state % GBtrForcing % array(iEdge))) * block % mesh % edgeMask % array(1,iEdge)
+ + block % state % time_levs(1) % state % barotropicForcing % array(iEdge))) * block % mesh % edgeMask % array(1,iEdge)
end do
deallocate(uTemp)
block => block % next
end do ! block
- ! boundary update on uBtrNew
- call mpas_timer_start("se halo ubtr", .false., timer_halo_ubtr)
- call mpas_dmpar_exch_halo_field(domain % blocklist % state % time_levs(newBtrSubcycleTime) % state % uBtrSubcycle)
- call mpas_timer_stop("se halo ubtr", timer_halo_ubtr)
+ ! boundary update on normalBarotropicVelocityNew
+ call mpas_timer_start("se halo normalBarotropicVelocity", .false., timer_halo_normalBarotropicVelocity)
+ call mpas_dmpar_exch_halo_field(domain % blocklist % state % time_levs(newBtrSubcycleTime) % state % normalBarotropicVelocitySubcycle)
+ call mpas_timer_stop("se halo normalBarotropicVelocity", timer_halo_normalBarotropicVelocity)
end do !do BtrCorIter=1,config_n_btr_cor_iter
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -555,10 +555,10 @@
do while (associated(block))
block % tend % ssh % array(:) = 0.0
- ! config_btr_gam3_uWt2 sets the forward weighting of velocity in the SSH computation
- ! config_btr_gam3_uWt2= 1 flux = uBtrNew*H
- ! config_btr_gam3_uWt2=0.5 flux = 1/2*(uBtrNew+uBtrOld)*H
- ! config_btr_gam3_uWt2= 0 flux = uBtrOld*H
+ ! config_btr_gam3_velWt2 sets the forward weighting of velocity in the SSH computation
+ ! config_btr_gam3_velWt2= 1 flux = normalBarotropicVelocityNew*H
+ ! config_btr_gam3_velWt2=0.5 flux = 1/2*(normalBarotropicVelocityNew+normalBarotropicVelocityOld)*H
+ ! config_btr_gam3_velWt2= 0 flux = normalBarotropicVelocityOld*H
do iCell = 1, block % mesh % nCells
do i = 1, block % mesh % nEdgesOnCell % array(iCell)
@@ -576,21 +576,21 @@
sshEdge = 0.5 * (sshCell1 + sshCell2)
! method 0: orig, works only without pbc:
- !hSum = sshEdge + block % mesh % refBottomDepthTopOfCell % array (block % mesh % maxLevelEdgeTop % array(iEdge)+1)
+ !thicknessSum = sshEdge + block % mesh % refBottomDepthTopOfCell % array (block % mesh % maxLevelEdgeTop % array(iEdge)+1)
! method 1, matches method 0 without pbcs, works with pbcs.
- hSum = sshEdge + min(block % mesh % bottomDepth % array(cell1), &
+ thicknessSum = sshEdge + min(block % mesh % bottomDepth % array(cell1), &
block % mesh % bottomDepth % array(cell2))
! method 2: may be better than method 1.
! take average of full thickness at two neighboring cells
- !hSum = sshEdge + 0.5 *( block % mesh % bottomDepth % array(cell1) &
+ !thicknessSum = sshEdge + 0.5 *( block % mesh % bottomDepth % array(cell1) &
! + block % mesh % bottomDepth % array(cell2) )
- flux = ((1.0-config_btr_gam3_uWt2) * block % state % time_levs(oldBtrSubcycleTime) % state % uBtrSubcycle % array(iEdge) &
- + config_btr_gam3_uWt2 * block % state % time_levs(newBtrSubcycleTime) % state % uBtrSubcycle % array(iEdge)) &
- * hSum
+ flux = ((1.0-config_btr_gam3_velWt2) * block % state % time_levs(oldBtrSubcycleTime) % state % normalBarotropicVelocitySubcycle % array(iEdge) &
+ + config_btr_gam3_velWt2 * block % state % time_levs(newBtrSubcycleTime) % state % normalBarotropicVelocitySubcycle % array(iEdge)) &
+ * thicknessSum
block % tend % ssh % array(iCell) = block % tend % ssh % array(iCell) + block % mesh % edgeSignOnCell % array(i, iCell) * flux &
* block % mesh % dvEdge % array(iEdge)
@@ -610,22 +610,22 @@
sshEdge = 0.5 * (sshCell1 + sshCell2)
! method 0: orig, works only without pbc:
- !hSum = sshEdge + block % mesh % refBottomDepthTopOfCell % array (block % mesh % maxLevelEdgeTop % array(iEdge)+1)
+ !thicknessSum = sshEdge + block % mesh % refBottomDepthTopOfCell % array (block % mesh % maxLevelEdgeTop % array(iEdge)+1)
! method 1, matches method 0 without pbcs, works with pbcs.
- hSum = sshEdge + min(block % mesh % bottomDepth % array(cell1), &
+ thicknessSum = sshEdge + min(block % mesh % bottomDepth % array(cell1), &
block % mesh % bottomDepth % array(cell2))
! method 2, better, I think.
! take average of full thickness at two neighboring cells
- !hSum = sshEdge + 0.5 *( block % mesh % bottomDepth % array(cell1) &
+ !thicknessSum = sshEdge + 0.5 *( block % mesh % bottomDepth % array(cell1) &
! + block % mesh % bottomDepth % array(cell2) )
- flux = ((1.0-config_btr_gam3_uWt2) * block % state % time_levs(oldBtrSubcycleTime) % state % uBtrSubcycle % array(iEdge) &
- + config_btr_gam3_uWt2 * block % state % time_levs(newBtrSubcycleTime) % state % uBtrSubcycle % array(iEdge)) &
- * hSum
+ flux = ((1.0-config_btr_gam3_velWt2) * block % state % time_levs(oldBtrSubcycleTime) % state % normalBarotropicVelocitySubcycle % array(iEdge) &
+ + config_btr_gam3_velWt2 * block % state % time_levs(newBtrSubcycleTime) % state % normalBarotropicVelocitySubcycle % array(iEdge)) &
+ * thicknessSum
- block % state % time_levs(1) % state % FBtr % array(iEdge) = block % state % time_levs(1) % state % FBtr % array(iEdge) + flux
+ block % state % time_levs(1) % state % barotropicThicknessFlux % array(iEdge) = block % state % time_levs(1) % state % barotropicThicknessFlux % array(iEdge) + flux
end do
! SSHnew = SSHold + dt/J*(-div(Flux))
@@ -651,15 +651,15 @@
block => domain % blocklist
do while (associated(block))
- ! uBtrNew = uBtrNew + uBtrSubcycleNEW
+ ! normalBarotropicVelocityNew = normalBarotropicVelocityNew + normalBarotropicVelocitySubcycleNEW
! This accumulates the sum.
! If the Barotropic Coriolis iteration is limited to one, this could
! be merged with the above code.
do iEdge=1,block % mesh % nEdges
- block % state % time_levs(2) % state % uBtr % array(iEdge) &
- = block % state % time_levs(2) % state % uBtr % array(iEdge) &
- + block % state % time_levs(newBtrSubcycleTime) % state % uBtrSubcycle % array(iEdge)
+ block % state % time_levs(2) % state % normalBarotropicVelocity % array(iEdge) &
+ = block % state % time_levs(2) % state % normalBarotropicVelocity % array(iEdge) &
+ + block % state % time_levs(newBtrSubcycleTime) % state % normalBarotropicVelocitySubcycle % array(iEdge)
end do ! iEdge
block => block % next
@@ -674,15 +674,15 @@
! END Barotropic subcycle loop
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- ! Normalize Barotropic subcycle sums: ssh, uBtr, and F
+ ! Normalize Barotropic subcycle sums: ssh, normalBarotropicVelocity, and F
block => domain % blocklist
do while (associated(block))
do iEdge=1,block % mesh % nEdges
- block % state % time_levs(1) % state % FBtr % array(iEdge) = block % state % time_levs(1) % state % FBtr % array(iEdge) &
+ block % state % time_levs(1) % state % barotropicThicknessFlux % array(iEdge) = block % state % time_levs(1) % state % barotropicThicknessFlux % array(iEdge) &
/ (config_n_btr_subcycles*config_btr_subcycle_loop_factor)
- block % state % time_levs(2) % state % uBtr % array(iEdge) = block % state % time_levs(2) % state % uBtr % array(iEdge) &
+ block % state % time_levs(2) % state % normalBarotropicVelocity % array(iEdge) = block % state % time_levs(2) % state % normalBarotropicVelocity % array(iEdge) &
/ (config_n_btr_subcycles*config_btr_subcycle_loop_factor + 1)
end do
@@ -692,7 +692,7 @@
! boundary update on F
call mpas_timer_start("se halo F", .false., timer_halo_f)
- call mpas_dmpar_exch_halo_field(domain % blocklist % state % time_levs(1) % state % FBtr)
+ call mpas_dmpar_exch_halo_field(domain % blocklist % state % time_levs(1) % state % barotropicThicknessFlux)
call mpas_timer_stop("se halo F", timer_halo_f)
@@ -711,7 +711,7 @@
! - \sum_{k=1}^{N^{edge}} h_{k,*}^{edge} {\bf u}_k^{avg} \right)
! \left/ \sum_{k=1}^{N^{edge}} h_{k,*}^{edge} \right.
- if (config_u_correction) then
+ if (config_vel_correction) then
ucorr_coef = 1
else
ucorr_coef = 0
@@ -719,34 +719,34 @@
do iEdge=1,block % mesh % nEdges
- ! velocity for uCorrection is uBtr + uBcl + uBolus
+ ! velocity for uCorrection is normalBarotropicVelocity + normalBaroclinicVelocity + uBolus
uTemp(:) &
- = block % state % time_levs(2) % state % uBtr % array( iEdge) &
- + block % state % time_levs(2) % state % uBcl % array(:,iEdge) &
+ = block % state % time_levs(2) % state % normalBarotropicVelocity % array( iEdge) &
+ + block % state % time_levs(2) % state % normalBaroclinicVelocity % array(:,iEdge) &
+ block % state % time_levs(1) % state % uBolusGM % array(:,iEdge)
- ! hSum is initialized outside the loop because on land boundaries
- ! maxLevelEdgeTop=0, but I want to initialize hSum with a
+ ! thicknessSum is initialized outside the loop because on land boundaries
+ ! maxLevelEdgeTop=0, but I want to initialize thicknessSum with a
! nonzero value to avoid a NaN.
- uhSum = block % state % time_levs(2) % state % h_edge % array(1,iEdge) * uTemp(1)
- hSum = block % state % time_levs(2) % state % h_edge % array(1,iEdge)
+ normalThicknessFluxSum = block % state % time_levs(2) % state % layerThicknessEdge % array(1,iEdge) * uTemp(1)
+ thicknessSum = block % state % time_levs(2) % state % layerThicknessEdge % array(1,iEdge)
do k=2,block % mesh % maxLevelEdgeTop % array(iEdge)
- uhSum = uhSum + block % state % time_levs(2) % state % h_edge % array(k,iEdge) * uTemp(k)
- hSum = hSum + block % state % time_levs(2) % state % h_edge % array(k,iEdge)
+ normalThicknessFluxSum = normalThicknessFluxSum + block % state % time_levs(2) % state % layerThicknessEdge % array(k,iEdge) * uTemp(k)
+ thicknessSum = thicknessSum + block % state % time_levs(2) % state % layerThicknessEdge % array(k,iEdge)
enddo
- uCorr = ucorr_coef*(( block % state % time_levs(1) % state % FBtr % array(iEdge) - uhSum)/hSum)
+ uCorr = ucorr_coef*(( block % state % time_levs(1) % state % barotropicThicknessFlux % array(iEdge) - normalThicknessFluxSum)/thicknessSum)
do k=1,block % mesh % nVertLevels
- ! uTranport = uBtr + uBcl + uBolus + uCorrection
- ! This is u used in advective terms for h and tracers
+ ! uTranport = normalBarotropicVelocity + normalBaroclinicVelocity + uBolus + uCorrection
+ ! This is u used in advective terms for layerThickness and tracers
! in tendency calls in stage 3.
block % state % time_levs(2) % state % uTransport % array(k,iEdge) &
= block % mesh % edgeMask % array(k,iEdge) &
- *( block % state % time_levs(2) % state % uBtr % array( iEdge) &
- + block % state % time_levs(2) % state % uBcl % array(k,iEdge) &
+ *( block % state % time_levs(2) % state % normalBarotropicVelocity % array( iEdge) &
+ + block % state % time_levs(2) % state % normalBaroclinicVelocity % array(k,iEdge) &
+ block % state % time_levs(1) % state % uBolusGM % array(k,iEdge) &
+ uCorr )
@@ -774,21 +774,21 @@
block => domain % blocklist
do while (associated(block))
- ! compute wTop. Use uTransport for advection of h and tracers.
- ! Use time level 1 values of h and h_edge because h has not yet been computed for time level 2.
- call ocn_wtop(block % mesh, block % state % time_levs(1) % state % h % array, &
- block % state % time_levs(1) % state % h_edge % array, &
+ ! compute vertTransportVelocityTop. Use uTransport for advection of layerThickness and tracers.
+ ! Use time level 1 values of layerThickness and layerThicknessEdge because layerThickness has not yet been computed for time level 2.
+ call ocn_vert_transport_velocity_top(block % mesh, block % state % time_levs(1) % state % layerThickness % array, &
+ block % state % time_levs(1) % state % layerThicknessEdge % array, &
block % state % time_levs(2) % state % uTransport % array, &
- block % state % time_levs(2) % state % wTop % array, err)
+ block % state % time_levs(2) % state % vertTransportVelocityTop % array, err)
- call ocn_tend_h(block % tend, block % state % time_levs(2) % state, block % mesh)
+ call ocn_tend_thick(block % tend, block % state % time_levs(2) % state, block % mesh)
block => block % next
end do
! update halo for thickness and tracer tendencies
- call mpas_timer_start("se halo h", .false., timer_halo_h)
- call mpas_dmpar_exch_halo_field(domain % blocklist % tend % h)
- call mpas_timer_stop("se halo h", timer_halo_h)
+ call mpas_timer_start("se halo thickness", .false., timer_halo_thickness)
+ call mpas_dmpar_exch_halo_field(domain % blocklist % tend % layerThickness)
+ call mpas_timer_stop("se halo thickness", timer_halo_thickness)
block => domain % blocklist
do while (associated(block))
@@ -820,20 +820,20 @@
! this is h_{n+1}
temp_h &
- = block % state % time_levs(1) % state % h % array(k,iCell) &
- + dt* block % tend % h % array(k,iCell)
+ = block % state % time_levs(1) % state % layerThickness % array(k,iCell) &
+ + dt* block % tend % layerThickness % array(k,iCell)
! this is h_{n+1/2}
- block % state % time_levs(2) % state % h % array(k,iCell) &
+ block % state % time_levs(2) % state % layerThickness % array(k,iCell) &
= 0.5*( &
- block % state % time_levs(1) % state % h % array(k,iCell) &
+ block % state % time_levs(1) % state % layerThickness % array(k,iCell) &
+ temp_h)
do i=1,2
! This is Phi at n+1
temp = ( &
block % state % time_levs(1) % state % tracers % array(i,k,iCell) &
- * block % state % time_levs(1) % state % h % array(k,iCell) &
+ * block % state % time_levs(1) % state % layerThickness % array(k,iCell) &
+ dt * block % tend % tracers % array(i,k,iCell)) &
/ temp_h
@@ -850,19 +850,19 @@
do k=1,block % mesh % nVertLevels
- ! u = uBtr + uBcl
- ! here uBcl is at time n+1/2
+ ! u = normalBarotropicVelocity + normalBaroclinicVelocity
+ ! here normalBaroclinicVelocity is at time n+1/2
! This is u used in next iteration or step
- block % state % time_levs(2) % state % u % array(k,iEdge) &
+ block % state % time_levs(2) % state % normalVelocity % array(k,iEdge) &
= block % mesh % edgeMask % array(k,iEdge) &
- *( block % state % time_levs(2) % state % uBtr % array( iEdge) &
- + block % state % time_levs(2) % state % uBcl % array(k,iEdge) )
+ *( block % state % time_levs(2) % state % normalBarotropicVelocity % array( iEdge) &
+ + block % state % time_levs(2) % state % normalBaroclinicVelocity % array(k,iEdge) )
enddo
end do ! iEdge
- ! Efficiency note: We really only need this to compute h_edge, density, pressure, and SSH
+ ! Efficiency note: We really only need this to compute layerThicknessEdge, density, pressure, and SSH
! in this diagnostics solve.
call ocn_diagnostic_solve(dt, block % state % time_levs(2) % state, block % mesh)
@@ -877,37 +877,37 @@
do k=1,block % mesh % maxLevelCell % array(iCell)
! this is h_{n+1}
- block % state % time_levs(2) % state % h % array(k,iCell) &
- = block % state % time_levs(1) % state % h % array(k,iCell) &
- + dt* block % tend % h % array(k,iCell)
+ block % state % time_levs(2) % state % layerThickness % array(k,iCell) &
+ = block % state % time_levs(1) % state % layerThickness % array(k,iCell) &
+ + dt* block % tend % layerThickness % array(k,iCell)
! This is Phi at n+1
do i=1,block % state % time_levs(1) % state % num_tracers
block % state % time_levs(2) % state % tracers % array(i,k,iCell) &
= (block % state % time_levs(1) % state % tracers % array(i,k,iCell) &
- * block % state % time_levs(1) % state % h % array(k,iCell) &
+ * block % state % time_levs(1) % state % layerThickness % array(k,iCell) &
+ dt * block % tend % tracers % array(i,k,iCell)) &
- / block % state % time_levs(2) % state % h % array(k,iCell)
+ / block % state % time_levs(2) % state % layerThickness % array(k,iCell)
enddo
end do
end do
! Recompute final u to go on to next step.
- ! u_{n+1} = uBtr_{n+1} + uBcl_{n+1}
- ! Right now uBclNew is at time n+1/2, so back compute to get uBcl at time n+1
- ! using uBcl_{n+1/2} = 1/2*(uBcl_n + u_Bcl_{n+1})
+ ! u_{n+1} = normalBarotropicVelocity_{n+1} + normalBaroclinicVelocity_{n+1}
+ ! Right now normalBaroclinicVelocityNew is at time n+1/2, so back compute to get normalBaroclinicVelocity at time n+1
+ ! using normalBaroclinicVelocity_{n+1/2} = 1/2*(normalBaroclinicVelocity_n + u_Bcl_{n+1})
! so the following lines are
- ! u_{n+1} = uBtr_{n+1} + 2*uBcl_{n+1/2} - uBcl_n
- ! note that uBcl is recomputed at the beginning of the next timestep due to Imp Vert mixing,
- ! so uBcl does not have to be recomputed here.
+ ! u_{n+1} = normalBarotropicVelocity_{n+1} + 2*normalBaroclinicVelocity_{n+1/2} - normalBaroclinicVelocity_n
+ ! note that normalBaroclinicVelocity is recomputed at the beginning of the next timestep due to Imp Vert mixing,
+ ! so normalBaroclinicVelocity does not have to be recomputed here.
do iEdge=1,block % mesh % nEdges
do k=1,block % mesh % maxLevelEdgeTop % array(iEdge)
- block % state % time_levs(2) % state % u % array(k,iEdge) &
- = block % state % time_levs(2) % state % uBtr % array( iEdge) &
- +2*block % state % time_levs(2) % state % uBcl % array(k,iEdge) &
- - block % state % time_levs(1) % state % uBcl % array(k,iEdge)
+ block % state % time_levs(2) % state % normalVelocity % array(k,iEdge) &
+ = block % state % time_levs(2) % state % normalBarotropicVelocity % array( iEdge) &
+ +2*block % state % time_levs(2) % state % normalBaroclinicVelocity % array(k,iEdge) &
+ - block % state % time_levs(1) % state % normalBaroclinicVelocity % array(k,iEdge)
end do
end do ! iEdges
@@ -929,7 +929,7 @@
! Call ocean diagnostic solve in preparation for vertical mixing. Note
! it is called again after vertical mixing, because u and tracers change.
- ! For Richardson vertical mixing, only rho, h_edge, and ke_edge need to
+ ! For Richardson vertical mixing, only density, layerThicknessEdge, and kineticEnergyEdge need to
! be computed. For kpp, more variables may be needed. Either way, this
! could be made more efficient by only computing what is needed for the
! implicit vmix routine that follows.
@@ -945,7 +945,7 @@
! conducted on tendencies, not on the velocity and tracer fields. So this update is required to
! communicate the change due to implicit vertical mixing across the boundary.
call mpas_timer_start("se implicit vert mix halos")
- call mpas_dmpar_exch_halo_field(domain % blocklist % state % time_levs(2) % state % u)
+ call mpas_dmpar_exch_halo_field(domain % blocklist % state % time_levs(2) % state % normalVelocity)
call mpas_dmpar_exch_halo_field(domain % blocklist % state % time_levs(2) % state % tracers)
call mpas_timer_stop("se implicit vert mix halos")
@@ -955,34 +955,34 @@
do while (associated(block))
if (config_prescribe_velocity) then
- block % state % time_levs(2) % state % u % array(:,:) = block % state % time_levs(1) % state % u % array(:,:)
+ block % state % time_levs(2) % state % normalVelocity % array(:,:) = block % state % time_levs(1) % state % normalVelocity % array(:,:)
end if
if (config_prescribe_thickness) then
- block % state % time_levs(2) % state % h % array(:,:) = block % state % time_levs(1) % state % h % array(:,:)
+ block % state % time_levs(2) % state % layerThickness % array(:,:) = block % state % time_levs(1) % state % layerThickness % array(:,:)
end if
call ocn_diagnostic_solve(dt, block % state % time_levs(2) % state, block % mesh)
- ! Compute velocity transport, used in advection terms of h and tracer tendency
+ ! Compute velocity transport, used in advection terms of layerThickness and tracer tendency
block % state % time_levs(2) % state % uTransport % array(:,:) &
- = block % state % time_levs(2) % state % u % array(:,:) &
+ = block % state % time_levs(2) % state % normalVelocity % array(:,:) &
+ block % state % time_levs(2) % state % uBolusGM % array(:,:)
- call mpas_reconstruct(block % mesh, block % state % time_levs(2) % state % u % array, &
- block % state % time_levs(2) % state % uReconstructX % array, &
- block % state % time_levs(2) % state % uReconstructY % array, &
- block % state % time_levs(2) % state % uReconstructZ % array, &
- block % state % time_levs(2) % state % uReconstructZonal % array, &
- block % state % time_levs(2) % state % uReconstructMeridional % array &
+ call mpas_reconstruct(block % mesh, block % state % time_levs(2) % state % normalVelocity % array, &
+ block % state % time_levs(2) % state % normalVelocityX % array, &
+ block % state % time_levs(2) % state % normalVelocityY % array, &
+ block % state % time_levs(2) % state % normalVelocityZ % array, &
+ block % state % time_levs(2) % state % normalVelocityZonal % array, &
+ block % state % time_levs(2) % state % normalVelocityMeridional % array &
)
- call mpas_reconstruct(block % mesh, block % mesh % u_src % array, &
- block % state % time_levs(2) % state % uSrcReconstructX % array, &
- block % state % time_levs(2) % state % uSrcReconstructY % array, &
- block % state % time_levs(2) % state % uSrcReconstructZ % array, &
- block % state % time_levs(2) % state % uSrcReconstructZonal % array, &
- block % state % time_levs(2) % state % uSrcReconstructMeridional % array &
+ call mpas_reconstruct(block % mesh, block % mesh % normalVelocityForcing % array, &
+ block % state % time_levs(2) % state % normalVelocityForcingReconstructX % array, &
+ block % state % time_levs(2) % state % normalVelocityForcingReconstructY % array, &
+ block % state % time_levs(2) % state % normalVelocityForcingReconstructZ % array, &
+ block % state % time_levs(2) % state % normalVelocityForcingReconstructZonal % array, &
+ block % state % time_levs(2) % state % normalVelocityForcingReconstructMeridional % array &
)
call ocn_time_average_accumulate(block % state % time_levs(2) % state, block % state % time_levs(1) % state)
Modified: trunk/mpas/src/core_ocean/mpas_ocn_tracer_advection.F
===================================================================
--- trunk/mpas/src/core_ocean/mpas_ocn_tracer_advection.F        2013-04-18 16:43:19 UTC (rev 2769)
+++ trunk/mpas/src/core_ocean/mpas_ocn_tracer_advection.F        2013-04-18 18:02:53 UTC (rev 2770)
@@ -240,24 +240,24 @@
!> advection of tracers.
!
!-----------------------------------------------------------------------
- subroutine mpas_ocn_tracer_advection_tend(tracers, uh, w, h, verticalCellSize, dt, grid, tend_h, tend)!{{{
+ subroutine mpas_ocn_tracer_advection_tend(tracers, normalThicknessFlux, w, layerThickness, verticalCellSize, dt, grid, tend_layerThickness, tend)!{{{
real (kind=RKIND), dimension(:,:,:), intent(inout) :: tend !< Input/Output: tracer tendency
real (kind=RKIND), dimension(:,:,:), intent(in) :: tracers !< Input/Output: tracer values
- real (kind=RKIND), dimension(:,:), intent(in) :: uh !< Input: Thickness weighted horizontal velocity
+ real (kind=RKIND), dimension(:,:), intent(in) :: normalThicknessFlux !< Input: Thickness weighted horizontal velocity
real (kind=RKIND), dimension(:,:), intent(in) :: w !< Input: Vertical velocity
- real (kind=RKIND), dimension(:,:), intent(in) :: h !< Input: Thickness field
+ real (kind=RKIND), dimension(:,:), intent(in) :: layerThickness !< Input: Thickness field
real (kind=RKIND), dimension(:,:), intent(in) :: verticalCellSize !< Input: Distance between vertical interfaces of a cell
real (kind=RKIND), intent(in) :: dt !< Input: Time step
type (mesh_type), intent(in) :: grid !< Input: grid information
- real (kind=RKIND), dimension(:,:), intent(in) :: tend_h !< Input: Thickness tendency information
+ real (kind=RKIND), dimension(:,:), intent(in) :: tend_layerThickness !< Input: Thickness tendency information
if(.not. tracerAdvOn) return
if(monotonicOn) then
- call mpas_ocn_tracer_advection_mono_tend(tracers, uh, w, h, verticalCellSize, dt, grid, tend_h, tend)
+ call mpas_ocn_tracer_advection_mono_tend(tracers, normalThicknessFlux, w, layerThickness, verticalCellSize, dt, grid, tend_layerThickness, tend)
else
- call mpas_ocn_tracer_advection_std_tend(tracers, uh, w, verticalCellSize, grid, tend)
+ call mpas_ocn_tracer_advection_std_tend(tracers, normalThicknessFlux, w, verticalCellSize, grid, tend)
endif
end subroutine mpas_ocn_tracer_advection_tend!}}}
Modified: trunk/mpas/src/core_ocean/mpas_ocn_tracer_advection_mono.F
===================================================================
--- trunk/mpas/src/core_ocean/mpas_ocn_tracer_advection_mono.F        2013-04-18 16:43:19 UTC (rev 2769)
+++ trunk/mpas/src/core_ocean/mpas_ocn_tracer_advection_mono.F        2013-04-18 18:02:53 UTC (rev 2770)
@@ -43,7 +43,7 @@
!> Both horizontal and vertical.
!
!-----------------------------------------------------------------------
- subroutine mpas_ocn_tracer_advection_mono_tend(tracers, uh, w, h, verticalCellSize, dt, grid, tend_h, tend)!{{{
+ subroutine mpas_ocn_tracer_advection_mono_tend(tracers, normalThicknessFlux, w, layerThickness, verticalCellSize, dt, grid, tend_layerThickness, tend)!{{{
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! Input: s - current model state
@@ -52,11 +52,11 @@
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
real (kind=RKIND), dimension(:,:,:), intent(in) :: tracers !< Input: current tracer values
- real (kind=RKIND), dimension(:,:), intent(in) :: uh !< Input: Thichness weighted velocitiy
+ real (kind=RKIND), dimension(:,:), intent(in) :: normalThicknessFlux !< Input: Thichness weighted velocitiy
real (kind=RKIND), dimension(:,:), intent(in) :: w !< Input: Vertical velocitiy
- real (kind=RKIND), dimension(:,:), intent(in) :: h !< Input: Thickness
+ real (kind=RKIND), dimension(:,:), intent(in) :: layerThickness !< Input: Thickness
real (kind=RKIND), dimension(:,:), intent(in) :: verticalCellSize !< Input: Distance between vertical interfaces of a cell
- real (kind=RKIND), dimension(:,:), intent(in) :: tend_h !< Input: Tendency for thickness field
+ real (kind=RKIND), dimension(:,:), intent(in) :: tend_layerThickness !< Input: Tendency for thickness field
real (kind=RKIND), intent(in) :: dt !< Input: Timestep
type (mesh_type), intent(in) :: grid !< Input: Grid information
real (kind=RKIND), dimension(:,:,:), intent(inout) :: tend !< Input/Output: Tracer tendency
@@ -134,7 +134,7 @@
do iCell = 1, nCells
do k=1, maxLevelCell(iCell)
- inv_h_new(k, iCell) = 1.0 / (h(k, iCell) + dt * tend_h(k, iCell))
+ inv_h_new(k, iCell) = 1.0 / (layerThickness(k, iCell) + dt * tend_layerThickness(k, iCell))
end do
end do
@@ -199,9 +199,9 @@
iCell = advCellsForEdge(i,iEdge)
do k = 1, maxLevelCell(iCell)
tracer_weight = lowOrderAdvectionMask(k, iEdge) * adv_coefs_2nd(i,iEdge) &
- + highOrderAdvectionMask(k, iEdge) * (adv_coefs(i,iEdge) + coef_3rd_order*sign(1.0_RKIND,uh(k,iEdge))*adv_coefs_3rd(i,iEdge))
+ + highOrderAdvectionMask(k, iEdge) * (adv_coefs(i,iEdge) + coef_3rd_order*sign(1.0_RKIND,normalThicknessFlux(k,iEdge))*adv_coefs_3rd(i,iEdge))
- tracer_weight = uh(k,iEdge)*tracer_weight
+ tracer_weight = normalThicknessFlux(k,iEdge)*tracer_weight
high_order_horiz_flux(k,iEdge) = high_order_horiz_flux(k,iEdge) + tracer_weight* tracer_cur(k,iCell)
end do ! k loop
end do ! i loop over nAdvCellsForEdge
@@ -247,7 +247,7 @@
invAreaCell2 = 1.0 / areaCell(cell2)
do k = 1, maxLevelEdgeTop(iEdge)
- flux_upwind = dvEdge(iEdge) * (max(0.0_RKIND,uh(k,iEdge))*tracer_cur(k,cell1) + min(0.0_RKIND,uh(k,iEdge))*tracer_cur(k,cell2))
+ flux_upwind = dvEdge(iEdge) * (max(0.0_RKIND,normalThicknessFlux(k,iEdge))*tracer_cur(k,cell1) + min(0.0_RKIND,normalThicknessFlux(k,iEdge))*tracer_cur(k,cell2))
high_order_horiz_flux(k,iEdge) = high_order_horiz_flux(k,iEdge) - flux_upwind
end do ! k loop
end do ! iEdge loop
@@ -259,7 +259,7 @@
cell1 = cellsOnEdge(1,iEdge)
cell2 = cellsOnEdge(2,iEdge)
do k = 1, maxLevelEdgeTop(iEdge)
- flux_upwind = dvEdge(iEdge) * (max(0.0_RKIND,uh(k,iEdge))*tracer_cur(k,cell1) + min(0.0_RKIND,uh(k,iEdge))*tracer_cur(k,cell2))
+ flux_upwind = dvEdge(iEdge) * (max(0.0_RKIND,normalThicknessFlux(k,iEdge))*tracer_cur(k,cell1) + min(0.0_RKIND,normalThicknessFlux(k,iEdge))*tracer_cur(k,cell2))
upwind_tendency(k,iCell) = upwind_tendency(k,iCell) + edgeSignOncell(i, iCell) * flux_upwind * invAreaCell1
@@ -275,9 +275,9 @@
! Factors are placed in the flux_incoming and flux_outgoing arrays
do iCell = 1, nCells
do k = 1, maxLevelCell(iCell)
- tracer_min_new = (tracer_cur(k,iCell)*h(k,iCell) + dt*(upwind_tendency(k,iCell)+flux_outgoing(k,iCell))) * inv_h_new(k,iCell)
- tracer_max_new = (tracer_cur(k,iCell)*h(k,iCell) + dt*(upwind_tendency(k,iCell)+flux_incoming(k,iCell))) * inv_h_new(k,iCell)
- tracer_upwind_new = (tracer_cur(k,iCell)*h(k,iCell) + dt*upwind_tendency(k,iCell)) * inv_h_new(k,iCell)
+ tracer_min_new = (tracer_cur(k,iCell)*layerThickness(k,iCell) + dt*(upwind_tendency(k,iCell)+flux_outgoing(k,iCell))) * inv_h_new(k,iCell)
+ tracer_max_new = (tracer_cur(k,iCell)*layerThickness(k,iCell) + dt*(upwind_tendency(k,iCell)+flux_incoming(k,iCell))) * inv_h_new(k,iCell)
+ tracer_upwind_new = (tracer_cur(k,iCell)*layerThickness(k,iCell) + dt*upwind_tendency(k,iCell)) * inv_h_new(k,iCell)
scale_factor = (tracer_max(k,iCell)-tracer_upwind_new)/(tracer_max_new-tracer_upwind_new+eps)
flux_incoming(k,iCell) = min( 1.0_RKIND, max( 0.0_RKIND, scale_factor) )
@@ -337,7 +337,7 @@
tracer_new(k, iCell) = tracer_new(k, iCell) + (high_order_vert_flux(k+1, iCell) - high_order_vert_flux(k, iCell)) + upwind_tendency(k,iCell)
!tracer_new is now the new state of the tracer. Only for a check on monotonicity
- tracer_new(k, iCell) = (tracer_cur(k, iCell)*h(k, iCell) + dt * tracer_new(k, iCell)) * inv_h_new(k, iCell)
+ tracer_new(k, iCell) = (tracer_cur(k, iCell)*layerThickness(k, iCell) + dt * tracer_new(k, iCell)) * inv_h_new(k, iCell)
end if
end do ! k loop
end do ! iCell loop
Modified: trunk/mpas/src/core_ocean/mpas_ocn_tracer_advection_std.F
===================================================================
--- trunk/mpas/src/core_ocean/mpas_ocn_tracer_advection_std.F        2013-04-18 16:43:19 UTC (rev 2769)
+++ trunk/mpas/src/core_ocean/mpas_ocn_tracer_advection_std.F        2013-04-18 18:02:53 UTC (rev 2770)
@@ -45,7 +45,7 @@
!> tracer advection tendencies.
!
!-----------------------------------------------------------------------
- subroutine mpas_ocn_tracer_advection_std_tend(tracers, uh, w, verticalCellSize, grid, tend)!{{{
+ subroutine mpas_ocn_tracer_advection_std_tend(tracers, normalThicknessFlux, w, verticalCellSize, grid, tend)!{{{
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! Input: s - current model state
@@ -56,13 +56,13 @@
real (kind=RKIND), dimension(:,:,:), intent(inout) :: tend !< Input/Output: Tracer tendency
real (kind=RKIND), dimension(:,:,:), intent(in) :: tracers !< Input: Tracer values
- real (kind=RKIND), dimension(:,:), intent(in) :: uh !< Input: Thickness weighted horizontal velocity
+ real (kind=RKIND), dimension(:,:), intent(in) :: normalThicknessFlux !< Input: Thickness weighted horizontal velocity
real (kind=RKIND), dimension(:,:), intent(in) :: w !< Input: Vertical Velocity
real (kind=RKIND), dimension(:,:), intent(in) :: verticalCellSize !< Input: Distance between vertical interfaces of a cell
type (mesh_type), intent(in) :: grid !< Input: Grid information
call mpas_timer_start("tracer-hadv", .false.)
- call mpas_ocn_tracer_advection_std_hadv_tend(tracers, uh, grid, tend)
+ call mpas_ocn_tracer_advection_std_hadv_tend(tracers, normalThicknessFlux, grid, tend)
call mpas_timer_stop("tracer-hadv")
call mpas_timer_start("tracer-vadv", .false.)
call mpas_ocn_tracer_advection_std_vadv_tend(tracers, w, verticalCellSize, grid, tend)
Modified: trunk/mpas/src/core_ocean/mpas_ocn_tracer_advection_std_hadv.F
===================================================================
--- trunk/mpas/src/core_ocean/mpas_ocn_tracer_advection_std_hadv.F        2013-04-18 16:43:19 UTC (rev 2769)
+++ trunk/mpas/src/core_ocean/mpas_ocn_tracer_advection_std_hadv.F        2013-04-18 18:02:53 UTC (rev 2770)
@@ -45,10 +45,10 @@
!> This routine computes the tendency for 3rd order horizontal advection of tracers.
!
!-----------------------------------------------------------------------
- subroutine mpas_ocn_tracer_advection_std_hadv_tend(tracers, uh, grid, tend)!{{{
+ subroutine mpas_ocn_tracer_advection_std_hadv_tend(tracers, normalThicknessFlux, grid, tend)!{{{
real (kind=RKIND), dimension(:,:,:), intent(inout) :: tend !< Input/output: Tracer tendency
real (kind=RKIND), dimension(:,:,:), intent(in) :: tracers !< Input: Tracer values
- real (kind=RKIND), dimension(:,:), intent(in) :: uh !< Input: Thickness weighted horizontal velocity
+ real (kind=RKIND), dimension(:,:), intent(in) :: normalThicknessFlux !< Input: Thickness weighted horizontal velocity
type (mesh_type), intent(in) :: grid !< Input: Grid information
integer :: i, iCell, iEdge, k, iTracer, cell1, cell2
@@ -91,7 +91,7 @@
iCell = advCellsForEdge(i,iEdge)
do k=1,grid % nVertLevels
tracer_weight = lowOrderAdvectionMask(k, iEdge) * adv_coefs_2nd(i,iEdge) &
- + highOrderAdvectionMask(k, iEdge) * (adv_coefs(i,iEdge) + coef_3rd_order*sign(1.0_RKIND,uh(k,iEdge))*adv_coefs_3rd(i,iEdge))
+ + highOrderAdvectionMask(k, iEdge) * (adv_coefs(i,iEdge) + coef_3rd_order*sign(1.0_RKIND,normalThicknessFlux(k,iEdge))*adv_coefs_3rd(i,iEdge))
do iTracer=1,num_tracers
flux_arr(iTracer,k) = flux_arr(iTracer,k) + tracer_weight* tracers(iTracer,k,iCell)
end do
@@ -100,8 +100,8 @@
do k=1,grid % nVertLevels
do iTracer=1,num_tracers
- tend(iTracer,k,cell1) = tend(iTracer,k,cell1) - uh(k,iEdge)*flux_arr(iTracer,k)/areaCell(cell1)
- tend(iTracer,k,cell2) = tend(iTracer,k,cell2) + uh(k,iEdge)*flux_arr(iTracer,k)/areaCell(cell2)
+ tend(iTracer,k,cell1) = tend(iTracer,k,cell1) - normalThicknessFlux(k,iEdge)*flux_arr(iTracer,k)/areaCell(cell1)
+ tend(iTracer,k,cell2) = tend(iTracer,k,cell2) + normalThicknessFlux(k,iEdge)*flux_arr(iTracer,k)/areaCell(cell2)
end do
end do
end if
Deleted: trunk/mpas/src/core_ocean/mpas_ocn_tracer_hadv.F
===================================================================
--- trunk/mpas/src/core_ocean/mpas_ocn_tracer_hadv.F        2013-04-18 16:43:19 UTC (rev 2769)
+++ trunk/mpas/src/core_ocean/mpas_ocn_tracer_hadv.F        2013-04-18 18:02:53 UTC (rev 2770)
@@ -1,189 +0,0 @@
-!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-!
-! ocn_tracer_hadv
-!
-!> \brief MPAS ocean horizontal tracer advection driver
-!> \author Doug Jacobsen
-!> \date 16 September 2011
-!> \version SVN:$Id:$
-!> \details
-!> This module contains the main driver routine for computing
-!> horizontal advection tendencies.
-!
-!-----------------------------------------------------------------------
-
-module ocn_tracer_hadv
-
- use mpas_grid_types
- use mpas_configure
- use mpas_timer
-
- use ocn_tracer_hadv2
- use ocn_tracer_hadv3
- use ocn_tracer_hadv4
-
- implicit none
- private
- save
-
- !--------------------------------------------------------------------
- !
- ! Public parameters
- !
- !--------------------------------------------------------------------
-
- !--------------------------------------------------------------------
- !
- ! Public member functions
- !
- !--------------------------------------------------------------------
-
- public :: ocn_tracer_hadv_tend, &
- ocn_tracer_hadv_init
-
- !--------------------------------------------------------------------
- !
- ! Private module variables
- !
- !--------------------------------------------------------------------
-
- type (timer_node), pointer :: hadv2Timer, hadv3Timer, hadv4Timer
-
-
-!***********************************************************************
-
-contains
-
-!***********************************************************************
-!
-! routine ocn_tracer_hadv_tend
-!
-!> \brief Computes tendency term for horizontal tracer advection
-!> \author Phil Jones, Doug Jacobsen
-!> \date 15 September 2011
-!> \version SVN:$Id$
-!> \details
-!> This routine computes the horizontal advection tendency for tracer
-!> based on current state and user choices of advection parameterization.
-!> Multiple parameterizations may be chosen and added together. These
-!> tendencies are generally computed by calling the specific routine
-!> for the chosen parameterization, so this routine is primarily a
-!> driver for managing these choices.
-!
-!-----------------------------------------------------------------------
-
- subroutine ocn_tracer_hadv_tend(grid, u, h_edge, tracers, tend, err)!{{{
-
- !-----------------------------------------------------------------
- !
- ! input variables
- !
- !-----------------------------------------------------------------
-
- real (kind=RKIND), dimension(:,:), intent(in) :: &
- u !< Input: velocity
-
- real (kind=RKIND), dimension(:,:), intent(in) :: &
- h_edge !< Input: thickness at edge
-
- real (kind=RKIND), dimension(:,:,:), intent(in) :: &
- tracers !< Input: tracers
-
- type (mesh_type), intent(in) :: &
- grid !< Input: grid information
-
- !-----------------------------------------------------------------
- !
- ! input/output variables
- !
- !-----------------------------------------------------------------
-
- real (kind=RKIND), dimension(:,:,:), intent(inout) :: &
- tend !< Input/Output: velocity tendency
-
- !-----------------------------------------------------------------
- !
- ! output variables
- !
- !-----------------------------------------------------------------
-
- integer, intent(out) :: err !< Output: Error flag
-
- !-----------------------------------------------------------------
- !
- ! local variables
- !
- !-----------------------------------------------------------------
-
- integer :: err1, err2, err3
-
- !-----------------------------------------------------------------
- !
- ! call relevant routines for computing tendencies
- ! note that the user can choose multiple options and the
- ! tendencies will be added together
- !
- !-----------------------------------------------------------------
-
- call mpas_timer_start("hadv2", .false., hadv2Timer);
- call ocn_tracer_hadv2_tend(grid, u, h_edge, tracers, tend, err1)
- call mpas_timer_stop("hadv2", hadv2Timer);
- call mpas_timer_start("hadv3", .false., hadv3Timer);
- call ocn_tracer_hadv3_tend(grid, u, h_edge, tracers, tend, err2)
- call mpas_timer_stop("hadv3", hadv3Timer);
- call mpas_timer_start("hadv4", .false., hadv4Timer);
- call ocn_tracer_hadv4_tend(grid, u, h_edge, tracers, tend, err3)
- call mpas_timer_stop("hadv4", hadv4Timer);
-
- err = ior(err1, ior(err2, err3))
-
- !--------------------------------------------------------------------
-
- end subroutine ocn_tracer_hadv_tend!}}}
-
-!***********************************************************************
-!
-! routine ocn_tracer_hadv_init
-!
-!> \brief Initializes ocean tracer horizontal advection quantities
-!> \author Phil Jones, Doug Jacobsen
-!> \date 15 September 2011
-!> \version SVN:$Id$
-!> \details
-!> This routine initializes a variety of quantities related to
-!> horizontal velocity advection in the ocean. Since a variety of
-!> parameterizations are available, this routine primarily calls the
-!> individual init routines for each parameterization.
-!
-!-----------------------------------------------------------------------
-
- subroutine ocn_tracer_hadv_init(err)!{{{
-
- !--------------------------------------------------------------------
-
- !-----------------------------------------------------------------
- !
- ! call individual init routines for each parameterization
- !
- !-----------------------------------------------------------------
-
- integer, intent(out) :: err !< Output: Error flag
-
- integer :: err1, err2, err3
-
- call ocn_tracer_hadv2_init(err1)
- call ocn_tracer_hadv3_init(err2)
- call ocn_tracer_hadv4_init(err3)
-
- err = ior(err1, ior(err2, err3))
-
- !--------------------------------------------------------------------
-
- end subroutine ocn_tracer_hadv_init!}}}
-
-!***********************************************************************
-
-end module ocn_tracer_hadv
-
-!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-! vim: foldmethod=marker
Deleted: trunk/mpas/src/core_ocean/mpas_ocn_tracer_hadv2.F
===================================================================
--- trunk/mpas/src/core_ocean/mpas_ocn_tracer_hadv2.F        2013-04-18 16:43:19 UTC (rev 2769)
+++ trunk/mpas/src/core_ocean/mpas_ocn_tracer_hadv2.F        2013-04-18 18:02:53 UTC (rev 2770)
@@ -1,199 +0,0 @@
-!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-!
-! ocn_tracer_hadv2
-!
-!> \brief MPAS ocean horizontal tracer advection 2nd order
-!> \author Doug Jacobsen
-!> \date 16 September 2011
-!> \version SVN:$Id:$
-!> \details
-!> This module contains the main driver routine for computing
-!> horizontal advection tendencies.
-!
-!-----------------------------------------------------------------------
-
-module ocn_tracer_hadv2
-
- use mpas_grid_types
- use mpas_configure
-
- implicit none
- private
- save
-
- !--------------------------------------------------------------------
- !
- ! Public parameters
- !
- !--------------------------------------------------------------------
-
- !--------------------------------------------------------------------
- !
- ! Public member functions
- !
- !--------------------------------------------------------------------
-
- public :: ocn_tracer_hadv2_tend, &
- ocn_tracer_hadv2_init
-
- !--------------------------------------------------------------------
- !
- ! Private module variables
- !
- !--------------------------------------------------------------------
-
- logical :: hadv2On !< Flag to turn on/off 2nd order hadv
-
-!***********************************************************************
-
-contains
-
-!***********************************************************************
-!
-! routine ocn_tracer_hadv2_tend
-!
-!> \brief Computes tendency term for horizontal tracer advection 2nd order
-!> \author Phil Jones, Doug Jacobsen
-!> \date 15 September 2011
-!> \version SVN:$Id$
-!> \details
-!> This routine computes the horizontal advection tendency for tracer
-!> based on current state using a 2nd order formulation.
-!
-!-----------------------------------------------------------------------
-
- subroutine ocn_tracer_hadv2_tend(grid, u, h_edge, tracers , tend, err)!{{{
-
- !-----------------------------------------------------------------
- !
- ! input variables
- !
- !-----------------------------------------------------------------
-
- real (kind=RKIND), dimension(:,:), intent(in) :: &
- u !< Input: tracer
-
- real (kind=RKIND), dimension(:,:), intent(in) :: &
- h_edge !< Input: thickness at edge
-
- real (kind=RKIND), dimension(:,:,:), intent(in) :: &
- tracers !< Input: tracers
-
- type (mesh_type), intent(in) :: &
- grid !< Input: grid information
-
- !-----------------------------------------------------------------
- !
- ! input/output variables
- !
- !-----------------------------------------------------------------
-
- real (kind=RKIND), dimension(:,:,:), intent(inout) :: &
- tend !< Input/Output: tracer tendency
-
- !-----------------------------------------------------------------
- !
- ! output variables
- !
- !-----------------------------------------------------------------
-
- integer, intent(out) :: err !< Output: Error flag
-
- !-----------------------------------------------------------------
- !
- ! local variables
- !
- !-----------------------------------------------------------------
-
- integer :: iEdge, nEdges, cell1, cell2, iTracer, num_tracers, k
-
- integer, dimension(:), pointer :: maxLevelEdgeTop
- integer, dimension(:,:), pointer :: cellsOnEdge
-
- real (kind=RKIND) :: flux, tracer_edge, invAreaCell1, invAreaCell2, r_tmp
-
- real (kind=RKIND), dimension(:), pointer :: dvEdge, areaCell
-
- !-----------------------------------------------------------------
- !
- ! call relevant routines for computing tendencies
- ! note that the user can choose multiple options and the
- ! tendencies will be added together
- !
- !-----------------------------------------------------------------
-
- err = 0
-
- if(.not.hadv2On) return
-
- nEdges = grid % nEdges
- maxLevelEdgeTop => grid % maxLevelEdgeTop % array
- cellsOnEdge => grid % cellsOnEdge % array
- dvEdge => grid % dvEdge % array
- areaCell => grid % areaCell % array
- num_tracers = size(tracers, 1)
-
- do iEdge=1,nEdges
- cell1 = cellsOnEdge(1,iEdge)
- cell2 = cellsOnEdge(2,iEdge)
-
- invAreaCell1 = 1.0 / areaCell(cell1)
- invAreaCell2 = 1.0 / areaCell(cell2)
- do k=1,maxLevelEdgeTop(iEdge)
- r_tmp = u(k,iEdge) * dvEdge(iEdge) * h_edge(k,iEdge)
- do iTracer=1,num_tracers
- tracer_edge = 0.5 * (tracers(iTracer,k,cell1) + tracers(iTracer,k,cell2))
- flux = r_tmp * tracer_edge
- tend(iTracer,k,cell1) = tend(iTracer,k,cell1) - flux * invAreaCell1
- tend(iTracer,k,cell2) = tend(iTracer,k,cell2) + flux * invAreaCell2
- end do
- end do
- end do
- !--------------------------------------------------------------------
-
- end subroutine ocn_tracer_hadv2_tend!}}}
-
-!***********************************************************************
-!
-! routine ocn_tracer_hadv2_init
-!
-!> \brief Initializes ocean tracer horizontal advection quantities
-!> \author Phil Jones, Doug Jacobsen
-!> \date 15 September 2011
-!> \version SVN:$Id$
-!> \details
-!> This routine initializes a variety of quantities related to
-!> 2nd order horizontal tracer advection in the ocean.
-!
-!-----------------------------------------------------------------------
-
- subroutine ocn_tracer_hadv2_init(err)!{{{
-
- !--------------------------------------------------------------------
-
- !-----------------------------------------------------------------
- !
- ! call individual init routines for each parameterization
- !
- !-----------------------------------------------------------------
-
- integer, intent(out) :: err !< Output: Error flag
-
- err = 0
- hadv2On = .false.
-
- if (config_horiz_tracer_adv_order == 2) then
- hadv2On = .true.
- end if
-
- !--------------------------------------------------------------------
-
- end subroutine ocn_tracer_hadv2_init!}}}
-
-!***********************************************************************
-
-end module ocn_tracer_hadv2
-
-!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-
-! vim: foldmethod=marker
Deleted: trunk/mpas/src/core_ocean/mpas_ocn_tracer_hadv3.F
===================================================================
--- trunk/mpas/src/core_ocean/mpas_ocn_tracer_hadv3.F        2013-04-18 16:43:19 UTC (rev 2769)
+++ trunk/mpas/src/core_ocean/mpas_ocn_tracer_hadv3.F        2013-04-18 18:02:53 UTC (rev 2770)
@@ -1,239 +0,0 @@
-!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-!
-! ocn_tracer_hadv3
-!
-!> \brief MPAS ocean horizontal tracer advection 3rd order
-!> \author Doug Jacobsen
-!> \date 16 September 2011
-!> \version SVN:$Id:$
-!> \details
-!> This module contains the main driver routine for computing
-!> horizontal advection tendencies.
-!
-!-----------------------------------------------------------------------
-
-module ocn_tracer_hadv3
-
- use mpas_grid_types
- use mpas_configure
-
- implicit none
- private
- save
-
- !--------------------------------------------------------------------
- !
- ! Public parameters
- !
- !--------------------------------------------------------------------
-
- !--------------------------------------------------------------------
- !
- ! Public member functions
- !
- !--------------------------------------------------------------------
-
- public :: ocn_tracer_hadv3_tend, &
- ocn_tracer_hadv3_init
-
- !--------------------------------------------------------------------
- !
- ! Private module variables
- !
- !--------------------------------------------------------------------
-
- logical :: hadv3On !< Flag to turn on/off 3rd order hadv
- real (kind=RKIND) :: coef_3rd_order !< Coefficient for 3rd order hadv
-
-!***********************************************************************
-
-contains
-
-!***********************************************************************
-!
-! routine ocn_tracer_hadv3_tend
-!
-!> \brief Computes tendency term for horizontal tracer advection 3rd order
-!> \author Phil Jones, Doug Jacobsen
-!> \date 15 September 2011
-!> \version SVN:$Id$
-!> \details
-!> This routine computes the horizontal advection tendency for tracer
-!> based on current state using a 3rd order formulation.
-!
-!-----------------------------------------------------------------------
-
- subroutine ocn_tracer_hadv3_tend(grid, u, h_edge, tracers , tend, err)!{{{
-
- !-----------------------------------------------------------------
- !
- ! input variables
- !
- !-----------------------------------------------------------------
-
- real (kind=RKIND), dimension(:,:), intent(in) :: &
- u !< Input: tracer
-
- real (kind=RKIND), dimension(:,:), intent(in) :: &
- h_edge !< Input: thickness at edge
-
- real (kind=RKIND), dimension(:,:,:), intent(in) :: &
- tracers !< Input: tracers
-
- type (mesh_type), intent(in) :: &
- grid !< Input: grid information
-
- !-----------------------------------------------------------------
- !
- ! input/output variables
- !
- !-----------------------------------------------------------------
-
- real (kind=RKIND), dimension(:,:,:), intent(inout) :: &
- tend !< Input/Output: tracer tendency
-
- !-----------------------------------------------------------------
- !
- ! output variables
- !
- !-----------------------------------------------------------------
-
- integer, intent(out) :: err !< Output: error flag
-
- !-----------------------------------------------------------------
- !
- ! local variables
- !
- !-----------------------------------------------------------------
-
- integer :: iEdge, nEdges, cell1, cell2, iTracer, num_tracers, i, k, &
- boundaryMask, velMask
-
- integer, dimension(:), pointer :: maxLevelEdgeTop, nEdgesOnCell
- integer, dimension(:,:), pointer :: cellsOnEdge, cellsOnCell, &
- cellMask, edgeMask
-
- real (kind=RKIND) :: flux, tracer_edge, d2fdx2_cell1, d2fdx2_cell2, &
- invAreaCell1, invAreaCell2
-
- real (kind=RKIND), dimension(:), pointer :: dvEdge, dcEdge, areaCell
- real (kind=RKIND), dimension(:,:,:), pointer :: deriv_two
-
- !-----------------------------------------------------------------
- !
- ! call relevant routines for computing tendencies
- ! note that the user can choose multiple options and the
- ! tendencies will be added together
- !
- !-----------------------------------------------------------------
-
- err = 0
-
- if(.not.hadv3On) return
-
- nEdges = grid % nEdges
- num_tracers = size(tracers, dim=1)
- maxLevelEdgeTop => grid % maxLevelEdgeTop % array
- nEdgesOnCell => grid % nEdgesOnCell % array
- cellMask => grid % cellMask % array
- cellsOnEdge => grid % cellsOnEdge % array
- cellsOnCell => grid % cellsOnCell % array
- dvEdge => grid % dvEdge % array
- dcEdge => grid % dcEdge % array
- areaCell => grid % areaCell % array
- deriv_two => grid % deriv_two % array
-
- do iEdge=1,nEdges
- cell1 = cellsOnEdge(1,iEdge)
- cell2 = cellsOnEdge(2,iEdge)
-
- invAreaCell1 = 1.0 / areaCell(cell1)
- invAreaCell2 = 1.0 / areaCell(cell2)
-
- do k=1,maxLevelEdgeTop(iEdge)
-
- d2fdx2_cell1 = 0.0
- d2fdx2_cell2 = 0.0
-
- boundaryMask = abs(transfer(cellMask(k,cell1) == 1 .and. cellMask(k,cell2) == 1,boundaryMask))
-
- do iTracer=1,num_tracers
-
- !-- if not a boundary cell
- d2fdx2_cell1 = deriv_two(1,1,iEdge) * tracers(iTracer,k,cell1) * boundaryMask
- d2fdx2_cell2 = deriv_two(1,2,iEdge) * tracers(iTracer,k,cell2) * boundaryMask
-
- !-- all edges of cell 1
- do i=1,nEdgesOnCell(cell1) * boundaryMask
- d2fdx2_cell1 = d2fdx2_cell1 + &
- deriv_two(i+1,1,iEdge) * tracers(iTracer,k,cellsOnCell(i,cell1))
- end do
-
- !-- all edges of cell 2
- do i=1,nEdgesOnCell(cell2) * boundaryMask
- d2fdx2_cell2 = d2fdx2_cell2 + &
- deriv_two(i+1,2,iEdge) * tracers(iTracer,k,cellsOnCell(i,cell2))
- end do
-
-
- velMask = 2*(abs(transfer(u(k,iEdge) <= 0, velMask))) - 1
- flux = dvEdge(iEdge) * u(k,iEdge) * h_edge(k,iEdge) * ( &
- 0.5*(tracers(iTracer,k,cell1) + tracers(iTracer,k,cell2)) &
- -(dcEdge(iEdge) **2) * (d2fdx2_cell1 + d2fdx2_cell2) / 12. &
- +velMask*(dcEdge(iEdge) **2) * coef_3rd_order*(d2fdx2_cell1 - d2fdx2_cell2) / 12. )
-
- !-- update tendency
- tend(iTracer,k,cell1) = tend(iTracer,k,cell1) - flux*invAreaCell1
- tend(iTracer,k,cell2) = tend(iTracer,k,cell2) + flux*invAreaCell2
- enddo
- end do
- end do
- !--------------------------------------------------------------------
-
- end subroutine ocn_tracer_hadv3_tend!}}}
-
-!***********************************************************************
-!
-! routine ocn_tracer_hadv3_init
-!
-!> \brief Initializes ocean tracer horizontal advection quantities
-!> \author Phil Jones, Doug Jacobsen
-!> \date 15 September 2011
-!> \version SVN:$Id$
-!> \details
-!> This routine initializes a variety of quantities related to
-!> 3rd order horizontal tracer advection in the ocean.
-!
-!-----------------------------------------------------------------------
-
- subroutine ocn_tracer_hadv3_init(err)!{{{
-
- !--------------------------------------------------------------------
-
- !-----------------------------------------------------------------
- !
- ! call individual init routines for each parameterization
- !
- !-----------------------------------------------------------------
-
- integer, intent(out) :: err !< Output: error flag
-
- err = 0
- hadv3On = .false.
-
- if (config_horiz_tracer_adv_order == 3) then
- hadv3On = .true.
-
- coef_3rd_order = config_coef_3rd_order
- end if
-
- !--------------------------------------------------------------------
-
- end subroutine ocn_tracer_hadv3_init!}}}
-
-!***********************************************************************
-
-end module ocn_tracer_hadv3
-
-!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-! vim: foldmethod=marker
Deleted: trunk/mpas/src/core_ocean/mpas_ocn_tracer_hadv4.F
===================================================================
--- trunk/mpas/src/core_ocean/mpas_ocn_tracer_hadv4.F        2013-04-18 16:43:19 UTC (rev 2769)
+++ trunk/mpas/src/core_ocean/mpas_ocn_tracer_hadv4.F        2013-04-18 18:02:53 UTC (rev 2770)
@@ -1,229 +0,0 @@
-!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-!
-! ocn_tracer_hadv4
-!
-!> \brief MPAS ocean horizontal tracer advection 4th order
-!> \author Doug Jacobsen
-!> \date 16 September 2011
-!> \version SVN:$Id:$
-!> \details
-!> This module contains the main driver routine for computing
-!> horizontal advection tendencies.
-!
-!-----------------------------------------------------------------------
-
-module ocn_tracer_hadv4
-
- use mpas_grid_types
- use mpas_configure
-
- implicit none
- private
- save
-
- !--------------------------------------------------------------------
- !
- ! Public parameters
- !
- !--------------------------------------------------------------------
-
- !--------------------------------------------------------------------
- !
- ! Public member functions
- !
- !--------------------------------------------------------------------
-
- public :: ocn_tracer_hadv4_tend, &
- ocn_tracer_hadv4_init
-
- !--------------------------------------------------------------------
- !
- ! Private module variables
- !
- !--------------------------------------------------------------------
-
- logical :: hadv4On !< Flag to turning on/off 4th order hadv
-
-!***********************************************************************
-
-contains
-
-!***********************************************************************
-!
-! routine ocn_tracer_hadv4_tend
-!
-!> \brief Computes tendency term for horizontal tracer advection 4th order
-!> \author Phil Jones, Doug Jacobsen
-!> \date 15 September 2011
-!> \version SVN:$Id$
-!> \details
-!> This routine computes the horizontal advection tendency for tracer
-!> based on current state using a 4th order formulation.
-!
-!-----------------------------------------------------------------------
-
- subroutine ocn_tracer_hadv4_tend(grid, u, h_edge, tracers , tend, err)!{{{
-
- !-----------------------------------------------------------------
- !
- ! input variables
- !
- !-----------------------------------------------------------------
-
- real (kind=RKIND), dimension(:,:), intent(in) :: &
- u !< Input: tracer
-
- real (kind=RKIND), dimension(:,:), intent(in) :: &
- h_edge !< Input: thickness at edge
-
- real (kind=RKIND), dimension(:,:,:), intent(in) :: &
- tracers !< Input: tracers
-
- type (mesh_type), intent(in) :: &
- grid !< Input: grid information
-
- !-----------------------------------------------------------------
- !
- ! input/output variables
- !
- !-----------------------------------------------------------------
-
- real (kind=RKIND), dimension(:,:,:), intent(inout) :: &
- tend !< Input/Output: tracer tendency
-
- !-----------------------------------------------------------------
- !
- ! output variables
- !
- !-----------------------------------------------------------------
-
- integer, intent(out) :: err !< Output: error flag
-
- !-----------------------------------------------------------------
- !
- ! local variables
- !
- !-----------------------------------------------------------------
-
- integer :: iEdge, nEdges, cell1, cell2, iTracer, num_tracers, i, k, &
- boundaryMask
-
- integer, dimension(:), pointer :: maxLevelEdgeTop, nEdgesOnCell
- integer, dimension(:,:), pointer :: cellsOnEdge, cellsOnCell, cellMask
-
- real (kind=RKIND) :: flux, tracer_edge, d2fdx2_cell1, d2fdx2_cell2, invAreaCell1, invAreaCell2
-
- real (kind=RKIND), dimension(:), pointer :: dvEdge, dcEdge, areaCell
- real (kind=RKIND), dimension(:,:,:), pointer :: deriv_two
-
- !-----------------------------------------------------------------
- !
- ! call relevant routines for computing tendencies
- ! note that the user can choose multiple options and the
- ! tendencies will be added together
- !
- !-----------------------------------------------------------------
-
- err = 0
-
- if(.not.hadv4On) return
-
- nEdges = grid % nEdges
- num_tracers = size(tracers, dim=1)
- maxLevelEdgeTop => grid % maxLevelEdgeTop % array
- nEdgesOnCell => grid % nEdgesOnCell % array
- cellMask => grid % cellMask % array
- cellsOnEdge => grid % cellsOnEdge % array
- cellsOnCell => grid % cellsOnCell % array
- dvEdge => grid % dvEdge % array
- dcEdge => grid % dcEdge % array
- areaCell => grid % areaCell % array
- deriv_two => grid % deriv_two % array
-
- do iEdge=1,nEdges
- cell1 = cellsOnEdge(1,iEdge)
- cell2 = cellsOnEdge(2,iEdge)
-
- invAreaCell1 = 1.0 / areaCell(cell1)
- invAreaCell2 = 1.0 / areaCell(cell2)
-
- do k=1,maxLevelEdgeTop(iEdge)
-
- d2fdx2_cell1 = 0.0
- d2fdx2_cell2 = 0.0
-
- boundaryMask = abs(transfer(cellMask(k,cell1) == 1 .and. cellMask(k, cell2) == 1, boundaryMask))
-
- do iTracer=1,num_tracers
- d2fdx2_cell1 = deriv_two(1,1,iEdge) * tracers(iTracer,k,cell1) * boundaryMask
- d2fdx2_cell2 = deriv_two(1,2,iEdge) * tracers(iTracer,k,cell2) * boundaryMask
-
- !-- all edges of cell 1
- do i=1,nEdgesOnCell(cell1) * boundaryMask
- d2fdx2_cell1 = d2fdx2_cell1 + &
- deriv_two(i+1,1,iEdge) * tracers(iTracer,k,cellsOnCell(i,cell1))
- end do
-
- !-- all edges of cell 2
- do i=1,nEdgesOnCell(cell2) * boundaryMask
- d2fdx2_cell2 = d2fdx2_cell2 + &
- deriv_two(i+1,2,iEdge) * tracers(iTracer,k,cellsOnCell(i,cell2))
- end do
-
- flux = dvEdge(iEdge) * u(k,iEdge) * h_edge(k,iEdge) * ( &
- 0.5*(tracers(iTracer,k,cell1) + tracers(iTracer,k,cell2)) &
- -(dcEdge(iEdge) **2) * (d2fdx2_cell1 + d2fdx2_cell2) / 12. )
-
- !-- update tendency
- tend(iTracer,k,cell1) = tend(iTracer,k,cell1) - flux * invAreaCell1
- tend(iTracer,k,cell2) = tend(iTracer,k,cell2) + flux * invAreaCell2
- enddo
- end do
- end do
- !--------------------------------------------------------------------
-
- end subroutine ocn_tracer_hadv4_tend!}}}
-
-!***********************************************************************
-!
-! routine ocn_tracer_hadv4_init
-!
-!> \brief Initializes ocean tracer horizontal advection quantities
-!> \author Phil Jones, Doug Jacobsen
-!> \date 15 September 2011
-!> \version SVN:$Id$
-!> \details
-!> This routine initializes the 4th order formulation for
-!> horizontal tracer advection in the ocean.
-!
-!-----------------------------------------------------------------------
-
- subroutine ocn_tracer_hadv4_init(err)!{{{
-
- !--------------------------------------------------------------------
-
- !-----------------------------------------------------------------
- !
- ! call individual init routines for each parameterization
- !
- !-----------------------------------------------------------------
-
- integer, intent(out) :: err !< Output: Error flag
-
- err = 0
- hadv4On = .false.
-
- if (config_horiz_tracer_adv_order == 4) then
- hadv4On = .true.
- end if
-
- !--------------------------------------------------------------------
-
- end subroutine ocn_tracer_hadv4_init!}}}
-
-!***********************************************************************
-
-end module ocn_tracer_hadv4
-
-!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-! vim: foldmethod=marker
Modified: trunk/mpas/src/core_ocean/mpas_ocn_tracer_hmix.F
===================================================================
--- trunk/mpas/src/core_ocean/mpas_ocn_tracer_hmix.F        2013-04-18 16:43:19 UTC (rev 2769)
+++ trunk/mpas/src/core_ocean/mpas_ocn_tracer_hmix.F        2013-04-18 18:02:53 UTC (rev 2770)
@@ -73,7 +73,7 @@
!
!-----------------------------------------------------------------------
- subroutine ocn_tracer_hmix_tend(grid, h_edge, tracers, tend, err)!{{{
+ subroutine ocn_tracer_hmix_tend(grid, layerThicknessEdge, tracers, tend, err)!{{{
!-----------------------------------------------------------------
!
@@ -82,7 +82,7 @@
!-----------------------------------------------------------------
real (kind=RKIND), dimension(:,:), intent(in) :: &
- h_edge !< Input: thickness at edge
+ layerThicknessEdge !< Input: thickness at edge
type (mesh_type), intent(in) :: &
grid !< Input: grid information
@@ -126,10 +126,10 @@
if(.not.tracerHmixOn) return
call mpas_timer_start("del2", .false., del2Timer)
- call ocn_tracer_hmix_del2_tend(grid, h_edge, tracers, tend, err1)
+ call ocn_tracer_hmix_del2_tend(grid, layerThicknessEdge, tracers, tend, err1)
call mpas_timer_stop("del2", del2Timer)
call mpas_timer_start("del4", .false., del4Timer)
- call ocn_tracer_hmix_del4_tend(grid, h_edge, tracers, tend, err2)
+ call ocn_tracer_hmix_del4_tend(grid, layerThicknessEdge, tracers, tend, err2)
call mpas_timer_stop("del4", del4Timer)
err = ior(err1, err2)
Modified: trunk/mpas/src/core_ocean/mpas_ocn_tracer_hmix_del2.F
===================================================================
--- trunk/mpas/src/core_ocean/mpas_ocn_tracer_hmix_del2.F        2013-04-18 16:43:19 UTC (rev 2769)
+++ trunk/mpas/src/core_ocean/mpas_ocn_tracer_hmix_del2.F        2013-04-18 18:02:53 UTC (rev 2770)
@@ -67,7 +67,7 @@
!
!-----------------------------------------------------------------------
- subroutine ocn_tracer_hmix_del2_tend(grid, h_edge, tracers, tend, err)!{{{
+ subroutine ocn_tracer_hmix_del2_tend(grid, layerThicknessEdge, tracers, tend, err)!{{{
!-----------------------------------------------------------------
!
@@ -76,7 +76,7 @@
!-----------------------------------------------------------------
real (kind=RKIND), dimension(:,:), intent(in) :: &
- h_edge !< Input: thickness at edge
+ layerThicknessEdge !< Input: thickness at edge
type (mesh_type), intent(in) :: &
grid !< Input: grid information
@@ -168,7 +168,7 @@
tracer_turb_flux = tracers(iTracer, k, cell2) - tracers(iTracer, k, cell1)
! div(h \kappa_2 </font>
<font color="gray">abla \phi) at cell center
- flux = h_edge(k, iEdge) * tracer_turb_flux * edgeMask(k, iEdge) * r_tmp
+ flux = layerThicknessEdge(k, iEdge) * tracer_turb_flux * edgeMask(k, iEdge) * r_tmp
tend(iTracer, k, iCell) = tend(iTracer, k, iCell) - edgeSignOnCell(i, iCell) * flux * invAreaCell1
end do
Modified: trunk/mpas/src/core_ocean/mpas_ocn_tracer_hmix_del4.F
===================================================================
--- trunk/mpas/src/core_ocean/mpas_ocn_tracer_hmix_del4.F        2013-04-18 16:43:19 UTC (rev 2769)
+++ trunk/mpas/src/core_ocean/mpas_ocn_tracer_hmix_del4.F        2013-04-18 18:02:53 UTC (rev 2770)
@@ -67,7 +67,7 @@
!
!-----------------------------------------------------------------------
- subroutine ocn_tracer_hmix_del4_tend(grid, h_edge, tracers, tend, err)!{{{
+ subroutine ocn_tracer_hmix_del4_tend(grid, layerThicknessEdge, tracers, tend, err)!{{{
!-----------------------------------------------------------------
!
@@ -76,7 +76,7 @@
!-----------------------------------------------------------------
real (kind=RKIND), dimension(:,:), intent(in) :: &
- h_edge !< Input: thickness at edge
+ layerThicknessEdge !< Input: thickness at edge
type (mesh_type), intent(in) :: &
grid !< Input: grid information
@@ -168,8 +168,8 @@
do k = 1, maxLevelEdgeTop(iEdge)
do iTracer = 1, num_tracers * edgeMask(k, iEdge)
- r_tmp1 = invdcEdge * h_edge(k, iEdge) * tracers(iTracer, k, cell1)
- r_tmp2 = invdcEdge * h_edge(k, iEdge) * tracers(iTracer, k, cell2)
+ r_tmp1 = invdcEdge * layerThicknessEdge(k, iEdge) * tracers(iTracer, k, cell1)
+ r_tmp2 = invdcEdge * layerThicknessEdge(k, iEdge) * tracers(iTracer, k, cell2)
delsq_tracer(iTracer, k, iCell) = delsq_tracer(iTracer, k, iCell) - edgeSignOnCell(i, iCell) * (r_tmp2 - r_tmp1) * invAreaCell1
end do
Deleted: trunk/mpas/src/core_ocean/mpas_ocn_tracer_vadv.F
===================================================================
--- trunk/mpas/src/core_ocean/mpas_ocn_tracer_vadv.F        2013-04-18 16:43:19 UTC (rev 2769)
+++ trunk/mpas/src/core_ocean/mpas_ocn_tracer_vadv.F        2013-04-18 18:02:53 UTC (rev 2770)
@@ -1,187 +0,0 @@
-!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-!
-! ocn_tracer_vadv
-!
-!> \brief MPAS ocean vertical tracer advection driver
-!> \author Doug Jacobsen
-!> \date 16 September 2011
-!> \version SVN:$Id:$
-!> \details
-!> This module contains the main driver routine for computing
-!> vertical advection tendencies.
-!
-!-----------------------------------------------------------------------
-
-module ocn_tracer_vadv
-
- use mpas_grid_types
- use mpas_configure
-
- use ocn_tracer_vadv_stencil
- use ocn_tracer_vadv_spline
-
- implicit none
- private
- save
-
- !--------------------------------------------------------------------
- !
- ! Public parameters
- !
- !--------------------------------------------------------------------
-
- !--------------------------------------------------------------------
- !
- ! Public member functions
- !
- !--------------------------------------------------------------------
-
- public :: ocn_tracer_vadv_tend, &
- ocn_tracer_vadv_init
-
- !--------------------------------------------------------------------
- !
- ! Private module variables
- !
- !--------------------------------------------------------------------
-
- logical :: vadvOn
-
-
-!***********************************************************************
-
-contains
-
-!***********************************************************************
-!
-! routine ocn_tracer_vadv_tend
-!
-!> \brief Computes tendency term for vertical tracer advection
-!> \author Phil Jones, Doug Jacobsen
-!> \date 15 September 2011
-!> \version SVN:$Id$
-!> \details
-!> This routine computes the vertical advection tendency for tracer
-!> based on current state and user choices of advection parameterization.
-!> Multiple parameterizations may be chosen and added together. These
-!> tendencies are generally computed by calling the specific routine
-!> for the chosen parameterization, so this routine is primarily a
-!> driver for managing these choices.
-!
-!-----------------------------------------------------------------------
-
- subroutine ocn_tracer_vadv_tend(grid, h, wTop, tracers, tend, err)!{{{
-
- !-----------------------------------------------------------------
- !
- ! input variables
- !
- !-----------------------------------------------------------------
-
- real (kind=RKIND), dimension(:,:), intent(in) :: &
- h, & !< Input: layer thickness
- wTop !< Input: vertical tracer in top layer
-
- real (kind=RKIND), dimension(:,:,:), intent(in) :: &
- tracers !< Input: tracers
-
- type (mesh_type), intent(in) :: &
- grid !< Input: grid information
-
- !-----------------------------------------------------------------
- !
- ! input/output variables
- !
- !-----------------------------------------------------------------
-
- real (kind=RKIND), dimension(:,:,:), intent(inout) :: &
- tend !< Input/Output: tracer tendency
-
- !-----------------------------------------------------------------
- !
- ! output variables
- !
- !-----------------------------------------------------------------
-
- integer, intent(out) :: err !< Output: error flag
-
- !-----------------------------------------------------------------
- !
- ! local variables
- !
- !-----------------------------------------------------------------
-
- integer :: err1, err2
-
- !-----------------------------------------------------------------
- !
- ! call relevant routines for computing tendencies
- ! note that the user can choose multiple options and the
- ! tendencies will be added together
- !
- !-----------------------------------------------------------------
-
- err = 0
-
- if(.not.vadvOn) return
-
- call ocn_tracer_vadv_stencil_tend(grid, h, wTop, tracers, tend, err1)
- call ocn_tracer_vadv_spline_tend(grid, h, wTop, tracers, tend, err2)
-
- err = ior(err1, err2)
-
- !--------------------------------------------------------------------
-
- end subroutine ocn_tracer_vadv_tend!}}}
-
-!***********************************************************************
-!
-! routine ocn_tracer_vadv_init
-!
-!> \brief Initializes ocean tracer vertical advection quantities
-!> \author Phil Jones, Doug Jacobsen
-!> \date 15 September 2011
-!> \version SVN:$Id$
-!> \details
-!> This routine initializes a variety of quantities related to
-!> vertical tracer advection in the ocean. Since a variety of
-!> parameterizations are available, this routine primarily calls the
-!> individual init routines for each parameterization.
-!
-!-----------------------------------------------------------------------
-
- subroutine ocn_tracer_vadv_init(err)!{{{
-
- !--------------------------------------------------------------------
-
- !-----------------------------------------------------------------
- !
- ! call individual init routines for each parameterization
- !
- !-----------------------------------------------------------------
-
- integer, intent(out) :: err !< Output: error flag
-
- integer :: err1, err2
-
- err = 0
- vadvOn = .false.
-
- if (config_vert_coord_movement.ne.'isopycnal') then
- vadvOn = .true.
- call ocn_tracer_vadv_stencil_init(err1)
- call ocn_tracer_vadv_spline_init(err2)
-
- err = ior(err1, err2)
- endif
-
- !--------------------------------------------------------------------
-
- end subroutine ocn_tracer_vadv_init!}}}
-
-!***********************************************************************
-
-end module ocn_tracer_vadv
-
-!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-! vim: foldmethod=marker
Deleted: trunk/mpas/src/core_ocean/mpas_ocn_tracer_vadv_spline.F
===================================================================
--- trunk/mpas/src/core_ocean/mpas_ocn_tracer_vadv_spline.F        2013-04-18 16:43:19 UTC (rev 2769)
+++ trunk/mpas/src/core_ocean/mpas_ocn_tracer_vadv_spline.F        2013-04-18 18:02:53 UTC (rev 2770)
@@ -1,196 +0,0 @@
-!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-!
-! ocn_tracer_vadv_spline
-!
-!> \brief MPAS ocean vertical tracer advection driver
-!> \author Doug Jacobsen
-!> \date 16 September 2011
-!> \version SVN:$Id:$
-!> \details
-!> This module contains the main driver routine for computing
-!> vertical advection tendencies.
-!
-!-----------------------------------------------------------------------
-
-module ocn_tracer_vadv_spline
-
- use mpas_grid_types
- use mpas_configure
- use mpas_timer
-
- use ocn_tracer_vadv_spline2
- use ocn_tracer_vadv_spline3
-
- implicit none
- private
- save
-
- !--------------------------------------------------------------------
- !
- ! Public parameters
- !
- !--------------------------------------------------------------------
-
- !--------------------------------------------------------------------
- !
- ! Public member functions
- !
- !--------------------------------------------------------------------
-
- public :: ocn_tracer_vadv_spline_tend, &
- ocn_tracer_vadv_spline_init
-
- !--------------------------------------------------------------------
- !
- ! Private module variables
- !
- !--------------------------------------------------------------------
-
- type (timer_node), pointer :: spline2_timer, spline3_timer
- logical :: splineOn
-
-
-!***********************************************************************
-
-contains
-
-!***********************************************************************
-!
-! routine ocn_tracer_vadv_spline_tend
-!
-!> \brief Computes tendency term for vertical tracer advection
-!> \author Doug Jacobsen
-!> \date 16 September 2011
-!> \version SVN:$Id$
-!> \details
-!> This routine computes the vertical advection tendency for tracer
-!> based on current state and user choices of advection parameterization.
-!> Multiple parameterizations may be chosen and added together. These
-!> tendencies are generally computed by calling the specific routine
-!> for the chosen parameterization, so this routine is primarily a
-!> driver for managing these choices.
-!
-!-----------------------------------------------------------------------
-
- subroutine ocn_tracer_vadv_spline_tend(grid, h, wTop, tracers, tend, err)!{{{
-
- !-----------------------------------------------------------------
- !
- ! input variables
- !
- !-----------------------------------------------------------------
-
- real (kind=RKIND), dimension(:,:), intent(in) :: &
- h, & !< Input: layer thickness
- wTop !< Input: vertical tracer in top layer
-
- real (kind=RKIND), dimension(:,:,:), intent(in) :: &
- tracers !< Input: tracers
-
- type (mesh_type), intent(in) :: &
- grid !< Input: grid information
-
- !-----------------------------------------------------------------
- !
- ! input/output variables
- !
- !-----------------------------------------------------------------
-
- real (kind=RKIND), dimension(:,:,:), intent(inout) :: &
- tend !< Input/Output: tracer tendency
-
- !-----------------------------------------------------------------
- !
- ! output variables
- !
- !-----------------------------------------------------------------
-
- integer, intent(out) :: err !< Output: error flag
-
- !-----------------------------------------------------------------
- !
- ! local variables
- !
- !-----------------------------------------------------------------
-
- integer :: err1, err2
-
- !-----------------------------------------------------------------
- !
- ! call relevant routines for computing tendencies
- ! note that the user can choose multiple options and the
- ! tendencies will be added together
- !
- !-----------------------------------------------------------------
-
- err = 0
-
- if(.not.splineOn) return
-
- call mpas_timer_start("spline 2", .false., spline2_timer)
- call ocn_tracer_vadv_spline2_tend(grid, h, wTop, tracers, tend, err1)
- call mpas_timer_stop("spline 2", spline2_timer)
-
- call mpas_timer_start("spline 3", .false., spline3_timer)
- call ocn_tracer_vadv_spline3_tend(grid, h, wTop, tracers, tend, err2)
- call mpas_timer_stop("spline 3", spline3_timer)
-
- err = ior(err1, err2)
-
- !--------------------------------------------------------------------
-
- end subroutine ocn_tracer_vadv_spline_tend!}}}
-
-!***********************************************************************
-!
-! routine ocn_tracer_vadv_spline_init
-!
-!> \brief Initializes ocean tracer vertical advection quantities
-!> \author Doug Jacobsen
-!> \date 16 September 2011
-!> \version SVN:$Id$
-!> \details
-!> This routine initializes a variety of quantities related to
-!> vertical tracer advection in the ocean. Since a variety of
-!> parameterizations are available, this routine primarily calls the
-!> individual init routines for each parameterization.
-!
-!-----------------------------------------------------------------------
-
- subroutine ocn_tracer_vadv_spline_init(err)!{{{
-
- !--------------------------------------------------------------------
-
- !-----------------------------------------------------------------
- !
- ! call individual init routines for each parameterization
- !
- !-----------------------------------------------------------------
-
- integer, intent(out) :: err !< Output: error flag
-
- integer :: err1, err2
-
- err = 0
-
- splineOn = .false.
-
- if(config_vert_tracer_adv.eq.'spline') then
- splineOn = .true.
-
- call ocn_tracer_vadv_spline2_init(err1)
- call ocn_tracer_vadv_spline3_init(err2)
-
- err = ior(err1, err2)
- endif
-
- !--------------------------------------------------------------------
-
- end subroutine ocn_tracer_vadv_spline_init!}}}
-
-!***********************************************************************
-
-end module ocn_tracer_vadv_spline
-
-!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-! vim: foldmethod=marker
Deleted: trunk/mpas/src/core_ocean/mpas_ocn_tracer_vadv_spline2.F
===================================================================
--- trunk/mpas/src/core_ocean/mpas_ocn_tracer_vadv_spline2.F        2013-04-18 16:43:19 UTC (rev 2769)
+++ trunk/mpas/src/core_ocean/mpas_ocn_tracer_vadv_spline2.F        2013-04-18 18:02:53 UTC (rev 2770)
@@ -1,208 +0,0 @@
-!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-!
-! ocn_tracer_vadv_spline2
-!
-!> \brief MPAS ocean vertical tracer advection driver
-!> \author Doug Jacobsen
-!> \date 16 September 2011
-!> \version SVN:$Id:$
-!> \details
-!> This module contains the main driver routine for computing
-!> vertical advection tendencies.
-!
-!-----------------------------------------------------------------------
-
-module ocn_tracer_vadv_spline2
-
- use mpas_grid_types
- use mpas_configure
-
- implicit none
- private
- save
-
- !--------------------------------------------------------------------
- !
- ! Public parameters
- !
- !--------------------------------------------------------------------
-
- !--------------------------------------------------------------------
- !
- ! Public member functions
- !
- !--------------------------------------------------------------------
-
- public :: ocn_tracer_vadv_spline2_tend, &
- ocn_tracer_vadv_spline2_init
-
- !--------------------------------------------------------------------
- !
- ! Private module variables
- !
- !--------------------------------------------------------------------
-
- logical :: spline2On
-
-
-!***********************************************************************
-
-contains
-
-!***********************************************************************
-!
-! routine ocn_tracer_vadv_spline2_tend
-!
-!> \brief Computes tendency term for vertical tracer advection 2nd order spline
-!> \author Doug Jacobsen
-!> \date 16 September 2011
-!> \version SVN:$Id$
-!> \details
-!> This routine computes the vertical advection tendency for tracer
-!> based on current state using a 2nd order spline.
-!
-!-----------------------------------------------------------------------
-
- subroutine ocn_tracer_vadv_spline2_tend(grid, h, wTop, tracers, tend, err)!{{{
-
- !-----------------------------------------------------------------
- !
- ! input variables
- !
- !-----------------------------------------------------------------
-
- real (kind=RKIND), dimension(:,:), intent(in) :: &
- h, & !< Input: layer thickness
- wTop !< Input: vertical tracer in top layer
-
- real (kind=RKIND), dimension(:,:,:), intent(in) :: &
- tracers !< Input: tracers
-
- type (mesh_type), intent(in) :: &
- grid !< Input: grid information
-
- !-----------------------------------------------------------------
- !
- ! input/output variables
- !
- !-----------------------------------------------------------------
-
- real (kind=RKIND), dimension(:,:,:), intent(inout) :: &
- tend !< Input/Output: tracer tendency
-
- !-----------------------------------------------------------------
- !
- ! output variables
- !
- !-----------------------------------------------------------------
-
- integer, intent(out) :: err !< Output: error flag
-
- !-----------------------------------------------------------------
- !
- ! local variables
- !
- !-----------------------------------------------------------------
-
- integer :: iCell, nCells, nCellsSolve, k, iTracer, num_tracers, nVertLevels
-
- integer, dimension(:), pointer :: maxLevelCell
-
- real (kind=RKIND), dimension(:,:,:), allocatable :: tracerTop
-
- !-----------------------------------------------------------------
- !
- ! call relevant routines for computing tendencies
- ! note that the user can choose multiple options and the
- ! tendencies will be added together
- !
- !-----------------------------------------------------------------
-
- err = 0
-
- if(.not.spline2On) return
- ! Compute tracerTop using linear interpolation.
-
- nCells = grid % nCells
- nCellsSolve = grid % nCellsSolve
- nVertLevels = grid % nVertLevels
- num_tracers = size(tracers, 1)
- maxLevelCell => grid % maxLevelCell % array
-
- allocate(tracerTop(num_tracers,nVertLevels+1,nCells))
-
- do iCell=1,nCellsSolve
- tracerTop(:,1,iCell) = tracers(:,1,iCell)
- do k=2,maxLevelCell(iCell)
- do iTracer=1,num_tracers
- ! Note h on the k side is multiplied by tracer at k-1
- ! and h on the Km1 (k-1) side is mult. by tracer at k.
- tracerTop(iTracer,k,iCell) = &
- ( h(k ,iCell)*tracers(iTracer,k-1,iCell) &
- + h(k-1,iCell)*tracers(iTracer,k ,iCell) ) &
- / (h(k-1,iCell) + h(k,iCell))
- end do
- end do
- tracerTop(:,maxLevelCell(iCell)+1,iCell) = tracers(:,maxLevelCell(iCell),iCell)
- end do
-
- do iCell=1,nCellsSolve
- do k=1,maxLevelCell(iCell)
- do iTracer=1,num_tracers
- tend(iTracer,k,iCell) = tend(iTracer,k,iCell) &
- - ( wTop(k ,iCell)*tracerTop(iTracer,k ,iCell) &
- - wTop(k+1,iCell)*tracerTop(iTracer,k+1,iCell))
- end do
- end do
- end do
-
- deallocate(tracerTop)
- !--------------------------------------------------------------------
-
- end subroutine ocn_tracer_vadv_spline2_tend!}}}
-
-!***********************************************************************
-!
-! routine ocn_tracer_vadv_spline2_init
-!
-!> \brief Initializes ocean tracer vertical advection quantities
-!> \author Doug Jacobsen
-!> \date 16 September 2011
-!> \version SVN:$Id$
-!> \details
-!> This routine initializes a variety of quantities related to
-!> 2nd order spline based vertical tracer advection in the ocean.
-!
-!-----------------------------------------------------------------------
-
- subroutine ocn_tracer_vadv_spline2_init(err)!{{{
-
- !--------------------------------------------------------------------
-
- !-----------------------------------------------------------------
- !
- ! call individual init routines for each parameterization
- !
- !-----------------------------------------------------------------
-
- integer, intent(out) :: err !< Output: error flag
-
- err = 0
-
- spline2On = .false.
-
- if(config_vert_tracer_adv_order.eq.2) then
- spline2On = .true.
- endif
-
-
- !--------------------------------------------------------------------
-
- end subroutine ocn_tracer_vadv_spline2_init!}}}
-
-!***********************************************************************
-
-end module ocn_tracer_vadv_spline2
-
-!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-! vim: foldmethod=marker
Deleted: trunk/mpas/src/core_ocean/mpas_ocn_tracer_vadv_spline3.F
===================================================================
--- trunk/mpas/src/core_ocean/mpas_ocn_tracer_vadv_spline3.F        2013-04-18 16:43:19 UTC (rev 2769)
+++ trunk/mpas/src/core_ocean/mpas_ocn_tracer_vadv_spline3.F        2013-04-18 18:02:53 UTC (rev 2770)
@@ -1,233 +0,0 @@
-!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-!
-! ocn_tracer_vadv_spline3
-!
-!> \brief MPAS ocean vertical tracer advection driver
-!> \author Doug Jacobsen
-!> \date 16 September 2011
-!> \version SVN:$Id:$
-!> \details
-!> This module contains the main driver routine for computing
-!> vertical advection tendencies.
-!
-!-----------------------------------------------------------------------
-
-module ocn_tracer_vadv_spline3
-
- use mpas_grid_types
- use mpas_configure
- use mpas_spline_interpolation
-
- implicit none
- private
- save
-
- !--------------------------------------------------------------------
- !
- ! Public parameters
- !
- !--------------------------------------------------------------------
-
- !--------------------------------------------------------------------
- !
- ! Public member functions
- !
- !--------------------------------------------------------------------
-
- public :: ocn_tracer_vadv_spline3_tend, &
- ocn_tracer_vadv_spline3_init
-
- !--------------------------------------------------------------------
- !
- ! Private module variables
- !
- !--------------------------------------------------------------------
-
- logical :: spline3On
-
-
-!***********************************************************************
-
-contains
-
-!***********************************************************************
-!
-! routine ocn_tracer_vadv_spline3_tend
-!
-!> \brief Computes tendency term for vertical tracer advection 3rd order spline
-!> \author Doug Jacobsen
-!> \date 16 September 2011
-!> \version SVN:$Id$
-!> \details
-!> This routine computes the vertical advection tendency for tracer
-!> based on current state using a 3rd order spline.
-!
-!-----------------------------------------------------------------------
-
- subroutine ocn_tracer_vadv_spline3_tend(grid, h, wTop, tracers, tend, err)!{{{
-
- !-----------------------------------------------------------------
- !
- ! input variables
- !
- !-----------------------------------------------------------------
-
- real (kind=RKIND), dimension(:,:), intent(in) :: &
- h, & !< Input: layer thickness
- wTop !< Input: vertical tracer in top layer
-
- real (kind=RKIND), dimension(:,:,:), intent(in) :: &
- tracers !< Input: tracers
-
- type (mesh_type), intent(in) :: &
- grid !< Input: grid information
-
- !-----------------------------------------------------------------
- !
- ! input/output variables
- !
- !-----------------------------------------------------------------
-
- real (kind=RKIND), dimension(:,:,:), intent(inout) :: &
- tend !< Input/Output: tracer tendency
-
- !-----------------------------------------------------------------
- !
- ! output variables
- !
- !-----------------------------------------------------------------
-
- integer, intent(out) :: err !< Output: error flag
-
- !-----------------------------------------------------------------
- !
- ! local variables
- !
- !-----------------------------------------------------------------
-
- integer :: iCell, nCells, nCellsSolve, k, iTracer, num_tracers, nVertLevels
-
- integer, dimension(:), pointer :: maxLevelCell
-
- real (kind=RKIND), dimension(:), allocatable :: tracer2ndDer, &
- tracersIn, tracersOut, depthTop, depthMid
- real (kind=RKIND), dimension(:,:,:), allocatable :: tracerTop
-
- !-----------------------------------------------------------------
- !
- ! call relevant routines for computing tendencies
- ! note that the user can choose multiple options and the
- ! tendencies will be added together
- !
- !-----------------------------------------------------------------
-
- err = 0
-
- if(.not.spline3On) return
- ! Compute tracerTop using linear interpolation.
-
- nCells = grid % nCells
- nCellsSolve = grid % nCellsSolve
- nVertLevels = grid % nVertLevels
- num_tracers = size(tracers, 1)
- maxLevelCell => grid % maxLevelCell % array
-
- allocate(tracerTop(num_tracers,nVertLevels+1,nCells))
-
- ! Compute tracerTop using cubic spline interpolation.
-
- allocate(tracer2ndDer(nVertLevels))
- allocate(tracersIn(nVertLevels),tracersOut(nVertLevels), &
- depthMid(nVertLevels), depthTop(nVertLevels+1))
-
- do iCell=1,nCellsSolve
-
- ! Here depth considers SSH to be depth=0. We don't need to
- ! have true z-coordinate depths because it is just for interpolation.
- depthTop(1) = 0.0
- do k=1,maxLevelCell(iCell)
- depthMid(k ) = depthTop(k) + 0.5*h(k,iCell)
- depthTop(k+1) = depthTop(k) + h(k,iCell)
- enddo
-
- do iTracer=1,num_tracers
-
- ! Place data in arrays to avoid creating new temporary arrays for every
- ! subroutine call.
- tracersIn(1:maxLevelCell(iCell))=tracers(iTracer,1:maxLevelCell(iCell),iCell)
-
- call mpas_cubic_spline_coefficients(depthMid, &
- tracersIn, maxLevelCell(iCell), tracer2ndDer)
-
- call mpas_interpolate_cubic_spline( &
- depthMid, tracersIn, tracer2ndDer, maxLevelCell(iCell), &
- depthTop(2:maxLevelCell(iCell)), tracersOut, maxLevelCell(iCell)-1 )
-
- tracerTop(itracer,1,iCell) = tracers(iTracer,1,iCell)
- tracerTop(iTracer,2:maxLevelCell(iCell),iCell) = tracersOut(1:maxLevelCell(iCell)-1)
- tracerTop(itracer,maxLevelCell(iCell)+1,iCell) = tracers(iTracer,maxLevelCell(iCell),iCell)
- end do
- end do
-
- do iCell=1,nCellsSolve
- do k=1,maxLevelCell(iCell)
- do iTracer=1,num_tracers
- tend(iTracer,k,iCell) = tend(iTracer,k,iCell) &
- - ( wTop(k ,iCell)*tracerTop(iTracer,k ,iCell) &
- - wTop(k+1,iCell)*tracerTop(iTracer,k+1,iCell))
- end do
- end do
- end do
-
- deallocate(tracer2ndDer)
- deallocate(tracersIn,tracersOut, depthMid, depthTop)
- deallocate(tracerTop)
- !--------------------------------------------------------------------
-
- end subroutine ocn_tracer_vadv_spline3_tend!}}}
-
-!***********************************************************************
-!
-! routine ocn_tracer_vadv_spline3_init
-!
-!> \brief Initializes ocean tracer vertical advection quantities
-!> \author Doug Jacobsen
-!> \date 16 September 2011
-!> \version SVN:$Id$
-!> \details
-!> This routine initializes a variety of quantities related to
-!> 3rd order spline based vertical tracer advection in the ocean.
-!
-!-----------------------------------------------------------------------
-
- subroutine ocn_tracer_vadv_spline3_init(err)!{{{
-
- !--------------------------------------------------------------------
-
- !-----------------------------------------------------------------
- !
- ! call individual init routines for each parameterization
- !
- !-----------------------------------------------------------------
-
- integer, intent(out) :: err !< Output: error flag
-
- err = 0
-
- spline3On = .false.
-
- if(config_vert_tracer_adv_order.eq.3) then
- spline3On = .true.
- endif
-
-
- !--------------------------------------------------------------------
-
- end subroutine ocn_tracer_vadv_spline3_init!}}}
-
-!***********************************************************************
-
-end module ocn_tracer_vadv_spline3
-
-!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-! vim: foldmethod=marker
Deleted: trunk/mpas/src/core_ocean/mpas_ocn_tracer_vadv_stencil.F
===================================================================
--- trunk/mpas/src/core_ocean/mpas_ocn_tracer_vadv_stencil.F        2013-04-18 16:43:19 UTC (rev 2769)
+++ trunk/mpas/src/core_ocean/mpas_ocn_tracer_vadv_stencil.F        2013-04-18 18:02:53 UTC (rev 2770)
@@ -1,201 +0,0 @@
-!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-!
-! ocn_tracer_vadv_stencil
-!
-!> \brief MPAS ocean vertical tracer advection driver
-!> \author Doug Jacobsen
-!> \date 16 September 2011
-!> \version SVN:$Id:$
-!> \details
-!> This module contains the main driver routine for computing
-!> vertical advection tendencies.
-!
-!-----------------------------------------------------------------------
-
-module ocn_tracer_vadv_stencil
-
- use mpas_grid_types
- use mpas_configure
- use mpas_timer
-
- use ocn_tracer_vadv_stencil2
- use ocn_tracer_vadv_stencil3
- use ocn_tracer_vadv_stencil4
-
- implicit none
- private
- save
-
- !--------------------------------------------------------------------
- !
- ! Public parameters
- !
- !--------------------------------------------------------------------
-
- !--------------------------------------------------------------------
- !
- ! Public member functions
- !
- !--------------------------------------------------------------------
-
- public :: ocn_tracer_vadv_stencil_tend, &
- ocn_tracer_vadv_stencil_init
-
- !--------------------------------------------------------------------
- !
- ! Private module variables
- !
- !--------------------------------------------------------------------
-
- type (timer_node), pointer :: stencil2_timer, stencil3_timer, stencil4_timer
-
- logical :: stencilOn
-
-
-!***********************************************************************
-
-contains
-
-!***********************************************************************
-!
-! routine ocn_tracer_vadv_stencil_tend
-!
-!> \brief Computes tendency term for vertical tracer advection
-!> \author Phil Jones, Doug Jacobsen
-!> \date 15 September 2011
-!> \version SVN:$Id$
-!> \details
-!> This routine computes the vertical advection tendency for tracers
-!> based on current state and user choices of stencil based advection parameterization.
-!> Multiple parameterizations may be chosen and added together. These
-!> tendencies are generally computed by calling the specific routine
-!> for the chosen parameterization, so this routine is primarily a
-!> driver for managing these choices.
-!
-!-----------------------------------------------------------------------
-
- subroutine ocn_tracer_vadv_stencil_tend(grid, h, wTop, tracers, tend, err)!{{{
-
- !-----------------------------------------------------------------
- !
- ! input variables
- !
- !-----------------------------------------------------------------
-
- real (kind=RKIND), dimension(:,:), intent(in) :: &
- h, & !< Input: layer thickness
- wTop !< Input: vertical tracer in top layer
-
- real (kind=RKIND), dimension(:,:,:), intent(in) :: &
- tracers !< Input: tracers
-
- type (mesh_type), intent(in) :: &
- grid !< Input: grid information
-
- !-----------------------------------------------------------------
- !
- ! input/output variables
- !
- !-----------------------------------------------------------------
-
- real (kind=RKIND), dimension(:,:,:), intent(inout) :: &
- tend !< Input/Output: tracer tendency
-
- !-----------------------------------------------------------------
- !
- ! output variables
- !
- !-----------------------------------------------------------------
-
- integer, intent(out) :: err !< Output: error flag
-
- !-----------------------------------------------------------------
- !
- ! local variables
- !
- !-----------------------------------------------------------------
-
- integer :: err1, err2, err3
-
- !-----------------------------------------------------------------
- !
- ! call relevant routines for computing tendencies
- ! note that the user can choose multiple options and the
- ! tendencies will be added together
- !
- !-----------------------------------------------------------------
-
- err = 0
-
- if(.not. stencilOn) return
-
- call mpas_timer_start("stencil 2", .false., stencil2_timer)
- call ocn_tracer_vadv_stencil2_tend(grid, wTop, tracers, tend, err1)
- call mpas_timer_stop("stencil 2", stencil2_timer)
- call mpas_timer_start("stencil 3", .false., stencil3_timer)
- call ocn_tracer_vadv_stencil3_tend(grid, h, wTop, tracers, tend, err2)
- call mpas_timer_stop("stencil 3", stencil3_timer)
- call mpas_timer_start("stencil 4", .false., stencil4_timer)
- call ocn_tracer_vadv_stencil4_tend(grid, h, wTop, tracers, tend, err3)
- call mpas_timer_stop("stencil 4", stencil4_timer)
-
- err = ior(err1, ior(err2, err3))
-
- !--------------------------------------------------------------------
-
- end subroutine ocn_tracer_vadv_stencil_tend!}}}
-
-!***********************************************************************
-!
-! routine ocn_tracer_vadv_stencil_init
-!
-!> \brief Initializes ocean tracer vertical advection quantities
-!> \author Phil Jones, Doug Jacobsen
-!> \date 15 September 2011
-!> \version SVN:$Id$
-!> \details
-!> This routine initializes a variety of quantities related to
-!> stencil based vertical tracer advection in the ocean. Since a variety of
-!> parameterizations are available, this routine primarily calls the
-!> individual init routines for each parameterization.
-!
-!-----------------------------------------------------------------------
-
- subroutine ocn_tracer_vadv_stencil_init(err)!{{{
-
- !--------------------------------------------------------------------
-
- !-----------------------------------------------------------------
- !
- ! call individual init routines for each parameterization
- !
- !-----------------------------------------------------------------
-
- integer, intent(out) :: err !< Output: error flag
-
- integer :: err1, err2, err3
-
- err = 0
-
- stencilOn = .false.
-
- if (config_vert_tracer_adv.eq.'stencil') then
- stencilOn = .true.
-
- call ocn_tracer_vadv_stencil2_init(err1)
- call ocn_tracer_vadv_stencil3_init(err2)
- call ocn_tracer_vadv_stencil4_init(err3)
-
- err = ior(err1, ior(err2, err3))
- endif
-
- !--------------------------------------------------------------------
-
- end subroutine ocn_tracer_vadv_stencil_init!}}}
-
-!***********************************************************************
-
-end module ocn_tracer_vadv_stencil
-
-!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-! vim: foldmethod=marker
Deleted: trunk/mpas/src/core_ocean/mpas_ocn_tracer_vadv_stencil2.F
===================================================================
--- trunk/mpas/src/core_ocean/mpas_ocn_tracer_vadv_stencil2.F        2013-04-18 16:43:19 UTC (rev 2769)
+++ trunk/mpas/src/core_ocean/mpas_ocn_tracer_vadv_stencil2.F        2013-04-18 18:02:53 UTC (rev 2770)
@@ -1,208 +0,0 @@
-!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-!
-! ocn_tracer_vadv_stencil2
-!
-!> \brief MPAS ocean vertical tracer advection driver
-!> \author Doug Jacobsen
-!> \date 16 September 2011
-!> \version SVN:$Id:$
-!> \details
-!> This module contains the main driver routine for computing
-!> vertical advection tendencies.
-!
-!-----------------------------------------------------------------------
-
-module ocn_tracer_vadv_stencil2
-
- use mpas_grid_types
- use mpas_configure
-
- implicit none
- private
- save
-
- !--------------------------------------------------------------------
- !
- ! Public parameters
- !
- !--------------------------------------------------------------------
-
- !--------------------------------------------------------------------
- !
- ! Public member functions
- !
- !--------------------------------------------------------------------
-
- public :: ocn_tracer_vadv_stencil2_tend, &
- ocn_tracer_vadv_stencil2_init
-
- !--------------------------------------------------------------------
- !
- ! Private module variables
- !
- !--------------------------------------------------------------------
-
- logical :: stencil2On
-
-
-!***********************************************************************
-
-contains
-
-!***********************************************************************
-!
-! routine ocn_tracer_vadv_stencil2_tend
-!
-!> \brief Computes tendency term for vertical tracer advection 2nd order stencil
-!> \author Phil Jones, Doug Jacobsen
-!> \date 15 September 2011
-!> \version SVN:$Id$
-!> \details
-!> This routine computes the vertical advection tendency for tracer
-!> based on current state using a 2nd order stencil.
-!
-!-----------------------------------------------------------------------
-
- subroutine ocn_tracer_vadv_stencil2_tend(grid, wTop, tracers, tend, err)!{{{
-
- !-----------------------------------------------------------------
- !
- ! input variables
- !
- !-----------------------------------------------------------------
-
- real (kind=RKIND), dimension(:,:), intent(in) :: &
- wTop !< Input: vertical tracer in top layer
-
- real (kind=RKIND), dimension(:,:,:), intent(in) :: &
- tracers !< Input: tracers
-
- type (mesh_type), intent(in) :: &
- grid !< Input: grid information
-
- !-----------------------------------------------------------------
- !
- ! input/output variables
- !
- !-----------------------------------------------------------------
-
- real (kind=RKIND), dimension(:,:,:), intent(inout) :: &
- tend !< Input/Output: tracer tendency
-
- !-----------------------------------------------------------------
- !
- ! output variables
- !
- !-----------------------------------------------------------------
-
- integer, intent(out) :: err !< Output: error flag
-
- !-----------------------------------------------------------------
- !
- ! local variables
- !
- !-----------------------------------------------------------------
-
- integer :: nCellsSolve, iCell, k, iTracer, num_tracers, nVertLevels
- integer :: nCells
-
- integer, dimension(:), pointer :: maxLevelCell
-
- real (kind=RKIND), dimension(:,:,:), allocatable :: tracerTop
-
-
- !-----------------------------------------------------------------
- !
- ! call relevant routines for computing tendencies
- ! note that the user can choose multiple options and the
- ! tendencies will be added together
- !
- !-----------------------------------------------------------------
-
- err = 0
-
- if(.not.stencil2On) return
-
- nCells = grid % nCells
- nCellsSolve = grid % nCellsSolve
- num_tracers = size(tracers, 1)
- nVertLevels = grid % nVertLevels
- maxLevelCell => grid % maxLevelCell % array
-
- allocate(tracerTop(num_tracers,nVertLevels+1,nCells))
-
- ! Compute tracerTop using centered stencil, a simple average.
-
- do iCell=1,nCellsSolve
- tracerTop(:,1,iCell) = tracers(:,1,iCell)
- do k=2,maxLevelCell(iCell)
- do iTracer=1,num_tracers
- tracerTop(iTracer,k,iCell) = &
- ( tracers(iTracer,k-1,iCell) &
- +tracers(iTracer,k ,iCell))/2.0
- end do
- end do
- tracerTop(:,maxLevelCell(iCell)+1,iCell) = tracers(:,maxLevelCell(iCell),iCell)
- end do
-
- do iCell=1,nCellsSolve
- do k=1,maxLevelCell(iCell)
- do iTracer=1,num_tracers
- tend(iTracer,k,iCell) = tend(iTracer,k,iCell) &
- - ( wTop(k ,iCell)*tracerTop(iTracer,k ,iCell) &
- - wTop(k+1,iCell)*tracerTop(iTracer,k+1,iCell))
- end do
- end do
- end do
-
- deallocate(tracerTop)
- !--------------------------------------------------------------------
-
- end subroutine ocn_tracer_vadv_stencil2_tend!}}}
-
-!***********************************************************************
-!
-! routine ocn_tracer_vadv_stencil2_init
-!
-!> \brief Initializes ocean tracer vertical advection quantities
-!> \author Phil Jones, Doug Jacobsen
-!> \date 15 September 2011
-!> \version SVN:$Id$
-!> \details
-!> This routine initializes a variety of quantities related to
-!> a 2nd order stencil based vertical tracer advection in the ocean.
-!
-!-----------------------------------------------------------------------
-
- subroutine ocn_tracer_vadv_stencil2_init(err)!{{{
-
- !--------------------------------------------------------------------
-
- !-----------------------------------------------------------------
- !
- ! call individual init routines for each parameterization
- !
- !-----------------------------------------------------------------
-
- integer, intent(out) :: err !< Output: error flag
-
- integer :: err1, err2, err3
-
- err = 0
- stencil2On = .false.
-
- if(config_vert_tracer_adv_order.eq.2) then
- stencil2On = .true.
- endif
-
-
- !--------------------------------------------------------------------
-
- end subroutine ocn_tracer_vadv_stencil2_init!}}}
-
-!***********************************************************************
-
-end module ocn_tracer_vadv_stencil2
-
-!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-! vim: foldmethod=marker
Deleted: trunk/mpas/src/core_ocean/mpas_ocn_tracer_vadv_stencil3.F
===================================================================
--- trunk/mpas/src/core_ocean/mpas_ocn_tracer_vadv_stencil3.F        2013-04-18 16:43:19 UTC (rev 2769)
+++ trunk/mpas/src/core_ocean/mpas_ocn_tracer_vadv_stencil3.F        2013-04-18 18:02:53 UTC (rev 2770)
@@ -1,230 +0,0 @@
-!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-!
-! ocn_tracer_vadv_stencil3
-!
-!> \brief MPAS ocean vertical tracer advection driver
-!> \author Doug Jacobsen
-!> \date 16 September 2011
-!> \version SVN:$Id:$
-!> \details
-!> This module contains the main driver routine for computing
-!> vertical advection tendencies.
-!
-!-----------------------------------------------------------------------
-
-module ocn_tracer_vadv_stencil3
-
- use mpas_grid_types
- use mpas_configure
-
- implicit none
- private
- save
-
- !--------------------------------------------------------------------
- !
- ! Public parameters
- !
- !--------------------------------------------------------------------
-
- !--------------------------------------------------------------------
- !
- ! Public member functions
- !
- !--------------------------------------------------------------------
-
- public :: ocn_tracer_vadv_stencil3_tend, &
- ocn_tracer_vadv_stencil3_init
-
- !--------------------------------------------------------------------
- !
- ! Private module variables
- !
- !--------------------------------------------------------------------
-
- logical :: stencil3On
-
-
-!***********************************************************************
-
-contains
-
-!***********************************************************************
-!
-! routine ocn_tracer_vadv_stencil3_tend
-!
-!> \brief Computes tendency term for vertical tracer advection 3rd order stencil
-!> \author Phil Jones, Doug Jacobsen
-!> \date 15 September 2011
-!> \version SVN:$Id$
-!> \details
-!> This routine computes the vertical advection tendency for tracer
-!> based on current state using a 3rd order stencil.
-!
-!-----------------------------------------------------------------------
-
- subroutine ocn_tracer_vadv_stencil3_tend(grid, h, wTop, tracers, tend, err)!{{{
-
- !-----------------------------------------------------------------
- !
- ! input variables
- !
- !-----------------------------------------------------------------
-
- real (kind=RKIND), dimension(:,:), intent(in) :: &
- h, & !< Input: layer thickness
- wTop !< Input: vertical tracer in top layer
-
- real (kind=RKIND), dimension(:,:,:), intent(in) :: &
- tracers !< Input: tracers
-
- type (mesh_type), intent(in) :: &
- grid !< Input: grid information
-
- !-----------------------------------------------------------------
- !
- ! input/output variables
- !
- !-----------------------------------------------------------------
-
- real (kind=RKIND), dimension(:,:,:), intent(inout) :: &
- tend !< Input/Output: tracer tendency
-
- !-----------------------------------------------------------------
- !
- ! output variables
- !
- !-----------------------------------------------------------------
-
- integer, intent(out) :: err !< Output: error flag
-
- !-----------------------------------------------------------------
- !
- ! local variables
- !
- !-----------------------------------------------------------------
-
- integer :: nCellsSolve, iCell, k, iTracer, num_tracers, nVertLevels
- integer :: nCells
-
- integer, dimension(:), pointer :: maxLevelCell
-
- real (kind=RKIND) :: cSignWTop, flux3Coef
- real (kind=RKIND), dimension(:,:,:), allocatable :: tracerTop
-
-
- !-----------------------------------------------------------------
- !
- ! call relevant routines for computing tendencies
- ! note that the user can choose multiple options and the
- ! tendencies will be added together
- !
- !-----------------------------------------------------------------
-
- err = 0
-
- if(.not.stencil3On) return
-
- nCells = grid % nCells
- nCellsSolve = grid % nCellsSolve
- num_tracers = size(tracers, 1)
- nVertLevels = grid % nVertLevels
- maxLevelCell => grid % maxLevelCell % array
-
- allocate(tracerTop(num_tracers,nVertLevels+1,nCells))
-
- ! Compute tracerTop using 3rd order stencil. This is the same
- ! as 4th order, but includes upwinding.
-
- ! Hardwire flux3Coeff at 1.0 for now. Could add this to the
- ! namelist, if desired.
- flux3Coef = 1.0
- do iCell=1,nCellsSolve
- tracerTop(:,1,iCell) = tracers(:,1,iCell)
- k=2
- do iTracer=1,num_tracers
- tracerTop(iTracer,k,iCell) = &
- ( h(k,iCell)*tracers(iTracer,k-1,iCell) &
- + h(k-1,iCell)*tracers(iTracer,k ,iCell) ) &
- / (h(k-1,iCell) + h(k,iCell))
- end do
- do k=3,maxLevelCell(iCell)-1
- cSignWTop = sign(flux3Coef,wTop(k,iCell))
- do iTracer=1,num_tracers
- tracerTop(iTracer,k,iCell) = &
- ( (-1.+ cSignWTop)*tracers(iTracer,k-2,iCell) &
- +( 7.-3.*cSignWTop)*tracers(iTracer,k-1,iCell) &
- +( 7.+3.*cSignWTop)*tracers(iTracer,k ,iCell) &
- +(-1.- cSignWTop)*tracers(iTracer,k+1,iCell) &
- )/12.
- end do
- end do
- k=maxLevelCell(iCell)
- do iTracer=1,num_tracers
- tracerTop(iTracer,k,iCell) = &
- ( h(k,iCell)*tracers(iTracer,k-1,iCell) &
- + h(k-1,iCell)*tracers(iTracer,k ,iCell) ) &
- / (h(k-1,iCell) + h(k,iCell))
- end do
- tracerTop(:,maxLevelCell(iCell)+1,iCell) = tracers(:,maxLevelCell(iCell),iCell)
- end do
-
- do iCell=1,nCellsSolve
- do k=1,maxLevelCell(iCell)
- do iTracer=1,num_tracers
- tend(iTracer,k,iCell) = tend(iTracer,k,iCell) &
- - ( wTop(k ,iCell)*tracerTop(iTracer,k ,iCell) &
- - wTop(k+1,iCell)*tracerTop(iTracer,k+1,iCell))
- end do
- end do
- end do
-
- deallocate(tracerTop)
- !--------------------------------------------------------------------
-
- end subroutine ocn_tracer_vadv_stencil3_tend!}}}
-
-!***********************************************************************
-!
-! routine ocn_tracer_vadv_stencil3_init
-!
-!> \brief Initializes ocean tracer vertical advection quantities
-!> \author Phil Jones, Doug Jacobsen
-!> \date 15 September 2011
-!> \version SVN:$Id$
-!> \details
-!> This routine initializes a variety of quantities related to
-!> 3rd order stencil based vertical tracer advection in the ocean.
-!
-!-----------------------------------------------------------------------
-
- subroutine ocn_tracer_vadv_stencil3_init(err)!{{{
-
- !--------------------------------------------------------------------
-
- !-----------------------------------------------------------------
- !
- ! call individual init routines for each parameterization
- !
- !-----------------------------------------------------------------
-
- integer, intent(out) :: err !< Output: error flag
-
- err = 0
- stencil3On = .false.
-
- if(config_vert_tracer_adv_order.eq.3) then
- stencil3On = .true.
- endif
-
-
- !--------------------------------------------------------------------
-
- end subroutine ocn_tracer_vadv_stencil3_init!}}}
-
-!***********************************************************************
-
-end module ocn_tracer_vadv_stencil3
-
-!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-! vim: foldmethod=marker
Deleted: trunk/mpas/src/core_ocean/mpas_ocn_tracer_vadv_stencil4.F
===================================================================
--- trunk/mpas/src/core_ocean/mpas_ocn_tracer_vadv_stencil4.F        2013-04-18 16:43:19 UTC (rev 2769)
+++ trunk/mpas/src/core_ocean/mpas_ocn_tracer_vadv_stencil4.F        2013-04-18 18:02:53 UTC (rev 2770)
@@ -1,225 +0,0 @@
-!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-!
-! ocn_tracer_vadv_stencil4
-!
-!> \brief MPAS ocean vertical tracer advection driver
-!> \author Doug Jacobsen
-!> \date 16 September 2011
-!> \version SVN:$Id:$
-!> \details
-!> This module contains the main driver routine for computing
-!> vertical advection tendencies.
-!
-!-----------------------------------------------------------------------
-
-module ocn_tracer_vadv_stencil4
-
- use mpas_grid_types
- use mpas_configure
-
- implicit none
- private
- save
-
- !--------------------------------------------------------------------
- !
- ! Public parameters
- !
- !--------------------------------------------------------------------
-
- !--------------------------------------------------------------------
- !
- ! Public member functions
- !
- !--------------------------------------------------------------------
-
- public :: ocn_tracer_vadv_stencil4_tend, &
- ocn_tracer_vadv_stencil4_init
-
- !--------------------------------------------------------------------
- !
- ! Private module variables
- !
- !--------------------------------------------------------------------
-
- logical :: stencil4On
-
-
-!***********************************************************************
-
-contains
-
-!***********************************************************************
-!
-! routine ocn_tracer_vadv_stencil4_tend
-!
-!> \brief Computes tendency term for vertical tracer advection 4th order stencil
-!> \author Phil Jones, Doug Jacobsen
-!> \date 15 September 2011
-!> \version SVN:$Id$
-!> \details
-!> This routine computes the vertical advection tendency for tracer
-!> based on current state using a 4th order stencil.
-!
-!-----------------------------------------------------------------------
-
- subroutine ocn_tracer_vadv_stencil4_tend(grid, h, wTop, tracers, tend, err)!{{{
-
- !-----------------------------------------------------------------
- !
- ! input variables
- !
- !-----------------------------------------------------------------
-
- real (kind=RKIND), dimension(:,:), intent(in) :: &
- h, & !< Input: layer thickness
- wTop !< Input: vertical tracer in top layer
-
- real (kind=RKIND), dimension(:,:,:), intent(in) :: &
- tracers !< Input: tracers
-
- type (mesh_type), intent(in) :: &
- grid !< Input: grid information
-
- !-----------------------------------------------------------------
- !
- ! input/output variables
- !
- !-----------------------------------------------------------------
-
- real (kind=RKIND), dimension(:,:,:), intent(inout) :: &
- tend !< Input/Output: tracer tendency
-
- !-----------------------------------------------------------------
- !
- ! output variables
- !
- !-----------------------------------------------------------------
-
- integer, intent(out) :: err !< Output: error flag
-
- !-----------------------------------------------------------------
- !
- ! local variables
- !
- !-----------------------------------------------------------------
-
- integer :: nCellsSolve, iCell, k, iTracer, num_tracers, nVertLevels
- integer :: nCells
-
- integer, dimension(:), pointer :: maxLevelCell
-
- real (kind=RKIND) :: cSingWTop, flux3Coef
- real (kind=RKIND), dimension(:,:,:), allocatable :: tracerTop
-
-
- !-----------------------------------------------------------------
- !
- ! call relevant routines for computing tendencies
- ! note that the user can choose multiple options and the
- ! tendencies will be added together
- !
- !-----------------------------------------------------------------
-
- err = 0
-
- if(.not.Stencil4On) return
-
- nCells = grid % nCells
- nCellsSolve = grid % nCellsSolve
- num_tracers = size(tracers, 1)
- nVertLevels = grid % nVertLevels
- maxLevelCell => grid % maxLevelCell % array
-
- allocate(tracerTop(num_tracers,nVertLevels+1,nCells))
-
- ! Compute tracerTop using 4rd order stencil [-1 7 7 -1]
-
- do iCell=1,nCellsSolve
- tracerTop(:,1,iCell) = tracers(:,1,iCell)
- k=2
- do iTracer=1,num_tracers
- tracerTop(iTracer,k,iCell) = &
- ( h(k ,iCell)*tracers(iTracer,k-1,iCell) &
- + h(k-1,iCell)*tracers(iTracer,k ,iCell) ) &
- / (h(k-1,iCell) + h(k,iCell))
- end do
- do k=3,maxLevelCell(iCell)-1
- do iTracer=1,num_tracers
- tracerTop(iTracer,k,iCell) = &
- (- tracers(iTracer,k-2,iCell) &
- +7.*tracers(iTracer,k-1,iCell) &
- +7.*tracers(iTracer,k ,iCell) &
- - tracers(iTracer,k+1,iCell) &
- )/12.
- end do
- end do
- k=maxLevelCell(iCell)
- do iTracer=1,num_tracers
- tracerTop(iTracer,k,iCell) = &
- ( h(k ,iCell)*tracers(iTracer,k-1,iCell) &
- + h(k-1,iCell)*tracers(iTracer,k ,iCell) ) &
- / (h(k-1,iCell) + h(k,iCell))
- end do
- tracerTop(:,maxLevelCell(iCell)+1,iCell) = tracers(:,maxLevelCell(iCell),iCell)
- end do
-
- do iCell=1,nCellsSolve
- do k=1,maxLevelCell(iCell)
- do iTracer=1,num_tracers
- tend(iTracer,k,iCell) = tend(iTracer,k,iCell) &
- - ( wTop(k ,iCell)*tracerTop(iTracer,k ,iCell) &
- - wTop(k+1,iCell)*tracerTop(iTracer,k+1,iCell))
- end do
- end do
- end do
-
- deallocate(tracerTop)
- !--------------------------------------------------------------------
-
- end subroutine ocn_tracer_vadv_stencil4_tend!}}}
-
-!***********************************************************************
-!
-! routine ocn_tracer_vadv_stencil4_init
-!
-!> \brief Initializes ocean tracer vertical advection quantities
-!> \author Phil Jones, Doug Jacobsen
-!> \date 15 September 2011
-!> \version SVN:$Id$
-!> \details
-!> This routine initializes a variety of quantities related to
-!> 4th order stencil based vertical tracer advection in the ocean.
-!
-!-----------------------------------------------------------------------
-
- subroutine ocn_tracer_vadv_stencil4_init(err)!{{{
-
- !--------------------------------------------------------------------
-
- !-----------------------------------------------------------------
- !
- ! call individual init routines for each parameterization
- !
- !-----------------------------------------------------------------
-
- integer, intent(out) :: err !< Output: error flag
-
- err = 0
- stencil4On = .false.
-
- if(config_vert_tracer_adv_order.eq.4) then
- stencil4On = .true.
- endif
-
-
- !--------------------------------------------------------------------
-
- end subroutine ocn_tracer_vadv_stencil4_init!}}}
-
-!***********************************************************************
-
-end module ocn_tracer_vadv_stencil4
-
-!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-! vim: foldmethod=marker
Modified: trunk/mpas/src/core_ocean/mpas_ocn_vel_coriolis.F
===================================================================
--- trunk/mpas/src/core_ocean/mpas_ocn_vel_coriolis.F        2013-04-18 16:43:19 UTC (rev 2769)
+++ trunk/mpas/src/core_ocean/mpas_ocn_vel_coriolis.F        2013-04-18 18:02:53 UTC (rev 2770)
@@ -63,7 +63,7 @@
!
!-----------------------------------------------------------------------
- subroutine ocn_vel_coriolis_tend(grid, Vor_edge, h_edge, u, ke, tend, err)!{{{
+ subroutine ocn_vel_coriolis_tend(grid, Vor_edge, layerThicknessEdge, normalVelocity, kineticEnergy, tend, err)!{{{
!-----------------------------------------------------------------
!
@@ -74,11 +74,11 @@
real (kind=RKIND), dimension(:,:), intent(in) :: &
Vor_edge !< Input: Potential vorticity on edge
real (kind=RKIND), dimension(:,:), intent(in) :: &
- h_edge !< Input: Thickness on edge
+ layerThicknessEdge !< Input: Thickness on edge
real (kind=RKIND), dimension(:,:), intent(in) :: &
- u !< Input: Horizontal velocity
+ normalVelocity !< Input: Horizontal velocity
real (kind=RKIND), dimension(:,:), intent(in) :: &
- ke !< Input: Kinetic Energy
+ kineticEnergy !< Input: Kinetic Energy
type (mesh_type), intent(in) :: &
grid !< Input: grid information
@@ -142,10 +142,10 @@
do j = 1,nEdgesOnEdge(iEdge)
eoe = edgesOnEdge(j,iEdge)
workpv = 0.5 * (Vor_edge(k,iEdge) + Vor_edge(k,eoe))
- q = q + weightsOnEdge(j,iEdge) * u(k,eoe) * workpv * h_edge(k,eoe)
+ q = q + weightsOnEdge(j,iEdge) * normalVelocity(k,eoe) * workpv * layerThicknessEdge(k,eoe)
end do
- tend(k,iEdge) = tend(k,iEdge) + edgeMask(k, iEdge) * (q - ( ke(k,cell2) - ke(k,cell1) ) * invLength )
+ tend(k,iEdge) = tend(k,iEdge) + edgeMask(k, iEdge) * (q - ( kineticEnergy(k,cell2) - kineticEnergy(k,cell1) ) * invLength )
end do
end do
@@ -186,7 +186,7 @@
coriolisOn = .true.
- if(config_disable_u_coriolis) coriolisOn = .false.
+ if(config_disable_vel_coriolis) coriolisOn = .false.
!--------------------------------------------------------------------
Modified: trunk/mpas/src/core_ocean/mpas_ocn_vel_forcing.F
===================================================================
--- trunk/mpas/src/core_ocean/mpas_ocn_vel_forcing.F        2013-04-18 16:43:19 UTC (rev 2769)
+++ trunk/mpas/src/core_ocean/mpas_ocn_vel_forcing.F        2013-04-18 18:02:53 UTC (rev 2770)
@@ -68,7 +68,7 @@
!
!-----------------------------------------------------------------------
- subroutine ocn_vel_forcing_tend(grid, u, u_src, ke_edge, h_edge, tend, err)!{{{
+ subroutine ocn_vel_forcing_tend(grid, u, normalVelocityForcing, kineticEnergyEdge, layerThicknessEdge, tend, err)!{{{
!-----------------------------------------------------------------
!
@@ -80,13 +80,13 @@
u !< Input: velocity
real (kind=RKIND), dimension(:,:), intent(in) :: &
- u_src !< Input: wind stress
+ normalVelocityForcing !< Input: wind stress
real (kind=RKIND), dimension(:,:), intent(in) :: &
- ke_edge !< Input: kinetic energy at edge
+ kineticEnergyEdge !< Input: kinetic energy at edge
real (kind=RKIND), dimension(:,:), intent(in) :: &
- h_edge !< Input: thickness at edge
+ layerThicknessEdge !< Input: thickness at edge
type (mesh_type), intent(in) :: &
grid !< Input: grid information
@@ -124,7 +124,7 @@
!
!-----------------------------------------------------------------
- call ocn_vel_forcing_windstress_tend(grid, u_src, h_edge, tend, err1)
+ call ocn_vel_forcing_windstress_tend(grid, normalVelocityForcing, layerThicknessEdge, tend, err1)
call ocn_vel_forcing_rayleigh_tend(grid, u, tend, err2)
err = ior(err1, err2)
Modified: trunk/mpas/src/core_ocean/mpas_ocn_vel_forcing_rayleigh.F
===================================================================
--- trunk/mpas/src/core_ocean/mpas_ocn_vel_forcing_rayleigh.F        2013-04-18 16:43:19 UTC (rev 2769)
+++ trunk/mpas/src/core_ocean/mpas_ocn_vel_forcing_rayleigh.F        2013-04-18 18:02:53 UTC (rev 2770)
@@ -64,7 +64,7 @@
!
!-----------------------------------------------------------------------
- subroutine ocn_vel_forcing_rayleigh_tend(grid, u, tend, err)!{{{
+ subroutine ocn_vel_forcing_rayleigh_tend(grid, normalVelocity, tend, err)!{{{
!-----------------------------------------------------------------
!
@@ -73,7 +73,7 @@
!-----------------------------------------------------------------
real (kind=RKIND), dimension(:,:), intent(in) :: &
- u !< Input: velocity
+ normalVelocity !< Input: velocity
type (mesh_type), intent(in) :: &
grid !< Input: grid information
@@ -122,7 +122,7 @@
do iEdge=1,nEdgesSolve
do k=1,maxLevelEdgeTop(iEdge)
- tend(k,iEdge) = tend(k,iEdge) - rayleighDampingCoef * u(k,iEdge)
+ tend(k,iEdge) = tend(k,iEdge) - rayleighDampingCoef * normalVelocity(k,iEdge)
enddo
enddo
Modified: trunk/mpas/src/core_ocean/mpas_ocn_vel_forcing_windstress.F
===================================================================
--- trunk/mpas/src/core_ocean/mpas_ocn_vel_forcing_windstress.F        2013-04-18 16:43:19 UTC (rev 2769)
+++ trunk/mpas/src/core_ocean/mpas_ocn_vel_forcing_windstress.F        2013-04-18 18:02:53 UTC (rev 2770)
@@ -62,7 +62,7 @@
!
!-----------------------------------------------------------------------
- subroutine ocn_vel_forcing_windstress_tend(grid, u_src, h_edge, tend, err)!{{{
+ subroutine ocn_vel_forcing_windstress_tend(grid, normalVelocityForcing, layerThicknessEdge, tend, err)!{{{
!-----------------------------------------------------------------
!
@@ -71,10 +71,10 @@
!-----------------------------------------------------------------
real (kind=RKIND), dimension(:,:), intent(in) :: &
- u_src !< Input: wind stress
+ normalVelocityForcing !< Input: wind stress
real (kind=RKIND), dimension(:,:), intent(in) :: &
- h_edge !< Input: thickness at edge
+ layerThicknessEdge !< Input: thickness at edge
type (mesh_type), intent(in) :: &
grid !< Input: grid information
@@ -130,7 +130,7 @@
do k = 1,min(maxLevelEdgeTop(iEdge),1)
! forcing in top layer only
- tend(k,iEdge) = tend(k,iEdge) + edgeMask(k, iEdge) * (u_src(k,iEdge) / config_rho0 / h_edge(k,iEdge))
+ tend(k,iEdge) = tend(k,iEdge) + edgeMask(k, iEdge) * (normalVelocityForcing(k,iEdge) / config_density0 / layerThicknessEdge(k,iEdge))
enddo
enddo
@@ -168,7 +168,7 @@
windStressOn = .true.
- if(config_disable_u_windstress) windStressOn = .false.
+ if(config_disable_vel_windstress) windStressOn = .false.
err = 0
Modified: trunk/mpas/src/core_ocean/mpas_ocn_vel_hmix.F
===================================================================
--- trunk/mpas/src/core_ocean/mpas_ocn_vel_hmix.F        2013-04-18 16:43:19 UTC (rev 2769)
+++ trunk/mpas/src/core_ocean/mpas_ocn_vel_hmix.F        2013-04-18 18:02:53 UTC (rev 2770)
@@ -74,7 +74,7 @@
!
!-----------------------------------------------------------------------
- subroutine ocn_vel_hmix_tend(grid, divergence, vorticity, viscosity, tend, err)!{{{
+ subroutine ocn_vel_hmix_tend(grid, divergence, relativeVorticity, viscosity, tend, err)!{{{
!-----------------------------------------------------------------
!
@@ -86,7 +86,7 @@
divergence !< Input: velocity divergence
real (kind=RKIND), dimension(:,:), intent(in) :: &
- vorticity !< Input: vorticity
+ relativeVorticity !< Input: relative vorticity
type (mesh_type), intent(in) :: &
grid !< Input: grid information
@@ -132,15 +132,15 @@
viscosity = 0.0
call mpas_timer_start("del2", .false., del2Timer)
- call ocn_vel_hmix_del2_tend(grid, divergence, vorticity, viscosity, tend, err1)
+ call ocn_vel_hmix_del2_tend(grid, divergence, relativeVorticity, viscosity, tend, err1)
call mpas_timer_stop("del2", del2Timer)
call mpas_timer_start("leith", .false., leithTimer)
- call ocn_vel_hmix_leith_tend(grid, divergence, vorticity, viscosity, tend, err2)
+ call ocn_vel_hmix_leith_tend(grid, divergence, relativeVorticity, viscosity, tend, err2)
call mpas_timer_stop("leith", leithTimer)
call mpas_timer_start("del4", .false., del4Timer)
- call ocn_vel_hmix_del4_tend(grid, divergence, vorticity, tend, err3)
+ call ocn_vel_hmix_del4_tend(grid, divergence, relativeVorticity, tend, err3)
call mpas_timer_stop("del4", del4Timer)
err = ior(ior(err1, err2),err3)
@@ -187,7 +187,7 @@
err = ior(ior(err1, err2),err3)
- if(config_disable_u_hmix) hmixOn = .false.
+ if(config_disable_vel_hmix) hmixOn = .false.
!--------------------------------------------------------------------
Modified: trunk/mpas/src/core_ocean/mpas_ocn_vel_hmix_del2.F
===================================================================
--- trunk/mpas/src/core_ocean/mpas_ocn_vel_hmix_del2.F        2013-04-18 16:43:19 UTC (rev 2769)
+++ trunk/mpas/src/core_ocean/mpas_ocn_vel_hmix_del2.F        2013-04-18 18:02:53 UTC (rev 2770)
@@ -64,13 +64,13 @@
!> This routine computes the horizontal mixing tendency for momentum
!> based on a Laplacian form for the mixing, \f$</font>
<font color="black">u_2 </font>
<font color="red">abla^2 u\f$
!> This tendency takes the
-!> form \f$</font>
<font color="black">u( </font>
<font color="black">abla divergence + k \times </font>
<font color="blue">abla vorticity )\f$,
+!> form \f$</font>
<font color="black">u( </font>
<font color="black">abla divergence + k \times </font>
<font color="black">abla relativeVorticity )\f$,
!> where \f$</font>
<font color="black">u\f$ is a viscosity and \f$k\f$ is the vertical unit vector.
!> This form is strictly only valid for constant \f$</font>
<font color="gray">u\f$ .
!
!-----------------------------------------------------------------------
- subroutine ocn_vel_hmix_del2_tend(grid, divergence, vorticity, viscosity, tend, err)!{{{
+ subroutine ocn_vel_hmix_del2_tend(grid, divergence, relativeVorticity, viscosity, tend, err)!{{{
!-----------------------------------------------------------------
!
@@ -82,7 +82,7 @@
divergence !< Input: velocity divergence
real (kind=RKIND), dimension(:,:), intent(in) :: &
- vorticity !< Input: vorticity
+ relativeVorticity !< Input: relative vorticity
type (mesh_type), intent(in) :: &
grid !< Input: grid information
@@ -151,13 +151,13 @@
do k=1,maxLevelEdgeTop(iEdge)
- ! Here -( vorticity(k,vertex2) - vorticity(k,vertex1) ) / dvEdge(iEdge)
- ! is - </font>
<font color="red">abla vorticity pointing from vertex 2 to vertex 1, or equivalently
- ! + k \times </font>
<font color="blue">abla vorticity pointing from cell1 to cell2.
+ ! Here -( relativeVorticity(k,vertex2) - relativeVorticity(k,vertex1) ) / dvEdge(iEdge)
+ ! is - </font>
<font color="blue">abla relativeVorticity pointing from vertex 2 to vertex 1, or equivalently
+ ! + k \times </font>
<font color="gray">abla relativeVorticity pointing from cell1 to cell2.
u_diffusion = ( divergence(k,cell2) - divergence(k,cell1) ) * invLength1 &
-viscVortCoef &
- *( vorticity(k,vertex2) - vorticity(k,vertex1) ) * invLength2
+ *( relativeVorticity(k,vertex2) - relativeVorticity(k,vertex1) ) * invLength2
visc2 = meshScalingDel2(iEdge) * eddyVisc2
Modified: trunk/mpas/src/core_ocean/mpas_ocn_vel_hmix_del4.F
===================================================================
--- trunk/mpas/src/core_ocean/mpas_ocn_vel_hmix_del4.F        2013-04-18 16:43:19 UTC (rev 2769)
+++ trunk/mpas/src/core_ocean/mpas_ocn_vel_hmix_del4.F        2013-04-18 18:02:53 UTC (rev 2770)
@@ -66,13 +66,13 @@
!> based on a biharmonic form for the mixing. This mixing tendency
!> takes the form \f$-</font>
<font color="black">u_4 </font>
<font color="red">abla^4 u\f$
!> but is computed as
-!> \f$</font>
<font color="black">abla^2 u = </font>
<font color="black">abla divergence + k \times </font>
<font color="blue">abla vorticity\f$
+!> \f$</font>
<font color="black">abla^2 u = </font>
<font color="black">abla divergence + k \times </font>
<font color="black">abla relativeVorticity\f$
!> applied recursively.
!> This formulation is only valid for constant \f$</font>
<font color="gray">u_4\f$ .
!
!-----------------------------------------------------------------------
- subroutine ocn_vel_hmix_del4_tend(grid, divergence, vorticity, tend, err)!{{{
+ subroutine ocn_vel_hmix_del4_tend(grid, divergence, relativeVorticity, tend, err)!{{{
!-----------------------------------------------------------------
!
@@ -84,7 +84,7 @@
divergence !< Input: velocity divergence
real (kind=RKIND), dimension(:,:), intent(in) :: &
- vorticity !< Input: vorticity
+ relativeVorticity !< Input: relative vorticity
type (mesh_type), intent(in) :: &
grid !< Input: grid information
@@ -127,7 +127,7 @@
meshScalingDel4, areaCell
real (kind=RKIND), dimension(:,:), allocatable :: delsq_divergence, &
- delsq_circulation, delsq_vorticity, delsq_u
+ delsq_circulation, delsq_relativeVorticity, delsq_u
err = 0
@@ -159,10 +159,10 @@
allocate(delsq_u(nVertLEvels, nEdges+1))
allocate(delsq_divergence(nVertLevels, nCells+1))
- allocate(delsq_vorticity(nVertLevels, nVertices+1))
+ allocate(delsq_relativeVorticity(nVertLevels, nVertices+1))
delsq_u(:,:) = 0.0
- delsq_vorticity(:,:) = 0.0
+ delsq_relativeVorticity(:,:) = 0.0
delsq_divergence(:,:) = 0.0
!Compute delsq_u
@@ -177,19 +177,19 @@
invDvEdge = 1.0 / dvEdge(iEdge)
do k=1,maxLevelEdgeTop(iEdge)
- ! Compute </font>
<font color="black">abla^2 u = </font>
<font color="black">abla divergence + k \times </font>
<font color="blue">abla vorticity
+ ! Compute </font>
<font color="black">abla^2 u = </font>
<font color="black">abla divergence + k \times </font>
<font color="gray">abla relativeVorticity
delsq_u(k, iEdge) = ( divergence(k,cell2) - divergence(k,cell1) ) * invDcEdge &
- -viscVortCoef *( vorticity(k,vertex2) - vorticity(k,vertex1)) * invDcEdge * sqrt(3.0)
+ -viscVortCoef *( relativeVorticity(k,vertex2) - relativeVorticity(k,vertex1)) * invDcEdge * sqrt(3.0)
end do
end do
- ! Compute delsq_vorticity
+ ! Compute delsq_relativeVorticity
do iVertex = 1, nVertices
invAreaTri1 = 1.0 / areaTriangle(iVertex)
do i = 1, vertexDegree
iEdge = edgesOnVertex(i, iVertex)
do k = 1, maxLevelVertexTop(iVertex)
- delsq_vorticity(k, iVertex) = delsq_vorticity(k, iVertex) + edgeSignOnVertex(i, iVertex) * dcEdge(iEdge) * delsq_u(k, iEdge) * invAreaTri1
+ delsq_relativeVorticity(k, iVertex) = delsq_relativeVorticity(k, iVertex) + edgeSignOnVertex(i, iVertex) * dcEdge(iEdge) * delsq_u(k, iEdge) * invAreaTri1
end do
end do
end do
@@ -219,7 +219,7 @@
do k=1,maxLevelEdgeTop(iEdge)
u_diffusion = (delsq_divergence(k,cell2) - delsq_divergence(k,cell1)) * invDcEdge &
- -viscVortCoef * (delsq_vorticity(k,vertex2) - delsq_vorticity(k,vertex1) ) * invDcEdge * sqrt(3.0)
+ -viscVortCoef * (delsq_relativeVorticity(k,vertex2) - delsq_relativeVorticity(k,vertex1) ) * invDcEdge * sqrt(3.0)
tend(k,iEdge) = tend(k,iEdge) - edgeMask(k, iEdge) * u_diffusion * r_tmp
end do
@@ -227,7 +227,7 @@
deallocate(delsq_u)
deallocate(delsq_divergence)
- deallocate(delsq_vorticity)
+ deallocate(delsq_relativeVorticity)
!--------------------------------------------------------------------
Modified: trunk/mpas/src/core_ocean/mpas_ocn_vel_hmix_leith.F
===================================================================
--- trunk/mpas/src/core_ocean/mpas_ocn_vel_hmix_leith.F        2013-04-18 16:43:19 UTC (rev 2769)
+++ trunk/mpas/src/core_ocean/mpas_ocn_vel_hmix_leith.F        2013-04-18 18:02:53 UTC (rev 2770)
@@ -76,7 +76,7 @@
!
!-----------------------------------------------------------------------
- subroutine ocn_vel_hmix_leith_tend(grid, divergence, vorticity, viscosity, tend, err)!{{{
+ subroutine ocn_vel_hmix_leith_tend(grid, divergence, relativeVorticity, viscosity, tend, err)!{{{
!-----------------------------------------------------------------
!
@@ -88,7 +88,7 @@
divergence !< Input: velocity divergence
real (kind=RKIND), dimension(:,:), intent(in) :: &
- vorticity !< Input: vorticity
+ relativeVorticity !< Input: relative vorticity
type (mesh_type), intent(in) :: &
grid !< Input: grid information
@@ -157,19 +157,19 @@
do k=1,maxLevelEdgeTop(iEdge)
- ! Here -( vorticity(k,vertex2) - vorticity(k,vertex1) ) / dvEdge(iEdge)
- ! is - </font>
<font color="red">abla vorticity pointing from vertex 2 to vertex 1, or equivalently
- ! + k \times </font>
<font color="blue">abla vorticity pointing from cell1 to cell2.
+ ! Here -( relativeVorticity(k,vertex2) - relativeVorticity(k,vertex1) ) / dvEdge(iEdge)
+ ! is - </font>
<font color="blue">abla relativeVorticity pointing from vertex 2 to vertex 1, or equivalently
+ ! + k \times </font>
<font color="red">abla relativeVorticity pointing from cell1 to cell2.
u_diffusion = ( divergence(k,cell2) - divergence(k,cell1) ) * invLength1 &
-viscVortCoef &
- *( vorticity(k,vertex2) - vorticity(k,vertex1) ) * invLength2
+ *( relativeVorticity(k,vertex2) - relativeVorticity(k,vertex1) ) * invLength2
! Here the first line is (\delta x)^3
! the second line is |</font>
<font color="black">abla \omega|
! and u_diffusion is </font>
<font color="gray">abla^2 u (see formula for $\bf{D}$ above).
visc2 = ( config_leith_parameter * config_leith_dx * meshScaling(iEdge) / 3.14)**3 &
- * abs( vorticity(k,vertex2) - vorticity(k,vertex1) ) * invLength1 * sqrt(3.0)
+ * abs( relativeVorticity(k,vertex2) - relativeVorticity(k,vertex1) ) * invLength1 * sqrt(3.0)
visc2 = min(visc2, config_leith_visc2_max)
tend(k,iEdge) = tend(k,iEdge) + edgeMask(k, iEdge) * visc2 * u_diffusion
Modified: trunk/mpas/src/core_ocean/mpas_ocn_vel_pressure_grad.F
===================================================================
--- trunk/mpas/src/core_ocean/mpas_ocn_vel_pressure_grad.F        2013-04-18 16:43:19 UTC (rev 2769)
+++ trunk/mpas/src/core_ocean/mpas_ocn_vel_pressure_grad.F        2013-04-18 18:02:53 UTC (rev 2770)
@@ -45,7 +45,7 @@
!--------------------------------------------------------------------
logical :: pgradOn
- real (kind=RKIND) :: rho0Inv, grho0Inv
+ real (kind=RKIND) :: density0Inv, gdensity0Inv
!***********************************************************************
@@ -66,7 +66,7 @@
!
!-----------------------------------------------------------------------
- subroutine ocn_vel_pressure_grad_tend(grid, pressure, zMid, rho, tend, err)!{{{
+ subroutine ocn_vel_pressure_grad_tend(grid, pressure, zMid, density, tend, err)!{{{
!-----------------------------------------------------------------
!
@@ -77,7 +77,7 @@
real (kind=RKIND), dimension(:,:), intent(in) :: &
pressure, & !< Input: Pressure field or Mongomery potential
zMid, & !< Input: z-coordinate at mid-depth of layer
- rho !< Input: density
+ density !< Input: density
type (mesh_type), intent(in) :: &
grid !< Input: grid information
@@ -123,12 +123,12 @@
edgeMask => grid % edgeMask % array
! pressure for generalized coordinates
- ! -1/rho_0 (grad p_k + rho g grad z_k^{mid})
+ ! -1/density_0 (grad p_k + density g grad z_k^{mid})
! For pure isopycnal coordinates, we are still using
! grad(M), the gradient of Montgomery Potential, because
- ! we have set rho0Inv=1 and grho0Inv=0 in the init routine,
- ! and pressure is passed in as MontPot.
+ ! we have set density0Inv=1 and gdensity0Inv=0 in the init routine,
+ ! and pressure is passed in as montgomeryPotential.
do iEdge=1,nEdgesSolve
cell1 = cellsOnEdge(1,iEdge)
@@ -137,9 +137,9 @@
do k=1,maxLevelEdgeTop(iEdge)
tend(k,iEdge) = tend(k,iEdge) &
- - edgeMask(k,iEdge) * rho0Inv*( pressure(k,cell2) &
+ - edgeMask(k,iEdge) * density0Inv*( pressure(k,cell2) &
- pressure(k,cell1) )* invdcEdge &
- - edgeMask(k,iEdge) * grho0Inv* 0.5*(rho(k,cell1)+rho(k,cell2)) &
+ - edgeMask(k,iEdge) * gdensity0Inv* 0.5*(density(k,cell1)+density(k,cell2)) &
*( zMid(k,cell2) &
- zMid(k,cell1) )* invdcEdge
@@ -192,14 +192,14 @@
pgradOn = .true.
if (config_pressure_gradient_type.eq.'MontgomeryPotential') then
- rho0Inv = 1.0
- grho0Inv = 0.0
+ density0Inv = 1.0
+ gdensity0Inv = 0.0
else
- rho0Inv = 1.0/config_rho0
- grho0Inv = gravity/config_rho0
+ density0Inv = 1.0/config_density0
+ gdensity0Inv = gravity/config_density0
end if
- if(config_disable_u_pgrad) pgradOn = .false.
+ if(config_disable_vel_pgrad) pgradOn = .false.
Modified: trunk/mpas/src/core_ocean/mpas_ocn_vel_vadv.F
===================================================================
--- trunk/mpas/src/core_ocean/mpas_ocn_vel_vadv.F        2013-04-18 16:43:19 UTC (rev 2769)
+++ trunk/mpas/src/core_ocean/mpas_ocn_vel_vadv.F        2013-04-18 18:02:53 UTC (rev 2770)
@@ -64,7 +64,7 @@
!
!-----------------------------------------------------------------------
- subroutine ocn_vel_vadv_tend(grid, u, h_edge, wTop, tend, err)!{{{
+ subroutine ocn_vel_vadv_tend(grid, u, layerThicknessEdge, vertTransportVelocityTop, tend, err)!{{{
!-----------------------------------------------------------------
!
@@ -75,8 +75,8 @@
real (kind=RKIND), dimension(:,:), intent(in) :: &
u !< Input: Horizontal velocity
real (kind=RKIND), dimension(:,:), intent(in) :: &
- h_edge,&!< Input: thickness at edge
- wTop !< Input: Vertical velocity on top layer
+ layerThicknessEdge,&!< Input: thickness at edge
+ vertTransportVelocityTop !< Input: Vertical velocity on top layer
type (mesh_type), intent(in) :: &
grid !< Input: grid information
@@ -109,7 +109,7 @@
integer, dimension(:), pointer :: maxLevelEdgeTop
integer, dimension(:,:), pointer :: cellsOnEdge, edgeMask
- real (kind=RKIND) :: wTopEdge
+ real (kind=RKIND) :: vertTransportVelocityTopEdge
real (kind=RKIND), dimension(:), allocatable :: w_dudzTopEdge
if(.not.velVadvOn) return
@@ -130,11 +130,11 @@
do k=2,maxLevelEdgeTop(iEdge)
! Average w from cell center to edge
- wTopEdge = 0.5*(wTop(k,cell1)+wTop(k,cell2))
+ vertTransportVelocityTopEdge = 0.5*(vertTransportVelocityTop(k,cell1)+vertTransportVelocityTop(k,cell2))
! compute dudz at vertical interface with first order derivative.
- w_dudzTopEdge(k) = wTopEdge * (u(k-1,iEdge)-u(k,iEdge)) &
- / (0.5*(h_edge(k-1,iEdge) + h_edge(k,iEdge)))
+ w_dudzTopEdge(k) = vertTransportVelocityTopEdge * (u(k-1,iEdge)-u(k,iEdge)) &
+ / (0.5*(layerThicknessEdge(k-1,iEdge) + layerThicknessEdge(k,iEdge)))
end do
w_dudzTopEdge(maxLevelEdgeTop(iEdge)+1) = 0.0
! Average w*du/dz from vertical interface to vertical middle of cell
@@ -182,7 +182,7 @@
velVadvOn = .true.
end if
- if(config_disable_u_vadv) velVadvOn = .false.
+ if(config_disable_vel_vadv) velVadvOn = .false.
!--------------------------------------------------------------------
Modified: trunk/mpas/src/core_ocean/mpas_ocn_vmix.F
===================================================================
--- trunk/mpas/src/core_ocean/mpas_ocn_vmix.F        2013-04-18 16:43:19 UTC (rev 2769)
+++ trunk/mpas/src/core_ocean/mpas_ocn_vmix.F        2013-04-18 18:02:53 UTC (rev 2770)
@@ -149,7 +149,7 @@
!
!-----------------------------------------------------------------------
- subroutine ocn_vel_vmix_tend_implicit(grid, dt, ke_edge, vertViscTopOfEdge, h, h_edge, u, err)!{{{
+ subroutine ocn_vel_vmix_tend_implicit(grid, dt, kineticEnergyEdge, vertViscTopOfEdge, layerThickness, layerThicknessEdge, normalVelocity, err)!{{{
!-----------------------------------------------------------------
!
@@ -161,7 +161,7 @@
grid !< Input: grid information
real (kind=RKIND), dimension(:,:), intent(in) :: &
- ke_edge !< Input: kinetic energy at edge
+ kineticEnergyEdge !< Input: kinetic energy at edge
real (kind=RKIND), dimension(:,:), intent(in) :: &
vertViscTopOfEdge !< Input: vertical mixing coefficients
@@ -170,7 +170,7 @@
dt !< Input: time step
real (kind=RKIND), dimension(:,:), intent(in) :: &
- h !< Input: thickness at cell center
+ layerThickness !< Input: thickness at cell center
!-----------------------------------------------------------------
!
@@ -179,10 +179,10 @@
!-----------------------------------------------------------------
real (kind=RKIND), dimension(:,:), intent(inout) :: &
- u !< Input: velocity
+ normalVelocity !< Input: velocity
real (kind=RKIND), dimension(:,:), intent(inout) :: &
- h_edge !< Input: thickness at edge
+ layerThicknessEdge !< Input: thickness at edge
!-----------------------------------------------------------------
!
@@ -204,7 +204,7 @@
integer, dimension(:,:), pointer :: cellsOnEdge
- real (kind=RKIND), dimension(:), allocatable :: A, B, C, uTemp
+ real (kind=RKIND), dimension(:), allocatable :: A, B, C, velTemp
err = 0
@@ -215,7 +215,7 @@
maxLevelEdgeTop => grid % maxLevelEdgeTop % array
cellsOnEdge => grid % cellsOnEdge % array
- allocate(A(nVertLevels),B(nVertLevels),C(nVertLevels),uTemp(nVertLevels))
+ allocate(A(nVertLevels),B(nVertLevels),C(nVertLevels),velTemp(nVertLevels))
A(1)=0
do iEdge=1,nEdges
@@ -223,26 +223,26 @@
if (N.gt.0) then
! Compute A(k), B(k), C(k)
- ! h_edge is computed in compute_solve_diag, and is not available yet,
- ! so recompute h_edge here.
+ ! layerThicknessEdge is computed in compute_solve_diag, and is not available yet,
+ ! so recompute layerThicknessEdge here.
cell1 = cellsOnEdge(1,iEdge)
cell2 = cellsOnEdge(2,iEdge)
do k=1,N
- h_edge(k,iEdge) = 0.5 * (h(k,cell1) + h(k,cell2))
+ layerThicknessEdge(k,iEdge) = 0.5 * (layerThickness(k,cell1) + layerThickness(k,cell2))
end do
! A is lower diagonal term
do k=2,N
A(k) = -2.0*dt*vertViscTopOfEdge(k,iEdge) &
- / (h_edge(k-1,iEdge) + h_edge(k,iEdge)) &
- / h_edge(k,iEdge)
+ / (layerThicknessEdge(k-1,iEdge) + layerThicknessEdge(k,iEdge)) &
+ / layerThicknessEdge(k,iEdge)
enddo
! C is upper diagonal term
do k=1,N-1
C(k) = -2.0*dt*vertViscTopOfEdge(k+1,iEdge) &
- / (h_edge(k,iEdge) + h_edge(k+1,iEdge)) &
- / h_edge(k,iEdge)
+ / (layerThicknessEdge(k,iEdge) + layerThicknessEdge(k+1,iEdge)) &
+ / layerThicknessEdge(k,iEdge)
enddo
! B is diagonal term
@@ -253,17 +253,17 @@
! Apply bottom drag boundary condition on the viscous term
B(N) = 1 - A(N) + dt*config_bottom_drag_coeff &
- *sqrt(2.0*ke_edge(k,iEdge))/h_edge(k,iEdge)
+ *sqrt(2.0*kineticEnergyEdge(k,iEdge))/layerThicknessEdge(k,iEdge)
- call tridiagonal_solve(A(2:N),B,C(1:N-1),u(:,iEdge),uTemp,N)
+ call tridiagonal_solve(A(2:N),B,C(1:N-1),normalVelocity(:,iEdge),velTemp,N)
- u(1:N,iEdge) = uTemp(1:N)
- u(N+1:nVertLevels,iEdge) = 0.0
+ normalVelocity(1:N,iEdge) = velTemp(1:N)
+ normalVelocity(N+1:nVertLevels,iEdge) = 0.0
end if
end do
- deallocate(A,B,C,uTemp)
+ deallocate(A,B,C,velTemp)
!--------------------------------------------------------------------
@@ -283,7 +283,7 @@
!
!-----------------------------------------------------------------------
- subroutine ocn_tracer_vmix_tend_implicit(grid, dt, vertDiffTopOfCell, h, tracers, err)!{{{
+ subroutine ocn_tracer_vmix_tend_implicit(grid, dt, vertDiffTopOfCell, layerThickness, tracers, err)!{{{
!-----------------------------------------------------------------
!
@@ -301,7 +301,7 @@
dt !< Input: time step
real (kind=RKIND), dimension(:,:), intent(in) :: &
- h !< Input: thickness at cell center
+ layerThickness !< Input: thickness at cell center
!-----------------------------------------------------------------
!
@@ -352,13 +352,13 @@
A(1)=0
do k=2,N
A(k) = -2.0*dt*vertDiffTopOfCell(k,iCell) &
- / (h(k-1,iCell) + h(k,iCell)) / h(k,iCell)
+ / (layerThickness(k-1,iCell) + layerThickness(k,iCell)) / layerThickness(k,iCell)
enddo
! C is upper diagonal term
do k=1,N-1
C(k) = -2.0*dt*vertDiffTopOfCell(k+1,iCell) &
- / (h(k,iCell) + h(k+1,iCell)) / h(k,iCell)
+ / (layerThickness(k,iCell) + layerThickness(k+1,iCell)) / layerThickness(k,iCell)
enddo
C(N) = 0.0
@@ -403,17 +403,17 @@
integer, intent(out) :: err
integer :: nCells
- real (kind=RKIND), dimension(:,:), pointer :: u, h, h_edge, vertViscTopOfEdge, vertDiffTopOfCell, ke_edge
+ real (kind=RKIND), dimension(:,:), pointer :: normalVelocity, layerThickness, layerThicknessEdge, vertViscTopOfEdge, vertDiffTopOfCell, kineticEnergyEdge
real (kind=RKIND), dimension(:,:,:), pointer :: tracers
integer, dimension(:), pointer :: maxLevelCell
err = 0
- u => state % u % array
+ normalVelocity => state % normalVelocity % array
tracers => state % tracers % array
- h => state % h % array
- h_edge => state % h_edge % array
- ke_edge => state % ke_edge % array
+ layerThickness => state % layerThickness % array
+ layerThicknessEdge => state % layerThicknessEdge % array
+ kineticEnergyEdge => state % kineticEnergyEdge % array
vertViscTopOfEdge => diagnostics % vertViscTopOfEdge % array
vertDiffTopOfCell => diagnostics % vertDiffTopOfCell % array
maxLevelCell => grid % maxLevelCell % array
@@ -425,13 +425,13 @@
!
! Implicit vertical solve for momentum
!
- call ocn_vel_vmix_tend_implicit(grid, dt, ke_edge, vertViscTopOfEdge, h, h_edge, u, err)
+ call ocn_vel_vmix_tend_implicit(grid, dt, kineticEnergyEdge, vertViscTopOfEdge, layerThickness, layerThicknessEdge, normalVelocity, err)
!
! Implicit vertical solve for tracers
!
- call ocn_tracer_vmix_tend_implicit(grid, dt, vertDiffTopOfCell, h, tracers, err)
+ call ocn_tracer_vmix_tend_implicit(grid, dt, vertDiffTopOfCell, layerThickness, tracers, err)
end subroutine ocn_vmix_implicit!}}}
@@ -469,7 +469,7 @@
velVmixOn = .true.
tracerVmixOn = .true.
- if(config_disable_u_vmix) velVmixOn = .false.
+ if(config_disable_vel_vmix) velVmixOn = .false.
if(config_disable_tr_vmix) tracerVmixOn = .false.
call ocn_vmix_coefs_const_init(err1)
Modified: trunk/mpas/src/core_ocean/mpas_ocn_vmix_coefs_rich.F
===================================================================
--- trunk/mpas/src/core_ocean/mpas_ocn_vmix_coefs_rich.F        2013-04-18 16:43:19 UTC (rev 2769)
+++ trunk/mpas/src/core_ocean/mpas_ocn_vmix_coefs_rich.F        2013-04-18 18:02:53 UTC (rev 2770)
@@ -109,7 +109,7 @@
integer :: err1, err2, err3, indexT, indexS
real (kind=RKIND), dimension(:,:), pointer :: &
- vertViscTopOfEdge, vertDiffTopOfCell, u, h, h_edge, rho, rhoDisplaced
+ vertViscTopOfEdge, vertDiffTopOfCell, normalVelocity, layerThickness, layerThicknessEdge, density, displacedDensity
real (kind=RKIND), dimension(:,:), pointer :: RiTopOfEdge, RiTopOfCell
@@ -133,23 +133,23 @@
RiTopOfEdge => d % RiTopOfEdge % array
RiTopOfCell => d % RiTopOfCell % array
- u => s % u % array
- h => s % h % array
- h_edge => s % h_edge % array
- rho => s % rho % array
- rhoDisplaced => s % rhoDisplaced % array
+ normalVelocity => s % normalVelocity % array
+ layerThickness => s % layerThickness % array
+ layerThicknessEdge => s % layerThicknessEdge % array
+ density => s % density % array
+ displacedDensity => s % displacedDensity % array
tracers => s % tracers % array
call mpas_timer_start("eos rich", .false., richEOSTimer)
- call ocn_equation_of_state_rho(s, grid, 0,'relative', err)
- call ocn_equation_of_state_rho(s, grid, 1,'relative', err)
+ call ocn_equation_of_state_density(s, grid, 0,'relative', err)
+ call ocn_equation_of_state_density(s, grid, 1,'relative', err)
call mpas_timer_stop("eos rich", richEOSTimer)
- call ocn_vmix_get_rich_numbers(grid, indexT, indexS, u, h, h_edge, &
- rho, rhoDisplaced, tracers, RiTopOfEdge, RiTopOfCell, err1)
+ call ocn_vmix_get_rich_numbers(grid, indexT, indexS, normalVelocity, layerThickness, layerThicknessEdge, &
+ density, displacedDensity, tracers, RiTopOfEdge, RiTopOfCell, err1)
- call ocn_vel_vmix_coefs_rich(grid, RiTopOfEdge, h_edge, vertViscTopOfEdge, err2)
- call ocn_tracer_vmix_coefs_rich(grid, RiTopOfCell, h, vertDiffTopOfCell, err3)
+ call ocn_vel_vmix_coefs_rich(grid, RiTopOfEdge, layerThicknessEdge, vertViscTopOfEdge, err2)
+ call ocn_tracer_vmix_coefs_rich(grid, RiTopOfCell, layerThickness, vertDiffTopOfCell, err3)
err = ior(err1, ior(err2, err3))
@@ -170,7 +170,7 @@
!
!-----------------------------------------------------------------------
- subroutine ocn_vel_vmix_coefs_rich(grid, RiTopOfEdge, h_edge, vertViscTopOfEdge, err)!{{{
+ subroutine ocn_vel_vmix_coefs_rich(grid, RiTopOfEdge, layerThicknessEdge, vertViscTopOfEdge, err)!{{{
!-----------------------------------------------------------------
!
@@ -182,7 +182,7 @@
grid !< Input: grid information
real (kind=RKIND), dimension(:,:), intent(in) :: &
- h_edge !< Input: thickness at edge
+ layerThicknessEdge !< Input: thickness at edge
real (kind=RKIND), dimension(:,:), intent(in) :: &
RiTopOfEdge !< Richardson number at top of edge
@@ -256,7 +256,7 @@
!
!-----------------------------------------------------------------------
- subroutine ocn_tracer_vmix_coefs_rich(grid, RiTopOfCell, h, vertDiffTopOfCell, err)!{{{
+ subroutine ocn_tracer_vmix_coefs_rich(grid, RiTopOfCell, layerThickness, vertDiffTopOfCell, err)!{{{
!-----------------------------------------------------------------
!
@@ -268,7 +268,7 @@
grid !< Input: grid information
real (kind=RKIND), dimension(:,:), intent(in) :: &
- h !< Input: thickness at cell center
+ layerThickness !< Input: thickness at cell center
real (kind=RKIND), dimension(:,:), intent(in) :: &
RiTopOfCell !< Input: Richardson number at top of cell
@@ -309,7 +309,7 @@
maxLevelCell => grid % maxLevelCell % array
- coef = -gravity/config_rho0/2.0
+ coef = -gravity/config_density0/2.0
do iCell = 1,nCells
do k = 2,maxLevelCell(iCell)
! efficiency note: these if statements are inside iEdge and k loops.
@@ -348,8 +348,8 @@
!
!-----------------------------------------------------------------------
- subroutine ocn_vmix_get_rich_numbers(grid, indexT, indexS, u, h, h_edge, & !{{{
- rho, rhoDisplaced, tracers, RiTopOfEdge, RiTopOfCell, err)
+ subroutine ocn_vmix_get_rich_numbers(grid, indexT, indexS, normalVelocity, layerThickness, layerThicknessEdge, & !{{{
+ density, displacedDensity, tracers, RiTopOfEdge, RiTopOfCell, err)
!-----------------------------------------------------------------
!
@@ -363,9 +363,9 @@
integer, intent(in) :: indexT !< Input: index for temperature
integer, intent(in) :: indexS !< Input: index for salinity
- real (kind=RKIND), dimension(:,:), intent(in) :: u !< Input: horizontal velocity
- real (kind=RKIND), dimension(:,:), intent(in) :: h !< Input: thickness
- real (kind=RKIND), dimension(:,:), intent(in) :: h_edge !< Input: thickness at edge
+ real (kind=RKIND), dimension(:,:), intent(in) :: normalVelocity !< Input: horizontal velocity
+ real (kind=RKIND), dimension(:,:), intent(in) :: layerThickness !< Input: thickness
+ real (kind=RKIND), dimension(:,:), intent(in) :: layerThicknessEdge !< Input: thickness at edge
real (kind=RKIND), dimension(:,:,:), intent(in) :: tracers !< Input: tracers
@@ -381,8 +381,8 @@
!
!-----------------------------------------------------------------
- real (kind=RKIND), dimension(:,:), intent(inout) :: rho !< Input/output: density
- real (kind=RKIND), dimension(:,:), intent(inout) :: rhoDisplaced !< Input/output: displaced density
+ real (kind=RKIND), dimension(:,:), intent(inout) :: density !< Input/output: density
+ real (kind=RKIND), dimension(:,:), intent(inout) :: displacedDensity !< Input/output: displaced density
real (kind=RKIND), dimension(:,:), intent(inout) :: RiTopOfEdge !< Input/output: Richardson number top of cell
real (kind=RKIND), dimension(:,:), intent(inout) :: RiTopOfCell !< Input/output: Richardson number top of cell
@@ -402,8 +402,8 @@
real (kind=RKIND) :: coef, invAreaCell
real (kind=RKIND), dimension(:), pointer :: dcEdge, dvEdge, areaCell
- real (kind=RKIND), dimension(:,:), allocatable :: drhoTopOfCell, du2TopOfCell, &
- drhoTopOfEdge, du2TopOfEdge
+ real (kind=RKIND), dimension(:,:), allocatable :: ddensityTopOfCell, du2TopOfCell, &
+ ddensityTopOfEdge, du2TopOfEdge
err = 0
@@ -425,26 +425,26 @@
edgeSignOnCell => grid % edgeSignOnCell % array
allocate( &
- drhoTopOfCell(nVertLevels+1,nCells+1), drhoTopOfEdge(nVertLevels+1,nEdges), &
+ ddensityTopOfCell(nVertLevels+1,nCells+1), ddensityTopOfEdge(nVertLevels+1,nEdges), &
du2TopOfCell(nVertLevels+1,nCells+1), du2TopOfEdge(nVertLevels+1,nEdges))
- ! drhoTopOfCell(k) = $\rho^*_{k-1}-\rho^*_k$
- drhoTopOfCell = 0.0
+ ! ddensityTopOfCell(k) = $\density^*_{k-1}-\density^*_k$
+ ddensityTopOfCell = 0.0
do iCell=1,nCells
do k=2,maxLevelCell(iCell)
- drhoTopOfCell(k,iCell) = rhoDisplaced(k-1,iCell) - rhoDisplaced(k,iCell)
+ ddensityTopOfCell(k,iCell) = displacedDensity(k-1,iCell) - displacedDensity(k,iCell)
end do
end do
- ! interpolate drhoTopOfCell to drhoTopOfEdge
- drhoTopOfEdge = 0.0
+ ! interpolate ddensityTopOfCell to ddensityTopOfEdge
+ ddensityTopOfEdge = 0.0
do iEdge=1,nEdges
cell1 = cellsOnEdge(1,iEdge)
cell2 = cellsOnEdge(2,iEdge)
do k=2,maxLevelEdgeTop(iEdge)
- drhoTopOfEdge(k,iEdge) = &
- (drhoTopOfCell(k,cell1) + &
- drhoTopOfCell(k,cell2))/2
+ ddensityTopOfEdge(k,iEdge) = &
+ (ddensityTopOfCell(k,cell1) + &
+ ddensityTopOfCell(k,cell2))/2
end do
end do
@@ -452,7 +452,7 @@
du2TopOfEdge=0.0
do iEdge=1,nEdges
do k=2,maxLevelEdgeTop(iEdge)
- du2TopOfEdge(k,iEdge) = (u(k-1,iEdge) - u(k,iEdge))**2
+ du2TopOfEdge(k,iEdge) = (normalVelocity(k-1,iEdge) - normalVelocity(k,iEdge))**2
end do
end do
@@ -469,30 +469,30 @@
end do
end do
- ! compute RiTopOfEdge using drhoTopOfEdge and du2TopOfEdge
- ! coef = -g/rho_0/2
+ ! compute RiTopOfEdge using ddensityTopOfEdge and du2TopOfEdge
+ ! coef = -g/density_0/2
RiTopOfEdge = 0.0
- coef = -gravity/config_rho0/2.0
+ coef = -gravity/config_density0/2.0
do iEdge = 1,nEdges
do k = 2,maxLevelEdgeTop(iEdge)
- RiTopOfEdge(k,iEdge) = coef*drhoTopOfEdge(k,iEdge) &
- *(h_edge(k-1,iEdge)+h_edge(k,iEdge)) &
+ RiTopOfEdge(k,iEdge) = coef*ddensityTopOfEdge(k,iEdge) &
+ *(layerThicknessEdge(k-1,iEdge)+layerThicknessEdge(k,iEdge)) &
/ (du2TopOfEdge(k,iEdge) + 1e-20)
end do
end do
- ! compute RiTopOfCell using drhoTopOfCell and du2TopOfCell
- ! coef = -g/rho_0/2
+ ! compute RiTopOfCell using ddensityTopOfCell and du2TopOfCell
+ ! coef = -g/density_0/2
RiTopOfCell = 0.0
do iCell = 1,nCells
do k = 2,maxLevelCell(iCell)
- RiTopOfCell(k,iCell) = coef*drhoTopOfCell(k,iCell) &
- *(h(k-1,iCell)+h(k,iCell)) &
+ RiTopOfCell(k,iCell) = coef*ddensityTopOfCell(k,iCell) &
+ *(layerThickness(k-1,iCell)+layerThickness(k,iCell)) &
/ (du2TopOfCell(k,iCell) + 1e-20)
end do
end do
- deallocate(drhoTopOfCell, drhoTopOfEdge, &
+ deallocate(ddensityTopOfCell, ddensityTopOfEdge, &
du2TopOfCell, du2TopOfEdge)
!--------------------------------------------------------------------
</font>
</pre>