File indexing completed on 2024-06-06 05:11:01 UTC
view on githubraw file Latest commit af61e5eb on 2024-06-06 03:30:35 UTC
42c525bfb4 Alis*0001 #include "OBCS_OPTIONS.h"
0002
b4626a356d Jean*0003
0004
0005
42c525bfb4 Alis*0006 SUBROUTINE OBCS_READPARMS( myThid )
b4626a356d Jean*0007
0008
2d12bccb16 Jean*0009
0010
0011
0012
b4626a356d Jean*0013
42c525bfb4 Alis*0014
b4626a356d Jean*0015
0016 IMPLICIT NONE
42c525bfb4 Alis*0017
0018 #include "SIZE.h"
0019 #include "EEPARAMS.h"
0020 #include "PARAMS.h"
9b4f2a04e2 Jean*0021 #include "OBCS_PARAMS.h"
0022 #include "OBCS_GRID.h"
0023 #include "OBCS_SEAICE.h"
42c525bfb4 Alis*0024 #ifdef ALLOW_ORLANSKI
0025 #include "ORLANSKI.h"
0026 #endif
0d9be7eb22 Jean*0027 #ifdef ALLOW_PTRACERS
ee1c912a22 Mart*0028 #include "PTRACERS_SIZE.h"
0029 #include "OBCS_PTRACERS.h"
0030 #endif /* ALLOW_PTRACERS */
9a428ff231 Oliv*0031 #ifdef ALLOW_EXCH2
0032 #include "W2_EXCH2_SIZE.h"
0033 #include "W2_EXCH2_TOPOLOGY.h"
0034 #include "W2_EXCH2_PARAMS.h"
0035 #endif /* ALLOW_EXCH2 */
42c525bfb4 Alis*0036
b4626a356d Jean*0037
42c525bfb4 Alis*0038 INTEGER myThid
0039
0040 #ifdef ALLOW_OBCS
672b822630 Jean*0041
0042 INTEGER ILNBLNK
0043 EXTERNAL ILNBLNK
42c525bfb4 Alis*0044
b4626a356d Jean*0045
45bc474d14 Jean*0046
0047
0048
0049
0050
0051
0052
9b8b001637 Jean*0053 CHARACTER*(MAX_LEN_MBUF) msgBuf
0054 INTEGER iUnit
45bc474d14 Jean*0055 INTEGER errCount
6646af77e1 Jean*0056 INTEGER i, j
d222604fe0 Mart*0057 INTEGER bi, bj, iG, jG, iGm, jGm
c816a80284 Jean*0058 INTEGER OB_indexUnset
8d129534f3 Jean*0059 #ifdef ALLOW_PTRACERS
0060 INTEGER iTracer
0061 #endif
9a428ff231 Oliv*0062 #ifdef ALLOW_EXCH2
0063 INTEGER tN
0064 #endif /* ALLOW_EXCH2 */
0065
0066
0067
0068
0069
0070
0071
0072
0073
0074
0075
0076
0077
0078
0079
0080
0081
0082
0083
0084
0085
0086
45bc474d14 Jean*0087
0088
0089
0090
0091
9a428ff231 Oliv*0092
0093
0094
0095
0096
0097
0098
0099
0100
0101
0102
0103 #ifdef ALLOW_EXCH2
0104 INTEGER OB_Jnorth(W2_maxXStackNx)
0105 INTEGER OB_Jsouth(W2_maxXStackNx)
0106 INTEGER OB_Ieast(W2_maxYStackNy)
0107 INTEGER OB_Iwest(W2_maxYStackNy)
0108 #else
0109 INTEGER OB_Jnorth(Nx)
0110 INTEGER OB_Jsouth(Nx)
0111 INTEGER OB_Ieast(Ny)
0112 INTEGER OB_Iwest(Ny)
0113 #endif
45bc474d14 Jean*0114 INTEGER OB_singleJnorth
0115 INTEGER OB_singleJsouth
0116 INTEGER OB_singleIeast
0117 INTEGER OB_singleIwest
9a428ff231 Oliv*0118
0119
0120
0121
0122
0123
0124
0125
0126
0127 INTEGER OBNS_Nx, OBNS_Ny
0128 INTEGER OBEW_Nx, OBEW_Ny
b4626a356d Jean*0129
9b8b001637 Jean*0130
672b822630 Jean*0131
05b5fb3079 Jean*0132 INTEGER nRetired
0133 LOGICAL useOBCSYearlyFields
672b822630 Jean*0134 _RL tidalPeriod(OBCS_tideCompSize)
0135 CHARACTER*(MAX_LEN_FNAM)
0136 & OBNamFile, OBSamFile, OBEamFile, OBWamFile,
0137 & OBNphFile, OBSphFile, OBEphFile, OBWphFile
05b5fb3079 Jean*0138
42c525bfb4 Alis*0139 NAMELIST /OBCS_PARM01/
ef03bf2dde Jean*0140 & insideOBmaskFile,
e4a300ec91 Jean*0141 & OBNconnectFile, OBSconnectFile,
0142 & OBEconnectFile, OBWconnectFile,
672b822630 Jean*0143 & OB_Jnorth, OB_Jsouth, OB_Ieast, OB_Iwest,
45bc474d14 Jean*0144 & OB_singleJnorth, OB_singleJsouth,
672b822630 Jean*0145 & OB_singleIeast, OB_singleIwest,
0146 & useOrlanskiNorth, useOrlanskiSouth,
0147 & useOrlanskiEast, useOrlanskiWest,
0148 & useStevensNorth, useStevensSouth,
0149 & useStevensEast, useStevensWest,
0150 & useOBCSprescribe, useOBCStides, OBCS_tidalPeriod,
4fb81a5efb Jean*0151 & OBCS_u1_adv_T, OBCS_u1_adv_S,
672b822630 Jean*0152 & OBNuFile, OBNvFile, OBNtFile, OBNsFile, OBNetaFile,
0153 & OBSuFile, OBSvFile, OBStFile, OBSsFile, OBSetaFile,
0154 & OBEuFile, OBEvFile, OBEtFile, OBEsFile, OBEetaFile,
0155 & OBWuFile, OBWvFile, OBWtFile, OBWsFile, OBWetaFile,
0156 & OBNwFile, OBSwFile, OBEwFile, OBWwFile,
0157 & OBN_uTidAmFile, OBS_uTidAmFile, OBE_uTidAmFile, OBW_uTidAmFile,
0158 & OBN_vTidAmFile, OBS_vTidAmFile, OBE_vTidAmFile, OBW_vTidAmFile,
0159 & OBN_uTidPhFile, OBS_uTidPhFile, OBE_uTidPhFile, OBW_uTidPhFile,
0160 & OBN_vTidPhFile, OBS_vTidPhFile, OBE_vTidPhFile, OBW_vTidPhFile,
0161 & OBNaFile, OBSaFile, OBEaFile, OBWaFile,
0162 & OBNhFile, OBShFile, OBEhFile, OBWhFile,
0163 & OBNslFile, OBSslFile, OBEslFile, OBWslFile,
0164 & OBNsnFile, OBSsnFile, OBEsnFile, OBWsnFile,
0165 & OBNuiceFile, OBSuiceFile, OBEuiceFile, OBWuiceFile,
0166 & OBNviceFile, OBSviceFile, OBEviceFile, OBWviceFile,
ee1c912a22 Mart*0167 #ifdef ALLOW_PTRACERS
4fb81a5efb Jean*0168 & OBCS_u1_adv_Tr,
672b822630 Jean*0169 & OBNptrFile, OBSptrFile, OBEptrFile, OBWptrFile,
ee1c912a22 Mart*0170 #endif
af61e5eb16 Mart*0171 & useOBCSsponge, useSeaiceSponge, useSeaiceNeumann,
432b2a4585 Dimi*0172 & OBCSsponge_N , OBCSsponge_S,
0173 & OBCSsponge_E, OBCSsponge_W,
0174 & OBCSsponge_UatNS, OBCSsponge_UatEW,
0175 & OBCSsponge_VatNS, OBCSsponge_VatEW,
0176 & OBCSsponge_Theta, OBCSsponge_Salt, useLinearSponge,
abfe198bce Mart*0177 & useOBCSbalance, OBCSbalanceSurf,
f4098ccf3f Jean*0178 & OBCS_balanceFacN, OBCS_balanceFacS,
0179 & OBCS_balanceFacE, OBCS_balanceFacW,
672b822630 Jean*0180 & OBCSfixTopo, OBCS_uvApplyFac,
6f4cf52d27 Dimi*0181 & OBCS_monitorFreq, OBCS_monSelect, OBCSprintDiags,
672b822630 Jean*0182 & useOBCSYearlyFields,
0183 & OBNAmFile, OBSAmFile, OBEAmFile, OBWAmFile,
0184 & OBNPhFile, OBSPhFile, OBEPhFile, OBWPhFile,
6f4cf52d27 Dimi*0185 & tidalPeriod
174cf6d3c0 Alis*0186
0187 #ifdef ALLOW_ORLANSKI
0188 NAMELIST /OBCS_PARM02/
f2f2d1c632 Alis*0189 & CMAX, cvelTimeScale, CFIX, useFixedCEast, useFixedCWest
174cf6d3c0 Alis*0190 #endif
42c525bfb4 Alis*0191
96bbd4e2a5 Patr*0192 #ifdef ALLOW_OBCS_SPONGE
0193 NAMELIST /OBCS_PARM03/
0194 & Urelaxobcsinner,Urelaxobcsbound,
0195 & Vrelaxobcsinner,Vrelaxobcsbound,
0196 & spongeThickness
0197 #endif
b2cb1ccb9a Mart*0198 #ifdef ALLOW_OBCS_STEVENS
0199 NAMELIST /OBCS_PARM04/
0200 & TrelaxStevens,SrelaxStevens,
0201 & useStevensPhaseVel,useStevensAdvection
b4626a356d Jean*0202 #endif /* ALLOW_OBCS_STEVENS */
c7c4b57180 Dimi*0203 #ifdef ALLOW_OBCS_SEAICE_SPONGE
0204 NAMELIST /OBCS_PARM05/
5e26aed318 Dimi*0205 & Arelaxobcsinner, Arelaxobcsbound,
0206 & Hrelaxobcsinner, Hrelaxobcsbound,
0207 & SLrelaxobcsinner,SLrelaxobcsbound,
0208 & SNrelaxobcsinner,SNrelaxobcsbound,
c7c4b57180 Dimi*0209 & seaiceSpongeThickness
ae4c29e0db Jean*0210 #endif
0211
0212 IF ( .NOT.useOBCS ) THEN
0213
0214 _BEGIN_MASTER(myThid)
0215
0216
0217 CALL PACKAGES_UNUSED_MSG( 'useOBCS', ' ', ' ' )
0218 _END_MASTER(myThid)
0219 RETURN
0220 ENDIF
96bbd4e2a5 Patr*0221
9b8b001637 Jean*0222 _BEGIN_MASTER(myThid)
42c525bfb4 Alis*0223
9a428ff231 Oliv*0224 #ifdef ALLOW_EXCH2
0225 OBNS_Nx = exch2_xStack_Nx
0226 OBNS_Ny = exch2_xStack_Ny
0227 OBEW_Nx = exch2_yStack_Nx
0228 OBEW_Ny = exch2_yStack_Ny
0229 #else
0230 OBNS_Nx = Nx
0231 OBNS_Ny = Ny
0232 OBEW_Nx = Nx
0233 OBEW_Ny = Ny
0234 #endif
0235
42c525bfb4 Alis*0236
da08c1c2cb Jean*0237 OB_indexNone = -99
c816a80284 Jean*0238 OB_indexUnset = 0
ef03bf2dde Jean*0239 insideOBmaskFile = ' '
e4a300ec91 Jean*0240 OBNconnectFile = ' '
0241 OBSconnectFile = ' '
0242 OBEconnectFile = ' '
0243 OBWconnectFile = ' '
6646af77e1 Jean*0244 DO i=1,OBNS_Nx
c816a80284 Jean*0245 OB_Jnorth(i) = OB_indexUnset
0246 OB_Jsouth(i) = OB_indexUnset
42c525bfb4 Alis*0247 ENDDO
6646af77e1 Jean*0248 DO j=1,OBEW_Ny
c816a80284 Jean*0249 OB_Ieast(j) = OB_indexUnset
0250 OB_Iwest(j) = OB_indexUnset
42c525bfb4 Alis*0251 ENDDO
45bc474d14 Jean*0252 OB_singleJnorth = OB_indexUnset
0253 OB_singleJsouth = OB_indexUnset
0254 OB_singleIeast = OB_indexUnset
0255 OB_singleIwest = OB_indexUnset
6646af77e1 Jean*0256 OBCS_indexStatus = 0
7c7f4c7f71 Mart*0257 useOrlanskiNorth =.FALSE.
0258 useOrlanskiSouth =.FALSE.
0259 useOrlanskiEast =.FALSE.
0260 useOrlanskiWest =.FALSE.
b2cb1ccb9a Mart*0261 useStevensNorth =.FALSE.
0262 useStevensSouth =.FALSE.
0263 useStevensEast =.FALSE.
0264 useStevensWest =.FALSE.
0265 useStevensPhaseVel =.TRUE.
0266 useStevensAdvection=.TRUE.
672b822630 Jean*0267 useOBCSprescribe =.FALSE.
0268 useOBCStides =.FALSE.
7c7f4c7f71 Mart*0269 useOBCSsponge =.FALSE.
c7c4b57180 Dimi*0270 useSeaiceSponge =.FALSE.
af61e5eb16 Mart*0271 useSeaiceNeumann =.FALSE.
432b2a4585 Dimi*0272 OBCSsponge_N =.TRUE.
0273 OBCSsponge_S =.TRUE.
0274 OBCSsponge_E =.TRUE.
0275 OBCSsponge_W =.TRUE.
0276 OBCSsponge_UatNS =.TRUE.
0277 OBCSsponge_UatEW =.TRUE.
0278 OBCSsponge_VatNS =.TRUE.
0279 OBCSsponge_VatEW =.TRUE.
0280 OBCSsponge_Theta =.TRUE.
0281 OBCSsponge_Salt =.TRUE.
0282 useLinearSponge =.FALSE.
7c7f4c7f71 Mart*0283 useOBCSbalance =.FALSE.
abfe198bce Mart*0284 OBCSbalanceSurf =.FALSE.
f4098ccf3f Jean*0285 OBCS_balanceFacN = 1. _d 0
0286 OBCS_balanceFacS = 1. _d 0
0287 OBCS_balanceFacE = 1. _d 0
0288 OBCS_balanceFacW = 1. _d 0
4fb81a5efb Jean*0289 OBCS_u1_adv_T = 0
0290 OBCS_u1_adv_S = 0
fb5ad257ea Jean*0291 OBCSfixTopo =.FALSE.
52fba54157 Jean*0292 OBCS_uvApplyFac = 1. _d 0
f4098ccf3f Jean*0293 OBCS_monitorFreq = monitorFreq
0294 OBCS_monSelect = 0
8830b8f970 Jean*0295 OBCSprintDiags = debugLevel.GE.debLevC
42c525bfb4 Alis*0296
b48d3feefc Patr*0297 OBNuFile = ' '
0298 OBNvFile = ' '
0299 OBNtFile = ' '
0300 OBNsFile = ' '
fe50289ca9 Dimi*0301 OBNaFile = ' '
6f4cf52d27 Dimi*0302 OBNhFile = ' '
fa757486b0 Dimi*0303 OBNslFile = ' '
0304 OBNsnFile = ' '
5459643feb Dimi*0305 OBNuiceFile = ' '
0306 OBNviceFile = ' '
b48d3feefc Patr*0307 OBSuFile = ' '
0308 OBSvFile = ' '
0309 OBStFile = ' '
0310 OBSsFile = ' '
fe50289ca9 Dimi*0311 OBSaFile = ' '
0312 OBShFile = ' '
fa757486b0 Dimi*0313 OBSslFile = ' '
0314 OBSsnFile = ' '
5459643feb Dimi*0315 OBSuiceFile = ' '
0316 OBSviceFile = ' '
b48d3feefc Patr*0317 OBEuFile = ' '
0318 OBEvFile = ' '
0319 OBEtFile = ' '
0320 OBEsFile = ' '
fe50289ca9 Dimi*0321 OBEaFile = ' '
0322 OBEhFile = ' '
fa757486b0 Dimi*0323 OBEslFile = ' '
0324 OBEsnFile = ' '
5459643feb Dimi*0325 OBEuiceFile = ' '
0326 OBEviceFile = ' '
b48d3feefc Patr*0327 OBWuFile = ' '
0328 OBWvFile = ' '
0329 OBWtFile = ' '
0330 OBWsFile = ' '
fe50289ca9 Dimi*0331 OBWaFile = ' '
0332 OBWhFile = ' '
fa757486b0 Dimi*0333 OBWslFile = ' '
0334 OBWsnFile = ' '
5459643feb Dimi*0335 OBWuiceFile = ' '
0336 OBWviceFile = ' '
d260176b41 Mart*0337 OBNetaFile = ' '
0338 OBSetaFile = ' '
0339 OBEetaFile = ' '
0340 OBWetaFile = ' '
2d12bccb16 Jean*0341 OBNwFile = ' '
0342 OBSwFile = ' '
0343 OBEwFile = ' '
0344 OBWwFile = ' '
672b822630 Jean*0345 OBN_uTidAmFile = ' '
0346 OBN_uTidPhFile = ' '
0347 OBN_vTidAmFile = ' '
0348 OBN_vTidPhFile = ' '
0349 OBS_uTidAmFile = ' '
0350 OBS_uTidPhFile = ' '
0351 OBS_vTidAmFile = ' '
0352 OBS_vTidPhFile = ' '
0353 OBE_uTidAmFile = ' '
0354 OBE_uTidPhFile = ' '
0355 OBE_vTidAmFile = ' '
0356 OBE_vTidPhFile = ' '
0357 OBW_uTidAmFile = ' '
0358 OBW_uTidPhFile = ' '
0359 OBW_vTidAmFile = ' '
0360 OBW_vTidPhFile = ' '
ee1c912a22 Mart*0361 #ifdef ALLOW_PTRACERS
0362 DO iTracer = 1, PTRACERS_num
4fb81a5efb Jean*0363 OBCS_u1_adv_Tr(iTracer) = 0
ee1c912a22 Mart*0364 OBNptrFile(iTracer) = ' '
0365 OBSptrFile(iTracer) = ' '
0366 OBEptrFile(iTracer) = ' '
0367 OBWptrFile(iTracer) = ' '
0368 ENDDO
0369 #endif
672b822630 Jean*0370
0371 OBCS_nTidalComp = 0
0372 DO i = 1, OBCS_tideCompSize
0373 OBCS_tidalPeriod(i) = 0. _d 0
6f4cf52d27 Dimi*0374 ENDDO
672b822630 Jean*0375
05b5fb3079 Jean*0376
0377 nRetired = 0
0378 useOBCSYearlyFields = .FALSE.
672b822630 Jean*0379 OBNamFile = 'retired-and-unset'
0380 OBSamFile = 'retired-and-unset'
0381 OBEamFile = 'retired-and-unset'
0382 OBWamFile = 'retired-and-unset'
0383 OBNphFile = 'retired-and-unset'
0384 OBSphFile = 'retired-and-unset'
0385 OBEphFile = 'retired-and-unset'
0386 OBWphFile = 'retired-and-unset'
0387 DO i = 1, OBCS_tideCompSize
0388 tidalPeriod(i) = -1. _d 0
0389 ENDDO
b48d3feefc Patr*0390
b4626a356d Jean*0391
0392 WRITE(msgBuf,'(A)') ' OBCS_READPARMS: opening data.obcs'
0393 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
0394 & SQUEEZE_RIGHT , myThid )
0395 CALL OPEN_COPY_DATA_FILE(
0396 I 'data.obcs', 'OBCS_READPARMS',
0397 O iUnit,
0398 I myThid )
0399
42c525bfb4 Alis*0400
0401 READ(UNIT=iUnit,NML=OBCS_PARM01)
0402
05b5fb3079 Jean*0403
0404 IF ( useOBCSYearlyFields ) THEN
0405 nRetired = nRetired + 1
672b822630 Jean*0406 WRITE(msgBuf,'(A,A)') 'OBCS_READPARMS: ',
0407 & '"useOBCSYearlyFields" no longer allowed in file "data.obcs"'
05b5fb3079 Jean*0408 CALL PRINT_ERROR( msgBuf, myThid )
0409 WRITE(msgBuf,'(A,A)') 'OBCS_READPARMS: ',
0410 & ' was moved to "data.exf", namelist: "EXF_NML_OBCS"'
0411 CALL PRINT_ERROR( msgBuf, myThid )
0412 ENDIF
672b822630 Jean*0413 errCount = 0
0414 DO i = 1, OBCS_tideCompSize
0415 IF ( tidalPeriod(i) .NE. -1. _d 0 ) errCount = errCount + 1
0416 ENDDO
0417 IF ( errCount.NE.0 ) THEN
0418 nRetired = nRetired + 1
0419 WRITE(msgBuf,'(A,A)') 'OBCS_READPARMS: ',
0420 & '"tidalPeriod" no longer allowed in file "data.obcs"'
0421 CALL PRINT_ERROR( msgBuf, myThid )
0422 WRITE(msgBuf,'(A,A)') 'OBCS_READPARMS: ',
0423 & ' was replaced by "OBCS_tidalPeriod" in same namelist'
0424 CALL PRINT_ERROR( msgBuf, myThid )
0425 ENDIF
0426 i = ILNBLNK(OBNamFile)
0427 IF ( i.NE.17 .OR. OBNamFile(1:17).NE.'retired-and-unset' ) THEN
0428 nRetired = nRetired + 1
0429 WRITE(msgBuf,'(A,A)') 'OBCS_READPARMS: ',
0430 & '"OBNamFile" no longer allowed in file "data.obcs"'
0431 CALL PRINT_ERROR( msgBuf, myThid )
0432 WRITE(msgBuf,'(A,A)') 'OBCS_READPARMS: ',
0433 & ' was replaced by "OBN_vTidAmFile" in same namelist'
0434 CALL PRINT_ERROR( msgBuf, myThid )
0435 ENDIF
0436 i = ILNBLNK(OBSamFile)
0437 IF ( i.NE.17 .OR. OBSamFile(1:17).NE.'retired-and-unset' ) THEN
0438 nRetired = nRetired + 1
0439 WRITE(msgBuf,'(A,A)') 'OBCS_READPARMS: ',
0440 & '"OBSamFile" no longer allowed in file "data.obcs"'
0441 CALL PRINT_ERROR( msgBuf, myThid )
0442 WRITE(msgBuf,'(A,A)') 'OBCS_READPARMS: ',
0443 & ' was replaced by "OBS_vTidAmFile" in same namelist'
0444 CALL PRINT_ERROR( msgBuf, myThid )
0445 ENDIF
0446 i = ILNBLNK(OBEamFile)
0447 IF ( i.NE.17 .OR. OBEamFile(1:17).NE.'retired-and-unset' ) THEN
0448 nRetired = nRetired + 1
0449 WRITE(msgBuf,'(A,A)') 'OBCS_READPARMS: ',
0450 & '"OBEamFile" no longer allowed in file "data.obcs"'
0451 CALL PRINT_ERROR( msgBuf, myThid )
0452 WRITE(msgBuf,'(A,A)') 'OBCS_READPARMS: ',
0453 & ' was replaced by "OBE_uTidAmFile" in same namelist'
0454 CALL PRINT_ERROR( msgBuf, myThid )
0455 ENDIF
0456 i = ILNBLNK(OBWamFile)
0457 IF ( i.NE.17 .OR. OBWamFile(1:17).NE.'retired-and-unset' ) THEN
0458 nRetired = nRetired + 1
0459 WRITE(msgBuf,'(A,A)') 'OBCS_READPARMS: ',
0460 & '"OBWamFile" no longer allowed in file "data.obcs"'
0461 CALL PRINT_ERROR( msgBuf, myThid )
0462 WRITE(msgBuf,'(A,A)') 'OBCS_READPARMS: ',
0463 & ' was replaced by "OBW_uTidAmFile" in same namelist'
0464 CALL PRINT_ERROR( msgBuf, myThid )
0465 ENDIF
0466 i = ILNBLNK(OBNphFile)
0467 IF ( i.NE.17 .OR. OBNphFile(1:17).NE.'retired-and-unset' ) THEN
0468 nRetired = nRetired + 1
0469 WRITE(msgBuf,'(A,A)') 'OBCS_READPARMS: ',
0470 & '"OBNphFile" no longer allowed in file "data.obcs"'
0471 CALL PRINT_ERROR( msgBuf, myThid )
0472 WRITE(msgBuf,'(A,A)') 'OBCS_READPARMS: ',
0473 & ' was replaced by "OBN_vTidPhFile" in same namelist'
0474 CALL PRINT_ERROR( msgBuf, myThid )
0475 ENDIF
0476 i = ILNBLNK(OBSphFile)
0477 IF ( i.NE.17 .OR. OBSphFile(1:17).NE.'retired-and-unset' ) THEN
0478 nRetired = nRetired + 1
0479 WRITE(msgBuf,'(A,A)') 'OBCS_READPARMS: ',
0480 & '"OBSphFile" no longer allowed in file "data.obcs"'
0481 CALL PRINT_ERROR( msgBuf, myThid )
0482 WRITE(msgBuf,'(A,A)') 'OBCS_READPARMS: ',
0483 & ' was replaced by "OBS_vTidPhFile" in same namelist'
0484 CALL PRINT_ERROR( msgBuf, myThid )
0485 ENDIF
0486 i = ILNBLNK(OBEphFile)
0487 IF ( i.NE.17 .OR. OBEphFile(1:17).NE.'retired-and-unset' ) THEN
0488 nRetired = nRetired + 1
0489 WRITE(msgBuf,'(A,A)') 'OBCS_READPARMS: ',
0490 & '"OBEphFile" no longer allowed in file "data.obcs"'
0491 CALL PRINT_ERROR( msgBuf, myThid )
0492 WRITE(msgBuf,'(A,A)') 'OBCS_READPARMS: ',
0493 & ' was replaced by "OBE_uTidPhFile" in same namelist'
0494 CALL PRINT_ERROR( msgBuf, myThid )
0495 ENDIF
0496 i = ILNBLNK(OBWphFile)
0497 IF ( i.NE.17 .OR. OBWphFile(1:17).NE.'retired-and-unset' ) THEN
0498 nRetired = nRetired + 1
0499 WRITE(msgBuf,'(A,A)') 'OBCS_READPARMS: ',
0500 & '"OBWphFile" no longer allowed in file "data.obcs"'
0501 CALL PRINT_ERROR( msgBuf, myThid )
0502 WRITE(msgBuf,'(A,A)') 'OBCS_READPARMS: ',
0503 & ' was replaced by "OBW_uTidPhFile" in same namelist'
0504 CALL PRINT_ERROR( msgBuf, myThid )
0505 ENDIF
05b5fb3079 Jean*0506
174cf6d3c0 Alis*0507 #ifdef ALLOW_ORLANSKI
0508
0509 CMAX = 0.45 _d 0 /* maximum allowable phase speed-CFL for AB-II */
4fb81a5efb Jean*0510 cvelTimeScale = 2000.0 _d 0 /* Averaging period for phase speed (s) */
f2f2d1c632 Alis*0511 CFIX = 0.8 _d 0 /* Fixed boundary phase speed in m/s */
0512 useFixedCEast=.FALSE.
0513 useFixedCWest=.FALSE.
174cf6d3c0 Alis*0514 IF (useOrlanskiNorth.OR.
0515 & useOrlanskiSouth.OR.
0516 & useOrlanskiEast.OR.
9b8b001637 Jean*0517 & useOrlanskiWest)
174cf6d3c0 Alis*0518 & READ(UNIT=iUnit,NML=OBCS_PARM02)
42c525bfb4 Alis*0519 #endif
9b8b001637 Jean*0520
96bbd4e2a5 Patr*0521 #ifdef ALLOW_OBCS_SPONGE
689200863e Mart*0522
0523
0524 spongeThickness = 0
0525 Urelaxobcsinner = 0. _d 0
0526 Urelaxobcsbound = 0. _d 0
0527 Vrelaxobcsinner = 0. _d 0
0528 Vrelaxobcsbound = 0. _d 0
0529
0530
0531
0532
0533
0534
96bbd4e2a5 Patr*0535 IF (useOBCSsponge)
0536 & READ(UNIT=iUnit,NML=OBCS_PARM03)
0537 #endif
b2cb1ccb9a Mart*0538 #ifdef ALLOW_OBCS_STEVENS
0539 TrelaxStevens = 0. _d 0
0540 SrelaxStevens = 0. _d 0
b4626a356d Jean*0541 IF ( useStevensNorth .OR. useStevensSouth
b2cb1ccb9a Mart*0542 & .OR. useStevensEast .OR. useStevensWest )
0543 & READ(UNIT=iUnit,NML=OBCS_PARM04)
0544 #endif
c7c4b57180 Dimi*0545 #ifdef ALLOW_OBCS_SEAICE_SPONGE
0546
0547
0548 seaiceSpongeThickness = 0
5e26aed318 Dimi*0549 Arelaxobcsinner = 0. _d 0
0550 Arelaxobcsbound = 0. _d 0
0551 Hrelaxobcsinner = 0. _d 0
0552 Hrelaxobcsbound = 0. _d 0
0553 SLrelaxobcsinner = 0. _d 0
0554 SLrelaxobcsbound = 0. _d 0
0555 SNrelaxobcsinner = 0. _d 0
0556 SNrelaxobcsbound = 0. _d 0
0557 IF (useSeaiceSponge) READ(UNIT=iUnit,NML=OBCS_PARM05)
c7c4b57180 Dimi*0558 #endif
96bbd4e2a5 Patr*0559
b4626a356d Jean*0560 WRITE(msgBuf,'(A)') ' OBCS_READPARMS: finished reading data.obcs'
0561 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
0562 & SQUEEZE_RIGHT , myThid )
42c525bfb4 Alis*0563
0564
7a77863887 Mart*0565 #ifdef SINGLE_DISK_IO
42c525bfb4 Alis*0566 CLOSE(iUnit)
7a77863887 Mart*0567 #else
0568 CLOSE(iUnit,STATUS='DELETE')
0569 #endif /* SINGLE_DISK_IO */
42c525bfb4 Alis*0570
05b5fb3079 Jean*0571
0572 IF ( nRetired .GT. 0 ) THEN
0573 WRITE(msgBuf,'(A)')
0574 & 'OBCS_READPARMS: reading parameter file "data.obcs"'
0575 CALL PRINT_ERROR( msgBuf, myThid )
672b822630 Jean*0576 WRITE(msgBuf,'(I4,A)') nRetired,
0577 & ' out of date parameters were found in namelist'
05b5fb3079 Jean*0578 CALL PRINT_ERROR( msgBuf, myThid )
0579 STOP 'ABNORMAL END: S/R OBCS_READPARMS'
0580 ENDIF
0581
672b822630 Jean*0582 #ifdef ALLOW_OBCS_TIDES
0583 IF ( useOBCStides ) THEN
0584
0585
0586 OBCS_nTidalComp = 0
0587 DO i = 1, OBCS_tideCompSize
0588 IF ( OBCS_tidalPeriod(i).NE.zeroRL ) OBCS_nTidalComp = i
0589 ENDDO
0590 WRITE(msgBuf,'(2A,I6)') ' Set number of tidal Components ',
0591 & 'in use: OBCS_nTidalComp =', OBCS_nTidalComp
0592 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
0593 & SQUEEZE_RIGHT, myThid )
0594 IF ( OBCS_nTidalComp .EQ. 0 ) THEN
0595 WRITE(msgBuf,'(2A)') 'OBCS_READPARMS: ',
0596 & 'useOBCStides=T without any OBCS_tidalPeriod > 0'
0597 CALL PRINT_ERROR( msgBuf, myThid )
0598 STOP 'ABNORMAL END: S/R OBCS_READPARMS'
0599 ENDIF
0600 ENDIF
0601 #endif /* ALLOW_OBCS_TIDES */
0602
45bc474d14 Jean*0603
0604 errCount = 0
0605 IF ( OB_singleIeast.NE.OB_indexUnset ) THEN
0606 DO j=1,OBEW_Ny
0607 IF ( OB_Ieast(j).EQ.OB_indexUnset ) THEN
0608 OB_Ieast(j) = OB_singleIeast
0609 ELSEIF ( OB_Ieast(j).NE.OB_singleIeast ) THEN
0610 errCount = errCount + 1
0611 ENDIF
0612 ENDDO
0613 ENDIF
0614 IF ( errCount .NE. 0 ) THEN
0615 WRITE(msgBuf,'(2A)') 'OBCS_READPARMS: ',
0616 & 'Inconsistent setting of OB_Ieast/OB_singleIeast'
0617 CALL PRINT_ERROR( msgBuf, myThid )
0618 STOP 'ABNORMAL END: S/R OBCS_READPARMS'
0619 ENDIF
0620
0621 IF ( OB_singleIwest.NE.OB_indexUnset ) THEN
0622 DO j=1,OBEW_Ny
0623 IF ( OB_Iwest(j).EQ.OB_indexUnset ) THEN
0624 OB_Iwest(j) = OB_singleIwest
0625 ELSEIF ( OB_Iwest(j).NE.OB_singleIwest ) THEN
0626 errCount = errCount + 1
0627 ENDIF
0628 ENDDO
0629 ENDIF
0630 IF ( errCount .NE. 0 ) THEN
0631 WRITE(msgBuf,'(2A)') 'OBCS_READPARMS: ',
0632 & 'Inconsistent setting of OB_Iwest/OB_singleIwest'
0633 CALL PRINT_ERROR( msgBuf, myThid )
0634 STOP 'ABNORMAL END: S/R OBCS_READPARMS'
0635 ENDIF
0636
0637 IF ( OB_singleJnorth.NE.OB_indexUnset ) THEN
0638 DO i=1,OBNS_Nx
0639 IF ( OB_Jnorth(i).EQ.OB_indexUnset ) THEN
0640 OB_Jnorth(i) = OB_singleJnorth
0641 ELSEIF ( OB_Jnorth(i).NE.OB_singleJnorth ) THEN
0642 errCount = errCount + 1
0643 ENDIF
0644 ENDDO
0645 ENDIF
0646 IF ( errCount .NE. 0 ) THEN
0647 WRITE(msgBuf,'(2A)') 'OBCS_READPARMS: ',
0648 & 'Inconsistent setting of OB_Jnorth/OB_singleJnorth'
0649 CALL PRINT_ERROR( msgBuf, myThid )
0650 STOP 'ABNORMAL END: S/R OBCS_READPARMS'
0651 ENDIF
0652
0653 IF ( OB_singleJsouth.NE.OB_indexUnset ) THEN
0654 DO i=1,OBNS_Nx
0655 IF ( OB_Jsouth(i).EQ.OB_indexUnset ) THEN
0656 OB_Jsouth(i) = OB_singleJsouth
0657 ELSEIF ( OB_Jsouth(i).NE.OB_singleJsouth ) THEN
0658 errCount = errCount + 1
0659 ENDIF
0660 ENDDO
0661 ENDIF
0662 IF ( errCount .NE. 0 ) THEN
0663 WRITE(msgBuf,'(2A)') 'OBCS_READPARMS: ',
0664 & 'Inconsistent setting of OB_Jsouth/OB_singleJsouth'
0665 CALL PRINT_ERROR( msgBuf, myThid )
0666 STOP 'ABNORMAL END: S/R OBCS_READPARMS'
0667 ENDIF
0668
b4626a356d Jean*0669
6646af77e1 Jean*0670 DO j=1,OBEW_Ny
c816a80284 Jean*0671 IF ( OB_Ieast(j) .NE.OB_indexUnset .AND.
0672 & OB_Ieast(j) .LT.0 ) OB_Ieast(j) = OB_Ieast(j)+OBEW_Nx+1
b4626a356d Jean*0673 ENDDO
6646af77e1 Jean*0674 DO i=1,OBNS_Nx
c816a80284 Jean*0675 IF ( OB_Jnorth(i).NE.OB_indexUnset .AND.
0676 & OB_Jnorth(i).LT.0 ) OB_Jnorth(i)=OB_Jnorth(i)+OBNS_Ny+1
b4626a356d Jean*0677 ENDDO
45bc474d14 Jean*0678
b4626a356d Jean*0679 IF ( debugLevel.GE.debLevA ) THEN
c816a80284 Jean*0680 CALL WRITE_0D_I( OB_indexUnset, INDEX_NONE,' OB_indexUnset =',
0681 & ' /* unset OB index value (i.e. no OB) */')
b4626a356d Jean*0682
0683
0684
0685
0686 WRITE(msgBuf,'(A)') ' Northern OB global indices : OB_Jnorth ='
0687 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
0688 & SQUEEZE_RIGHT, myThid )
0689 CALL PRINT_LIST_I( OB_Jnorth, 1, OBNS_Nx, INDEX_I,
0690 & .FALSE., .TRUE., standardMessageUnit )
0691 WRITE(msgBuf,'(A)') ' Southern OB global indices : OB_Jsouth ='
0692 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
0693 & SQUEEZE_RIGHT, myThid )
0694 CALL PRINT_LIST_I( OB_Jsouth, 1, OBNS_Nx, INDEX_I,
0695 & .FALSE., .TRUE., standardMessageUnit )
0696 WRITE(msgBuf,'(A)') ' Eastern OB global indices : OB_Ieast ='
0697 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
0698 & SQUEEZE_RIGHT, myThid )
0699 CALL PRINT_LIST_I( OB_Ieast, 1, OBEW_Ny, INDEX_J,
0700 & .FALSE., .TRUE., standardMessageUnit )
0701 WRITE(msgBuf,'(A)') ' Western OB global indices : OB_Iwest ='
0702 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
0703 & SQUEEZE_RIGHT, myThid )
0704 CALL PRINT_LIST_I( OB_Iwest, 1, OBEW_Ny, INDEX_J,
0705 & .FALSE., .TRUE., standardMessageUnit )
0706 WRITE(msgBuf,'(A)') ' '
0707 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
0708 & SQUEEZE_RIGHT, myThid )
0709 ENDIF
abfe198bce Mart*0710 OBCSbalanceSurf = OBCSbalanceSurf .AND. useOBCSbalance
b4626a356d Jean*0711
8eca246483 Jean*0712
0713
42c525bfb4 Alis*0714
8eca246483 Jean*0715
0716
c816a80284 Jean*0717
0718
6646af77e1 Jean*0719
0720
8eca246483 Jean*0721 DO bj = 1, nSy
0722 DO bi = 1, nSx
d222604fe0 Mart*0723
6646af77e1 Jean*0724 DO i=1-OLx,sNx+OLx
c816a80284 Jean*0725 OB_Jn(i,bi,bj) = OB_indexNone
0726 OB_Js(i,bi,bj) = OB_indexNone
d222604fe0 Mart*0727 ENDDO
0728
6646af77e1 Jean*0729 DO j=1-OLy,sNy+OLy
c816a80284 Jean*0730 OB_Ie(j,bi,bj) = OB_indexNone
672b822630 Jean*0731 OB_Iw(j,bi,bj) = OB_indexNone
d222604fe0 Mart*0732 ENDDO
0733
9a428ff231 Oliv*0734 #ifdef ALLOW_EXCH2
c816a80284 Jean*0735
0736
9a428ff231 Oliv*0737 tN = W2_myTileList(bi,bj)
0738
c816a80284 Jean*0739
0740
0741 DO i=1,sNx
0742 iG = exch2_txXStackLo(tN)+i-1
0743
0744 IF ( OB_Jnorth(iG).NE.OB_indexUnset ) THEN
0745
0746 DO j=1,sNy+1
0747 jG = exch2_tyXStackLo(tN)+j-1
0748 IF ( jG.EQ.OB_Jnorth(iG) ) OB_Jn(i,bi,bj) = j
0749 ENDDO
0750 ENDIF
0751
0752 IF ( OB_Jsouth(iG).NE.OB_indexUnset ) THEN
0753 DO j=0,sNy
0754 jG = exch2_tyXStackLo(tN)+j-1
0755 IF ( jG.EQ.OB_Jsouth(iG) ) OB_Js(i,bi,bj) = j
0756 ENDDO
0757 ENDIF
9a428ff231 Oliv*0758 ENDDO
0759
c816a80284 Jean*0760
0761
6646af77e1 Jean*0762 DO j=1,sNy
0763 jG = exch2_tyYStackLo(tN)+j-1
c816a80284 Jean*0764
0765 IF ( OB_Ieast(jG).NE.OB_indexUnset ) THEN
0766
0767 DO i=1,sNx+1
0768 iG = exch2_txYStackLo(tN)+i-1
0769 IF ( iG.EQ.OB_Ieast(jG) ) OB_Ie(j,bi,bj) = i
0770 ENDDO
0771 ENDIF
0772
0773 IF ( OB_Iwest(jG).NE.OB_indexUnset ) THEN
0774 DO i=0,sNx
0775 iG = exch2_txYStackLo(tN)+i-1
0776 IF ( iG.EQ.OB_Iwest(jG) ) OB_Iw(j,bi,bj) = i
0777 ENDDO
0778 ENDIF
9a428ff231 Oliv*0779 ENDDO
c816a80284 Jean*0780
6646af77e1 Jean*0781
0782 OBCS_indexStatus = 1
9a428ff231 Oliv*0783
0784 #else /* ALLOW_EXCH2 */
0785
6646af77e1 Jean*0786 DO j=1-OLy,sNy+OLy
c816a80284 Jean*0787
6646af77e1 Jean*0788 jG = myYGlobalLo+(bj-1)*sNy+j-1
c816a80284 Jean*0789
0790
0791
0792 jGm = 1+MOD( jG-1+Ny , Ny )
0793
0794
0795 IF ( OB_Ieast(jGm).NE.OB_indexUnset ) THEN
0796
0797 DO i=1,sNx+1
0798 iG = myXGlobalLo+(bi-1)*sNx+i-1
0799 iGm = 1+MOD( iG-1+Nx , Nx )
0800 IF ( iG.EQ.OB_Ieast(jGm) ) OB_Ie(j,bi,bj) = i
0801 ENDDO
0802 ENDIF
0803
0804 IF ( OB_Iwest(jGm).NE.OB_indexUnset ) THEN
0805 DO i=0,sNx
0806 iG = myXGlobalLo+(bi-1)*sNx+i-1
0807 iGm = 1+MOD( iG-1+Nx , Nx )
0808 IF ( iG.EQ.OB_Iwest(jGm) ) OB_Iw(j,bi,bj) = i
0809 ENDDO
0810 ENDIF
d222604fe0 Mart*0811 ENDDO
c816a80284 Jean*0812
0813 DO i=1-OLx,sNx+OLx
0814 iG = myXGlobalLo+(bi-1)*sNx+i-1
0815 iGm = 1+MOD( iG-1+Nx , Nx )
0816
0817
0818 IF ( OB_Jnorth(iGm).NE.OB_indexUnset ) THEN
0819 DO j=1,sNy+1
0820 jG = myYGlobalLo+(bj-1)*sNy+j-1
0821 jGm = 1+MOD( jG-1+Ny , Ny )
0822 IF ( jG.EQ.OB_Jnorth(iGm) ) OB_Jn(i,bi,bj) = j
0823 ENDDO
0824 ENDIF
0825
0826 IF ( OB_Jsouth(iGm).NE.OB_indexUnset ) THEN
0827 DO j=0,sNy
0828 jG = myYGlobalLo+(bj-1)*sNy+j-1
0829 jGm = 1+MOD( jG-1+Ny , Ny )
0830 IF ( jG.EQ.OB_Jsouth(iGm) ) OB_Js(i,bi,bj) = j
0831 ENDDO
0832 ENDIF
d222604fe0 Mart*0833 ENDDO
c816a80284 Jean*0834
6646af77e1 Jean*0835
0836 OBCS_indexStatus = 2
c816a80284 Jean*0837
9a428ff231 Oliv*0838 #endif /* ALLOW_EXCH2 */
0839
d222604fe0 Mart*0840
0841 ENDDO
0842 ENDDO
0843
8eca246483 Jean*0844 _END_MASTER(myThid)
0845
0846
6646af77e1 Jean*0847 _BARRIER
9a428ff231 Oliv*0848
42c525bfb4 Alis*0849 #endif /* ALLOW_OBCS */
0850 RETURN
0851 END