Skip to content

Commit

Permalink
+Moved ridging diagnostics into ice_transport
Browse files Browse the repository at this point in the history
  Moved ridging rate diagnostics from post_ice_state_diagnostics into
ice_transport, eliminated several arguments to ice_transport and making rdg_rate
an optional argument to ice_transport, and eliminated the optional rdg_rate
argument to post_ice_state_diagnostics.  All answers are bitwise identical but
the order of entries in the SIS_available_diags file changes.
  • Loading branch information
Hallberg-NOAA committed Nov 28, 2018
1 parent 02bf864 commit 572fbc3
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 41 deletions.
42 changes: 9 additions & 33 deletions src/SIS_dyn_trans.F90
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ module SIS_dyn_trans
integer, dimension(:), allocatable :: id_t, id_sal
integer :: id_cn=-1, id_hi=-1, id_hp=-1, id_hs=-1, id_tsn=-1, id_ext=-1 ! id_hp mw/new
integer :: id_t_iceav=-1, id_s_iceav=-1, id_e2m=-1
integer :: id_rdgr=-1 ! These do not exist yet: id_rdgf=-1, id_rdgo=-1, id_rdgv=-1

integer :: id_simass=-1, id_sisnmass=-1, id_sivol=-1
integer :: id_siconc=-1, id_sithick=-1, id_sisnconc=-1, id_sisnthick=-1
Expand Down Expand Up @@ -301,13 +300,9 @@ subroutine SIS_dynamics_trans(IST, OSS, FIA, IOF, dt_slow, CS, icebergs_CS, G, I

real, parameter :: T_0degC = 273.15 ! 0 degrees C in Kelvin

real, dimension(SZI_(G),SZJ_(G),IG%CatIce) :: &
rdg_frac ! fraction of ridged ice per category
real, dimension(SZI_(G),SZJ_(G)) :: &
rdg_open, & ! formation rate of open water due to ridging
rdg_vosh, & ! rate of ice mass shifted from level to ridged ice
!! rdg_s2o, & ! snow mass [kg m-2] dumped into ocean during ridging
rdg_rate, & ! Niki: Where should this come from?
rdg_rate, & ! A ridging rate in s-1, this will be calculated from the strain rates in the dynamics.
snow2ocn
real :: tmp3 ! This is a bad name - make it more descriptive!

Expand Down Expand Up @@ -584,8 +579,7 @@ subroutine SIS_dynamics_trans(IST, OSS, FIA, IOF, dt_slow, CS, icebergs_CS, G, I
if (CS%Cgrid_dyn) then
call ice_transport(IST%part_size, IST%mH_ice, IST%mH_snow, IST%mH_pond, &
IST%u_ice_C, IST%v_ice_C, IST%TrReg, dt_slow_dyn, G, IG, &
CS%SIS_transport_CSp, IST%rdg_mice, snow2ocn, rdg_rate, &
rdg_open, rdg_vosh)
CS%SIS_transport_CSp, IST%rdg_mice, snow2ocn) !###, rdg_rate=rdg_rate)
else
! B-grid transport
! Convert the velocities to C-grid points for transport.
Expand All @@ -599,7 +593,7 @@ subroutine SIS_dynamics_trans(IST, OSS, FIA, IOF, dt_slow, CS, icebergs_CS, G, I

call ice_transport(IST%part_size, IST%mH_ice, IST%mH_snow, IST%mH_pond, &
uc, vc, IST%TrReg, dt_slow_dyn, G, IG, CS%SIS_transport_CSp, &
IST%rdg_mice, snow2ocn, rdg_rate, rdg_open, rdg_vosh)
IST%rdg_mice, snow2ocn, rdg_rate=rdg_rate)
endif
if (CS%column_check) &
call write_ice_statistics(IST, CS%Time, CS%n_calls, G, IG, CS%sum_output_CSp, &
Expand Down Expand Up @@ -631,8 +625,7 @@ subroutine SIS_dynamics_trans(IST, OSS, FIA, IOF, dt_slow, CS, icebergs_CS, G, I

call enable_SIS_averaging(dt_slow, CS%Time, CS%diag)

call post_ice_state_diagnostics(CS, IST, OSS, IOF, dt_slow, CS%Time, G, IG, CS%diag, &
rdg_rate=rdg_rate)
call post_ice_state_diagnostics(CS, IST, OSS, IOF, dt_slow, CS%Time, G, IG, CS%diag)

call disable_SIS_averaging(CS%diag)

Expand Down Expand Up @@ -661,8 +654,7 @@ end subroutine SIS_dynamics_trans

!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~!
!> Offer diagnostics of the slowly evolving sea ice state.
subroutine post_ice_state_diagnostics(CS, IST, OSS, IOF, dt_slow, Time, G, IG, diag, &
rdg_rate)
subroutine post_ice_state_diagnostics(CS, IST, OSS, IOF, dt_slow, Time, G, IG, diag)
type(ice_state_type), intent(inout) :: IST !< A type describing the state of the sea ice
type(ocean_sfc_state_type), intent(in) :: OSS !< A structure containing the arrays that describe
!! the ocean's surface state for the ice model.
Expand All @@ -676,15 +668,16 @@ subroutine post_ice_state_diagnostics(CS, IST, OSS, IOF, dt_slow, Time, G, IG, d
type(ice_grid_type), intent(inout) :: IG !< The sea-ice specific grid type
type(dyn_trans_CS), pointer :: CS !< The control structure for the SIS_dyn_trans module
type(SIS_diag_ctrl), pointer :: diag !< A structure that is used to regulate diagnostic output
real, dimension(SZI_(G),SZJ_(G)), &
optional, intent(in) :: rdg_rate !< The ice ridging rate in s-1.

! Local variables
real, dimension(G%isc:G%iec,G%jsc:G%jec) :: mass, mass_ice, mass_snow, tmp2d
real, dimension(SZI_(G),SZJ_(G),IG%CatIce,IG%NkIce) :: &
temp_ice ! A diagnostic array with the ice temperature in degC.
real, dimension(SZI_(G),SZJ_(G),IG%CatIce) :: &
temp_snow ! A diagnostic array with the snow temperature in degC.
! ### This diagnostic does not exist yet.
! real, dimension(SZI_(G),SZJ_(G),IG%CatIce) :: &
! rdg_frac ! fraction of ridged ice per category
real, dimension(SZI_(G),SZJ_(G)) :: diagVar ! An temporary array for diagnostics.
real, dimension(IG%NkIce) :: S_col ! Specified thermodynamic salinity of each
! ice layer if spec_thermo_sal is true.
Expand Down Expand Up @@ -849,8 +842,7 @@ subroutine post_ice_state_diagnostics(CS, IST, OSS, IOF, dt_slow, Time, G, IG, d
!TOM> preparing output field fraction of ridged ice rdg_frac = (ridged ice volume) / (total ice volume)
! in each category; IST%rdg_mice is ridged ice mass per unit total area throughout the code.
! if (CS%id_rdgf>0) then
! !$OMP parallel do default(none) shared(isc,iec,jsc,jec,ncat,IST,G,rdg_frac,IG) &
! !$OMP private(tmp3)
! !$OMP parallel do default(shared) private(tmp3)
! do j=jsc,jec ; do k=1,ncat ; do i=isc,iec
! tmp3 = IST%mH_ice(i,j,k)*IST%part_size(i,j,k)
! if (tmp3*IG%H_to_kg_m2 > Rho_Ice*1.e-5) then ! 1 mm ice thickness x 1% ice concentration
Expand All @@ -861,16 +853,6 @@ subroutine post_ice_state_diagnostics(CS, IST, OSS, IOF, dt_slow, Time, G, IG, d
! enddo ; enddo ; enddo
! call post_data(CS%id_rdgf, rdg_frac(isc:iec,jsc:jec), diag)
! endif

if (CS%id_rdgr>0 .and. present(rdg_rate)) &
call post_data(CS%id_rdgr, rdg_rate(isc:iec,jsc:jec), diag)
! if (CS%id_rdgo>0) call post_data(CS%id_rdgo, rdg_open(isc:iec,jsc:jec), diag)
! if (CS%id_rdgv>0) then
! do j=jsc,jec ; do i=isc,iec
! tmp2d(i,j) = rdg_vosh(i,j) * G%areaT(i,j) * G%mask2dT(i,j)
! enddo ; enddo
! call post_data(CS%id_rdgv, tmp2d, diag)
! endif
endif

end subroutine post_ice_state_diagnostics
Expand Down Expand Up @@ -1466,15 +1448,9 @@ subroutine SIS_dyn_trans_init(Time, G, IG, param_file, diag, CS, output_dir, Tim
'ice + snow + bergs mass', 'kg/m^2', missing_value=missing)
CS%id_e2m = register_diag_field('ice_model','E2MELT' ,diag%axesT1, Time, &
'heat needed to melt ice', 'J/m^2', missing_value=missing)
CS%id_rdgr = register_diag_field('ice_model','RDG_RATE' ,diag%axesT1, Time, &
'ice ridging rate', '1/sec', missing_value=missing)
!### THESE DIAGNOSTICS DO NOT EXIST YET.
! CS%id_rdgf = register_diag_field('ice_model','RDG_FRAC' ,diag%axesT1, Time, &
! 'ridged ice fraction', '0-1', missing_value=missing)
! CS%id_rdgo = register_diag_field('ice_model','RDG_OPEN' ,diag%axesT1, Time, &
! 'opening due to ridging', '1/s', missing_value=missing)
! CS%id_rdgv = register_diag_field('ice_model','RDG_VOSH' ,diag%axesT1, Time, &
! 'volume shifted from level to ridged ice', 'm^3/s', missing_value=missing)
!### THIS DIAGNOSTIC IS MISSING.
! CS%id_ta = register_diag_field('ice_model', 'TA', diag%axesT1, Time, &
! 'surface air temperature', 'C', missing_value=missing)
Expand Down
40 changes: 32 additions & 8 deletions src/SIS_transport.F90
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ module SIS_transport
type, public :: SIS_transport_CS ; private

logical :: SLAB_ICE = .false. !< If true, do old style GFDL slab ice?
real :: Rho_ice = 905.0 !< The nominal density of sea ice, in kg m-3.
real :: Rho_ice = 905.0 !< The nominal density of sea ice, in kg m-3, used here only in rolling.
!### Rho_snow is unused in this module.
real :: Rho_snow = 330.0 !< The nominal density of snow on sea ice, in kg m-3.
real :: Roll_factor !< A factor by which the propensity of small amounts of thick sea-ice
!! to become thinner by rolling is increased, or 0 to disable rolling.
Expand All @@ -61,8 +62,10 @@ module SIS_transport
!< The control structure for the SIS thickness advection module

!>@{ Diagnostic IDs
integer :: id_ix_trans = -1, id_iy_trans = -1, id_xprt=-1
integer :: id_ix_trans = -1, id_iy_trans = -1, id_xprt = -1, id_rdgr = -1
! integer :: id_rdgo=-1, id_rdgv=-1 ! These do not exist yet
!!@}

end type SIS_transport_CS

contains
Expand All @@ -71,7 +74,7 @@ module SIS_transport
!> ice_transport - does ice transport and thickness class redistribution
subroutine ice_transport(part_sz, mH_ice, mH_snow, mH_pond, uc, vc, TrReg, &
dt_slow, G, IG, CS, rdg_hice, snow2ocn, &
rdg_rate, rdg_open, rdg_vosh)
rdg_rate)
type(SIS_hor_grid_type), intent(inout) :: G !< The horizontal grid type
type(ice_grid_type), intent(inout) :: IG !< The sea-ice specific grid type
real, dimension(SZI_(G),SZJ_(G),0:SZCAT_(IG)), &
Expand All @@ -96,9 +99,7 @@ subroutine ice_transport(part_sz, mH_ice, mH_snow, mH_pond, uc, vc, TrReg, &
real, dimension(SZI_(G),SZJ_(G),SZCAT_(IG)), &
intent(inout) :: rdg_hice !< The thickness of ridged ice, in kg m-2.
real, dimension(SZI_(G),SZJ_(G)), intent(inout) :: snow2ocn !< snow volume [m] dumped into ocean during ridging
real, dimension(SZI_(G),SZJ_(G)), intent(inout) :: rdg_rate !< The ice ridging rate in s-1.
real, dimension(SZI_(G),SZJ_(G)), intent(inout) :: rdg_open !< formation rate of open water due to ridging
real, dimension(SZI_(G),SZJ_(G)), intent(inout) :: rdg_vosh !< rate of ice volume shifted from level to ridged ice
real, dimension(SZI_(G),SZJ_(G)), optional, intent(in) :: rdg_rate !< The ice ridging rate in s-1.

! Local variables
real, dimension(:,:,:,:), &
Expand Down Expand Up @@ -128,6 +129,10 @@ subroutine ice_transport(part_sz, mH_ice, mH_snow, mH_pond, uc, vc, TrReg, &
mca0_ice, mca0_snow,& ! The initial mass of snow and ice per unit total
! area in a cell, in units of H (often kg m-2).
mca_pond, mca0_pond ! As for ice and snow above but for melt ponds, in H.
!### These will be needed when the ice ridging is properly implemented.
! real, dimension(SZI_(G),SZJ_(G)) :: &
! rdg_open, & ! formation rate of open water due to ridging
! rdg_vosh ! rate of ice mass shifted from level to ridged ice
real :: yr_dt ! Tne number of timesteps in a year.
real :: h_in_m ! The ice thickness in m.
real :: hca_in_m ! The ice thickness averaged over the whole cell in m.
Expand Down Expand Up @@ -272,8 +277,9 @@ subroutine ice_transport(part_sz, mH_ice, mH_snow, mH_pond, uc, vc, TrReg, &
call continuity(uc, vc, mca0_snow, mca_snow, uh_snow, vh_snow, dt_adv, G, IG, CS%continuity_CSp)
call continuity(uc, vc, mca0_pond, mca_pond, uh_pond, vh_pond, dt_adv, G, IG, CS%continuity_CSp)

call advect_scalar(mH_ice, mca0_ice, mca_ice, uh_ice, vh_ice, dt_adv, G, IG, CS%SIS_thick_adv_CSp)


call advect_scalar(mH_ice, mca0_ice, mca_ice, uh_ice, vh_ice, dt_adv, G, IG, CS%SIS_thick_adv_CSp)
call advect_SIS_tracers(mca0_ice, mca_ice, uh_ice, vh_ice, dt_adv, G, IG, &
CS%SIS_tr_adv_CSp, TrReg, snow_tr=.false.)
call advect_SIS_tracers(mca0_snow, mca_snow, uh_snow, vh_snow, dt_adv, G, IG, &
Expand Down Expand Up @@ -457,6 +463,17 @@ subroutine ice_transport(part_sz, mH_ice, mH_snow, mH_pond, uc, vc, TrReg, &
endif
if (CS%id_ix_trans>0) call post_SIS_data(CS%id_ix_trans, uf, CS%diag)
if (CS%id_iy_trans>0) call post_SIS_data(CS%id_iy_trans, vf, CS%diag)
if (CS%do_ridging) then
if (CS%id_rdgr>0 .and. present(rdg_rate)) &
call post_SIS_data(CS%id_rdgr, rdg_rate, CS%diag)
! if (CS%id_rdgo>0) call post_SIS_data(CS%id_rdgo, rdg_open, diag)
! if (CS%id_rdgv>0) then
! do j=jsc,jec ; do i=isc,iec
! tmp2d(i,j) = rdg_vosh(i,j) * G%areaT(i,j) * G%mask2dT(i,j)
! enddo ; enddo
! call post_SIS_data(CS%id_rdgv, tmp2d, diag)
! endif
endif

if (CS%bounds_check) &
call check_SIS_tracer_bounds(TrReg, G, IG, "At end of SIS_transport")
Expand Down Expand Up @@ -1137,8 +1154,15 @@ subroutine SIS_transport_init(Time, G, param_file, diag, CS)
CS%id_iy_trans = register_diag_field('ice_model', 'IY_TRANS', diag%axesCv1, Time, &
'y-direction ice transport', 'kg/s', missing_value=missing, &
interp_method='none')
CS%id_xprt = register_diag_field('ice_model','XPRT', diag%axesT1, Time, &
CS%id_xprt = register_diag_field('ice_model', 'XPRT', diag%axesT1, Time, &
'frozen water transport convergence', 'kg/(m^2*yr)', missing_value=missing)
CS%id_rdgr = register_diag_field('ice_model', 'RDG_RATE', diag%axesT1, Time, &
'ice ridging rate', '1/sec', missing_value=missing)
!### THESE DIAGNOSTICS DO NOT EXIST YET.
! CS%id_rdgo = register_diag_field('ice_model','RDG_OPEN' ,diag%axesT1, Time, &
! 'rate of opening due to ridging', '1/s', missing_value=missing)
! CS%id_rdgv = register_diag_field('ice_model','RDG_VOSH' ,diag%axesT1, Time, &
! 'volume shifted from level to ridged ice', 'm^3/s', missing_value=missing)

end subroutine SIS_transport_init

Expand Down

0 comments on commit 572fbc3

Please sign in to comment.