ROMS 3.9 MPDATA bugs

Bug reports, work arounds and fixes

Moderators: arango, robertson

Post Reply
Message
Author
chuning
Posts: 4
Joined: Thu Jan 21, 2016 6:06 pm
Location: Rutgers University

ROMS 3.9 MPDATA bugs

#1 Post by chuning » Tue Feb 04, 2020 8:51 am

Hi, when using MPDATA in ROMS 3.9 I found two potential issues in step3d_t.F.

The first one is a typo in line 826

Code: Select all

              DO i=IstrUm2,IstrUm2
Where it should be

Code: Select all

              DO i=IstrUm2,Iendp2i
The second one is related to the logical switches of SPLINES_VDIFF and MPDATA (line 1302-1433). With the current version, when SPLINES_VDIFF and MPDATA are both activated, the whole vertical diffusion section is skipped and tracer concentrations are not written back to t. I did an easy fix

Code: Select all

# ifdef SPLINES_VDIFF
          IF (.not.((Hadvection(itrc,ng)%MPDATA).and.                   &
     &              (Vadvection(itrc,ng)%MPDATA))) THEN
            ...
          ELSE
# endif
!
!  Compute off-diagonal coefficients FC [lambda*dt*Akt/Hz] for the
!  implicit vertical diffusion terms at future time step, located
!  at horizontal RHO-points and vertical W-points.
!  Also set FC at the top and bottom levels.
!
          cff=-dt(ng)*lambda
          ...
          DO k=N(ng)-1,1,-1
            DO i=Istr,Iend
#  ifdef DIAGNOSTICS_TS
              cff1=t(i,j,k,nnew,itrc)*oHz(i,j,k)
#  endif
              DC(i,k)=DC(i,k)-CF(i,k)*DC(i,k+1)
              t(i,j,k,nnew,itrc)=DC(i,k)
#  ifdef DIAGNOSTICS_TS
              DiaTwrk(i,j,k,itrc,iTvdif)=DiaTwrk(i,j,k,itrc,iTvdif)+    &
     &                                   t(i,j,k,nnew,itrc)-cff1
#  endif
            END DO
          END DO
# ifdef SPLINES_VDIFF
          END IF
# endif
This will still put the original vertical diffusion code in when MPDATA is used. The only issue is that it messes with the indentation in built code. Another option is to copy and paste the diffusion code in the SPLINE_VDIFF section.

User avatar
jivica
Posts: 135
Joined: Mon May 05, 2003 2:41 pm
Location: The University of Western Australia, Perth, Australia

Re: ROMS 3.9 MPDATA bugs

#2 Post by jivica » Wed Feb 05, 2020 6:05 am

I wonder if it is related to the post submitted long time ago:

viewtopic.php?f=19&t=4864&p=18889&hilit=MPDATA#p18887


Regards,
Ivica

User avatar
arango
Site Admin
Posts: 1117
Joined: Wed Feb 26, 2003 4:41 pm
Location: IMCS, Rutgers University
Contact:

Re: ROMS 3.9 MPDATA bugs

#3 Post by arango » Thu Feb 06, 2020 11:44 pm

Yes, Great catch :!: Thank you for reporting these two bugs. I updated the :arrow: repositories.

Post Reply