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

merge upstream main post v6.5.0 #6

Merged
merged 80 commits into from
May 3, 2024

Conversation

zhaobin74
Copy link
Collaborator

@zhaobin74 zhaobin74 commented May 3, 2024

This PR merged with CICE consortium main branch post release 6.5.0.
Major change:

  • True ice transport on C-grid.

Depends on GEOS-ESM/Icepack#5

daveh150 and others added 30 commits December 16, 2022 14:48
CICE-Consortium#801)

* Adding method to check namelist in any order. Use subroutine in ice_namelist_mod.F90 to search for namelist in ice_in.

* Moved goto_nml subroutine to ice_fileunits.F90. Removed ice_namelist_mod.F90

* Cleanup indentations with tmpstr2 use

* Cleanup spacing and intentation

* For namelist check, remove extra continuation after making ice_abort string.

Co-authored-by: Tony Craig <[email protected]>
* Fix OMP setup

* Update meshgrid
…rtium#810)

* Modified doc for Dupont et al ref

* Minor modif to v_i calculation in seabed_stress_factor_prob to prevent rare instability
* Fix OMP setup

* Update meshgrid

* Small updates for CESM

* Add change for UFS
* Add time_period_freq to history file metadata
… 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 <[email protected]>
Reported-by: Jean-Francois Lemieux <[email protected]>

* 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 <[email protected]>
* ice_history_write: fix initial condition metadata under 'hist_avg'

When writing averaged history outputs (hist_avg=.true.), this setting
also affects the initial condition. Even if the actual data variables
written to the initial condition are not averaged (they are taken
more or less directly from the restart or the hard-coded defaults,
modulo aggregation over categories), their attributes ('cell_method' and
'time_rep') imply they are averaged, and the 'bound' attribute of the
'time' variable refers to the 'time_bounds' variable.

Make the metadata of the initial condition more correct by:
- not writing the 'time_bounds' variable (and the corresponding 'd2' dimension)
- not writing the 'bounds' attribute of the 'time' variable
- not writing the 'cell_method' attributes of each variable
- writing the 'time_rep' attribute of each variable as 'instantaneous'
instead of 'averaged'.

Do this by checking 'write_ic' at all places where we check for the
value of 'hist_avg' to write the above variables and attributes in each
of the 3 IO backends (binary, netcdf, pio2).

* drivers/{nemo_concepts,standalone}: write initial condition at initial time

In CICE_InitMod::cice_init, we call ice_calendar::advance_timestep
before writing the initial condition, such that the 'time' variable in
the initial condition is not zero; it has a value of 1*dt (the model
time step). The initial condition filename also reflects this, since
'msec' (model seconds) also has a value of 1*dt and is used in
ice_history_shared::construct_filename. This leads to the initial
condition filename not corresponding to the model initialization
date/time but rather 1*dt later.

Since we call 'accum_hist' after initializing the forcing, any forcing
field written to the initial condition has values corresponding to
msec=dt, whereas the ice state corresponds to msec=0, leading to an
inconsistency.

Fix that by calling 'accum_hist' to write the initial condition _before_
calling 'advance_timestep'. Since we now call 'accum_hist' before
initializing the forcing, any forcing field written to the initial
condition have its default, hard-coded value, instead of its value at
time=dt. An improvement would be to read the forcing at time=dt, write
the initial condition, advance the time step, and read the forcing
again, but let's not complicate things too much for now.
* Initial halochk unit test implementation

- Add halochk unit test
- Add "unknown" and "noupdate" checks to ice_boundary
- Remove field_loc_Wface, not used anywhere, not supported
- Update cice_decomp.csh script

To Do: validate tripole and tripoleT, add unit test to test suite

* - Fix bug in serial/ice_boundary.F90 tripoleT halo update
- Reduce redundant tripole buffer copies in serial/ice_boundary.F90
- Generalize iSrc wraparound calculation in ice_boundary.F90
- Add open, cyclic, tripole, and tripoleT set_nml files
- Update unittest suite

* - Add haloUpdate_stress test to halo unit test
- Add tripoleT support to haloUpdate_stress
- Add abort check that nx_global is even for tripole grids
- Update documentation

* update documentation

* update documentation

* update documentation

* update documentation

* update documentation

* update documentation

* Update halochk test to make haloupdate_stress test more robust, less chance for false positive

