Baroclinic sea level calculation - #1104
Conversation
49713c9 to
c610d30
Compare
2aa435f to
0389b19
Compare
d0be54e to
8a56e4e
Compare
| pt, & ! Pressure at the top of a layer [R L2 T-2 ~> Pa] | ||
| pb, & ! Pressure at the bottom of a layer [R L2 T-2 ~> Pa] | ||
| gz, & ! Geopotential at the bottom of a layer [L2 T-2 ~> m2 s-2] | ||
| dp, & ! Pressure change across a layer in Boussinesq mode [R L2 T-2 ~> Pa] |
There was a problem hiding this comment.
The comment here should make it clear that this is the anomaly in the pressure change across a layer relative to what would be found if the density of the layer were rho_s. Without this clarification, it is very hard to see how the code in this routine would generate the baroclinic sea level anomaly. This comment also pertains to the descriptions of dg, dp_int, dg_int and p_int in the next few lines, all of which are also anomalies relative to the reference state.
Algorithms implemented in MOM_interface_heights.F90
Implemented in MOM_diagnostics.F90
Implemented for harmonic analysis
* Rewrite algorithm for the EOS and non-Boussinesq case. * Skip calculations at grid points with potentially zero depth.
* Fix dimensions of variables * Set the surface density as a run-time parameter, RHO_BSL, with the default value being RHO_BSL = 1025 kg m-3.
|
|
||
| I_gEarth = 1.0 / GV%g_Earth; SpV_s = 1.0 / rho_s | ||
|
|
||
| call find_eta(h, tv, G, GV, US, eta, halo_size=1, dZref=dZ_ref) |
There was a problem hiding this comment.
This call to find_eta is only needed in Boussinesq mode. Because this can be an expensive call in non-Boussinesq mode, it should be avoided when it is not needed. In fact, given the substantial differences in the algorithms and the meanings of the variables between Boussinesq and non-Boussinesq modes, I would be tempted to go so far as to split the body of this routine into two separate routines that are called depending on whether the Boussinsesq approximation is being made.
Hallberg-NOAA
left a comment
There was a problem hiding this comment.
I have worked through all of the calculations in this revised PR, and I am convinced that all of the expressions are correct (or at least plausible). The one big thing that would have helped in working through the code is for there to be more explicit comments describing some of the variables in find_bsl() to make it clear that they are anomalies relative to what would be found if the density were RHO_BSL, and that they can be negative. I think that this probably applies to dp, dp_int, and pt in Boussinesq mode while in non-Boussinesq mode it applies to gz, dg, and dg_int and p_int, but not to pb, pt or dp. (Without this reminder in the comments I spent much more time than I should looking for the subtraction without which the calculations do not make sense!) Given the very different meanings of these variables, it might even make sense to refactor find_bsl() to have separate internal routines (with a common top-level interfaces) for the Boussinesq and non-Boussinesq cases.
There also needs to be a more explicit description in the MOM_parameter_doc description for RHO_BSL explaining that this is the reference density for determining the surface height anomalies from on the baroclinic density structure based on integrals of the differences between the actual density and this value.
With these relatively straightforward changes to the documentation in the code and perhaps some strategic refactoring greater clarity (but without changing any of the actual calculations), I think that this PR would be ready to be accepted.
| enddo | ||
| !$OMP do | ||
| do j=js,je ; do i=is,ie ; if (maskT(i,j)) then | ||
| bsl(i,j) = - (p_int(i,j) * I_gEarth) / (rho_s * bathyT(i,j)) |
There was a problem hiding this comment.
I suspect that there are cases where dividing by bathyT here will not work because in some cases (such as the Great Lakes) bathyT can be equal to or above the reference geoid and still have water. Would it make more sense to use the vertical sum of the layer thicknesses (perhaps in a max with GV%H_subroundoff) in the denominator instead?
| enddo | ||
| !$OMP do | ||
| do j=js,je ; do i=is,ie ; if (maskT(i,j)) then | ||
| bsl(i,j) = (p_int(i,j) * (I_gEarth * I_gEarth)) / (rho_s * bathyT(i,j)) |
There was a problem hiding this comment.
I think that the denominator here should be the sum of the layer thicknesses.
Also, there should be spaces around the semicolon on the next line to follow the pattern used elsewhere.
* Clarify the description of local variables in find_bsl(), and the description of RHO_BSL in MOM_parameter_doc * Move find_eta so that it is not called in non-Boussinesq mode
|
Because whether the Boussinesq mode is activated must be determined during the run time, I feel it's difficult to split this subroutine into multiple subroutines under the same interface. |
|
For BSL calculation, what matters is not whether |
Also, in theory, the denominator should be the distance between the bottom and the mean sea level, instead of the instantaneous sea level, i.e., it should be time-independent. That's another reason I'm trying to avoid using the sum of layer thickness, because if the SSH variation is large relative to the total depth, this will amplify the error. |
|
Splitting this subroutine into 3 (one that is called from outside, and a Boussinesq version or a non-Boussinesq version that are called from the first one, depending on whether or not a particular run is Boussinesq) should be straightforward. This is the pattern that was adopted in MOM_PressureForce.F90, although in this case I would keep all 3 subroutines in the same module. |
|
You can accommodate spatially varying time-mean sea levels by using However, in the cases here it seems to me that we are dividing an integral by the total depth or pressure to give what amounts to a vertical average. If this can be interpreted as a vertical average, I would think that because the bounds of integration in the numerator vary with the rapid time-scales, the normalization in the denominator should also exhibit the same rapid variations. |
|
Split find_bsl() into three subroutines, depending on whether an equation of state is used and whether the Boussinesq approximation is used.
I thought about it and decided not to make this change for the following reasons:
I've added some comments explaining some of these aspects in the code. A more complete, mathematically rigours explanation of this algorithm, and the physics behind it, will be available once our paper is published. |
This replaces PR #984 and is based on algorithms in a manuscript that we plan to submit to JPO. Reference to this work will be added as soon as it's available.