1 |
jmc |
1.14 |
C $Header: /u/gcmpack/MITgcm/pkg/cal/cal_readparms.F,v 1.13 2012/04/05 21:59:03 jmc Exp $ |
2 |
edhill |
1.3 |
C $Name: $ |
3 |
heimbach |
1.2 |
|
4 |
edhill |
1.3 |
#include "CAL_OPTIONS.h" |
5 |
heimbach |
1.2 |
|
6 |
jmc |
1.10 |
SUBROUTINE CAL_READPARMS( myThid ) |
7 |
heimbach |
1.2 |
|
8 |
jmc |
1.12 |
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 |
heimbach |
1.2 |
|
43 |
jmc |
1.12 |
IMPLICIT NONE |
44 |
heimbach |
1.2 |
|
45 |
jmc |
1.12 |
C == global variables == |
46 |
heimbach |
1.2 |
#include "SIZE.h" |
47 |
|
|
#include "EEPARAMS.h" |
48 |
|
|
#include "PARAMS.h" |
49 |
heimbach |
1.8 |
#include "cal.h" |
50 |
heimbach |
1.2 |
|
51 |
jmc |
1.10 |
C == routine arguments == |
52 |
|
|
C myThid :: my Thread Id number |
53 |
|
|
INTEGER myThid |
54 |
heimbach |
1.2 |
|
55 |
jmc |
1.12 |
C == local variables == |
56 |
|
|
INTEGER iUnit |
57 |
|
|
CHARACTER*(MAX_LEN_MBUF) msgBuf |
58 |
heimbach |
1.2 |
|
59 |
jmc |
1.12 |
C == end of interface == |
60 |
heimbach |
1.2 |
|
61 |
jmc |
1.12 |
C Calendar parameters |
62 |
|
|
NAMELIST /CAL_NML/ |
63 |
heimbach |
1.2 |
& TheCalendar, |
64 |
jmc |
1.12 |
& startDate_1, startDate_2, |
65 |
jmc |
1.9 |
& calendarDumps |
66 |
heimbach |
1.2 |
|
67 |
jmc |
1.10 |
#ifdef ALLOW_DEBUG |
68 |
|
|
IF (debugMode) CALL DEBUG_ENTER('CAL_READPARMS',myThid) |
69 |
|
|
#endif |
70 |
heimbach |
1.2 |
|
71 |
|
|
_BEGIN_MASTER(myThid) |
72 |
|
|
|
73 |
jmc |
1.12 |
C Initialise the calendar parameters |
74 |
jmc |
1.13 |
cal_setStatus = 0 |
75 |
heimbach |
1.2 |
TheCalendar = ' ' |
76 |
|
|
startdate_1 = 0 |
77 |
|
|
startdate_2 = 0 |
78 |
jmc |
1.9 |
calendarDumps = .FALSE. |
79 |
heimbach |
1.2 |
|
80 |
jmc |
1.12 |
C Next, read the calendar data file. |
81 |
heimbach |
1.6 |
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 |
jmc |
1.10 |
WRITE(msgBuf,'(A)') |
91 |
heimbach |
1.6 |
& 'CAL_READPARMS: finished reading data.cal' |
92 |
|
|
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
93 |
|
|
& SQUEEZE_RIGHT , 1) |
94 |
|
|
CLOSE( iUnit ) |
95 |
heimbach |
1.2 |
|
96 |
|
|
_END_MASTER(myThid) |
97 |
|
|
|
98 |
jmc |
1.12 |
C Everyone else must wait for the parameters to be loaded |
99 |
heimbach |
1.2 |
_BARRIER |
100 |
|
|
|
101 |
jmc |
1.10 |
#ifdef ALLOW_DEBUG |
102 |
|
|
IF (debugMode) CALL DEBUG_LEAVE('CAL_READPARMS',myThid) |
103 |
|
|
#endif |
104 |
|
|
|
105 |
|
|
RETURN |
106 |
|
|
END |