C================================================ C This subroutine initializes masks C================================================ SUBROUTINE INI_MASKS implicit none #include "SIZE.h" #include "SWE.h" #include "MASKS.h" integer i,j C First set everything to land (0)/ocean (1) based on H do j=1,ny do i=1,nx maskU(i,j)=1. maskV(i,j)=1. if (H(i,j) .LT. 1.e-8) then maskU(i,j)=0. maskU(i+1,j)=0. maskV(i,j)=0. maskV(i,j+1)=0. endif enddo enddo C Now set west/east boundary to 0 or 1 do j=0,ny+1 if (H(0,j) .LT. 1.e-8) then maskU(0,j)=0. maskU(1,j)=0. else maskU(0,j)=1. maskU(1,j)=1. endif if (H(nx+1,j) .LT. 1.e-8) then maskU(nx+1,j)=0. else maskU(nx+1,j)=1. ! true iff periodic in x endif enddo C Now set south/north boundary to 0 or 1 do i=0,nx+1 if (H(i,0) .LT. 1.e-8) then maskV(i,0)=0. maskV(i,1)=0. else maskV(i,0)=1. maskV(i,1)=1. endif if (H(i,ny+1) .LT. 1.e-8) then maskV(i,ny+1)=0. else maskV(i,ny+1)=1. ! true iff periodic in y endif enddo end