Skip to content

Commit

Permalink
Merge branch 'dev/gfdl' into alternate_first_direction
Browse files Browse the repository at this point in the history
  • Loading branch information
Hallberg-NOAA committed Sep 24, 2021
2 parents 4bf730a + 41947ab commit f57f608
Show file tree
Hide file tree
Showing 67 changed files with 1,033 additions and 1,137 deletions.
2 changes: 2 additions & 0 deletions docs/parameterizations_lateral.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,6 @@ Tidal forcing
-------------

Astronomical tidal forcings and self-attraction and loading are implement in MOM_tidal_forcing.
Tides can also be added via an open boundary tidal specification,
see [OBC wiki page](https://github.com/NOAA-GFDL/MOM6-examples/wiki/Open-Boundary-Conditions).

5 changes: 2 additions & 3 deletions docs/parameterizations_vertical.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,12 @@ Interior and bottom-driven mixing
Kappa-shear
MOM_kappa_shear implements the shear-driven mixing of :cite:`jackson2008`.

:ref:`Internal_Shear_Mixing`

Internal-tide driven mixing

The schemes of :cite:`st_laurent2002`, :cite:`polzin2009`, and :cite:`melet2012`, are all implemented through MOM_set_diffusivity and MOM_diabatic_driver.

:ref:`Internal_Tidal_Mixing`
:ref:`Internal_Vert_Mixing`


Vertical friction
-----------------
Expand Down
13 changes: 11 additions & 2 deletions docs/zotero.bib
Original file line number Diff line number Diff line change
Expand Up @@ -1728,7 +1728,7 @@ @article{adcroft2006
pages = {224--233}
}

@article{adcroft2004,
@article{adcroft2004-1,
title = {Rescaled height coordinates for accurate representation of free-surface flows in ocean circulation models},
volume = {7},
issn = {1463-5003},
Expand Down Expand Up @@ -2308,7 +2308,7 @@ @article{carpenter1990
doi = {https://doi.org/10.1175/1520-0493(1990)118<0586:AOTPPM>2.0.CO;2}
}

@article{kasahara1974,
@article{kasahara1974-1,
title = {Various {Vertical} {Coordinate} {Systems} {Used} for {Numerical} {Weather} {Prediction}},
volume = {102},
issn = {0027-0644},
Expand Down Expand Up @@ -2675,3 +2675,12 @@ @article{bryan1979
journal = {J. Geophys. Res.}
}

@techreport{griffies2015a,
author = {S. M. Griffies and M. Levy and A. J. Adcroft and G. Danabasoglu and R.
W. Hallberg and D. Jacobsen and W. Large and T. Ringler},
title = {Theory and Numerics of the Community Ocean Vertical Mixing (CVMix)
Project},
year = {2015},
pages = {98 pp},
institution = {NOAA GFDL}
}
4 changes: 2 additions & 2 deletions src/ALE/MOM_regridding.F90
Original file line number Diff line number Diff line change
Expand Up @@ -477,10 +477,10 @@ subroutine initialize_regridding(CS, GV, US, max_depth, param_file, mdl, coord_m
CS%nk=ke

! Target resolution (for fixed coordinates)
allocate( CS%coordinateResolution(CS%nk) ); CS%coordinateResolution(:) = -1.E30
allocate( CS%coordinateResolution(CS%nk), source=-1.E30 )
if (state_dependent(CS%regridding_scheme)) then
! Target values
allocate( CS%target_density(CS%nk+1) ); CS%target_density(:) = -1.E30*US%kg_m3_to_R
allocate( CS%target_density(CS%nk+1), source=-1.E30*US%kg_m3_to_R )
endif

if (allocated(dz)) then
Expand Down
50 changes: 17 additions & 33 deletions src/core/MOM.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2258,16 +2258,10 @@ subroutine initialize_MOM(Time, Time_init, param_file, dirs, CS, restart_CSp, &
endif
endif

if (use_frazil) then
allocate(CS%tv%frazil(isd:ied,jsd:jed)) ; CS%tv%frazil(:,:) = 0.0
endif
if (bound_salinity) then
allocate(CS%tv%salt_deficit(isd:ied,jsd:jed)) ; CS%tv%salt_deficit(:,:) = 0.0
endif
if (use_frazil) allocate(CS%tv%frazil(isd:ied,jsd:jed), source=0.0)
if (bound_salinity) allocate(CS%tv%salt_deficit(isd:ied,jsd:jed), source=0.0)

if (bulkmixedlayer .or. use_temperature) then
allocate(CS%Hml(isd:ied,jsd:jed)) ; CS%Hml(:,:) = 0.0
endif
if (bulkmixedlayer .or. use_temperature) allocate(CS%Hml(isd:ied,jsd:jed), source=0.0)

if (bulkmixedlayer) then
GV%nkml = nkml ; GV%nk_rho_varies = nkml + nkbl
Expand All @@ -2284,8 +2278,8 @@ subroutine initialize_MOM(Time, Time_init, param_file, dirs, CS, restart_CSp, &
CS%n_dyn_steps_in_adv = 0

if (debug_truncations) then
allocate(CS%u_prev(IsdB:IedB,jsd:jed,nz)) ; CS%u_prev(:,:,:) = 0.0
allocate(CS%v_prev(isd:ied,JsdB:JedB,nz)) ; CS%v_prev(:,:,:) = 0.0
allocate(CS%u_prev(IsdB:IedB,jsd:jed,nz), source=0.0)
allocate(CS%v_prev(isd:ied,JsdB:JedB,nz), source=0.0)
MOM_internal_state%u_prev => CS%u_prev
MOM_internal_state%v_prev => CS%v_prev
call safe_alloc_ptr(CS%ADp%du_dt_visc,IsdB,IedB,jsd,jed,nz)
Expand All @@ -2305,9 +2299,7 @@ subroutine initialize_MOM(Time, Time_init, param_file, dirs, CS, restart_CSp, &

CS%CDp%uh => CS%uh ; CS%CDp%vh => CS%vh

if (CS%interp_p_surf) then
allocate(CS%p_surf_prev(isd:ied,jsd:jed)) ; CS%p_surf_prev(:,:) = 0.0
endif
if (CS%interp_p_surf) allocate(CS%p_surf_prev(isd:ied,jsd:jed), source=0.0)

ALLOC_(CS%ssh_rint(isd:ied,jsd:jed)) ; CS%ssh_rint(:,:) = 0.0
ALLOC_(CS%ave_ssh_ibc(isd:ied,jsd:jed)) ; CS%ave_ssh_ibc(:,:) = 0.0
Expand All @@ -2319,9 +2311,9 @@ subroutine initialize_MOM(Time, Time_init, param_file, dirs, CS, restart_CSp, &
! initialization routine for tv.
if (use_EOS) call EOS_init(param_file, CS%tv%eqn_of_state, US)
if (use_temperature) then
allocate(CS%tv%TempxPmE(isd:ied,jsd:jed)) ; CS%tv%TempxPmE(:,:) = 0.0
allocate(CS%tv%TempxPmE(isd:ied,jsd:jed), source=0.0)
if (use_geothermal) then
allocate(CS%tv%internal_heat(isd:ied,jsd:jed)) ; CS%tv%internal_heat(:,:) = 0.0
allocate(CS%tv%internal_heat(isd:ied,jsd:jed), source=0.0)
endif
endif
call callTree_waypoint("state variables allocated (initialize_MOM)")
Expand Down Expand Up @@ -2433,18 +2425,13 @@ subroutine initialize_MOM(Time, Time_init, param_file, dirs, CS, restart_CSp, &
if (CS%rotate_index) then
G_in%ke = GV%ke

allocate(u_in(G_in%IsdB:G_in%IedB, G_in%jsd:G_in%jed, nz))
allocate(v_in(G_in%isd:G_in%ied, G_in%JsdB:G_in%JedB, nz))
allocate(h_in(G_in%isd:G_in%ied, G_in%jsd:G_in%jed, nz))
u_in(:,:,:) = 0.0
v_in(:,:,:) = 0.0
h_in(:,:,:) = GV%Angstrom_H
allocate(u_in(G_in%IsdB:G_in%IedB, G_in%jsd:G_in%jed, nz), source=0.0)
allocate(v_in(G_in%isd:G_in%ied, G_in%JsdB:G_in%JedB, nz), source=0.0)
allocate(h_in(G_in%isd:G_in%ied, G_in%jsd:G_in%jed, nz), source=GV%Angstrom_H)

if (use_temperature) then
allocate(T_in(G_in%isd:G_in%ied, G_in%jsd:G_in%jed, nz))
allocate(S_in(G_in%isd:G_in%ied, G_in%jsd:G_in%jed, nz))
T_in(:,:,:) = 0.0
S_in(:,:,:) = 0.0
allocate(T_in(G_in%isd:G_in%ied, G_in%jsd:G_in%jed, nz), source=0.0)
allocate(S_in(G_in%isd:G_in%ied, G_in%jsd:G_in%jed, nz), source=0.0)

CS%tv%T => T_in
CS%tv%S => S_in
Expand All @@ -2455,10 +2442,8 @@ subroutine initialize_MOM(Time, Time_init, param_file, dirs, CS, restart_CSp, &
! when using an ice shelf. Passing the ice shelf diagnostics CS from MOM
! for legacy reasons. The actual ice shelf diag CS is internal to the ice shelf
call initialize_ice_shelf(param_file, G_in, Time, ice_shelf_CSp, diag_ptr)
allocate(frac_shelf_in(G_in%isd:G_in%ied, G_in%jsd:G_in%jed))
frac_shelf_in(:,:) = 0.0
allocate(CS%frac_shelf_h(isd:ied, jsd:jed))
CS%frac_shelf_h(:,:) = 0.0
allocate(frac_shelf_in(G_in%isd:G_in%ied, G_in%jsd:G_in%jed), source=0.0)
allocate(CS%frac_shelf_h(isd:ied, jsd:jed), source=0.0)
call ice_shelf_query(ice_shelf_CSp,G,CS%frac_shelf_h)
! MOM_initialize_state is using the unrotated metric
call rotate_array(CS%frac_shelf_h, -turns, frac_shelf_in)
Expand Down Expand Up @@ -2512,8 +2497,7 @@ subroutine initialize_MOM(Time, Time_init, param_file, dirs, CS, restart_CSp, &
else
if (use_ice_shelf) then
call initialize_ice_shelf(param_file, G, Time, ice_shelf_CSp, diag_ptr)
allocate(CS%frac_shelf_h(isd:ied, jsd:jed))
CS%frac_shelf_h(:,:) = 0.0
allocate(CS%frac_shelf_h(isd:ied, jsd:jed), source=0.0)
call ice_shelf_query(ice_shelf_CSp,G,CS%frac_shelf_h)
call MOM_initialize_state(CS%u, CS%v, CS%h, CS%tv, Time, G, GV, US, &
param_file, dirs, restart_CSp, CS%ALE_CSp, CS%tracer_Reg, &
Expand Down Expand Up @@ -2650,7 +2634,7 @@ subroutine initialize_MOM(Time, Time_init, param_file, dirs, CS, restart_CSp, &
call thickness_diffuse_init(Time, G, GV, US, param_file, diag, CS%CDp, CS%thickness_diffuse_CSp)

if (CS%split) then
allocate(eta(SZI_(G),SZJ_(G))) ; eta(:,:) = 0.0
allocate(eta(SZI_(G),SZJ_(G)), source=0.0)
call initialize_dyn_split_RK2(CS%u, CS%v, CS%h, CS%uh, CS%vh, eta, Time, &
G, GV, US, param_file, diag, CS%dyn_split_RK2_CSp, restart_CSp, &
CS%dt, CS%ADp, CS%CDp, MOM_internal_state, CS%VarMix, CS%MEKE, &
Expand Down
27 changes: 14 additions & 13 deletions src/core/MOM_barotropic.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2359,7 +2359,8 @@ subroutine btstep(U_in, V_in, eta_in, dt, bc_accel_u, bc_accel_v, forces, pbce,
if (GV%Boussinesq) then
do j=js,je ; do i=is,ie
if ((eta(i,j) < -GV%Z_to_H*G%bathyT(i,j)) .and. (G%mask2dT(i,j) > 0.0)) then
write(mesg,'(ES24.16," vs. ",ES24.16)') GV%H_to_m*eta(i,j), -US%Z_to_m*G%bathyT(i,j)
write(mesg,'(ES24.16," vs. ",ES24.16, " at ", ES12.4, ES12.4, i7, i7)') GV%H_to_m*eta(i,j), &
-US%Z_to_m*G%bathyT(i,j), G%geoLonT(i,j), G%geoLatT(i,j), i + G%isd_global, j + G%jsd_global
if (err_count < 2) &
call MOM_error(WARNING, "btstep: eta has dropped below bathyT: "//trim(mesg), all_print=.true.)
err_count = err_count + 1
Expand Down Expand Up @@ -3092,17 +3093,17 @@ subroutine set_up_BT_OBC(OBC, eta, BT_OBC, BT_Domain, G, GV, US, MS, halo, use_B
endif

if (.not. BT_OBC%is_alloced) then
allocate(BT_OBC%Cg_u(isdw-1:iedw,jsdw:jedw)) ; BT_OBC%Cg_u(:,:) = 0.0
allocate(BT_OBC%H_u(isdw-1:iedw,jsdw:jedw)) ; BT_OBC%H_u(:,:) = 0.0
allocate(BT_OBC%uhbt(isdw-1:iedw,jsdw:jedw)) ; BT_OBC%uhbt(:,:) = 0.0
allocate(BT_OBC%ubt_outer(isdw-1:iedw,jsdw:jedw)) ; BT_OBC%ubt_outer(:,:) = 0.0
allocate(BT_OBC%eta_outer_u(isdw-1:iedw,jsdw:jedw)) ; BT_OBC%eta_outer_u(:,:) = 0.0

allocate(BT_OBC%Cg_v(isdw:iedw,jsdw-1:jedw)) ; BT_OBC%Cg_v(:,:) = 0.0
allocate(BT_OBC%H_v(isdw:iedw,jsdw-1:jedw)) ; BT_OBC%H_v(:,:) = 0.0
allocate(BT_OBC%vhbt(isdw:iedw,jsdw-1:jedw)) ; BT_OBC%vhbt(:,:) = 0.0
allocate(BT_OBC%vbt_outer(isdw:iedw,jsdw-1:jedw)) ; BT_OBC%vbt_outer(:,:) = 0.0
allocate(BT_OBC%eta_outer_v(isdw:iedw,jsdw-1:jedw)) ; BT_OBC%eta_outer_v(:,:)=0.0
allocate(BT_OBC%Cg_u(isdw-1:iedw,jsdw:jedw), source=0.0)
allocate(BT_OBC%H_u(isdw-1:iedw,jsdw:jedw), source=0.0)
allocate(BT_OBC%uhbt(isdw-1:iedw,jsdw:jedw), source=0.0)
allocate(BT_OBC%ubt_outer(isdw-1:iedw,jsdw:jedw), source=0.0)
allocate(BT_OBC%eta_outer_u(isdw-1:iedw,jsdw:jedw), source=0.0)

allocate(BT_OBC%Cg_v(isdw:iedw,jsdw-1:jedw), source=0.0)
allocate(BT_OBC%H_v(isdw:iedw,jsdw-1:jedw), source=0.0)
allocate(BT_OBC%vhbt(isdw:iedw,jsdw-1:jedw), source=0.0)
allocate(BT_OBC%vbt_outer(isdw:iedw,jsdw-1:jedw), source=0.0)
allocate(BT_OBC%eta_outer_v(isdw:iedw,jsdw-1:jedw), source=0.0)
BT_OBC%is_alloced = .true.
call create_group_pass(BT_OBC%pass_uv, BT_OBC%ubt_outer, BT_OBC%vbt_outer, BT_Domain)
call create_group_pass(BT_OBC%pass_uhvh, BT_OBC%uhbt, BT_OBC%vhbt, BT_Domain)
Expand Down Expand Up @@ -4743,7 +4744,7 @@ subroutine barotropic_init(u, v, h, eta, Time, G, GV, US, param_file, diag, CS,
wave_drag_file = trim(slasher(inputdir))//trim(wave_drag_file)
call log_param(param_file, mdl, "INPUTDIR/BT_WAVE_DRAG_FILE", wave_drag_file)

allocate(lin_drag_h(isd:ied,jsd:jed)) ; lin_drag_h(:,:) = 0.0
allocate(lin_drag_h(isd:ied,jsd:jed), source=0.0)

call MOM_read_data(wave_drag_file, wave_drag_var, lin_drag_h, G%Domain, scale=US%m_to_Z*US%T_to_s)
call pass_var(lin_drag_h, G%Domain)
Expand Down
Loading

0 comments on commit f57f608

Please sign in to comment.