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

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

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


Revision 1.7 - (hide annotations) (download)
Tue Dec 15 00:20:34 1998 UTC (25 years, 5 months ago) by adcroft
Branch: MAIN
CVS Tags: checkpoint19
Changes since 1.6: +7 -3 lines
 o Added "natural BCs" as alternative to "virtual salt flux"
 o Re-difined precFloat32 and precFloat64 to be 32 and 64
   so that their values can be meaningfuly set in the data file
 o Modified read_write.F to create an exception if readBinaryPrec
   is not set
 o Replaced CPP control of viscous BCs with run-time control
 o Tidied up input-data precision (ie. ini_depths cnh_dbg...)
 o ini_forcing.F now initialises *all* forcing arrays to zero
 o Definitively tested verification experiments 0,1,2 and 4
   (3 is atmospheric set-up which is in a state of flux)

1 adcroft 1.7 C $Header: /u/gcmpack/models/MITgcmUV/model/src/calc_div_ghat.F,v 1.6 1998/11/06 22:44:44 cnh Exp $
2 cnh 1.1
3 cnh 1.6 #include "CPP_OPTIONS.h"
4 cnh 1.1
5     C /==========================================================\
6     C | S/R CALC_DIV_GHAT |
7     C | o Form the right hand-side of the surface pressure eqn. |
8     C \==========================================================/
9     SUBROUTINE CALC_DIV_GHAT(
10     I bi,bj,iMin,iMax,jMin,jMax,
11     I K,
12     I xA,yA,
13     I myThid)
14    
15     IMPLICIT NONE
16    
17     C == Global variables ==
18     #include "SIZE.h"
19     #include "DYNVARS.h"
20     #include "FFIELDS.h"
21     #include "EEPARAMS.h"
22     #include "PARAMS.h"
23     #include "GRID.h"
24     #include "CG2D.h"
25    
26     C == Routine arguments ==
27     C pH - Hydrostatic pressure
28     C bi, bj, iMin, iMax, jMin, jMax - Range of points for which calculation
29     C results will be set.
30     C kUp, kDown, kM1 - Index for upper and lower layers.
31     C myThid - Instance number for this innvocation of CALC_MOM_RHS
32     INTEGER bi,bj,iMin,iMax,jMin,jMax
33     INTEGER K
34     _RS xA (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
35     _RS yA (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
36     INTEGER myThid
37    
38     C == Local variables ==
39     INTEGER i,j
40     _RL pf (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
41    
42     C-- Pressure equation source term
43     C Term is the vertical integral of the divergence of the
44     C time tendency terms along with a relaxation term that
45     C pulls div(U) + dh/dt back toward zero.
46    
47 cnh 1.2 IF ( k .EQ. Nr ) THEN
48 cnh 1.1 C Initialise source term on first pass
49     DO j=jMin,jMax
50     DO i=iMin,iMax
51     C cg2d_b(i,j,bi,bj) = cg2d_b(i,j,bi,bj)
52     C & -freeSurfFac*_rA(i,j,bi,bj)*
53     C & cg2d_x(I ,J ,bi,bj)/deltaTMom/deltaTMom
54     cg2d_b(i,j,bi,bj) =
55 adcroft 1.7 & freeSurfFac*_rA(i,j,bi,bj)*horiVertRatio*(
56     & -cg2d_x(I,J,bi,bj)/deltaTMom/deltaTMom
57     #ifdef USE_NATURAL_BCS
58     & +EmPmR(I,J,bi,bj)/deltaTMom
59     #endif
60     & )
61 cnh 1.1 ENDDO
62     ENDDO
63     ENDIF
64    
65     DO j=jMin,jMax
66     DO i=iMin,iMax
67     pf(i,j) = xA(i,j)*gUNm1(i,j,k,bi,bj) / deltaTmom
68     ENDDO
69     ENDDO
70     DO j=1,sNy
71     DO i=1,sNx
72     cg2d_b(i,j,bi,bj) = cg2d_b(i,j,bi,bj) +
73     & pf(i+1,j)-pf(i,j)
74     ENDDO
75     ENDDO
76    
77     DO j=jMin,jMax
78     DO i=iMin,iMax
79     pf(i,j) = yA(i,j)*gVNm1(i,j,k,bi,bj) / deltatmom
80     ENDDO
81     ENDDO
82    
83     DO j=1,sNy
84     DO i=1,sNx
85 cnh 1.5 cg2d_b(i,j,bi,bj) = cg2d_b(i,j,bi,bj) +
86 cnh 1.1 & pf(i,j+1)-pf(i,j)
87     ENDDO
88     ENDDO
89 cnh 1.4
90 cnh 1.1
91     RETURN
92     END

  ViewVC Help
Powered by ViewVC 1.1.22