1 |
C $Header: /u/gcmpack/models/MITgcmUV/pkg/obcs/obcs_readparms.F,v 1.4 2001/04/10 22:35:27 heimbach 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 |
|
23 |
C === Routine arguments === |
24 |
INTEGER myThid |
25 |
|
26 |
#ifdef ALLOW_OBCS |
27 |
|
28 |
NAMELIST /OBCS_PARM01/ |
29 |
& OB_Jnorth,OB_Jsouth,OB_Ieast,OB_Iwest, |
30 |
& useOrlanskiNorth,useOrlanskiSouth, |
31 |
& useOrlanskiEast,useOrlanskiWest, |
32 |
& OBNuFile,OBNvFile,OBNtFile,OBNsFile, |
33 |
& OBSuFile,OBSvFile,OBStFile,OBSsFile, |
34 |
& OBEuFile,OBEvFile,OBEtFile,OBEsFile, |
35 |
& OBWuFile,OBWvFile,OBWtFile,OBWsFile |
36 |
|
37 |
#ifdef ALLOW_ORLANSKI |
38 |
NAMELIST /OBCS_PARM02/ |
39 |
& CMAX, cvelTimeScale |
40 |
#endif |
41 |
|
42 |
C === Local variables === |
43 |
C msgBuf - Informational/error meesage buffer |
44 |
C iUnit - Work variable for IO unit number |
45 |
CHARACTER*(MAX_LEN_MBUF) msgBuf |
46 |
INTEGER iUnit |
47 |
INTEGER I,J |
48 |
|
49 |
C-- OBCS_READPARMS has been called so we know that |
50 |
C the package is active. |
51 |
OBCSIsOn=.TRUE. |
52 |
|
53 |
_BEGIN_MASTER(myThid) |
54 |
|
55 |
WRITE(msgBuf,'(A)') ' OBCS_READPARMS: opening data.obcs' |
56 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
57 |
& SQUEEZE_RIGHT , 1) |
58 |
|
59 |
CALL OPEN_COPY_DATA_FILE( |
60 |
I 'data.obcs', 'OBCS_READPARMS', |
61 |
O iUnit, |
62 |
I myThid ) |
63 |
|
64 |
C-- Default flags and values for OBCS |
65 |
DO I=1,Nx |
66 |
OB_Jnorth(I)=0 |
67 |
OB_Jsouth(I)=0 |
68 |
ENDDO |
69 |
DO J=1,Ny |
70 |
OB_Ieast(J)=0 |
71 |
OB_Iwest(J)=0 |
72 |
ENDDO |
73 |
useOrlanskiNorth=.FALSE. |
74 |
useOrlanskiSouth=.FALSE. |
75 |
useOrlanskiEast =.FALSE. |
76 |
useOrlanskiWest =.FALSE. |
77 |
|
78 |
OBNuFile = ' ' |
79 |
OBNvFile = ' ' |
80 |
OBNtFile = ' ' |
81 |
OBNsFile = ' ' |
82 |
OBSuFile = ' ' |
83 |
OBSvFile = ' ' |
84 |
OBStFile = ' ' |
85 |
OBSsFile = ' ' |
86 |
OBEuFile = ' ' |
87 |
OBEvFile = ' ' |
88 |
OBEtFile = ' ' |
89 |
OBEsFile = ' ' |
90 |
OBWuFile = ' ' |
91 |
OBWvFile = ' ' |
92 |
OBWtFile = ' ' |
93 |
OBWsFile = ' ' |
94 |
|
95 |
C-- Read parameters from open data file |
96 |
READ(UNIT=iUnit,NML=OBCS_PARM01) |
97 |
|
98 |
C Account for periodicity if negative indices were supplied |
99 |
DO J=1,Ny |
100 |
IF (OB_Ieast(J).lt.0) OB_Ieast(J)=OB_Ieast(J)+Nx+1 |
101 |
ENDDO |
102 |
DO I=1,Nx |
103 |
IF (OB_Jnorth(I).lt.0) OB_Jnorth(I)=OB_Jnorth(I)+Ny+1 |
104 |
ENDDO |
105 |
write(*,*) 'OB Jn =',OB_Jnorth |
106 |
write(*,*) 'OB Js =',OB_Jsouth |
107 |
write(*,*) 'OB Ie =',OB_Ieast |
108 |
write(*,*) 'OB Iw =',OB_Iwest |
109 |
|
110 |
#ifdef ALLOW_ORLANSKI |
111 |
C Default Orlanski radiation parameters |
112 |
CMAX = 0.45 _d 0 /* maximum allowable phase speed-CFL for AB-II */ |
113 |
cvelTimeScale = 2000.0 _d 0 /* Averaging period for phase speed in sec. */ |
114 |
IF (useOrlanskiNorth.OR. |
115 |
& useOrlanskiSouth.OR. |
116 |
& useOrlanskiEast.OR. |
117 |
& useOrlanskiWest) |
118 |
& READ(UNIT=iUnit,NML=OBCS_PARM02) |
119 |
#endif |
120 |
|
121 |
WRITE(msgBuf,'(A)') ' OBCS_READPARMS: finished reading data.obcs' |
122 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
123 |
& SQUEEZE_RIGHT , 1) |
124 |
|
125 |
C-- Close the open data file |
126 |
CLOSE(iUnit) |
127 |
_END_MASTER(myThid) |
128 |
|
129 |
C-- Everyone else must wait for the parameters to be loaded |
130 |
_BARRIER |
131 |
|
132 |
#endif /* ALLOW_OBCS */ |
133 |
RETURN |
134 |
END |