@@ -882,8 +882,8 @@ subroutine step_MOM(forces_in, fluxes_in, sfc_state, Time_start, time_int_in, CS
882
882
call step_MOM_thermo(CS, G, GV, US, u, v, h, CS% tv, fluxes, dtdia, &
883
883
end_time_thermo, .true. , Waves= Waves)
884
884
if ( CS% use_ALE_algorithm ) &
885
- call ALE_gridgen_and_remapping (CS, G, GV, US, u, v, h, CS% tv, dtdia, Time_local)
886
- call update_tracers_after_ALE (CS, G, GV, US, u, v, h, CS% tv)
885
+ call ALE_regridding_and_remapping (CS, G, GV, US, u, v, h, CS% tv, dtdia, Time_local)
886
+ call post_diabatic_halo_updates (CS, G, GV, US, u, v, h, CS% tv)
887
887
CS% time_in_thermo_cycle = CS% time_in_thermo_cycle + dtdia
888
888
889
889
! The diabatic processes are now ahead of the dynamics by dtdia.
@@ -997,8 +997,8 @@ subroutine step_MOM(forces_in, fluxes_in, sfc_state, Time_start, time_int_in, CS
997
997
call step_MOM_thermo(CS, G, GV, US, u, v, h, CS% tv, fluxes, dtdia, &
998
998
Time_local, .false. , Waves= Waves)
999
999
if ( CS% use_ALE_algorithm ) &
1000
- call ALE_gridgen_and_remapping (CS, G, GV, US, u, v, h, CS% tv, dtdia, Time_local)
1001
- call update_tracers_after_ALE (CS, G, GV, US, u, v, h, CS% tv)
1000
+ call ALE_regridding_and_remapping (CS, G, GV, US, u, v, h, CS% tv, dtdia, Time_local)
1001
+ call post_diabatic_halo_updates (CS, G, GV, US, u, v, h, CS% tv)
1002
1002
CS% time_in_thermo_cycle = CS% time_in_thermo_cycle + dtdia
1003
1003
1004
1004
if ((CS% t_dyn_rel_thermo== 0.0 ) .and. .not. do_dyn) then
@@ -1563,7 +1563,7 @@ subroutine step_MOM_tracer_dyn(CS, G, GV, US, h, Time_local)
1563
1563
end subroutine step_MOM_tracer_dyn
1564
1564
1565
1565
! > MOM_step_thermo orchestrates the thermodynamic time stepping and vertical
1566
- ! ! remapping, via calls to diabatic (or adiabatic) and ALE_regrid .
1566
+ ! ! remapping, via calls to diabatic (or adiabatic).
1567
1567
subroutine step_MOM_thermo (CS , G , GV , US , u , v , h , tv , fluxes , dtdia , &
1568
1568
Time_end_thermo , update_BBL , Waves )
1569
1569
type (MOM_control_struct), intent (inout ) :: CS ! < Master MOM control structure
@@ -1711,7 +1711,9 @@ subroutine step_MOM_thermo(CS, G, GV, US, u, v, h, tv, fluxes, dtdia, &
1711
1711
1712
1712
end subroutine step_MOM_thermo
1713
1713
1714
- subroutine ALE_gridgen_and_remapping (CS , G , GV , US , u , v , h , tv , dtdia , Time_end_thermo )
1714
+ ! > ALE_regridding_and_remapping does regridding (the generation of a new grid) and remapping
1715
+ ! (from the old grid to the new grid). This is done after the themrodynamic step.
1716
+ subroutine ALE_regridding_and_remapping (CS , G , GV , US , u , v , h , tv , dtdia , Time_end_thermo )
1715
1717
type (MOM_control_struct), intent (inout ) :: CS ! < Master MOM control structure
1716
1718
type (ocean_grid_type), intent (inout ) :: G ! < ocean grid structure
1717
1719
type (verticalGrid_type), intent (inout ) :: GV ! < ocean vertical grid structure
@@ -1748,7 +1750,7 @@ subroutine ALE_gridgen_and_remapping(CS, G, GV, US, u, v, h, tv, dtdia, Time_end
1748
1750
1749
1751
is = G% isc ; ie = G% iec ; js = G% jsc ; je = G% jec ; nz = GV% ke
1750
1752
showCallTree = callTree_showQuery()
1751
- if (showCallTree) call callTree_enter(" ALE_gridgen_and_remapping (), MOM.F90" )
1753
+ if (showCallTree) call callTree_enter(" ALE_regridding_and_remapping (), MOM.F90" )
1752
1754
if (CS% debug) call query_debugging_checks(do_redundant= debug_redundant)
1753
1755
1754
1756
call cpu_clock_begin(id_clock_remap)
@@ -1837,12 +1839,16 @@ subroutine ALE_gridgen_and_remapping(CS, G, GV, US, u, v, h, tv, dtdia, Time_end
1837
1839
h(i,j,k) = h_new(i,j,k)
1838
1840
enddo ; enddo ; enddo
1839
1841
1842
+ if (showCallTree) call callTree_waypoint(" finished ALE_regrid (ALE_regridding_and_remapping)" )
1843
+ call cpu_clock_end(id_clock_ALE)
1844
+
1845
+ ! Whenever thickness changes let the diag manager know, target grids
1846
+ ! for vertical remapping may need to be regenerated. This needs to
1847
+ ! happen after the H update and before the next post_data.
1840
1848
call diag_update_remap_grids(CS% diag)
1849
+
1841
1850
call postALE_tracer_diagnostics(CS% tracer_Reg, G, GV, CS% diag, dtdia)
1842
1851
1843
- if (showCallTree) call callTree_waypoint(" finished ALE_regrid (step_MOM_thermo)" )
1844
- call cpu_clock_end(id_clock_ALE)
1845
- ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1846
1852
if (CS% debug .and. CS% use_ALE_algorithm) then
1847
1853
call MOM_state_chksum(" Post-ALE " , u, v, h, CS% uh, CS% vh, G, GV, US)
1848
1854
call hchksum(tv% T, " Post-ALE T" , G% HI, haloshift= 1 , unscale= US% C_to_degC)
@@ -1871,11 +1877,14 @@ subroutine ALE_gridgen_and_remapping(CS, G, GV, US, u, v, h, tv, dtdia, Time_end
1871
1877
1872
1878
call cpu_clock_end(id_clock_remap)
1873
1879
1874
- if (showCallTree) call callTree_leave(" ALE_gridgen_and_remapping (), MOM.F90" )
1880
+ if (showCallTree) call callTree_leave(" ALE_regridding_and_remapping (), MOM.F90" )
1875
1881
1876
- end subroutine ALE_gridgen_and_remapping
1882
+ end subroutine ALE_regridding_and_remapping
1877
1883
1878
- subroutine update_tracers_after_ALE (CS , G , GV , US , u , v , h , tv )
1884
+ ! > post_diabatic_halo_updates does halo updates and calculates derived thermodynamic quantities
1885
+ ! (e.g. specific volume). This must be done after the diabatic step regardless of is ALE
1886
+ ! cooridinates are used or not.
1887
+ subroutine post_diabatic_halo_updates (CS , G , GV , US , u , v , h , tv )
1879
1888
type (MOM_control_struct), intent (inout ) :: CS ! < Master MOM control structure
1880
1889
type (ocean_grid_type), intent (inout ) :: G ! < ocean grid structure
1881
1890
type (verticalGrid_type), intent (inout ) :: GV ! < ocean vertical grid structure
@@ -1917,7 +1926,7 @@ subroutine update_tracers_after_ALE(CS, G, GV, US, u, v, h, tv)
1917
1926
if (allocated (tv% SpV_avg)) then
1918
1927
call calc_derived_thermo(tv, h, G, GV, US, halo= dynamics_stencil, debug= CS% debug)
1919
1928
endif
1920
- end subroutine update_tracers_after_ALE
1929
+ end subroutine post_diabatic_halo_updates
1921
1930
1922
1931
! > step_offline is the main driver for running tracers offline in MOM6. This has been primarily
1923
1932
! ! developed with ALE configurations in mind. Some work has been done in isopycnal configuration, but
0 commit comments