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

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

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


Revision 1.6 - (hide annotations) (download)
Thu Oct 9 04:19:18 2003 UTC (20 years, 8 months ago) by edhill
Branch: MAIN
CVS Tags: checkpoint51k_post, checkpoint52l_pre, hrcube4, hrcube5, checkpoint57b_post, checkpoint52d_pre, checkpoint56b_post, checkpoint52j_pre, checkpoint51o_pre, checkpoint54d_post, checkpoint54e_post, checkpoint51l_post, checkpoint57d_post, checkpoint52k_post, checkpoint55, checkpoint54, checkpoint57, checkpoint56, checkpoint53, checkpoint52, checkpoint52f_post, checkpoint54f_post, checkpoint51t_post, checkpoint51n_post, checkpoint55i_post, checkpoint52i_pre, hrcube_1, hrcube_2, hrcube_3, checkpoint51s_post, checkpoint55c_post, checkpoint52e_pre, checkpoint52e_post, checkpoint51n_pre, checkpoint53d_post, checkpoint57a_post, checkpoint52b_pre, checkpoint54b_post, checkpoint51l_pre, checkpoint52m_post, checkpoint55g_post, checkpoint51q_post, checkpoint52b_post, checkpoint52c_post, checkpoint57c_post, checkpoint52f_pre, checkpoint55d_post, checkpoint54a_pre, checkpoint53c_post, checkpoint55d_pre, checkpoint57c_pre, checkpoint55j_post, checkpoint54a_post, checkpoint55h_post, checkpoint51r_post, checkpoint51i_post, checkpoint57e_post, checkpoint55b_post, checkpoint53a_post, checkpoint55f_post, checkpoint52d_post, checkpoint53g_post, eckpoint57e_pre, checkpoint52a_pre, checkpoint52i_post, checkpoint52h_pre, checkpoint56a_post, checkpoint53f_post, checkpoint52j_post, checkpoint57f_pre, branch-netcdf, checkpoint52l_post, checkpoint52n_post, checkpoint53b_pre, checkpoint56c_post, checkpoint57a_pre, checkpoint55a_post, checkpoint51o_post, checkpoint53b_post, checkpoint52a_post, ecco_c52_e35, checkpoint51m_post, checkpoint53d_pre, checkpoint55e_post, checkpoint54c_post, checkpoint51p_post, checkpoint51u_post
Branch point for: branch-nonh, tg2-branch, netcdf-sm0, checkpoint51n_branch
Changes since 1.5: +2 -2 lines
 o first check-in for the "branch-genmake2" merge
 o verification suite as run on shelley (gcc 3.2.2):

Wed Oct  8 23:42:29 EDT 2003
                T           S           U           V
G D M    c        m  s        m  s        m  s        m  s
E p a R  g  m  m  e  .  m  m  e  .  m  m  e  .  m  m  e  .
N n k u  2  i  a  a  d  i  a  a  d  i  a  a  d  i  a  a  d
2 d e n  d  n  x  n  .  n  x  n  .  n  x  n  .  n  x  n  .

OPTFILE=NONE

