/[MITgcm]/MITgcm/pkg/obcs/obcs_readparms.F
ViewVC logotype

Contents of /MITgcm/pkg/obcs/obcs_readparms.F

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


Revision 1.16 - (show annotations) (download)
Fri Oct 26 02:00:48 2007 UTC (17 years, 8 months ago) by dimitri
Branch: MAIN
Changes since 1.15: +11 -1 lines
Added open boundary conditions capability for seaice UICE, and VICE
UICE and VICE are reset at the edges after calling the solver and
before advection/diffusion.  Needs testing.

1 C $Header: /u/gcmpack/MITgcm/pkg/obcs/obcs_readparms.F,v 1.15 2007/10/23 08:25:28 dimitri Exp $
2 C $Name: $
3
4 #include "OBCS_OPTIONS.h"
5
6 SUBROUTINE OBCS_READPARMS( myThid )
7 C /==========================================================\
8 C | SUBROUTINE OBCS_READPARMS |
9 C | o Routine to initialize OBCS variables and constants. |
10 C |==========================================================|
11 C \==========================================================/
12 IMPLICIT NONE
13
14 C === Global variables ===
15 #include "SIZE.h"
16 #include "EEPARAMS.h"
17 #include "PARAMS.h"
18 #include "OBCS.h"
19 #ifdef ALLOW_ORLANSKI
20 #include "ORLANSKI.h"
21 #endif
22 #ifdef ALLOW_PTRACERS.h
23 #include "PTRACERS_SIZE.h"
24 #include "OBCS_PTRACERS.h"
25 #endif /* ALLOW_PTRACERS */
26
27 C === Routine arguments ===
28 INTEGER myThid
29
30 #ifdef ALLOW_OBCS
31
32 C === Local variables ===
33 C msgBuf - Informational/error meesage buffer
34 C iUnit - Work variable for IO unit number
35 CHARACTER*(MAX_LEN_MBUF) msgBuf
36 INTEGER iUnit
37 INTEGER I,J,iTracer
38
39 NAMELIST /OBCS_PARM01/
40 & OB_Jnorth,OB_Jsouth,OB_Ieast,OB_Iwest,
41 & useOrlanskiNorth,useOrlanskiSouth,
42 & useOrlanskiEast,useOrlanskiWest,
43 & OBNuFile,OBNvFile,OBNtFile,OBNsFile,OBNaFile,OBNhFile,
44 & OBSuFile,OBSvFile,OBStFile,OBSsFile,OBSaFile,OBShFile,
45 & OBEuFile,OBEvFile,OBEtFile,OBEsFile,OBEaFile,OBEhFile,
46 & OBWuFile,OBWvFile,OBWtFile,OBWsFile,OBWaFile,OBWhFile,
47 & OBNslFile,OBSslFile,OBEslFile,OBWslFile,
48 & OBNsnFile,OBSsnFile,OBEsnFile,OBWsnFile,
49 & OBNuiceFile,OBSuiceFile,OBEuiceFile,OBWuiceFile,
50 & OBNviceFile,OBSviceFile,OBEviceFile,OBWviceFile,
51 & useOBCSsponge, useOBCSbalance, useOBCSprescribe,
52 & OBCSprintDiags
53 #ifdef ALLOW_PTRACERS
54 & , OBNptrFile,OBSptrFile,OBEptrFile,OBWptrFile
55 #endif
56
57 #ifdef ALLOW_ORLANSKI
58 NAMELIST /OBCS_PARM02/
59 & CMAX, cvelTimeScale, CFIX, useFixedCEast, useFixedCWest
60 #endif
61
62 #ifdef ALLOW_OBCS_SPONGE
63 NAMELIST /OBCS_PARM03/
64 & Urelaxobcsinner,Urelaxobcsbound,
65 & Vrelaxobcsinner,Vrelaxobcsbound,
66 & spongeThickness
67 #endif
68
69 _BEGIN_MASTER(myThid)
70
71 C-- OBCS_READPARMS has been called so we know that
72 C the package is active.
73 OBCSIsOn=.TRUE.
74
75 WRITE(msgBuf,'(A)') ' OBCS_READPARMS: opening data.obcs'
76 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
77 & SQUEEZE_RIGHT , 1)
78
79 CALL OPEN_COPY_DATA_FILE(
80 I 'data.obcs', 'OBCS_READPARMS',
81 O iUnit,
82 I myThid )
83
84 C-- Default flags and values for OBCS
85 DO I=1,Nx
86 OB_Jnorth(I)=0
87 OB_Jsouth(I)=0
88 ENDDO
89 DO J=1,Ny
90 OB_Ieast(J)=0
91 OB_Iwest(J)=0
92 ENDDO
93 useOrlanskiNorth=.FALSE.
94 useOrlanskiSouth=.FALSE.
95 useOrlanskiEast =.FALSE.
96 useOrlanskiWest =.FALSE.
97 useOBCSsponge =.FALSE.
98 useOBCSbalance =.FALSE.
99 useOBCSprescribe=.FALSE.
100 OBCSprintDiags =.TRUE.
101
102 OBNuFile = ' '
103 OBNvFile = ' '
104 OBNtFile = ' '
105 OBNsFile = ' '
106 OBNaFile = ' '
107 OBNslFile = ' '
108 OBNsnFile = ' '
109 OBNuiceFile = ' '
110 OBNviceFile = ' '
111 OBNhFile = ' '
112 OBSuFile = ' '
113 OBSvFile = ' '
114 OBStFile = ' '
115 OBSsFile = ' '
116 OBSaFile = ' '
117 OBShFile = ' '
118 OBSslFile = ' '
119 OBSsnFile = ' '
120 OBSuiceFile = ' '
121 OBSviceFile = ' '
122 OBEuFile = ' '
123 OBEvFile = ' '
124 OBEtFile = ' '
125 OBEsFile = ' '
126 OBEaFile = ' '
127 OBEhFile = ' '
128 OBEslFile = ' '
129 OBEsnFile = ' '
130 OBEuiceFile = ' '
131 OBEviceFile = ' '
132 OBWuFile = ' '
133 OBWvFile = ' '
134 OBWtFile = ' '
135 OBWsFile = ' '
136 OBWaFile = ' '
137 OBWhFile = ' '
138 OBWslFile = ' '
139 OBWsnFile = ' '
140 OBWuiceFile = ' '
141 OBWviceFile = ' '
142 #ifdef ALLOW_PTRACERS
143 DO iTracer = 1, PTRACERS_num
144 OBNptrFile(iTracer) = ' '
145 OBSptrFile(iTracer) = ' '
146 OBEptrFile(iTracer) = ' '
147 OBWptrFile(iTracer) = ' '
148 ENDDO
149 #endif
150
151 C-- Read parameters from open data file
152 READ(UNIT=iUnit,NML=OBCS_PARM01)
153
154 C Account for periodicity if negative indices were supplied
155 DO J=1,Ny
156 IF (OB_Ieast(J).lt.0) OB_Ieast(J)=OB_Ieast(J)+Nx+1
157 ENDDO
158 DO I=1,Nx
159 IF (OB_Jnorth(I).lt.0) OB_Jnorth(I)=OB_Jnorth(I)+Ny+1
160 ENDDO
161 write(*,*) 'OB Jn =',OB_Jnorth
162 write(*,*) 'OB Js =',OB_Jsouth
163 write(*,*) 'OB Ie =',OB_Ieast
164 write(*,*) 'OB Iw =',OB_Iwest
165
166 #ifdef ALLOW_ORLANSKI
167 C Default Orlanski radiation parameters
168 CMAX = 0.45 _d 0 /* maximum allowable phase speed-CFL for AB-II */
169 cvelTimeScale = 2000.0 _d 0 /* Averaging period for phase speed in sec. */
170 CFIX = 0.8 _d 0 /* Fixed boundary phase speed in m/s */
171 useFixedCEast=.FALSE.
172 useFixedCWest=.FALSE.
173 IF (useOrlanskiNorth.OR.
174 & useOrlanskiSouth.OR.
175 & useOrlanskiEast.OR.
176 & useOrlanskiWest)
177 & READ(UNIT=iUnit,NML=OBCS_PARM02)
178 #endif
179
180 #ifdef ALLOW_OBCS_SPONGE
181 C Default sponge layer parameters:
182 C sponge layer is turned off by default
183 spongeThickness = 0
184 Urelaxobcsinner = 0. _d 0
185 Urelaxobcsbound = 0. _d 0
186 Vrelaxobcsinner = 0. _d 0
187 Vrelaxobcsbound = 0. _d 0
188 CML this was the previous default in units of days
189 CML spongeThickness = 2
190 CML Urelaxobcsinner = 5. _d 0
191 CML Urelaxobcsbound = 1. _d 0
192 CML Vrelaxobcsinner = 5. _d 0
193 CML Vrelaxobcsbound = 1. _d 0
194 IF (useOBCSsponge)
195 & READ(UNIT=iUnit,NML=OBCS_PARM03)
196 #endif
197
198 WRITE(msgBuf,'(A)') ' OBCS_READPARMS: finished reading data.obcs'
199 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
200 & SQUEEZE_RIGHT , 1)
201
202 C-- Close the open data file
203 CLOSE(iUnit)
204 _END_MASTER(myThid)
205
206 C-- Everyone else must wait for the parameters to be loaded
207 _BARRIER
208
209 #endif /* ALLOW_OBCS */
210 RETURN
211 END

  ViewVC Help
Powered by ViewVC 1.1.22