Skip to content

Commit

Permalink
Deprecate zsalinity, remove code
Browse files Browse the repository at this point in the history
  • Loading branch information
apcraig committed Jul 29, 2023
1 parent d8f0057 commit f836c7d
Show file tree
Hide file tree
Showing 22 changed files with 2 additions and 666 deletions.
220 changes: 0 additions & 220 deletions cicecore/cicedyn/analysis/ice_diagnostics_bgc.F90
Original file line number Diff line number Diff line change
Expand Up @@ -851,226 +851,6 @@ subroutine bgc_diags

end subroutine bgc_diags

!=======================================================================
#ifdef tcxzsal
!
! 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_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_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
#endif
!=======================================================================

end module ice_diagnostics_bgc
Expand Down
92 changes: 0 additions & 92 deletions cicecore/cicedyn/analysis/ice_history_bgc.F90
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@ module ice_history_bgc
f_iso = 'x', &
f_faero_atm = 'x', f_faero_ocn = 'x', &
f_aero = 'x', &
!tcxzsal f_fzsal = 'm', f_fzsal_ai = 'm', &
! f_fzsal_g = 'm', f_fzsal_g_ai = 'm', &
! f_zsal = 'x', &
f_fbio = 'x', f_fbio_ai = 'x', &
f_zaero = 'x', f_bgc_S = 'x', &
f_bgc_N = 'x', f_bgc_C = 'x', &
Expand Down Expand Up @@ -154,8 +151,6 @@ module ice_history_bgc
!---------------------------------------------------------------

integer (kind=int_kind), dimension(max_nstrm), public :: &
!tcxzsal n_fzsal , n_fzsal_ai , &
! n_fzsal_g , n_fzsal_g_ai , &
n_zsal

integer(kind=int_kind), dimension(icepack_max_iso,max_nstrm) :: &
Expand Down Expand Up @@ -628,25 +623,6 @@ subroutine init_hist_bgc_2D
f_bgc_DMS_cat1 = f_bgc_DMS
f_bgc_PON_cat1 = f_bgc_PON

!tcxzsal if (solve_zsal) then
! f_fzsal = f_fsalt
! f_fzsal_g = f_fsalt
! f_fzsal_ai = f_fsalt_ai
! f_fzsal_g_ai = f_fsalt_ai
! f_zsal = f_sice
! f_fsalt = 'x'
! f_fsalt_ai = 'x'
! f_sice = 'x'
! else
! f_fzsal = 'x'
! f_fzsal_g = 'x'
! f_fzsal_ai = 'x'
! f_fzsal_g_ai = 'x'
! f_zsal = 'x'
! f_bgc_S = 'x'
f_iki = 'x'
!tcxzsal endif

call broadcast_scalar (f_fiso_atm, master_task)
call broadcast_scalar (f_fiso_ocn, master_task)
call broadcast_scalar (f_iso, master_task)
Expand All @@ -655,11 +631,6 @@ subroutine init_hist_bgc_2D
call broadcast_scalar (f_aero, master_task)
call broadcast_scalar (f_fbri, master_task)
call broadcast_scalar (f_hbri, master_task)
!tcxzsal call broadcast_scalar (f_fzsal, master_task)
! call broadcast_scalar (f_fzsal_ai, master_task)
! call broadcast_scalar (f_fzsal_g, master_task)
! call broadcast_scalar (f_fzsal_g_ai, master_task)
! call broadcast_scalar (f_zsal, master_task)
call broadcast_scalar (f_fNit, master_task)
call broadcast_scalar (f_fNit_ai, master_task)
call broadcast_scalar (f_fDOC, master_task)
Expand Down Expand Up @@ -739,7 +710,6 @@ subroutine init_hist_bgc_2D
call broadcast_scalar (f_bphi, master_task)
call broadcast_scalar (f_iDi, master_task)
call broadcast_scalar (f_iki, master_task)
!tcxzsal call broadcast_scalar (f_bgc_S, master_task)
call broadcast_scalar (f_zfswin, master_task)
call broadcast_scalar (f_PPnet, master_task)
call broadcast_scalar (f_algalpeak, master_task)
Expand Down Expand Up @@ -838,34 +808,6 @@ subroutine init_hist_bgc_2D
enddo
endif

