1 |
heimbach |
1.3 |
C $Header: /u/gcmpack/MITgcm/pkg/grdchk/grdchk_readparms.F,v 1.2.4.1 2002/05/30 22:12:32 heimbach Exp $ |
2 |
heimbach |
1.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 |
heimbach |
1.3 |
& grdchkvarindex, |
66 |
|
|
& useCentralDiff |
67 |
heimbach |
1.2 |
|
68 |
|
|
jtlo = mybylo(mythid) |
69 |
|
|
jthi = mybyhi(mythid) |
70 |
|
|
itlo = mybxlo(mythid) |
71 |
|
|
ithi = mybxhi(mythid) |
72 |
|
|
jmin = 1-oly |
73 |
|
|
jmax = sny+oly |
74 |
|
|
imin = 1-olx |
75 |
|
|
imax = snx+olx |
76 |
|
|
|
77 |
|
|
_BEGIN_MASTER( mythid ) |
78 |
|
|
|
79 |
|
|
c-- Set default values. |
80 |
|
|
grdchk_eps = 1. _d 0 |
81 |
|
|
nbeg = 1 |
82 |
|
|
nend = 1 |
83 |
|
|
nstep = 1 |
84 |
heimbach |
1.3 |
useCentralDiff = .TRUE. |
85 |
heimbach |
1.2 |
|
86 |
|
|
c-- Check versions. |
87 |
|
|
|
88 |
|
|
open(unit=scrunit1,status='scratch') |
89 |
|
|
|
90 |
|
|
c-- Next, read the forcing data file. |
91 |
|
|
open(unit = modeldataunit,file = 'data.grdchk', |
92 |
|
|
& status = 'old', iostat = errio) |
93 |
|
|
if ( errio .lt. 0 ) then |
94 |
|
|
stop ' ... stopped in grdchk_readparms.' |
95 |
|
|
endif |
96 |
|
|
|
97 |
|
|
do while ( .true. ) |
98 |
|
|
read(modeldataunit, fmt='(a)', end=1001) record |
99 |
|
|
il = max(ilnblnk(record),1) |
100 |
|
|
if ( record(1:1) .ne. commentcharacter ) |
101 |
|
|
& write(unit=scrunit1, fmt='(a)') record(:il) |
102 |
|
|
enddo |
103 |
|
|
1001 continue |
104 |
|
|
|
105 |
|
|
close( modeldataunit ) |
106 |
|
|
|
107 |
|
|
rewind( scrunit1 ) |
108 |
|
|
read(unit = scrunit1, nml = grdchk_nml) |
109 |
|
|
close( scrunit1 ) |
110 |
|
|
|
111 |
|
|
c-- Summarize the gradient check's setup. |
112 |
|
|
call grdchk_Summary( mythid ) |
113 |
|
|
_END_MASTER( mythid ) |
114 |
|
|
|
115 |
|
|
_BARRIER |
116 |
|
|
|
117 |
|
|
#endif /* ALLOW_GRADIENT_CHECK */ |
118 |
|
|
|
119 |
|
|
end |
120 |
|
|
|
121 |
|
|
|