Commit 9da15785 authored by Knut's avatar Knut
Browse files

consistent momentum alternation

parent 3ce54125
......@@ -92,6 +92,7 @@
! Original author(s): Karsten Bolding & Hans Burchard
!
! !LOCAL VARIABLES:
logical,private :: ufirst=.false.
integer :: num_neighbors
REALTYPE :: An_sum
!
......@@ -322,11 +323,11 @@
! !IROUTINE: postinit_2d - re-initialise some 2D after hotstart read.
!
! !INTERFACE:
subroutine postinit_2d(runtype,timestep,hotstart)
subroutine postinit_2d(runtype,timestep,hotstart,MinN)
IMPLICIT NONE
!
! !INPUT PARAMETERS:
integer, intent(in) :: runtype
integer, intent(in) :: runtype,MinN
REALTYPE, intent(in) :: timestep
logical, intent(in) :: hotstart
!
......@@ -352,6 +353,8 @@
LEVEL1 'postinit_2d'
ufirst = ( mod(MinN,2) .eq. 0 )
!
! It is possible that a user changes the land mask and reads an "old" hotstart file.
! In this case the "old" velocities will need to be zeroed out.
......@@ -464,7 +467,7 @@
call uv_diffusion(An_method,U,V,D,DU,DV) ! Has to be called after uv_advect.
call toc(TIM_INTEGR2D)
call momentum(loop,tausx,tausy,airp)
call momentum(loop,tausx,tausy,airp,ufirst)
if (runtype .gt. 1) then
call tic(TIM_INTEGR2D)
Uint=Uint+U
......
......@@ -5,7 +5,7 @@
! !ROUTINE: momentum - 2D-momentum for all interior points.
!
! !INTERFACE:
subroutine momentum(n,tausx,tausy,airp)
subroutine momentum(n,tausx,tausy,airp,ufirst)
!
! !DESCRIPTION:
!
......@@ -26,11 +26,14 @@
REALTYPE, intent(in) :: tausy(E2DFIELD)
REALTYPE, intent(in) :: airp(E2DFIELD)
!
! !INPUT/OUTPUT VARIABLES:
logical, intent(inout) :: ufirst
!
! !REVISION HISTORY:
! Original author(s): Hans Burchard & Karsten Bolding
!
! !LOCAL VARIABLES:
logical :: ufirst=.false.
!
!EOP
!-----------------------------------------------------------------------
!BOC
......
......@@ -66,6 +66,7 @@
! Original author(s): Karsten Bolding & Hans Burchard
!
! !LOCAL VARIABLES:
logical,private :: ufirst=.true.
logical :: advect_turbulence=.false.
#ifdef NO_BAROCLINIC
integer :: ip_method
......@@ -281,13 +282,13 @@
! !IROUTINE: postinit_3d - re-initialise some 3D after hotstart read.
!
! !INTERFACE:
subroutine postinit_3d(runtype,timestep,hotstart)
subroutine postinit_3d(runtype,timestep,hotstart,MinN)
! !USES:
use domain, only: imin,imax,jmin,jmax, az,au,av
IMPLICIT NONE
!
! !INPUT PARAMETERS:
integer, intent(in) :: runtype
integer, intent(in) :: runtype,MinN
REALTYPE, intent(in) :: timestep
logical, intent(in) :: hotstart
!
......@@ -313,6 +314,8 @@
LEVEL1 'postinit_3d'
ufirst = ( mod(int(ceiling((_ONE_*MinN)/M)),2) .eq. 1 )
if (do_numerical_analyses) then
allocate(numdis3d(I3DFIELD),stat=rc)
......@@ -487,7 +490,6 @@
! rotation.
!
! !LOCAL VARIABLES:
logical, save :: ufirst=.true.
!
!EOP
!-------------------------------------------------------------------------
......
......@@ -283,10 +283,10 @@
MinN = MinN+1
end if
call postinit_2d(runtype,timestep,hotstart)
call postinit_2d(runtype,timestep,hotstart,MinN)
#ifndef NO_3D
if (runtype .gt. 1) then
call postinit_3d(runtype,timestep,hotstart)
call postinit_3d(runtype,timestep,hotstart,MinN)
end if
#endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment