1 |
C $Header: /u/gcmpack/MITgcm/pkg/cal/cal_readparms.F,v 1.11 2011/12/22 19:02:13 jmc Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "CAL_OPTIONS.h" |
5 |
|
6 |
SUBROUTINE CAL_READPARMS( myThid ) |
7 |
|
8 |
C ================================================================== |
9 |
C SUBROUTINE cal_readparms |
10 |
C ================================================================== |
11 |
C o This routine initialises the calendar according to the user |
12 |
C specifications in "data.calendar". |
13 |
C |
14 |
C started: Christian Eckert eckert@mit.edu 30-Jun-1999 |
15 |
C changed: Christian Eckert eckert@mit.edu 29-Dec-1999 |
16 |
C - restructured the original version in order to have a |
17 |
C better interface to the MITgcmUV. |
18 |
C |
19 |
C Christian Eckert eckert@mit.edu 10-Jan-2000 |
20 |
C - Modified namelist input. The data file is first copied |
21 |
C to scrunit1 with the comment lines being left out. |
22 |
C After this, scrunit1 is used to read the namelist data. |
23 |
C |
24 |
C Christian Eckert eckert@mit.edu 19-Jan-2000 |
25 |
C - Changed the role of the routine arguments. Chris Hill |
26 |
C proposed to make the calendar less "invasive". The tool |
27 |
C now assumes that the MITgcmUV already provides an ade- |
28 |
C quate set of time stepping parameters. The calendar |
29 |
C only associates a date with the given starttime of the |
30 |
C numerical model. startdate corresponds to zero start- |
31 |
C time. So, given niter0 or startdate .ne. zero the actual |
32 |
C startdate of the current integration is shifted by the |
33 |
C time interval correponding to niter0, startdate respec- |
34 |
C tively. |
35 |
C |
36 |
C Christian Eckert eckert@mit.edu 03-Feb-2000 |
37 |
C - Introduced new routine and function names, cal_<NAME>, |
38 |
C for verion 0.1.3. |
39 |
C ================================================================== |
40 |
C SUBROUTINE cal_readparms |
41 |
C ================================================================== |
42 |
|
43 |
IMPLICIT NONE |
44 |
|
45 |
C == global variables == |
46 |
#include "SIZE.h" |
47 |
#include "EEPARAMS.h" |
48 |
#include "PARAMS.h" |
49 |
#include "cal.h" |
50 |
|
51 |
C == routine arguments == |
52 |
C myThid :: my Thread Id number |
53 |
INTEGER myThid |
54 |
|
55 |
C == local variables == |
56 |
C Variables related to the calendar tool. |
57 |
CHARACTER*(9) TheCalendar |
58 |
INTEGER iUnit |
59 |
CHARACTER*(MAX_LEN_MBUF) msgBuf |
60 |
|
61 |
C == end of interface == |
62 |
|
63 |
C Calendar parameters |
64 |
NAMELIST /CAL_NML/ |
65 |
& TheCalendar, |
66 |
& startDate_1, startDate_2, |
67 |
& calendarDumps |
68 |
|
69 |
#ifdef ALLOW_DEBUG |
70 |
IF (debugMode) CALL DEBUG_ENTER('CAL_READPARMS',myThid) |
71 |
#endif |
72 |
|
73 |
_BEGIN_MASTER(myThid) |
74 |
|
75 |
C Initialise the calendar parameters |
76 |
TheCalendar = ' ' |
77 |
startdate_1 = 0 |
78 |
startdate_2 = 0 |
79 |
calendarDumps = .FALSE. |
80 |
|
81 |
C Next, read the calendar data file. |
82 |
WRITE(msgBuf,'(A)') 'CAL_READPARMS: opening data.cal' |
83 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
84 |
& SQUEEZE_RIGHT , 1) |
85 |
|
86 |
CALL OPEN_COPY_DATA_FILE( |
87 |
I 'data.cal', 'CAL_READPARMS', |
88 |
O iUnit, |
89 |
I myThid ) |
90 |
READ(unit = iUnit, nml = cal_nml) |
91 |
WRITE(msgBuf,'(A)') |
92 |
& 'CAL_READPARMS: finished reading data.cal' |
93 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
94 |
& SQUEEZE_RIGHT , 1) |
95 |
CLOSE( iUnit ) |
96 |
|
97 |
C Check consistency of the date specifications with the MITgcm |
98 |
C startTime, endTime, and nTimeSteps, then set all the calendar |
99 |
C parameters. |
100 |
CALL CAL_SET( |
101 |
I startTime, endTime, deltaTclock, |
102 |
I nIter0, nEndIter, nTimeSteps, |
103 |
I startdate_1, startdate_2, |
104 |
I TheCalendar, |
105 |
I myThid ) |
106 |
|
107 |
CALL CAL_SUMMARY( myThid ) |
108 |
|
109 |
_END_MASTER(myThid) |
110 |
|
111 |
C Everyone else must wait for the parameters to be loaded |
112 |
_BARRIER |
113 |
|
114 |
#ifdef ALLOW_DEBUG |
115 |
IF (debugMode) CALL DEBUG_LEAVE('CAL_READPARMS',myThid) |
116 |
#endif |
117 |
|
118 |
RETURN |
119 |
END |