Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc, ice_history: correct units for 'sigP' and improve doc for stress variables #817

Merged
merged 3 commits into from
Mar 8, 2023

Conversation

phil-blain
Copy link
Member

PR checklist

  • Suggest PR reviewers from list in the column to the right.
  • Please copy the PR test results link or provide a summary of testing completed below.
    Did not run a whole test suite as it does not change the results. I tested that sigP has the correct units in the history files.
  • How much do the PR code changes differ from the unmodified code?
    • bit for bit
    • different at roundoff level
    • more substantial
  • Does this PR create or have dependencies on Icepack or any other models?
    • Yes
    • No
  • Does this PR update the Icepack submodule? If so, the Icepack submodule must point to a hash on Icepack's main branch.
    • Yes
    • No
  • Does this PR add any new test cases?
    • Yes
    • No
  • Is the documentation being updated? ("Documentation" includes information on the wiki or in the .rst files from doc/source/, which are used to create the online technical docs at https://readthedocs.org/projects/cice-consortium-cice/. A test build of the technical docs will be performed as part of the PR testing.)
    • Yes
    • No, does the documentation need to be updated at a later time?
      • Yes
      • No
  • Please provide any additional information or relevant details below:

The intenal ice pressure 'sigP' is is units of N/m, as can be seen in
ice_dyn_shared::principal_stress. However, the corresponding history
variable is wrongly defined in ice_history::init_hist with unit '1'
(dimensionless). This means the wrong unit is written to the NetCDF
history output. This dates back to the introduction of that variable in
6ed2359 (Added pressure, modified norm of principal stresses and made
small modifs to basal stress following Till's comments, 2018-03-02).

Fix the unit. While at it, add an entry for 'sigP' in the index, from
which this variable is missing.

Reported-by: Frederic Dupont frederic.dupont@canada.ca
Reported-by: Jean-Francois Lemieux jean-francois.lemieux@canada.ca

@phil-blain phil-blain requested a review from apcraig March 7, 2023 17:29
@dabail10
Copy link
Contributor

dabail10 commented Mar 7, 2023

I guess I had always assumed that sigP was unitless like sig1 and sig2. Good catch.

Copy link
Contributor

@eclare108213 eclare108213 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The confusion might have originated with this statement in the sg_dynamics.rst doc (or maybe this statement is also a symptom):

CICE can output the internal ice pressure which is an important field to support navigation in ice-infested water. The internal ice pressure (sigP) is the average of the normal stresses multiplied by -1 and is therefore simply equal to -\sigma_1/2.

"normal" does not mean "normalized" here, I think, but that's how I initially read it.
Could this bit of documentation be rephrased to be more clear?

@phil-blain
Copy link
Member Author

phil-blain commented Mar 7, 2023

Indeed, normal does not mean normalized there, that's my understanding. Maybe just referencing the variables sigma_11, sigma_22 already introduced above in the text would help lessen the confusion ? something like this:

diff --git a/./doc/source/science_guide/sg_dynamics.rst b/./doc/source/science_guide/sg_dynamics.rst
index 6b269d4..2135048 100644
--- a/./doc/source/science_guide/sg_dynamics.rst
+++ b/./doc/source/science_guide/sg_dynamics.rst
@@ -450,45 +450,45 @@ Rheology

 For convenience we formulate the stress tensor :math:`\bf \sigma` in
 terms of :math:`\sigma_1=\sigma_{11}+\sigma_{22}`,
 :math:`\sigma_2=\sigma_{11}-\sigma_{22}`, and introduce the
 divergence, :math:`D_D`, and the horizontal tension and shearing
 strain rates, :math:`D_T` and :math:`D_S` respectively:

 .. math::
    D_D = \dot{\epsilon}_{11} + \dot{\epsilon}_{22},

 .. math::
    D_T = \dot{\epsilon}_{11} - \dot{\epsilon}_{22},

 .. math::
    D_S = 2\dot{\epsilon}_{12},

 where

 .. math::
    \dot{\epsilon}_{ij} = {1\over 2}\left({{\partial u_i}\over{\partial x_j}} + {{\partial u_j}\over{\partial x_i}}\right)

 CICE can output the internal ice pressure which is an important field to support navigation in ice-infested water.
-The internal ice pressure (``sigP``) is the average of the normal stresses multiplied by :math:`-1` and
+The internal ice pressure (``sigP``) is the average of the normal stresses (:math:`\sigma_{11}, \sigma_{22}`) multiplied by :math:`-1` and
 is therefore simply equal to :math:`-\sigma_1/2`.

@JFLemieux73 what do you think?

The sphinxcontrib.bibtex Sphinx extension used for the bibliography now
wants the bibliography file to be configured in the Sphinx configuration
file (conf.py) instead of in the source file where the bibliography is
included. This is new in sphinxcontrib.bibtex 2.0 [1], so let's do that.

Keeping the filename also in zreferences.rst does not hurt and lets us
stay compatible with earlier versions of sphinxcontrib.bibtex, so let's
keep it there also.

[1] https://sphinxcontrib-bibtex.readthedocs.io/en/latest/changes.html#id5
The intenal ice pressure 'sigP' is is units of N/m, as can be seen in
ice_dyn_shared::principal_stress. However, the corresponding history
variable is wrongly defined in ice_history::init_hist with unit '1'
(dimensionless). This means the wrong unit is written to the NetCDF
history output. This dates back to the introduction of that variable in
6ed2359 (Added pressure, modified norm of principal stresses and made
small modifs to basal stress following Till's comments, 2018-03-02).

Fix the unit. While at it, add an entry for 'sigP' in the index, from
which this variable is missing.

Reported-by: Frederic Dupont <frederic.dupont@canada.ca>
Reported-by: Jean-Francois Lemieux <jean-francois.lemieux@canada.ca>
@phil-blain phil-blain changed the title ice_history: correct units for 'sigP' doc, ice_history: correct units for 'sigP' and improve doc for stress variables Mar 8, 2023
Try to make the doc a little less confusing by cross-referencing the
code variables used for stress computations with the corresponding
variables in the science guide a little bit more, and vice-versa:

- mention the doc variables sigma_1, sigma_2 in the index entries for
stressp, stressm
- mention the code variables stressp, stressm when the doc variables
sigma_1, sigma_2 are introduced
- introduce new doc variables sigma_n,1 and sigma_n,2 to denote the
normalized principal stresses, and add the equation for those. This
allows mentioning that they are normalized by the ice strength, which
was not mentioned elsewhere.
- mention these new doc variables in the index entry for sig1, sig2
- refer to the normal stress sigma_11, sigma_22 by their variable names
when mentioning them in the sentence that introduces the ice pressure
- mention the code variables sig1, sig2 in the "Implementation" part of
the user guide when mentioning the 'principal_stresses' subroutine.

Helped-by: Jean-Francois Lemieux <jean-francois.lemieux@canada.ca>
@phil-blain
Copy link
Member Author

phil-blain commented Mar 8, 2023

I just pushed a new version, here is the range-diff:

$ git range-diff  @{u}  3259e4 HEAD
-:  ------- > 1:  9b42771 doc/source/conf.py: adjust for sphinxcontrib.bibtex 2.0
1:  3259e46 ! 2:  59dbdc2 ice_history: correct units for 'sigP'
    @@ doc/source/cice_index.rst: either Celsius or Kelvin units).  Deprecated paramete
         "shlat", "southern latitude of artificial mask edge", "30\ :math:`^\circ`\ N"
         "shortwave", "flag for shortwave parameterization (‘ccsm3’ or ‘dEdd’)", ""
         "sig1(2)", "principal stress components (diagnostic)", ""
    -+   "sigP", "internal ice pressure", ""
    ++   "sigP", "internal ice pressure", "N/m"
         "sil", "silicate concentration", "mmol/m\ :math:`^3`"
         "sinw", "sine of the turning angle in water", "0."
         "Sinz", "ice salinity profile", "ppt"
-:  ------- > 3:  7b3ef24 doc: clarify stress variables

The first commit was needed to build the documentation locally. The 3rd commit tries to make the documentation clearer. Hopefully this addresses your comment, @eclare108213 :)

Copy link
Contributor

@eclare108213 eclare108213 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thanks!

@apcraig apcraig merged commit 0fcc140 into CICE-Consortium:main Mar 8, 2023
phil-blain added a commit to phil-blain/CICE that referenced this pull request Mar 15, 2023
… variables (CICE-Consortium#817)

* doc/source/conf.py: adjust for sphinxcontrib.bibtex 2.0

The sphinxcontrib.bibtex Sphinx extension used for the bibliography now
wants the bibliography file to be configured in the Sphinx configuration
file (conf.py) instead of in the source file where the bibliography is
included. This is new in sphinxcontrib.bibtex 2.0 [1], so let's do that.

Keeping the filename also in zreferences.rst does not hurt and lets us
stay compatible with earlier versions of sphinxcontrib.bibtex, so let's
keep it there also.

[1] https://sphinxcontrib-bibtex.readthedocs.io/en/latest/changes.html#id5

* ice_history: correct units for 'sigP'

The intenal ice pressure 'sigP' is is units of N/m, as can be seen in
ice_dyn_shared::principal_stress. However, the corresponding history
variable is wrongly defined in ice_history::init_hist with unit '1'
(dimensionless). This means the wrong unit is written to the NetCDF
history output. This dates back to the introduction of that variable in
6ed2359 (Added pressure, modified norm of principal stresses and made
small modifs to basal stress following Till's comments, 2018-03-02).

Fix the unit. While at it, add an entry for 'sigP' in the index, from
which this variable is missing.

Reported-by: Frederic Dupont <frederic.dupont@canada.ca>
Reported-by: Jean-Francois Lemieux <jean-francois.lemieux@canada.ca>

* doc: clarify stress variables

Try to make the doc a little less confusing by cross-referencing the
code variables used for stress computations with the corresponding
variables in the science guide a little bit more, and vice-versa:

- mention the doc variables sigma_1, sigma_2 in the index entries for
stressp, stressm
- mention the code variables stressp, stressm when the doc variables
sigma_1, sigma_2 are introduced
- introduce new doc variables sigma_n,1 and sigma_n,2 to denote the
normalized principal stresses, and add the equation for those. This
allows mentioning that they are normalized by the ice strength, which
was not mentioned elsewhere.
- mention these new doc variables in the index entry for sig1, sig2
- refer to the normal stress sigma_11, sigma_22 by their variable names
when mentioning them in the sentence that introduces the ice pressure
- mention the code variables sig1, sig2 in the "Implementation" part of
the user guide when mentioning the 'principal_stresses' subroutine.

Helped-by: Jean-Francois Lemieux <jean-francois.lemieux@canada.ca>

(cherry picked from commit 0fcc140)

Cherry-pick related notes:
- We get a conflict in cice_index.rst due to the additional 'U' at the
end of strintx(y)U and strocnx(y)U. Let's keep those lines as they are
upstream in order to minimize potential conflicts in the future. I'm not
sure this is actually the best way to go, but we'll see how this goes.
phil-blain added a commit to phil-blain/CICE that referenced this pull request Mar 15, 2023
… variables (CICE-Consortium#817)

* doc/source/conf.py: adjust for sphinxcontrib.bibtex 2.0

The sphinxcontrib.bibtex Sphinx extension used for the bibliography now
wants the bibliography file to be configured in the Sphinx configuration
file (conf.py) instead of in the source file where the bibliography is
included. This is new in sphinxcontrib.bibtex 2.0 [1], so let's do that.

Keeping the filename also in zreferences.rst does not hurt and lets us
stay compatible with earlier versions of sphinxcontrib.bibtex, so let's
keep it there also.

[1] https://sphinxcontrib-bibtex.readthedocs.io/en/latest/changes.html#id5

* ice_history: correct units for 'sigP'

The intenal ice pressure 'sigP' is is units of N/m, as can be seen in
ice_dyn_shared::principal_stress. However, the corresponding history
variable is wrongly defined in ice_history::init_hist with unit '1'
(dimensionless). This means the wrong unit is written to the NetCDF
history output. This dates back to the introduction of that variable in
6ed2359 (Added pressure, modified norm of principal stresses and made
small modifs to basal stress following Till's comments, 2018-03-02).

Fix the unit. While at it, add an entry for 'sigP' in the index, from
which this variable is missing.

Reported-by: Frederic Dupont <frederic.dupont@canada.ca>
Reported-by: Jean-Francois Lemieux <jean-francois.lemieux@canada.ca>

* doc: clarify stress variables

Try to make the doc a little less confusing by cross-referencing the
code variables used for stress computations with the corresponding
variables in the science guide a little bit more, and vice-versa:

- mention the doc variables sigma_1, sigma_2 in the index entries for
stressp, stressm
- mention the code variables stressp, stressm when the doc variables
sigma_1, sigma_2 are introduced
- introduce new doc variables sigma_n,1 and sigma_n,2 to denote the
normalized principal stresses, and add the equation for those. This
allows mentioning that they are normalized by the ice strength, which
was not mentioned elsewhere.
- mention these new doc variables in the index entry for sig1, sig2
- refer to the normal stress sigma_11, sigma_22 by their variable names
when mentioning them in the sentence that introduces the ice pressure
- mention the code variables sig1, sig2 in the "Implementation" part of
the user guide when mentioning the 'principal_stresses' subroutine.

Helped-by: Jean-Francois Lemieux <jean-francois.lemieux@canada.ca>

(cherry picked from commit 0fcc140)

Cherry-pick related notes:
- We get a conflict in cice_index.rst due to the additional 'U' at the
end of strintx(y)U and strocnx(y)U. Let's keep those lines as they are
upstream in order to minimize potential conflicts in the future. I'm not
sure this is actually the best way to go, but we'll see how this goes.
phil-blain added a commit to phil-blain/CICE that referenced this pull request Mar 16, 2023
doc, ice_history: correct units for 'sigP' and improve doc for stress variables (CICE-Consortium#817)

Closes #20
phil-blain added a commit to phil-blain/CICE that referenced this pull request Feb 2, 2024
… variables (CICE-Consortium#817)

* doc/source/conf.py: adjust for sphinxcontrib.bibtex 2.0

The sphinxcontrib.bibtex Sphinx extension used for the bibliography now
wants the bibliography file to be configured in the Sphinx configuration
file (conf.py) instead of in the source file where the bibliography is
included. This is new in sphinxcontrib.bibtex 2.0 [1], so let's do that.

Keeping the filename also in zreferences.rst does not hurt and lets us
stay compatible with earlier versions of sphinxcontrib.bibtex, so let's
keep it there also.

[1] https://sphinxcontrib-bibtex.readthedocs.io/en/latest/changes.html#id5

* ice_history: correct units for 'sigP'

The intenal ice pressure 'sigP' is is units of N/m, as can be seen in
ice_dyn_shared::principal_stress. However, the corresponding history
variable is wrongly defined in ice_history::init_hist with unit '1'
(dimensionless). This means the wrong unit is written to the NetCDF
history output. This dates back to the introduction of that variable in
6ed2359 (Added pressure, modified norm of principal stresses and made
small modifs to basal stress following Till's comments, 2018-03-02).

Fix the unit. While at it, add an entry for 'sigP' in the index, from
which this variable is missing.

Reported-by: Frederic Dupont <frederic.dupont@canada.ca>
Reported-by: Jean-Francois Lemieux <jean-francois.lemieux@canada.ca>

* doc: clarify stress variables

Try to make the doc a little less confusing by cross-referencing the
code variables used for stress computations with the corresponding
variables in the science guide a little bit more, and vice-versa:

- mention the doc variables sigma_1, sigma_2 in the index entries for
stressp, stressm
- mention the code variables stressp, stressm when the doc variables
sigma_1, sigma_2 are introduced
- introduce new doc variables sigma_n,1 and sigma_n,2 to denote the
normalized principal stresses, and add the equation for those. This
allows mentioning that they are normalized by the ice strength, which
was not mentioned elsewhere.
- mention these new doc variables in the index entry for sig1, sig2
- refer to the normal stress sigma_11, sigma_22 by their variable names
when mentioning them in the sentence that introduces the ice pressure
- mention the code variables sig1, sig2 in the "Implementation" part of
the user guide when mentioning the 'principal_stresses' subroutine.

Helped-by: Jean-Francois Lemieux <jean-francois.lemieux@canada.ca>

(cherry picked from commit 0fcc140)

Cherry-pick related notes:
- We get a conflict in cice_index.rst due to the additional 'U' at the
end of strintx(y)U and strocnx(y)U. Let's keep those lines as they are
upstream in order to minimize potential conflicts in the future. I'm not
sure this is actually the best way to go, but we'll see how this goes.
phil-blain added a commit to phil-blain/CICE that referenced this pull request Feb 2, 2024
doc, ice_history: correct units for 'sigP' and improve doc for stress variables (CICE-Consortium#817)

Closes #20
phil-blain added a commit to phil-blain/CICE that referenced this pull request Feb 9, 2024
… variables (CICE-Consortium#817)

* doc/source/conf.py: adjust for sphinxcontrib.bibtex 2.0

The sphinxcontrib.bibtex Sphinx extension used for the bibliography now
wants the bibliography file to be configured in the Sphinx configuration
file (conf.py) instead of in the source file where the bibliography is
included. This is new in sphinxcontrib.bibtex 2.0 [1], so let's do that.

Keeping the filename also in zreferences.rst does not hurt and lets us
stay compatible with earlier versions of sphinxcontrib.bibtex, so let's
keep it there also.

[1] https://sphinxcontrib-bibtex.readthedocs.io/en/latest/changes.html#id5

* ice_history: correct units for 'sigP'

The intenal ice pressure 'sigP' is is units of N/m, as can be seen in
ice_dyn_shared::principal_stress. However, the corresponding history
variable is wrongly defined in ice_history::init_hist with unit '1'
(dimensionless). This means the wrong unit is written to the NetCDF
history output. This dates back to the introduction of that variable in
6ed2359 (Added pressure, modified norm of principal stresses and made
small modifs to basal stress following Till's comments, 2018-03-02).

Fix the unit. While at it, add an entry for 'sigP' in the index, from
which this variable is missing.

Reported-by: Frederic Dupont <frederic.dupont@canada.ca>
Reported-by: Jean-Francois Lemieux <jean-francois.lemieux@canada.ca>

* doc: clarify stress variables

Try to make the doc a little less confusing by cross-referencing the
code variables used for stress computations with the corresponding
variables in the science guide a little bit more, and vice-versa:

- mention the doc variables sigma_1, sigma_2 in the index entries for
stressp, stressm
- mention the code variables stressp, stressm when the doc variables
sigma_1, sigma_2 are introduced
- introduce new doc variables sigma_n,1 and sigma_n,2 to denote the
normalized principal stresses, and add the equation for those. This
allows mentioning that they are normalized by the ice strength, which
was not mentioned elsewhere.
- mention these new doc variables in the index entry for sig1, sig2
- refer to the normal stress sigma_11, sigma_22 by their variable names
when mentioning them in the sentence that introduces the ice pressure
- mention the code variables sig1, sig2 in the "Implementation" part of
the user guide when mentioning the 'principal_stresses' subroutine.

Helped-by: Jean-Francois Lemieux <jean-francois.lemieux@canada.ca>

(cherry picked from commit 0fcc140)

Cherry-pick related notes:
- We get a conflict in cice_index.rst due to the additional 'U' at the
end of strintx(y)U and strocnx(y)U. Let's keep those lines as they are
upstream in order to minimize potential conflicts in the future. I'm not
sure this is actually the best way to go, but we'll see how this goes.
- After rebasing, it turns out this was a good decision!
phil-blain added a commit to phil-blain/CICE that referenced this pull request Feb 9, 2024
doc, ice_history: correct units for 'sigP' and improve doc for stress variables (CICE-Consortium#817)

Closes #20
@phil-blain phil-blain deleted the doc-pressure-unit branch February 19, 2024 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants