Skip to content

Commit

Permalink
Need to figure out why answers changed
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Shao committed Oct 13, 2016
1 parent 4513996 commit 44d71c9
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 21 deletions.
7 changes: 4 additions & 3 deletions src/core/MOM.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2525,7 +2525,8 @@ subroutine initialize_MOM(Time, param_file, dirs, CS, Time_in)
cmor_long_name ="Sea Water Salinity")
endif

call offline_transport_init(param_file, CS%offline_CSp, CS%diabatic_CSp, G, GV)
call offline_transport_init(param_file, CS%offline_CSp, &
CS%diabatic_CSp%diabatic_aux_CSp, G, GV)
call register_diags_offline_transport(Time, CS%diag, CS%offline_CSp)


Expand Down Expand Up @@ -2830,7 +2831,7 @@ subroutine register_diags(Time, G, GV, CS, ADp)
'Layer Thickness before diabatic forcing', thickness_units, v_cell_method='sum')
CS%id_e_predia = register_diag_field('ocean_model', 'e_predia', diag%axesTi, Time, &
'Interface Heights before diabatic forcing', 'meter')
! if (CS%diabatic_first .and. (.not. CS%adiabatic)) then
if (CS%diabatic_first .and. (.not. CS%adiabatic)) then
CS%id_u_preale = register_diag_field('ocean_model', 'u_preale', diag%axesCuL, Time, &
'Zonal velocity before remapping', 'meter second-1')
CS%id_v_preale = register_diag_field('ocean_model', 'v_preale', diag%axesCvL, Time, &
Expand All @@ -2843,7 +2844,7 @@ subroutine register_diags(Time, G, GV, CS, ADp)
'Salinity before remapping', 'ppt')
CS%id_e_preale = register_diag_field('ocean_model', 'e_preale', diag%axesTi, Time, &
'Interface Heights before remapping', 'meter')
! endif
endif

