Boundary error

General scientific issues regarding ROMS

Moderators: arango, robertson

Post Reply
Message
Author
zdcgl9862
Posts: 7
Joined: Sun Oct 28, 2012 6:56 pm
Location: sun yat-sen university

Boundary error

#1 Unread post by zdcgl9862 »

Hello,everyone
I have a problem when I rum the ROMS,the depth and mask are wrong on the boundary. The depth and the mask are correct in the file grd.nc, but it is change west,east,south and north over in file his.nc. That is to say, the south and north boundary have be switched while the west and east switched. I don't know what happen, and just think some Syntax is wrong in ROMS.

User avatar
kate
Posts: 4088
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: Boundary error

#2 Unread post by kate »

Did you pick a periodic boundary condition for LBC in your ocean.in?

zdcgl9862
Posts: 7
Joined: Sun Oct 28, 2012 6:56 pm
Location: sun yat-sen university

Re: Boundary error

#3 Unread post by zdcgl9862 »

Yes, I did. At first, I pick periodic boundary condition for the south and east acoording with the reality, but the model Blowing-up. Then I pick periodic boundary condition for the weat and north change the reality over, and the model run over. when I view the results, I find that error. The depth and the mask are correct on lateral boundary in the file grd.nc, but it is change west,east,south and north over in file his.nc.

User avatar
kate
Posts: 4088
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: Boundary error

#4 Unread post by kate »

A periodic boundary means that you have a situation (like a donut) in which everything matches east and west. Everything going out the east comes in the west. The land mask and the bathymetry should match east and west so that when the model switches them, it is the same before and after. I can't think of a reason to have east periodic without also making west periodic. It is both or neither.

zdcgl9862
Posts: 7
Joined: Sun Oct 28, 2012 6:56 pm
Location: sun yat-sen university

Re: Boundary error

#5 Unread post by zdcgl9862 »

Tanks for your reply! I have tried many ways. when I used the ROMS3.2 or ROMS3.4, the problem has been disappeared. But it is still existed while I use the ROMS3.6.

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

Re: Boundary error

#6 Unread post by arango »

This is a problem in your configuration and not in ROMS. All the versions of ROMS are tested with periodic boundary conditions before they are released. Obviously, you are doing something wrong here. Your previous posts indicate that you have a misunderstanding about periodic boundary conditions.

It is also possible that your grid NetCDF file is wrong. If you have periodic boundary conditions, all the fields in the NetCDF file need to be periodic except the position arrays: Cartesian (x_rho, y_rho, x_psi, y_psi, x_u, y_u, x_v, y_v) or spherical (lon_rho, lat_rho, lon_psi, lat_psi, lon_u, lat_u, lon_v, lat_v). Many users of Matlab and third-party scripts need to be aware of transposing the matrix in squared grids (Lm=Mm). I have mentioned so may times in this forum that squared grids are very dangerous because you can transpose the data matrix very easily and there is not way to get an error when writing data into the NetCDF file.

If your grid NetCDF is periodic, you need to configure ROMS with periodic boundary conditions ALWAYS.

zdcgl9862
Posts: 7
Joined: Sun Oct 28, 2012 6:56 pm
Location: sun yat-sen university

Re: Boundary error

#7 Unread post by zdcgl9862 »

I have played the contour of the depth in his.nc,and found the problem in ROMS3.6. I don't know the reason.
Attachments
the depth in his.nc used ROMS3.4:
the depth in his.nc used ROMS3.4:
the depth in his.nc used ROMS3.6:
the depth in his.nc used ROMS3.6:

User avatar
kate
Posts: 4088
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: Boundary error

#8 Unread post by kate »

With this sort of domain you don't want periodic boundary conditions. Did you turn them on?

zdcgl9862
Posts: 7
Joined: Sun Oct 28, 2012 6:56 pm
Location: sun yat-sen university

Re: Boundary error

#9 Unread post by zdcgl9862 »

The forcing of my case is the tidal bounary conditions that are derived from TPXO8.0.
And my Lateral Boundary Condition is as follows:

