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