if (CS%use_temperature) then
CS%id_T_predia = register_diag_field('ocean_model', 'temp_predia', diag%axesTL, Time, &
Expand Down
4 changes: 1 addition & 3 deletions src/parameterizations/vertical/MOM_diabatic_aux.F90
Original file line number Diff line number Diff line change
Expand Up @@ -839,7 +839,7 @@ subroutine applyBoundaryFluxesInOut(CS, G, GV, dt, fluxes, optics, h, tv, &
! Pen_SW_bnd and netMassOut
netSalt, & ! surface salt flux ( g(salt)/m2 for non-Bouss and ppt*H for Bouss )
nonpenSW ! non-downwelling SW, which is absorbed at ocean surface
real, dimension(SZI_(G), SZK_(G)) :: h2d, T2d, hloss
real, dimension(SZI_(G), SZK_(G)) :: h2d, T2d
real, dimension(SZI_(G), SZK_(G)) :: pen_TKE_2d, dSV_dT_2d
real, dimension(max(optics%nbands,1),SZI_(G)) :: Pen_SW_bnd
real, dimension(max(optics%nbands,1),SZI_(G),SZK_(G)) :: opacityBand
Expand Down Expand Up @@ -894,7 +894,6 @@ subroutine applyBoundaryFluxesInOut(CS, G, GV, dt, fluxes, optics, h, tv, &
do k=1,nz ; do i=is,ie
h2d(i,k) = h(i,j,k)
T2d(i,k) = tv%T(i,j,k)
hloss(i,k) = 0.0
do n=1,nsw
opacityBand(n,i,k) = (1.0 / GV%m_to_H)*optics%opacity_band(n,i,j,k)
enddo
Expand Down Expand Up @@ -1010,7 +1009,6 @@ subroutine applyBoundaryFluxesInOut(CS, G, GV, dt, fluxes, optics, h, tv, &
! Update state
hOld = h2d(i,k) ! Keep original thickness in hand
h2d(i,k) = h2d(i,k) + dThickness ! New thickness
hloss(i,k) = dThickness
if (h2d(i,k) > 0.0) then
if (calculate_energetics .and. (dThickness > 0.)) then
! Calculate the energy required to mix the newly added water over
Expand Down
13 changes: 3 additions & 10 deletions src/parameterizations/vertical/MOM_diabatic_driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ module MOM_diabatic_driver
integer :: id_Tdif_z = -1, id_Tadv_z = -1, id_Sdif_z = -1, id_Sadv_z = -1
integer :: id_Tdif = -1, id_Tadv = -1, id_Sdif = -1, id_Sadv = -1
integer :: id_MLD_003 = -1, id_MLD_0125 = -1, id_MLD_user = -1, id_mlotstsq = -1
integer :: id_subMLN2 = -1, id_brine_lay = -1, id_hloss_boundary
integer :: id_subMLN2 = -1, id_brine_lay = -1

integer :: id_diabatic_diff_temp_tend = -1
integer :: id_diabatic_diff_saln_tend = -1
Expand Down Expand Up @@ -777,7 +777,6 @@ subroutine diabatic(u, v, h, tv, fluxes, visc, ADp, CDp, dt, G, GV, CS)
(0.5*(h(i,j,k-1) + h(i,j,k)) + h_neglect)
eb(i,j,k-1) = eb(i,j,k-1) + Ent_int
ea(i,j,k) = ea(i,j,k) + Ent_int
! eb(i,j,k-1) = ea(i,j,k)
Kd_int(i,j,K) = Kd_int(i,j,K) + Kd_add_here

! for diagnostics
Expand Down Expand Up @@ -1138,12 +1137,8 @@ subroutine diabatic(u, v, h, tv, fluxes, visc, ADp, CDp, dt, G, GV, CS)
eatr(i,j,k) = eatr(i,j,k) + add_ent
endif ; endif
enddo ; enddo

if (CS%useALEalgorithm) then
do i=is,ie ; eatr(i,j,1) = ea(i,j,1) ; enddo
else
do i=is,ie ; eatr(i,j,1) = ea(i,j,1) ; enddo
endif
do i=is,ie ; eatr(i,j,1) = ea(i,j,1) ; enddo

enddo

if (CS%useALEalgorithm) then
Expand Down Expand Up @@ -1938,8 +1933,6 @@ subroutine diabatic_driver_init(Time, G, GV, param_file, useALEalgorithm, diag,
'Layer entrainment from above per timestep','meter')
CS%id_eb = register_diag_field('ocean_model','eb',diag%axesTL,Time, &
'Layer entrainment from below per timestep', 'meter')
CS%id_hloss_boundary = register_diag_field('ocean_model','hloss_boundary',diag%axesTL,Time, &
'Layer thickness lost/gained due to fluxes at the boundary', 'meter')
CS%id_dudt_dia = register_diag_field('ocean_model','dudt_dia',diag%axesCuL,Time, &
'Zonal Acceleration from Diapycnal Mixing', 'meter second-2')
CS%id_dvdt_dia = register_diag_field('ocean_model','dvdt_dia',diag%axesCvL,Time, &
Expand Down
10 changes: 5 additions & 5 deletions src/tracer/MOM_offline_control.F90
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module MOM_offline_transport
use MOM_shortwave_abs, only : optics_type
use MOM_diag_mediator, only : post_data
use MOM_forcing_type, only : forcing
use MOM_diabatic_driver, only : diabatic_CS
use MOM_diabatic_aux, only : diabatic_aux_CS

implicit none

Expand Down Expand Up @@ -228,11 +228,11 @@ end subroutine register_diags_offline_transport

! Initializes the control structure for offline transport and reads in some of the
! run time parameters from MOM_input
subroutine offline_transport_init(param_file, CS, diabatic_CSp, G, GV)
subroutine offline_transport_init(param_file, CS, diabatic_aux_CSp, G, GV)

type(param_file_type), intent(in) :: param_file
type(offline_transport_CS), pointer, intent(inout) :: CS
type(diabatic_CS), pointer, intent(in) :: diabatic_CSp
type(diabatic_aux_CS), pointer, intent(in) :: diabatic_aux_CSp
type(ocean_grid_type), intent(in) :: G
type(verticalGrid_type), intent(in) :: GV

Expand Down Expand Up @@ -285,8 +285,8 @@ subroutine offline_transport_init(param_file, CS, diabatic_CSp, G, GV)
if(.not. CS%fields_are_offset) CS%ridx_snap = CS%start_index

! Copy over parameters from other control structures
CS%evap_CFL_limit = diabatic_CSp%diabatic_aux_CSp%evap_CFL_limit
CS%minimum_forcing_depth = diabatic_CSp%diabatic_aux_CSp%minimum_forcing_depth
CS%evap_CFL_limit = diabatic_aux_CSp%evap_CFL_limit
CS%minimum_forcing_depth = diabatic_aux_CSp%minimum_forcing_depth

call callTree_leave("offline_transport_init")

Expand Down

0 comments on commit 44d71c9

Please sign in to comment.