1 |
C $Header: /u/gcmpack/MITgcm/model/src/ini_psurf.F,v 1.11 2009/06/14 21:45:12 jmc Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "PACKAGES_CONFIG.h" |
5 |
#include "CPP_OPTIONS.h" |
6 |
|
7 |
CBOP |
8 |
C !ROUTINE: INI_PSURF |
9 |
C !INTERFACE: |
10 |
SUBROUTINE INI_PSURF( myThid ) |
11 |
|
12 |
C !DESCRIPTION: \bv |
13 |
C *==========================================================* |
14 |
C | SUBROUTINE INI_PSURF | |
15 |
C | o Set model initial free-surface height/pressure. | |
16 |
C *==========================================================* |
17 |
C | There are several options for setting the initial | |
18 |
C | surface displacement (r unit) field. | |
19 |
C | 1. Inline code | |
20 |
C | 2. Two-dimensional data from a file. | |
21 |
C *==========================================================* |
22 |
C \ev |
23 |
|
24 |
C !USES: |
25 |
IMPLICIT NONE |
26 |
C === Global variables === |
27 |
#include "SIZE.h" |
28 |
#include "EEPARAMS.h" |
29 |
#include "PARAMS.h" |
30 |
#include "GRID.h" |
31 |
#include "DYNVARS.h" |
32 |
#include "SURFACE.h" |
33 |
#ifdef ALLOW_CD_CODE |
34 |
# include "CD_CODE_VARS.h" |
35 |
#endif |
36 |
#ifdef ALLOW_SHELFICE |
37 |
# include "SHELFICE.h" |
38 |
#endif |
39 |
|
40 |
C !INPUT/OUTPUT PARAMETERS: |
41 |
C == Routine arguments == |
42 |
C myThid :: Number of this instance of INI_PSURF |
43 |
INTEGER myThid |
44 |
|
45 |
C !LOCAL VARIABLES: |
46 |
C == Local variables == |
47 |
C bi,bj :: tiles indices |
48 |
C I,J :: Loop counters |
49 |
INTEGER bi, bj |
50 |
INTEGER I, J |
51 |
CEOP |
52 |
|
53 |
C-- Initialise surface position anomaly to zero |
54 |
DO bj = myByLo(myThid), myByHi(myThid) |
55 |
DO bi = myBxLo(myThid), myBxHi(myThid) |
56 |
DO J=1-OLy,sNy+OLy |
57 |
DO I=1-OLx,sNx+OLx |
58 |
etaN(I,J,bi,bj) = 0. _d 0 |
59 |
ENDDO |
60 |
ENDDO |
61 |
ENDDO |
62 |
ENDDO |
63 |
C Read an initial state |
64 |
IF (pSurfInitFile .NE. ' ') THEN |
65 |
CALL READ_FLD_XY_RL( pSurfInitFile, ' ', etaN, 0, myThid ) |
66 |
C fill the overlap (+ BARRIER) |
67 |
_EXCH_XY_RL(etaN, myThid) |
68 |
ENDIF |
69 |
|
70 |
#ifdef ALLOW_CD_CODE |
71 |
C-- By default, initialize etaNm1 with etaN : |
72 |
DO bj=myByLo(myThid),myByHi(myThid) |
73 |
DO bi=myBxLo(myThid),myBxHi(myThid) |
74 |
DO J=1-OLy,sNy+OLy |
75 |
DO I=1-OLx,sNx+OLx |
76 |
etaNm1(I,J,bi,bj) = etaN(I,J,bi,bj) |
77 |
ENDDO |
78 |
ENDDO |
79 |
ENDDO |
80 |
ENDDO |
81 |
C _EXCH_XY_RL(etaNm1, myThid) |
82 |
#endif |
83 |
|
84 |
#ifdef EXACT_CONSERV |
85 |
C-- By default, initialize etaH with etaN : |
86 |
DO bj=myByLo(myThid),myByHi(myThid) |
87 |
DO bi=myBxLo(myThid),myBxHi(myThid) |
88 |
DO j=1-OLy,sNy+OLy |
89 |
DO i=1-OLx,sNx+OLx |
90 |
etaH(i,j,bi,bj) = etaN(i,j,bi,bj) |
91 |
etaHnm1(i,j,bi,bj) = etaN(i,j,bi,bj) |
92 |
dEtaHdt(i,j,bi,bj) = 0. _d 0 |
93 |
ENDDO |
94 |
ENDDO |
95 |
ENDDO |
96 |
ENDDO |
97 |
#endif /* EXACT_CONSERV */ |
98 |
|
99 |
#ifdef ALLOW_SHELFICE |
100 |
IF ( useShelfIce .AND. usingZCoords ) THEN |
101 |
DO bj=myByLo(myThid),myByHi(myThid) |
102 |
DO bi=myBxLo(myThid),myBxHi(myThid) |
103 |
DO j=1-OLy,sNy+OLy |
104 |
DO i=1-OLx,sNx+OLx |
105 |
phi0surf(i,j,bi,bj) = phi0surf(i,j,bi,bj) |
106 |
& + shelficeLoadAnomaly(i,j,bi,bj)*recip_rhoConst |
107 |
ENDDO |
108 |
ENDDO |
109 |
ENDDO |
110 |
ENDDO |
111 |
ENDIF |
112 |
#endif /* ALLOW_SHELFICE */ |
113 |
|
114 |
RETURN |
115 |
END |