Skip to content

Commit

Permalink
Send swpen by category (CICE-Consortium#495)
Browse files Browse the repository at this point in the history
Send broadband fswthrun by categories to coupler.
  • Loading branch information
dabail10 authored Jul 31, 2020
1 parent 9e8a300 commit 6a3e60c
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 2 deletions.
14 changes: 14 additions & 0 deletions cicecore/cicedynB/general/ice_flux.F90
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,11 @@ module ice_flux
fresh_da, & ! fresh water flux to ocean due to data assim (kg/m^2/s)
fsalt_da ! salt flux to ocean due to data assimilation(kg/m^2/s)

real (kind=dbl_kind), dimension (:,:,:,:), allocatable, public :: &
fswthrun_ai ! per-category fswthru * ai (W/m^2)

logical (kind=log_kind), public :: send_i2x_per_cat = .false.

!-----------------------------------------------------------------
! internal
!-----------------------------------------------------------------
Expand Down Expand Up @@ -713,6 +718,11 @@ subroutine init_coupler_flux
ffep (:,:,:,:)= c0
ffed (:,:,:,:)= c0

if (send_i2x_per_cat) then
allocate(fswthrun_ai(nx_block,ny_block,ncat,max_blocks))
fswthrun_ai(:,:,:,:) = c0
endif

!-----------------------------------------------------------------
! derived or computed fields
!-----------------------------------------------------------------
Expand Down Expand Up @@ -806,6 +816,10 @@ subroutine init_flux_ocn
H2_16O_ocn (:,:,:) = c0
H2_18O_ocn (:,:,:) = c0

if (send_i2x_per_cat) then
fswthrun_ai(:,:,:,:) = c0
endif

end subroutine init_flux_ocn

!=======================================================================
Expand Down
21 changes: 19 additions & 2 deletions cicecore/cicedynB/general/ice_step_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,8 @@ subroutine step_therm1 (dt, iblk)
flat, fswabs, flwout, evap, evaps, evapi, Tref, Qref, Uref, fresh, fsalt, fhocn, &
fswthru, fswthru_vdr, fswthru_vdf, fswthru_idr, fswthru_idf, &
meltt, melts, meltb, congel, snoice, &
flatn_f, fsensn_f, fsurfn_f, fcondtopn_f
flatn_f, fsensn_f, fsurfn_f, fcondtopn_f, &
send_i2x_per_cat, fswthrun_ai
use ice_flux_bgc, only: dsnown, faero_atm, faero_ocn, fiso_atm, fiso_ocn, &
Qa_iso, Qref_iso, fiso_evap, HDO_ocn, H2_16O_ocn, H2_18O_ocn
use ice_grid, only: lmask_n, lmask_s, tmask
Expand Down Expand Up @@ -310,7 +311,8 @@ subroutine step_therm1 (dt, iblk)
enddo
endif ! tr_aero

if (tmask(i,j,iblk)) &
if (tmask(i,j,iblk)) then

call icepack_step_therm1(dt=dt, ncat=ncat, &
nilyr=nilyr, nslyr=nslyr, &
aicen_init = aicen_init (i,j,:,iblk), &
Expand Down Expand Up @@ -452,6 +454,21 @@ subroutine step_therm1 (dt, iblk)
frz_onset = frz_onset (i,j, iblk), &
yday=yday, prescribed_ice=prescribed_ice)

!-----------------------------------------------------------------
! handle per-category i2x fields, no merging
!-----------------------------------------------------------------

if (send_i2x_per_cat) then
do n = 1, ncat
! TODO (mvertens, 2018-12-22): do we need to add the band separated quantities
! for MOM6 here also?

fswthrun_ai(i,j,n,iblk) = fswthrun(i,j,n,iblk)*aicen_init(i,j,n,iblk)
enddo ! ncat
endif

endif

if (tr_iso) then
do n = 1, ncat
if (vicen(i,j,n,iblk) > puny) &
Expand Down

0 comments on commit 6a3e60c

Please sign in to comment.