1 |
C $Header: /u/gcmpack/MITgcm/pkg/shelfice/shelfice_update_masks.F,v 1.6 2014/09/11 19:20:38 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 "SHELFICE.h" |
28 |
#endif /* ALLOW_SHELFICE */ |
29 |
|
30 |
C !INPUT/OUTPUT PARAMETERS: |
31 |
C == Routine arguments == |
32 |
C rLowC :: base of fluid column in r_unit at grid-cell center |
33 |
C rSurfC :: surface reference position (r_unit) at grid-cell center |
34 |
C myThid :: my Thread Id number |
35 |
_RS rLowC (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
36 |
_RS rSurfC (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
37 |
INTEGER myThid |
38 |
|
39 |
#ifdef ALLOW_SHELFICE |
40 |
C !LOCAL VARIABLES: |
41 |
C == Local variables == |
42 |
C bi, bj :: tile indices |
43 |
C i, j :: Loop counters |
44 |
INTEGER bi, bj |
45 |
INTEGER i, j |
46 |
CEOP |
47 |
|
48 |
C-- Initialize R_shelfIce |
49 |
DO bj = myByLo(myThid), myByHi(myThid) |
50 |
DO bi = myBxLo(myThid), myBxHi(myThid) |
51 |
DO j=1-OLy,sNy+OLy |
52 |
DO i=1-OLx,sNx+OLx |
53 |
R_shelfIce(i,j,bi,bj) = 0. _d 0 |
54 |
ENDDO |
55 |
ENDDO |
56 |
ENDDO |
57 |
ENDDO |
58 |
|
59 |
IF ( SHELFICEtopoFile .NE. ' ' ) THEN |
60 |
_BARRIER |
61 |
C- Read the shelfIce draught using the mid-level I/O pacakage read_write_rec |
62 |
C The 0 is the "iteration" argument. The 1 is the record number. |
63 |
CALL READ_REC_XY_RS( SHELFICEtopoFile, R_shelfIce, |
64 |
& 1, 0, myThid ) |
65 |
C- Read the shelfIce draught using the mid-level I/O pacakage read_write_fld |
66 |
C The 0 is the "iteration" argument. The ' ' is an empty suffix |
67 |
C CALL READ_FLD_XY_RS( SHELFICEtopoFile, ' ', R_shelfIce, |
68 |
C & 0, myThid ) |
69 |
C- end setup R_shelfIce in the interior |
70 |
ENDIF |
71 |
|
72 |
C- fill in the overlap (+ BARRIER): |
73 |
_EXCH_XY_RS( R_shelfIce, myThid ) |
74 |
|
75 |
C-- Modify ocean upper boundary position according to ice-shelf topography |
76 |
IF ( usingZCoords ) THEN |
77 |
DO bj=myByLo(myThid), myByHi(myThid) |
78 |
DO bi=myBxLo(myThid), myBxHi(myThid) |
79 |
DO j=1-OLy,sNy+OLy |
80 |
DO i=1-OLx,sNx+OLx |
81 |
rSurfC(i,j,bi,bj) = |
82 |
& MIN( rSurfC(i,j,bi,bj), R_shelfIce(i,j,bi,bj) ) |
83 |
ENDDO |
84 |
ENDDO |
85 |
ENDDO |
86 |
ENDDO |
87 |
ELSE |
88 |
STOP 'SHELFICE_INIT_DEPTHS: Missing code for P-coords' |
89 |
ENDIF |
90 |
|
91 |
#endif /* ALLOW_SHELFICE */ |
92 |
|
93 |
RETURN |
94 |
END |