Skip to content

Commit

Permalink
+Rescaled IOF%flux_u_ocn and IOF%stress_mag
Browse files Browse the repository at this point in the history
  Rescaled IOF%flux_u_ocn, IOF%flux_v_ocn, and IOF%stress_mag for expanded
dimensional consistency testing and code simplification.  All answers are
bitwise identical, but there are minor interface changes.
  • Loading branch information
Hallberg-NOAA committed Nov 7, 2019
1 parent 8481061 commit 40ee0ec
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 67 deletions.
76 changes: 38 additions & 38 deletions src/SIS_dyn_trans.F90
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,8 @@ subroutine update_icebergs(IST, OSS, IOF, FIA, icebergs_CS, dt_slow, G, US, IG,
! This code reproduces a long-standing bug, in that the old ice-ocean
! stresses are being passed in place of the wind stresses on the icebergs.
do j=jsc,jec ; do i=isc,iec
windstr_x(i,j) = IOF%flux_u_ocn(i,j)
windstr_y(i,j) = IOF%flux_v_ocn(i,j)
windstr_x(i,j) = US%L_T_to_m_s*US%s_to_T*IOF%flux_u_ocn(i,j)
windstr_y(i,j) = US%L_T_to_m_s*US%s_to_T*IOF%flux_v_ocn(i,j)
enddo ; enddo
stress_stagger = IOF%flux_uv_stagger
else
Expand Down Expand Up @@ -1475,18 +1475,18 @@ subroutine set_ocean_top_stress_Bgrid(IOF, windstr_x_water, windstr_y_water, &
do j=jsc,jec
do i=isc,iec
ps_vel = G%mask2dT(i,j) * part_size(i,j,0)
IOF%flux_u_ocn(i,j) = IOF%flux_u_ocn(i,j) + ps_vel * 0.25 * US%L_T_to_m_s*US%s_to_T* &
IOF%flux_u_ocn(i,j) = IOF%flux_u_ocn(i,j) + ps_vel * 0.25 * &
((windstr_x_water(I,J) + windstr_x_water(I-1,J-1)) + &
(windstr_x_water(I-1,J) + windstr_x_water(I,J-1)))
IOF%flux_v_ocn(i,j) = IOF%flux_v_ocn(i,j) + ps_vel * 0.25 * US%L_T_to_m_s*US%s_to_T* &
IOF%flux_v_ocn(i,j) = IOF%flux_v_ocn(i,j) + ps_vel * 0.25 * &
((windstr_y_water(I,J) + windstr_y_water(I-1,J-1)) + &
(windstr_y_water(I-1,J) + windstr_y_water(I,J-1)))
enddo
do k=1,ncat ; do i=isc,iec ; if (G%mask2dT(i,j)>0.5) then
IOF%flux_u_ocn(i,j) = IOF%flux_u_ocn(i,j) + part_size(i,j,k) * 0.25 * US%L_T_to_m_s*US%s_to_T* &
IOF%flux_u_ocn(i,j) = IOF%flux_u_ocn(i,j) + part_size(i,j,k) * 0.25 * &
((str_ice_oce_x(I,J) + str_ice_oce_x(I-1,J-1)) + &
(str_ice_oce_x(I-1,J) + str_ice_oce_x(I,J-1)))
IOF%flux_v_ocn(i,j) = IOF%flux_v_ocn(i,j) + part_size(i,j,k) * 0.25 * US%L_T_to_m_s*US%s_to_T* &
IOF%flux_v_ocn(i,j) = IOF%flux_v_ocn(i,j) + part_size(i,j,k) * 0.25 * &
((str_ice_oce_y(I,J) + str_ice_oce_y(I-1,J-1)) + &
(str_ice_oce_y(I-1,J) + str_ice_oce_y(I,J-1)))
endif ; enddo ; enddo
Expand All @@ -1498,14 +1498,14 @@ subroutine set_ocean_top_stress_Bgrid(IOF, windstr_x_water, windstr_y_water, &
ps_vel = 1.0 ; if (G%mask2dBu(I,J)>0.5) ps_vel = &
0.25*((part_size(i+1,j+1,0) + part_size(i,j,0)) + &
(part_size(i+1,j,0) + part_size(i,j+1,0)) )
IOF%flux_u_ocn(I,J) = IOF%flux_u_ocn(I,J) + US%L_T_to_m_s*US%s_to_T* windstr_x_water(I,J) * ps_vel
IOF%flux_v_ocn(I,J) = IOF%flux_v_ocn(I,J) + US%L_T_to_m_s*US%s_to_T* windstr_y_water(I,J) * ps_vel
IOF%flux_u_ocn(I,J) = IOF%flux_u_ocn(I,J) + windstr_x_water(I,J) * ps_vel
IOF%flux_v_ocn(I,J) = IOF%flux_v_ocn(I,J) + windstr_y_water(I,J) * ps_vel
enddo
do k=1,ncat ; do I=isc-1,iec ; if (G%mask2dBu(I,J)>0.5) then
ps_vel = 0.25 * ((part_size(i+1,j+1,k) + part_size(i,j,k)) + &
(part_size(i+1,j,k) + part_size(i,j+1,k)) )
IOF%flux_u_ocn(I,J) = IOF%flux_u_ocn(I,J) + US%L_T_to_m_s*US%s_to_T* str_ice_oce_x(I,J) * ps_vel
IOF%flux_v_ocn(I,J) = IOF%flux_v_ocn(I,J) + US%L_T_to_m_s*US%s_to_T* str_ice_oce_y(I,J) * ps_vel
IOF%flux_u_ocn(I,J) = IOF%flux_u_ocn(I,J) + str_ice_oce_x(I,J) * ps_vel
IOF%flux_v_ocn(I,J) = IOF%flux_v_ocn(I,J) + str_ice_oce_y(I,J) * ps_vel
endif ; enddo ; enddo
enddo
elseif (IOF%flux_uv_stagger == CGRID_NE) then
Expand All @@ -1514,12 +1514,12 @@ subroutine set_ocean_top_stress_Bgrid(IOF, windstr_x_water, windstr_y_water, &
do I=isc-1,iec
ps_vel = 1.0 ; if (G%mask2dCu(I,j)>0.5) ps_vel = &
0.5*(part_size(i+1,j,0) + part_size(i,j,0))
IOF%flux_u_ocn(I,j) = IOF%flux_u_ocn(I,j) + ps_vel * US%L_T_to_m_s*US%s_to_T* &
IOF%flux_u_ocn(I,j) = IOF%flux_u_ocn(I,j) + ps_vel * &
0.5 * (windstr_x_water(I,J) + windstr_x_water(I,J-1))
enddo
do k=1,ncat ; do I=isc-1,iec ; if (G%mask2dCu(I,j)>0.5) then
ps_vel = 0.5 * (part_size(i+1,j,k) + part_size(i,j,k))
IOF%flux_u_ocn(I,j) = IOF%flux_u_ocn(I,j) + ps_vel * US%L_T_to_m_s*US%s_to_T* &
IOF%flux_u_ocn(I,j) = IOF%flux_u_ocn(I,j) + ps_vel * &
0.5 * (str_ice_oce_x(I,J) + str_ice_oce_x(I,J-1))
endif ; enddo ; enddo
enddo
Expand All @@ -1528,12 +1528,12 @@ subroutine set_ocean_top_stress_Bgrid(IOF, windstr_x_water, windstr_y_water, &
do i=isc,iec
ps_vel = 1.0 ; if (G%mask2dCv(i,J)>0.5) ps_vel = &
0.5*(part_size(i,j+1,0) + part_size(i,j,0))
IOF%flux_v_ocn(i,J) = IOF%flux_v_ocn(i,J) + ps_vel * US%L_T_to_m_s*US%s_to_T* &
IOF%flux_v_ocn(i,J) = IOF%flux_v_ocn(i,J) + ps_vel * &
0.5 * (windstr_y_water(I,J) + windstr_y_water(I-1,J))
enddo
do k=1,ncat ; do i=isc,iec ; if (G%mask2dCv(i,J)>0.5) then
ps_vel = 0.5 * (part_size(i,j+1,k) + part_size(i,j,k))
IOF%flux_v_ocn(i,J) = IOF%flux_v_ocn(i,J) + ps_vel * US%L_T_to_m_s*US%s_to_T* &
IOF%flux_v_ocn(i,J) = IOF%flux_v_ocn(i,J) + ps_vel * &
0.5 * (str_ice_oce_y(I,J) + str_ice_oce_y(I-1,J))
endif ; enddo ; enddo
enddo
Expand Down Expand Up @@ -1585,16 +1585,16 @@ subroutine set_ocean_top_stress_Cgrid(IOF, windstr_x_water, windstr_y_water, &
do j=jsc,jec
do i=isc,iec
ps_vel = G%mask2dT(i,j) * part_size(i,j,0)
IOF%flux_u_ocn(i,j) = IOF%flux_u_ocn(i,j) + ps_vel * 0.5 * US%L_T_to_m_s*US%s_to_T* &
IOF%flux_u_ocn(i,j) = IOF%flux_u_ocn(i,j) + ps_vel * 0.5 * &
(windstr_x_water(I,j) + windstr_x_water(I-1,j))
IOF%flux_v_ocn(i,j) = IOF%flux_v_ocn(i,j) + ps_vel * 0.5 * US%L_T_to_m_s*US%s_to_T* &
IOF%flux_v_ocn(i,j) = IOF%flux_v_ocn(i,j) + ps_vel * 0.5 * &
(windstr_y_water(i,J) + windstr_y_water(i,J-1))
enddo
!### SIMPLIFY THIS TO USE THAT sum(part_size(i,j,1:ncat)) = 1.0-part_size(i,j,0) ?
do k=1,ncat ; do i=isc,iec ; if (G%mask2dT(i,j)>0.5) then
IOF%flux_u_ocn(i,j) = IOF%flux_u_ocn(i,j) + part_size(i,j,k) * 0.5 * US%L_T_to_m_s*US%s_to_T* &
IOF%flux_u_ocn(i,j) = IOF%flux_u_ocn(i,j) + part_size(i,j,k) * 0.5 * &
(str_ice_oce_x(I,j) + str_ice_oce_x(I-1,j))
IOF%flux_v_ocn(i,j) = IOF%flux_v_ocn(i,j) + part_size(i,j,k) * 0.5 * US%L_T_to_m_s*US%s_to_T* &
IOF%flux_v_ocn(i,j) = IOF%flux_v_ocn(i,j) + part_size(i,j,k) * 0.5 * &
(str_ice_oce_y(i,J) + str_ice_oce_y(i,J-1))
endif ; enddo ; enddo
enddo
Expand All @@ -1606,17 +1606,17 @@ subroutine set_ocean_top_stress_Cgrid(IOF, windstr_x_water, windstr_y_water, &
0.25*((part_size(i+1,j+1,0) + part_size(i,j,0)) + &
(part_size(i+1,j,0) + part_size(i,j+1,0)) )
!### Consider deleting the masks here? They probably do not change answers.
IOF%flux_u_ocn(I,J) = IOF%flux_u_ocn(I,J) + ps_vel * G%mask2dBu(I,J) * 0.5 * US%L_T_to_m_s*US%s_to_T* &
IOF%flux_u_ocn(I,J) = IOF%flux_u_ocn(I,J) + ps_vel * G%mask2dBu(I,J) * 0.5 * &
(windstr_x_water(I,j) + windstr_x_water(I,j+1))
IOF%flux_v_ocn(I,J) = IOF%flux_v_ocn(I,J) + ps_vel * G%mask2dBu(I,J) * 0.5 * US%L_T_to_m_s*US%s_to_T* &
IOF%flux_v_ocn(I,J) = IOF%flux_v_ocn(I,J) + ps_vel * G%mask2dBu(I,J) * 0.5 * &
(windstr_y_water(i,J) + windstr_y_water(i+1,J))
enddo
do k=1,ncat ; do I=isc-1,iec ; if (G%mask2dBu(I,J)>0.5) then
ps_vel = 0.25 * ((part_size(i+1,j+1,k) + part_size(i,j,k)) + &
(part_size(i+1,j,k) + part_size(i,j+1,k)) )
IOF%flux_u_ocn(I,J) = IOF%flux_u_ocn(I,J) + ps_vel * 0.5 * US%L_T_to_m_s*US%s_to_T* &
IOF%flux_u_ocn(I,J) = IOF%flux_u_ocn(I,J) + ps_vel * 0.5 * &
(str_ice_oce_x(I,j) + str_ice_oce_x(I,j+1))
IOF%flux_v_ocn(I,J) = IOF%flux_v_ocn(I,J) + ps_vel * 0.5 * US%L_T_to_m_s*US%s_to_T* &
IOF%flux_v_ocn(I,J) = IOF%flux_v_ocn(I,J) + ps_vel * 0.5 * &
(str_ice_oce_y(i,J) + str_ice_oce_y(i+1,J))
endif ; enddo ; enddo
enddo
Expand All @@ -1626,23 +1626,23 @@ subroutine set_ocean_top_stress_Cgrid(IOF, windstr_x_water, windstr_y_water, &
do I=Isc-1,iec
ps_vel = 1.0 ; if (G%mask2dCu(I,j)>0.5) ps_vel = &
0.5*(part_size(i+1,j,0) + part_size(i,j,0))
IOF%flux_u_ocn(I,j) = IOF%flux_u_ocn(I,j) + ps_vel * US%L_T_to_m_s*US%s_to_T*windstr_x_water(I,j)
IOF%flux_u_ocn(I,j) = IOF%flux_u_ocn(I,j) + ps_vel * windstr_x_water(I,j)
enddo
do k=1,ncat ; do I=isc-1,iec ; if (G%mask2dCu(I,j)>0.5) then
ps_vel = 0.5 * (part_size(i+1,j,k) + part_size(i,j,k))
IOF%flux_u_ocn(I,j) = IOF%flux_u_ocn(I,j) + ps_vel * US%L_T_to_m_s*US%s_to_T*str_ice_oce_x(I,j)
IOF%flux_u_ocn(I,j) = IOF%flux_u_ocn(I,j) + ps_vel * str_ice_oce_x(I,j)
endif ; enddo ; enddo
enddo
!$OMP parallel do default(shared) private(ps_vel)
do J=jsc-1,jec
do i=isc,iec
ps_vel = 1.0 ; if (G%mask2dCv(i,J)>0.5) ps_vel = &
0.5*(part_size(i,j+1,0) + part_size(i,j,0))
IOF%flux_v_ocn(i,J) = IOF%flux_v_ocn(i,J) + ps_vel * US%L_T_to_m_s*US%s_to_T*windstr_y_water(i,J)
IOF%flux_v_ocn(i,J) = IOF%flux_v_ocn(i,J) + ps_vel * windstr_y_water(i,J)
enddo
do k=1,ncat ; do i=isc,iec ; if (G%mask2dCv(i,J)>0.5) then
ps_vel = 0.5 * (part_size(i,j+1,k) + part_size(i,j,k))
IOF%flux_v_ocn(i,J) = IOF%flux_v_ocn(i,J) + ps_vel * US%L_T_to_m_s*US%s_to_T*str_ice_oce_y(i,J)
IOF%flux_v_ocn(i,J) = IOF%flux_v_ocn(i,J) + ps_vel * str_ice_oce_y(i,J)
endif ; enddo ; enddo
enddo
else
Expand Down Expand Up @@ -1695,12 +1695,12 @@ subroutine set_ocean_top_stress_B2(IOF, windstr_x_water, windstr_y_water, &
do j=jsc,jec ; do i=isc,iec
ps_ocn = G%mask2dT(i,j) * ice_free(i,j)
ps_ice = G%mask2dT(i,j) * ice_cover(i,j)
IOF%flux_u_ocn(i,j) = IOF%flux_u_ocn(i,j) + 0.25 * US%L_T_to_m_s*US%s_to_T* &
IOF%flux_u_ocn(i,j) = IOF%flux_u_ocn(i,j) + 0.25 * &
(ps_ocn * ((windstr_x_water(I,J) + windstr_x_water(I-1,J-1)) + &
(windstr_x_water(I-1,J) + windstr_x_water(I,J-1))) + &
ps_ice * ((str_ice_oce_x(I,J) + str_ice_oce_x(I-1,J-1)) + &
(str_ice_oce_x(I-1,J) + str_ice_oce_x(I,J-1))) )
IOF%flux_v_ocn(i,j) = IOF%flux_v_ocn(i,j) + 0.25 * US%L_T_to_m_s*US%s_to_T* &
IOF%flux_v_ocn(i,j) = IOF%flux_v_ocn(i,j) + 0.25 * &
(ps_ocn * ((windstr_y_water(I,J) + windstr_y_water(I-1,J-1)) + &
(windstr_y_water(I-1,J) + windstr_y_water(I,J-1))) + &
ps_ice * ((str_ice_oce_y(I,J) + str_ice_oce_y(I-1,J-1)) + &
Expand All @@ -1716,9 +1716,9 @@ subroutine set_ocean_top_stress_B2(IOF, windstr_x_water, windstr_y_water, &
ps_ice = 0.25 * ((ice_cover(i+1,j+1) + ice_cover(i,j)) + &
(ice_cover(i+1,j) + ice_cover(i,j+1)) )
endif
IOF%flux_u_ocn(I,J) = IOF%flux_u_ocn(I,J) + US%L_T_to_m_s*US%s_to_T* &
IOF%flux_u_ocn(I,J) = IOF%flux_u_ocn(I,J) + &
(ps_ocn * windstr_x_water(I,J) + ps_ice * str_ice_oce_x(I,J))
IOF%flux_v_ocn(I,J) = IOF%flux_v_ocn(I,J) + US%L_T_to_m_s*US%s_to_T* &
IOF%flux_v_ocn(I,J) = IOF%flux_v_ocn(I,J) + &
(ps_ocn * windstr_y_water(I,J) + ps_ice * str_ice_oce_y(I,J))
enddo ; enddo
elseif (IOF%flux_uv_stagger == CGRID_NE) then
Expand All @@ -1729,7 +1729,7 @@ subroutine set_ocean_top_stress_B2(IOF, windstr_x_water, windstr_y_water, &
ps_ocn = 0.5*(ice_free(i+1,j) + ice_free(i,j))
ps_ice = 0.5*(ice_cover(i+1,j) + ice_cover(i,j))
endif
IOF%flux_u_ocn(I,j) = IOF%flux_u_ocn(I,j) + 0.5 * US%L_T_to_m_s*US%s_to_T* &
IOF%flux_u_ocn(I,j) = IOF%flux_u_ocn(I,j) + 0.5 * &
(ps_ocn * (windstr_x_water(I,J) + windstr_x_water(I,J-1)) + &
ps_ice * (str_ice_oce_x(I,J) + str_ice_oce_x(I,J-1)) )
enddo ; enddo
Expand All @@ -1740,7 +1740,7 @@ subroutine set_ocean_top_stress_B2(IOF, windstr_x_water, windstr_y_water, &
ps_ocn = 0.5*(ice_free(i,j+1) + ice_free(i,j))
ps_ice = 0.5*(ice_cover(i,j+1) + ice_cover(i,j))
endif
IOF%flux_v_ocn(i,J) = IOF%flux_v_ocn(i,J) + 0.5 * US%L_T_to_m_s*US%s_to_T* &
IOF%flux_v_ocn(i,J) = IOF%flux_v_ocn(i,J) + 0.5 * &
(ps_ocn * (windstr_y_water(I,J) + windstr_y_water(I-1,J)) + &
ps_ice * (str_ice_oce_y(I,J) + str_ice_oce_y(I-1,J)) )
enddo ; enddo
Expand Down Expand Up @@ -1792,10 +1792,10 @@ subroutine set_ocean_top_stress_C2(IOF, windstr_x_water, windstr_y_water, &
do j=jsc,jec ; do i=isc,iec
ps_ocn = G%mask2dT(i,j) * ice_free(i,j)
ps_ice = G%mask2dT(i,j) * ice_cover(i,j)
IOF%flux_u_ocn(i,j) = IOF%flux_u_ocn(i,j) + US%L_T_to_m_s*US%s_to_T* &
IOF%flux_u_ocn(i,j) = IOF%flux_u_ocn(i,j) + &
(ps_ocn * 0.5 * (windstr_x_water(I,j) + windstr_x_water(I-1,j)) + &
ps_ice * 0.5 * (str_ice_oce_x(I,j) + str_ice_oce_x(I-1,j)) )
IOF%flux_v_ocn(i,j) = IOF%flux_v_ocn(i,j) + US%L_T_to_m_s*US%s_to_T* &
IOF%flux_v_ocn(i,j) = IOF%flux_v_ocn(i,j) + &
(ps_ocn * 0.5 * (windstr_y_water(i,J) + windstr_y_water(i,J-1)) + &
ps_ice * 0.5 * (str_ice_oce_y(i,J) + str_ice_oce_y(i,J-1)) )
enddo ; enddo
Expand All @@ -1809,10 +1809,10 @@ subroutine set_ocean_top_stress_C2(IOF, windstr_x_water, windstr_y_water, &
ps_ice = 0.25 * ((ice_cover(i+1,j+1) + ice_cover(i,j)) + &
(ice_cover(i+1,j) + ice_cover(i,j+1)) )
endif
IOF%flux_u_ocn(I,J) = IOF%flux_u_ocn(I,J) + US%L_T_to_m_s*US%s_to_T* &
IOF%flux_u_ocn(I,J) = IOF%flux_u_ocn(I,J) + &
(ps_ocn * 0.5 * (windstr_x_water(I,j) + windstr_x_water(I,j+1)) + &
ps_ice * 0.5 * (str_ice_oce_x(I,j) + str_ice_oce_x(I,j+1)) )
IOF%flux_v_ocn(I,J) = IOF%flux_v_ocn(I,J) + US%L_T_to_m_s*US%s_to_T* &
IOF%flux_v_ocn(I,J) = IOF%flux_v_ocn(I,J) + &
(ps_ocn * 0.5 * (windstr_y_water(i,J) + windstr_y_water(i+1,J)) + &
ps_ice * 0.5 * (str_ice_oce_y(i,J) + str_ice_oce_y(i+1,J)) )
enddo ; enddo
Expand All @@ -1824,7 +1824,7 @@ subroutine set_ocean_top_stress_C2(IOF, windstr_x_water, windstr_y_water, &
ps_ocn = 0.5*(ice_free(i+1,j) + ice_free(i,j))
ps_ice = 0.5*(ice_cover(i+1,j) + ice_cover(i,j))
endif
IOF%flux_u_ocn(I,j) = IOF%flux_u_ocn(I,j) + US%L_T_to_m_s*US%s_to_T* &
IOF%flux_u_ocn(I,j) = IOF%flux_u_ocn(I,j) + &
(ps_ocn * windstr_x_water(I,j) + ps_ice * str_ice_oce_x(I,j))
enddo ; enddo
!$OMP parallel do default(shared) private(ps_ocn, ps_ice)
Expand All @@ -1834,7 +1834,7 @@ subroutine set_ocean_top_stress_C2(IOF, windstr_x_water, windstr_y_water, &
ps_ocn = 0.5*(ice_free(i,j+1) + ice_free(i,j))
ps_ice = 0.5*(ice_cover(i,j+1) + ice_cover(i,j))
endif
IOF%flux_v_ocn(i,J) = IOF%flux_v_ocn(i,J) + US%L_T_to_m_s*US%s_to_T* &
IOF%flux_v_ocn(i,J) = IOF%flux_v_ocn(i,J) + &
(ps_ocn * windstr_y_water(i,J) + ps_ice * str_ice_oce_y(i,J))
enddo ; enddo
else
Expand Down
17 changes: 10 additions & 7 deletions src/SIS_types.F90
Original file line number Diff line number Diff line change
Expand Up @@ -357,11 +357,13 @@ module SIS_types
flux_lh_ocn_top, & !< The upward flux of latent heat at the ocean surface [W m-2].
lprec_ocn_top, & !< The downward flux of liquid precipitation at the ocean surface [kg m-2 s-1].
fprec_ocn_top, & !< The downward flux of frozen precipitation at the ocean surface [kg m-2 s-1].
flux_u_ocn, & !< The flux of x-momentum into the ocean at locations given by flux_uv_stagger [Pa].
flux_u_ocn, & !< The flux of x-momentum into the ocean at locations given by
!! flux_uv_stagger [kg m-2 L T-2 ~> Pa].
!! Note that regardless of the staggering, flux_u_ocn is allocated as though on an A-grid.
flux_v_ocn, & !< The flux of y-momentum into the ocean at locations given by flux_uv_stagger [Pa].
flux_v_ocn, & !< The flux of y-momentum into the ocean at locations given by
!! flux_uv_stagger [kg m-2 L T-2 ~> Pa].
!! Note that regardless of the staggering, flux_v_ocn is allocated as though on an A-grid.
stress_mag, & !< The area-weighted time-mean of the magnitude of the stress on the ocean [Pa].
stress_mag, & !< The area-weighted time-mean of the magnitude of the stress on the ocean [kg m-2 L T-2 ~> Pa].
melt_nudge, & !< A downward fresh water flux into the ocean that acts to nudge the ocean
!! surface salinity to facilitate the retention of sea ice [kg m-2 s-1].
flux_salt, & !< The flux of salt out of the ocean [kg m-2].
Expand Down Expand Up @@ -2205,10 +2207,11 @@ end subroutine dealloc_ice_ocean_flux

!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~!
!> Perform checksums on various arrays in an ice_ocean_flux_type.
subroutine IOF_chksum(mesg, IOF, G)
subroutine IOF_chksum(mesg, IOF, G, US)
character(len=*), intent(in) :: mesg !< A message that appears on the chksum lines.
type(ice_ocean_flux_type), intent(in) :: IOF !< The structure whose arrays are being checksummed.
type(SIS_hor_grid_type), intent(inout) :: G !< The ice-model's horizonal grid type.
type(unit_scale_type), intent(in) :: US !< A structure with unit conversion factors

call hchksum(IOF%flux_salt, trim(mesg)//" IOF%flux_salt", G%HI)

Expand All @@ -2219,12 +2222,12 @@ subroutine IOF_chksum(mesg, IOF, G)
call hchksum(IOF%flux_sw_ocn, trim(mesg)//" IOF%flux_sw_ocn", G%HI)
call hchksum(IOF%lprec_ocn_top, trim(mesg)//" IOF%lprec_ocn_top", G%HI)
call hchksum(IOF%fprec_ocn_top, trim(mesg)//" IOF%fprec_ocn_top", G%HI)
call hchksum(IOF%flux_u_ocn, trim(mesg)//" IOF%flux_u_ocn", G%HI)
call hchksum(IOF%flux_v_ocn, trim(mesg)//" IOF%flux_v_ocn", G%HI)
call hchksum(IOF%flux_u_ocn, trim(mesg)//" IOF%flux_u_ocn", G%HI, scale=US%L_T_to_m_s*US%s_to_T)
call hchksum(IOF%flux_v_ocn, trim(mesg)//" IOF%flux_v_ocn", G%HI, scale=US%L_T_to_m_s*US%s_to_T)
call hchksum(IOF%pres_ocn_top, trim(mesg)//" IOF%pres_ocn_top", G%HI)
call hchksum(IOF%mass_ice_sn_p, trim(mesg)//" IOF%mass_ice_sn_p", G%HI)
if (allocated(IOF%stress_mag)) &
call hchksum(IOF%stress_mag, trim(mesg)//" IOF%stress_mag", G%HI)
call hchksum(IOF%stress_mag, trim(mesg)//" IOF%stress_mag", G%HI, scale=US%L_T_to_m_s*US%s_to_T)

call hchksum(IOF%Enth_Mass_in_atm, trim(mesg)//" IOF%Enth_Mass_in_atm", G%HI)
call hchksum(IOF%Enth_Mass_out_atm, trim(mesg)//" IOF%Enth_Mass_out_atm", G%HI)
Expand Down
Loading

0 comments on commit 40ee0ec

Please sign in to comment.