1 |
C $Header: /u/gcmpack/development/heimbach/ecco_env/pkg/grdchk/grdchk_init.F,v 1.3 2000/10/23 16:32:14 heimbach Exp $ |
2 |
|
3 |
#include "CPP_OPTIONS.h" |
4 |
|
5 |
|
6 |
subroutine grdchk_readparms( |
7 |
I mythid |
8 |
& ) |
9 |
|
10 |
c ================================================================== |
11 |
c SUBROUTINE grdchk_readparms |
12 |
c ================================================================== |
13 |
c |
14 |
c o Initialize the ECCO gradient check. |
15 |
c |
16 |
c started: Christian Eckert eckert@mit.edu 03-Mar-2000 |
17 |
c continued: heimbach@mit.edu: 13-Jun-2001 |
18 |
c |
19 |
c ================================================================== |
20 |
c SUBROUTINE grdchk_readparms |
21 |
c ================================================================== |
22 |
|
23 |
implicit none |
24 |
|
25 |
c == global variables == |
26 |
|
27 |
#include "EEPARAMS.h" |
28 |
#include "SIZE.h" |
29 |
|
30 |
#include "ctrl.h" |
31 |
#include "grdchk.h" |
32 |
|
33 |
c == routine arguments == |
34 |
|
35 |
integer mythid |
36 |
|
37 |
#ifdef ALLOW_GRADIENT_CHECK |
38 |
c == local variables == |
39 |
|
40 |
integer i,j,k |
41 |
integer bi,bj |
42 |
integer itlo,ithi |
43 |
integer jtlo,jthi |
44 |
integer jmin,jmax |
45 |
integer imin,imax |
46 |
|
47 |
integer errio |
48 |
integer il |
49 |
|
50 |
character*(max_len_prec) record |
51 |
|
52 |
c == external == |
53 |
|
54 |
integer ilnblnk |
55 |
external ilnblnk |
56 |
|
57 |
c == end of interface == |
58 |
|
59 |
c-- Optimization parameters. |
60 |
namelist /grdchk_nml/ |
61 |
& grdchk_eps, |
62 |
& nbeg, |
63 |
& nstep, |
64 |
& nend, |
65 |
& grdchkvarindex |
66 |
|
67 |
jtlo = mybylo(mythid) |
68 |
jthi = mybyhi(mythid) |
69 |
itlo = mybxlo(mythid) |
70 |
ithi = mybxhi(mythid) |
71 |
jmin = 1-oly |
72 |
jmax = sny+oly |
73 |
imin = 1-olx |
74 |
imax = snx+olx |
75 |
|
76 |
_BEGIN_MASTER( mythid ) |
77 |
|
78 |
c-- Set default values. |
79 |
grdchk_eps = 1. _d 0 |
80 |
nbeg = 1 |
81 |
nend = 1 |
82 |
nstep = 1 |
83 |
|
84 |
c-- Check versions. |
85 |
|
86 |
open(unit=scrunit1,status='scratch') |
87 |
|
88 |
c-- Next, read the forcing data file. |
89 |
open(unit = modeldataunit,file = 'data.grdchk', |
90 |
& status = 'old', iostat = errio) |
91 |
if ( errio .lt. 0 ) then |
92 |
stop ' ... stopped in grdchk_readparms.' |
93 |
endif |
94 |
|
95 |
do while ( .true. ) |
96 |
read(modeldataunit, fmt='(a)', end=1001) record |
97 |
il = max(ilnblnk(record),1) |
98 |
if ( record(1:1) .ne. commentcharacter ) |
99 |
& write(unit=scrunit1, fmt='(a)') record(:il) |
100 |
enddo |
101 |
1001 continue |
102 |
|
103 |
close( modeldataunit ) |
104 |
|
105 |
rewind( scrunit1 ) |
106 |
read(unit = scrunit1, nml = grdchk_nml) |
107 |
close( scrunit1 ) |
108 |
|
109 |
c-- Summarize the gradient check's setup. |
110 |
call grdchk_Summary( mythid ) |
111 |
_END_MASTER( mythid ) |
112 |
|
113 |
_BARRIER |
114 |
|
115 |
#endif /* ALLOW_GRADIENT_CHECK */ |
116 |
|
117 |
end |
118 |
|
119 |
|