1 |
jmc |
1.13 |
C $Header: /u/gcmpack/MITgcm/pkg/grdchk/grdchk_readparms.F,v 1.12 2007/10/09 00:05:45 jmc Exp $ |
2 |
jmc |
1.12 |
C $Name: $ |
3 |
heimbach |
1.2 |
|
4 |
|
|
#include "CPP_OPTIONS.h" |
5 |
|
|
|
6 |
|
|
|
7 |
heimbach |
1.5 |
subroutine grdchk_readparms( mythid ) |
8 |
heimbach |
1.2 |
|
9 |
|
|
c ================================================================== |
10 |
|
|
c SUBROUTINE grdchk_readparms |
11 |
|
|
c ================================================================== |
12 |
|
|
c |
13 |
|
|
c o Initialize the ECCO gradient check. |
14 |
|
|
c |
15 |
|
|
c started: Christian Eckert eckert@mit.edu 03-Mar-2000 |
16 |
|
|
c continued: heimbach@mit.edu: 13-Jun-2001 |
17 |
|
|
c |
18 |
|
|
c ================================================================== |
19 |
|
|
c SUBROUTINE grdchk_readparms |
20 |
|
|
c ================================================================== |
21 |
|
|
|
22 |
|
|
implicit none |
23 |
|
|
|
24 |
|
|
c == global variables == |
25 |
|
|
|
26 |
|
|
#include "EEPARAMS.h" |
27 |
|
|
#include "SIZE.h" |
28 |
|
|
|
29 |
|
|
#include "ctrl.h" |
30 |
|
|
#include "grdchk.h" |
31 |
|
|
|
32 |
|
|
c == routine arguments == |
33 |
|
|
|
34 |
|
|
integer mythid |
35 |
|
|
|
36 |
heimbach |
1.7 |
#ifdef ALLOW_GRDCHK |
37 |
heimbach |
1.2 |
c == local variables == |
38 |
|
|
|
39 |
|
|
integer i,j,k |
40 |
|
|
integer bi,bj |
41 |
|
|
integer itlo,ithi |
42 |
|
|
integer jtlo,jthi |
43 |
|
|
integer jmin,jmax |
44 |
|
|
integer imin,imax |
45 |
|
|
|
46 |
|
|
integer errio |
47 |
|
|
integer il |
48 |
heimbach |
1.9 |
integer iUnit |
49 |
heimbach |
1.2 |
|
50 |
heimbach |
1.9 |
character*(max_len_mbuf) msgbuf |
51 |
heimbach |
1.2 |
character*(max_len_prec) record |
52 |
|
|
|
53 |
|
|
c == external == |
54 |
|
|
|
55 |
|
|
integer ilnblnk |
56 |
|
|
external ilnblnk |
57 |
|
|
|
58 |
|
|
c == end of interface == |
59 |
|
|
|
60 |
|
|
c-- Optimization parameters. |
61 |
|
|
namelist /grdchk_nml/ |
62 |
|
|
& grdchk_eps, |
63 |
|
|
& nbeg, |
64 |
|
|
& nstep, |
65 |
|
|
& nend, |
66 |
heimbach |
1.3 |
& grdchkvarindex, |
67 |
heimbach |
1.5 |
& useCentralDiff, |
68 |
heimbach |
1.8 |
& grdchkwhichproc, |
69 |
|
|
& iGloPos, |
70 |
|
|
& jGloPos, |
71 |
|
|
& kGloPos, |
72 |
heimbach |
1.10 |
& iGloTile, |
73 |
|
|
& jGloTile, |
74 |
heimbach |
1.11 |
& idep, |
75 |
|
|
& jdep, |
76 |
heimbach |
1.8 |
& obcsglo, |
77 |
|
|
& recglo |
78 |
heimbach |
1.2 |
|
79 |
|
|
jtlo = mybylo(mythid) |
80 |
|
|
jthi = mybyhi(mythid) |
81 |
|
|
itlo = mybxlo(mythid) |
82 |
|
|
ithi = mybxhi(mythid) |
83 |
|
|
jmin = 1-oly |
84 |
|
|
jmax = sny+oly |
85 |
|
|
imin = 1-olx |
86 |
|
|
imax = snx+olx |
87 |
|
|
|
88 |
|
|
_BEGIN_MASTER( mythid ) |
89 |
|
|
|
90 |
|
|
c-- Set default values. |
91 |
heimbach |
1.5 |
grdchk_eps = 1. _d 0 |
92 |
heimbach |
1.8 |
nbeg = 0 |
93 |
|
|
nend = 0 |
94 |
|
|
nstep = 0 |
95 |
heimbach |
1.5 |
useCentralDiff = .TRUE. |
96 |
|
|
grdchkwhichproc = 0 |
97 |
heimbach |
1.8 |
iGloPos = 0 |
98 |
|
|
jGloPos = 0 |
99 |
|
|
kGloPos = 1 |
100 |
heimbach |
1.10 |
iGloTile = 1 |
101 |
|
|
jGloTile = 1 |
102 |
heimbach |
1.11 |
idep = 1 |
103 |
|
|
jdep = 1 |
104 |
heimbach |
1.8 |
obcsglo = 1 |
105 |
|
|
recglo = 1 |
106 |
heimbach |
1.2 |
|
107 |
|
|
|
108 |
heimbach |
1.9 |
c Next, read the calendar data file. |
109 |
|
|
WRITE(msgBuf,'(A)') 'GRDCHK_READPARMS: opening data.grdchk' |
110 |
|
|
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
111 |
|
|
& SQUEEZE_RIGHT , 1) |
112 |
|
|
|
113 |
|
|
CALL OPEN_COPY_DATA_FILE( |
114 |
|
|
I 'data.grdchk', 'GRDCHK_READPARMS', |
115 |
|
|
O iUnit, |
116 |
|
|
I myThid ) |
117 |
|
|
|
118 |
|
|
READ(unit = iUnit, nml = grdchk_nml) |
119 |
|
|
|
120 |
jmc |
1.12 |
WRITE(msgBuf,'(A)') |
121 |
heimbach |
1.9 |
& 'GRDCHK_READPARMS: finished reading data.grdchk' |
122 |
|
|
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
123 |
|
|
& SQUEEZE_RIGHT , 1) |
124 |
heimbach |
1.2 |
|
125 |
heimbach |
1.9 |
CLOSE( iUnit ) |
126 |
heimbach |
1.2 |
|
127 |
heimbach |
1.10 |
IF ( iGloPos .GT. sNx .OR. jGloPos .GT. sNy ) THEN |
128 |
|
|
WRITE(msgBuf,'(A)') 'i/j GloPos must be <= sNx/y' |
129 |
|
|
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
130 |
|
|
& SQUEEZE_RIGHT , 1) |
131 |
|
|
STOP 'S/R grdchk_readparms' |
132 |
|
|
ENDIF |
133 |
|
|
IF ( jGloTile .GT. 1 .AND. useCubedSphereExchange ) THEN |
134 |
jmc |
1.12 |
WRITE(msgBuf,'(A)') |
135 |
heimbach |
1.10 |
& 'jGloTile must be = 1 for useCubedSphereExchange' |
136 |
|
|
STOP 'S/R grdchk_readparms' |
137 |
|
|
ENDIF |
138 |
|
|
|
139 |
jmc |
1.13 |
c-- Summarize the gradient check setup. |
140 |
heimbach |
1.2 |
call grdchk_Summary( mythid ) |
141 |
|
|
_END_MASTER( mythid ) |
142 |
|
|
|
143 |
|
|
_BARRIER |
144 |
|
|
|
145 |
heimbach |
1.7 |
#endif /* ALLOW_GRDCHK */ |
146 |
heimbach |
1.2 |
|
147 |
|
|
end |