Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix compilation issue with openmp #76

Merged
merged 1 commit into from
Nov 6, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions src/parameterizations/lateral/MOM_MEKE.F90
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ subroutine step_forward_MEKE(MEKE, h, visc, dt, G, CS)

if (CS%MEKE_K4 >= 0.0) then
! Calculate Laplacian of MEKE
!$OMP parallel default(none) shared(is,ie,js,je,MEKE_uflux,G,MEKE,MEKE_vflux,CS)
!$OMP do
do j=js,je ; do I=is-1,ie
MEKE_uflux(I,j) = ((G%dy_Cu(I,j)*G%IdxCu(I,j)) * G%mask2dCu(I,j)) * &
Expand All @@ -271,11 +272,15 @@ subroutine step_forward_MEKE(MEKE, h, visc, dt, G, CS)
! CS%del2MEKE(i,j) = (G%IareaT(i,j)*I_mass(i,j)) * &
! ((MEKE_uflux(I,j) - MEKE_uflux(I-1,j)) + (MEKE_vflux(i,J) - MEKE_vflux(i,J-1)))
enddo ; enddo
!$OMP end parallel
call cpu_clock_begin(CS%id_clock_pass)
call do_group_pass(CS%pass_del2MEKE, G%Domain)
call cpu_clock_end(CS%id_clock_pass)

! Bi-harmonic diffusion of MEKE
!$OMP parallel default(none) shared(is,ie,js,je,MEKE_uflux,G,CS,sdt,mass, &
!$OMP mass_neglect,MEKE_vflux,I_mass) &
!$OMP private(K4_here,Inv_Kh_max)
!$OMP do
do j=js,je ; do I=is-1,ie
K4_here = CS%MEKE_K4
Expand Down Expand Up @@ -306,17 +311,17 @@ subroutine step_forward_MEKE(MEKE, h, visc, dt, G, CS)
((MEKE_uflux(I-1,j) - MEKE_uflux(I,j)) + &
(MEKE_vflux(i,J-1) - MEKE_vflux(i,J)))
enddo ; enddo

!$OMP end parallel
endif !

if (CS%MEKE_KH >= 0.0) then
! Lateral diffusion of MEKE
Kh_here = CS%MEKE_Kh

!$OMP parallel default(none) shared(is,ie,js,je,MEKE,CS,sdt,G,Kh_u,MEKE_uflux, &
!$OMP mass,mass_neglect,Kh_v,MEKE_vflux,I_mass, &
!$OMP sdt_damp,drag_rate,Rho0,drag_rate_visc, &
!$OMP cdrag2,bottomFac2,MEKE_decay) &
!$OMP private(Kh_here,Inv_Kh_max,ldamping)
!$OMP private(Kh_here,Inv_Kh_max,ldamping)
if (CS%MEKE_KH >= 0.0) then
! Lateral diffusion of MEKE
Kh_here = CS%MEKE_Kh
!$OMP do
do j=js,je ; do I=is-1,ie
! Limit Kh to avoid CFL violations.
Expand Down Expand Up @@ -382,8 +387,9 @@ subroutine step_forward_MEKE(MEKE, h, visc, dt, G, CS)
MEKE_decay(i,j) = 0.5 * G%mask2dT(i,j) * (MEKE_decay(i,j) + ldamping)
enddo ; enddo
endif
!$OMP end parallel
endif ! MEKE_KH>=0
!$OMP end parallel


! DO WE NEED THIS HALO UPDATE ??? -AJA #####################################################
call cpu_clock_begin(CS%id_clock_pass)
Expand Down