forked from darwinproject/darwin3
-
Notifications
You must be signed in to change notification settings - Fork 1
/
timestep_tracer.F
69 lines (62 loc) · 2.14 KB
/
timestep_tracer.F
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#include "PACKAGES_CONFIG.h"
#include "CPP_OPTIONS.h"
CBOP
C !ROUTINE: TIMESTEP_TRACER
C !INTERFACE:
SUBROUTINE TIMESTEP_TRACER(
I bi, bj, deltaTLev,
I tracer,
U gTracer,
I myTime, myIter, myThid )
C !DESCRIPTION: \bv
C *==========================================================*
C | S/R TIMESTEP_TRACER
C | o Step model tracer field forward in time
C *==========================================================*
C \ev
C !USES:
IMPLICIT NONE
C == Global variables ===
#include "SIZE.h"
#include "EEPARAMS.h"
#include "PARAMS.h"
#include "GRID.h"
C !INPUT/OUTPUT PARAMETERS:
C == Routine Arguments ==
C bi, bj :: current tile indices
C deltaTLev :: time-step [s] (vertical dimension vector)
C tracer :: tracer field
C gTracer :: input: tracer tendency ; output: updated tracer
C myTime :: current time in simulation
C myIter :: current iteration number
C myThid :: my Thread Id number
INTEGER bi, bj
_RL deltaTLev(Nr)
_RL tracer (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
_RL gTracer(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
_RL myTime
INTEGER myIter, myThid
C !LOCAL VARIABLES:
C == Local variables ==
INTEGER i, j, k
CEOP
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
C- Step tracer forward in time and store provisional value in gTracer array
DO k=1,Nr
DO j=1-OLy,sNy+OLy
DO i=1-OLx,sNx+OLx
gTracer(i,j,k) = tracer(i,j,k)
& + deltaTLev(k)*gTracer(i,j,k)
#ifdef ALLOW_OBCS
CML For the Stevens open boundary conditions, we need to step forward
CML the tracer even on the boundary in order to include surface
CML forcing and (vertical) diffusion contributions. For other cases
CML this mask was meant to avoid unrealistic values on the open boundaries.
CML Lets hope that we can live without this safety net.
C & *maskInC(i,j,bi,bj)
#endif
ENDDO
ENDDO
ENDDO
RETURN
END