@@ -861,8 +861,8 @@ subroutine step_MOM(forces_in, fluxes_in, sfc_state, Time_start, time_int_in, CS
861
861
call step_MOM_thermo(CS, G, GV, US, u, v, h, CS% tv, fluxes, dtdia, &
862
862
end_time_thermo, .true. , Waves= Waves)
863
863
if ( CS% use_ALE_algorithm ) &
864
- call ALE_gridgen_and_remapping (CS, G, GV, US, u, v, h, CS% tv, dtdia, Time_local)
865
- call update_tracers_after_ALE (CS, G, GV, US, u, v, h, CS% tv)
864
+ call ALE_regridding_and_remapping (CS, G, GV, US, u, v, h, CS% tv, dtdia, Time_local)
865
+ call post_diabatic_halo_updates (CS, G, GV, US, u, v, h, CS% tv)
866
866
CS% time_in_thermo_cycle = CS% time_in_thermo_cycle + dtdia
867
867
868
868
! The diabatic processes are now ahead of the dynamics by dtdia.
@@ -967,8 +967,8 @@ subroutine step_MOM(forces_in, fluxes_in, sfc_state, Time_start, time_int_in, CS
967
967
call step_MOM_thermo(CS, G, GV, US, u, v, h, CS% tv, fluxes, dtdia, &
968
968
Time_local, .false. , Waves= Waves)
969
969
if ( CS% use_ALE_algorithm ) &
970
- call ALE_gridgen_and_remapping (CS, G, GV, US, u, v, h, CS% tv, dtdia, Time_local)
971
- call update_tracers_after_ALE (CS, G, GV, US, u, v, h, CS% tv)
970
+ call ALE_regridding_and_remapping (CS, G, GV, US, u, v, h, CS% tv, dtdia, Time_local)
971
+ call post_diabatic_halo_updates (CS, G, GV, US, u, v, h, CS% tv)
972
972
CS% time_in_thermo_cycle = CS% time_in_thermo_cycle + dtdia
973
973
974
974
if ((CS% t_dyn_rel_thermo== 0.0 ) .and. .not. do_dyn) then
@@ -1519,7 +1519,7 @@ subroutine step_MOM_tracer_dyn(CS, G, GV, US, h, Time_local)
1519
1519
end subroutine step_MOM_tracer_dyn
1520
1520
1521
1521
! > MOM_step_thermo orchestrates the thermodynamic time stepping and vertical
1522
- ! ! remapping, via calls to diabatic (or adiabatic) and ALE_regrid .
1522
+ ! ! remapping, via calls to diabatic (or adiabatic).
1523
1523
subroutine step_MOM_thermo (CS , G , GV , US , u , v , h , tv , fluxes , dtdia , &
1524
1524
Time_end_thermo , update_BBL , Waves )
1525
1525
type (MOM_control_struct), intent (inout ) :: CS ! < Master MOM control structure
@@ -1667,7 +1667,9 @@ subroutine step_MOM_thermo(CS, G, GV, US, u, v, h, tv, fluxes, dtdia, &
1667
1667
1668
1668
end subroutine step_MOM_thermo
1669
1669
1670
- subroutine ALE_gridgen_and_remapping (CS , G , GV , US , u , v , h , tv , dtdia , Time_end_thermo )
1670
+ ! > ALE_regridding_and_remapping does regridding (the generation of a new grid) and remapping
1671
+ ! (from the old grid to the new grid). This is done after the themrodynamic step.
1672
+ subroutine ALE_regridding_and_remapping (CS , G , GV , US , u , v , h , tv , dtdia , Time_end_thermo )
1671
1673
type (MOM_control_struct), intent (inout ) :: CS ! < Master MOM control structure
1672
1674
type (ocean_grid_type), intent (inout ) :: G ! < ocean grid structure
1673
1675
type (verticalGrid_type), intent (inout ) :: GV ! < ocean vertical grid structure
@@ -1704,7 +1706,7 @@ subroutine ALE_gridgen_and_remapping(CS, G, GV, US, u, v, h, tv, dtdia, Time_end
1704
1706
1705
1707
is = G% isc ; ie = G% iec ; js = G% jsc ; je = G% jec ; nz = GV% ke
1706
1708
showCallTree = callTree_showQuery()
1707
- if (showCallTree) call callTree_enter(" ALE_gridgen_and_remapping (), MOM.F90" )
1709
+ if (showCallTree) call callTree_enter(" ALE_regridding_and_remapping (), MOM.F90" )
1708
1710
if (CS% debug) call query_debugging_checks(do_redundant= debug_redundant)
1709
1711
1710
1712
call cpu_clock_begin(id_clock_remap)
@@ -1793,12 +1795,16 @@ subroutine ALE_gridgen_and_remapping(CS, G, GV, US, u, v, h, tv, dtdia, Time_end
1793
1795
h(i,j,k) = h_new(i,j,k)
1794
1796
enddo ; enddo ; enddo
1795
1797
1798
+ if (showCallTree) call callTree_waypoint(" finished ALE_regrid (ALE_regridding_and_remapping)" )
1799
+ call cpu_clock_end(id_clock_ALE)
1800
+
1801
+ ! Whenever thickness changes let the diag manager know, target grids
1802
+ ! for vertical remapping may need to be regenerated. This needs to
1803
+ ! happen after the H update and before the next post_data.
1796
1804
call diag_update_remap_grids(CS% diag)
1805
+
1797
1806
call postALE_tracer_diagnostics(CS% tracer_Reg, G, GV, CS% diag, dtdia)
1798
1807
1799
- if (showCallTree) call callTree_waypoint(" finished ALE_regrid (step_MOM_thermo)" )
1800
- call cpu_clock_end(id_clock_ALE)
1801
- ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1802
1808
if (CS% debug .and. CS% use_ALE_algorithm) then
1803
1809
call MOM_state_chksum(" Post-ALE " , u, v, h, CS% uh, CS% vh, G, GV, US)
1804
1810
call hchksum(tv% T, " Post-ALE T" , G% HI, haloshift= 1 , unscale= US% C_to_degC)
@@ -1827,11 +1833,14 @@ subroutine ALE_gridgen_and_remapping(CS, G, GV, US, u, v, h, tv, dtdia, Time_end
1827
1833
1828
1834
call cpu_clock_end(id_clock_remap)
1829
1835
1830
- if (showCallTree) call callTree_leave(" ALE_gridgen_and_remapping (), MOM.F90" )
1836
+ if (showCallTree) call callTree_leave(" ALE_regridding_and_remapping (), MOM.F90" )
1831
1837
1832
- end subroutine ALE_gridgen_and_remapping
1838
+ end subroutine ALE_regridding_and_remapping
1833
1839
1834
- subroutine update_tracers_after_ALE (CS , G , GV , US , u , v , h , tv )
1840
+ ! > post_diabatic_halo_updates does halo updates and calculates derived thermodynamic quantities
1841
+ ! (e.g. specific volume). This must be done after the diabatic step regardless of is ALE
1842
+ ! cooridinates are used or not.
1843
+ subroutine post_diabatic_halo_updates (CS , G , GV , US , u , v , h , tv )
1835
1844
type (MOM_control_struct), intent (inout ) :: CS ! < Master MOM control structure
1836
1845
type (ocean_grid_type), intent (inout ) :: G ! < ocean grid structure
1837
1846
type (verticalGrid_type), intent (inout ) :: GV ! < ocean vertical grid structure
@@ -1873,7 +1882,7 @@ subroutine update_tracers_after_ALE(CS, G, GV, US, u, v, h, tv)
1873
1882
if (allocated (tv% SpV_avg)) then
1874
1883
call calc_derived_thermo(tv, h, G, GV, US, halo= dynamics_stencil, debug= CS% debug)
1875
1884
endif
1876
- end subroutine update_tracers_after_ALE
1885
+ end subroutine post_diabatic_halo_updates
1877
1886
1878
1887
! > step_offline is the main driver for running tracers offline in MOM6. This has been primarily
1879
1888
! ! developed with ALE configurations in mind. Some work has been done in isopycnal configuration, but
0 commit comments