Commit af5e236a authored by kbk's avatar kbk
Browse files

iimin,iimax,jjmin,jjmax -> imin,imax,jmin,jmax

parent 360d4cd2
......@@ -119,13 +119,10 @@
! Here the memory-allocation is defined
#define E2DFIELD imin-HALO:imax+HALO,jmin-HALO:jmax+HALO
#define I2DFIELD iimin-HALO:iimax+HALO,jjmin-HALO:jjmax+HALO
#define I3DFIELD iimin-HALO:iimax+HALO,jjmin-HALO:jjmax+HALO,0:kmax
#define I2DFIELD imin-HALO:imax+HALO,jmin-HALO:jmax+HALO
#define I3DFIELD imin-HALO:imax+HALO,jmin-HALO:jmax+HALO,0:kmax
! These defines the do loops for the real inner points..
! that is the points that are independent of neighbours.
#define DO_EILOOP DO i=imin,imax
#define DO_EJLOOP DO j=jmin,jmax
#define DO_IILOOP DO i=iimin,iimax
#define DO_IJLOOP DO j=jjmin,jjmax
!$Id: adaptive_coordinates.F90,v 1.3 2007-04-16 11:05:34 kbk Exp $
!$Id: adaptive_coordinates.F90,v 1.4 2007-06-07 10:25:19 kbk Exp $
#include "cppdefs.h"
!-----------------------------------------------------------------------
!BOP
......@@ -13,7 +13,7 @@
! For Richard to do
!
! !USES:
use domain, only: ga,iimin,iimax,jjmin,jjmax,kmax,H,HU,HV,az,au,av
use domain, only: ga,imin,imax,jmin,jmax,kmax,H,HU,HV,az,au,av
use variables_3d, only: dt,kmin,kumin,kvmin,ho,hn,huo,hvo,hun,hvn
use variables_3d, only: sseo,ssen,ssuo,ssun,ssvo,ssvn
use variables_3d, only: kmin_pmz,kumin_pmz,kvmin_pmz
......@@ -123,20 +123,20 @@ STDERR 'adaptive_coordinates()'
kmaxm1= _ONE_/float(kmax)
! Dirty way to read initial distribution (as equidistant sigma coordinates):
do j=jjmin,jjmax
do i=iimin,iimax
do j=jmin,jmax
do i=imin,imax
ho(i,j,:)=(sseo(i,j)+H(i,j))*kmaxm1
hn(i,j,:)=(ssen(i,j)+H(i,j))*kmaxm1
end do
end do
do j=jjmin,jjmax
do i=iimin-1,iimax
do j=jmin,jmax
do i=imin-1,imax
huo(i,j,:)=(ssuo(i,j)+HU(i,j))*kmaxm1
hun(i,j,:)=(ssun(i,j)+HU(i,j))*kmaxm1
end do
end do
do j=jjmin-1,jjmax
do i=iimin,iimax
do j=jmin-1,jmax
do i=imin,imax
hvo(i,j,:)=(ssvo(i,j)+HV(i,j))*kmaxm1
hvn(i,j,:)=(ssvn(i,j)+HV(i,j))*kmaxm1
end do
......@@ -154,8 +154,8 @@ STDERR 'adaptive_coordinates()'
ho=hn
! Lagrangian and thickness filtering step
do k=1,kmax
do j=jjmin+1,jjmax-1
do i=iimin+1,iimax-1
do j=jmin+1,jmax-1
do i=imin+1,imax-1
hn(i,j,k)=ho(i,j,k) &
-((uu(i,j,k)*DYU-uu(i-1,j ,k)*DYUIM1) &
+(vv(i,j,k)*DXV-vv(i ,j-1,k)*DXVJM1)) &
......@@ -184,15 +184,15 @@ STDERR 'adaptive_coordinates()'
! For problem zones (boundaries, thin layers), put zero 'horizontal diffusion'
do k=1,kmax-1
do j=jjmin,jjmax
do i=iimin,iimax
do j=jmin,jmax
do i=imin,imax
if (au(i,j).eq.1) work2(i,j,k)=_ONE_
end do
end do
end do
do k=2,kmax
do j=jjmin,jjmax
do i=iimin+1,iimax
do j=jmin,jmax
do i=imin+1,imax
if ((zpos(i,j,k)-zpos(i,j,k-1)).lt.depthmin) then
work2(i ,j,k )=0
work2(i ,j,k-1)=0
......@@ -203,15 +203,15 @@ STDERR 'adaptive_coordinates()'
end do
end do
do k=1,kmax
do j=jjmin,jjmax
do i=iimin,iimax
do j=jmin,jmax
do i=imin,imax
if (av(i,j).eq.1) work3(i,j,k)=_ONE_
end do
end do
end do
do k=2,kmax
do j=jjmin+1,jjmax
do i=iimin,iimax
do j=jmin+1,jmax
do i=imin,imax
if((zpos(i,j,k)-zpos(i,j,k-1)).lt.depthmin) then
work3(i,j,k)=0
work3(i,j,k-1)=0
......@@ -226,12 +226,12 @@ STDERR 'adaptive_coordinates()'
! Dirty BC
zposo=zpos
do k=1,kmax-1
do j=jjmin+1,jjmax-1
do i=iimin+1,iimax-1
do j=jmin+1,jmax-1
do i=imin+1,imax-1
rm=0
im=0
do iii=max(iimin,i-iw),min(iimax,i+iw)
do jjj=max(jjmin,j-iw),min(jjmax,j+iw)
do iii=max(imin,i-iw),min(imax,i+iw)
do jjj=max(jmin,j-iw),min(jmax,j+iw)
rm=rm+az(iii,jjj)*(rho(iii,jjj,k+1)+rho(iii,jjj,k))
im=im+az(iii,jjj)
end do
......@@ -252,8 +252,8 @@ STDERR 'adaptive_coordinates()'
end do
! Local consistency
do k=1,kmax
do j=jjmin,jjmax
do i=iimin,iimax
do j=jmin,jmax
do i=imin,imax
if((zpos(i,j,k)-zpos(i,j,k-1)).lt.depthmin) then
zpos(i,j,k)=zpos(i,j,k-1)+depthmin
endif
......@@ -269,8 +269,8 @@ STDERR 'adaptive_coordinates()'
call htoz(hn,zpos)
dtgrid=dt/float(split)
do j=jjmin,jjmax
do i=iimin,iimax
do j=jmin,jmax
do i=imin,imax
if (az(i,j) .eq. 1) then
NNloc=NN(i,j,:)
SSloc=SS(i,j,:)
......@@ -348,24 +348,24 @@ STDERR 'adaptive_coordinates()'
! uu
huo=hun
do k=1,kmax
do j=jjmin,jjmax
do i=iimin,iimax-1
do j=jmin,jmax
do i=imin,imax-1
hun(i,j,k)=0.5*(hn(i,j,k)+hn(i+1,j,k))
end do
end do
end do
! maybe not allowed in iimax....
! maybe not allowed in imax....
call hcheck(hun,ssun,hu)
! vv
hvo=hvn
do k=1,kmax
do j=jjmin,jjmax-1
do i=iimin,iimax
do j=jmin,jmax-1
do i=imin,imax
hvn(i,j,k)=0.5*(hn(i,j,k)+hn(i,j+1,k))
end do
end do
end do
! maybe not allowed in jjmax....
! maybe not allowed in jmax....
call hcheck(hvn,ssvn,hv)
#ifdef DEBUG
......
......@@ -31,8 +31,7 @@
! \end{enumerate}
!
! !USES:
use domain, only: imin,imax,jmin,jmax
use domain, only: iimin,iimax,jjmin,jjmax,kmax
use domain, only: imin,imax,jmin,jmax,kmax
use halo_zones, only: update_3d_halo,wait_halo,D_TAG
IMPLICIT NONE
!
......@@ -272,14 +271,14 @@
call u_split_adv(dt,f,uu,hun,delxu,delyu,area_inv,au,a2,&
hor_adv,az,AH)
call update_3d_halo(f,f,az,&
iimin,jjmin,iimax,jjmax,kmax,D_TAG)
imin,jmin,imax,jmax,kmax,D_TAG)
call wait_halo(D_TAG)
#ifndef SLICE_MODEL
call v_split_adv(dt,f,vv,hvn,delxv,delyv,area_inv,av,a2,&
hor_adv,az,AH)
call update_3d_halo(f,f,az,&
iimin,jjmin,iimax,jjmax,kmax,D_TAG)
imin,jmin,imax,jmax,kmax,D_TAG)
call wait_halo(D_TAG)
#endif
......@@ -294,14 +293,14 @@
call u_split_adv(dt,f,uu,hun,delxu,delyu,area_inv,au,a1,&
hor_adv,az,AH)
call update_3d_halo(f,f,az, &
iimin,jjmin,iimax,jjmax,kmax,D_TAG)
imin,jmin,imax,jmax,kmax,D_TAG)
call wait_halo(D_TAG)
#ifndef SLICE_MODEL
call v_split_adv(dt,f,vv,hvn,delxv,delyv,area_inv,av,a1,&
hor_adv,az,AH)
call update_3d_halo(f,f,az, &
iimin,jjmin,iimax,jjmax,kmax,D_TAG)
imin,jmin,imax,jmax,kmax,D_TAG)
call wait_halo(D_TAG)
#endif
......@@ -312,7 +311,7 @@
call w_split_adv(dt,f,ww,az,a2,ver_adv)
#endif
call update_3d_halo(f,f,az, &
iimin,jjmin,iimax,jjmax,kmax,D_TAG)
imin,jmin,imax,jmax,kmax,D_TAG)
call wait_halo(D_TAG)
end if
......@@ -320,14 +319,14 @@
call v_split_adv(dt,f,vv,hvn,delxv,delyv,area_inv,av,a1,&
hor_adv,az,AH)
call update_3d_halo(f,f,az, &
iimin,jjmin,iimax,jjmax,kmax,D_TAG)
imin,jmin,imax,jmax,kmax,D_TAG)
call wait_halo(D_TAG)
#endif
call u_split_adv(dt,f,uu,hun,delxu,delyu,area_inv,au,a1,&
hor_adv,az,AH)
call update_3d_halo(f,f,az, &
iimin,jjmin,iimax,jjmax,kmax,D_TAG)
imin,jmin,imax,jmax,kmax,D_TAG)
call wait_halo(D_TAG)
case (2)
......
!$Id: bdy_3d.F90,v 1.11 2006-08-25 09:00:19 kbk Exp $
!$Id: bdy_3d.F90,v 1.12 2007-06-07 10:25:19 kbk Exp $
#include "cppdefs.h"
!-----------------------------------------------------------------------
!BOP
......@@ -15,8 +15,7 @@
!
! !USES:
use halo_zones, only : H_TAG,U_TAG,V_TAG
use domain, only: imin,jmin,imax,jmax,H,az,au,av
use domain, only: iimin,jjmin,iimax,jjmax,kmax
use domain, only: imin,jmin,imax,jmax,kmax,H,az,au,av
use domain, only: nsbv,NWB,NNB,NEB,NSB,bdy_index
use domain, only: wi,wfj,wlj,nj,nfi,nli,ei,efj,elj,sj,sfi,sli
use variables_3d
......@@ -131,17 +130,17 @@
case (1)
! Lateral zero-gradient boundary condition (north & south)
do k=1,kmax
do i=iimin,iimax
if (au(i,jjmin) .eq. 3) field(i,jjmin,k)=field(i,jjmin+1,k)
if (au(i,jjmax) .eq. 3) field(i,jjmax,k)=field(i,jjmax-1,k)
do i=imin,imax
if (au(i,jmin) .eq. 3) field(i,jmin,k)=field(i,jmin+1,k)
if (au(i,jmax) .eq. 3) field(i,jmax,k)=field(i,jmax-1,k)
end do
end do
case (2)
! Lateral zero-gradient boundary conditions (west & east)
do k=1,kmax
do j=jjmin,jjmax
if (av(iimin,j) .eq. 3) field(iimin,j,k)=field(iimin+1,j,k)
if (av(iimax,j) .eq. 3) field(iimax,j,k)=field(iimax-1,j,k)
do j=jmin,jmax
if (av(imin,j) .eq. 3) field(imin,j,k)=field(imin+1,j,k)
if (av(imax,j) .eq. 3) field(imax,j,k)=field(imax-1,j,k)
end do
end do
case default
......
!$Id: bottom_friction_3d.F90,v 1.9 2006-03-01 15:54:08 kbk Exp $
!$Id: bottom_friction_3d.F90,v 1.10 2007-06-07 10:25:19 kbk Exp $
#include "cppdefs.h"
!-----------------------------------------------------------------------
!BOP
......@@ -46,7 +46,7 @@
!
! !USES:
use parameters, only: kappa,avmmol
use domain, only: iimin,iimax,jjmin,jjmax,kmax,au,av,min_depth
use domain, only: imin,imax,jmin,jmax,kmax,au,av,min_depth
use variables_2d, only: zub,zvb,zub0,zvb0
use variables_3d, only: kumin,kvmin,uu,vv,huo,hun,hvo,hvn,rru,rrv
IMPLICIT NONE
......@@ -87,8 +87,8 @@
end if
#endif
do j=jjmin,jjmax
do i=iimin,iimax
do j=jmin,jmax
do i=imin,imax
if (au(i,j) .ge. 1) then
kk = kumin(i,j)
uuloc(i,j)=uu(i,j,kk)/(huo(i,j,kk))
......@@ -110,8 +110,8 @@
end do
end do
do j=jjmin,jjmax
do i=iimin,iimax
do j=jmin,jmax
do i=imin,imax
if (av(i,j) .ge. 1) then
kk = kvmin(i,j)
#if 0
......@@ -134,8 +134,8 @@
end do
#if 1
do j=jjmin,jjmax
do i=iimin,iimax
do j=jmin,jmax
do i=imin,imax
if (au(i,j) .ge. 1) then
hh=max(min_depth/kmax,hun(i,j,kumin(i,j)))
r=(zub(i,j)+0.5*hh)/zub(i,j)
......@@ -151,8 +151,8 @@
#endif
#if 1
do j=jjmin,jjmax
do i=iimin,iimax
do j=jmin,jmax
do i=imin,imax
if (av(i,j) .ge. 1) then
hh=max(min_depth/kmax,hvn(i,j,kvmin(i,j)))
r=(zvb(i,j)+0.5*hh)/zvb(i,j)
......
......@@ -5,13 +5,13 @@
! !DESCRIPTION:
!
! !USES:
use domain, only: iimin,iimax,jjmin,jjmax,kmax,H
use domain, only: imin,imax,jmin,jmax,kmax,H
IMPLICIT NONE
REALTYPE :: zpos(I3DFIELD),hn(I3DFIELD),depthmin
integer :: i,j,k
do k=1,kmax
do j=jjmin,jjmax
do i=iimin,iimax
do j=jmin,jmax
do i=imin,imax
hn(i,j,k)= zpos(i,j,k)-zpos(i,j,k-1)
hn(i,j,k)=max(hn(i,j,k),depthmin)
enddo
......@@ -26,13 +26,13 @@
! !DESCRIPTION:
!
! !USES:
use domain, only: iimin,iimax,jjmin,jjmax,kmax,H
use domain, only: imin,imax,jmin,jmax,kmax,H
IMPLICIT NONE
REALTYPE :: zpos(I3DFIELD),hn(I3DFIELD),depthmin
integer :: i,j,k
! write(6,*) 'htoz',iimax,hn(iimax/2,2,kmax/2),H(iimax/2,2)
do j=jjmin,jjmax
do i=iimin,iimax
! write(6,*) 'htoz',imax,hn(imax/2,2,kmax/2),H(imax/2,2)
do j=jmin,jmax
do i=imin,imax
zpos(i,j,0)=-H(i,j)
do k=1,kmax
zpos(i,j,k)=zpos(i,j,k-1)+hn(i,j,k)
......@@ -47,15 +47,15 @@
! !DESCRIPTION:
!
! !USES:
use domain, only: iimin,iimax,jjmin,jjmax,kmax
use domain, only: imin,imax,jmin,jmax,kmax
IMPLICIT NONE
REALTYPE :: ssen(I2DFIELD),hn(I3DFIELD)
REALTYPE :: h(I2DFIELD),HH,depthmin
integer :: i,j,k
! Final check of layer thicnkess thoug not necessary if zpos treated correctly
! write(6,*) 'Inside',hn(iimax/2,2,kmax/2)
do j=jjmin,jjmax
do i=iimin,iimax
! write(6,*) 'Inside',hn(imax/2,2,kmax/2)
do j=jmin,jmax
do i=imin,imax
HH=0.
do k=1,kmax
HH=HH+hn(i,j,k)
......@@ -65,7 +65,7 @@
end do
end do
end do
! write(6,*) 'Inside after',hn(iimax/2,2,kmax/2)
! write(6,*) 'Inside after',hn(imax/2,2,kmax/2)
return
end
......
!$Id: coordinates.F90,v 1.13 2007-03-30 13:10:59 hb Exp $
!$Id: coordinates.F90,v 1.14 2007-06-07 10:25:19 kbk Exp $
#include "cppdefs.h"
!-----------------------------------------------------------------------
!BOP
......@@ -127,7 +127,7 @@ STDERR 'coordinates(): adaptive_coordinates not coded yet'
end if ! first
#ifdef SLICE_MODEL
do i=iimin,iimax
do i=imin,imax
do k=kvmin(i,2),kmax
hvo(i,1,k)=hvo(i,2,k)
hvo(i,3,k)=hvo(i,2,k)
......
!$Id: eqstate.F90,v 1.9 2007-02-23 12:20:36 kbk Exp $
!$Id: eqstate.F90,v 1.10 2007-06-07 10:25:19 kbk Exp $
#include "cppdefs.h"
!-----------------------------------------------------------------------
!BOP
......@@ -103,7 +103,7 @@
! Here, the equation of state is calculated for every 3D grid point.
!
! !USES:
use domain, only: iimin,iimax,jjmin,jjmax,kmax,az
use domain, only: imin,imax,jmin,jmax,kmax,az
use variables_3d, only: T,S,rho,buoy
IMPLICIT NONE
!
......@@ -130,22 +130,22 @@
#define BUOYANCY
select case (eqstate_method)
case (1)
forall(i=iimin-1:iimax+1,j=jjmin-1:jjmax+1,az(i,j) .gt. 0) &
forall(i=imin-1:imax+1,j=jmin-1:jmax+1,az(i,j) .gt. 0) &
rho(i,j,1:kmax) = rho_0 + &
dtr0*(T(i,j,1:kmax)-T0) + dsr0*(S(i,j,1:kmax)-S0)
#ifdef HAIDVOGEL_TEST
forall(i=iimin-1:iimax+1,j=jjmin-1:jjmax+1,az(i,j) .gt. 0) &
forall(i=imin-1:imax+1,j=jmin-1:jmax+1,az(i,j) .gt. 0) &
rho(i,j,1:kmax) = 1000. + S(i,j,1:kmax)
#endif
#ifdef CONSTANCE_TEST
forall(i=iimin-1:iimax+1,j=jjmin-1:jjmax+1,az(i,j) .gt. 0) &
forall(i=imin-1:imax+1,j=jmin-1:jmax+1,az(i,j) .gt. 0) &
rho(i,j,1:kmax) = 1000. + *dtr0*(T(i,j,1:kmax)-T0)
#endif
case (2)
do k = 1,kmax
do j = jjmin-1,jjmax+1
do i = iimin-1,iimax+1
do j = jmin-1,jmax+1
do i = imin-1,imax+1
if (az(i,j) .gt. 0) then
T1 = T(i,j,k)
T2 = T1*T1
......
!$Id: fct_2dh_adv.F90,v 1.5 2006-03-01 16:03:32 kbk Exp $
!$Id: fct_2dh_adv.F90,v 1.6 2007-06-07 10:25:19 kbk Exp $
#include "cppdefs.h"
!-----------------------------------------------------------------------
!BOP
......@@ -25,8 +25,7 @@
! one-dimensional directioal-split schemes might compute negative intermediate
!
! !USES:
use domain, only: imin,imax,jmin,jmax
use domain, only: iimin,iimax,jjmin,jjmax,kmax
use domain, only: imin,imax,jmin,jmax,kmax
use advection_3d, only: hi,hio
IMPLICIT NONE
!
......@@ -105,8 +104,8 @@
flx = _ZERO_
do k=1,kmax ! Calculating u-interface low-order fluxes !
do j=jjmin,jjmax
do i=iimin-1,iimax
do j=jmin,jmax
do i=imin-1,imax
if (uu(i,j,k) .gt. _ZERO_) then
flx(i,j,k)=uu(i,j,k)*f(i,j,k)
else
......@@ -118,8 +117,8 @@
fly = _ZERO_
do k=1,kmax ! Calculating v-interface low-order fluxes !
do j=jjmin-1,jjmax
do i=iimin,iimax
do j=jmin-1,jmax
do i=imin,imax
if (vv(i,j,k) .gt. _ZERO_) then
fly(i,j,k)=vv(i,j,k)*f(i,j,k)
else
......@@ -131,8 +130,8 @@
fhx = _ZERO_
do k=1,kmax ! Calculating u-interface high-order fluxes !
do j=jjmin,jjmax
do i=iimin-1,iimax
do j=jmin,jmax
do i=imin-1,imax
uuu=uu(i,j,k)/hun(i,j,k)*dt/delxu(i,j)
vvv=0.25*(vv(i ,j-1,k)/hvn(i ,j-1,k) &
+vv(i ,j ,k)/hvn(i ,j ,k) &
......@@ -198,8 +197,8 @@
fhy = _ZERO_
do k=1,kmax ! Calculating v-interface high-order fluxes !
do j=jjmin-1,jjmax
do i=iimin,iimax
do j=jmin-1,jmax
do i=imin,imax
uuu=vv(i,j,k)*dt/delyv(i,j)
vvv=0.25*( &
uu(i-1,j,k)/hun(i-1,j,k) &
......@@ -267,8 +266,8 @@
! Calculate intermediate low resolution solution fi
do k=1,kmax
do j=jjmin,jjmax
do i=iimin,iimax
do j=jmin,jmax
do i=imin,imax
if (az(i,j) .eq. 1) then
hio(i,j,k)=hi(i,j,k)
hi(i,j,k)=hio(i,j,k) &
......@@ -286,8 +285,8 @@
! Calculating and applying the flux limiter
do k=1,kmax
do j=jjmin,jjmax
do i=iimin,iimax
do j=jmin,jmax
do i=imin,imax
if (az(i,j) .eq. 1) then
cmin(i,j,k)= 10000.
cmax(i,j,k)=-10000.
......@@ -331,8 +330,8 @@
! Limiters for the u-fluxes (fac)
do k=1,kmax
do j=jjmin,jjmax
do i=iimin-1,iimax
do j=jmin,jmax
do i=imin-1,imax
if (fhx(i,j,k)-flx(i,j,k).ge.0.) then
fac=min(rm(i,j,k),rp(i+1,j,k))
else
......@@ -348,8 +347,8 @@
! Limiters for the v-fluxes (fac)
do k=1,kmax
do j=jjmin-1,jjmax
do i=iimin,iimax
do j=jmin-1,jmax
do i=imin,imax
if (fhy(i,j,k)-fly(i,j,k).ge.0.) then
fac=min(rm(i,j,k),rp(i,j+1,k))
else
......@@ -366,8 +365,8 @@
! Doing the full advection in one step
do k=1,kmax
do j=jjmin,jjmax
do i=iimin,iimax
do j=jmin,jmax
do i=imin,imax
if (az(i,j) .eq. 1) then
! CAUTION: hi(i,j,k) already calculated above
f(i,j,k)=(f(i,j,k)*hio(i,j,k) &
......
!$Id: general_coordinates.F90,v 1.1 2007-03-29 12:28:22 kbk Exp $
!$Id: general_coordinates.F90,v 1.2 2007-06-07 10:25:19 kbk Exp $