/[MITgcm]/MITgcm/pkg/generic_advdiff/gad_c2_adv_r.F
ViewVC logotype

Annotation of /MITgcm/pkg/generic_advdiff/gad_c2_adv_r.F

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


Revision 1.3 - (hide annotations) (download)
Thu Sep 20 20:07:06 2001 UTC (22 years, 8 months ago) by adcroft
Branch: MAIN
Changes since 1.2: +28 -11 lines
Added comments in form compatible with "protex".

1 adcroft 1.3 C $Header: /u/gcmpack/models/MITgcmUV/pkg/generic_advdiff/gad_c2_adv_r.F,v 1.2 2001/07/12 00:30:27 jmc Exp $
2 jmc 1.2 C $Name: $
3 adcroft 1.1
4     #include "GAD_OPTIONS.h"
5    
6 adcroft 1.3 CBOP
7     C !ROUTINE: GAD_C2_ADV_R
8    
9     C !INTERFACE: ==========================================================
10 adcroft 1.1 SUBROUTINE GAD_C2_ADV_R(
11     I bi,bj,k,
12     I rTrans,
13     I tracer,
14     O wT,
15     I myThid )
16 adcroft 1.3
17     C !DESCRIPTION:
18     C Calculates the vertical flux due to advection of a tracer using
19     C centered second-order interpolation:
20     C \begin{equation*}
21     C F^r_{adv} = w \theta
22     C \end{equation*}
23    
24     C !USES: ===============================================================
25 adcroft 1.1 IMPLICIT NONE
26     #include "SIZE.h"
27     #include "GRID.h"
28     #include "EEPARAMS.h"
29     #include "PARAMS.h"
30    
31 adcroft 1.3 C !INPUT PARAMETERS: ===================================================
32     C bi,bj :: tile indices
33     C k :: vertical level
34     C rTrans :: vertical volume transport
35     C tracer :: tracer field
36     C myThid :: thread number
37 adcroft 1.1 INTEGER bi,bj,k
38     _RL rTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
39     _RL tracer(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
40 adcroft 1.3 INTEGER myThid
41    
42     C !OUTPUT PARAMETERS: ==================================================
43     C wT :: vertical advective flux
44 adcroft 1.1 _RL wT (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
45    
46 adcroft 1.3 C !LOCAL VARIABLES: ====================================================
47     C i,j :: loop indices
48     C km1 :: =k+1 for k<Nr, =Nr for k>=Nr
49 adcroft 1.1 INTEGER i,j,km1
50 adcroft 1.3 CEOP
51 adcroft 1.1
52     km1=max(1,k-1)
53    
54 jmc 1.2 IF ( k.EQ.1 .OR. k.GT.Nr) THEN
55 adcroft 1.1 DO j=1-Oly,sNy+Oly
56     DO i=1-Olx,sNx+Olx
57     wT(i,j) = 0.
58     ENDDO
59     ENDDO
60     ELSE
61     DO j=1-Oly,sNy+Oly
62     DO i=1-Olx,sNx+Olx
63 jmc 1.2 wT(i,j) = maskC(i,j,kM1,bi,bj)*
64     & rTrans(i,j)*
65 adcroft 1.1 & (Tracer(i,j,k,bi,bj)+Tracer(i,j,kM1,bi,bj))*0.5 _d 0
66     ENDDO
67     ENDDO
68     ENDIF
69    
70     RETURN
71     END

  ViewVC Help
Powered by ViewVC 1.1.22