1 |
C $Header: /home/ubuntu/mnt/e9_copy/MITgcm/pkg/shelfice/shelfice_init_depths.F,v 1.1 2017/04/10 23:50:41 jmc Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "SHELFICE_OPTIONS.h" |
5 |
|
6 |
CBOP |
7 |
C !ROUTINE: SHELFICE_INIT_DEPTHS |
8 |
C !INTERFACE: |
9 |
SUBROUTINE SHELFICE_INIT_DEPTHS( |
10 |
U rLowC, rSurfC, |
11 |
I myThid ) |
12 |
C !DESCRIPTION: \bv |
13 |
C *==========================================================* |
14 |
C | SUBROUTINE SHELFICE_INIT_DEPTHS |
15 |
C | o Modify ocean upper boundary position according to |
16 |
C | ice-shelf topography |
17 |
C *==========================================================* |
18 |
C \ev |
19 |
|
20 |
C !USES: |
21 |
IMPLICIT NONE |
22 |
C === Global variables === |
23 |
#include "SIZE.h" |
24 |
#include "EEPARAMS.h" |
25 |
#include "PARAMS.h" |
26 |
#ifdef ALLOW_SHELFICE |
27 |
#include "GRID.h" |
28 |
# include "SHELFICE.h" |
29 |
#endif /* ALLOW_SHELFICE */ |
30 |
|
31 |
C !INPUT/OUTPUT PARAMETERS: |
32 |
C == Routine arguments == |
33 |
C rLowC :: base of fluid column in r_unit at grid-cell center |
34 |
C rSurfC :: surface reference position (r_unit) at grid-cell center |
35 |
C myThid :: my Thread Id number |
36 |
_RS rLowC (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
37 |
_RS rSurfC (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
38 |
INTEGER myThid |
39 |
|
40 |
#ifdef ALLOW_SHELFICE |
41 |
C !LOCAL VARIABLES: |
42 |
C == Local variables == |
43 |
C bi, bj :: tile indices |
44 |
C i, j :: Loop counters |
45 |
INTEGER bi, bj |
46 |
INTEGER i, j, k |
47 |
CEOP |
48 |
|
49 |
C-- Initialize R_shelfIce |
50 |
DO bj = myByLo(myThid), myByHi(myThid) |
51 |
DO bi = myBxLo(myThid), myBxHi(myThid) |
52 |
DO j=1-OLy,sNy+OLy |
53 |
DO i=1-OLx,sNx+OLx |
54 |
R_shelfIce(i,j,bi,bj) = 0. _d 0 |
55 |
ENDDO |
56 |
ENDDO |
57 |
ENDDO |
58 |
ENDDO |
59 |
|
60 |
IF ( SHELFICEtopoFile .NE. ' ' ) THEN |
61 |
_BARRIER |
62 |
C- Read the shelfIce draught using the mid-level I/O pacakage read_write_rec |
63 |
C The 0 is the "iteration" argument. The 1 is the record number. |
64 |
CALL READ_REC_XY_RS( SHELFICEtopoFile, R_shelfIce, |
65 |
& 1, 0, myThid ) |
66 |
C- Read the shelfIce draught using the mid-level I/O pacakage read_write_fld |
67 |
C The 0 is the "iteration" argument. The ' ' is an empty suffix |
68 |
C CALL READ_FLD_XY_RS( SHELFICEtopoFile, ' ', R_shelfIce, |
69 |
C & 0, myThid ) |
70 |
C- end setup R_shelfIce in the interior |
71 |
ENDIF |
72 |
|
73 |
C- fill in the overlap (+ BARRIER): |
74 |
_EXCH_XY_RS( R_shelfIce, myThid ) |
75 |
|
76 |
C-- Modify ocean upper boundary position according to ice-shelf topography |
77 |
IF ( usingZCoords ) THEN |
78 |
DO bj=myByLo(myThid), myByHi(myThid) |
79 |
DO bi=myBxLo(myThid), myBxHi(myThid) |
80 |
DO j=1-OLy,sNy+OLy |
81 |
DO i=1-OLx,sNx+OLx |
82 |
rSurfC(i,j,bi,bj) = |
83 |
& MIN( rSurfC(i,j,bi,bj), R_shelfIce(i,j,bi,bj) ) |
84 |
ENDDO |
85 |
ENDDO |
86 |
ENDDO |
87 |
ENDDO |
88 |
ELSE |
89 |
STOP 'SHELFICE_INIT_DEPTHS: Missing code for P-coords' |
90 |
ENDIF |
91 |
|
92 |
C---- ICEFRONT BEGIN |
93 |
IF ( ICEFRONTlengthFile .NE. ' ' ) THEN |
94 |
CALL READ_FLD_XY_RS( ICEFRONTlengthFile, ' ', |
95 |
& icefrontlength, 0, myThid ) |
96 |
_EXCH_XY_RS( icefrontlength, myThid ) |
97 |
ENDIF |
98 |
|
99 |
IF ( ICEFRONTdepthFile .NE. ' ' ) THEN |
100 |
CALL READ_FLD_XY_RS( ICEFRONTdepthFile, ' ', |
101 |
& R_icefront, 0, myThid ) |
102 |
_EXCH_XY_RS( R_icefront, myThid ) |
103 |
ENDIF |
104 |
|
105 |
C Make sure that R_icefront is positive |
106 |
DO bj = myByLo(myThid), myByHi(myThid) |
107 |
DO bi = myBxLo(myThid), myBxHi(myThid) |
108 |
DO J = 1-OLy, sNy+OLy |
109 |
DO I = 1-OLx, sNx+OLx |
110 |
R_icefront(I,J,bi,bj) = ABS(R_icefront(I,J,bi,bj)) |
111 |
ENDDO |
112 |
ENDDO |
113 |
ENDDO |
114 |
ENDDO |
115 |
|
116 |
C---- ICEFRONT END |
117 |
|
118 |
#endif /* ALLOW_SHELFICE */ |
119 |
|
120 |
|
121 |
RETURN |
122 |
END |