Skip to content

Commit

Permalink
Update CICE to latest Consortium master (NOAA-EMC#26)
Browse files Browse the repository at this point in the history
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 (NOAA-EMC#29)

update icepack and pointer

update icepack and revert gitmodules

update icepack

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

add memory profiling (NOAA-EMC#36)

* add profile_memory calls to CICE cap

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
  • Loading branch information
DeniseWorthen committed May 10, 2024
1 parent 297aa57 commit bf1dfc5
Show file tree
Hide file tree
Showing 98 changed files with 5,085 additions and 6,839 deletions.
64 changes: 10 additions & 54 deletions .github/workflows/test-cice.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ name: GHActions
on:
push:
branches:
- main
- master
- 'CICE*'
- 'ghactions*'
pull_request:
Expand All @@ -27,12 +27,8 @@ jobs:
matrix:
# os: [macos-latest, ubuntu-latest]
os: [macos-latest]
# os: [macos-13]
# os: [ubuntu-latest]
include:
# - os: macos-13
# envdef: macos
# minicond: Miniconda3-latest-MacOSX-x86_64.sh
- os: macos-latest
envdef: macos
minicond: Miniconda3-latest-MacOSX-x86_64.sh
Expand All @@ -46,7 +42,6 @@ jobs:
run: |
sudo xcode-select -r
sudo xcode-select -s /Library/Developer/CommandLineTools
sudo ln -s /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/* /usr/local/include/
echo "xcrun --show-sdk-path: $(xcrun --show-sdk-path)"
echo "xcode-select -p: $(xcode-select -p)"
- name: system info
Expand Down Expand Up @@ -78,20 +73,6 @@ jobs:
ln -s ${GITHUB_WORKSPACE}/../CICE ${HOME}/cice
# ls -al ${HOME}/
# ls -al ${GITHUB_WORKSPACE}/
- name: check for tabs
run: |
cd $HOME/cice/cicecore
set cnt = 0
set ffiles = `find -P . -iname "*.f*"`
set cfiles = `find -P . -iname "*.c*"`
foreach file ($ffiles $cfiles)
set fcnt = `sed -n '/\t/p' $file | wc -l`
@ cnt = $cnt + $fcnt
if ($fcnt > 0) then
echo "TAB found: $fcnt $file"
endif
end
exit $cnt
- name: setup conda env
shell: /bin/bash {0}
run: |
Expand All @@ -102,26 +83,10 @@ jobs:
conda env create -f configuration/scripts/machines/environment.yml
- name: check conda env
run: |
conda activate cice && which clang && which gfortran && which mpicc && which mpifort && which make
clang --version
gfortran --version
conda activate cice && which mpicc && which mpifort && which make
mpifort --version
mpicc --version
make --version
# echo "mpifort -v:"
# mpifort -v
# echo "mpifort --showme:compile:"
# mpifort --showme:compile
# echo "mpifort --showme:link:"
# mpifort --showme:link
# echo "mpifort --showme:command:"
# mpifort --showme:command
# echo "mpifort --showme:libdirs:"
# mpifort --showme:libdirs
# echo "mpifort --showme:libs:"
# mpifort --showme:libs
# echo "mpifort --showme:incdirs:"
# mpifort --showme:incdirs
- name: check setup case
run: |
cd $HOME/cice
Expand All @@ -130,28 +95,19 @@ jobs:
run: |
cd $HOME/cice
./cice.setup -m conda -e ${{ matrix.envdef }} --test smoke --testid c0
- name: run hello world unit test
run: |
cd $HOME/cice
./cice.setup -m conda -e ${{ matrix.envdef }} --test unittest --pes 2x1 -s helloworld --testid hw01
cd *helloworld*hw01
./cice.build
./cice.run
- name: check cice compile
run: |
cd $HOME/cice
./cice.setup -m conda -e ${{ matrix.envdef }} -c case1 --pes 2x2 -s diag1
cd case1
./cice.build
# - name: compile case
# run: |
# cd $HOME/cice
# ./cice.setup -m conda -e ${{ matrix.envdef }} -c case1
# cd case1
# ./cice.build
- name: download input data
run: |
cd $HOME/cice-dirs/input
wget --progress=dot:giga https://zenodo.org/record/3728358/files/CICE_data_gx3_grid_ic-20200320.tar.gz && tar xvfz CICE_data_gx3_grid_ic-20200320.tar.gz
wget --progress=dot:giga https://zenodo.org/records/10419929/files/CICE_data_gx3_forcing_JRA55_200501_20231220.tar.gz && tar xvfz CICE_data_gx3_forcing_JRA55_200501_20231220.tar.gz
wget --progress=dot:giga https://zenodo.org/record/3728362/files/CICE_data_gx3_forcing_NCAR_bulk-20200320.tar.gz && tar xvfz CICE_data_gx3_forcing_NCAR_bulk-20200320.tar.gz
wget --progress=dot:giga https://zenodo.org/record/3728364/files/CICE_data_gx3_forcing_JRA55-20200320.tar.gz && tar xvfz CICE_data_gx3_forcing_JRA55-20200320.tar.gz
pwd
cd CICE_data/forcing/gx3/JRA55/8XDAILY
ln -s JRA55_gx3_03hr_forcing_200501.nc JRA55_gx3_03hr_forcing_2005.nc
cd $HOME/cice-dirs/input
ls -alR
# - name: run case
# run: |
Expand Down
14 changes: 13 additions & 1 deletion cice.setup
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,18 @@ if ((${dosuite} == 1 || ${dotest} == 1) && ${testid} == ${spval}) then
exit -1
endif
# This creates a new sandbox and modifies the source code for "improved" lcov analysis
# Turn this if block off if you don't want coverage to do that
if ($coverage == 1) then
set sandbox_lcov = ${ICE_SANDBOX}/../cice_lcov_${sdate}-${stime}
cp -p -r ${ICE_SANDBOX} ${sandbox_lcov}
echo "shifting to sandbox = ${sandbox_lcov}"
set ICE_SANDBOX = ${sandbox_lcov}
set ICE_SCRIPTS = "${ICE_SANDBOX}/configuration/scripts"
cd ${ICE_SANDBOX}
${ICE_SCRIPTS}/tests/lcov_modify_source.sh
endif
#---------------------------------------------------------------------
# Setup tsfile and test suite support stuff
Expand Down Expand Up @@ -1094,7 +1106,7 @@ cd ${testname_base}
source ./cice.settings
if (\${dobuild} == true) then
if (\${doreuse} == true) then
set ciceexe = "../ciceexe.\${ICE_ENVNAME}.\${ICE_COMMDIR}.\${ICE_BLDDEBUG}.\${ICE_THREADED}.\${ICE_IOTYPE}"
set ciceexe = "../ciceexe.\${ICE_TARGET}.\${ICE_ENVNAME}.\${ICE_COMMDIR}.\${ICE_BLDDEBUG}.\${ICE_THREADED}.\${ICE_IOTYPE}"
./cice.build --exe \${ciceexe}
if !(-e \${ciceexe}) cp -p \${ICE_RUNDIR}/cice \${ciceexe}
else
Expand Down
76 changes: 44 additions & 32 deletions cicecore/cicedyn/analysis/ice_diagnostics.F90
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,22 @@ module ice_diagnostics

implicit none
private
public :: runtime_diags, init_mass_diags, init_diags, &
print_state, print_points_state, diagnostic_abort

public :: runtime_diags, init_mass_diags, init_diags, debug_ice, &
print_state, diagnostic_abort

! diagnostic output file
character (len=char_len), public :: diag_file

! point print data

logical (kind=log_kind), public :: &
debug_model , & ! if true, debug model at high level
print_points , & ! if true, print point data
print_global ! if true, print global data

integer (kind=int_kind), public :: &
debug_model_step = 999999999 ! begin printing at istep1=debug_model_step

integer (kind=int_kind), parameter, public :: &
npnt = 2 ! total number of points to be printed

Expand Down Expand Up @@ -87,16 +90,6 @@ module ice_diagnostics
totaeron , & ! total aerosol mass
totaeros ! total aerosol mass

! printing info for routine print_state
! iblkp, ip, jp, mtask identify the grid cell to print
! character (char_len) :: plabel
integer (kind=int_kind), parameter, public :: &
check_step = 999999999, & ! begin printing at istep1=check_step
iblkp = 1, & ! block number
ip = 72, & ! i index
jp = 11, & ! j index
mtask = 0 ! my_task

!=======================================================================

contains
Expand Down Expand Up @@ -1525,20 +1518,39 @@ end subroutine init_diags

!=======================================================================

! This routine is useful for debugging.
! Calls to it should be inserted in the form (after thermo, for example)
! do iblk = 1, nblocks
! do j=jlo,jhi
! do i=ilo,ihi
! plabel = 'post thermo'
! if (istep1 >= check_step .and. iblk==iblkp .and i==ip &
! .and. j==jp .and. my_task == mtask) &
! call print_state(plabel,i,j,iblk)
! enddo
! enddo
! This routine is useful for debugging
! author Elizabeth C. Hunke, LANL

subroutine debug_ice(iblk, plabeld)

use ice_kinds_mod
use ice_calendar, only: istep1
use ice_communicate, only: my_task
use ice_blocks, only: nx_block, ny_block

character (char_len), intent(in) :: plabeld
integer (kind=int_kind), intent(in) :: iblk

! local
integer (kind=int_kind) :: i, j, m
character(len=*), parameter :: subname='(debug_ice)'

! tcraig, do this only on one point, the first point
! do m = 1, npnt
m = 1
if (istep1 >= debug_model_step .and. &
iblk == pbloc(m) .and. my_task == pmloc(m)) then
i = piloc(m)
j = pjloc(m)
call print_state(plabeld,i,j,iblk)
endif
! enddo
!
! 'use ice_diagnostics' may need to be inserted also

end subroutine debug_ice

!=======================================================================

! This routine is useful for debugging.
! author: Elizabeth C. Hunke, LANL

subroutine print_state(plabel,i,j,iblk)
Expand Down Expand Up @@ -1587,7 +1599,7 @@ subroutine print_state(plabel,i,j,iblk)

this_block = get_block(blocks_ice(iblk),iblk)

write(nu_diag,*) plabel
write(nu_diag,*) subname,plabel
write(nu_diag,*) 'istep1, my_task, i, j, iblk:', &
istep1, my_task, i, j, iblk
write(nu_diag,*) 'Global i and j:', &
Expand Down Expand Up @@ -1692,16 +1704,14 @@ subroutine print_state(plabel,i,j,iblk)
write(nu_diag,*) ' evap = ',evap (i,j,iblk)
write(nu_diag,*) ' flwout = ',flwout(i,j,iblk)
write(nu_diag,*) ' '
call flush_fileunit(nu_diag)

end subroutine print_state

!=======================================================================
#ifdef UNDEPRECATE_print_points_state

! This routine is useful for debugging.
! Calls can be inserted anywhere and it will print info on print_points points
! call print_points_state(plabel)
!
! 'use ice_diagnostics' may need to be inserted also

subroutine print_points_state(plabel,ilabel)

Expand Down Expand Up @@ -1757,6 +1767,7 @@ subroutine print_points_state(plabel,ilabel)
write(llabel,'(a)') 'pps:'//trim(llabel)
endif

write(nu_diag,*) subname
write(nu_diag,*) trim(llabel),'istep1, my_task, i, j, iblk=', &
istep1, my_task, i, j, iblk
write(nu_diag,*) trim(llabel),'Global i and j=', &
Expand Down Expand Up @@ -1835,12 +1846,13 @@ subroutine print_points_state(plabel,ilabel)
write(nu_diag,*) ' evap = ',evap (i,j,iblk)
write(nu_diag,*) ' flwout = ',flwout(i,j,iblk)
write(nu_diag,*) ' '
call flush_fileunit(nu_diag)

endif ! my_task
enddo ! ncnt

end subroutine print_points_state

#endif
!=======================================================================

! prints error information prior to aborting
Expand Down
Loading

0 comments on commit bf1dfc5

Please sign in to comment.