1 |
heimbach |
1.7 |
C $Header: /u/gcmpack/MITgcm/pkg/grdchk/grdchk_readparms.F,v 1.6 2003/06/24 16:08:45 heimbach Exp $ |
2 |
heimbach |
1.2 |
|
3 |
|
|
#include "CPP_OPTIONS.h" |
4 |
|
|
|
5 |
|
|
|
6 |
heimbach |
1.5 |
subroutine grdchk_readparms( mythid ) |
7 |
heimbach |
1.2 |
|
8 |
|
|
c ================================================================== |
9 |
|
|
c SUBROUTINE grdchk_readparms |
10 |
|
|
c ================================================================== |
11 |
|
|
c |
12 |
|
|
c o Initialize the ECCO gradient check. |
13 |
|
|
c |
14 |
|
|
c started: Christian Eckert eckert@mit.edu 03-Mar-2000 |
15 |
|
|
c continued: heimbach@mit.edu: 13-Jun-2001 |
16 |
|
|
c |
17 |
|
|
c ================================================================== |
18 |
|
|
c SUBROUTINE grdchk_readparms |
19 |
|
|
c ================================================================== |
20 |
|
|
|
21 |
|
|
implicit none |
22 |
|
|
|
23 |
|
|
c == global variables == |
24 |
|
|
|
25 |
|
|
#include "EEPARAMS.h" |
26 |
|
|
#include "SIZE.h" |
27 |
|
|
|
28 |
|
|
#include "ctrl.h" |
29 |
|
|
#include "grdchk.h" |
30 |
|
|
|
31 |
|
|
c == routine arguments == |
32 |
|
|
|
33 |
|
|
integer mythid |
34 |
|
|
|
35 |
heimbach |
1.7 |
#ifdef ALLOW_GRDCHK |
36 |
heimbach |
1.2 |
c == local variables == |
37 |
|
|
|
38 |
|
|
integer i,j,k |
39 |
|
|
integer bi,bj |
40 |
|
|
integer itlo,ithi |
41 |
|
|
integer jtlo,jthi |
42 |
|
|
integer jmin,jmax |
43 |
|
|
integer imin,imax |
44 |
|
|
|
45 |
|
|
integer errio |
46 |
|
|
integer il |
47 |
|
|
|
48 |
|
|
character*(max_len_prec) record |
49 |
|
|
|
50 |
|
|
c == external == |
51 |
|
|
|
52 |
|
|
integer ilnblnk |
53 |
|
|
external ilnblnk |
54 |
|
|
|
55 |
|
|
c == end of interface == |
56 |
|
|
|
57 |
|
|
c-- Optimization parameters. |
58 |
|
|
namelist /grdchk_nml/ |
59 |
|
|
& grdchk_eps, |
60 |
|
|
& nbeg, |
61 |
|
|
& nstep, |
62 |
|
|
& nend, |
63 |
heimbach |
1.3 |
& grdchkvarindex, |
64 |
heimbach |
1.5 |
& useCentralDiff, |
65 |
|
|
& grdchkwhichproc |
66 |
heimbach |
1.2 |
|
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 |
heimbach |
1.5 |
grdchk_eps = 1. _d 0 |
80 |
|
|
nbeg = 1 |
81 |
|
|
nend = 1 |
82 |
|
|
nstep = 1 |
83 |
|
|
useCentralDiff = .TRUE. |
84 |
|
|
grdchkwhichproc = 0 |
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 |
heimbach |
1.7 |
#endif /* ALLOW_GRDCHK */ |
118 |
heimbach |
1.2 |
|
119 |
|
|
end |
120 |
|
|
|
121 |
|
|
|