-
Notifications
You must be signed in to change notification settings - Fork 134
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
Documentation on adding diagnostic output. #331
Merged
Merged
Changes from 18 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
158b443
Fix nt_zbgc_frac
dabail10 93c6ab4
Merge branch 'master' of https://github.com/CICE-Consortium/Icepack
dabail10 8f3263d
Merge branch 'master' of https://github.com/CICE-Consortium/Icepack
dabail10 776316e
Merge branch 'master' of https://github.com/CICE-Consortium/Icepack
dabail10 a2219bf
Merge branch 'master' of https://github.com/CICE-Consortium/Icepack
dabail10 2abbfa7
Merge branch 'master' of https://github.com/CICE-Consortium/Icepack
dabail10 9bb6df7
Merge branch 'master' of https://github.com/ESCOMP/Icepack
dabail10 b72c0bc
Merge branch 'master' of https://github.com/CICE-Consortium/Icepack
dabail10 1f0195e
Merge branch 'master' of https://github.com/ESCOMP/Icepack
dabail10 78c0aef
Merge branch 'master' of https://github.com/CICE-Consortium/Icepack
dabail10 6a603cd
Merge branch 'master' of https://github.com/ESCOMP/Icepack
dabail10 d353104
Merge branch 'master' of https://github.com/CICE-Consortium/Icepack
dabail10 d9273f1
Merge branch 'master' of https://github.com/CICE-Consortium/Icepack
dabail10 2ec16b0
Merge branch 'master' of https://github.com/CICE-Consortium/Icepack
dabail10 a40bbf9
Merge branch 'master' of https://github.com/CICE-Consortium/Icepack
dabail10 faa181f
Merge branch 'master' of https://github.com/CICE-Consortium/Icepack
dabail10 a2950cc
Merge branch 'master' of https://github.com/CICE-Consortium/Icepack
dabail10 e920664
New developer guide module on adding diagnostics
dabail10 641b354
Merge branch 'master' of https://github.com/CICE-Consortium/Icepack i…
dabail10 a12e4a9
More on adding diagnostics
dabail10 a7f961a
test
dabail10 88d35ce
fix errors
dabail10 616a69a
Fix version of bibtex
dabail10 9b6238a
Fix version of bibtex
dabail10 dde8c27
Merge branch 'master' of git+ssh://github.com/CICE-Consortium/Icepack…
dabail10 25a2793
Update documentation for diagnostics
dabail10 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
:tocdepth: 3 | ||
|
||
.. _adddiag: | ||
|
||
Adding diagnostics | ||
================== | ||
|
||
Icepack only produces ASCII (text) log output for four points (full model with ITD, an initially ice free point, a land point, and a case with a slab ocean). Each of these files contains the state information for that point. Sometimes additional variables are required in this output. The procedure for adding diagnostic variables is outlined here. | ||
|
||
#. For non-BGC variables, one should edit **icedrv\_diagnostics.F90**: | ||
|
||
- If the variable is already defined within the code, then add it to a "use" statement in the subroutine | ||
``runtime_diags``. | ||
|
||
- If the variable is just a scalar, then follow the example of "aice". Copy the write statement for Qa to | ||
a place in the output list where it is most appropriate. The format "900" is appropriate for most scalars. | ||
Edit the copied statement to be the variable you want. The following example adds snow-melt (melts). | ||
|
||
.. code-block:: fortran | ||
|
||
use icedrv_flux, only: melts | ||
|
||
write(nu_diag_out+n-1,900) 'snow melt = ',melts(n)! snow melt | ||
|
||
- If the variable is an array, say depending on ncat, then follow the example of fiso_evap. This just requires | ||
adding a loop for the print statement. Make sure ncat and a counter, nc are available. Say for example, | ||
the category ice area, aicen. | ||
|
||
.. code-block:: fortran | ||
|
||
use icedrv_domain_size, only: ncat | ||
|
||
use icedrv_state, only: aicen | ||
|
||
! local variables | ||
|
||
integer (kind=int_kind) :: & | ||
n, nc, k | ||
|
||
do nc = 1,ncat | ||
write(nu_diag_out+n-1,901) 'Category ice area = ',aicen(n,nc),nc ! category ice area | ||
enddo | ||
|
||
- If the variable is a tracer, then in addition to the variable trcr or trcrn, you will need to have the tracer | ||
index available. Here, you can look at the example of nt_Tsfc. | ||
|
||
- In some cases, a new format statement might be required if 900 or 901 are not correct. | ||
|
||
#. For BGC variables, one should edit **icedrv\_diagnostics\_bgc.F90**: | ||
|
||
- If the variable is already defined within the code, then add it to a "use" statement in the subroutine | ||
``hbrine_diags`` or ``bgc_diags`` or ``zsal_diags``. The similar procedure for state variables is used here. | ||
|
||
- Note that the BGC needs to be activited and the particular tracer turned on. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. spell activated There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed. |
||
|
||
In general, try to format the output statements to line up with the surrounding print messages. This may require a couple of tries to get it to compile and run. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,4 +16,5 @@ Developer Guide | |
dg_driver.rst | ||
dg_scripts.rst | ||
dg_adding_tracers.rst | ||
dg_adding_diagnostics.rst | ||
dg_other.rst |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is would add what n is, e.g.
(no hyphen needed)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added a bit more here. Hopefully this is helpful.