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

add Cgrid-related fixes for nuopc/cmeps #728

Merged
merged 127 commits into from
Jun 23, 2022
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
127 commits
Select commit Hold shift + click to select a range
0338d04
Merge pull request #1 from CICE-Consortium/master
DeniseWorthen Feb 25, 2020
99470ed
Merge pull request #2 from CICE-Consortium/master
DeniseWorthen Mar 7, 2020
71d2ded
Merge pull request #3 from CICE-Consortium/master
DeniseWorthen Apr 2, 2020
d46d691
merge latest master (#4)
DeniseWorthen Apr 22, 2020
183218a
updated orbital calculations needed for cesm
Apr 23, 2020
10e7c20
fixed problems in updated orbital calculations needed for cesm
Apr 29, 2020
ce8e5a9
update CICE6 to support coupling with UFS
apcraig May 10, 2020
8f0b5ee
Merge pull request #2 from apcraig/ufs01
dabail10 May 10, 2020
7ac0e3d
Merge pull request #1 from ESCOMP/nuopc
DeniseWorthen May 12, 2020
80c9e6e
Merge branch 'master' of https://github.com/CICE-Consortium/CICE into…
dabail10 May 19, 2020
53715ea
put in changes so that both ufsatm and cesm requirements for potentia…
May 25, 2020
7e43703
Merge pull request #3 from mvertens/mvertens/nuopc
dabail10 May 26, 2020
397e588
Merge remote-tracking branch 'upstream/master'
DeniseWorthen Jun 2, 2020
3bb3694
Convergence on ustar for CICE. (#452) (#5)
DeniseWorthen Jun 5, 2020
f41f1e9
Merge remote-tracking branch 'upstream/nuopc' into HEAD
DeniseWorthen Jun 22, 2020
e70d1ab
update icepack submodule
DeniseWorthen Jun 22, 2020
308a1d4
Revert "update icepack submodule"
DeniseWorthen Jun 22, 2020
7848fdf
Merge branch 'master' of https://github.com/CICE-Consortium/CICE into…
dabail10 Jun 24, 2020
6982ee4
Merge remote-tracking branch 'upstream/nuopc' into HEAD
DeniseWorthen Jun 25, 2020
089f60f
update comp_ice.backend with temporary ice_timers fix
DeniseWorthen Jun 25, 2020
6affdcf
Merge branch 'master' of https://github.com/CICE-Consortium/CICE into…
dabail10 Jun 29, 2020
b5a6058
Merge branch 'master' of https://github.com/CICE-Consortium/CICE into…
dabail10 Jul 1, 2020
415df0e
Merge branch 'nuopc' of https://github.com/ESCOMP/CICE into nuopc
dabail10 Jul 1, 2020
b4da8a6
Merge branch 'master' of https://github.com/CICE-Consortium/CICE into…
dabail10 Jul 1, 2020
239c7de
Merge branch 'nuopc' of https://github.com/ESCOMP/CICE into nuopc
dabail10 Jul 1, 2020
ad03424
Fix threading problem in init_bgc
dabail10 Jul 1, 2020
73e7774
Fix additional OMP problems
dabail10 Jul 1, 2020
46fcfba
changes for coldstart running
DeniseWorthen Jul 2, 2020
c762336
Move the forapps directory
dabail10 Jul 2, 2020
6bccf71
remove cesmcoupled ifdefs
DeniseWorthen Jul 2, 2020
902e883
Fix logging issues for NUOPC
dabail10 Jul 2, 2020
178693a
Merge branch 'nuopc' of https://github.com/ESCOMP/CICE into nuopc
dabail10 Jul 2, 2020
b4afd2e
removal of many cpp-ifdefs
Jul 4, 2020
3a1b88b
fix compile errors
DeniseWorthen Jul 4, 2020
41855fd
fixes to get cesm working
Jul 4, 2020
aea1aa8
update to latest nuopc changes
Jul 4, 2020
e4c989c
Merge branch 'master' of https://github.com/CICE-Consortium/CICE into…
dabail10 Jul 6, 2020
30a81cc
fixed white space issue
Jul 7, 2020
8ebdda9
Merge pull request #4 from mvertens/nuopc
dabail10 Jul 7, 2020
27dd3b7
Add restart_coszen namelist option
dabail10 Jul 7, 2020
50bf856
Merge remote-tracking branch 'upstream/master'
DeniseWorthen Jul 7, 2020
6b4a277
Merge branch 'nuopc' into coszen
dabail10 Jul 7, 2020
93f0e86
Merge pull request #5 from ESCOMP/coszen
dabail10 Jul 7, 2020
f92bef3
update icepack submodule
DeniseWorthen Jul 7, 2020
4e8cc79
Merge remote-tracking branch 'upstream/nuopc' into emc/develop
DeniseWorthen Jul 7, 2020
8ff4ee0
change Orion to orion in backend
DeniseWorthen Jul 7, 2020
916c6af
add -link_mpi=dbg to debug flags (#8)
DeniseWorthen Jul 14, 2020
9bdb9ad
Merge remote-tracking branch 'CICE-Consortium/master' into emc/develop
DeniseWorthen Jul 15, 2020
8f37bfc
cice6 compile (#6)
MinsukJi-NOAA Jul 17, 2020
86b8dab
Merge remote-tracking branch 'upstream/emc/develop' into HEAD
DeniseWorthen Jul 17, 2020
c084de4
Merge remote-tracking branch 'upstream/master' into emc/develop
DeniseWorthen Jul 17, 2020
88cc2fd
Merge remote-tracking branch 'upstream/master' into emc/develop
DeniseWorthen Aug 5, 2020
bdf1a1f
changes for consistency w/ current emc-cice5 (#13)
DeniseWorthen Aug 12, 2020
5ecde75
Merge remote-tracking branch 'upstream/emc/develop' into emc/develop
DeniseWorthen Aug 12, 2020
d81a834
Fixcommit (#14)
DeniseWorthen Aug 13, 2020
4d7ba5b
Merge remote-tracking branch 'upstream/master' into emc/develop
DeniseWorthen Aug 13, 2020
5dcfca8
Merge remote-tracking branch 'upstream/emc/develop' into emc/develop
DeniseWorthen Aug 13, 2020
285985c
Update CICE6 for integration to S2S
DeniseWorthen Aug 31, 2020
6d30789
Merge remote-tracking branch 'upstream/emc/develop' into emc/develop
DeniseWorthen Aug 31, 2020
8129aab
Merge remote-tracking branch 'consortium/master' into emc/develop
DeniseWorthen Aug 31, 2020
ac617cd
Support TACC stampede (#19)
MinsukJi-NOAA Oct 8, 2020
23cdee7
Merge remote-tracking branch 'upstream/emc/develop' into emc/develop
DeniseWorthen Oct 8, 2020
1e4f42b
update icepack
DeniseWorthen Oct 30, 2020
2515f77
Merge remote-tracking branch 'consortium/master' into feature/updcice
DeniseWorthen Oct 30, 2020
41afe74
add ice_dyn_vp module to CICE_InitMod
DeniseWorthen Oct 30, 2020
2a0f332
update gitmodules, update icepack
DeniseWorthen Nov 10, 2020
f773ef3
Update CICE to consortium master (#23)
DeniseWorthen Nov 10, 2020
840e931
Merge remote-tracking branch 'upstream/emc/develop' into emc/develop
DeniseWorthen Nov 10, 2020
1e4d393
Merge remote-tracking branch 'upstream/emc/develop' into feature/updcice
DeniseWorthen Mar 14, 2021
66546ae
Merge remote-tracking branch 'Consortium/master' into feature/updcice
DeniseWorthen Mar 14, 2021
2eca569
update icepack
DeniseWorthen Apr 5, 2021
b52e91c
Merge remote-tracking branch 'upstream/emc/develop' into emc/develop
DeniseWorthen Apr 5, 2021
51db2f9
Merge remote-tracking branch 'Consortium/master' into feature/updcice
DeniseWorthen Jun 1, 2021
d8fb6d9
switch icepack branches
DeniseWorthen Jun 2, 2021
9a76541
update icepack
DeniseWorthen Jun 4, 2021
519d339
Update CICE to latest Consortium master (#26)
DeniseWorthen Jun 4, 2021
74e7b58
Merge remote-tracking branch 'upstream/emc/develop' into emc/develop
DeniseWorthen Jun 5, 2021
9d88d92
add cice changes for zlvs (#29)
DeniseWorthen Jun 10, 2021
d1f2d15
Merge remote-tracking branch 'upstream/emc/develop' into emc/develop
DeniseWorthen Jun 11, 2021
0c39047
Merge branch 'emc/develop' into feature/updcice
DeniseWorthen Jun 24, 2021
f3b2652
update icepack and pointer
DeniseWorthen Jun 24, 2021
9057817
Merge remote-tracking branch 'Consortium/master' into feature/updcice
DeniseWorthen Jun 24, 2021
1721728
Merge remote-tracking branch 'Consortium/master' into feature/updcice
DeniseWorthen Jul 2, 2021
55586f7
update icepack and revert gitmodules
DeniseWorthen Jul 20, 2021
441f693
Fix history features
apcraig Aug 10, 2021
15763d8
revert set_nml.histall
apcraig Aug 10, 2021
b3364a6
fix implementation error
apcraig Aug 11, 2021
96d5851
update model log output in ice_init
apcraig Aug 11, 2021
7b5c2b4
Fix QC issues
apcraig Aug 12, 2021
c5794b4
Update testing
apcraig Aug 13, 2021
eaa3c3a
update documentation
apcraig Aug 13, 2021
e31ce7e
reset calchk to 100000 years
apcraig Aug 13, 2021
83068c7
update evp1d test
apcraig Aug 13, 2021
3fd897e
Merge branch 'master' of https://github.com/cice-consortium/cice into…
apcraig Aug 13, 2021
4373d3d
update icepack
DeniseWorthen Aug 15, 2021
71f4fe6
Merge remote-tracking branch 'TCraig/tmB' into feature/updcice
DeniseWorthen Aug 15, 2021
aeb473a
Merge remote-tracking branch 'Consortium/master' into feature/updcice
DeniseWorthen Aug 20, 2021
aade124
update icepack
DeniseWorthen Aug 20, 2021
7f089d0
add memory profiling (#36)
DeniseWorthen Aug 23, 2021
397b4bd
Merge branch 'NOAA-EMC:emc/develop' into feature/updcice
DeniseWorthen Aug 26, 2021
a1b3375
update icepack
DeniseWorthen Aug 31, 2021
7d2139c
Merge remote-tracking branch 'Consortium/master' into feature/updcice
DeniseWorthen Aug 31, 2021
cd021b5
Merge remote-tracking branch 'Consortium/master' into feature/updcice
DeniseWorthen Sep 1, 2021
5cb78cd
fix rhoa when lowest_temp is 0.0
DeniseWorthen Sep 15, 2021
d0a45a2
update icepack submodule
DeniseWorthen Sep 16, 2021
2540695
Update CICE for latest Consortium master (#38)
DeniseWorthen Sep 16, 2021
8a88024
Merge branch 'NOAA-EMC:emc/develop' into feature/updcice
DeniseWorthen Sep 20, 2021
d95bd51
Use CICE-Consortium/Icepack master (#40)
DeniseWorthen Oct 1, 2021
d83c67b
Merge branch 'NOAA-EMC:emc/develop' into feature/updcice
DeniseWorthen Oct 12, 2021
8d4a3c6
recreate cap update branch (#42)
DeniseWorthen Nov 22, 2021
55bf9f4
Merge remote-tracking branch 'Consortium/main' into feature/updcice
DeniseWorthen Nov 29, 2021
7a0b65e
Merge branch 'emc/develop' into feature/updcice
DeniseWorthen Nov 30, 2021
abbebab
remove 2 extraneous lines
DeniseWorthen Nov 30, 2021
8ff0fb2
duplicate gitmodule style for icepack
DeniseWorthen Nov 30, 2021
27dfd1b
Update CICE to latest Consortium/main (#45)
DeniseWorthen Feb 24, 2022
c660075
Update CICE to Consortium/main (#48)
DeniseWorthen May 10, 2022
4b28dfe
Merge remote-tracking branch 'Consortium/main' into feature/addCgrid
DeniseWorthen May 14, 2022
247dc1d
fix comment, fix env for orion and hera
DeniseWorthen May 14, 2022
dd158e2
replace save_init with step_prep in CICE_RunMod
DeniseWorthen May 14, 2022
ae50efe
fixes for cgrid repro
DeniseWorthen May 22, 2022
cbc6046
remove added haloupdates
DeniseWorthen May 24, 2022
ab95d2d
Merge remote-tracking branch 'Consortium/main' into feature/addCgridf…
DeniseWorthen Jun 2, 2022
a38df37
Merge remote-tracking branch 'Consortium/main' into feature/addCgridf…
DeniseWorthen Jun 13, 2022
2d5487a
change F->S for ocean velocities and tilts
DeniseWorthen Jun 13, 2022
26498db
fix debug failure when grid_ice=C
DeniseWorthen Jun 20, 2022
9e2dd69
respond to review comments
DeniseWorthen Jun 22, 2022
cc0f89c
remove inserted whitespace for uvelE,N and vvelE,N
DeniseWorthen Jun 22, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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:travis@travis-ci.org@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