@@ -195,7 +195,6 @@ module MOM
195195 ! ! bottom drag viscosities, and related fields
196196 type (MEKE_type), pointer :: MEKE = > NULL () ! < structure containing fields
197197 ! ! related to the Mesoscale Eddy Kinetic Energy
198-
199198 logical :: adiabatic ! < If true, there are no diapycnal mass fluxes, and no calls
200199 ! ! to routines to calculate or apply diapycnal fluxes.
201200 logical :: use_legacy_diabatic_driver! < If true (default), use the a legacy version of the
@@ -526,6 +525,8 @@ subroutine step_MOM(forces, fluxes, sfc_state, Time_start, time_interval, CS, &
526525
527526 if (therm_reset) then
528527 CS% time_in_thermo_cycle = 0.0
528+ ! GMM
529+ if (allocated (sfc_state% melt_potential)) sfc_state% melt_potential(:,:) = 0.0
529530 if (associated (CS% tv% frazil)) CS% tv% frazil(:,:) = 0.0
530531 if (associated (CS% tv% salt_deficit)) CS% tv% salt_deficit(:,:) = 0.0
531532 if (associated (CS% tv% TempxPmE)) CS% tv% TempxPmE(:,:) = 0.0
@@ -807,7 +808,7 @@ subroutine step_MOM(forces, fluxes, sfc_state, Time_start, time_interval, CS, &
807808 endif
808809
809810 if (showCallTree) call callTree_waypoint(" calling extract_surface_state (step_MOM)" )
810- call extract_surface_state(CS, sfc_state, dt )
811+ call extract_surface_state(CS, sfc_state, dt_therm )
811812
812813 ! Do diagnostics that only occur at the end of a complete forcing step.
813814 if (cycle_end) then
@@ -2815,15 +2816,17 @@ subroutine extract_surface_state(CS, sfc_state, dt)
28152816 ! $OMP parallel do default(shared)
28162817 do j= js,je ; do i= is,ie
28172818 ! set melt_potential to zero to avoid passing values set previously
2818- sfc_state % melt_potential (i,j) = 0.0
2819- ! calculate freezing temp.
2820- call calculate_TFreeze(sfc_state% SSS(i,j), CS % tv % P_Ref , T_freeze, CS% tv% eqn_of_state)
2819+ if (G % mask2dT (i,j)> 0 .) then
2820+ ! calculate freezing pot. temp. @ surface
2821+ call calculate_TFreeze(sfc_state% SSS(i,j), 0.0 , T_freeze, CS% tv% eqn_of_state)
28212822 if (present (dt)) then
2822- ! melt_potential, in W/m^2
2823- sfc_state% melt_potential(i,j) = CS% tv% C_p * CS% GV% Rho0 * (sfc_state% SST(i,j) - T_freeze) * sfc_state% Hml(i,j)/ dt
2823+ ! time accumulated melt_potential, in J/m^2
2824+ sfc_state% melt_potential(i,j) = sfc_state% melt_potential(i,j) + (CS% tv% C_p * CS% GV% Rho0 * &
2825+ (sfc_state% SST(i,j) - T_freeze) * CS% Hmix)
28242826 else
28252827 sfc_state% melt_potential(i,j) = 0.0
28262828 endif
2829+ endif ! G%mask2dT
28272830 enddo ; enddo
28282831 endif
28292832
0 commit comments