Code: Select all

!                   W       S       E       N
!                   e       o       a       o
!                   s       u       s       r
!                   t       t       t       t
!                           h               h
!
!                   1       2       3       4

   LBC(isFsur) ==   Clo     Cha     Cha     Clo           ! free-surface
   LBC(isUbar) ==   Clo     Per     Per     Clo           ! 2D U-momentum
   LBC(isVbar) ==   Clo     Per     Per     Clo           ! 2D V-momentum
   LBC(isUvel) ==   Clo     Per     Per     Clo           ! 3D U-momentum
   LBC(isVvel) ==   Clo     Per     Per     Clo           ! 3D V-momentum
   LBC(isMtke) ==   Clo     Per     Per     Clo           ! mixing TKE

   LBC(isTvar) ==   Clo     Per     Per     Clo   \       ! temperature
                    Clo     Per     Per     Clo           ! salinity

! Adjoint-based algorithms can have different lateral boundary
! conditions keywords.

ad_LBC(isFsur) ==   Clo     Cha     Cha     Clo           ! free-surface
ad_LBC(isUbar) ==   Clo     Per     Per     Clo           ! 2D U-momentum
ad_LBC(isVbar) ==   Clo     Per     Per     Clo           ! 2D U-momentum
ad_LBC(isUvel) ==   Clo     Per     Per     Clo           ! 3D U-momentum
ad_LBC(isVvel) ==   Clo     Per     Per     Clo           ! 3D V-momentum
ad_LBC(isMtke) ==   Clo     Per     Per     Clo           ! mixing TKE

ad_LBC(isTvar) ==   Clo     Per     Per     Clo   \       ! temperature
                    Clo     Per     Per     Clo           ! salinity

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

Re: Boundary error

#10 Unread post by arango »

Like I said, you have a huge misunderstanding about periodic boundary conditions. Periodic boundary conditions are applied in boundary pairs. If you want the eastern boundary to be periodic, the western boundary must be periodic also and vice versa. It you want the southern boundary to be periodic, the northern boundary must be periodic also and vice versa. The periodicity form a annulus in the periodic direction :!: The information exiting the eastern boundary will enter the western boundary. Similarly, the information exiting the northern boundary will enter the southern boundary. It is that simple :!:

In older version of ROMS, we have EW_PERIODIC (for east-west periodic boundaries) and NS_PERIODIC (fort north-south periodic boundaries). They are set on pairs.

I have to put an error message in ROMS now to notify users of such a huge mistake. It will never occurred to me that an user will use the periodicity in this way.

Where is your curiosity? You just need to look :arrow: wikipedia to understand periodic boundary conditions. Or more importantly, to look the code for periodic boundary conditions (exchange_2d.F or exchange_3d.F):

Code: Select all

        IF (EW_exchange) THEN
          IF (DOMAIN(ng)%Western_Edge(tile)) THEN
            DO j=Jmin,Jmax
              A(Lm(ng)+1,j)=A(1,j)
              A(Lm(ng)+2,j)=A(2,j)
            END DO
            IF (NghostPoints.eq.3) THEN
              DO j=Jmin,Jmax
                A(Lm(ng)+3,j)=A(3,j)
              END DO
            END IF
          END IF
          IF (DOMAIN(ng)%Eastern_Edge(tile)) THEN
            DO j=Jmin,Jmax
              A(-2,j)=A(Lm(ng)-2,j)
              A(-1,j)=A(Lm(ng)-1,j)
              A( 0,j)=A(Lm(ng)  ,j)
            END DO
          END IF
        END IF
:idea: :idea: :idea: Finally, you cannot have periodic boundary conditions with a bathymetry like the one above :!: The bathymetry values must be the same in the periodic direction.

zdcgl9862
Posts: 7
Joined: Sun Oct 28, 2012 6:56 pm
Location: sun yat-sen university

Re: Boundary error

#11 Unread post by zdcgl9862 »

Thanks very much for your detial instructions. I have undstand the boundary conditions,and the problem had been solved.

Post Reply