/[MITgcm]/MITgcm/pkg/rbcs/rbcs_add_tendency.F
ViewVC logotype

Annotation of /MITgcm/pkg/rbcs/rbcs_add_tendency.F

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


Revision 1.2 - (hide annotations) (download)
Tue Sep 26 19:29:37 2006 UTC (17 years, 7 months ago) by stephd
Branch: MAIN
CVS Tags: checkpoint58u_post, checkpoint58w_post, checkpoint58r_post, checkpoint58x_post, checkpoint58t_post, checkpoint58q_post, checkpoint59e, checkpoint59d, checkpoint59g, checkpoint59f, checkpoint59a, checkpoint59c, checkpoint59b, checkpoint59h, checkpoint59, checkpoint58y_post, checkpoint58v_post, checkpoint58s_post
Changes since 1.1: +1 -1 lines
o fix bug in rbcs mask for more than one ptracer

1 stephd 1.1
2     #include "CPP_OPTIONS.h"
3     #include "PACKAGES_CONFIG.h"
4    
5     CBOP
6     C !ROUTINE: RBCS_ADD_TSTENDENCY
7    
8     C !INTERFACE: ==========================================================
9     SUBROUTINE RBCS_ADD_TENDENCY(bi,bj,k, tracernum,
10     & myTime, myThid )
11    
12     C !DESCRIPTION:
13     C Will update tendencies with terms to relax to 3-D field
14    
15     C !USES: ===============================================================
16     IMPLICIT NONE
17     #include "SIZE.h"
18     #include "GRID.h"
19     #include "DYNVARS.h"
20     #include "EEPARAMS.h"
21     #include "PARAMS.h"
22     #ifdef ALLOW_PTRACERS
23     #include "PTRACERS_SIZE.h"
24     #include "PTRACERS.h"
25     #endif
26     #include "RBCS.h"
27    
28     C !INPUT PARAMETERS: ===================================================
29     C myThid :: thread number
30     C myIter :: current timestep
31     C myTime :: current time
32     C iTracer :: ptracer number
33     C bi,bj :: tile indices
34     C k :: vertical level
35     INTEGER myThid, myIter
36     _RL myTime
37     INTEGER bi,bj,k
38     INTEGER tracernum
39    
40     C !LOCAL VARIABLES: ====================================================
41     C i,j :: loop indices
42     INTEGER i,j
43     INTEGER iTracer
44     INTEGER irbc
45     CEOP
46    
47     #ifdef ALLOW_RBCS
48    
49     if (tracernum.eq.1) then
50     if (useRBCtemp) then
51     DO j=1,sNy
52     DO i=1,sNx
53     gT(I,J,K,bi,bj) = gT(I,J,K,bi,bj)
54     & - maskC(I,J,K,bi,bj)*
55     & RBC_mask(I,J,K,bi,bj,1)/tauRelaxT*
56     & (theta(I,J,K,bi,bj)-
57     & RBCtemp(I,J,K,bi,bj))
58     ENDDO
59     ENDDO
60     endif
61     endif
62    
63     if (tracernum.eq.2) then
64     if (useRBCsalt) then
65     DO j=1,sNy
66     DO i=1,sNx
67     gS(I,J,K,bi,bj) = gS(I,J,K,bi,bj)
68     & - maskC(I,J,K,bi,bj)*
69     & RBC_mask(I,J,K,bi,bj,2)/tauRelaxS*
70     & (salt(I,J,K,bi,bj)-
71     & RBCsalt(I,J,K,bi,bj))
72     ENDDO
73     ENDDO
74     endif
75     endif
76    
77     #ifdef ALLOW_PTRACERS
78     if (tracernum.gt.2) then
79     iTracer=tracernum-2
80 stephd 1.2 irbc=min(maskLEN,tracernum)
81 stephd 1.1 if (useRBCptracers) then
82     if (useRBCptrnum(iTracer)) then
83     DO j=1,sNy
84     DO i=1,sNx
85     gPtr(I,J,K,bi,bj,iTracer) = gPtr(I,J,K,bi,bj,iTracer)
86     & - maskC(I,J,K,bi,bj)*
87     & RBC_mask(I,J,K,bi,bj,irbc)/tauRelaxPTR(iTracer)*
88     & (pTracer(I,J,K,bi,bj,iTracer)-
89     & RBC_ptracers(I,J,K,bi,bj,iTracer))
90     ENDDO
91     ENDDO
92     endif
93     endif
94     endif
95     #endif
96    
97     #endif /* ALLOW_RBCS */
98    
99     RETURN
100     END

  ViewVC Help
Powered by ViewVC 1.1.22