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

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

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


Revision 1.3 - (show annotations) (download)
Thu Oct 9 04:19:18 2003 UTC (20 years, 7 months ago) by edhill
Branch: MAIN
CVS Tags: checkpoint51k_post, checkpoint52l_pre, hrcube4, hrcube5, checkpoint52d_pre, checkpoint52j_pre, checkpoint51o_pre, checkpoint51l_post, checkpoint52k_post, checkpoint53, checkpoint52, checkpoint52f_post, checkpoint51t_post, checkpoint51n_post, checkpoint52i_pre, hrcube_1, hrcube_2, hrcube_3, checkpoint51s_post, checkpoint52e_pre, checkpoint52e_post, checkpoint51n_pre, checkpoint53d_post, checkpoint52b_pre, checkpoint51l_pre, checkpoint52m_post, checkpoint51q_post, checkpoint52b_post, checkpoint52c_post, checkpoint52f_pre, checkpoint53c_post, checkpoint51r_post, checkpoint51i_post, checkpoint53a_post, checkpoint52d_post, checkpoint52a_pre, checkpoint52i_post, checkpoint52h_pre, checkpoint53f_post, checkpoint52j_post, branch-netcdf, checkpoint52l_post, checkpoint52n_post, checkpoint53b_pre, checkpoint51o_post, checkpoint53b_post, checkpoint52a_post, ecco_c52_e35, checkpoint51m_post, checkpoint53d_pre, checkpoint51p_post, checkpoint51u_post
Branch point for: branch-nonh, tg2-branch, netcdf-sm0, checkpoint51n_branch
Changes since 1.2: +2 -1 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 C $Header: /u/u3/gcmpack/MITgcm/model/src/update_etah.F,v 1.2.6.1 2003/10/02 18:10:45 edhill Exp $
2 C $Name: $
3
4 #include "PACKAGES_CONFIG.h"
5 #include "CPP_OPTIONS.h"
6
7 CBOP
8 C !ROUTINE: UPDATE_ETAH
9 C !INTERFACE:
10 SUBROUTINE UPDATE_ETAH( myTime, myIter, myThid )
11 C !DESCRIPTION: \bv
12 C *==========================================================*
13 C | SUBROUTINE UPDATE_ETAH
14 C | o Update etaH at the begining of the time step.
15 C | (required with NLFS to derive surface layer thickness)
16 C *==========================================================*
17 C \ev
18
19 C !USES:
20 IMPLICIT NONE
21 C == Global variables
22 #include "SIZE.h"
23 #include "EEPARAMS.h"
24 #include "PARAMS.h"
25 #include "DYNVARS.h"
26 #include "GRID.h"
27 #include "SURFACE.h"
28 #include "FFIELDS.h"
29
30 C !INPUT/OUTPUT PARAMETERS:
31 C == Routine arguments ==
32 C myTime :: Current time in simulation
33 C myIter :: Current iteration number in simulation
34 C myThid :: Thread number for this instance of the routine.
35 _RL myTime
36 INTEGER myIter
37 INTEGER myThid
38
39 C !LOCAL VARIABLES:
40 #ifdef EXACT_CONSERV
41 C Local variables in common block
42
43 C Local variables
44 C i,j,k,bi,bj :: Loop counters
45 INTEGER i,j,k,bi,bj
46 CEOP
47
48
49 DO bj=myByLo(myThid),myByHi(myThid)
50 DO bi=myBxLo(myThid),myBxHi(myThid)
51 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
52
53 #ifdef NONLIN_FRSURF
54 c IF (useRealFreshWaterFlux .AND. nonlinFreeSurf.GT.0) THEN
55 IF ( (nonlinFreeSurf.GT.0 .OR. buoyancyRelation.EQ.'OCEANICP')
56 & .AND. useRealFreshWaterFlux ) THEN
57
58 C-- Called at the beginning of the time step :
59 C- keep present time EmPmR to compute later (S/R EXTERNAL_FORCING_SURF)
60 C tracers and momentum flux associated with fresh water input.
61
62 IF ( myTime.NE.startTime ) THEN
63 DO j=1-Oly,sNy+Oly
64 DO i=1-Olx,sNx+Olx
65 PmEpR(i,j,bi,bj) = -EmPmR(i,j,bi,bj)
66 ENDDO
67 ENDDO
68
69 ELSE
70 DO j=1-Oly,sNy+Oly
71 DO i=1-Olx,sNx+Olx
72 PmEpR(i,j,bi,bj) = 0. _d 0
73 ENDDO
74 ENDDO
75
76 IF( myTime .NE. 0. _d 0 .AND. nonlinFreeSurf.GE.0 ) THEN
77 C needs previous time-step value of E-P-R, that has not been loaded
78 C and was not in pickup-file ; try to use etaN & etaH instead.
79 DO j=1,sNy
80 DO i=1,sNx
81 PmEpR(i,j,bi,bj) =
82 & hDivFlow(i,j,bi,bj)*recip_rA(i,j,bi,bj)
83 & + (etaN(i,j,bi,bj)-etaH(i,j,bi,bj))
84 & /(implicDiv2Dflow*deltaTfreesurf)
85 PmEpR(i,j,bi,bj) = PmEpR(i,j,bi,bj)/convertEmP2rUnit
86 ENDDO
87 ENDDO
88 ENDIF
89 ENDIF
90
91 ENDIF
92 #endif /* NONLIN_FRSURF */
93
94 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
95
96 C-- Update etaH at the beginning of the time step :
97 C Incorporate the Explicit part of -Divergence(Barotropic_Flow)
98
99 IF ( useRealFreshWaterFlux .AND. myTime.EQ.startTime ) THEN
100 C needs previous time-step value of E-P-R, that has not been loaded
101 C and was not in pickup-file ; try to use etaN & etaH instead.
102 DO j=1-Oly,sNy+Oly
103 DO i=1-Olx,sNx+Olx
104 etaH(i,j,bi,bj) = etaN(i,j,bi,bj)
105 & + (etaN(i,j,bi,bj)-etaH(i,j,bi,bj))
106 & *(1. - implicDiv2Dflow)/implicDiv2Dflow
107 ENDDO
108 ENDDO
109
110 ELSEIF (implicDiv2Dflow.EQ. 1. _d 0) THEN
111 DO j=1-Oly,sNy+Oly
112 DO i=1-Olx,sNx+Olx
113 etaH(i,j,bi,bj) = etaN(i,j,bi,bj)
114 ENDDO
115 ENDDO
116
117 ELSEIF (useRealFreshWaterFlux) THEN
118 DO j=1,sNy
119 DO i=1,sNx
120 etaH(i,j,bi,bj) = etaN(i,j,bi,bj)
121 & - (1. - implicDiv2Dflow)*( convertEmP2rUnit*EmPmR(i,j,bi,bj)
122 & +hDivFlow(i,j,bi,bj)*recip_rA(i,j,bi,bj)
123 & )*deltaTfreesurf
124 ENDDO
125 ENDDO
126
127 ELSE
128 DO j=1,sNy
129 DO i=1,sNx
130 etaH(i,j,bi,bj) = etaN(i,j,bi,bj)
131 & - (1. - implicDiv2Dflow)*hDivFlow(i,j,bi,bj)
132 & *recip_rA(i,j,bi,bj)*deltaTfreesurf
133 ENDDO
134 ENDDO
135 ENDIF
136
137 #ifdef ALLOW_OBCS
138 #ifdef NONLIN_FRSURF
139 C- note: 1) needs to apply OBC to etaH since viscous terms depend on hFacZ.
140 C that is not only function of boundaries hFac values.
141 C 2) has to be done before calc_surf_dr; but since obcs_calc is
142 C called later, hFacZ will lag 1 time step behind OBC update.
143 C 3) avoid also unrealistic value of etaH in OB regions that
144 C might produce many "WARNING" message from calc_surf_dr.
145 C-------
146 IF ( useOBCS .AND. nonlinFreeSurf.GT.0 )
147 & CALL OBCS_APPLY_ETA( bi, bj, etaH, myThid )
148 #endif /* NONLIN_FRSURF */
149 #endif /* ALLOW_OBCS */
150
151 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
152
153 C- end bi,bj loop.
154 ENDDO
155 ENDDO
156
157 IF (implicDiv2Dflow .NE. 1. _d 0 .OR. useOBCS )
158 & _EXCH_XY_RL(etaH, myThid )
159
160 #endif /* EXACT_CONSERV */
161
162 #ifdef NONLIN_FRSURF
163 IF ( buoyancyRelation.EQ.'OCEANICP'
164 & .AND. useRealFreshWaterFlux
165 & .AND. myTime.EQ.startTime ) THEN
166 _EXCH_XY_RS(PmEpR, myThid )
167 ENDIF
168 #endif /* NONLIN_FRSURF */
169
170 RETURN
171 END

  ViewVC Help
Powered by ViewVC 1.1.22