* update documentation

* update documentation

* update documentation
to fix the latex/pdf errors recently trapped by readthedocs.
* send wlat to and fro for FSD

* Update Icepack to include FSDmods

---------

Co-authored-by: cmbitz <[email protected]>
* Fix CESMCOUPLED compile problem in icepack
… bug (CICE-Consortium#824)

* Update global reduction implementation to improve performance, fix VP bug

This was mainly done for situations like VP that need a fast global sum.
The VP global sum is still slightly faster than the one computed in the
infrastructure, so kept that implementation.  Found a bug in the workspace_y
calculation in VP that was fixed.  Also found that the haloupdate call
as part of the precondition step generally improves VP performance, so removed
option to NOT call the haloupdate there.

Separately, fixed a bug in the tripoleT global sum implementation, added
a tripoleT global sum unit test, and resynced ice_exit.F90, ice_reprosum.F90,
and ice_global_reductions.F90 between serial and mpi versions.

- Refactor global sums to improve performance, move if checks outside do loops
- Fix bug in tripoleT global sums, tripole seam masking
- Update VP solver, use local global sum more often
- Update VP solver, fix bug in workspace_y calculation
- Update VP solver, always call haloupdate during precondition
- Refactor ice_exit.F90 and sync serial and mpi versions
- Sync ice_reprosum.F90 between serial and mpi versions
- Update sumchk unit test to handle grids better
- Add tripoleT sumchk test

* Update VP global sum to exclude local implementation with tripole grids
…#827)

* Add functionality to change hist_avg for each stream

* Fix some documentation

* Try to fix sphinx problem

* Fix hist_avg documentation

* Add some metadata changes to time and time_bounds
Remove trailing blanks via automated tool in some Fortran files
* Fix for mesh check in CESM driver

* Slightly different way to evaluate longitude difference

* Slightly different way to evaluate longitude difference

* Put the abs inside the mod

* Add abort calls back in
* update readthedocs.yaml, turn on pdf

* update readthedocs.yaml, turn on pdf

* update readthedocs.yaml, turn on pdf

* update readthedocs.yaml, turn on pdf
* Add option to change location in interval of time axis

* Only use hist_time_axis when hist_avg is true

* Add more comments and information in the documentation

* Add a check on hist_time_axis as well as a global attribute

* Abort if hist_time_axis is not set correctly.
Remove deprecated COREII LYq forcing

Remove deprecated print_points_state

Update links in rst documentation to point to main, not master
* updating paths for local nrlssc builds

* Add jra55do forcing option

* Updated env.nrlssc_gnu for new local directory structure

* Added JRA55do to file names. Added comments for each variable name at top of JRA55do_???_files subroutine

* Make JRA55 forcing to use common subroutines. Search atm_data_type for specific cases

* remove extraneous 'i' variable in JRA55_files

* Changed JRA55 filename JRA55_grid instead of grid at end of filename

* Add jra55do tests to base_suite and quick_suite. This is done via set_nml options.

* Update forcing implementation to provide a little more flexibility for
JRA55, JRA55do, and ncar bulk atm forcing files.

* Update documentation

* update Onyx port

* Update forcing documentation

Initial port to derecho_intel

* clean up blank spaces

---------

Co-authored-by: daveh150 <[email protected]>
…tium#846)

- fix optional arguments issues
- fix hsn_new(1) bug

Update optargs unit test, add new test cases

Add opticep unit test, to test CICE calls to Icepack without optional arguments.
Add new comparison option to comparelog.csh to compare a unit test with
a standard CICE test.

Update unittest_suite

Update documentation about optional arguments and unit tests
…al remapping (CICE-Consortium#833)

* Use same method whether l_fixed_area=T or F to compute masks for edge fluxes

* Corrected typo in comment

* Cosmetic (indentation) change in ice_transport_remap.F90

* Set l_fixed_area value depending of grid type

* Modifs to the doc for l_fixed_area

* Use umask for uvel,vvel initialization for boxslotcyl and change grid avg type from S to A in init_state

* Temporary changes before next PR: l_fixed_area=F for B and C grid

* Temporary changes before next PR: remove paragraph in the doc

* Small modifs: l_fixed_area and grid_ice are defined in module ice_transport_remap
…Consortium#853)

* test ghactions

* update master to main in github actions
* Replace tr_snow flag with snwredist, snwgrain in some places (tr_snow is still used more generally).  Fix intent(out) compile issue in ice_read_write.F90. Replace badger with chicoma machine files.

* update icepack to 86cae16d1b7c4c4f8

---------

Co-authored-by: apcraig <[email protected]>
* Deprecate zsalinity, mostly with ifdef and comments first for testing

* Deprecate zsalinity, remove code

* Add warning message for deprecated zsalinity

* Update Icepack to #f5e093f5148554674 (deprecate zsalinity)
…ICE-Consortium#850)

* Extend restart output controls, provide multiple streams for possible
output frequencies.  Convert dumpfreq, dumpfreq_n, dumpfreq_base to
arrays.

Modify histfreq_base to make it an array as well.  Now each history stream
can have it's own base time (init or zero).

Update documentation.

* Clean up implementation and documentation

* Update PR to check github actions
…ICE-Consortium#856)

* merge latest master (#4)

* Isotopes for CICE (CICE-Consortium#423)

Co-authored-by: apcraig <[email protected]>
Co-authored-by: David Bailey <[email protected]>
Co-authored-by: Elizabeth Hunke <[email protected]>

* updated orbital calculations needed for cesm

* fixed problems in updated orbital calculations needed for cesm

* update CICE6 to support coupling with UFS

* put in changes so that both ufsatm and cesm requirements for potential temperature and density are satisfied

* Convergence on ustar for CICE. (CICE-Consortium#452) (#5)

* Add atmiter_conv to CICE

* Add documentation

* trigger build the docs

Co-authored-by: David A. Bailey <[email protected]>

* update icepack submodule

* Revert "update icepack submodule"

This reverts commit e70d1ab.

* update comp_ice.backend with temporary ice_timers fix

* Fix threading problem in init_bgc

* Fix additional OMP problems

* changes for coldstart running

* Move the forapps directory

* remove cesmcoupled ifdefs

* Fix logging issues for NUOPC

* removal of many cpp-ifdefs

* fix compile errors

* fixes to get cesm working

* fixed white space issue

* Add restart_coszen namelist option

* update icepack submodule

* change Orion to orion in backend

remove duplicate print lines from ice_transport_driver

* add -link_mpi=dbg to debug flags (CICE-Consortium#8)

* cice6 compile (#6)

* enable debug build. fix to remove errors

* fix an error in comp_ice.backend.libcice

* change Orion to orion for machine identification

* changes for consistency w/ current emc-cice5 (CICE-Consortium#13)

Update to emc/develop fork to current CICE consortium 

Co-authored-by: David A. Bailey <[email protected]>
Co-authored-by: Tony Craig <[email protected]>
Co-authored-by: Elizabeth Hunke <[email protected]>
Co-authored-by: Mariana Vertenstein <[email protected]>
Co-authored-by: apcraig <[email protected]>
Co-authored-by: Philippe Blain <[email protected]>

* Fixcommit (CICE-Consortium#14)

Align commit history between emc/develop and cice-consortium/master

* Update CICE6 for integration to S2S


* add wcoss_dell_p3 compiler macro

* update to icepack w/ debug fix

* replace SITE with MACHINE_ID

* update compile scripts

* Support TACC stampede (CICE-Consortium#19)

* update icepack

* add ice_dyn_vp module to CICE_InitMod

* update gitmodules, update icepack

* Update CICE to consortium master (CICE-Consortium#23)

updates include:

* deprecate upwind advection (CICE-Consortium#508)
* add implicit VP solver (CICE-Consortium#491)

* update icepack

* switch icepack branches

* update to icepack master but set abort flag in ITD routine
to false

* update icepack

* Update CICE to latest Consortium master (CICE-Consortium#26)


update CICE and Icepack

* changes the criteria for aborting ice for thermo-conservation errors
* updates the time manager
* fixes two bugs in ice_therm_mushy
* updates Icepack to Consortium master w/ flip of abort flag for troublesome IC cases

* add cice changes for zlvs (CICE-Consortium#29)

* update icepack and pointer

* update icepack and revert gitmodules

* Fix history features

- Fix bug in history time axis when sec_init is not zero.
- Fix issue with time_beg and time_end uninitialized values.
- Add support for averaging with histfreq='1' by allowing histfreq_n to be any value
  in that case.  Extend and clean up construct_filename for history files.  More could
  be done, but wanted to preserve backwards compatibility.
- Add new calendar_sec2hms to converts daily seconds to hh:mm:ss.  Update the
  calchk calendar unit tester to check this method
- Remove abort test in bcstchk, this was just causing problems in regression testing
- Remove known problems documentation about problems writing when istep=1.  This issue
  does not exist anymore with the updated time manager.
- Add new tests with hist_avg = false.  Add set_nml.histinst.

* revert set_nml.histall

* fix implementation error

* update model log output in ice_init

* Fix QC issues

- Add netcdf ststus checks and aborts in ice_read_write.F90
- Check for end of file when reading records in ice_read_write.F90 for
  ice_read_nc methods
- Update set_nml.qc to better specify the test, turn off leap years since we're cycling
  2005 data
- Add check in c ice.t-test.py to make sure there is at least 1825 files, 5 years of data
- Add QC run to base_suite.ts to verify qc runs to completion and possibility to use
  those results directly for QC validation
- Clean up error messages and some indentation in ice_read_write.F90

* Update testing

- Add prod suite including 10 year gx1prod and qc test
- Update unit test compare scripts

* update documentation

* reset calchk to 100000 years

* update evp1d test

* update icepack

* update icepack

* add memory profiling (CICE-Consortium#36)


* add profile_memory calls to CICE cap

* update icepack

* fix rhoa when lowest_temp is 0.0

* provide default value for rhoa when imported temp_height_lowest
(Tair) is 0.0
* resolves seg fault when frac_grid=false and do_ca=true

* update icepack submodule

* Update CICE for latest Consortium master (CICE-Consortium#38)


    * Implement advanced snow physics in icepack and CICE
    * Fix time-stamping of CICE history files
    * Fix CICE history file precision

* Use CICE-Consortium/Icepack master (CICE-Consortium#40)

* switch to icepack master at consortium

* recreate cap update branch (CICE-Consortium#42)


* add debug_model feature
* add required variables and calls for tr_snow

* remove 2 extraneous lines

* remove two log print lines that were removed prior to
merge of driver updates to consortium

* duplicate gitmodule style for icepack

* Update CICE to latest Consortium/main (CICE-Consortium#45)

* Update CICE to Consortium/main (CICE-Consortium#48)


Update OpenMP directives as needed including validation via new omp_suite. Fixed OpenMP in dynamics.
Refactored eap puny/pi lookups to improve scalar performance
Update Tsfc implementation to make sure land blocks don't set Tsfc to freezing temp
Update for sea bed stress calculations

* fix comment, fix env for orion and hera

* replace save_init with step_prep in CICE_RunMod

* fixes for cgrid repro

* remove added haloupdates

* baselines pass with these extra halo updates removed

* change F->S for ocean velocities and tilts

* fix debug failure when grid_ice=C

* compiling in debug mode using -init=snan,arrays requires
initialization of variables

* respond to review comments

* remove inserted whitespace for uvelE,N and vvelE,N

* Add wave-cice coupling; update to Consortium main (CICE-Consortium#51)


* add wave-ice fields
* initialize aicen_init, which turns up as NaN in calc of floediam
export
* add call to icepack_init_wave to initialize wavefreq and dwavefreq
* update to latest consortium main (PR 752)

* add initializationsin ice_state

* initialize vsnon/vsnon_init and vicen/vicen_init

* Update CICE (CICE-Consortium#54)


* update to include recent PRs to Consortium/main

* fix for nudiag_set

allow nudiag_set to be available outside of cesm; may prefer
to fix in coupling interface

* Update CICE for latest Consortium/main (CICE-Consortium#56)

* add run time info

* change real(8) to real(dbl)kind)

* fix syntax

* fix write unit

* use cice_wrapper for ufs timer functionality

* add elapsed model time for logtime

* tidy up the wrapper

* fix case for 'time since' at the first advance

* add timer and forecast log

* write timer values to timer log, not nu_diag
* write log.ice.fXXX

* only one time is needed

* modify message written for log.ice.fXXX

* change info in fXXX log file

* Update CICE from Consortium/main (CICE-Consortium#62)


* Fix CESMCOUPLED compile issue in icepack. (CICE-Consortium#823)
* Update global reduction implementation to improve performance, fix VP bug (CICE-Consortium#824)
* Update VP global sum to exclude local implementation with tripole grids
* Add functionality to change hist_avg for each stream (CICE-Consortium#827)
* Update Icepack to #6703bc533c968 May 22, 2023 (CICE-Consortium#829)
* Fix for mesh check in CESM driver (CICE-Consortium#830)
* Namelist option for time axis position. (CICE-Consortium#839)

* reset timer after Advance to retrieve "wait time"

* add logical control for enabling runtime info

* remove zsal items from cap

* fix typo

---------

Co-authored-by: apcraig <[email protected]>
Co-authored-by: David Bailey <[email protected]>
Co-authored-by: Elizabeth Hunke <[email protected]>
Co-authored-by: Mariana Vertenstein <[email protected]>
Co-authored-by: Minsuk Ji <[email protected]>
Co-authored-by: Tony Craig <[email protected]>
Co-authored-by: Philippe Blain <[email protected]>
Co-authored-by: Jun.Wang <[email protected]>
Includes thin ice enthalpy fix, not bit-for-bit.
* Update cheyenne and derecho ports

cheyenne_intel updated to intel/19/1/1, mpt/2.25
cheyenne_gnu updated to gnu/8.3.0, mpt/2.25
cheyenne_pgi updated to pgi/19.9, mpt/2.22
derecho_intel minor updates
derecho_intelclassic added
derecho_inteloneapi added (not working)
derecho_gnu added
derecho_cray added
derecho_nvhpc added

cheyenne_pgi changed answers

derecho_inteloneapi is not working, compiler issues

fixes automated qc testing on cheyenne

* Update permissions on env.chicoma_intel
dabail10 and others added 22 commits November 28, 2023 14:10
…ortium#912)

* Add capability for h extension

* Update documentation for hist_str

* Change hist_str to hist_suffix

* Change in default namelist

* Update doc/source/cice_index.rst

Co-authored-by: Philippe Blain <[email protected]>

* One more hist_str

---------

Co-authored-by: Philippe Blain <[email protected]>
…-Consortium#922)

* update ghactions testing

* refactor min/max global reductions, code away from huge which was giving MPI some problems.
* removal of unused variables.

* moved xav to transport. Could remove commented code. Could remove xav and yav as they are zero

* Move derived parameters and only allocate if needed

* bugfixes for cxp, cyp...

* fix index and remove commented code in ice_grid

* new version of transport_remap. xav, yav array where needed. xxav, yyav parameter

* Removed comments rom ice_transport_remap and arrays for nonuniform grids
* Added new variable vort for vorticity output

* Added calc of diag vorticity for evp, vp and eap for B, C and CD grids

* updated doc and ice_in file for new vorticity variable

* Changed output frequency of vorticity from m to x

* Added f_vort to set_nml.histall and set_nml.histdbg

* Specified location of divu, shear and vort in ice_history.F90

---------

Co-authored-by: Tony Craig <[email protected]>
Update pio and netcdf error checks

---------

Co-authored-by: anton-climate <[email protected]>
Co-authored-by: Anton Steketee <[email protected]>
…nsortium#931)

Update PULL_REQUEST_TEMPLATE to request detailed information about changes associated with the PR. This will be useful for the commit log when squash merging the PR.
---------

Co-authored-by: Philippe Blain <[email protected]>
…nsortium#934)

In the "End-To-End Testing Procedure" section of the user guide, we
instruct users to run a base suite and a test suite, but only mention
checking the results of the test suite.

Also mention checking the results of the base suite first, to make sure
everything passes before checking the test suite.

Suggested-by: Jean-Francois Lemieux <[email protected]>
This provides new features for CICE IO both thru netCDF and PIO.  New namelist are added to control history and restart format, hdf5 compression and chunking, the PIO rearranger, and PIO IO task control.  Separate controls are provided for history and restart files.  The namelist changes are for

  _history_format, restart_format
  history_rearranger, restart_rearranger
  history_iotasks, history_root, history_stride, restart_iotasks, restart_root, and restart_stride
  history_chunksize, history_deflate, restart_chunksize, restart_deflate._

In particular,

- Update restart_format and history_format options to 'cdf1', 'cdf2', 'cdf5', 'hdf5', 'pnetcdf1', 'pnetcdf2', 'pnetcdf5', 'default'.  The old options, 'default', 'pio_netcdf', and 'pio_pnetcdf' are still supported and backwards compatible with lcdf64, but are deprecated and no longer documented.  The old options and old namelist lcdf64 are covered by the new options.  Support of the old options should be removed in the future.  Note that some problems were discovered when opening files with hdf5 format but reading non-hdf5 files with a spack built PIO/netCDF.  As a result, the format specified for the restart read is always 'cdf1' which provides flexibility and robustness across software installs, although it may result in serial reads of hdf5 files when a parallel read could be done.
- Deprecate lcdf64 namelist.  This namelist is no longer needed and is covered by the new restart_format and history_format options.  The namelist still exists and is backwards compatible with the old 'default', 'pio_netcdf', and 'pio_pnetcdf' format options, but is no longer documented.  This should be removed in the future.
- Add new namelist to control PIO pe/task setup (iotasks, root, stride) for history and restart.  These settings control the PIO IO tasks.  The root, stride, and iotasks are consistent with the MPI communicator.  root=0 is the first MPI task.  These control PIO IO performance and are usually a function of things like the IO and node hardware.  See PIO for more information.  CICE computes PIO iotask, root, and stride defaults for cases where -99 is passed in for some or all of these namelist.  Those defaults are somewhat constrained by a bug in PIO, NCAR/ParallelIO#1986.  The current implementation avoids the bug by limiting the iotasks for some MPI task counts.  This is noted in ice_pio.F90.
- Add new namelist to control PIO rearranger (rearranger) for history and restart.  Supports 'box', 'subset', and 'default'.  These control how PIO rearrangment is carried out.  default is equivalent to box and the box generally performs better.  See PIO for more information.
- Add new namelist to support hdf5 compression and chunking (deflate, chunksize) for history and restart.  The deflate controls file compression and is an integer between 0 and 9 where 0 means no compression and 9 is maximum compression.   Generally, the higher the number, the slower the IO and the smaller the file, but the optimal setting depends on the contents of the file.  Chunksize provides a performance control for the hdf5 parallel writes.  It is a 2d array and is associated with the size of the piece of the array written by hdf5.  hdf5 can be read and written in parallel, but that depends on how netCDF and PIO are built.  Note that prior version of PIO, including PIO1, do not support the hdf5 compression and chunking thru the PIO interface.
- Add new namelist settings (set_nml files) and update the io_suite to cover the new IO options.  Remove old namelist settings associated with the deprecated format options and the lcdf64 namelist.  These deprecated feature are no longer tested.
- Update documentation to add new namelist and IO features.
- Update the nuopc/cmeps driver code to support the new features.
- Update the default ice_in to add the new namelist.
- Update the derecho netcdf module to a version that supports hdf5.
- Clean up some code formatting (indentation)

---------

Co-authored-by: Anton Steketee <[email protected]>
* ice_history_shared: add namelist flags for coordinate variables

Users might not wish for all 8 coordinate variables to be written to
each history file, so add namelist flags allowing to disable each
coordinate variable independantly, following the approach used for the
other grid variables. Move the definition of 'ncoord' from each IO
backend to 'ice_history_shared'. Note that we already 'use' the whole of
ice_history_shared in ice_history_write, so we do not need to adjust the
use statement.

Note that the code that writes these variables in module
'ice_history_write' in each of the IO backends is not modified, it will
be adjusted in a following commit.

* io_{netcdf,pio2}/ice_history_write: define coordinates attributes in a loop

In ice_history_write::ice_write_hist, we initialize the 'var_coord' and
'coord_bounds' arrays by manually incrementing 'ind' and initializing
each elements with the corresponding information for each coordinate
variable. The rest of the code in that subroutine instead uses a loop on
'ncoord', which is a parameter holding the number of coordinates
variable, along with 'select' statements.

The latter approach is more elegant and also more flexible if we change
the number of coordinates variables. Refactor the code to use a loop and
leverage the integers n_{u,t,n,e}{lon,lat} added in the previous commit,
in both io_netcdf and io_pio2, which have identical code in this part of
the subroutine.

* io_{netcdf,pio2}/ice_history_write: use namelist flags for coordinate variables

In order to enable the namelist flags for each coordinate variables
added in the previous commit, adjust the code of the io_netcdf and
io_pio2 backends by checking the value of 'icoord(i)' for each loop on
'ncoord' that calls NetCDF or PIO functions.

Add the new flags to the reference namelist.
For CESMCOUPLED, the pio_iotype is set though CMEPS. For completeness, we also need to check the ioformat set through CMEPS. ioformat is used to set the nmode0. nmode0 and clobber combine to set the nmode flag for pio_createfile / pio_openfile operations. Due a typo nmode0 was not being set for netcdf4 iotypes (before this change).
Set idate0 in nuopc cap, so that the history "time:units" attribute in netcdf output is consistent with other model components.

Set use_leap_years in nuopc cap, so that netcdf output "time:calendar" is set correctly in history output

Co-authored-by: Denise Worthen <[email protected]>
Port CICE to Carpenter for intel, cray, and gnu compilers with mpich. Will add weekly testing on Carpenter, Onyx was recently decommissioned.

During development,

- It was discovered that the serial compilers and parallel compilers produce different results. This was reported to sys admins. Serial compilation is done with the parallel compilers to ensure bit-for-bit results with serial and mpi comm versions.
- It was discovered that the openmpi and intel mpi options are not working properly. This was reported to sys admins. All testing is done with mpich for now.
* Add dvsdtd diagnostic for SIMIP sndmassdyn

* Fix the units of SIMIP snow variables

* Fix calls to update_state

* Add present for dagedt and fix indents

* This PR has been updated to include dvsdtt (thermodynamic tendency
for snow). Also, the calls to update_state have been updated in all
of the drivers. Note that I can only test the NUOPC/CMEPS and standalone
drivers, so it would be good if others could test.

* Update the opticep unit test to be consistent with the latest changes.

---------

Co-authored-by: apcraig <[email protected]>
…E-Consortium#943)

Add checks that individual history streams have unique filenames. If they
do not, then streams will overwrite each other. With this change, abort in that case. Added in ice_history_shared.F90, subroutine construct_filename. The implementation tracks the latest filenames for each stream and checks versus those names. Because the file naming convention relies heavily on the current model date/time, this should be adequate (versus keeping track of all history filenames ever used).

Updated the cstream string in subroutine construct_filename. It was hardwired to len=1 which probably was an error. Made it len=char_len to support longer hist_suffix character strings in filenames.

Updated the ncfile variable implementation in ice_write_hist in io_binary, io_netcdf, and io_pio2. It was defined as an array of length max_nstrm, and was changed to a non-array character string. The array implementation served no purpose.

Modified the set_nml.histinst to add hist_suffix values for each stream. The latest code modifications cause The current test suite to fail with "histall,histinst" because it creates multiple streams with the same filename. Setting hist_suffix for histinst fixes this (and tests hist_suffix).

Clean up abort calls in ice_history_shared.F90, add space before "ERROR:".

Update the documentation describing history streams. Some "_" formatting was changed to simply "_" where the backslash wasn't needed in ug_implementation.rst.

Several namelist settings were tested to make sure the model would abort with identical filenames including the case where a time averaged file with output at each timestep conflicts with an instantaneous history stream of lower output frequency.
…sortium#75) (CICE-Consortium#944)

* fix dummy arguments w/o values
* fix missing j-loop in export 4d

Resolve compiler warning arising from ice_prescribed_mod due to the intent(out) variable RC not being given an explicit value. This is an operational requirement for NOAA. Fix bug arising from missing j-loop index in ice_import_export
@zhaobin74 zhaobin74 requested a review from mathomp4 May 3, 2024 13:29
@zhaobin74 zhaobin74 added the Contingent - DNA Do Not Approve (DNA). These changes are contingent on other PRs label May 3, 2024
Copy link
Member

@mathomp4 mathomp4 left a comment

Choose a reason for hiding this comment

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

Trust in Bin!

Copy link
Member

@mathomp4 mathomp4 left a comment

Choose a reason for hiding this comment

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

Trust in Bin!

@zhaobin74 zhaobin74 merged commit d7b5971 into geos/develop May 3, 2024
1 check failed
@zhaobin74
Copy link
Collaborator Author

Thanks, @mathomp4. The failed GH action on macos appears related to the submodule issue, which will be resolved once we push GEOS stuff into upstream.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Contingent - DNA Do Not Approve (DNA). These changes are contingent on other PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.