Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…nto Icepack1.2
  • Loading branch information
apcraig committed Apr 8, 2021
2 parents 24f0b83 + 5cf2232 commit cb4fe0f
Show file tree
Hide file tree
Showing 33 changed files with 411 additions and 80 deletions.
133 changes: 133 additions & 0 deletions .github/workflows/test-icepack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
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
- 'Icepack*'
- 'ghactions*'
pull_request:
release:
types:
- created

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

jobs:
build:
name: "IcepackTesting"
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}/../Icepack ${HOME}/icepack
# ls -al ${HOME}/
# ls -al ${GITHUB_WORKSPACE}/
- name: setup conda env
shell: /bin/bash {0}
run: |
cd $HOME && mkdir -p icepack-dirs/runs icepack-dirs/baseline icepack-dirs/input
source $HOME/miniconda/bin/activate
conda init tcsh
cd $HOME/icepack
conda env create -f configuration/scripts/machines/environment.yml
- name: check conda env
run: |
conda activate icepack && which clang && which gfortran && which make
gfortran --version
clang --version
make --version
- name: check setup case
run: |
cd $HOME/icepack
./icepack.setup -m conda -e ${{ matrix.envdef }} -c case0 --pes 1x1 -s diag1
- name: check setup test
run: |
cd $HOME/icepack
./icepack.setup -m conda -e ${{ matrix.envdef }} --test smoke --testid c0
# - name: compile case
# run: |
# cd $HOME/icepack
# ./icepack.setup -m conda -e ${{ matrix.envdef }} -c case1
# cd case1
# ./icepack.build
- name: download input data
run: |
cd $HOME/icepack-dirs/input
wget --progress=dot:giga https://zenodo.org/record/3728287/files/Icepack_data-20200326.tar.gz && tar xvfz ICEPACK_data-20200326.tar.gz
pwd
ls -alR
# - name: run case
# run: |
# cd $HOME/icepack
# cd case1
# ./icepack.run
- name: run suite
run: |
cd $HOME/icepack
./icepack.setup -m conda -e ${{ matrix.envdef }} --suite travis_suite --testid ${{ matrix.os }}
- name: write output
run: |
cd $HOME/icepack
./.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/icepack.runlog* testsuite.*/*/logs/icepack.runlog*)
echo "### ${logfile} ###"
tail -20 $logfile
echo " "
end

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/Icepack.svg?branch=master)](https://travis-ci.org/CICE-Consortium/Icepack)
[![Travis-CI](https://travis-ci.com/CICE-Consortium/Icepack.svg?branch=master)](https://travis-ci.com/CICE-Consortium/Icepack)
[![GHActions](https://github.com/CICE-Consortium/Icepack/workflows/GHActions/badge.svg)](https://github.com/CICE-Consortium/Icepack/actions)
[![Documentation Status](https://readthedocs.org/projects/cice-consortium-icepack/badge/?version=master)](http://cice-consortium-icepack.readthedocs.io/en/master/?badge=master)
[![lcov](https://img.shields.io/endpoint?url=https://apcraig.github.io/coverage_icepack.json)](https://apcraig.github.io)

Expand Down
4 changes: 2 additions & 2 deletions columnphysics/icepack_intfc.F90
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
!=======================================================================
! Copyright (c) 2020, Triad National Security, LLC
! Copyright (c) 2021, Triad National Security, LLC
! All rights reserved.
!
! Copyright 2020. Triad National Security, LLC. This software was
! Copyright 2021. Triad National Security, LLC. This software was
! produced under U.S. Government contract DE-AC52-06NA25396 for Los
! Alamos National Laboratory (LANL), which is operated by Triad
! National Security, LLC for the U.S. Department of Energy. The U.S.
Expand Down
2 changes: 1 addition & 1 deletion columnphysics/icepack_parameters.F90
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ module icepack_parameters

real (kind=dbl_kind), public :: &
! (Briegleb JGR 97 11475-11485 July 1992)
emissivity = 0.95_dbl_kind ,&! emissivity of snow and ice
emissivity = 0.985_dbl_kind,&! emissivity of snow and ice
albocn = 0.06_dbl_kind ,&! ocean albedo
vonkar = 0.4_dbl_kind ,&! von Karman constant
stefan_boltzmann = 567.0e-10_dbl_kind,&! W/m^2/K^4
Expand Down
2 changes: 2 additions & 0 deletions columnphysics/icepack_shortwave.F90
Original file line number Diff line number Diff line change
Expand Up @@ -4323,6 +4323,8 @@ subroutine icepack_step_radiation (dt, ncat, &

end subroutine icepack_step_radiation

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

! Delta-Eddington solution expressions

!=======================================================================
Expand Down
19 changes: 16 additions & 3 deletions columnphysics/icepack_therm_itd.F90
Original file line number Diff line number Diff line change
Expand Up @@ -305,11 +305,24 @@ subroutine linear_itd (ncat, hin_max, &

if (hicen_init(n) > puny .and. &
hicen_init(n+1) > puny) then
! interpolate between adjacent category growth rates
slope = (dhicen(n+1) - dhicen(n)) / &

if ((hicen_init(n+1) - hicen_init(n))>0) then

! interpolate between adjacent category growth rates
slope = (dhicen(n+1) - dhicen(n)) / &
(hicen_init(n+1) - hicen_init(n))
hbnew(n) = hin_max(n) + dhicen(n) &
hbnew(n) = hin_max(n) + dhicen(n) &
+ slope * (hin_max(n) - hicen_init(n))

else

write(warnstr,*) subname, &
'ITD Thermodynamics: hicen_init(n+1) <= hicen_init(n)'
call icepack_warnings_setabort(.true.)
call icepack_warnings_add(warnstr)

endif

elseif (hicen_init(n) > puny) then ! hicen_init(n+1)=0
hbnew(n) = hin_max(n) + dhicen(n)
elseif (hicen_init(n+1) > puny) then ! hicen_init(n)=0
Expand Down
42 changes: 19 additions & 23 deletions columnphysics/icepack_therm_mushy.F90
Original file line number Diff line number Diff line change
Expand Up @@ -217,32 +217,28 @@ subroutine temperature_changes_salinity(dt, &
!-----------------------------------------------------------------
!mclaren: Should there be an if calc_Tsfc statement here then??

dswabs = c0
if (sw_redist) then
dt_rhoi_hlyr = dt / (rhoi*hilyr)
do k = 1, nilyr
Iswabs_tmp = c0 ! all Iswabs is moved into fswsfc
Tmlt = liquidus_temperature_mush(zSin(k))

dt_rhoi_hlyr = dt / (rhoi*hilyr)

do k = 1, nilyr

Iswabs_tmp = c0 ! all Iswabs is moved into fswsfc

Tmlt = liquidus_temperature_mush(zSin(k))

if (zTin(k) <= Tmlt - sw_dtemp) then
ci = cp_ice - Lfresh * Tmlt / (zTin(k)**2)
Iswabs_tmp = min(Iswabs(k), &
sw_frac*(Tmlt-zTin(k))*ci/dt_rhoi_hlyr)
endif
if (Iswabs_tmp < puny) Iswabs_tmp = c0

dswabs = min(Iswabs(k) - Iswabs_tmp, fswint)

fswsfc = fswsfc + dswabs
fswint = fswint - dswabs
Iswabs(k) = Iswabs_tmp

enddo

if (zTin(k) <= Tmlt - sw_dtemp) then
ci = cp_ice - Lfresh * Tmlt / (zTin(k)**2)
Iswabs_tmp = min(Iswabs(k), &
sw_frac*(Tmlt-zTin(k))*ci/dt_rhoi_hlyr)
endif
if (Iswabs_tmp < puny) Iswabs_tmp = c0
dswabs = dswabs + min(Iswabs(k) - Iswabs_tmp, fswint)
Iswabs(k) = Iswabs_tmp
enddo
endif
if (.not. lsnow) then ! hs <= hs_min
dswabs = dswabs + sum(Sswabs(:))
endif
fswsfc = fswsfc + dswabs
fswint = fswint - dswabs

if (lsnow) then
! case with snow
Expand Down
2 changes: 1 addition & 1 deletion columnphysics/icepack_therm_vertical.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1887,7 +1887,7 @@ subroutine conservation_check_vthermo(dt, &
- fsnow*Lfresh - fadvocn) * dt
ferr = abs(efinal-einit-einp) / dt

if (ferr > ferrmax) then
if (ferr > 1.1_dbl_kind*ferrmax) then
call icepack_warnings_setabort(.true.,__FILE__,__LINE__)
call icepack_warnings_add(subname//" conservation_check_vthermo: Thermo energy conservation error" )

Expand Down
9 changes: 4 additions & 5 deletions columnphysics/icepack_zbgc.F90
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ subroutine add_new_ice_bgc (dt, nblyr, &

integer (kind=int_kind), intent(in) :: &
nblyr , & ! number of bio layers
ncat , & ! number of thickness categories
nilyr , & ! number of ice layers
nltrcr, & ! number of zbgc tracers
ncat , & ! number of thickness categories
nilyr , & ! number of ice layers
nltrcr , & ! number of zbgc tracers
nbtrcr , & ! number of biology tracers
ntrcr ! number of tracers in use

Expand Down Expand Up @@ -525,7 +525,7 @@ subroutine adjust_tracer_profile (nbtrcr, dt, ntrcr, &
do k = 1, nilyr
trcrn(nt_sice+k-1) = trtmp(nt_sice+k-1)
enddo !k
endif ! solve_zsal
endif ! solve_zsal

endif ! location

Expand All @@ -534,7 +534,6 @@ end subroutine adjust_tracer_profile
!=======================================================================
!autodocument_start icepack_init_bgc
!

subroutine icepack_init_bgc(ncat, nblyr, nilyr, ntrcr_o, &
cgrid, igrid, ntrcr, nbtrcr, &
sicen, trcrn, sss, ocean_bio_all)
Expand Down
2 changes: 1 addition & 1 deletion columnphysics/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ICEPACK 1.2.4
ICEPACK 1.2.5
4 changes: 2 additions & 2 deletions configuration/driver/icedrv_MAIN.F90
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
!=======================================================================
! Copyright (c) 2020, Triad National Security, LLC
! Copyright (c) 2021, Triad National Security, LLC
! All rights reserved.
!
! Copyright 2020. Triad National Security, LLC. This software was
! Copyright 2021. Triad National Security, LLC. This software was
! produced under U.S. Government contract DE-AC52-06NA25396 for Los
! Alamos National Laboratory (LANL), which is operated by Triad
! National Security, LLC for the U.S. Department of Energy. The U.S.
Expand Down
23 changes: 12 additions & 11 deletions configuration/driver/icedrv_diagnostics_bgc.F90
Original file line number Diff line number Diff line change
Expand Up @@ -794,7 +794,7 @@ subroutine zsal_diags ()
!-----------------------------------------------------------------
! NOTE these are computed for the last timestep only (not avg)

do n = 1, nx
do n = 1, nx
pfzsal = fzsal(n)
pfzsal_g = fzsal_g(n)
phinS = c0
Expand Down Expand Up @@ -850,25 +850,24 @@ subroutine zsal_diags ()
do k = 1,nilyr
pSice(k) = trcr(n,nt_sice+k-1)
enddo
enddo ! nx

!-----------------------------------------------------------------
! start spewing
!-----------------------------------------------------------------

write(nu_diag_out+n-1,*) ' '
write(nu_diag_out+n-1,*) ' Brine height '
write(nu_diag_out+n-1,900) 'hbrin = ',phinS
write(nu_diag_out+n-1,900) 'hbrin cat 1 = ',phinS1
write(nu_diag_out+n-1,900) 'Freeboard = ',phbrn
write(nu_diag_out+n-1,900) 'dhbrin cat 1 top = ',pdh_top1
write(nu_diag_out+n-1,900) 'dhbrin cat 1 bottom = ',pdh_bot1
write(nu_diag_out+n-1,900) 'hbrin = ',phinS(n)
write(nu_diag_out+n-1,900) 'hbrin cat 1 = ',phinS1(n)
write(nu_diag_out+n-1,900) 'Freeboard = ',phbrn(n)
write(nu_diag_out+n-1,900) 'dhbrin cat 1 top = ',pdh_top1(n)
write(nu_diag_out+n-1,900) 'dhbrin cat 1 bottom = ',pdh_bot1(n)
write(nu_diag_out+n-1,*) ' '
write(nu_diag_out+n-1,*) ' zSalinity '
write(nu_diag_out+n-1,900) 'Avg density (kg/m^3) = ',psice_rho
write(nu_diag_out+n-1,900) 'Salt flux (kg/m^2/s) = ',pfzsal
write(nu_diag_out+n-1,900) 'Grav. Drain. Salt flux = ',pfzsal_g
write(nu_diag_out+n-1,900) 'Darcy V cat 1 (m/s) = ',pdarcy_V1
write(nu_diag_out+n-1,900) 'Avg density (kg/m^3) = ',psice_rho(n)
write(nu_diag_out+n-1,900) 'Salt flux (kg/m^2/s) = ',pfzsal(n)
write(nu_diag_out+n-1,900) 'Grav. Drain. Salt flux = ',pfzsal_g(n)
write(nu_diag_out+n-1,900) 'Darcy V cat 1 (m/s) = ',pdarcy_V1(n)
write(nu_diag_out+n-1,*) ' '
write(nu_diag_out+n-1,*) ' Top down bgc Layer Model'
write(nu_diag_out+n-1,*) ' '
Expand Down Expand Up @@ -901,6 +900,8 @@ subroutine zsal_diags ()
write(nu_diag_out+n-1,802) (pSice(k), k = 1,nilyr)
write(nu_diag_out+n-1,*) ' '

enddo ! nx

802 format (f24.17,2x)
803 format (a25,2x)
900 format (a25,2x,f24.17)
Expand Down
Loading

0 comments on commit cb4fe0f

Please sign in to comment.