@@ -195,7 +195,6 @@ module MOM
195
195
! ! bottom drag viscosities, and related fields
196
196
type (MEKE_type), pointer :: MEKE = > NULL () ! < structure containing fields
197
197
! ! related to the Mesoscale Eddy Kinetic Energy
198
-
199
198
logical :: adiabatic ! < If true, there are no diapycnal mass fluxes, and no calls
200
199
! ! to routines to calculate or apply diapycnal fluxes.
201
200
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, &
526
525
527
526
if (therm_reset) then
528
527
CS% time_in_thermo_cycle = 0.0
528
+ ! GMM
529
+ if (allocated (sfc_state% melt_potential)) sfc_state% melt_potential(:,:) = 0.0
529
530
if (associated (CS% tv% frazil)) CS% tv% frazil(:,:) = 0.0
530
531
if (associated (CS% tv% salt_deficit)) CS% tv% salt_deficit(:,:) = 0.0
531
532
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, &
807
808
endif
808
809
809
810
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 )
811
812
812
813
! Do diagnostics that only occur at the end of a complete forcing step.
813
814
if (cycle_end) then
@@ -2815,15 +2816,17 @@ subroutine extract_surface_state(CS, sfc_state, dt)
2815
2816
! $OMP parallel do default(shared)
2816
2817
do j= js,je ; do i= is,ie
2817
2818
! 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)
2821
2822
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)
2824
2826
else
2825
2827
sfc_state% melt_potential(i,j) = 0.0
2826
2828
endif
2829
+ endif ! G%mask2dT
2827
2830
enddo ; enddo
2828
2831
endif
2829
2832
0 commit comments