[MITgcm-support] Question about RBCS gridding in rbcs_add_tendency.F

Martin Losch Martin.Losch at awi.de
Wed Jun 11 11:47:41 EDT 2025


Hi Katarina,

with RBCS I often find that I need to specify more flags than I expect, e.g. set useRBCtemp, provide a mask file, provide the relaxation fields, turn on the package, and now I probably forgot something important again. I always end up using the ‘print hallo’-debugger to see, if the relevant parts of rbcs_add_tendency.F are reached.

Martin

> On 11. Jun 2025, at 17:11, Jean-Michel Campin <jmc at mit.edu> wrote:
> 
> Hi Katarina,
> 
> I don't know exactly what type of problem you found, but regarding the i,j loop ranges
> in "rbcs_add_tendency.F", the current code is correct, i.e., we don't need to extend the
> range to the full array size (1-OLx:sNx+OLx). Strictly speeaking, it would be enough for
> Theta and Salt to update gTendency over 1:sNx but 1) this is not the case for momentum
> tendency and 2) for some tracer diagnostics, we need 1 more point on each side of the tile.
> 
> Cheers,
> Jean-Michel
> 
> On Tue, Jun 10, 2025 at 10:45:19AM -0400, Katarina Merk wrote:
>> Dear all,
>> 
>> I???m encountering some unexpected behavior with the RBCS package. Specifically, the relaxation doesn't always seem to have the effect that I expect. 
>> 
>> While looking through the code, I came across a section in rbcs_add_tendency.F that did not make sense to me. The loops for the relaxations is currently written like:
>> 
>>     IF ( tracerNum.EQ.1 .AND. useRBCtemp ) THEN
>>        irbc = MIN(maskLEN,tracerNum)
>>        rec_tauRlx = rbcsVanishingFac/tauRelaxT
>>        DO j=0,sNy+1
>>         DO i=0,sNx+1
>>          gTendency(i,j) = gTendency(i,j)
>>     &       - RBC_mask(i,j,k,bi,bj,irbc)*rec_tauRlx
>>     &        *( theta(i,j,k,bi,bj)- RBCtemp(i,j,k,bi,bj) )
>> 
>>         ENDDO
>>        ENDDO
>>      ENDIF
>> 
>> Should this instead use halo-aware indexing like:
>> 
>>      DO j = 1-OLy, sNy+OLy
>>       DO i = 1-OLx, sNx+OLx
>> Is the current gridding intentional, or could this be contributing to the relaxation issues I???m seeing?
>> 
>> Thanks for your time and help!
>> 
>> Best,
>> Katarina
> 
>> _______________________________________________
>> MITgcm-support mailing list
>> MITgcm-support at mitgcm.org
>> http://mailman.mitgcm.org/mailman/listinfo/mitgcm-support
> 
> _______________________________________________
> MITgcm-support mailing list
> MITgcm-support at mitgcm.org
> http://mailman.mitgcm.org/mailman/listinfo/mitgcm-support



More information about the MITgcm-support mailing list