1 |
C $Header: /u/gcmpack/MITgcm/pkg/offline/offline_readparms.F,v 1.6 2008/08/13 18:53:14 stephd Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "OFFLINE_OPTIONS.h" |
5 |
|
6 |
SUBROUTINE OFFLINE_READPARMS( myThid ) |
7 |
C /==========================================================\ |
8 |
C | SUBROUTINE OFFLINE_READPARMS | |
9 |
C | o Routine to initialize OFFLINE variables and constants. | |
10 |
C |==========================================================| |
11 |
C | Initialize OFFLINE parameters, read in data.off | |
12 |
C \==========================================================/ |
13 |
IMPLICIT NONE |
14 |
|
15 |
C === Global variables === |
16 |
#include "SIZE.h" |
17 |
#include "EEPARAMS.h" |
18 |
#include "PARAMS.h" |
19 |
#include "GRID.h" |
20 |
#ifdef ALLOW_OFFLINE |
21 |
#include "OFFLINE.h" |
22 |
#endif |
23 |
|
24 |
C === Routine arguments === |
25 |
INTEGER myThid |
26 |
|
27 |
#ifdef ALLOW_OFFLINE |
28 |
C-- Bulk Formula parameter |
29 |
NAMELIST /OFFLINE_PARM01/ |
30 |
& UvelFile, VvelFile, WvelFile, ThetFile, |
31 |
& SaltFile, ConvFile, GMwxFile, GMwyFile, |
32 |
& GMwzFile, HfluxFile, SfluxFile, KPP_DiffSFile, |
33 |
& KPP_ghatFile, ICEFile |
34 |
|
35 |
NAMELIST /OFFLINE_PARM02/ |
36 |
& offlineIter0, offlineOffsetIter, |
37 |
& deltaToffline, offlineForcingPeriod, |
38 |
& offlineForcingCycle, offlineLoadPrec |
39 |
|
40 |
C === Local variables === |
41 |
C msgBuf - Informational/error meesage buffer |
42 |
C iUnit - Work variable for IO unit number |
43 |
CHARACTER*(MAX_LEN_MBUF) msgBuf |
44 |
INTEGER iUnit |
45 |
|
46 |
_BEGIN_MASTER(myThid) |
47 |
|
48 |
WRITE(msgBuf,'(A)') ' OFFLINE_READPARMS: opening data.off' |
49 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
50 |
& SQUEEZE_RIGHT , 1) |
51 |
|
52 |
|
53 |
CALL OPEN_COPY_DATA_FILE( |
54 |
I 'data.off', 'OFFLINE_READPARMS', |
55 |
O iUnit, |
56 |
I myThid ) |
57 |
|
58 |
C-- Default values |
59 |
UvelFile=' ' |
60 |
VvelFile=' ' |
61 |
WvelFile=' ' |
62 |
ThetFile=' ' |
63 |
SaltFile=' ' |
64 |
ConvFile=' ' |
65 |
GMwxFile=' ' |
66 |
GMwyFile=' ' |
67 |
GMwzFile=' ' |
68 |
HFluxFile=' ' |
69 |
SFluxFile=' ' |
70 |
KPP_DiffSFile=' ' |
71 |
KPP_ghatFile=' ' |
72 |
ICEFile=' ' |
73 |
|
74 |
C-- Read parameters from open data file |
75 |
READ(UNIT=iUnit,NML=OFFLINE_PARM01) |
76 |
|
77 |
deltaToffline=deltaTclock |
78 |
offlineIter0=nIter0 !initial offline field timestep |
79 |
offlineOffsetIter=0 !offset |
80 |
offlineForcingPeriod=2592000. |
81 |
offlineForcingCycle=31104000. |
82 |
offlineLoadPrec=readBinaryPrec |
83 |
|
84 |
C-- Read parameters from open data file |
85 |
READ(UNIT=iUnit,NML=OFFLINE_PARM02) |
86 |
|
87 |
WRITE(msgBuf,'(A)') |
88 |
& ' OFFLINE_READPARMS: finished reading data.off' |
89 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
90 |
& SQUEEZE_RIGHT , 1) |
91 |
|
92 |
C-- Close the open data file |
93 |
CLOSE(iUnit) |
94 |
_END_MASTER(myThid) |
95 |
|
96 |
C-- Everyone else must wait for the parameters to be loaded |
97 |
_BARRIER |
98 |
|
99 |
|
100 |
#endif /* ALLOW_OFFLINE */ |
101 |
|
102 |
RETURN |
103 |
END |