1 |
dimitri |
1.14 |
C $Header: /u/gcmpack/MITgcm/pkg/obcs/obcs_readparms.F,v 1.13 2006/10/17 19:00:44 jmc Exp $ |
2 |
heimbach |
1.7 |
C $Name: $ |
3 |
adcroft |
1.2 |
|
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 |
mlosch |
1.11 |
#ifdef ALLOW_PTRACERS.h |
23 |
|
|
#include "PTRACERS_SIZE.h" |
24 |
|
|
#include "OBCS_PTRACERS.h" |
25 |
|
|
#endif /* ALLOW_PTRACERS */ |
26 |
adcroft |
1.2 |
|
27 |
|
|
C === Routine arguments === |
28 |
|
|
INTEGER myThid |
29 |
|
|
|
30 |
|
|
#ifdef ALLOW_OBCS |
31 |
|
|
|
32 |
jmc |
1.13 |
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 |
adcroft |
1.2 |
NAMELIST /OBCS_PARM01/ |
40 |
|
|
& OB_Jnorth,OB_Jsouth,OB_Ieast,OB_Iwest, |
41 |
|
|
& useOrlanskiNorth,useOrlanskiSouth, |
42 |
heimbach |
1.5 |
& useOrlanskiEast,useOrlanskiWest, |
43 |
dimitri |
1.14 |
& 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 |
mlosch |
1.12 |
& useOBCSsponge, useOBCSbalance, useOBCSprescribe, |
48 |
|
|
& OBCSprintDiags |
49 |
mlosch |
1.11 |
#ifdef ALLOW_PTRACERS |
50 |
|
|
& , OBNptrFile,OBSptrFile,OBEptrFile,OBWptrFile |
51 |
|
|
#endif |
52 |
adcroft |
1.3 |
|
53 |
|
|
#ifdef ALLOW_ORLANSKI |
54 |
|
|
NAMELIST /OBCS_PARM02/ |
55 |
adcroft |
1.6 |
& CMAX, cvelTimeScale, CFIX, useFixedCEast, useFixedCWest |
56 |
adcroft |
1.3 |
#endif |
57 |
adcroft |
1.2 |
|
58 |
heimbach |
1.7 |
#ifdef ALLOW_OBCS_SPONGE |
59 |
|
|
NAMELIST /OBCS_PARM03/ |
60 |
|
|
& Urelaxobcsinner,Urelaxobcsbound, |
61 |
|
|
& Vrelaxobcsinner,Vrelaxobcsbound, |
62 |
|
|
& spongeThickness |
63 |
|
|
#endif |
64 |
|
|
|
65 |
jmc |
1.13 |
_BEGIN_MASTER(myThid) |
66 |
adcroft |
1.2 |
|
67 |
|
|
C-- OBCS_READPARMS has been called so we know that |
68 |
|
|
C the package is active. |
69 |
|
|
OBCSIsOn=.TRUE. |
70 |
|
|
|
71 |
|
|
WRITE(msgBuf,'(A)') ' OBCS_READPARMS: opening data.obcs' |
72 |
|
|
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
73 |
|
|
& SQUEEZE_RIGHT , 1) |
74 |
|
|
|
75 |
|
|
CALL OPEN_COPY_DATA_FILE( |
76 |
|
|
I 'data.obcs', 'OBCS_READPARMS', |
77 |
|
|
O iUnit, |
78 |
|
|
I myThid ) |
79 |
|
|
|
80 |
|
|
C-- Default flags and values for OBCS |
81 |
|
|
DO I=1,Nx |
82 |
|
|
OB_Jnorth(I)=0 |
83 |
|
|
OB_Jsouth(I)=0 |
84 |
|
|
ENDDO |
85 |
|
|
DO J=1,Ny |
86 |
|
|
OB_Ieast(J)=0 |
87 |
|
|
OB_Iwest(J)=0 |
88 |
|
|
ENDDO |
89 |
|
|
useOrlanskiNorth=.FALSE. |
90 |
|
|
useOrlanskiSouth=.FALSE. |
91 |
|
|
useOrlanskiEast =.FALSE. |
92 |
|
|
useOrlanskiWest =.FALSE. |
93 |
heimbach |
1.7 |
useOBCSsponge =.FALSE. |
94 |
mlosch |
1.8 |
useOBCSbalance =.FALSE. |
95 |
mlosch |
1.12 |
useOBCSprescribe=.FALSE. |
96 |
|
|
OBCSprintDiags =.TRUE. |
97 |
heimbach |
1.5 |
|
98 |
|
|
OBNuFile = ' ' |
99 |
|
|
OBNvFile = ' ' |
100 |
|
|
OBNtFile = ' ' |
101 |
|
|
OBNsFile = ' ' |
102 |
dimitri |
1.14 |
OBNaFile = ' ' |
103 |
|
|
OBNhFile = ' ' |
104 |
heimbach |
1.5 |
OBSuFile = ' ' |
105 |
|
|
OBSvFile = ' ' |
106 |
|
|
OBStFile = ' ' |
107 |
|
|
OBSsFile = ' ' |
108 |
dimitri |
1.14 |
OBSaFile = ' ' |
109 |
|
|
OBShFile = ' ' |
110 |
heimbach |
1.5 |
OBEuFile = ' ' |
111 |
|
|
OBEvFile = ' ' |
112 |
|
|
OBEtFile = ' ' |
113 |
|
|
OBEsFile = ' ' |
114 |
dimitri |
1.14 |
OBEaFile = ' ' |
115 |
|
|
OBEhFile = ' ' |
116 |
heimbach |
1.5 |
OBWuFile = ' ' |
117 |
|
|
OBWvFile = ' ' |
118 |
|
|
OBWtFile = ' ' |
119 |
|
|
OBWsFile = ' ' |
120 |
dimitri |
1.14 |
OBWaFile = ' ' |
121 |
|
|
OBWhFile = ' ' |
122 |
mlosch |
1.11 |
#ifdef ALLOW_PTRACERS |
123 |
|
|
DO iTracer = 1, PTRACERS_num |
124 |
|
|
OBNptrFile(iTracer) = ' ' |
125 |
|
|
OBSptrFile(iTracer) = ' ' |
126 |
|
|
OBEptrFile(iTracer) = ' ' |
127 |
|
|
OBWptrFile(iTracer) = ' ' |
128 |
|
|
ENDDO |
129 |
|
|
#endif |
130 |
adcroft |
1.2 |
|
131 |
|
|
C-- Read parameters from open data file |
132 |
|
|
READ(UNIT=iUnit,NML=OBCS_PARM01) |
133 |
|
|
|
134 |
|
|
C Account for periodicity if negative indices were supplied |
135 |
|
|
DO J=1,Ny |
136 |
|
|
IF (OB_Ieast(J).lt.0) OB_Ieast(J)=OB_Ieast(J)+Nx+1 |
137 |
|
|
ENDDO |
138 |
|
|
DO I=1,Nx |
139 |
|
|
IF (OB_Jnorth(I).lt.0) OB_Jnorth(I)=OB_Jnorth(I)+Ny+1 |
140 |
|
|
ENDDO |
141 |
heimbach |
1.4 |
write(*,*) 'OB Jn =',OB_Jnorth |
142 |
|
|
write(*,*) 'OB Js =',OB_Jsouth |
143 |
|
|
write(*,*) 'OB Ie =',OB_Ieast |
144 |
|
|
write(*,*) 'OB Iw =',OB_Iwest |
145 |
adcroft |
1.2 |
|
146 |
adcroft |
1.3 |
#ifdef ALLOW_ORLANSKI |
147 |
|
|
C Default Orlanski radiation parameters |
148 |
|
|
CMAX = 0.45 _d 0 /* maximum allowable phase speed-CFL for AB-II */ |
149 |
|
|
cvelTimeScale = 2000.0 _d 0 /* Averaging period for phase speed in sec. */ |
150 |
adcroft |
1.6 |
CFIX = 0.8 _d 0 /* Fixed boundary phase speed in m/s */ |
151 |
|
|
useFixedCEast=.FALSE. |
152 |
|
|
useFixedCWest=.FALSE. |
153 |
adcroft |
1.3 |
IF (useOrlanskiNorth.OR. |
154 |
|
|
& useOrlanskiSouth.OR. |
155 |
|
|
& useOrlanskiEast.OR. |
156 |
jmc |
1.13 |
& useOrlanskiWest) |
157 |
adcroft |
1.3 |
& READ(UNIT=iUnit,NML=OBCS_PARM02) |
158 |
adcroft |
1.2 |
#endif |
159 |
jmc |
1.13 |
|
160 |
heimbach |
1.7 |
#ifdef ALLOW_OBCS_SPONGE |
161 |
mlosch |
1.10 |
C Default sponge layer parameters: |
162 |
|
|
C sponge layer is turned off by default |
163 |
|
|
spongeThickness = 0 |
164 |
|
|
Urelaxobcsinner = 0. _d 0 |
165 |
|
|
Urelaxobcsbound = 0. _d 0 |
166 |
|
|
Vrelaxobcsinner = 0. _d 0 |
167 |
|
|
Vrelaxobcsbound = 0. _d 0 |
168 |
|
|
CML this was the previous default in units of days |
169 |
|
|
CML spongeThickness = 2 |
170 |
|
|
CML Urelaxobcsinner = 5. _d 0 |
171 |
|
|
CML Urelaxobcsbound = 1. _d 0 |
172 |
|
|
CML Vrelaxobcsinner = 5. _d 0 |
173 |
|
|
CML Vrelaxobcsbound = 1. _d 0 |
174 |
heimbach |
1.7 |
IF (useOBCSsponge) |
175 |
|
|
& READ(UNIT=iUnit,NML=OBCS_PARM03) |
176 |
|
|
#endif |
177 |
|
|
|
178 |
adcroft |
1.2 |
WRITE(msgBuf,'(A)') ' OBCS_READPARMS: finished reading data.obcs' |
179 |
|
|
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
180 |
|
|
& SQUEEZE_RIGHT , 1) |
181 |
|
|
|
182 |
|
|
C-- Close the open data file |
183 |
|
|
CLOSE(iUnit) |
184 |
|
|
_END_MASTER(myThid) |
185 |
|
|
|
186 |
|
|
C-- Everyone else must wait for the parameters to be loaded |
187 |
|
|
_BARRIER |
188 |
|
|
|
189 |
|
|
#endif /* ALLOW_OBCS */ |
190 |
|
|
RETURN |
191 |
|
|
END |