Skip to content

Commit

Permalink
Comment all omega_w2x entries
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavo-marques committed Oct 13, 2023
1 parent e2bbb08 commit 3720b99
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 39 deletions.
40 changes: 20 additions & 20 deletions src/core/MOM_forcing_type.F90
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,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 @@ -227,8 +227,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 @@ -365,7 +365,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 @@ -1331,8 +1331,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 @@ -2170,11 +2170,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 @@ -2311,11 +2311,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 @@ -2964,8 +2964,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 @@ -3292,7 +3292,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 @@ -3352,7 +3352,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
36 changes: 18 additions & 18 deletions src/parameterizations/vertical/MOM_vert_friction.F90
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,8 @@ subroutine vertFPmix(ui, vi, uold, vold, hbl_h, h, forces, dt, G, GV, US, CS, OB
real, dimension(SZI_(G),SZJB_(G)) :: ustar2_v !< ustar squared at v-pts [L2 T-2 ~> m2 s-2]
real, dimension(SZIB_(G),SZJ_(G)) :: taux_u !< zonal wind stress at u-pts [R L Z T-2 ~> Pa]
real, dimension(SZI_(G),SZJB_(G)) :: tauy_v !< meridional wind stress at v-pts [R L Z T-2 ~> Pa]
real, dimension(SZIB_(G),SZJ_(G)) :: omega_w2x_u !< angle between wind and x-axis at u-pts [rad]
real, dimension(SZI_(G),SZJB_(G)) :: omega_w2x_v !< angle between wind and y-axis at v-pts [rad]
!real, dimension(SZIB_(G),SZJ_(G)) :: omega_w2x_u !< angle between wind and x-axis at u-pts [rad]
!real, dimension(SZI_(G),SZJB_(G)) :: omega_w2x_v !< angle between wind and y-axis at v-pts [rad]
real, dimension(SZIB_(G),SZJ_(G),SZK_(GV)+1) :: tau_u !< kinematic zonal mtm flux at u-pts [L2 T-2 ~> m2 s-2]
real, dimension(SZI_(G),SZJB_(G),SZK_(GV)+1) :: tau_v !< kinematic mer. mtm flux at v-pts [L2 T-2 ~> m2 s-2]
real, dimension(SZIB_(G),SZJ_(G),SZK_(GV)+1) :: tauxDG_u !< downgradient zonal mtm flux at u-pts [L2 T-2 ~> m2 s-2]
Expand Down Expand Up @@ -270,8 +270,8 @@ subroutine vertFPmix(ui, vi, uold, vold, hbl_h, h, forces, dt, G, GV, US, CS, OB
hbl_v(:,:) = 0.
kbl_u(:,:) = 0
kbl_v(:,:) = 0
omega_w2x_u(:,:) = 0.0
omega_w2x_v(:,:) = 0.0
!omega_w2x_u(:,:) = 0.0
!omega_w2x_v(:,:) = 0.0
tauxDG_u(:,:,:) = 0.0
tauyDG_v(:,:,:) = 0.0
do j = js,je
Expand All @@ -283,7 +283,7 @@ subroutine vertFPmix(ui, vi, uold, vold, hbl_h, h, forces, dt, G, GV, US, CS, OB
tauy = ( G%mask2dCv(i ,j )*tauy_v(i ,j ) + G%mask2dCv(i ,j-1)*tauy_v(i ,j-1) &
+ G%mask2dCv(i+1,j )*tauy_v(i+1,j ) + G%mask2dCv(i+1,j-1)*tauy_v(i+1,j-1) ) / tmp
ustar2_u(I,j) = sqrt( taux_u(I,j)*taux_u(I,j) + tauy*tauy )
omega_w2x_u(I,j) = atan2( tauy , taux_u(I,j) )
!omega_w2x_u(I,j) = atan2( tauy , taux_u(I,j) )
tauxDG_u(I,j,1) = taux_u(I,j)
depth = 0.0
do k = 1, nz
Expand All @@ -305,7 +305,7 @@ subroutine vertFPmix(ui, vi, uold, vold, hbl_h, h, forces, dt, G, GV, US, CS, OB
taux = ( G%mask2dCu(i ,j) * taux_u(i ,j) + G%mask2dCu(i ,j+1) * taux_u(i ,j+1) &
+ G%mask2dCu(i-1,j) * taux_u(i-1,j) + G%mask2dCu(i-1,j+1) * taux_u(i-1,j+1)) / tmp
ustar2_v(i,J) = sqrt(tauy_v(i,J)*tauy_v(i,J) + taux*taux)
omega_w2x_v(i,J) = atan2( tauy_v(i,J), taux )
!omega_w2x_v(i,J) = atan2( tauy_v(i,J), taux )
tauyDG_v(i,J,1) = tauy_v(i,J)
depth = 0.0
do k = 1, nz
Expand Down Expand Up @@ -377,7 +377,7 @@ subroutine vertFPmix(ui, vi, uold, vold, hbl_h, h, forces, dt, G, GV, US, CS, OB
do I = Isq,Ieq
if( (G%mask2dCu(I,j) > 0.5) ) then
! SURFACE
tauyDG_u(I,j,1) = ustar2_u(I,j) * cos(omega_w2x_u(I,j))
tauyDG_u(I,j,1) = ustar2_u(I,j) !* cos(omega_w2x_u(I,j))
tau_u(I,j,1) = ustar2_u(I,j)
Omega_tau2w_u(I,j,1) = 0.0
Omega_tau2s_u(I,j,1) = 0.0
Expand All @@ -386,7 +386,7 @@ subroutine vertFPmix(ui, vi, uold, vold, hbl_h, h, forces, dt, G, GV, US, CS, OB
kp1 = MIN(k+1 , nz)
tau_u(I,j,k+1) = sqrt( tauxDG_u(I,j,k+1)*tauxDG_u(I,j,k+1) + tauyDG_u(I,j,k+1)*tauyDG_u(I,j,k+1))
Omega_tau2x = atan2( tauyDG_u(I,j,k+1) , tauxDG_u(I,j,k+1) )
omega_tmp = Omega_tau2x - omega_w2x_u(I,j)
omega_tmp = Omega_tau2x !- omega_w2x_u(I,j)
if ( (omega_tmp > pi ) ) omega_tmp = omega_tmp - 2.*pi
if ( (omega_tmp < (0.-pi)) ) omega_tmp = omega_tmp + 2.*pi
Omega_tau2w_u(I,j,k+1) = omega_tmp
Expand All @@ -399,7 +399,7 @@ subroutine vertFPmix(ui, vi, uold, vold, hbl_h, h, forces, dt, G, GV, US, CS, OB
do i = is, ie
if( (G%mask2dCv(i,J) > 0.5) ) then
! SURFACE
tauxDG_v(i,J,1) = ustar2_v(i,J) * sin(omega_w2x_v(i,J))
tauxDG_v(i,J,1) = ustar2_v(i,J) !* sin(omega_w2x_v(i,J))
tau_v(i,J,1) = ustar2_v(i,J)
Omega_tau2w_v(i,J,1) = 0.0
Omega_tau2s_v(i,J,1) = 0.0
Expand All @@ -408,7 +408,7 @@ subroutine vertFPmix(ui, vi, uold, vold, hbl_h, h, forces, dt, G, GV, US, CS, OB
kp1 = MIN(k+1 , nz)
tau_v(i,J,k+1) = sqrt ( tauxDG_v(i,J,k+1)*tauxDG_v(i,J,k+1) + tauyDG_v(i,J,k+1)*tauyDG_v(i,J,k+1) )
omega_tau2x = atan2( tauyDG_v(i,J,k+1) , tauxDG_v(i,J,k+1) )
omega_tmp = omega_tau2x - omega_w2x_v(i,J)
omega_tmp = omega_tau2x !- omega_w2x_v(i,J)
if ( (omega_tmp > pi ) ) omega_tmp = omega_tmp - 2.*pi
if ( (omega_tmp < (0.-pi)) ) omega_tmp = omega_tmp + 2.*pi
Omega_tau2w_v(i,J,k+1) = omega_tmp
Expand Down Expand Up @@ -440,8 +440,8 @@ subroutine vertFPmix(ui, vi, uold, vold, hbl_h, h, forces, dt, G, GV, US, CS, OB
sin_tmp = tauyDG_u(I,j,k+1) / (tau_u(I,j,k+1) + GV%H_subroundoff)

! rotate to wind coordinates
Wind_x = ustar2_u(I,j) * cos(omega_w2x_u(I,j))
Wind_y = ustar2_u(I,j) * sin(omega_w2x_u(I,j))
Wind_x = ustar2_u(I,j) !* cos(omega_w2x_u(I,j))
Wind_y = ustar2_u(I,j) !* sin(omega_w2x_u(I,j))
tauNL_DG = (Wind_x * cos_tmp + Wind_y * sin_tmp)
tauNL_CG = (Wind_y * cos_tmp - Wind_x * sin_tmp)
omega_w2s = atan2(tauNL_CG, tauNL_DG)
Expand All @@ -465,7 +465,7 @@ subroutine vertFPmix(ui, vi, uold, vold, hbl_h, h, forces, dt, G, GV, US, CS, OB
Omega_tau2s_u(I,j,k+1) = atan2(tauNL_CG , (tau_u(I,j,k+1)+tauNL_DG))
tau_u(I,j,k+1) = sqrt((tauxDG_u(I,j,k+1) + tauNL_X)**2 + (tauyDG_u(I,j,k+1) + tauNL_Y)**2)
omega_tau2x = atan2((tauyDG_u(I,j,k+1) + tauNL_Y), (tauxDG_u(I,j,k+1) + tauNL_X))
omega_tau2w = omega_tau2x - omega_w2x_u(I,j)
omega_tau2w = omega_tau2x !- omega_w2x_u(I,j)
if (omega_tau2w >= pi ) omega_tau2w = omega_tau2w - 2.*pi
if (omega_tau2w <= (0.-pi) ) omega_tau2w = omega_tau2w + 2.*pi
Omega_tau2w_u(I,j,k+1) = omega_tau2w
Expand Down Expand Up @@ -499,8 +499,8 @@ subroutine vertFPmix(ui, vi, uold, vold, hbl_h, h, forces, dt, G, GV, US, CS, OB
sin_tmp = tauyDG_v(i,J,k+1) / (tau_v(i,J,k+1) + GV%H_subroundoff)

! rotate into wind coordinate
Wind_x = ustar2_v(i,J) * cos(omega_w2x_v(i,J))
Wind_y = ustar2_v(i,J) * sin(omega_w2x_v(i,J))
Wind_x = ustar2_v(i,J) !* cos(omega_w2x_v(i,J))
Wind_y = ustar2_v(i,J) !* sin(omega_w2x_v(i,J))
tauNL_DG = (Wind_x * cos_tmp + Wind_y * sin_tmp)
tauNL_CG = (Wind_y * cos_tmp - Wind_x * sin_tmp)
omega_w2s = atan2(tauNL_CG , tauNL_DG)
Expand All @@ -521,8 +521,8 @@ subroutine vertFPmix(ui, vi, uold, vold, hbl_h, h, forces, dt, G, GV, US, CS, OB
! diagnostics
Omega_tau2s_v(i,J,k+1) = atan2(tauNL_CG, tau_v(i,J,k+1) + tauNL_DG)
tau_v(i,J,k+1) = sqrt((tauxDG_v(i,J,k+1) + tauNL_X)**2 + (tauyDG_v(i,J,k+1) + tauNL_Y)**2)
omega_tau2x = atan2((tauyDG_v(i,J,k+1) + tauNL_Y) , (tauxDG_v(i,J,k+1) + tauNL_X))
omega_tau2w = omega_tau2x - omega_w2x_v(i,J)
!omega_tau2x = atan2((tauyDG_v(i,J,k+1) + tauNL_Y) , (tauxDG_v(i,J,k+1) + tauNL_X))
!omega_tau2w = omega_tau2x - omega_w2x_v(i,J)
if (omega_tau2w > pi) omega_tau2w = omega_tau2w - 2.*pi
if (omega_tau2w .le. (0.-pi) ) omega_tau2w = omega_tau2w + 2.*pi
Omega_tau2w_v(i,J,k+1) = omega_tau2w
Expand All @@ -546,7 +546,7 @@ subroutine vertFPmix(ui, vi, uold, vold, hbl_h, h, forces, dt, G, GV, US, CS, OB
if (CS%id_FPtau2s_v > 0) call post_data(CS%id_FPtau2s_v, omega_tau2s_v, CS%diag)
if (CS%id_FPtau2w_u > 0) call post_data(CS%id_FPtau2w_u, omega_tau2w_u, CS%diag)
if (CS%id_FPtau2w_v > 0) call post_data(CS%id_FPtau2w_v, omega_tau2w_v, CS%diag)
if (CS%id_FPw2x > 0) call post_data(CS%id_FPw2x, forces%omega_w2x , CS%diag)
!if (CS%id_FPw2x > 0) call post_data(CS%id_FPw2x, forces%omega_w2x , CS%diag)

end subroutine vertFPmix

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 @@ -707,7 +707,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 3720b99

Please sign in to comment.