Skip to content

Commit

Permalink
Merge pull request #1 from marshallward/pr_1019_fix
Browse files Browse the repository at this point in the history
T scaling and OpenMP fixes
  • Loading branch information
Hallberg-NOAA authored Oct 10, 2019
2 parents 629416b + 12d3aac commit b3e4b3c
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 13 deletions.
4 changes: 2 additions & 2 deletions src/core/MOM_PressureForce_blocked_AFV.F90
Original file line number Diff line number Diff line change
Expand Up @@ -630,8 +630,8 @@ subroutine PressureForce_blk_AFV_Bouss(h, tv, PFu, PFv, G, GV, US, CS, ALE_CSp,
endif

!$OMP parallel do default(none) shared(use_p_atm,Rho_ref,Rho_ref_mks,G,GV,e,p_atm,nz,use_EOS,&
!$OMP use_ALE,T_t,T_b,S_t,S_b,CS,tv,tv_tmp,g_Earth_z, &
!$OMP h,PFu,I_Rho0,h_neglect,dz_neglect,PFv,dM)&
!$OMP use_ALE,T_t,T_b,S_t,S_b,CS,tv,tv_tmp,g_Earth_z_geo, &
!$OMP g_Earth_mks_z,h,PFu,I_Rho0,h_neglect,dz_neglect,PFv,dM)&
!$OMP private(is_bk,ie_bk,js_bk,je_bk,Isq_bk,Ieq_bk,Jsq_bk, &
!$OMP Jeq_bk,ioff_bk,joff_bk,pa_bk, &
!$OMP intx_pa_bk,inty_pa_bk,dpa_bk,intz_dpa_bk, &
Expand Down
5 changes: 3 additions & 2 deletions src/core/MOM_forcing_type.F90
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,7 @@ subroutine extractFluxes2d(G, GV, US, fluxes, optics, nsw, dt_in_T, FluxRescaleD
logical, intent(in) :: aggregate_FW !< For determining how to aggregate the forcing.

integer :: j
!$OMP parallel do default(none) shared(G, GV, fluxes, optics, nsw,dt,FluxRescaleDepth, &
!$OMP parallel do default(none) shared(G, GV, US, fluxes, optics, nsw, dt_in_T, FluxRescaleDepth, &
!$OMP useRiverHeatContent, useCalvingHeatContent, &
!$OMP h,T,netMassInOut,netMassOut,Net_heat,Net_salt,Pen_SW_bnd,tv, &
!$OMP aggregate_FW)
Expand Down Expand Up @@ -1320,7 +1320,8 @@ subroutine register_forcing_type_diags(Time, diag, US, use_temperature, handles,
cmor_long_name='Rainfall Flux where Ice Free Ocean over Sea')

handles%id_vprec = register_diag_field('ocean_model', 'vprec', diag%axesT1, Time, &
'Virtual liquid precip into ocean due to SSS restoring', 'kg m-2 s-1')
'Virtual liquid precip into ocean due to SSS restoring', &
units='kg m-2 s-1', conversion=US%R_to_kg_m3*US%Z_to_m*US%s_to_T)

handles%id_frunoff = register_diag_field('ocean_model', 'frunoff', diag%axesT1, Time, &
'Frozen runoff (calving) and iceberg melt into ocean', 'kg m-2 s-1', &
Expand Down
2 changes: 1 addition & 1 deletion src/core/MOM_isopycnal_slopes.F90
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ subroutine calc_isoneutral_slopes(G, GV, US, h, e, tv, dt_kappa_smooth, &
enddo ; enddo ! end of j-loop

! Calculate the meridional isopycnal slope.
!$OMP parallel do default(none) shared(nz,is,ie,js,je,IsdB,use_EOS,G,GV,pres,T,S,tv, &
!$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,Z_to_L,L_to_Z,H_to_Z, &
!$OMP h_neglect2,present_N2_v,G_Rho0,N2_v,slope_y) &
!$OMP private(drdjA,drdjB,drdkL,drdkR,pres_v,T_v,S_v, &
Expand Down
2 changes: 1 addition & 1 deletion src/parameterizations/vertical/MOM_diabatic_aux.F90
Original file line number Diff line number Diff line change
Expand Up @@ -971,7 +971,7 @@ subroutine applyBoundaryFluxesInOut(CS, G, GV, US, dt_in_T, fluxes, optics, nsw,
if (CS%id_createdH>0) CS%createdH(:,:) = 0.
numberOfGroundings = 0

!$OMP parallel do default(none) shared(is,ie,js,je,nz,h,tv,nsw,G,GV,US,optics,fluxes,dt, &
!$OMP parallel do default(none) shared(is,ie,js,je,nz,h,tv,nsw,G,GV,US,optics,fluxes, &
!$OMP H_limit_fluxes,numberOfGroundings,iGround,jGround,&
!$OMP nonPenSW,hGrounding,CS,Idt,aggregate_FW_forcing, &
!$OMP minimum_forcing_depth,evap_CFL_limit,dt_in_T, &
Expand Down
2 changes: 1 addition & 1 deletion src/parameterizations/vertical/MOM_geothermal.F90
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ subroutine geothermal(h, tv, dt, ea, eb, G, GV, US, CS, halo)
if (compute_h_old) h_old(:,:,:) = 0.0
if (compute_T_old) T_old(:,:,:) = 0.0

!$OMP parallel do default(none) shared(is,ie,js,je,G,GV,CS,dt,Irho_cp,nkmb,tv, &
!$OMP parallel do default(none) shared(is,ie,js,je,G,GV,US,CS,dt,Irho_cp,nkmb,tv, &
!$OMP p_Ref,h,Angstrom,nz,H_neglect,eb, &
!$OMP compute_h_old,compute_T_old,h_old,T_old, &
!$OMP work_3d,Idt) &
Expand Down
2 changes: 1 addition & 1 deletion src/parameterizations/vertical/MOM_internal_tide_input.F90
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ subroutine find_N2_bottom(h, tv, T_f, S_f, h2, fluxes, G, GV, US, N2_bot)
do i=is,ie
dRho_int(i,1) = 0.0 ; dRho_int(i,nz+1) = 0.0
enddo
!$OMP parallel do default(none) shared(is,ie,js,je,nz,tv,fluxes,G,GV,h,T_f,S_f, &
!$OMP parallel do default(none) shared(is,ie,js,je,nz,tv,fluxes,G,GV,US,h,T_f,S_f, &
!$OMP h2,N2_bot,G_Rho0) &
!$OMP private(pres,Temp_Int,Salin_Int,dRho_dT,dRho_dS, &
!$OMP hb,dRho_bot,z_from_bot,do_i,h_amp, &
Expand Down
2 changes: 1 addition & 1 deletion src/parameterizations/vertical/MOM_regularize_layers.F90
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ subroutine regularize_surface(h, tv, dt, ea, eb, G, GV, US, CS)


! Now restructure the layers.
!$OMP parallel do default(none) shared(is,ie,js,je,nz,do_j,def_rat_h,CS,nkmb,G,GV,&
!$OMP parallel do default(none) shared(is,ie,js,je,nz,do_j,def_rat_h,CS,nkmb,G,GV,US, &
!$OMP e,I_dtol,h,tv,debug,h_neglect,p_ref_cv,ea, &
!$OMP eb,id_clock_EOS,nkml) &
!$OMP private(d_ea,d_eb,max_def_rat,do_i,nz_filt,e_e,e_w,&
Expand Down
4 changes: 2 additions & 2 deletions src/parameterizations/vertical/MOM_set_viscosity.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1193,7 +1193,7 @@ subroutine set_viscous_ML(u, v, h, tv, forces, visc, dt_in_T, G, GV, US, CS, sym
endif
enddo ; endif

!$OMP parallel do default(private) shared(u,v,h,tv,forces,visc,dt,G,GV,US,CS,use_EOS,dt_Rho0, &
!$OMP parallel do default(private) shared(u,v,h,tv,forces,visc,dt_in_T,G,GV,US,CS,use_EOS,dt_Rho0, &
!$OMP h_neglect,h_tiny,g_H_Rho0,js,je,OBC,Isq,Ieq,nz, &
!$OMP U_bg_sq,mask_v,cdrag_sqrt,cdrag_sqrt_Z,Rho0x400_G,nkml)
do j=js,je ! u-point loop
Expand Down Expand Up @@ -1428,7 +1428,7 @@ subroutine set_viscous_ML(u, v, h, tv, forces, visc, dt_in_T, G, GV, US, CS, sym

enddo ! j-loop at u-points

!$OMP parallel do default(private) shared(u,v,h,tv,forces,visc,dt,G,GV,US,CS,use_EOS,dt_Rho0, &
!$OMP parallel do default(private) shared(u,v,h,tv,forces,visc,dt_in_T,G,GV,US,CS,use_EOS,dt_Rho0, &
!$OMP h_neglect,h_tiny,g_H_Rho0,is,ie,OBC,Jsq,Jeq,nz, &
!$OMP U_bg_sq,cdrag_sqrt,cdrag_sqrt_Z,Rho0x400_G,nkml,mask_u)
do J=Jsq,Jeq ! v-point loop
Expand Down
4 changes: 2 additions & 2 deletions src/parameterizations/vertical/MOM_vert_friction.F90
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@ subroutine vertvisc_coef(u, v, h, forces, visc, dt_in_T, G, GV, US, CS, OBC)
endif

!$OMP parallel do default(private) shared(G,GV,US,CS,visc,Isq,Ieq,nz,u,h,forces,hML_u, &
!$OMP OBC,h_neglect,dt,I_valBL,Kv_u) &
!$OMP OBC,h_neglect,dt_in_T,I_valBL,Kv_u) &
!$OMP firstprivate(i_hbbl)
do j=G%Jsc,G%Jec
do I=Isq,Ieq ; do_i(I) = (G%mask2dCu(I,j) > 0) ; enddo
Expand Down Expand Up @@ -838,7 +838,7 @@ subroutine vertvisc_coef(u, v, h, forces, visc, dt_in_T, G, GV, US, CS, OBC)

! Now work on v-points.
!$OMP parallel do default(private) shared(G,GV,CS,US,visc,is,ie,Jsq,Jeq,nz,v,h,forces,hML_v, &
!$OMP OBC,h_neglect,dt,I_valBL,Kv_v) &
!$OMP OBC,h_neglect,dt_in_T,I_valBL,Kv_v) &
!$OMP firstprivate(i_hbbl)
do J=Jsq,Jeq
do i=is,ie ; do_i(i) = (G%mask2dCv(i,J) > 0) ; enddo
Expand Down

0 comments on commit b3e4b3c

Please sign in to comment.