Skip to content

Commit

Permalink
Fixed an OMP issue in MOM_isopycnal_slopes
Browse files Browse the repository at this point in the history
  • Loading branch information
Wendazhang33 committed Aug 1, 2024
1 parent 8f2c547 commit 7aa86db
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions src/core/MOM_isopycnal_slopes.F90
Original file line number Diff line number Diff line change
Expand Up @@ -240,18 +240,20 @@ subroutine calc_isoneutral_slopes(G, GV, US, h, e, tv, dt_kappa_smooth, use_stan
enddo ; enddo
enddo

do I=is-1,ie
GxSpV_u(I) = G_Rho0 !This will be changed if both use_EOS and allocated(tv%SpV_avg) are true
enddo

!$OMP parallel do default(none) shared(nz,is,ie,js,je,IsdB,use_EOS,G,GV,US,pres,T,S,tv,h,e, &
!$OMP h_neglect,dz_neglect,h_neglect2, &
!$OMP present_N2_u,G_Rho0,N2_u,slope_x,dzSxN,EOSdom_u,EOSdom_h1, &
!$OMP local_open_u_BC,dzu,OBC,use_stanley) &
!$OMP private(drdiA,drdiB,drdkL,drdkR,pres_u,T_u,S_u, &
!$OMP drho_dT_u,drho_dS_u,hg2A,hg2B,hg2L,hg2R,haA, &
!$OMP drho_dT_dT_h,scrap,pres_h,T_h,S_h,GxSpV_u, &
!$OMP drho_dT_dT_h,scrap,pres_h,T_h,S_h, &
!$OMP haB,haL,haR,dzaL,dzaR,wtA,wtB,wtL,wtR,drdz, &
!$OMP drdx,mag_grad2,slope,l_seg)
if (present_N2_u .or. (present(dzSxN))) then
GxSpV_u(:) = G_Rho0
endif
!$OMP drdx,mag_grad2,slope,l_seg) &
!$OMP firstprivate(GxSpV_u)
do j=js,je ; do K=nz,2,-1
if (.not.(use_EOS)) then
drdiA = 0.0 ; drdiB = 0.0
Expand Down Expand Up @@ -383,20 +385,22 @@ subroutine calc_isoneutral_slopes(G, GV, US, h, e, tv, dt_kappa_smooth, use_stan
enddo ! I
enddo ; enddo ! end of j-loop

do i=is,ie
GxSpV_v(i) = G_Rho0 !This will be changed if both use_EOS and allocated(tv%SpV_avg) are true
enddo

! Calculate the meridional isopycnal slope.
!$OMP parallel do default(none) shared(nz,is,ie,js,je,IsdB,use_EOS,G,GV,US,pres,T,S,tv, &
!$OMP h,h_neglect,e,dz_neglect, &
!$OMP h_neglect2,present_N2_v,G_Rho0,N2_v,slope_y,dzSyN,EOSdom_v, &
!$OMP dzv,local_open_v_BC,OBC,use_stanley) &
!$OMP private(drdjA,drdjB,drdkL,drdkR,pres_v,T_v,S_v, &
!$OMP drho_dT_v,drho_dS_v,hg2A,hg2B,hg2L,hg2R,haA, &
!$OMP drho_dT_dT_h,scrap,pres_h,T_h,S_h,GxSpV_v, &
!$OMP drho_dT_dT_h,scrap,pres_h,T_h,S_h, &
!$OMP drho_dT_dT_hr,pres_hr,T_hr,S_hr, &
!$OMP haB,haL,haR,dzaL,dzaR,wtA,wtB,wtL,wtR,drdz, &
!$OMP drdy,mag_grad2,slope,l_seg)
if ((present_N2_v) .or. (present(dzSyN))) then
GxSpV_v(:) = G_Rho0
endif
!$OMP drdy,mag_grad2,slope,l_seg) &
!$OMP firstprivate(GxSpV_v)
do J=js-1,je ; do K=nz,2,-1
if (.not.(use_EOS)) then
drdjA = 0.0 ; drdjB = 0.0
Expand Down

0 comments on commit 7aa86db

Please sign in to comment.