diff --git a/columnphysics/icepack_itd.F90 b/columnphysics/icepack_itd.F90 index 1870ec4a..013373ad 100644 --- a/columnphysics/icepack_itd.F90 +++ b/columnphysics/icepack_itd.F90 @@ -738,8 +738,8 @@ end subroutine column_conservation_check !======================================================================= ! Cleanup subroutine that rebins thickness categories if necessary, -! eliminates very small ice areas while conserving mass and energy, -! aggregates state variables, and does a boundary call. +! eliminates very small ice areas while conserving mass and energy +! and aggregates state variables. ! It is a good idea to call this subroutine after the thermodynamics ! (thermo_vertical/thermo_itd) and again after the dynamics ! (evp/transport/ridging). @@ -758,7 +758,8 @@ subroutine cleanup_itd (dt, hin_max, & fpond, fresh, & fsalt, fhocn, & faero_ocn, fiso_ocn, & - flux_bio, Tf, limit_aice_in) + flux_bio, Tf, & + limit_aice, dorebin) real (kind=dbl_kind), intent(in) :: & dt ! time step @@ -817,8 +818,9 @@ subroutine cleanup_itd (dt, hin_max, & fiso_ocn ! isotope flux to ocean (kg/m^2/s) logical (kind=log_kind), intent(in), optional :: & - limit_aice_in ! if false, allow aice to be out of bounds - ! may want to allow this for unit tests + dorebin, & ! if false, do not call rebin (default true) + limit_aice ! if false, allow aice to be out of bounds + ! may want to allow this for unit tests (default true) ! local variables @@ -842,7 +844,8 @@ subroutine cleanup_itd (dt, hin_max, & dflux_bio ! zapped biology flux (mmol/m^2/s) logical (kind=log_kind) :: & - limit_aice ! if true, check for aice out of bounds + ldorebin , & ! if true, call rebin + llimit_aice ! if true, check for aice out of bounds character(len=*),parameter :: subname='(cleanup_itd)' @@ -850,10 +853,16 @@ subroutine cleanup_itd (dt, hin_max, & ! Initialize !----------------------------------------------------------------- - if (present(limit_aice_in)) then - limit_aice = limit_aice_in + if (present(limit_aice)) then + llimit_aice = limit_aice else - limit_aice = .true. + llimit_aice = .true. + endif + + if (present(dorebin)) then + ldorebin = dorebin + else + ldorebin = .true. endif dfpond = c0 @@ -871,7 +880,7 @@ subroutine cleanup_itd (dt, hin_max, & call aggregate_area (aicen, aice, aice0) if (icepack_warnings_aborted(subname)) return - if (limit_aice) then ! check for aice out of bounds + if (llimit_aice) then ! check for aice out of bounds if (aice > c1+puny .or. aice < -puny) then call icepack_warnings_setabort(.true.,__FILE__,__LINE__) call icepack_warnings_add(subname//' aggregate ice area out of bounds') @@ -883,13 +892,13 @@ subroutine cleanup_itd (dt, hin_max, & enddo return endif - endif ! limit_aice + endif ! llimit_aice !----------------------------------------------------------------- ! Identify grid cells with ice. !----------------------------------------------------------------- - if (aice > puny) then + if (ldorebin .and. aice > puny) then !----------------------------------------------------------------- ! Make sure ice in each category is within its thickness bounds. @@ -898,7 +907,7 @@ subroutine cleanup_itd (dt, hin_max, & ! correctly (e.g., very fast ice growth). !----------------------------------------------------------------- - call rebin (trcr_depend, & + call rebin (trcr_depend, & trcr_base, & n_trcr_strata, & nt_strata, & @@ -913,7 +922,7 @@ subroutine cleanup_itd (dt, hin_max, & ! Zero out ice categories with very small areas. !----------------------------------------------------------------- - if (limit_aice) then + if (llimit_aice) then call zap_small_areas (dt, & aice, aice0, & aicen, trcrn, & @@ -937,7 +946,7 @@ subroutine cleanup_itd (dt, hin_max, & return endif - endif ! l_limit_aice + endif ! llimit_aice !------------------------------------------------------------------- ! Zap snow that has out of bounds temperatures diff --git a/columnphysics/icepack_mechred.F90 b/columnphysics/icepack_mechred.F90 index 6205b581..70766cc6 100644 --- a/columnphysics/icepack_mechred.F90 +++ b/columnphysics/icepack_mechred.F90 @@ -1740,7 +1740,9 @@ subroutine icepack_step_ridge(dt, ndtd, & araftn, vraftn, & aice, fsalt, & first_ice, fzsal, & - flux_bio, closing, Tf ) + flux_bio, closing, & + Tf, & + docleanup, dorebin) real (kind=dbl_kind), intent(in) :: & dt ! time step @@ -1815,6 +1817,10 @@ subroutine icepack_step_ridge(dt, ndtd, & logical (kind=log_kind), dimension(:), intent(inout) :: & first_ice ! true until ice forms + logical (kind=log_kind), intent(in), optional :: & + docleanup, & ! if false, do not call cleanup_itd (default true) + dorebin ! if false, do not call rebin in cleanup_itd (default true) + !autodocument_end ! local variables @@ -1822,6 +1828,10 @@ subroutine icepack_step_ridge(dt, ndtd, & real (kind=dbl_kind) :: & dtt ! thermo time step + logical (kind=log_kind) :: & + ldocleanup, &! if true, call cleanup_itd + ldorebin ! if true, call rebin in cleanup_itd + logical (kind=log_kind), save :: & first_call = .true. ! first call flag @@ -1841,6 +1851,17 @@ subroutine icepack_step_ridge(dt, ndtd, & endif endif + if (present(docleanup)) then + ldocleanup = docleanup + else + ldocleanup = .true. + endif + + if (present(dorebin)) then + ldorebin = dorebin + else + ldorebin = .true. + endif !----------------------------------------------------------------- ! Identify ice-ocean cells. @@ -1880,8 +1901,9 @@ subroutine icepack_step_ridge(dt, ndtd, & ! categories with very small areas. !----------------------------------------------------------------- - dtt = dt * ndtd ! for proper averaging over thermo timestep - call cleanup_itd (dtt, hin_max, & + if (ldocleanup) then + dtt = dt * ndtd ! for proper averaging over thermo timestep + call cleanup_itd(dtt, hin_max, & aicen, trcrn, & vicen, vsnon, & aice0, aice, & @@ -1893,8 +1915,10 @@ subroutine icepack_step_ridge(dt, ndtd, & fpond, fresh, & fsalt, fhocn, & faero_ocn, fiso_ocn, & - flux_bio, Tf) - if (icepack_warnings_aborted(subname)) return + flux_bio, Tf, & + dorebin = ldorebin) + if (icepack_warnings_aborted(subname)) return + endif first_call = .false. diff --git a/doc/source/user_guide/interfaces.include b/doc/source/user_guide/interfaces.include index a1838537..ae640d1b 100644 --- a/doc/source/user_guide/interfaces.include +++ b/doc/source/user_guide/interfaces.include @@ -497,7 +497,9 @@ icepack_step_ridge araftn, vraftn, & aice, fsalt, & first_ice, fzsal, & - flux_bio, closing, Tf ) + flux_bio, closing, & + Tf, & + docleanup, dorebin) real (kind=dbl_kind), intent(in) :: & dt ! time step @@ -572,6 +574,10 @@ icepack_step_ridge logical (kind=log_kind), dimension(:), intent(inout) :: & first_ice ! true until ice forms + logical (kind=log_kind), intent(in), optional :: & + docleanup, & ! if false, do not call cleanup_itd (default true) + dorebin ! if false, do not call rebin in cleanup_itd (default true) + icepack_mushy_physics.F90