Skip to content

Commit

Permalink
Corrected 5 OMP declarations
Browse files Browse the repository at this point in the history
  Added US to two openMP declarations and made the default shared for 3 others.
SIS2 was not compiling with openMP without these changes.  All answers are
bitwise identical.
  • Loading branch information
Hallberg-NOAA committed Dec 9, 2019
1 parent d70a2ba commit b9b1a91
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/SIS_ctrl_types.F90
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ subroutine ice_diagnostics_init(IOF, OSS, FIA, G, US, IG, diag, Time, Cgrid)
if (id_geo_lat>0) call post_data(id_geo_lat, G%geoLatT, diag, is_static=.true.)
if (id_cell_area>0) then
I_area_Earth = 1.0 / (16.0*atan(1.0)*G%Rad_Earth**2)
!$OMP parallel do default(none) shared(isc,iec,jsc,jec,G,I_area_Earth,tmp_diag)
!$OMP parallel do default(shared)
do j=jsc,jec ; do i=isc,iec
tmp_diag(i,j) = (US%L_to_m**2*G%areaT(i,j) * G%mask2dT(i,j)) * I_area_Earth
enddo ; enddo
Expand Down
2 changes: 1 addition & 1 deletion src/SIS_dyn_cgrid.F90
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,7 @@ subroutine SIS_C_dynamics(ci, mis, mice, ui, vi, uo, vo, &

m_neglect = H_subroundoff*CS%Rho_ice
m_neglect2 = m_neglect**2 ; m_neglect4 = m_neglect**4
!$OMP parallel default(none) shared(isc,iec,jsc,jec,G,CS,dt_slow,ui_min_trunc,u_IC,ui, &
!$OMP parallel default(none) shared(isc,iec,jsc,jec,G,US,CS,dt_slow,ui_min_trunc,u_IC,ui, &
!$OMP ui_max_trunc,vi_min_trunc,vi_max_trunc,v_IC,vi,mice, &
!$OMP mis,ci,dt,Tdamp,I_2EC,ci_proj,pres_mice, &
!$OMP dx2B,dy2B,dx_dyB,dy_dxB,dx2T,dy2T,dx_dyT,dy_dxT, &
Expand Down
8 changes: 2 additions & 6 deletions src/SIS_tracer_advect.F90
Original file line number Diff line number Diff line change
Expand Up @@ -298,9 +298,7 @@ subroutine advect_tracer(Tr, h_prev, h_end, uhtr, vhtr, ntr, dt, G, US, IG, CS)
! Set the range of valid points after this iteration.
isv = isv + stensil ; iev = iev - stensil
jsv = jsv + stensil ; jev = jev - stensil
!$OMP parallel do default(none) shared(ncat,domore_k,x_first,Tr,hprev,uhr,uh_neglect, &
!$OMP domore_u,ntr,nL_max,Idt,isv,iev,jsv,jev, &
!$OMP stensil,G,CS,vhr,vh_neglect,domore_v,IG)
!$OMP parallel do default(shared)
do k=1,ncat ; if (domore_k(k) > 0) then
! To ensure positive definiteness of the thickness at each iteration, the
! mass fluxes out of each layer are checked each step, and limited to keep
Expand Down Expand Up @@ -547,9 +545,7 @@ subroutine advect_scalar(scalar, h_prev, h_end, uhtr, vhtr, dt, G, US, IG, CS) !
! Set the range of valid points after this iteration.
isv = isv + stensil ; iev = iev - stensil
jsv = jsv + stensil ; jev = jev - stensil
!$OMP parallel do default(none) shared(ncat,isv,iev,jsv,jev,x_first,domore_k,scalar, &
!$OMP hprev,uhr,uh_neglect,domore_u,Idt,stensil,G, &
!$OMP CS,vhr,vh_neglect,domore_v,IG)
!$OMP parallel do default(shared)
do k=1,ncat ; if (domore_k(k) > 0) then
! To ensure positive definiteness of the thickness at each iteration, the
! mass fluxes out of each layer are checked each step, and limited to keep
Expand Down
2 changes: 1 addition & 1 deletion src/ice_model.F90
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ subroutine update_ice_slow_thermo(Ice)
! This code is only required to reproduce an old bug.
i_off = LBOUND(Ice%flux_t,1) - sG%isc
j_off = LBOUND(Ice%flux_t,2) - sG%jsc
!$OMP parallel do default(none) shared(Ice,sG,i_off,j_off) private(i2,j2)
!$OMP parallel do default(none) shared(Ice,sG,US,i_off,j_off) private(i2,j2)
do j=sG%jsc,sG%jec ; do i=sG%isc,sG%iec
i2 = i+i_off ; j2 = j+j_off
Ice%sCS%IOF%flux_u_ocn(i,j) = US%m_s_to_L_T*US%T_to_s*Ice%flux_u(i2,j2)
Expand Down

0 comments on commit b9b1a91

Please sign in to comment.