Y Y Y Y 13 16 16 16  0 16 16 16 16 16 16 16 16 13 12  0  0 pass  adjustment.128x64x1
Y Y Y Y 16 16 16 16  0 16 16 16 16 16 16  0  0 16 16  0  0 pass  adjustment.cs-32x32x1
Y Y Y Y 16 16 16 16  0 16 16 16 16 16 16 22  0 16 16 22  0 pass  adjust_nlfs.cs-32x32x1
Y Y Y Y -- 13 13 16 16 13 13 13 13 16 16 16 16 16 16 16 16 N/O   advect_cs
Y Y Y Y -- 22 16 16 16 16 16 16 13 16 16 16 16 16 16 16 16 N/O   advect_xy
Y Y Y Y -- 13 16 13 16 16 16 16 16 16 16 22 16 16 16 16 16 N/O   advect_xz
Y Y Y Y 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 pass  aim.5l_cs
Y Y Y Y 14 16 16 16 16 16 16 16 16 13 16 16 16 16 16 13 16 pass  aim.5l_Equatorial_Channel
Y Y Y Y 16 16 16 16 16 16 16 16 16 16 16 13 16 16 13 13 16 pass  aim.5l_LatLon
Y Y Y Y 13 16 16 16 16 16 16 16 16 16 13 12 13 13 16 13 16 pass  exp0
Y Y Y Y 14 16 16 16 16 16 16 16 22 16 16 16 13 16 16 22 16 pass  exp1
Y Y Y Y 13 13 16 13 16 16 16 16 16 13 13 16 16 13 13 13 13 pass  exp2
Y Y Y Y 16 16 16 16 16 16 16 16 22 16 16 16 16 16 16 16 16 pass  exp4
Y Y Y Y 16 16 16 16 16 16 16 16 16 16 16 22 16 16 16 22 16 pass  exp5
Y Y Y Y 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 pass  front_relax
Y Y Y Y 14 16 16 13 13 16 16 13 13 16 13 13 16 12 13 13 16 pass  global_ocean.90x40x15
Y Y Y Y 10 16 16 13 13 16 13 16 16 13 13 13 13 16 16 13 16 FAIL  global_ocean.cs32x15
Y Y Y Y  6 11 12 13 13 12 13 16 13  9  9  9  9 10  9  9 11 FAIL  global_ocean_pressure
Y Y Y Y 14 16 16 13 16 16 16 13 13 13 13 13 16 12 16 13 16 pass  global_with_exf
Y Y Y Y 14 16 16 16 16 16 16 16 16 11 13 22 13 16 16  9 16 pass  hs94.128x64x5
Y Y Y Y 13 16 16 16 16 16 16 16 16 11 16 16 16 13 16 22 13 pass  hs94.1x64x5
Y Y Y Y 14 16 16 16 16 16 16 16 16 13 16 13 13 16 16 22 13 pass  hs94.cs-32x32x5
Y Y Y Y 10 10 16 13 13 16 16 16 22 16 13 13 13 13 13 22 13 FAIL  ideal_2D_oce
Y Y Y Y  8 16 16 16 16 16 16 16 16 13 13  8 16 16 16 16 16 FAIL  internal_wave
Y Y Y Y 14 16 16 16 16 16 16 16 16 13 13 22 13 13 13 22 16 pass  inverted_barometer
Y Y Y Y 12 16 16 16 16 16 16 16 16 16 13 12 13 13 13 13 13 FAIL  lab_sea
Y Y Y Y 11 16 16 16 16 16 16 16 13 13 13 12 13 16 13 12 13 FAIL  natl_box
Y Y Y Y 16 16 16 16 16 16 16 16 22 16 16 16 16 16 16 16 16 pass  plume_on_slope
Y Y Y Y 13 16 16 16 16 13 16 16 16 16 16 16 16 13 16 16 16 pass  solid-body.cs-32x32x1

