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

Update CICE from Consortium/main, add run-time and history-write logging #65

Merged
merged 35 commits into from
Sep 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
9424497
Fix CESMCOUPLED compile issue in icepack. (#823)
dabail10 Mar 23, 2023
5b0418a
Update global reduction implementation to improve performance, fix VP…
apcraig Apr 5, 2023
35ec167
Add functionality to change hist_avg for each stream (#827)
dabail10 May 17, 2023
b98b8ae
Update Icepack to #6703bc533c968 May 22, 2023 (#829)
apcraig May 24, 2023
8e2aab2
Fix for mesh check in CESM driver (#830)
dabail10 Jun 20, 2023
7eb4dd7
Update .readthedocs.yaml, add pdf (#837)
apcraig Jun 20, 2023
bd0ee2c
add run time info
junwang-noaa Jun 27, 2023
e01660b
change real(8) to real(dbl)kind)
junwang-noaa Jul 6, 2023
b475ad4
fix syntax
junwang-noaa Jul 6, 2023
dc73c66
fix write unit
junwang-noaa Jul 6, 2023
1e65452
use cice_wrapper for ufs timer functionality
DeniseWorthen Jul 6, 2023
c6049c5
add elapsed model time for logtime
DeniseWorthen Jul 6, 2023
34dc667
Namelist option for time axis position. (#839)
dabail10 Jul 7, 2023
b7d88d9
tidy up the wrapper
DeniseWorthen Jul 7, 2023
fead17f
add timer and forecast log
DeniseWorthen Jul 7, 2023
a744734
only one time is needed
DeniseWorthen Jul 8, 2023
1c98b43
modify message written for log.ice.fXXX
DeniseWorthen Jul 10, 2023
dd13d6f
change info in fXXX log file
DeniseWorthen Jul 10, 2023
766ff8d
Update Icepack to #d024340f19676b July 6, 2023 (#841)
apcraig Jul 11, 2023
f9d3002
Add support for JRA55do (#843)
apcraig Jul 13, 2023
9f42a62
Update Icepack to Consortium main #4728746, July 18 2023 (#846)
apcraig Jul 20, 2023
1870b3a
Merge remote-tracking branch 'Consortium/main' into feature/updcice
DeniseWorthen Jul 24, 2023
4cb296c
Modification of edge mask computation when l_fixed_area=T in horizont…
JFLemieux73 Jul 25, 2023
8baa3eb
Merge remote-tracking branch 'Consortium/main' into feature/updcice
DeniseWorthen Jul 25, 2023
7e8dc5b
Update conda_macos to fix problems with Github Actions testing (#853)
apcraig Aug 10, 2023
7c0a18e
Merge branch 'NOAA-EMC:emc/develop' into feature/runtime
DeniseWorthen Aug 16, 2023
8322416
Updates to advanced snow physics implementation (#852)
eclare108213 Aug 18, 2023
a1f066b
reset timer after Advance to retrieve "wait time"
DeniseWorthen Aug 21, 2023
357103a
Deprecate zsalinity (#851)
apcraig Aug 22, 2023
c7876eb
Merge remote-tracking branch 'Consortium/main' into feature/updcice
DeniseWorthen Aug 23, 2023
aa22374
Merge branch 'feature/runtime' into feature/updcice
DeniseWorthen Aug 23, 2023
897ea65
add logical control for enabling runtime info
DeniseWorthen Aug 23, 2023
48cf726
Merge branch 'feature/runtime' into feature/updcice
DeniseWorthen Aug 23, 2023
76c3f7f
remove zsal items from cap
DeniseWorthen Aug 23, 2023
84427a6
fix typo
DeniseWorthen Aug 23, 2023
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
43 changes: 35 additions & 8 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:
- master
- main
- 'CICE*'
- 'ghactions*'
pull_request:
Expand All @@ -27,8 +27,12 @@ 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 Down Expand Up @@ -98,10 +102,26 @@ jobs:
conda env create -f configuration/scripts/machines/environment.yml
- name: check conda env
run: |
conda activate cice && which mpicc && which mpifort && which make
conda activate cice && which clang && which gfortran && which mpicc && which mpifort && which make
clang --version
gfortran --version
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 @@ -110,12 +130,19 @@ jobs:
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: 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: download input data
run: |
cd $HOME/cice-dirs/input
Expand Down
225 changes: 3 additions & 222 deletions cicecore/cicedyn/analysis/ice_diagnostics_bgc.F90
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ module ice_diagnostics_bgc

implicit none
private
public :: hbrine_diags, bgc_diags, zsal_diags
public :: hbrine_diags, bgc_diags

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

Expand Down Expand Up @@ -715,7 +715,7 @@ subroutine bgc_diags
endif
if (tr_bgc_N) then
write(nu_diag,*) '---------------------------------------------------'
write(nu_diag,900) 'tot algal growth (1/d) = ',pgrow_net(1),pgrow_net(2)
write(nu_diag,901) 'tot algal growth (1/d) = ',pgrow_net(1),pgrow_net(2)
do kk = 1,n_algae
write(nu_diag,*) ' algal conc. (mmol N/m^3) or flux (mmol N/m^2/d)'
write(nu_diag,1020) ' type:', kk
Expand Down Expand Up @@ -846,230 +846,11 @@ subroutine bgc_diags
802 format (f24.17,2x,f24.17)
803 format (a25,2x,a25)
900 format (a25,2x,f24.17,2x,f24.17)
901 format (a25,2x,g24.17,2x,g24.17)
1020 format (a30,2x,i6) ! integer

end subroutine bgc_diags

!=======================================================================
!
! Writes diagnostic info (max, min, global sums, etc) to standard out
!
! authors: Elizabeth C. Hunke, LANL
! Bruce P. Briegleb, NCAR
! Cecilia M. Bitz, UW
! Nicole Jeffery, LANL

subroutine zsal_diags

use ice_arrays_column, only: fzsal, fzsal_g, sice_rho, bTiz, &
iDi, bphi, dhbr_top, dhbr_bot, darcy_V
use ice_broadcast, only: broadcast_scalar, broadcast_array
use ice_diagnostics, only: npnt, print_points, pmloc, piloc, pjloc, &
pbloc
use ice_domain_size, only: nblyr, ncat, nilyr
use ice_state, only: aicen, aice, vice, trcr, trcrn, vicen, vsno

! local variables

integer (kind=int_kind) :: &
i, j, k, n, nn, iblk

! fields at diagnostic points
real (kind=dbl_kind), dimension(npnt) :: &
phinS, phinS1,&
phbrn,pdh_top1,pdh_bot1, psice_rho, pfzsal, &
pfzsal_g, pdarcy_V1

! vertical fields of category 1 at diagnostic points for bgc layer model
real (kind=dbl_kind), dimension(npnt,nblyr+2) :: &
pphin, pphin1
real (kind=dbl_kind), dimension(npnt,nblyr) :: &
pSin, pSice, pSin1

real (kind=dbl_kind), dimension(npnt,nblyr+1) :: &
pbTiz, piDin

real (kind=dbl_kind) :: &
rhosi, rhow, rhos

logical (kind=log_kind) :: tr_brine

integer (kind=int_kind) :: nt_fbri, nt_bgc_S, nt_sice
character(len=*), parameter :: subname = '(zsal_diags)'

call icepack_query_parameters(rhosi_out=rhosi, rhow_out=rhow, rhos_out=rhos)
call icepack_query_tracer_flags(tr_brine_out=tr_brine)
call icepack_query_tracer_indices(nt_fbri_out=nt_fbri, nt_bgc_S_out=nt_bgc_S, &
nt_sice_out=nt_sice)
call icepack_warnings_flush(nu_diag)
if (icepack_warnings_aborted()) call abort_ice(error_message=subname, &
file=__FILE__, line=__LINE__)

!-----------------------------------------------------------------
! salinity and microstructure of the ice
!-----------------------------------------------------------------

if (print_points) then

!-----------------------------------------------------------------
! state of the ice and associated fluxes for 2 defined points
! NOTE these are computed for the last timestep only (not avg)
!-----------------------------------------------------------------

do n = 1, npnt
if (my_task == pmloc(n)) then
i = piloc(n)
j = pjloc(n)
iblk = pbloc(n)

pfzsal(n) = fzsal(i,j,iblk)
pfzsal_g(n) = fzsal_g(i,j,iblk)
phinS(n) = c0
phinS1(n) = c0
phbrn(n) = c0
psice_rho(n) = c0
pdh_top1(n) = c0
pdh_bot1(n) = c0
pdarcy_V1(n) = c0
do nn = 1,ncat
psice_rho(n) = psice_rho(n) + sice_rho(i,j,nn,iblk)*aicen(i,j,nn,iblk)
enddo
if (aice(i,j,iblk) > c0) &
psice_rho(n) = psice_rho(n)/aice(i,j,iblk)
if (tr_brine .and. aice(i,j,iblk) > c0) then
phinS(n) = trcr(i,j,nt_fbri,iblk)*vice(i,j,iblk)/aice(i,j,iblk)
phbrn(n) = (c1 - rhosi/rhow)*vice(i,j,iblk)/aice(i,j,iblk) &
- rhos/rhow *vsno(i,j,iblk)/aice(i,j,iblk)
endif
if (tr_brine .and. aicen(i,j,1,iblk)> c0) then
phinS1(n) = trcrn(i,j,nt_fbri,1,iblk) &
* vicen(i,j,1,iblk)/aicen(i,j,1,iblk)
pdh_top1(n) = dhbr_top(i,j,1,iblk)
pdh_bot1(n) = dhbr_bot(i,j,1,iblk)
pdarcy_V1(n) = darcy_V(i,j,1,iblk)
endif
do k = 1, nblyr+1
pbTiz(n,k) = c0
piDin(n,k) = c0
do nn = 1,ncat
pbTiz(n,k) = pbTiz(n,k) + bTiz(i,j,k,nn,iblk)*vicen(i,j,nn,iblk)
piDin(n,k) = piDin(n,k) + iDi(i,j,k,nn,iblk)*vicen(i,j,nn,iblk)
enddo
if (vice(i,j,iblk) > c0) then
pbTiz(n,k) = pbTiz(n,k)/vice(i,j,iblk)
piDin(n,k) = piDin(n,k)/vice(i,j,iblk)
endif
enddo ! k
do k = 1, nblyr+2
pphin(n,k) = c0
pphin1(n,k) = c0
if (aicen(i,j,1,iblk) > c0) pphin1(n,k) = bphi(i,j,k,1,iblk)
do nn = 1,ncat
pphin(n,k) = pphin(n,k) + bphi(i,j,k,nn,iblk)*vicen(i,j,nn,iblk)
enddo
if (vice(i,j,iblk) > c0) then
pphin(n,k) = pphin(n,k)/vice(i,j,iblk)
endif
enddo
do k = 1,nblyr
pSin(n,k) = c0
pSin1(n,k) = c0
pSin(n,k)= trcr(i,j,nt_bgc_S+k-1,iblk)
if (aicen(i,j,1,iblk) > c0) pSin1(n,k) = trcrn(i,j,nt_bgc_S+k-1,1,iblk)
enddo
do k = 1,nilyr
pSice(n,k) = trcr(i,j,nt_sice+k-1,iblk)
enddo
endif ! my_task = pmloc

call broadcast_scalar(phinS (n), pmloc(n))
call broadcast_scalar(phinS1 (n), pmloc(n))
call broadcast_scalar(phbrn (n), pmloc(n))
call broadcast_scalar(pdh_top1 (n), pmloc(n))
call broadcast_scalar(pdh_bot1 (n), pmloc(n))
call broadcast_scalar(psice_rho(n), pmloc(n))
call broadcast_scalar(pfzsal_g (n), pmloc(n))
call broadcast_scalar(pdarcy_V1(n), pmloc(n))
call broadcast_scalar(pfzsal (n), pmloc(n))
call broadcast_array (pbTiz (n,:), pmloc(n))
call broadcast_array (piDin (n,:), pmloc(n))
call broadcast_array (pphin (n,:), pmloc(n))
call broadcast_array (pphin1 (n,:), pmloc(n))
call broadcast_array (pSin (n,:), pmloc(n))
call broadcast_array (pSin1 (n,:), pmloc(n))
call broadcast_array (pSice (n,:), pmloc(n))
enddo ! npnt
endif ! print_points

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

if (my_task == master_task) then

call flush_fileunit(nu_diag)

!-----------------------------------------------------------------
! diagnostics for Arctic and Antarctic points
!-----------------------------------------------------------------

if (print_points) then

write(nu_diag,*) ' '
write(nu_diag,902) ' Brine height '
write(nu_diag,900) 'hbrin = ',phinS(1),phinS(2)
write(nu_diag,900) 'hbrin cat 1 = ',phinS1(1),phinS1(2)
write(nu_diag,900) 'Freeboard = ',phbrn(1),phbrn(2)
write(nu_diag,900) 'dhbrin cat 1 top = ',pdh_top1(1),pdh_top1(2)
write(nu_diag,900) 'dhbrin cat 1 bottom = ',pdh_bot1(1),pdh_bot1(2)
write(nu_diag,*) ' '
write(nu_diag,902) ' zSalinity '
write(nu_diag,900) 'Avg density (kg/m^3) = ',psice_rho(1),psice_rho(2)
write(nu_diag,900) 'Salt flux (kg/m^2/s) = ',pfzsal(1),pfzsal(2)
write(nu_diag,900) 'Grav. Drain. Salt flux = ',pfzsal_g(1),pfzsal_g(2)
write(nu_diag,900) 'Darcy V cat 1 (m/s) = ',pdarcy_V1(1),pdarcy_V1(2)
write(nu_diag,*) ' '
write(nu_diag,*) ' Top down bgc Layer Model'
write(nu_diag,*) ' '
write(nu_diag,803) 'bTiz(1) ice temp',' bTiz(2) ice temp '
write(nu_diag,*) '---------------------------------------------------'
write(nu_diag,802) ((pbTiz(n,k),n = 1,2), k = 1,nblyr+1)
write(nu_diag,*) ' '
write(nu_diag,803) 'iDi(1) diffusivity ','iDi(2) diffusivity '
write(nu_diag,*) '---------------------------------------------------'
write(nu_diag,802) ((piDin(n,k),n=1,2), k = 1,nblyr+1)
write(nu_diag,*) ' '
write(nu_diag,803) 'bphi(1) porosity ','bphi(2) porosity '
write(nu_diag,*) '---------------------------------------------------'
write(nu_diag,802) ((pphin(n,k),n=1,2), k = 1,nblyr+1)
write(nu_diag,*) ' '
write(nu_diag,803) 'phi1(1) porosity ','phi1(2) porosity '
write(nu_diag,*) '---------------------------------------------------'
write(nu_diag,802) ((pphin1(n,k),n=1,2), k = 1,nblyr+1)
write(nu_diag,*) ' '
write(nu_diag,803) 'zsal(1) cat 1 ','zsal(2) cat 1 '
write(nu_diag,*) '---------------------------------------------------'
write(nu_diag,802) ((pSin1(n,k),n=1,2), k = 1,nblyr)
write(nu_diag,*) ' '
write(nu_diag,803) 'zsal(1) Avg S ','zsal(2) Avg S '
write(nu_diag,*) '---------------------------------------------------'
write(nu_diag,802) ((pSin(n,k),n=1,2), k = 1,nblyr)
write(nu_diag,*) ' '
write(nu_diag,803) 'Sice(1) Ice S ','Sice(2) Ice S '
write(nu_diag,*) '---------------------------------------------------'
write(nu_diag,802) ((pSice(n,k),n=1,2), k = 1,nilyr)
write(nu_diag,*) ' '

endif ! print_points
endif ! my_task = master_task

802 format (f24.17,2x,f24.17)
803 format (a25,2x,a25)
900 format (a25,2x,f24.17,2x,f24.17)
902 format (a25,10x,f6.1,1x,f6.1,9x,f6.1,1x,f6.1)

end subroutine zsal_diags

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

end module ice_diagnostics_bgc
Expand Down
4 changes: 2 additions & 2 deletions cicecore/cicedyn/analysis/ice_history.F90
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ subroutine init_hist (dt)
logical (kind=log_kind) :: formdrag
logical (kind=log_kind) :: tr_iage, tr_FY, tr_lvl, tr_pond, tr_aero, tr_brine
logical (kind=log_kind) :: tr_fsd, tr_snow
logical (kind=log_kind) :: skl_bgc, solve_zsal, solve_zbgc, z_tracers
logical (kind=log_kind) :: skl_bgc, solve_zbgc, z_tracers
integer (kind=int_kind) :: n, ns, ns1, ns2
integer (kind=int_kind), dimension(max_nstrm) :: &
ntmp
Expand Down Expand Up @@ -222,7 +222,7 @@ subroutine init_hist (dt)
call icepack_query_parameters(rhofresh_out=rhofresh, Tffresh_out=Tffresh, &
secday_out=secday, rad_to_deg_out=rad_to_deg)
call icepack_query_parameters(formdrag_out=formdrag, skl_bgc_out=skl_bgc, &
solve_zsal_out=solve_zsal, solve_zbgc_out=solve_zbgc, z_tracers_out=z_tracers)
solve_zbgc_out=solve_zbgc, z_tracers_out=z_tracers)
call icepack_query_tracer_flags(tr_iage_out=tr_iage, tr_FY_out=tr_FY, &
tr_lvl_out=tr_lvl, tr_pond_out=tr_pond, tr_aero_out=tr_aero, &
tr_brine_out=tr_brine, tr_fsd_out=tr_fsd, tr_snow_out=tr_snow)
Expand Down
Loading
Loading