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

Contents of /MITgcm/pkg/generic_advdiff/gad_grad_x.F

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


Revision 1.5 - (show annotations) (download)
Wed Sep 29 04:53:30 2004 UTC (19 years, 7 months ago) by heimbach
Branch: MAIN
CVS Tags: checkpoint57m_post, checkpoint57g_pre, checkpoint57s_post, checkpoint58b_post, checkpoint57b_post, checkpoint57g_post, checkpoint56b_post, checkpoint57y_post, checkpoint57r_post, checkpoint57d_post, checkpoint57i_post, checkpoint58, checkpoint57, checkpoint56, checkpoint58f_post, checkpoint57n_post, checkpoint58d_post, checkpoint58a_post, checkpoint57z_post, checkpoint55i_post, checkpoint58m_post, checkpoint57l_post, checkpoint57t_post, checkpoint57v_post, checkpoint57f_post, checkpoint57a_post, checkpoint57h_pre, checkpoint57h_post, checkpoint57y_pre, checkpoint55g_post, checkpoint58o_post, checkpoint57c_post, checkpoint58p_post, checkpoint58q_post, checkpoint55d_post, checkpoint58e_post, checkpoint55d_pre, checkpoint57c_pre, checkpoint58r_post, checkpoint55j_post, checkpoint55h_post, checkpoint58n_post, checkpoint57e_post, checkpoint55f_post, checkpoint57p_post, checkpint57u_post, checkpoint57q_post, eckpoint57e_pre, checkpoint58k_post, checkpoint56a_post, checkpoint58l_post, checkpoint57h_done, checkpoint57j_post, checkpoint57f_pre, checkpoint58g_post, checkpoint58h_post, checkpoint56c_post, checkpoint58j_post, checkpoint57a_pre, checkpoint57o_post, checkpoint57k_post, checkpoint57w_post, checkpoint58i_post, checkpoint57x_post, checkpoint58c_post, checkpoint55e_post
Changes since 1.4: +3 -1 lines
Make CALL FILL_CORNER_CS_... invisible to TAF (the hard way for now)
Will become an issue for cubed-sphere adjoint.

1 C $Header: /u/gcmpack/MITgcm/pkg/generic_advdiff/gad_grad_x.F,v 1.4 2004/09/24 16:54:20 jmc Exp $
2 C $Name: $
3
4 #include "GAD_OPTIONS.h"
5
6 CBOP
7 C !ROUTINE: GAD_GRAD_X
8
9 C !INTERFACE: ==========================================================
10 SUBROUTINE GAD_GRAD_X(
11 I bi,bj,k,
12 I xA,
13 U tracer,
14 O dTdx,
15 I myThid )
16
17 C !DESCRIPTION:
18 C Calculates the zonal gradient of a tracer: $\partial_x \theta
19 C = \frac{1}{\Delta x_c} \delta_i \theta$
20 C and multiplies by the area.
21
22 C !USES: ===============================================================
23 IMPLICIT NONE
24 #include "SIZE.h"
25 #include "EEPARAMS.h"
26 #include "GRID.h"
27
28 C !INPUT PARAMETERS: ===================================================
29 C bi,bj :: tile indices
30 C k :: vertical level
31 C myThid :: thread number
32 INTEGER bi,bj,k
33 _RS xA (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
34 INTEGER myThid
35
36 C !UPDATED PARAMETERS: =================================================
37 C tracer :: tracer field
38 C (NOTE: only udate the corner-halo region when using CS-grid)
39 _RL tracer(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
40
41 C !OUTPUT PARAMETERS: ==================================================
42 C dTdx :: zonal gradient (units = [Tr_units]*[r_units])
43 _RL dTdx (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
44
45 C !LOCAL VARIABLES: ====================================================
46 C i,j :: loop indices
47 INTEGER i,j
48 CEOP
49
50 #ifndef ALLOW_AUTODIFF_TAMC
51 C-- Internal exchange for calculations in X
52 IF (useCubedSphereExchange) THEN
53 CALL FILL_CS_CORNER_TR_RL( .TRUE., tracer, bi,bj, myThid )
54 ENDIF
55 #endif
56
57 C o Zonal tracer gradient
58 DO j=1-Oly,sNy+Oly
59 dTdx(1-Olx,j)=0.
60 DO i=1-Olx+1,sNx+Olx
61 dTdx(i,j) = _recip_dxC(i,j,bi,bj)*xA(i,j)
62 & *(tracer(i,j)-tracer(i-1,j))
63 #ifdef COSINEMETH_III
64 & *sqCosFacU(j,bi,bj)
65 #endif
66 ENDDO
67 ENDDO
68
69 RETURN
70 END

  ViewVC Help
Powered by ViewVC 1.1.22