/[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.1 - (show annotations) (download)
Mon May 14 19:48:36 2007 UTC (17 years, 1 month ago) by dfer
Branch: MAIN
CVS Tags: checkpoint59e, checkpoint59d, checkpoint59g, checkpoint59f, checkpoint59c, checkpoint59b, checkpoint59i, checkpoint59h
Refreshing the set-up (changing boring salinity-like passive tracer
to a super-fun Age Tracer)

1 C $Header: /u/gcmpack/MITgcm/pkg/ptracers/ptracers_forcing.F,v 1.11 2007/01/09 22:26:03 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 c #include "FFIELDS.h"
24 c #include "DYNVARS.h"
25 #include "GRID.h"
26 #ifdef ALLOW_RBCS
27 #include "PTRACERS_SIZE.h"
28 #include "RBCS.h"
29 #endif
30
31 C !INPUT PARAMETERS: ===================================================
32 C bi,bj :: tile indices
33 C iMin iMax jMin jMax :: working range of tile for applying forcing
34 C k :: vertical level number
35 C iTracer :: tracer number
36 C gPtracer :: the tendency array
37 C surfPtracer :: surface forcing term
38 C myIter :: time-step number
39 C myTime :: model time
40 C myThid :: thread number
41 INTEGER bi,bj,iMin,iMax,jMin,jMax,k,iTracer
42 _RL gPtracer(1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nr,nSx,nSy)
43 _RL surfPtracer(1-Olx:sNx+Olx,1-Oly:sNy+Oly,nSx,nSy)
44 INTEGER myIter
45 _RL myTime
46 INTEGER myThid
47
48 C !OUTPUT PARAMETERS: ==================================================
49 C gPtracer :: updates tendency array
50
51 #ifdef ALLOW_PTRACERS
52
53 C !LOCAL VARIABLES: ====================================================
54 C i,j :: loop indices
55 INTEGER i,j
56 C number of surface interface layer
57 INTEGER kSurface
58 CEOP
59
60 IF ( usingPCoords ) THEN
61 kSurface = Nr
62 ELSE
63 kSurface = 1
64 ENDIF
65
66 C-- Surface forcing term surfPtracer is previously computed by
67 C PTRACERS_FORCING_SURF (and stored as surfaceForcingPtr)
68 C because it is needed by KPP_TRANSPORT_PTR.
69
70 #ifdef ALLOW_GCHEM
71 IF ( useGCHEM )
72 & CALL GCHEM_ADD_TENDENCY(
73 I bi,bj,iMin,iMax,jMin,jMax,k,
74 I iTracer,
75 I myTime,myIter, myThid)
76 #else /* ALLOW_GCHEM */
77 IF ( .NOT. useGCHEM .AND. k .EQ. kSurface ) THEN
78 DO j=jMin,jMax
79 DO i=iMin,iMax
80 gPtracer(i,j,k,bi,bj) = gPtracer(i,j,k,bi,bj)
81 & + surfPtracer(i,j,bi,bj)
82 & *recip_drF(k)*recip_hFacC(i,j,k,bi,bj)
83 ENDDO
84 ENDDO
85 ELSEIF ( .NOT. useGCHEM .AND. k .NE. kSurface ) THEN
86 DO j=jMin,jMax
87 DO i=iMin,iMax
88 gPtracer(i,j,k,bi,bj) = gPtracer(i,j,k,bi,bj)
89 & + 1. _d 0 * maskC(i,j,k,bi,bj)
90 ENDDO
91 ENDDO
92 ENDIF
93 #endif /* ALLOW_GCHEM */
94
95 #ifdef ALLOW_RBCS
96 if (useRBCptracers) then
97 CALL RBCS_ADD_TENDENCY(bi,bj,k,iTracer+2,
98 I myTime, myThid)
99 endif
100 #endif
101
102
103 #endif /* ALLOW_PTRACERS */
104
105 RETURN
106 END

  ViewVC Help
Powered by ViewVC 1.1.22