1 edhill 1.6 C $Header: /u/u3/gcmpack/MITgcm/model/src/ini_pressure.F,v 1.5.2.1 2003/10/02 18:10:45 edhill Exp $
2     C $Name: $
3 mlosch 1.1
4     #include "CPP_OPTIONS.h"
5    
6     CBOP
7     C !ROUTINE: INI_PRESSURE
8     C !INTERFACE:
9 jmc 1.3 SUBROUTINE INI_PRESSURE( myThid )
10 mlosch 1.1 C !DESCRIPTION: \bv
11     C *==========================================================*
12     C | SUBROUTINE INI_PRESSURE
13     C | o initialise the pressure field consistently with
14     C | temperature and salinity
15     C | - needs to be called after ini_theta, ini_salt, and
16     C | ini_psurf
17     C | - does not include surface pressure loading, because
18     C | that is only available until after
19 jmc 1.3 C | CALL packages_init_variables
20 mlosch 1.1 C *==========================================================*
21     C \ev
22    
23     C !USES:
24 jmc 1.3 IMPLICIT NONE
25 mlosch 1.1 C == Global variables ==
26     #include "SIZE.h"
27     #include "EEPARAMS.h"
28     #include "PARAMS.h"
29     #include "EOS.h"
30     #include "GRID.h"
31     #include "DYNVARS.h"
32    
33     C !INPUT/OUTPUT PARAMETERS:
34     C == Routine arguments ==
35     C myThid - Number of this instance of INI_PRESSURE
36     INTEGER myThid
37    
38     C !LOCAL VARIABLES:
39     C == Local variables ==
40 jmc 1.3 C dPhiHydX,Y :: Gradient (X & Y directions) of Hyd. Potential
41 mlosch 1.1 C bi,bj - Loop counters
42     C I,J,K
43     INTEGER bi, bj
44     INTEGER I, J, K
45 jmc 1.4 INTEGER iMin, iMax, jMin, jMax, npiter
46     _RL PhiHydF (1-Olx:sNx+Olx,1-Oly:sNy+Oly)
47     _RL PhiHydC (1-Olx:sNx+Olx,1-Oly:sNy+Oly)
48 jmc 1.3 _RL dPhiHydX(1-Olx:sNx+Olx,1-Oly:sNy+Oly)
49     _RL dPhiHydY(1-Olx:sNx+Olx,1-Oly:sNy+Oly)
50 jmc 1.4 _RL oldPhi (1-Olx:sNx+Olx,1-Oly:sNy+Oly)
51     _RL count, rmspp, rmsppold
52 mlosch 1.1
53     CHARACTER*(MAX_LEN_MBUF) msgBuf
54 mlosch 1.2 CEOP
55 mlosch 1.1 iMin = 1-OLx
56     iMax = sNx+OLx
57     jMin = 1-OLy
58     jMax = sNy+OLy
59    
60 jmc 1.3 WRITE(msgBuf,'(a)')
61 mlosch 1.1 & 'Start initial hydrostatic pressure computation'
62     CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
63     & SQUEEZE_RIGHT , 1)
64 jmc 1.3 DO bj = myByLo(myThid), myByHi(myThid)
65     DO bi = myBxLo(myThid), myBxHi(myThid)
66     DO k = 1,Nr
67     DO j=1-OLy,sNy+OLy
68     DO i=1-OLx,sNx+OLx
69 jmc 1.4 totPhiHyd(i,j,k,bi,bj) = 0. _d 0
70 jmc 1.3 ENDDO
71     ENDDO
72     ENDDO
73     ENDDO
74     ENDDO
75 mlosch 1.1
76 jmc 1.4 c IF ( startTime .NE. 0. ) RETURN
77     c IF ( buoyancyRelation .EQ. 'OCEANIC' ) THEN
78     IF ( useDynP_inEos_Zc ) THEN
79 mlosch 1.1
80 heimbach 1.5 #ifndef ALLOW_AUTODIFF_TAMC
81     cph-- deal with this iterative loop for AD once it will
82     cph-- really be needed;
83     cph-- would need storing of totPhiHyd for each npiter
84    
85 mlosch 1.1 rmspp = 1. _d 0
86     rmsppold = 0. _d 0
87     npiter = 0
88    
89     C iterate pressure p = integral of (g*rho(p)*dz)
90 jmc 1.4 DO npiter= 1, 15
91 mlosch 1.1 rmsppold = rmspp
92     rmspp = 0. _d 0
93 jmc 1.4 count = 0.
94 jmc 1.3 DO bj = myByLo(myThid), myByHi(myThid)
95     DO bi = myBxLo(myThid), myBxHi(myThid)
96 jmc 1.4 DO j=1-OLy,sNy+OLy
97     DO i=1-OLx,sNx+OLx
98     phiHydF(i,j) = 0. _d 0
99     ENDDO
100     ENDDO
101 jmc 1.3 DO k = 1, Nr
102 mlosch 1.1 C for each level save old pressure and compute new pressure
103 jmc 1.3 DO j=jMin,jMax
104     DO i=iMin,iMax
105 jmc 1.4 oldPhi(i,j) = totPhiHyd(i,j,k,bi,bj)
106 jmc 1.3 ENDDO
107     ENDDO
108     CALL CALC_PHI_HYD(
109     I bi, bj, iMin, iMax, jMin, jMax, k,
110     I theta, salt,
111 jmc 1.4 U phiHydF,
112     O phiHydC, dPhiHydX, dPhiHydY,
113 jmc 1.3 I startTime, nIter0, myThid)
114 mlosch 1.1 C compute convergence criterion
115 jmc 1.3 DO j=jMin,jMax
116     DO i=iMin,iMax
117 mlosch 1.1 rmspp = rmspp
118 jmc 1.4 & + (totPhiHyd(i,j,k,bi,bj)-oldPhi(i,j))**2
119     count = count + maskC(i,j,k,bi,bj)
120 jmc 1.3 ENDDO
121     ENDDO
122 jmc 1.4 C -- end k loop
123 jmc 1.3 ENDDO
124     ENDDO
125     ENDDO
126 mlosch 1.1 Cml WRITE(msgBuf,'(I10.10)') npiter
127     Cml CALL WRITE_FLD_XYZ_RL( 'POLD.',msgBuf,pold,npiter,myThid)
128     Cml CALL WRITE_FLD_XYZ_RL( 'PINI.',msgBuf,pressure,npiter,myThid)
129 jmc 1.4 _GLOBAL_SUM_R8( rmspp, myThid )
130     _GLOBAL_SUM_R8( count, myThid )
131     IF ( count .EQ. 0. ) THEN
132 mlosch 1.1 rmspp = 0. _d 0
133 jmc 1.3 ELSE
134 jmc 1.4 rmspp = sqrt(rmspp/count)
135 jmc 1.3 ENDIF
136     WRITE(msgBuf,'(a,i2,a,e20.13)')
137 mlosch 1.1 & 'Iteration ', npiter, ', RMS-difference = ', rmspp
138     CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
139     & SQUEEZE_RIGHT , 1)
140    
141 jmc 1.4 C -- end npiter loop
142 jmc 1.3 ENDDO
143 mlosch 1.1 C print some diagnostics
144 jmc 1.3 IF ( rmspp .ne. 0. ) THEN
145     IF ( rmspp .EQ. rmsppold ) THEN
146 jmc 1.4 WRITE(msgBuf,'(A)')
147 mlosch 1.1 & 'Initial hydrostatic pressure did not converge perfectly,'
148     CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
149     & SQUEEZE_RIGHT , 1)
150 jmc 1.4 WRITE(msgBuf,'(A)')
151 mlosch 1.1 & 'but the RMS-difference is constant, indicating that the'
152     CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
153     & SQUEEZE_RIGHT , 1)
154 jmc 1.4 WRITE(msgBuf,'(A)')
155 mlosch 1.1 & 'algorithm converged within machine precision.'
156     CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
157     & SQUEEZE_RIGHT , 1)
158 jmc 1.3 ELSE
159 jmc 1.4 WRITE(msgBuf,'(A,I2,A)')
160 mlosch 1.1 & 'Initial hydrostatic pressure did not converge after ',
161     & npiter-1, ' steps'
162     CALL PRINT_ERROR( msgBuf, myThid )
163     STOP 'ABNORMAL END: S/R INI_PRESSURE'
164 jmc 1.3 ENDIF
165     ENDIF
166 jmc 1.4 WRITE(msgBuf,'(A)')
167 mlosch 1.1 & 'Initial hydrostatic pressure converged.'
168     CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
169     & SQUEEZE_RIGHT , 1)
170    
171 heimbach 1.5 #endif /* ALLOW_AUTODIFF_TAMC */
172    
173     c-- else of if useDynP_inEos_Zc
174 jmc 1.3 ELSE
175     C print a message and DO nothing
176 jmc 1.4 WRITE(msgBuf,'(A,A)')
177 mlosch 1.1 & 'Pressure is predetermined for buoyancyRelation ',
178     & buoyancyRelation(1:11)
179     CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
180     & SQUEEZE_RIGHT , 1)
181    
182 jmc 1.3 ENDIF
183 mlosch 1.1
184 jmc 1.4 WRITE(msgBuf,'(A)') ' '
185 mlosch 1.1 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
186     & SQUEEZE_RIGHT , 1)
187    
188 jmc 1.3 RETURN
189     END

  ViewVC Help
Powered by ViewVC 1.1.22