/[MITgcm]/MITgcm/verification/tutorial_global_oce_latlon/code/ptracers_forcing.F
ViewVC logotype

Contents of /MITgcm/verification/tutorial_global_oce_latlon/code/ptracers_forcing.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.5 - (show annotations) (download)
Mon Apr 25 20:56:16 2011 UTC (13 years, 1 month ago) by dfer
Branch: MAIN
CVS Tags: checkpoint64y, checkpoint64x, checkpoint64q, checkpoint64p, checkpoint64s, checkpoint64r, checkpoint64u, checkpoint64t, checkpoint64w, checkpoint64v, checkpoint64i, checkpoint64h, checkpoint64k, checkpoint64j, checkpoint64m, checkpoint64l, checkpoint64o, checkpoint64n, checkpoint64a, checkpoint64c, checkpoint64b, checkpoint64e, checkpoint64d, checkpoint64g, checkpoint64f, checkpoint63p, checkpoint63q, checkpoint63r, checkpoint63s, checkpoint63l, checkpoint63m, checkpoint63n, checkpoint63o, checkpoint63h, checkpoint63i, checkpoint63j, checkpoint63k, checkpoint63d, checkpoint63e, checkpoint63f, checkpoint63g, checkpoint63a, checkpoint63b, checkpoint63c, checkpoint64, checkpoint63, checkpoint62w, checkpoint62z, checkpoint62y, checkpoint62x
Changes since 1.4: +4 -8 lines
Bring up to date with ref subroutine in pkg/ptracers

1 C $Header: /u/gcmpack/MITgcm/verification/tutorial_global_oce_latlon/code/ptracers_forcing.F,v 1.4 2010/08/24 15:15:00 jmc Exp $
2 C $Name: $
3
4 #include "PTRACERS_OPTIONS.h"
5
6 CBOP
7 C !ROUTINE: PTRACERS_FORCING
8
9 C !INTERFACE: ==========================================================
10 SUBROUTINE PTRACERS_FORCING(
11 I bi,bj,iMin,iMax,jMin,jMax,k,iTracer,
12 U gPtracer,surfPtracer,
13 I myIter,myTime,myThid )
14
15 C !DESCRIPTION:
16 C Adds sources and sinks of passive tracers to the tendency arrays
17
18 C !USES: ===============================================================
19 IMPLICIT NONE
20 #include "SIZE.h"
21 #include "EEPARAMS.h"
22 #include "PARAMS.h"
23 #include "GRID.h"
24
25 C !INPUT PARAMETERS: ===================================================
26 C bi,bj :: tile indices
27 C iMin iMax jMin jMax :: working range of tile for applying forcing
28 C k :: vertical level number
29 C iTracer :: tracer number
30 C gPtracer :: the tendency array
31 C surfPtracer :: surface forcing term
32 C myIter :: time-step number
33 C myTime :: model time
34 C myThid :: thread number
35 INTEGER bi,bj,iMin,iMax,jMin,jMax,k,iTracer
36 _RL gPtracer(1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nr,nSx,nSy)
37 _RL surfPtracer(1-Olx:sNx+Olx,1-Oly:sNy+Oly,nSx,nSy)
38 INTEGER myIter
39 _RL myTime
40 INTEGER myThid
41
42 C !OUTPUT PARAMETERS: ==================================================
43 C gPtracer :: updates tendency array
44
45 #ifdef ALLOW_PTRACERS
46
47 C !LOCAL VARIABLES: ====================================================
48 C i,j :: loop indices
49 INTEGER i,j
50 C number of surface interface layer
51 INTEGER kSurface
52 CEOP
53
54 IF ( usingPCoords ) THEN
55 kSurface = Nr
56 ELSE
57 kSurface = 1
58 ENDIF
59
60 C-- Surface forcing term surfPtracer is previously computed by
61 C PTRACERS_FORCING_SURF (and stored as surfaceForcingPTr)
62 C because it is needed by KPP_TRANSPORT_PTR.
63
64 #ifdef ALLOW_GCHEM
65 IF ( useGCHEM )
66 & CALL GCHEM_ADD_TENDENCY(
67 I bi,bj,iMin,iMax,jMin,jMax,k,
68 I iTracer,
69 I myTime,myIter, myThid)
70 #endif /* ALLOW_GCHEM */
71
72 IF ( k .EQ. kSurface ) THEN
73 DO j=jMin,jMax
74 DO i=iMin,iMax
75 gPtracer(i,j,k,bi,bj) = gPtracer(i,j,k,bi,bj)
76 & + surfPtracer(i,j,bi,bj)
77 & *recip_drF(k)*recip_hFacC(i,j,k,bi,bj)
78 ENDDO
79 ENDDO
80 ELSEIF ( k .NE. kSurface ) THEN
81 DO j=jMin,jMax
82 DO i=iMin,iMax
83 gPtracer(i,j,k,bi,bj) = gPtracer(i,j,k,bi,bj)
84 & + 1. _d 0 * maskC(i,j,k,bi,bj)
85 ENDDO
86 ENDDO
87 ENDIF
88
89 #ifdef ALLOW_RBCS
90 IF ( useRBCS ) THEN
91 CALL RBCS_ADD_TENDENCY(
92 I bi,bj,k,iTracer+2,
93 I myTime, myThid )
94 ENDIF
95 #endif /* ALLOW_RBCS */
96
97 #endif /* ALLOW_PTRACERS */
98
99 RETURN
100 END

  ViewVC Help
Powered by ViewVC 1.1.22