pure subroutine ocean_surfflux_assemble_impl(heat_content_massin, heat_content_massout, &
Q_heat, Q_salt, &
q_sw, q_lw, q_lat, q_sens, heat_added, &
heat_cavity, &
heat_content_lprec, heat_content_fprec, &
heat_content_vprec, heat_content_lrunoff, &
heat_content_frunoff, heat_content_seaice_melt, &
evap, salt_flux, salt_cavity, &
hTr_T, h_layer, wet_mask, &
Q_heat_const, Q_salt_const, cp, h_min, &
nz, nx, ny)
!! Flat `do concurrent` kernel — explicit-shape dummies, integer
!! dims declared first (decl-order, ifx #8586). See
!! `ocean_surface_flux_assemble` for the physics; this is the
!! arithmetic verbatim.
integer, intent(in) :: nz, nx, ny
real(wp), intent(inout) :: heat_content_massin(nx, ny), heat_content_massout(nx, ny)
real(wp), intent(inout) :: Q_heat(nx, ny), Q_salt(nx, ny)
real(wp), intent(in) :: q_sw(nx, ny), q_lw(nx, ny), q_lat(nx, ny), q_sens(nx, ny)
real(wp), intent(in) :: heat_added(nx, ny), heat_cavity(nx, ny)
real(wp), intent(in) :: heat_content_lprec(nx, ny), heat_content_fprec(nx, ny)
real(wp), intent(in) :: heat_content_vprec(nx, ny), heat_content_lrunoff(nx, ny)
real(wp), intent(in) :: heat_content_frunoff(nx, ny), heat_content_seaice_melt(nx, ny)
real(wp), intent(in) :: evap(nx, ny), salt_flux(nx, ny), salt_cavity(nx, ny)
real(wp), intent(in) :: hTr_T(nx, ny, nz), h_layer(nx, ny, nz), wet_mask(nx, ny)
real(wp), intent(in) :: Q_heat_const, Q_salt_const, cp, h_min
integer :: i, j
real(wp) :: sst, massin, massout
do concurrent(j=1:ny, i=1:nx) local(sst, massin, massout)
massin = heat_content_lprec(i, j) + heat_content_fprec(i, j) &
+ heat_content_vprec(i, j) + heat_content_lrunoff(i, j) &
+ heat_content_frunoff(i, j) + heat_content_seaice_melt(i, j)
sst = hTr_T(i, j, nz)/max(h_layer(i, j, nz), h_min)
massout = cp*sst*evap(i, j)
heat_content_massin(i, j) = wet_mask(i, j)*massin
heat_content_massout(i, j) = wet_mask(i, j)*massout
Q_heat(i, j) = wet_mask(i, j)* &
(Q_heat_const + q_sw(i, j) + q_lw(i, j) + q_lat(i, j) + &
q_sens(i, j) + heat_added(i, j) + heat_cavity(i, j) + &
massin + massout)
Q_salt(i, j) = wet_mask(i, j)*(Q_salt_const + salt_flux(i, j) + &
salt_cavity(i, j))
end do
end subroutine ocean_surfflux_assemble_impl