\n",
- "This notebook is meant to work with MOM6 run via the CESM framework\n",
- "
"
- ]
- },
- {
- "cell_type": "markdown",
- "id": "cell-3",
- "metadata": {},
- "source": [
- "This notebook checks if the fluxes of water, heat, and salt crossing the surface of the ocean are consistent with corresponding changes in the ocean interior. This particular analysis is for `g.e30_a08l.GW_JRA.TL319_t232_wgx3_hycom1_N75.2026.sfc_test01` CESM G_JRA-compset without OBCs.\n",
+ "Case root: `/glade/work/chengz/cesm.cases/sfc_fluxes_check/g.e30_a08l.GW_JRA.TL319_t232_wgx3_hycom1_N75.2026.sfc_test01`\n",
" \n",
"Results from this notebook: \n",
"1. Maps of surface boundary fluxes of water, heat, and salt crossing into the liquid seawater in MOM6;\n",
@@ -141,7 +113,7 @@
},
{
"cell_type": "code",
- "execution_count": 10,
+ "execution_count": 3,
"id": "cell-6",
"metadata": {},
"outputs": [],
@@ -310,7 +282,7 @@
},
{
"cell_type": "code",
- "execution_count": 11,
+ "execution_count": 4,
"id": "cell-7",
"metadata": {},
"outputs": [],
@@ -398,37 +370,24 @@
"We compute the change in seawater mass over a given time period using two methods. Note that the difference from the offline diagnostics is generally larger than that from the online diagnostics, because the model output interval is usually larger than the model time step, and the loss of precision may occur depending on how the output is written by the model, especially if the output is written in single precision.\n",
"\n",
"1) The net mass per time of water (units of kg/s) entering through the ocean boundaries is given by the area integral\n",
- "$$\\begin{equation*}\n",
- "\\mbox{boundary water mass entering liquid seawater} = \\int Q_{W} \\, dA,\n",
- "\\end{equation*}$$\n",
- "where the net water flux (units of $\\mbox{kg}~\\mbox{m}^{-2}~\\mbox{s}^{-1}$) is given by\n",
- "$$\\begin{align*}\n",
- " Q_{W} &= {\\tt PRCmE}.\n",
- "\\end{align*}$$\n",
- "A nonzero surface mass flux is associated with liquid and solid precipitation and runoff; evaporation and condensation; sea ice melt/formation; and surface restoring. \n",
+ " $$ \\mbox{boundary water mass entering liquid seawater} = \\int Q_{W} \\, dA, $$\n",
+ " where the net water flux (units of $\\mbox{kg}~\\mbox{m}^{-2}~\\mbox{s}^{-1}$) is given by\n",
+ " $$ Q_{W} = {\\tt PRCmE}. $$\n",
+ " A nonzero surface mass flux is associated with liquid and solid precipitation and runoff; evaporation and condensation; sea ice melt/formation; and surface restoring. \n",
"\n",
"2) The time change of liquid seawater mass is computed according to \n",
- "$$\\begin{equation*}\n",
- "\\mbox{seawater mass change at step $n$} = \n",
- "\\frac{1}{\\tau_{n} - \\tau_{n-1} } \\int \\left[\\int (\\rho_{n} - \\rho_{n-1}) \\, \\mathrm{d}z \\right] dA,\n",
- "\\end{equation*}$$\n",
- "where $\\tau_{n} - \\tau_{n-1}$ is the time increment of the output (i.e., one day) in seconds. Note that we make use of the MOM6 diagnostic for depth integrated density\n",
- "$$\\begin{equation*}\n",
- " {\\tt mass\\_wt} = \\int \\rho \\, \\mathrm{d}z.\n",
- "\\end{equation*}$$\n",
- "For a Boussinesq fluid, the in-situ $\\rho$ factor is set to $\\rho_{0}$, in which case the diagnostic field ${\\tt mass\\_wt}$ measures the thickness of a fluid column, multiplied by $\\rho_{0}$.\n",
- "Note that the numerical difference of ${\\tt mass\\_wt}$ is taken between $\\tau_{n}$ and $\\tau_{n-1}$, because ${\\tt mass\\_wt[n]}$ is a snapshot at the end of the $n$-th day, whereas ${\\tt PRCmE[n]}$ is the daily average over the $n$-th day.\n",
- "For self-consistency, we should have the following equality\n",
- "$$\\begin{equation*}\n",
- "\\boxed{\n",
- " \\mbox{boundary water mass entering liquid seawater} = \\mbox{seawater mass change}.\n",
- "}\n",
- "\\end{equation*}$$"
+ " $$ \\mbox{seawater mass change at step $n$} = \\frac{1}{\\tau_{n} - \\tau_{n-1} } \\int \\left[\\int (\\rho_{n} - \\rho_{n-1}) \\, \\mathrm{d}z \\right] dA, $$\n",
+ " where $\\tau_{n} - \\tau_{n-1}$ is the time increment of the output (i.e., one day) in seconds. Note that we make use of the MOM6 diagnostic for depth integrated density\n",
+ " $$ {\\tt mass\\_wt} = \\int \\rho \\, \\mathrm{d}z. $$\n",
+ " For a Boussinesq fluid, the in-situ $\\rho$ factor is set to $\\rho_{0}$, in which case the diagnostic field ${\\tt mass\\_wt}$ measures the thickness of a fluid column, multiplied by $\\rho_{0}$.\n",
+ " Note that the numerical difference of ${\\tt mass\\_wt}$ is taken between $\\tau_{n}$ and $\\tau_{n-1}$, because ${\\tt mass\\_wt[n]}$ is a snapshot at the end of the $n$-th day, whereas ${\\tt PRCmE[n]}$ is the daily average over the $n$-th day.\n",
+ " For self-consistency, we should have the following equality\n",
+ " $$ \\boxed{\\mbox{boundary water mass entering liquid seawater} = \\mbox{seawater mass change}.} $$"
]
},
{
"cell_type": "code",
- "execution_count": 12,
+ "execution_count": 5,
"id": "cell-10",
"metadata": {},
"outputs": [
@@ -476,7 +435,7 @@
},
{
"cell_type": "code",
- "execution_count": 13,
+ "execution_count": 6,
"id": "cell-12",
"metadata": {},
"outputs": [
@@ -521,7 +480,7 @@
},
{
"cell_type": "code",
- "execution_count": 14,
+ "execution_count": 7,
"id": "cell-14",
"metadata": {},
"outputs": [
@@ -590,7 +549,7 @@
},
{
"cell_type": "code",
- "execution_count": 15,
+ "execution_count": 8,
"id": "cell-16",
"metadata": {},
"outputs": [
@@ -633,36 +592,25 @@
"We compute the change in seawater heat content over a given time period using two methods. If the difference is large, then there is a bug.\n",
"\n",
"1) The net heat per time (units of Watts) entering through the ocean (surface and bottom) boundaries is given by the area integral\n",
- "$$\\begin{equation*}\n",
- "\\mbox{boundary heating of liquid seawater} = \\int Q \\, dA,\n",
- "\\end{equation*}$$\n",
- "where the net heat flux (units of $\\mbox{W}~\\mbox{m}^{-2}~\\mbox{s}^{-1}$) is given by \n",
- "$$\\begin{align*}\n",
- " Q &= {\\tt (net\\_heat\\_coupler + heat\\_pme + frazil) + internal\\_heat + heat\\_restore} \\\\\n",
- " &= {\\tt net\\_heat\\_surface + internal\\_heat + heat\\_restore}\n",
- "\\end{align*}$$\n",
- "Note that ${\\tt internal\\_heat}$ represents the geothermal heating from the seafloor, which also contributes to the heat budget.\n",
- "\n",
- "3) The time change of liquid seawater heat is computed according to \n",
- "$$\\begin{equation*}\n",
- "\\mbox{seawater heat content change} = \n",
- "\\frac{C_p }{\\tau_{n} - \\tau_{n-1} } \\int dA \\left(\\rho_0 \\int (\\Theta_{n} - \\Theta_{n-1}) \\, \\mathrm{d}z \\right) \n",
- "\\end{equation*}$$\n",
- " where $\\tau_{n} - \\tau_{n-1}$ is the time increment of the output (i.e., one day) in seconds. Note that we make use of the MOM6 diagnostic for depth integrated potential/conservative temperature \n",
- "$$\\begin{equation*}\n",
- " {\\tt tomint} = \\rho_0 \\int \\Theta \\, \\mathrm{d}z,\n",
- "\\end{equation*}$$\n",
- " where the Boussinesq reference density, $\\rho_{0}$, is used since this test case makes the Boussinesq approximation. For self-consistency, we should have the following equality \n",
- "$$\\begin{equation*}\n",
- "\\boxed{\n",
- " \\mbox{boundary heating of liquid seawater} = \\mbox{seawater heat content change}.\n",
- "}\n",
- "\\end{equation*}$$"
+ " $$ \\mbox{boundary heating of liquid seawater} = \\int Q \\, dA, $$\n",
+ " where the net heat flux (units of $\\mbox{W}~\\mbox{m}^{-2}~\\mbox{s}^{-1}$) is given by \n",
+ " \\begin{align*}\n",
+ " Q &= {\\tt (net\\_heat\\_coupler + heat\\_pme + frazil) + internal\\_heat + heat\\_restore} \\\\\n",
+ " &= {\\tt net\\_heat\\_surface + internal\\_heat + heat\\_restore}\n",
+ " \\end{align*}\n",
+ " Note that ${\\tt internal\\_heat}$ represents the geothermal heating from the seafloor, which also contributes to the heat budget.\n",
+ "\n",
+ "2) The time change of liquid seawater heat is computed according to \n",
+ " $$ \\mbox{seawater heat content change} = \\frac{C_p }{\\tau_{n} - \\tau_{n-1} } \\int dA \\left(\\rho_0 \\int (\\Theta_{n} - \\Theta_{n-1}) \\, \\mathrm{d}z \\right) $$\n",
+ " where $\\tau_{n} - \\tau_{n-1}$ is the time increment of the output (i.e., one day) in seconds. Note that we make use of the MOM6 diagnostic for depth integrated potential/conservative temperature \n",
+ " $$ {\\tt tomint} = \\rho_0 \\int \\Theta \\, \\mathrm{d}z, $$\n",
+ " where the Boussinesq reference density, $\\rho_{0}$, is used since this test case makes the Boussinesq approximation. For self-consistency, we should have the following equality \n",
+ " $$ \\boxed{\\mbox{boundary heating of liquid seawater} = \\mbox{seawater heat content change}.} $$"
]
},
{
"cell_type": "code",
- "execution_count": 17,
+ "execution_count": 9,
"id": "cell-19",
"metadata": {},
"outputs": [
@@ -673,7 +621,7 @@
"Total seawater heat at time step n [Joules] = 1.991266151962276e+25\n",
"Total seawater heat at time step n0 [Joules] = 1.9912403096544068e+25\n",
"Total seawater heat content change [Joules] = 2.5842307869582826e+20\n",
- "Net heat flux across ocean surface [Joules] = 2.584230786967218e+20\n",
+ "Net heat flux across ocean boundaries [Joules] = 2.584230786967218e+20\n",
"Residual [Joules] = -893550592.0\n",
"Residual relative to heat content change = -3.4576973717263614e-12\n",
"Residual relative to tomint[n] = -5.19368040771876e-22\n"
@@ -708,7 +656,7 @@
},
{
"cell_type": "code",
- "execution_count": 25,
+ "execution_count": 10,
"id": "cell-21",
"metadata": {},
"outputs": [
@@ -763,7 +711,7 @@
},
{
"cell_type": "code",
- "execution_count": 26,
+ "execution_count": 11,
"id": "cell-23",
"metadata": {},
"outputs": [
@@ -810,15 +758,15 @@
"
Components of heat content associated with mass flux across ocean surface
\n",
"\n",
"Components of heat content of surface mass fluxes:\n",
- "$$\\begin{align*}\n",
- " {\\tt heat\\_PmE = } &{\\tt heat\\_content\\_lprec + heat\\_content\\_fprec + heat\\_content\\_evap + heat\\_content\\_lrunoff + heat\\_content\\_frunoff +} \\\\\n",
- " &{\\tt heat\\_content\\_cond + heat\\_content\\_frunoff\\_glc + heat\\_content\\_lrunoff\\_glc + heat\\_content\\_vprec}\n",
- "\\end{align*}$$"
+ "\\begin{align*}\n",
+ "{\\tt heat\\_PmE =} &{\\tt heat\\_content\\_lprec + heat\\_content\\_fprec + heat\\_content\\_evap + heat\\_content\\_lrunoff + heat\\_content\\_frunoff +} \\\\\n",
+ " &{\\tt heat\\_content\\_cond + heat\\_content\\_frunoff\\_glc + heat\\_content\\_lrunoff\\_glc + heat\\_content\\_vprec}\n",
+ "\\end{align*}"
]
},
{
"cell_type": "code",
- "execution_count": 27,
+ "execution_count": 12,
"id": "cell-28",
"metadata": {},
"outputs": [
@@ -883,7 +831,7 @@
},
{
"cell_type": "code",
- "execution_count": 28,
+ "execution_count": 13,
"id": "cell-33",
"metadata": {},
"outputs": [
@@ -947,35 +895,22 @@
"We compute the change in seawater salt content over a given time period using two methods. If the difference is large, then there is a bug.\n",
"\n",
"1) The net salt per unit time (units of kg/s) entering through the ocean boundaries is given by the area integral\n",
- "$$\\begin{equation*}\n",
- "\\mbox{boundary salt entering liquid seawater} = \\int Q_{S} \\, dA,\n",
- "\\end{equation*}$$\n",
- "where the net salt flux (units of $\\mbox{kg}~\\mbox{m}^{-2}~\\mbox{s}^{-1}$) is given by \n",
- "$$\\begin{align*}\n",
- " Q_{S} &= {\\tt salt\\_flux} + {\\tt salt\\_restore}.\n",
- "\\end{align*}$$\n",
- "A nonzero salt flux is associated with exchanges between liquid seawater and solid sea ice. It also arises from simulations using a restoring boundary flux associated with damping to observed sea surface salinity. Finally, there can be a salt flux when using sponges to damp the ocean interior back to an observed value. \n",
+ " $$ \\mbox{boundary salt entering liquid seawater} = \\int Q_{S} \\, dA, $$\n",
+ " where the net salt flux (units of $\\mbox{kg}~\\mbox{m}^{-2}~\\mbox{s}^{-1}$) is given by \n",
+ " $$ Q_{S} = {\\tt salt\\_flux} + {\\tt salt\\_restore}. $$\n",
+ " A nonzero salt flux is associated with exchanges between liquid seawater and solid sea ice. It also arises from simulations using a restoring boundary flux associated with damping to observed sea surface salinity. Finally, there can be a salt flux when using sponges to damp the ocean interior back to an observed value. \n",
"\n",
"2) The time change of liquid seawater salt content is computed according to \n",
- "$$\\begin{equation*}\n",
- "\\mbox{seawater salt content change} = \n",
- "\\frac{1}{\\tau_{n} - \\tau_{n-1} } \\int dA \\left(\\rho_0 \\int (S_{n} - S_{n-1}) \\, \\mathrm{d}z \\right) \n",
- "\\end{equation*}$$\n",
- "where $\\tau_{n} - \\tau_{n-1}$ is the time increment of the output (i.e., one day) in seconds. Note that we make use of the MOM6 diagnostic for depth integrated salinity \n",
- "$$\\begin{equation*}\n",
- " {\\tt somint} = \\rho_0 \\int S \\, \\mathrm{d}z,\n",
- "\\end{equation*}$$\n",
- "where the Boussinesq reference density, $\\rho_{0}$, is used since this test case makes the Boussinesq approximation. For self-consistency, we should have the following equality \n",
- "$$\\begin{equation*}\n",
- "\\boxed{\n",
- " \\mbox{boundary salt entering liquid seawater} = \\mbox{seawater salt content change}.\n",
- "}\n",
- "\\end{equation*}$$"
+ " $$ \\mbox{seawater salt content change} = \\frac{1}{\\tau_{n} - \\tau_{n-1} } \\int dA \\left(\\rho_0 \\int (S_{n} - S_{n-1}) \\, \\mathrm{d}z \\right) $$\n",
+ " where $\\tau_{n} - \\tau_{n-1}$ is the time increment of the output (i.e., one day) in seconds. Note that we make use of the MOM6 diagnostic for depth integrated salinity \n",
+ " $$ {\\tt somint} = \\rho_0 \\int S \\, \\mathrm{d}z, $$\n",
+ " where the Boussinesq reference density, $\\rho_{0}$, is used since this test case makes the Boussinesq approximation. For self-consistency, we should have the following equality \n",
+ " $$ \\boxed{\\mbox{boundary salt entering liquid seawater} = \\mbox{seawater salt content change}.} $$"
]
},
{
"cell_type": "code",
- "execution_count": 29,
+ "execution_count": 14,
"id": "cell-39",
"metadata": {},
"outputs": [
@@ -1011,7 +946,7 @@
},
{
"cell_type": "code",
- "execution_count": 30,
+ "execution_count": 15,
"id": "cell-40",
"metadata": {},
"outputs": [