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

Contents of /MITgcm/model/src/ini_linear_phisurf.F

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


Revision 1.9 - (show annotations) (download)
Wed Feb 26 03:11:32 2003 UTC (21 years, 3 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint51k_post, checkpoint57m_post, checkpoint52l_pre, hrcube4, hrcube5, checkpoint57g_pre, checkpoint50c_post, checkpoint57s_post, checkpoint57b_post, checkpoint52d_pre, checkpoint57g_post, checkpoint56b_post, checkpoint50c_pre, checkpoint52j_pre, checkpoint51o_pre, checkpoint54d_post, checkpoint54e_post, checkpoint51l_post, checkpoint48i_post, checkpoint57r_post, checkpoint57d_post, checkpoint57i_post, checkpoint52l_post, checkpoint52k_post, checkpoint55, checkpoint54, checkpoint57, checkpoint56, checkpoint51, checkpoint50, checkpoint53, checkpoint52, checkpoint50d_post, checkpoint52f_post, checkpoint57n_post, checkpoint50b_pre, checkpoint54f_post, checkpoint51f_post, checkpoint51d_post, checkpoint51t_post, checkpoint51n_post, checkpoint55i_post, checkpoint57l_post, checkpoint52i_pre, hrcube_1, hrcube_2, hrcube_3, checkpoint51s_post, checkpoint57t_post, checkpoint55c_post, checkpoint51j_post, checkpoint52e_pre, checkpoint57v_post, checkpoint57f_post, checkpoint52e_post, checkpoint51n_pre, checkpoint53d_post, checkpoint57a_post, checkpoint57h_pre, checkpoint52b_pre, checkpoint54b_post, checkpoint57h_post, checkpoint51l_pre, checkpoint52m_post, checkpoint55g_post, checkpoint48h_post, checkpoint51q_post, checkpoint51b_pre, checkpoint52b_post, checkpoint52c_post, checkpoint51h_pre, checkpoint57c_post, checkpoint50f_post, checkpoint50a_post, checkpoint50f_pre, checkpoint52f_pre, checkpoint55d_post, checkpoint54a_pre, checkpoint53c_post, checkpoint55d_pre, checkpoint57c_pre, checkpoint55j_post, branchpoint-genmake2, checkpoint54a_post, checkpoint55h_post, checkpoint51r_post, checkpoint51i_post, checkpoint57e_post, checkpoint55b_post, checkpoint51b_post, checkpoint51c_post, checkpoint53a_post, checkpoint55f_post, checkpoint52d_post, checkpoint53g_post, checkpoint57p_post, checkpint57u_post, checkpoint50g_post, checkpoint57q_post, eckpoint57e_pre, checkpoint52a_pre, checkpoint50h_post, checkpoint52i_post, checkpoint50e_pre, checkpoint50i_post, checkpoint51i_pre, checkpoint52h_pre, checkpoint56a_post, checkpoint53f_post, checkpoint57h_done, checkpoint52j_post, checkpoint50e_post, checkpoint57j_post, checkpoint57f_pre, branch-netcdf, checkpoint50d_pre, checkpoint52n_post, checkpoint53b_pre, checkpoint56c_post, checkpoint51e_post, checkpoint57a_pre, checkpoint55a_post, checkpoint49, checkpoint57o_post, checkpoint51o_post, checkpoint57k_post, checkpoint51f_pre, checkpoint53b_post, checkpoint52a_post, checkpoint57w_post, checkpoint51g_post, ecco_c52_e35, checkpoint50b_post, checkpoint51m_post, checkpoint53d_pre, checkpoint55e_post, checkpoint54c_post, checkpoint51a_post, checkpoint51p_post, checkpoint51u_post
Branch point for: branch-genmake2, branch-nonh, tg2-branch, netcdf-sm0, checkpoint51n_branch
Changes since 1.8: +21 -5 lines
improve definition of Po_surf when using Finite Volume form to integrate
  PhiHyd and (standard) vertical grid (Center at middle).

1 C $Header: /u/gcmpack/MITgcm/model/src/ini_linear_phisurf.F,v 1.8 2003/01/10 23:41:15 heimbach Exp $
2 C $Name: $
3
4 #include "CPP_OPTIONS.h"
5
6 CBOP
7 C !ROUTINE: INI_LINEAR_PHISURF
8 C !INTERFACE:
9 SUBROUTINE INI_LINEAR_PHISURF( myThid )
10
11 C !DESCRIPTION: \bv
12 C *==========================================================*
13 C | SUBROUTINE INI_LINEAR_PHISURF
14 C | o Initialise the Linear Relation Phi_surf(eta)
15 C *==========================================================*
16 C | Initialise -Boyancy at surface level (Bo_surf)
17 C | to setup the Linear relation: Phi_surf(eta)=Bo_surf*eta
18 C | Initialise phi0surf = starting point for integrating
19 C | phiHyd (= phiHyd at r=RoSurf)
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 myThid - Thread no. that called this routine.
35 INTEGER myThid
36
37 C == Local variables in common ==
38 C Hloc - Temporary array used to write surface topography
39 C has to be in common for multi threading
40 COMMON / LOCAL_INI_PHISURF / topoHloc
41 _RS topoHloc(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
42
43 C !LOCAL VARIABLES:
44 C === Local variables ===
45 C bi,bj - Loop counters
46 C I,J,K
47 CHARACTER*(MAX_LEN_MBUF) msgBuf
48 INTEGER bi, bj
49 INTEGER I, J, K
50 _RL rhoLoc
51 _RL dPIdp
52 CEOP
53
54 #ifdef ALLOW_AUTODIFF_TAMC
55 DO bj=myByLo(myThid),myByHi(myThid)
56 DO bi=myBxLo(myThid),myBxHi(myThid)
57 DO J=1-Oly,sNy+Oly
58 DO I=1-Olx,sNx+Olx
59 Bo_surf(I,J,bi,bj) = 0. _d 0
60 recip_Bo(I,J,bi,bj) = 0. _d 0
61 ENDDO
62 ENDDO
63 ENDDO
64 ENDDO
65 #endif
66
67 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
68
69 C-- Initialise -Boyancy at surface level : Bo_surf
70 C Bo_surf is defined as d/dr(Phi_surf) and set to g/rtoz (linear free surface)
71 C with rtoz = conversion factor from r-unit to z-unit (=horiVertRatio)
72 C an accurate formulation includes P_surf and T,S_surf effects on rho_surf:
73 C (setting uniformLin_PhiSurf=.FALSE.):
74 C z-ocean (rtoz=1) : Bo_surf = - Boyancy = gravity * rho_surf/rho_0
75 C p-atmos (rtoz=rho_c*g) : Bo_surf = (1/rho)_surf
76 C Note on Phi_surf splitting : Non-linear Time-dependent effects on b_surf
77 C [through eta & (T-tRef)_surf] are included in PhiHyd rather than in Bo_surf
78 C--
79 IF ( buoyancyRelation .eq. 'OCEANIC' ) THEN
80 C- gBaro = gravity (except for External mode test with reduced gravity)
81 DO bj=myByLo(myThid),myByHi(myThid)
82 DO bi=myBxLo(myThid),myBxHi(myThid)
83 DO J=1-Oly,sNy+Oly
84 DO I=1-Olx,sNx+Olx
85 Bo_surf(I,J,bi,bj) = gBaro
86 recip_Bo(I,J,bi,bj) = 1. _d 0 / gBaro
87 ENDDO
88 ENDDO
89 ENDDO
90 ENDDO
91 ELSEIF ( uniformLin_PhiSurf ) THEN
92 C- use a linear (in ps) uniform relation : Phi'_surf = 1/rhoConst * ps'_surf
93 DO bj=myByLo(myThid),myByHi(myThid)
94 DO bi=myBxLo(myThid),myBxHi(myThid)
95 DO J=1-Oly,sNy+Oly
96 DO I=1-Olx,sNx+Olx
97 Bo_surf(I,J,bi,bj) = recip_rhoConst
98 recip_Bo(I,J,bi,bj) = rhoConst
99 ENDDO
100 ENDDO
101 ENDDO
102 ENDDO
103 ELSEIF ( buoyancyRelation .eq. 'OCEANICP' ) THEN
104 DO bj=myByLo(myThid),myByHi(myThid)
105 DO bi=myBxLo(myThid),myBxHi(myThid)
106 DO J=1-Oly,sNy+Oly
107 DO I=1-Olx,sNx+Olx
108 IF ( Ro_surf(I,J,bi,bj).GT.0. _d 0
109 & .AND. ksurfC(I,J,bi,bj).LE.Nr ) THEN
110 k = ksurfC(I,J,bi,bj)
111 CALL FIND_RHO_SCALAR(
112 & tRef(k), sRef(k), Ro_surf(I,J,bi,bj),
113 & rhoLoc, myThid )
114 rhoLoc = rhoLoc + rhoConst
115 if ( rhoLoc .eq. 0. _d 0 ) then
116 Bo_surf(I,J,bi,bj) = 0. _d 0
117 else
118 Bo_surf(I,J,bi,bj) = 1./rhoLoc
119 endif
120 recip_Bo(I,J,bi,bj) = rhoLoc
121 ELSE
122 Bo_surf(I,J,bi,bj) = 0. _d 0
123 recip_Bo(I,J,bi,bj) = 0. _d 0
124 ENDIF
125 ENDDO
126 ENDDO
127 ENDDO
128 ENDDO
129 ELSEIF ( buoyancyRelation .eq. 'ATMOSPHERIC' ) THEN
130 C- use a linearized (in ps) Non-uniform relation : Bo_surf(Po_surf,tRef_surf)
131 C--- Bo = d/d_p(Phi_surf) = tRef_surf*d/d_p(PI) ; PI = Cp*(p/Po)^kappa
132 DO bj=myByLo(myThid),myByHi(myThid)
133 DO bi=myBxLo(myThid),myBxHi(myThid)
134 DO J=1-Oly,sNy+Oly
135 DO I=1-Olx,sNx+Olx
136 IF ( Ro_surf(I,J,bi,bj).GT.0. _d 0
137 & .AND. ksurfC(I,J,bi,bj).LE.Nr ) THEN
138 dPIdp = (atm_Cp*atm_kappa/atm_Po)*
139 & (Ro_surf(I,J,bi,bj)/atm_Po)**(atm_kappa-1. _d 0)
140 Bo_surf(I,J,bi,bj) = dPIdp*tRef(ksurfC(I,J,bi,bj))
141 recip_Bo(I,J,bi,bj) = 1. _d 0 / Bo_surf(I,J,bi,bj)
142 ELSE
143 Bo_surf(I,J,bi,bj) = 0.
144 recip_Bo(I,J,bi,bj) = 0.
145 ENDIF
146 ENDDO
147 ENDDO
148 ENDDO
149 ENDDO
150 ELSE
151 STOP 'INI_LINEAR_PHISURF: We should never reach this point!'
152 ENDIF
153
154 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
155
156 C-- Update overlap regions
157 _EXCH_XY_R8(Bo_surf, myThid)
158 _EXCH_XY_R8(recip_Bo, myThid)
159
160 IF ( ( buoyancyRelation .eq. 'ATMOSPHERIC' .OR.
161 & buoyancyRelation .eq. 'OCEANICP' )
162 & .AND. .NOT.uniformLin_PhiSurf ) THEN
163
164 _BEGIN_MASTER( myThid )
165 CALL WRITE_FLD_XY_RL( 'Bo_surf',' ',Bo_surf,0,myThid)
166 _END_MASTER( myThid )
167
168 ENDIF
169
170 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
171
172 C-- Initialise phi0surf: used for atmos. surf. P-loading (ocean, z-coord)
173 C or topographic geopotential anom. (p-coord)
174
175 DO bj=myByLo(myThid),myByHi(myThid)
176 DO bi=myBxLo(myThid),myBxHi(myThid)
177 DO J=1-Oly,sNy+Oly
178 DO I=1-Olx,sNx+Olx
179 phi0surf(I,J,bi,bj) = 0.
180 ENDDO
181 ENDDO
182 ENDDO
183 ENDDO
184
185 IF ( buoyancyRelation .eq. 'ATMOSPHERIC'
186 & .AND. topoFile.NE.' ' ) THEN
187
188 #ifdef ALLOW_AUTODIFF_TAMC
189 STOP 'CANNOT PRESENTLY USE THIS OPTION WITH ADJOINT'
190 #else
191
192 C-- Compute topoH = PhiRef(Po_surf)/g ; is different from original
193 C topoZ(read from file) because of truncation of Po_surf.
194 C NOTE: not clear for now which topoZ needs to be saved in common block
195 C-- AND set phi0surf = starting point for integrating Geopotential;
196
197 CALL INI_P_GROUND( -2,
198 O topoHloc,
199 I Ro_surf, myThid )
200
201 _BEGIN_MASTER( myThid )
202 CALL WRITE_FLD_XY_RS( 'topo_H',' ',topoHloc,0,myThid)
203 _END_MASTER( myThid )
204
205 IF (selectFindRoSurf.NE.0) THEN
206 _EXCH_XY_RS(phi0surf, myThid)
207
208 _BEGIN_MASTER( myThid )
209 CALL WRITE_FLD_XY_RS( 'phi0surf',' ',phi0surf,0,myThid)
210 _END_MASTER( myThid )
211 ENDIF
212
213 #endif /* ALLOW_AUTODIFF_TAMC */
214
215 ENDIF
216
217 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
218 RETURN
219 END

  ViewVC Help
Powered by ViewVC 1.1.22