Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/emc/develop' into emc/develop
Browse files Browse the repository at this point in the history
  • Loading branch information
DeniseWorthen committed Apr 5, 2021
2 parents 840e931 + 2eca569 commit b52e91c
Show file tree
Hide file tree
Showing 86 changed files with 2,107 additions and 1,196 deletions.
135 changes: 135 additions & 0 deletions .github/workflows/test-cice.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
name: GHActions

# This workflow is triggered on pushes, pull-requeust, and releases
# ghactions* branch names will trigger this to support development testing
# To Do: get it working with bash and ubuntu

on:
push:
branches:
- master
- 'CICE*'
- 'ghactions*'
pull_request:
release:
types:
- created

defaults:
run:
shell: /bin/csh {0}

jobs:
build:
name: "CICETesting"
runs-on: ${{ matrix.os }}
strategy:
matrix:
# os: [macos-latest, ubuntu-latest]
os: [macos-latest]
# os: [ubuntu-latest]
include:
- os: macos-latest
envdef: macos
minicond: Miniconda3-latest-MacOSX-x86_64.sh
# - os: ubuntu-latest
# envdef: linux
# minicond: Miniconda3-latest-Linux-x86_64.sh
steps:
- name: reset macos toolchain to commandlinetools
shell: /bin/bash {0}
if: contains( matrix.envdef, 'macos')
run: |
sudo xcode-select -r
sudo xcode-select -s /Library/Developer/CommandLineTools
echo "xcrun --show-sdk-path: $(xcrun --show-sdk-path)"
echo "xcode-select -p: $(xcode-select -p)"
- name: system info
shell: /bin/bash {0}
run: |
type wget
type curl
type csh
echo "readlink \$(which csh): $(python -c 'import os, sys; print os.path.realpath(sys.argv[1])' $(which csh))"
echo "csh --version: $(csh --version)"
echo "uname -a: $(uname -a)"
echo "sw_vers: $(sw_vers)"
echo "HOME: $HOME"
echo "GITHUB_WORKSPACE: $GITHUB_WORKSPACE"
echo "OS: ${{ matrix.os }}"
echo "ENVDEF: ${{ matrix.envdef }}"
echo "MINICOND: ${{ matrix.minicond }}"
- name : install miniconda
shell: /bin/bash {0}
run: |
wget https://repo.anaconda.com/miniconda/${{ matrix.minicond }} -O ~/miniconda.sh
bash ~/miniconda.sh -b -p $HOME/miniconda
- name: clone
uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: link
run: |
ln -s ${GITHUB_WORKSPACE}/../CICE ${HOME}/cice
# ls -al ${HOME}/
# ls -al ${GITHUB_WORKSPACE}/
- name: setup conda env
shell: /bin/bash {0}
run: |
cd $HOME && mkdir -p cice-dirs/runs cice-dirs/baseline cice-dirs/input
source $HOME/miniconda/bin/activate
conda init tcsh
cd $HOME/cice
conda env create -f configuration/scripts/machines/environment.yml
- name: check conda env
run: |
conda activate cice && which mpicc && which mpifort && which make
mpifort --version
mpicc --version
make --version
- name: check setup case
run: |
cd $HOME/cice
./cice.setup -m conda -e ${{ matrix.envdef }} -c case0 --pes 1x1 -s diag1
- name: check setup test
run: |
cd $HOME/cice
./cice.setup -m conda -e ${{ matrix.envdef }} --test smoke --testid c0
# - 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 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 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 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
ls -alR
# - name: run case
# run: |
# cd $HOME/cice
# cd case1
# ./cice.run
- name: run suite
run: |
cd $HOME/cice
./cice.setup -m conda -e ${{ matrix.envdef }} --suite travis_suite --testid ${{ matrix.os }}
- name: write output
run: |
cd $HOME/cice
./.github/workflows/write_logfiles.csh
cd testsuite.${{ matrix.os }}
./results.csh
- name: successful run
if: ${{ success() }}
run: |
echo "${{ job.name }} PASSED"
- name: trap failure
if: ${{ failure() }}
run: |
echo "${{ job.name }} FAILED"
exit 99
10 changes: 10 additions & 0 deletions .github/workflows/write_logfiles.csh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/csh

