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

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

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


Revision 1.31 - (hide annotations) (download)
Wed Sep 19 02:43:27 2001 UTC (22 years, 8 months ago) by adcroft
Branch: MAIN
CVS Tags: checkpoint40
Changes since 1.30: +24 -5 lines
Re-arranged sequence of operations for Adams-Bashforth
 o this does not change numbers
 o this makes it very easy to extract forcing/diffusion out of ABII
   by changing calling sequence in calc_gt, calc_gs,...

Key modifications:
 o new s/r: ADAMS_BASHFORTH2  gT=3/2*gT-1/2*gTnm1
 o changed TIMESTEP_TRACER from gTnm1=t+dt*(3/2*gT-1/2*gTnm1)
   to  gT=T+dt*gT
 o changed CALC_GT,CALC_GS & CALC_GTR1 to calcuate "gT" defined
   by new timestep_tracer (ie. including forcing, ABII, N-L F-S, etc...)
   now calls ADAMS_BASHFORTH2 and FREESURF_RESCALE_G
 o changed CYCLE_TRACER appropriately  T=gT only

Other associated mods:
 o new s/r: FREESURF_RESCALE_G applies non-linear free-surface term
   this used to be in TIMESTEP_TRACER
 o added myIter as argument to CALC_GS,CALC_GT,CALC_GTR1

1 adcroft 1.31 C $Header: /u/gcmpack/models/MITgcmUV/model/src/calc_gs.F,v 1.30 2001/09/18 19:07:35 adcroft Exp $
2     C $Name: $
3 cnh 1.1
4 cnh 1.17 #include "CPP_OPTIONS.h"
5 cnh 1.1
6     SUBROUTINE CALC_GS(
7     I bi,bj,iMin,iMax,jMin,jMax,k,kM1,kUp,kDown,
8 adcroft 1.28 I xA,yA,uTrans,vTrans,rTrans,maskUp,
9 adcroft 1.21 I KappaRS,
10 adcroft 1.23 U fVerS,
11 adcroft 1.31 I myTime,myIter,myThid )
12 cnh 1.1 C /==========================================================\
13     C | SUBROUTINE CALC_GS |
14 adcroft 1.7 C | o Calculate the salt tendency terms. |
15 cnh 1.1 C |==========================================================|
16     C | A procedure called EXTERNAL_FORCING_S is called from |
17     C | here. These procedures can be used to add per problem |
18 adcroft 1.7 C | E-P flux source terms. |
19 cnh 1.1 C | Note: Although it is slightly counter-intuitive the |
20     C | EXTERNAL_FORCING routine is not the place to put |
21     C | file I/O. Instead files that are required to |
22     C | calculate the external source terms are generally |
23     C | read during the model main loop. This makes the |
24     C | logisitics of multi-processing simpler and also |
25     C | makes the adjoint generation simpler. It also |
26     C | allows for I/O to overlap computation where that |
27     C | is supported by hardware. |
28     C | Aside from the problem specific term the code here |
29     C | forms the tendency terms due to advection and mixing |
30     C | The baseline implementation here uses a centered |
31     C | difference form for the advection term and a tensorial |
32     C | divergence of a flux form for the diffusive term. The |
33     C | diffusive term is formulated so that isopycnal mixing and|
34     C | GM-style subgrid-scale terms can be incorporated b simply|
35     C | setting the diffusion tensor terms appropriately. |
36     C \==========================================================/
37     IMPLICIT NONE
38    
39     C == GLobal variables ==
40     #include "SIZE.h"
41     #include "DYNVARS.h"
42     #include "EEPARAMS.h"
43     #include "PARAMS.h"
44 adcroft 1.30 #include "GAD.h"
45 cnh 1.1
46     C == Routine arguments ==
47 adcroft 1.7 C fVerS - Flux of salt (S) in the vertical
48 cnh 1.1 C direction at the upper(U) and lower(D) faces of a cell.
49     C maskUp - Land mask used to denote base of the domain.
50     C xA - Tracer cell face area normal to X
51     C yA - Tracer cell face area normal to X
52     C uTrans - Zonal volume transport through cell face
53     C vTrans - Meridional volume transport through cell face
54 adcroft 1.18 C rTrans - Vertical volume transport through cell face
55 cnh 1.1 C bi, bj, iMin, iMax, jMin, jMax - Range of points for which calculation
56     C results will be set.
57 adcroft 1.7 C myThid - Instance number for this innvocation of CALC_GT
58 cnh 1.1 _RL fVerS (1-OLx:sNx+OLx,1-OLy:sNy+OLy,2)
59     _RS xA (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
60     _RS yA (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
61     _RL uTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
62     _RL vTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
63 cnh 1.12 _RL rTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
64 cnh 1.1 _RS maskUp(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
65 cnh 1.14 _RL KappaRS(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
66 adcroft 1.7 INTEGER k,kUp,kDown,kM1
67 cnh 1.1 INTEGER bi,bj,iMin,iMax,jMin,jMax
68 adcroft 1.31 _RL myTime
69     INTEGER myIter
70 cnh 1.1 INTEGER myThid
71    
72     C == Local variables ==
73 heimbach 1.20
74     #ifdef ALLOW_AUTODIFF_TAMC
75     C-- only the kUp part of fverS is set in this subroutine
76     C-- the kDown is still required
77     fVerS(1,1,kDown) = fVerS(1,1,kDown)
78 adcroft 1.27 #endif
79 cnh 1.1
80 adcroft 1.30 CALL GAD_CALC_RHS(
81     I bi,bj,iMin,iMax,jMin,jMax,k,kM1,kUp,kDown,
82     I xA,yA,uTrans,vTrans,rTrans,maskUp,
83     I diffKhS, diffK4S, KappaRS, Salt,
84     I GAD_SALINITY, saltAdvScheme,
85     U fVerS, gS,
86     I myThid )
87 cnh 1.1
88 cnh 1.16 C-- External forcing term(s)
89     CALL EXTERNAL_FORCING_S(
90     I iMin,iMax,jMin,jMax,bi,bj,k,
91 adcroft 1.31 I myTime,myThid)
92    
93     IF ( saltAdvScheme.EQ.ENUM_CENTERED_2ND
94     & .OR.saltAdvScheme.EQ.ENUM_UPWIND_3RD
95     & .OR.saltAdvScheme.EQ.ENUM_CENTERED_4TH ) THEN
96     CALL ADAMS_BASHFORTH2(
97     I bi, bj, K,
98     U gS, gSnm1,
99     I myIter, myThid )
100     ENDIF
101    
102     #ifdef NONLIN_FRSURF
103     IF (nonlinFreeSurf.GT.0) THEN
104     CALL FREESURF_RESCALE_G(
105     I bi, bj, K,
106     U gS,
107     I myThid )
108     ENDIF
109     #endif /* NONLIN_FRSURF */
110 cnh 1.1
111     RETURN
112     END

  ViewVC Help
Powered by ViewVC 1.1.22