! ! zsalinity
!
!tcxzsal
! call define_hist_field(n_fzsal,"fzsal","kg/m^2/s",tstr2D, tcstr, &
! "prognostic salt flux ice to ocn (cpl)", &
! "if positive, ocean gains salt", c1, c0, &
! ns, f_fzsal)
!
! call define_hist_field(n_fzsal_ai,"fzsal_ai","kg/m^2/s",tstr2D, tcstr, &
! "prognostic salt flux ice to ocean", &
! "weighted by ice area", c1, c0, &
! ns, f_fzsal_ai)
!
! call define_hist_field(n_fzsal_g,"fzsal_g","kg/m^2/s",tstr2D, tcstr, &
! "Gravity drainage salt flux ice to ocn (cpl)", &
! "if positive, ocean gains salt", c1, c0, &
! ns, f_fzsal_g)
!
! call define_hist_field(n_fzsal_g_ai,"fzsal_g_ai","kg/m^2/s",tstr2D, tcstr, &
! "Gravity drainage salt flux ice to ocean", &
! "weighted by ice area", c1, c0, &
! ns, f_fzsal_g_ai)
!
! call define_hist_field(n_zsal,"zsal_tot","g/m^2",tstr2D, tcstr, &
! "Total Salt content", &
! "In ice volume*fbri", c1, c0, &
! ns, f_zsal)

! Aerosols
if (f_aero(1:1) /= 'x') then
do n=1,n_aero
Expand Down Expand Up @@ -1888,11 +1830,6 @@ subroutine init_hist_bgc_3Db
"permeability", "on bio interface grid", 1.0e6_dbl_kind, c0, &
ns, f_iki)

!tcxzsal if (f_bgc_S(1:1) /= 'x') &
! call define_hist_field(n_bgc_S,"bgc_S","ppt",tstr3Db, tcstr, &
! "bulk salinity", "on bio grid", c1, c0, &
! ns, f_bgc_S)

if (f_zfswin(1:1) /= 'x') &
call define_hist_field(n_zfswin,"zfswin","W/m^2",tstr3Db, tcstr, &
"internal ice PAR", "on bio interface grid", c1, c0, &
Expand Down Expand Up @@ -2043,18 +1980,6 @@ subroutine accum_hist_bgc (iblk)

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

!tcxzsal ! zsalinity
! if (f_fzsal (1:1) /= 'x') &
! call accum_hist_field(n_fzsal, iblk, fzsal(:,:,iblk), a2D)
! if (f_fzsal_ai(1:1)/= 'x') &
! call accum_hist_field(n_fzsal_ai, iblk, fzsal_ai(:,:,iblk), a2D)
! if (f_fzsal_g (1:1) /= 'x') &
! call accum_hist_field(n_fzsal_g, iblk, fzsal_g(:,:,iblk), a2D)
! if (f_fzsal_g_ai(1:1)/= 'x') &
! call accum_hist_field(n_fzsal_g_ai,iblk, fzsal_g_ai(:,:,iblk), a2D)
! if (f_zsal (1:1) /= 'x') &
! call accum_hist_field(n_zsal, iblk, zsal_tot(:,:,iblk), a2D)

! isotopes
if (f_fiso_atm(1:1) /= 'x') then
do n=1,n_iso
Expand Down Expand Up @@ -2713,21 +2638,6 @@ subroutine accum_hist_bgc (iblk)
workz(:,:,1:nzblyr), a3Db)
endif

!tcxzsal if (f_bgc_S (1:1) /= 'x') then
! workz(:,:,:) = c0
! do j = jlo, jhi
! do i = ilo, ihi
! if (aice(i,j,iblk) > c0) then
! workz(i,j,1) = trcr(i,j,nt_bgc_S,iblk)
! workz(i,j,2:nblyr+1) = trcr(i,j,nt_bgc_S:nt_bgc_S+nblyr-1,iblk)
! workz(i,j,nblyr+2) = sss(i,j,iblk)
! endif
! enddo ! i
! enddo ! j
! call accum_hist_field(n_bgc_S-n3Dzcum, iblk, nzblyr, &
! workz(:,:,1:nzblyr), a3Db)
! endif

if (f_zfswin (1:1) /= 'x') then
workz(:,:,:) = c0
do n = 1, ncat_hist
Expand Down Expand Up @@ -3507,8 +3417,6 @@ subroutine init_history_bgc
snow_bio_net(:,:,:,:) = c0
fbio_snoice (:,:,:,:) = c0
fbio_atmice (:,:,:,:) = c0
!tcxzsal fzsal (:,:,:) = c0
! fzsal_g (:,:,:) = c0
zfswin (:,:,:,:,:) = c0
fnit (:,:,:) = c0
fsil (:,:,:) = c0
Expand Down
3 changes: 0 additions & 3 deletions cicecore/cicedyn/dynamics/ice_transport_driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,6 @@ subroutine init_transport
if (nt-k==nt_bgc_Nit) &
write(nu_diag,1000) 'nt_bgc_Nit ',nt,depend(nt),tracer_type(nt),&
has_dependents(nt)
!tcxzsal if (nt-k==nt_bgc_S) &
! write(nu_diag,1000) 'nt_bgc_S ',nt,depend(nt),tracer_type(nt),&
! has_dependents(nt)
enddo
write(nu_diag,*) ' '
endif ! master_task
Expand Down
Loading

0 comments on commit f836c7d

Please sign in to comment.