#echo "hello"

foreach logfile (case*/logs/cice.runlog* testsuite.*/*/logs/cice.runlog*)
echo "### ${logfile} ###"
tail -20 $logfile
echo " "
end

6 changes: 5 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ install:

# Fetch forcing data
- "wget 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 -C ~"
tar xvfz CICE_data_gx3_forcing_NCAR_bulk-20200320.tar.gz -C ~"

# Fetch jra55_gx3 forcing data
- "wget https://zenodo.org/record/3728364/files/CICE_data_gx3_forcing_JRA55-20200320.tar.gz &&
tar xvfz CICE_data_gx3_forcing_JRA55-20200320.tar.gz -C ~"

# Mirror entire data folder
#- "lftp ftp://anonymous:[email protected]@ftp.cgd.ucar.edu
Expand Down
Binary file modified LICENSE.pdf
Binary file not shown.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[![Build Status](https://travis-ci.org/CICE-Consortium/CICE.svg?branch=master)](https://travis-ci.org/CICE-Consortium/CICE)
[![Travis-CI](https://travis-ci.org/CICE-Consortium/CICE.svg?branch=master)](https://travis-ci.org/CICE-Consortium/CICE)
[![GHActions](https://github.com/CICE-Consortium/CICE/workflows/GHActions/badge.svg)](https://github.com/CICE-Consortium/CICE/actions)
[![Documentation Status](https://readthedocs.org/projects/cice-consortium-cice/badge/?version=master)](http://cice-consortium-cice.readthedocs.io/en/master/?badge=master)
[![lcov](https://img.shields.io/endpoint?url=https://apcraig.github.io/coverage.json)](https://apcraig.github.io)

Expand Down
15 changes: 11 additions & 4 deletions cicecore/cicedynB/analysis/ice_diagnostics.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1561,11 +1561,11 @@ subroutine print_state(plabel,i,j,iblk)

real (kind=dbl_kind) :: &
eidebug, esdebug, &
qi, qs, Tsnow, &
qi, qs, Tsnow, si, &
rad_to_deg, puny, rhoi, lfresh, rhos, cp_ice

integer (kind=int_kind) :: n, k, nt_Tsfc, nt_qice, nt_qsno, nt_fsd, &
nt_isosno, nt_isoice
nt_isosno, nt_isoice, nt_sice

logical (kind=log_kind) :: tr_fsd, tr_iso

Expand All @@ -1576,7 +1576,7 @@ subroutine print_state(plabel,i,j,iblk)

call icepack_query_tracer_flags(tr_fsd_out=tr_fsd, tr_iso_out=tr_iso)
call icepack_query_tracer_indices(nt_Tsfc_out=nt_Tsfc, nt_qice_out=nt_qice, &
nt_qsno_out=nt_qsno, nt_fsd_out=nt_fsd, &
nt_qsno_out=nt_qsno, nt_sice_out=nt_sice, nt_fsd_out=nt_fsd, &
nt_isosno_out=nt_isosno, nt_isoice_out=nt_isoice)
call icepack_query_parameters( &
rad_to_deg_out=rad_to_deg, puny_out=puny, rhoi_out=rhoi, lfresh_out=lfresh, &
Expand Down Expand Up @@ -1621,7 +1621,6 @@ subroutine print_state(plabel,i,j,iblk)

enddo ! n


eidebug = c0
do n = 1,ncat
do k = 1,nilyr
Expand Down Expand Up @@ -1654,6 +1653,14 @@ subroutine print_state(plabel,i,j,iblk)
write(nu_diag,*) 'qsnow(i,j)',esdebug
write(nu_diag,*) ' '

do n = 1,ncat
do k = 1,nilyr
si = trcrn(i,j,nt_sice+k-1,n,iblk)
write(nu_diag,*) 'sice, cat ',n,' layer ',k, si
enddo
enddo
write(nu_diag,*) ' '

write(nu_diag,*) 'uvel(i,j)',uvel(i,j,iblk)
write(nu_diag,*) 'vvel(i,j)',vvel(i,j,iblk)

Expand Down
4 changes: 2 additions & 2 deletions cicecore/cicedynB/analysis/ice_history.F90
Original file line number Diff line number Diff line change
Expand Up @@ -925,12 +925,12 @@ subroutine init_hist (dt)
ns1, f_strinty)

call define_hist_field(n_taubx,"taubx","N/m^2",ustr2D, ucstr, &
"basal (seabed) stress (x)", &
"seabed (basal) stress (x)", &
"positive is x direction on U grid", c1, c0, &
ns1, f_taubx)

call define_hist_field(n_tauby,"tauby","N/m^2",ustr2D, ucstr, &
"basal (seabed) stress (y)", &
"seabed (basal) stress (y)", &
"positive is y direction on U grid", c1, c0, &
ns1, f_tauby)

Expand Down
46 changes: 30 additions & 16 deletions cicecore/cicedynB/analysis/ice_history_bgc.F90
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ module ice_history_bgc
subroutine init_hist_bgc_2D

use ice_broadcast, only: broadcast_scalar
use ice_calendar, only: nstreams
use ice_calendar, only: nstreams, histfreq
use ice_communicate, only: my_task, master_task
use ice_history_shared, only: tstr2D, tcstr, define_hist_field, &
f_fsalt, f_fsalt_ai, f_sice
Expand Down Expand Up @@ -781,6 +781,7 @@ subroutine init_hist_bgc_2D
if (tr_iso .or. tr_aero .or. tr_brine .or. solve_zsal .or. skl_bgc) then

do ns = 1, nstreams
if (histfreq(ns) /= 'x') then

if (f_iso(1:1) /= 'x') then
do n=1,n_iso
Expand Down Expand Up @@ -1780,6 +1781,7 @@ subroutine init_hist_bgc_2D
"distance from ice bottom to brine surface", c1, c0, &
ns, f_hbri)

endif ! histfreq(ns) /= 'x'
enddo ! nstreams

endif ! tr_aero, etc
Expand All @@ -1790,7 +1792,7 @@ end subroutine init_hist_bgc_2D

subroutine init_hist_bgc_3Dc

use ice_calendar, only: nstreams
use ice_calendar, only: nstreams, histfreq
use ice_history_shared, only: tstr3Dc, tcstr, define_hist_field

integer (kind=int_kind) :: ns
Expand All @@ -1802,26 +1804,27 @@ subroutine init_hist_bgc_3Dc
if (icepack_warnings_aborted()) call abort_ice(error_message=subname, &
file=__FILE__, line=__LINE__)

if (tr_brine) then
if (tr_brine) then

! 3D (category) variables must be looped separately
do ns = 1, nstreams
if (f_fbri(1:1) /= 'x') &
call define_hist_field(n_fbri,"fbrine","1",tstr3Dc, tcstr, &
if (histfreq(ns) /= 'x') then
if (f_fbri(1:1) /= 'x') &
call define_hist_field(n_fbri,"fbrine","1",tstr3Dc, tcstr, &
"brine tracer fraction of ice volume, cat", &
"none", c1, c0, &
ns, f_fbri)
"none", c1, c0, ns, f_fbri)
endif ! histfreq /= 'x'
enddo ! ns

endif
endif ! tr_brine

end subroutine init_hist_bgc_3Dc

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

subroutine init_hist_bgc_3Db

use ice_calendar, only: nstreams
use ice_calendar, only: nstreams,histfreq
use ice_history_shared, only: tstr3Db, tcstr, define_hist_field

integer (kind=int_kind) :: ns
Expand All @@ -1841,6 +1844,7 @@ subroutine init_hist_bgc_3Db
if (z_tracers .or. solve_zsal) then

do ns = 1, nstreams
if (histfreq(ns) /= 'x') then

if (f_bTin(1:1) /= 'x') &
call define_hist_field(n_bTin,"bTizn","C",tstr3Db, tcstr, &
Expand Down Expand Up @@ -1873,6 +1877,7 @@ subroutine init_hist_bgc_3Db
"internal ice PAR", "on bio interface grid", c1, c0, &
ns, f_zfswin)

endif ! histfreq(ns) /= 'x'
enddo ! ns

endif ! z_tracers or solve_zsal
Expand Down Expand Up @@ -2012,9 +2017,10 @@ subroutine accum_hist_bgc (iblk)
! increment field
!---------------------------------------------------------------

if (tr_iso .or. tr_aero .or. tr_brine .or. solve_zsal .or. skl_bgc) then
! 2d bgc fields
! 2d bgc fields
if (allocated(a2D)) then

if (tr_iso .or. tr_aero .or. tr_brine .or. solve_zsal .or. skl_bgc) then

! zsalinity
if (f_fzsal (1:1) /= 'x') &
Expand Down Expand Up @@ -2635,19 +2641,22 @@ subroutine accum_hist_bgc (iblk)
call accum_hist_field(n_hbri, iblk, &
hbri(:,:,iblk), a2D)

endif ! 2d bgc tracers, tr_aero, tr_brine, solve_zsal, skl_bgc

endif ! 2d bgc tracers, tr_aero, tr_brine, solve_zsal, skl_bgc
endif ! allocated(a2D)

! 3D category fields

if (allocated(a3Dc)) then
if (tr_brine) then
! 3Dc bgc category fields

if (f_fbri (1:1) /= 'x') &
call accum_hist_field(n_fbri-n2D, iblk, ncat_hist, &
trcrn(:,:,nt_fbri,1:ncat_hist,iblk), a3Dc)
endif
endif ! allocated(a3Dc)

if (allocated(a3Db)) then
if (z_tracers .or. solve_zsal) then
! 3Db category fields

Expand Down Expand Up @@ -2754,8 +2763,10 @@ subroutine accum_hist_bgc (iblk)
workz(:,:,1:nzblyr), a3Db)
endif

endif ! 3Db fields
endif ! 3Db fields
endif ! allocated(a3Db)

if (allocated(a3Da)) then
if (z_tracers) then
! 3Da category fields

Expand Down Expand Up @@ -3189,15 +3200,16 @@ subroutine accum_hist_bgc (iblk)
workz2(:,:,1:nzalyr), a3Da)
endif

endif ! z_tracers, 3Da tracers
endif ! z_tracers, 3Da tracers
endif ! allocated(a3Da)

end subroutine accum_hist_bgc

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

subroutine init_hist_bgc_3Da

use ice_calendar, only: nstreams
use ice_calendar, only: nstreams, histfreq
use ice_history_shared, only: tstr3Da, tcstr, define_hist_field

integer (kind=int_kind) :: ns, n
Expand All @@ -3216,6 +3228,7 @@ subroutine init_hist_bgc_3Da
if (z_tracers) then

do ns = 1, nstreams
if (histfreq(ns) /= 'x') then

!----------------------------------------------------------------------------
! snow+bio grid ==>
Expand Down Expand Up @@ -3439,6 +3452,7 @@ subroutine init_hist_bgc_3Da
"other bulk nitrogen pool in cat 1", "snow+bio grid", c1, c0, &
ns, f_bgc_PON_cat1)

endif ! histfreq(ns) /= 'x'
enddo !ns

endif ! z_tracers
Expand Down
Loading

0 comments on commit b52e91c

Please sign in to comment.