/[MITgcm]/MITgcm/model/src/calc_wsurf_tr.F
ViewVC logotype

Annotation of /MITgcm/model/src/calc_wsurf_tr.F

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


Revision 1.2 - (hide annotations) (download)
Sun Apr 26 19:34:25 2009 UTC (15 years ago) by jmc
Branch: MAIN
CVS Tags: checkpoint64y, checkpoint64x, checkpoint64z, 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, checkpoint65, checkpoint62, checkpoint63, checkpoint66g, checkpoint66f, checkpoint66e, checkpoint66d, checkpoint66c, checkpoint66b, checkpoint66a, checkpoint66o, checkpoint66n, checkpoint66m, checkpoint66l, checkpoint66k, checkpoint66j, checkpoint66i, checkpoint66h, checkpoint65z, checkpoint65x, checkpoint65y, checkpoint65r, checkpoint65s, checkpoint65p, checkpoint65q, checkpoint65v, checkpoint65w, checkpoint65t, checkpoint65u, checkpoint65j, checkpoint65k, checkpoint65h, checkpoint65i, checkpoint65n, checkpoint65o, checkpoint65l, checkpoint65m, checkpoint65b, checkpoint65c, checkpoint65a, checkpoint65f, checkpoint65g, checkpoint65d, checkpoint65e, checkpoint62c, checkpoint62b, checkpoint62a, checkpoint62g, checkpoint62f, checkpoint62e, checkpoint62d, checkpoint62k, checkpoint62j, checkpoint62i, checkpoint62h, checkpoint62o, checkpoint62n, checkpoint62m, checkpoint62l, checkpoint62s, checkpoint62r, checkpoint62q, checkpoint62p, checkpoint62w, checkpoint62v, checkpoint62u, checkpoint62t, checkpoint62z, checkpoint62y, checkpoint62x, checkpoint61n, checkpoint61o, checkpoint61m, checkpoint61v, checkpoint61w, checkpoint61t, checkpoint61u, checkpoint61r, checkpoint61s, checkpoint61p, checkpoint61q, checkpoint61z, checkpoint61x, checkpoint61y, HEAD
Changes since 1.1: +23 -14 lines
call GLOBAL_SUM_TILE_RL (result is less dependant on Nb of Procs/Threads)

1 jmc 1.2 C $Header: /u/gcmpack/MITgcm/model/src/calc_wsurf_tr.F,v 1.1 2007/01/05 01:35:00 dfer Exp $
2 dfer 1.1 C $Name: $
3    
4     #include "CPP_OPTIONS.h"
5    
6     CBOP
7     C !ROUTINE: CALC_WSURF_TR
8     C !INTERFACE:
9     SUBROUTINE CALC_WSURF_TR(thetaFld, saltFld, wVelFld,
10     I myTime, myIter, myThid )
11     C !DESCRIPTION: \bv
12     C *==========================================================*
13     C | SUBROUTINE CALC_WSURF_TR
14     C | o Compute a correction for the source/sink of tracer
15     C | due to the linear free surface.
16     C | o The source/sink results from W*Tr not summing to
17     C | zero at the free surface.
18 jmc 1.2 C | o Here, we compute an area-weighted mean correction
19 dfer 1.1 C | to be applied in external_forcing.F
20     C *==========================================================*
21     C \ev
22    
23     C !USES:
24     IMPLICIT NONE
25     C == Global variables
26     #include "SIZE.h"
27     #include "EEPARAMS.h"
28     #include "PARAMS.h"
29     #include "GRID.h"
30     #include "SURFACE.h"
31    
32     C !INPUT/OUTPUT PARAMETERS:
33     C == Routine arguments ==
34     C myTime :: Current time in simulation
35     C myIter :: Current iteration number in simulation
36     C myThid :: Thread number for this instance of the routine.
37     C thetaFld :: Potential Temperature field
38     C saltFld :: Salinity field
39     C wvelFld :: vertical velocity field
40     _RL myTime
41     INTEGER myIter
42     INTEGER myThid
43     _RL thetaFld(1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nr,nSx,nSy)
44     _RL saltFld (1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nr,nSx,nSy)
45     _RL wVelFld (1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nr,nSx,nSy)
46    
47     C !LOCAL VARIABLES:
48     C Local variables
49     C i,j,k,bi,bj :: loop counter
50     INTEGER i,j,bi,bj,ks
51     _RL wT_Mean, wS_Mean
52 jmc 1.2 _RL wT_Tile(nSx,nSy)
53     _RL wS_Tile(nSx,nSy)
54 dfer 1.1 CEOP
55    
56     C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
57    
58 jmc 1.2 TsurfCor= 0.
59     SsurfCor= 0.
60 dfer 1.1
61     wT_Mean = 0.
62     wS_Mean = 0.
63    
64     DO bj=myByLo(myThid), myByHi(myThid)
65     DO bi=myBxLo(myThid), myBxHi(myThid)
66 jmc 1.2 wT_Tile(bi,bj) = 0.
67     wS_Tile(bi,bj) = 0.
68 dfer 1.1 DO j=1,sNy
69     DO i=1,sNx
70     ks = ksurfC(i,j,bi,bj)
71     IF (ks.LE.Nr) THEN
72 jmc 1.2 wT_Tile(bi,bj) = wT_Tile(bi,bj)
73 dfer 1.1 & + rA(i,j,bi,bj)*wVelFld(i,j,ks,bi,bj)
74     & *thetaFld(i,j,ks,bi,bj)
75 jmc 1.2 wS_Tile(bi,bj) = wS_Tile(bi,bj)
76 dfer 1.1 & + rA(i,j,bi,bj)*wVelFld(i,j,ks,bi,bj)
77     & *saltFld(i,j,ks,bi,bj)
78     ENDIF
79     ENDDO
80     ENDDO
81 jmc 1.2 c#ifdef ALLOW_AUTODIFF_TAMC
82     c wT_Mean = wT_Mean + wT_Tile(bi,bj)
83     c wS_Mean = wS_Mean + wS_Tile(bi,bj)
84     c#endif
85 dfer 1.1 C- end bi,bj loop.
86     ENDDO
87     ENDDO
88    
89     C-- Global diagnostic :
90 jmc 1.2 c#ifdef ALLOW_AUTODIFF_TAMC
91     c _GLOBAL_SUM_RL(wT_Mean,myThid)
92     c _GLOBAL_SUM_RL(wS_Mean,myThid)
93     c#else
94     CALL GLOBAL_SUM_TILE_RL( wT_Tile, wT_Mean, myThid )
95     CALL GLOBAL_SUM_TILE_RL( wS_Tile, wS_Mean, myThid )
96     c#endif
97    
98     IF ( globalArea.GT.0. ) THEN
99 dfer 1.1 _BEGIN_MASTER( myThid )
100     TsurfCor = wT_Mean / globalArea
101     SsurfCor = wS_Mean / globalArea
102     _END_MASTER( myThid )
103     ENDIF
104     _BARRIER
105    
106     C-----
107    
108     RETURN
109     END

  ViewVC Help
Powered by ViewVC 1.1.22