@@ -738,8 +738,8 @@ end subroutine column_conservation_check
738
738
! =======================================================================
739
739
740
740
! Cleanup subroutine that rebins thickness categories if necessary,
741
- ! eliminates very small ice areas while conserving mass and energy,
742
- ! aggregates state variables, and does a boundary call .
741
+ ! eliminates very small ice areas while conserving mass and energy
742
+ ! and aggregates state variables.
743
743
! It is a good idea to call this subroutine after the thermodynamics
744
744
! (thermo_vertical/thermo_itd) and again after the dynamics
745
745
! (evp/transport/ridging).
@@ -758,7 +758,8 @@ subroutine cleanup_itd (dt, hin_max, &
758
758
fpond , fresh , &
759
759
fsalt , fhocn , &
760
760
faero_ocn , fiso_ocn , &
761
- flux_bio , Tf , limit_aice_in )
761
+ flux_bio , Tf , &
762
+ limit_aice , dorebin )
762
763
763
764
real (kind= dbl_kind), intent (in ) :: &
764
765
dt ! time step
@@ -817,8 +818,9 @@ subroutine cleanup_itd (dt, hin_max, &
817
818
fiso_ocn ! isotope flux to ocean (kg/m^2/s)
818
819
819
820
logical (kind= log_kind), intent (in ), optional :: &
820
- limit_aice_in ! if false, allow aice to be out of bounds
821
- ! may want to allow this for unit tests
821
+ dorebin, & ! if false, do not call rebin (default true)
822
+ limit_aice ! if false, allow aice to be out of bounds
823
+ ! may want to allow this for unit tests (default true)
822
824
823
825
! local variables
824
826
@@ -842,18 +844,25 @@ subroutine cleanup_itd (dt, hin_max, &
842
844
dflux_bio ! zapped biology flux (mmol/m^2/s)
843
845
844
846
logical (kind= log_kind) :: &
845
- limit_aice ! if true, check for aice out of bounds
847
+ ldorebin , & ! if true, call rebin
848
+ llimit_aice ! if true, check for aice out of bounds
846
849
847
850
character (len=* ),parameter :: subname= ' (cleanup_itd)'
848
851
849
852
!- ----------------------------------------------------------------
850
853
! Initialize
851
854
!- ----------------------------------------------------------------
852
855
853
- if (present (limit_aice_in )) then
854
- limit_aice = limit_aice_in
856
+ if (present (limit_aice )) then
857
+ llimit_aice = limit_aice
855
858
else
856
- limit_aice = .true.
859
+ llimit_aice = .true.
860
+ endif
861
+
862
+ if (present (dorebin)) then
863
+ ldorebin = dorebin
864
+ else
865
+ ldorebin = .true.
857
866
endif
858
867
859
868
dfpond = c0
@@ -871,7 +880,7 @@ subroutine cleanup_itd (dt, hin_max, &
871
880
call aggregate_area (aicen, aice, aice0)
872
881
if (icepack_warnings_aborted(subname)) return
873
882
874
- if (limit_aice ) then ! check for aice out of bounds
883
+ if (llimit_aice ) then ! check for aice out of bounds
875
884
if (aice > c1+ puny .or. aice < - puny) then
876
885
call icepack_warnings_setabort(.true. ,__FILE__,__LINE__)
877
886
call icepack_warnings_add(subname// ' aggregate ice area out of bounds' )
@@ -883,13 +892,13 @@ subroutine cleanup_itd (dt, hin_max, &
883
892
enddo
884
893
return
885
894
endif
886
- endif ! limit_aice
895
+ endif ! llimit_aice
887
896
888
897
!- ----------------------------------------------------------------
889
898
! Identify grid cells with ice.
890
899
!- ----------------------------------------------------------------
891
900
892
- if (aice > puny) then
901
+ if (ldorebin .and. aice > puny) then
893
902
894
903
!- ----------------------------------------------------------------
895
904
! Make sure ice in each category is within its thickness bounds.
@@ -898,7 +907,7 @@ subroutine cleanup_itd (dt, hin_max, &
898
907
! correctly (e.g., very fast ice growth).
899
908
!- ----------------------------------------------------------------
900
909
901
- call rebin (trcr_depend, &
910
+ call rebin (trcr_depend, &
902
911
trcr_base, &
903
912
n_trcr_strata, &
904
913
nt_strata, &
@@ -913,7 +922,7 @@ subroutine cleanup_itd (dt, hin_max, &
913
922
! Zero out ice categories with very small areas.
914
923
!- ----------------------------------------------------------------
915
924
916
- if (limit_aice ) then
925
+ if (llimit_aice ) then
917
926
call zap_small_areas (dt, &
918
927
aice, aice0, &
919
928
aicen, trcrn, &
@@ -937,7 +946,7 @@ subroutine cleanup_itd (dt, hin_max, &
937
946
return
938
947
endif
939
948
940
- endif ! l_limit_aice
949
+ endif ! llimit_aice
941
950
942
951
!- ------------------------------------------------------------------
943
952
! Zap snow that has out of bounds temperatures
0 commit comments