﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
947	LuvSrc / LwSrc issue reported by Aurora Leeson	wilkin		"Parker !MacCready's student Aurora Leeson [https://mobile.myroms.org/forum/viewtopic.php?p=24462#p24462 identifies] in the ROMS Forum what appears to be a bug in the processing of **!LuvSrc** / **!LwSrc** options in the particular combination that a user has a mix of ''BOTH'' **!LwSrc** and **!LuvSrc** sources (functionality we recently allowed following discussion with John Warner) ''AND'' not all the **!LuvSrc** sources are in the u-direction (it is a quirky combination to trigger an error). 

In **step3d_uv.F**, we need to have instead:

{{{
!
!-----------------------------------------------------------------------
! Apply momentum transport point sources (like river runoff), if any.
!-----------------------------------------------------------------------
!
      IF (LuvSrc(ng)) THEN
        DO is=1,Nsrc(ng)
          i=SOURCES(ng)%Isrc(is)
          j=SOURCES(ng)%Jsrc(is)
          IF (((IstrR.le.i).and.(i.le.IendR)).and.                      &
     &        ((JstrR.le.j).and.(j.le.JendR))) THEN
            IF (INT(SOURCES(ng)%Dsrc(is)).eq.0) THEN
              DO k=1,N(ng)
                cff1=1.0_r8/(on_u(i,j)*                                 &
     &                       0.5_r8*(z_w(i-1,j,k)-z_w(i-1,j,k-1)+       &
     &                               z_w(i  ,j,k)-z_w(i  ,j,k-1)))
                u(i,j,k,nnew)=SOURCES(ng)%Qsrc(is,k)*cff1
              END DO
            ELSE IF (INT(SOURCES(ng)%Dsrc(is)).eq.1) THEN
              DO k=1,N(ng)
                cff1=1.0_r8/(om_v(i,j)*                                 &
     &                       0.5_r8*(z_w(i,j-1,k)-z_w(i,j-1,k-1)+       &
     &                               z_w(i,j  ,k)-z_w(i,j  ,k-1)))
                v(i,j,k,nnew)=SOURCES(ng)%Qsrc(is,k)*cff1
              END DO
            END IF
          END IF
        END DO
      END IF
}}}
Notice that when **Dsrc(is) = 2**, no contribution is added to **u** and **v**. That is done as volume vertical influx in **omega.F**.

Propagated change to the **TLM**, **RPM**, and **ADM** versions of **step3d_uv.F**."	bug	closed	minor	Release ROMS/TOMS 4.2	Nonlinear	4.1	Fixed		
