Skip to content

Commit

Permalink
Merge branch 'omega_w2x_changes' into fpmix_updates_june24
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavo-marques committed Jul 24, 2024
2 parents 58c1cd5 + dcb1dee commit e5ed1a4
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 25 deletions.
6 changes: 3 additions & 3 deletions config_src/drivers/nuopc_cap/mom_surface_forcing_nuopc.F90
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ subroutine convert_IOB_to_fluxes(IOB, fluxes, index_bounds, Time, valid_time, G,
call allocate_forcing_type(G, fluxes, water=.true., heat=.true., ustar=.true., &
press=.true., fix_accum_bug=CS%fix_ustar_gustless_bug, &
cfc=CS%use_CFC, hevap=CS%enthalpy_cpl, tau_mag=.true.)
!call safe_alloc_ptr(fluxes%omega_w2x,isd,ied,jsd,jed)
call safe_alloc_ptr(fluxes%omega_w2x,isd,ied,jsd,jed)

call safe_alloc_ptr(fluxes%sw_vis_dir,isd,ied,jsd,jed)
call safe_alloc_ptr(fluxes%sw_vis_dif,isd,ied,jsd,jed)
Expand Down Expand Up @@ -704,7 +704,7 @@ subroutine convert_IOB_to_forces(IOB, forces, index_bounds, Time, G, US, CS)

call safe_alloc_ptr(forces%p_surf,isd,ied,jsd,jed)
call safe_alloc_ptr(forces%p_surf_full,isd,ied,jsd,jed)
!call safe_alloc_ptr(forces%omega_w2x,isd,ied,jsd,jed)
call safe_alloc_ptr(forces%omega_w2x,isd,ied,jsd,jed)

if (CS%rigid_sea_ice) then
call safe_alloc_ptr(forces%rigidity_ice_u,IsdB,IedB,jsd,jed)
Expand Down Expand Up @@ -865,7 +865,7 @@ subroutine convert_IOB_to_forces(IOB, forces, index_bounds, Time, G, US, CS)
forces%tau_mag(i,j) = gustiness + G%mask2dT(i,j) * sqrt(taux_at_h(i,j)**2 + tauy_at_h(i,j)**2)
forces%ustar(i,j) = sqrt(gustiness*Irho0 + Irho0 * G%mask2dT(i,j) * &
sqrt(taux_at_h(i,j)**2 + tauy_at_h(i,j)**2))
!forces%omega_w2x(i,j) = atan(tauy_at_h(i,j), taux_at_h(i,j))
forces%omega_w2x(i,j) = atan(tauy_at_h(i,j), taux_at_h(i,j))
enddo ; enddo
call pass_vector(forces%taux, forces%tauy, G%Domain, halo=1)
else ! C-grid wind stresses.
Expand Down
40 changes: 20 additions & 20 deletions src/core/MOM_forcing_type.F90
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ module MOM_forcing_type

! surface stress components and turbulent velocity scale
real, pointer, dimension(:,:) :: &
!omega_w2x => NULL(), & !< the counter-clockwise angle of the wind stress with respect
omega_w2x => NULL(), & !< the counter-clockwise angle of the wind stress with respect
ustar => NULL(), & !< surface friction velocity scale [Z T-1 ~> m s-1].
tau_mag => NULL(), & !< Magnitude of the wind stress averaged over tracer cells,
!! including any contributions from sub-gridscale variability
Expand Down Expand Up @@ -239,8 +239,8 @@ module MOM_forcing_type
tau_mag => NULL(), & !< Magnitude of the wind stress averaged over tracer cells, including any
!! contributions from sub-gridscale variability or gustiness [R L Z T-2 ~> Pa]
ustar => NULL(), & !< surface friction velocity scale [Z T-1 ~> m s-1].
net_mass_src => NULL() !< The net mass source to the ocean [R Z T-1 ~> kg m-2 s-1]
!omega_w2x => NULL() !< the counter-clockwise angle of the wind stress with respect
net_mass_src => NULL(), & !< The net mass source to the ocean [R Z T-1 ~> kg m-2 s-1]
omega_w2x => NULL() !< the counter-clockwise angle of the wind stress with respect
!! to the horizontal abscissa (x-coordinate) at tracer points [rad].

! applied surface pressure from other component models (e.g., atmos, sea ice, land ice)
Expand Down Expand Up @@ -378,7 +378,7 @@ module MOM_forcing_type
integer :: id_taux = -1
integer :: id_tauy = -1
integer :: id_ustar = -1
!integer :: id_omega_w2x = -1
integer :: id_omega_w2x = -1
integer :: id_tau_mag = -1
integer :: id_psurf = -1
integer :: id_TKE_tidal = -1
Expand Down Expand Up @@ -1506,8 +1506,8 @@ subroutine register_forcing_type_diags(Time, diag, US, use_temperature, handles,
'Surface friction velocity = [(gustiness + tau_magnitude)/rho0]^(1/2)', &
'm s-1', conversion=US%Z_to_m*US%s_to_T)

!handles%id_omega_w2x = register_diag_field('ocean_model', 'omega_w2x', diag%axesT1, Time, &
! 'Counter-clockwise angle of the wind stress from the horizontal axis.', 'rad')
handles%id_omega_w2x = register_diag_field('ocean_model', 'omega_w2x', diag%axesT1, Time, &
'Counter-clockwise angle of the wind stress from the horizontal axis.', 'rad')

if (present(use_berg_fluxes)) then
if (use_berg_fluxes) then
Expand Down Expand Up @@ -2370,11 +2370,11 @@ subroutine copy_common_forcing_fields(forces, fluxes, G, skip_pres)
fluxes%ustar(i,j) = forces%ustar(i,j)
enddo ; enddo
endif
!if (associated(forces%omega_w2x) .and. associated(fluxes%omega_w2x)) then
! do j=js,je ; do i=is,ie
! fluxes%omega_w2x(i,j) = forces%omega_w2x(i,j)
! enddo ; enddo
!endif
if (associated(forces%omega_w2x) .and. associated(fluxes%omega_w2x)) then
do j=js,je ; do i=is,ie
fluxes%omega_w2x(i,j) = forces%omega_w2x(i,j)
enddo ; enddo
endif
if (associated(forces%tau_mag) .and. associated(fluxes%tau_mag)) then
do j=js,je ; do i=is,ie
fluxes%tau_mag(i,j) = forces%tau_mag(i,j)
Expand Down Expand Up @@ -2516,11 +2516,11 @@ subroutine copy_back_forcing_fields(fluxes, forces, G)
forces%ustar(i,j) = fluxes%ustar(i,j)
enddo ; enddo
endif
!if (associated(forces%omega_w2x) .and. associated(fluxes%omega_w2x)) then
! do j=js,je ; do i=is,ie
! forces%omega_w2x(i,j) = fluxes%omega_w2x(i,j)
! enddo ; enddo
!endif
if (associated(forces%omega_w2x) .and. associated(fluxes%omega_w2x)) then
do j=js,je ; do i=is,ie
forces%omega_w2x(i,j) = fluxes%omega_w2x(i,j)
enddo ; enddo
endif
if (associated(forces%tau_mag) .and. associated(fluxes%tau_mag)) then
do j=js,je ; do i=is,ie
forces%tau_mag(i,j) = fluxes%tau_mag(i,j)
Expand Down Expand Up @@ -3172,8 +3172,8 @@ subroutine forcing_diagnostics(fluxes_in, sfc_state, G_in, US, time_end, diag, h
if ((handles%id_ustar > 0) .and. associated(fluxes%ustar)) &
call post_data(handles%id_ustar, fluxes%ustar, diag)

!if ((handles%id_omega_w2x > 0) .and. associated(fluxes%omega_w2x)) &
! call post_data(handles%id_omega_w2x, fluxes%omega_w2x, diag)
if ((handles%id_omega_w2x > 0) .and. associated(fluxes%omega_w2x)) &
call post_data(handles%id_omega_w2x, fluxes%omega_w2x, diag)

if ((handles%id_ustar_berg > 0) .and. associated(fluxes%ustar_berg)) &
call post_data(handles%id_ustar_berg, fluxes%ustar_berg, diag)
Expand Down Expand Up @@ -3512,7 +3512,7 @@ end subroutine myAlloc
subroutine deallocate_forcing_type(fluxes)
type(forcing), intent(inout) :: fluxes !< Forcing fields structure

!if (associated(fluxes%omega_w2x)) deallocate(fluxes%omega_w2x)
if (associated(fluxes%omega_w2x)) deallocate(fluxes%omega_w2x)
if (associated(fluxes%ustar)) deallocate(fluxes%ustar)
if (associated(fluxes%ustar_gustless)) deallocate(fluxes%ustar_gustless)
if (associated(fluxes%tau_mag)) deallocate(fluxes%tau_mag)
Expand Down Expand Up @@ -3572,7 +3572,7 @@ end subroutine deallocate_forcing_type
subroutine deallocate_mech_forcing(forces)
type(mech_forcing), intent(inout) :: forces !< Forcing fields structure

!if (associated(forces%omega_w2x)) deallocate(forces%omega_w2x)
if (associated(forces%omega_w2x)) deallocate(forces%omega_w2x)
if (associated(forces%taux)) deallocate(forces%taux)
if (associated(forces%tauy)) deallocate(forces%tauy)
if (associated(forces%ustar)) deallocate(forces%ustar)
Expand Down
2 changes: 1 addition & 1 deletion src/parameterizations/lateral/MOM_MEKE.F90
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ module MOM_MEKE
logical :: Rd_as_max_scale !< If true the length scale can not exceed the
!! first baroclinic deformation radius.
logical :: use_old_lscale !< Use the old formula for mixing length scale.
logical :: use_min_lscale !< Use simple minimum for mixing l >= 0.
logical :: use_min_lscale !< Use simple minimum for mixing length scale.
logical :: MEKE_positive !< If true, it guarantees that MEKE will always be >= 0.
real :: lscale_maxval !< The ceiling on the MEKE mixing length scale when use_min_lscale is true [L ~> m].
real :: cdrag !< The bottom drag coefficient for MEKE, times rescaling factors [H L-1 ~> nondim or kg m-3]
Expand Down
2 changes: 1 addition & 1 deletion src/user/MOM_wave_interface.F90
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,7 @@ subroutine Update_Surface_Waves(G, GV, US, Time_present, dt, CS, forces)
enddo
do jj=G%jsc,G%jec
do ii=G%isc,G%iec
!CS%Omega_w2x(ii,jj) = forces%omega_w2x(ii,jj)
CS%Omega_w2x(ii,jj) = forces%omega_w2x(ii,jj)
do b=1,CS%NumBands
CS%UStk_Hb(ii,jj,b) = US%m_s_to_L_T*forces%UStkb(ii,jj,b)
CS%VStk_Hb(ii,jj,b) = US%m_s_to_L_T*forces%VStkb(ii,jj,b)
Expand Down

0 comments on commit e5ed1a4

Please sign in to comment.