1 |
C $Header: /u/gcmpack/MITgcm/pkg/cal/cal_readparms.F,v 1.13 2012/04/05 21:59:03 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 |
INTEGER iUnit |
57 |
CHARACTER*(MAX_LEN_MBUF) msgBuf |
58 |
|
59 |
C == end of interface == |
60 |
|
61 |
C Calendar parameters |
62 |
NAMELIST /CAL_NML/ |
63 |
& TheCalendar, |
64 |
& startDate_1, startDate_2, |
65 |
& calendarDumps |
66 |
|
67 |
#ifdef ALLOW_DEBUG |
68 |
IF (debugMode) CALL DEBUG_ENTER('CAL_READPARMS',myThid) |
69 |
#endif |
70 |
|
71 |
_BEGIN_MASTER(myThid) |
72 |
|
73 |
C Initialise the calendar parameters |
74 |
cal_setStatus = 0 |
75 |
TheCalendar = ' ' |
76 |
startdate_1 = 0 |
77 |
startdate_2 = 0 |
78 |
calendarDumps = .FALSE. |
79 |
|
80 |
C Next, read the calendar data file. |
81 |
WRITE(msgBuf,'(A)') 'CAL_READPARMS: opening data.cal' |
82 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
83 |
& SQUEEZE_RIGHT , 1) |
84 |
|
85 |
CALL OPEN_COPY_DATA_FILE( |
86 |
I 'data.cal', 'CAL_READPARMS', |
87 |
O iUnit, |
88 |
I myThid ) |
89 |
READ(unit = iUnit, nml = cal_nml) |
90 |
WRITE(msgBuf,'(A)') |
91 |
& 'CAL_READPARMS: finished reading data.cal' |
92 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
93 |
& SQUEEZE_RIGHT , 1) |
94 |
CLOSE( iUnit ) |
95 |
|
96 |
_END_MASTER(myThid) |
97 |
|
98 |
C Everyone else must wait for the parameters to be loaded |
99 |
_BARRIER |
100 |
|
101 |
#ifdef ALLOW_DEBUG |
102 |
IF (debugMode) CALL DEBUG_LEAVE('CAL_READPARMS',myThid) |
103 |
#endif |
104 |
|
105 |
RETURN |
106 |
END |