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