-
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
Update CPPs and Documentation #329
Changes from all commits
8efeb59
300fbdc
fc5bfef
740fca4
9696156
e5a2356
a39f619
9f1244d
8dc0ec6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
! | ||
! author: Elizabeth C. Hunke and William H. Lipscomb, LANL | ||
! 2006: ECH converted to free source form (F90) | ||
! 2020: TC added support for NO_I8 and NO_R16 | ||
|
||
module icepack_kinds | ||
|
||
|
@@ -17,10 +18,18 @@ module icepack_kinds | |
char_len_long = 256, & | ||
log_kind = kind(.true.), & | ||
int_kind = selected_int_kind(6), & | ||
#if defined (NO_I8) | ||
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. Minor point, but why 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. In CICE, there is a mixture of #ifdef and #if defined. The NO_I8 in CICE has #if defined, so I made the icepack format match that. I could change it here, but then would probably want to change it in CICE as well. If we want to take this step, I'm happy to do it. I'm personally not that concerned about mixing the styles, although agree a single approach is nicer (but then requires diligence to maintain it). |
||
int8_kind = selected_int_kind(6), & | ||
#else | ||
int8_kind = selected_int_kind(13), & | ||
#endif | ||
real_kind = selected_real_kind(6), & | ||
dbl_kind = selected_real_kind(13), & | ||
#if defined (NO_R16) | ||
r16_kind = selected_real_kind(13) | ||
#else | ||
r16_kind = selected_real_kind(33,4931) | ||
#endif | ||
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. This looks good to me, but I have a dumb question. I'm not familiar with how selected_real_kind works, but it seems to me there might be a machine and compiler dependence here? Do we have to update this every couple of years? Sorry if I missed this in an earlier discussion. 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. The NO_I8 and NO_R16 are definitely compiler dependent which means they may be required on certain machines. And this could certainly change. For instance, NO_R16 is defined for a few machine/compilers now. It's possible those are incorrect. To be honest, I'm not sure how those settings were decided. I suspect it's partly historical and they have not been reviewed for a while. The main point of these CPPs is that they provide users with a flag to turn off these features if their compiler doesn't support them. As a general rule, they should only be used when needed. And we probably should review the current settings in the current machines to check whether we really do need them where they are currently set. |
||
|
||
!======================================================================= | ||
|
||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -163,7 +163,7 @@ preset setting (option), the set_env.setting and set_nml.setting will be used to | |||||
change the defaults. This is done as part of the ``icepack.setup`` and the | ||||||
modifications are resolved in the **icepack.settings** and **icepack_in** file placed in | ||||||
the case directory. If multiple options are chosen that conflict, then the last | ||||||
option chosen takes precedent. Not all options are compatible with each other. | ||||||
option chosen takes precedence. Not all options are compatible with each other. | ||||||
|
||||||
Some of the options are | ||||||
|
||||||
|
@@ -201,6 +201,25 @@ To add some optional settings, one might do:: | |||||
|
||||||
Once the cases are created, users are free to modify the **icepack.settings** and **icepack_in** namelist to further modify their setup. | ||||||
|
||||||
|
||||||
.. _cicecpps: | ||||||
|
||||||
C Preprocessor (CPP) Macros | ||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||||||
|
||||||
There are a few C Preprocessor Macros supported in the Icepack model. These | ||||||
support certain coding features to be excluded or included during the compile. They | ||||||
exist in part to support the CICE model and other applications that use Icepack. | ||||||
|
||||||
For standalone Icepack, The CPPs are defined by the `CPPDEFS` variable in the Icepack | ||||||
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.
Suggested change
|
||||||
Makefile. They are defined | ||||||
by passing the -D[CPP] to the C and Fortran compilers (ie. -DNO_I8) and this | ||||||
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. Instead of 'ie.' please use 'e.g.' |
||||||
is what needs to be set in the ``CPPDEFS`` variable. The value of ``ICE_CPPDEFS`` in | ||||||
**icepack.settings** is copied into the Makefile ``CPPDEFS`` variable as are settings | ||||||
hardwired into the **Macros.[machine]_[environment]** file. | ||||||
|
||||||
A list of available CPPs can be found in :ref:`tabcpps`. | ||||||
|
||||||
.. _version: | ||||||
|
||||||
Model Version Control | ||||||
|
@@ -330,7 +349,7 @@ the **env.[machine]** file. The easiest way to change a user's default is to | |||||
create a file in your home directory called **.cice\_proj** and add your | ||||||
preferred account name to the first line. | ||||||
There is also an option (``--acct``) in **icepack.setup** to define the account number. | ||||||
The order of precedent is **icepack.setup** command line option, | ||||||
The order of precedence is **icepack.setup** command line option, | ||||||
**.cice\_proj** setting, and then value in the **env.[machine]** file. | ||||||
|
||||||
.. _queue: | ||||||
|
@@ -343,7 +362,7 @@ the **env.[machine]** file. The easiest way to change a user's default is to | |||||
create a file in your home directory called **.cice\_queue** and add your | ||||||
preferred account name to the first line. | ||||||
There is also an option (``--queue``) in **icepack.setup** to define the queue name on a case basis. | ||||||
The order of precedent is **icepack.setup** command line option, | ||||||
The order of precedence is **icepack.setup** command line option, | ||||||
**.cice\_queue** setting, and then value in the **env.[machine]** file. | ||||||
|
||||||
.. _laptops: | ||||||
|
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.
This is the only instance of "NOFRAC"... was this added for compiling CICE as part of another model ? (@eclare108213 you added that in 1ae0446 (Isotopes for Icepack (#307), 2020-04-06))
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.
According to @dabail10, this was added for debugging the isotopes and is not needed at this time.