mom-ocean / MOM6

Modular Ocean Model
Other
181 stars 223 forks source link

OBC question for you #500

Closed kshedstrom closed 6 years ago

kshedstrom commented 7 years ago

In MOM_continuity_PPM, there's this chunk:

        if (any_simple_OBC) then
          do I=ish-1,ieh
            do_I(I) = OBC%segment(OBC%segnum_u(I,j))%specified
            if (do_I(I)) BT_cont%Fa_u_W0(I,j) = GV%H_subroundoff*G%dy_Cu(I,j)
          enddo
          do k=1,nz ; do I=ish-1,ieh ; if (do_I(I)) then
            if (abs(OBC%segment(OBC%segnum_u(I,j))%normal_vel(I,j,k)) > 0.0) &
              BT_cont%Fa_u_W0(I,j) = BT_cont%Fa_u_W0(I,j) + &
                   OBC%segment(OBC%segnum_u(I,j))%normal_trans(I,j,k) / &
                   OBC%segment(OBC%segnum_u(I,j))%normal_vel(I,j,k)
          endif ; enddo ; enddo
          do I=ish-1,ieh ; if (do_I(I)) then
            BT_cont%Fa_u_E0(I,j) = BT_cont%Fa_u_W0(I,j)
            BT_cont%Fa_u_WW(I,j) = BT_cont%Fa_u_W0(I,j)
            BT_cont%Fa_u_EE(I,j) = BT_cont%Fa_u_W0(I,j)
          endif ; enddo
        endif

The last part setting BT_cont%Fa_u_E0 and friends is only inside the if (any_simple_OBC) test. Is this correct?

adcroft commented 7 years ago

That is what the code says and I think it is correct. The derivatives only need to changed where ...%specified is true because the solver can calculate those derivatives from the non-specified OBC fluxes.

I think. @Hallberg-NOAA ?

kshedstrom commented 7 years ago

Actually, what I really (also) need is the correct setting of the BT_cont components along an open boundary segment. Right now some depend on external values of "h".

adcroft commented 7 years ago

☹️

Hallberg-NOAA commented 7 years ago

The BT_cont components describe the vertically summed transport (in H m2/s) as a function of the barotropic velocity, with the "Fa" components describing the open Face-area (in m2) when the flow is weakly from the east or west (..._E0 and ..._W0), or very strongly from the east or west (..._EE and ..._WW), with the other components being the transports and the velocities at which these are realized. This whole structure is basically a continuous 4-part thickness profile, that is partly a linearization of the transports about the initial ocean state, but reverting to upwinding limits for sufficiently strong velocities. (Calculating the effective face areas is actually a little more complicated than just summing the thicknesses because we reduce the transports due to vertical viscosity, and the input barotropic velocities are actually barotropic accelerations multiplied by a timestep, but in the inviscid limit they are the same; see Hallberg and Adcroft, 2009, Ocean Modelling for a full discussion of this point.) The OBC code you quote, Kate, sets these face areas based on the ratio of transports to specified velocities in the specified OBC case. Obviously this is not the right approach for the more general OBCs. For more general OBCs, I think that we will want to exploit the no-normal-derivative constraint, and set all of the effective face areas to be the same sum of the (viscosity-corrected) thicknesses on the interior side of the OBCs. If the face-areas are the same, the velocities at which we transition between the 4 pieces of the fit become immaterial, although the transports inside of the BT_cont type do need to be set consistently (0 should work for the velocities and transports). Does this help?

kshedstrom commented 6 years ago

Fixed in commits leading to c73e0e3a4d.