/[MITgcm]/MITgcm/pkg/cal/cal_readparms.F
ViewVC logotype

Contents of /MITgcm/pkg/cal/cal_readparms.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.4 - (show annotations) (download)
Tue Nov 25 19:04:16 2003 UTC (20 years, 6 months ago) by heimbach
Branch: MAIN
CVS Tags: checkpoint52l_pre, hrcube4, hrcube5, checkpoint57b_post, checkpoint52d_pre, checkpoint56b_post, checkpoint52j_pre, checkpoint54d_post, checkpoint54e_post, checkpoint52l_post, checkpoint52k_post, checkpoint55, checkpoint54, checkpoint57, checkpoint56, checkpoint53, checkpoint52f_post, checkpoint54f_post, checkpoint55i_post, checkpoint52i_pre, hrcube_1, hrcube_2, hrcube_3, checkpoint55c_post, checkpoint52e_pre, checkpoint52e_post, checkpoint53d_post, checkpoint57a_post, checkpoint54b_post, checkpoint52m_post, checkpoint55g_post, checkpoint52c_post, checkpoint52f_pre, checkpoint55d_post, checkpoint54a_pre, checkpoint53c_post, checkpoint55d_pre, checkpoint55j_post, checkpoint54a_post, checkpoint55h_post, checkpoint55b_post, checkpoint53a_post, checkpoint55f_post, checkpoint52d_post, checkpoint53g_post, checkpoint52i_post, checkpoint52h_pre, checkpoint56a_post, checkpoint53f_post, checkpoint52j_post, branch-netcdf, checkpoint52n_post, checkpoint53b_pre, checkpoint56c_post, checkpoint57a_pre, checkpoint55a_post, checkpoint53b_post, checkpoint53d_pre, checkpoint55e_post, checkpoint54c_post
Branch point for: netcdf-sm0
Changes since 1.3: +1 -6 lines
Removed all CPP options for cal package.
cal has no more CPP options.

1 C $Header: /u/gcmpack/MITgcm/pkg/cal/cal_readparms.F,v 1.3 2003/10/09 04:19:19 edhill 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
12 c o This routine initialises the calendar according to the user
13 c specifications in "data.calendar".
14 c
15 c started: Christian Eckert eckert@mit.edu 30-Jun-1999
16 c
17 c changed: Christian Eckert eckert@mit.edu 29-Dec-1999
18 c
19 c - restructured the original version in order to have a
20 c better interface to the MITgcmUV.
21 c
22 c Christian Eckert eckert@mit.edu 10-Jan-2000
23 c
24 c - Modified namelist input. The data file is first copied
25 c to scrunit1 with the comment lines being left out.
26 c After this, scrunit1 is used to read the namelist data.
27 c
28 c Christian Eckert eckert@mit.edu 19-Jan-2000
29 c
30 c - Changed the role of the routine arguments. Chris Hill
31 c proposed to make the calendar less "invasive". The tool
32 c now assumes that the MITgcmUV already provides an ade-
33 c quate set of time stepping parameters. The calendar
34 c only associates a date with the given starttime of the
35 c numerical model. startdate corresponds to zero start-
36 c time. So, given niter0 or startdate .ne. zero the actual
37 c startdate of the current integration is shifted by the
38 c time interval correponding to niter0, startdate respec-
39 c tively.
40 c
41 c Christian Eckert eckert@mit.edu 03-Feb-2000
42 c
43 c - Introduced new routine and function names, cal_<NAME>,
44 c for verion 0.1.3.
45 c
46 c ==================================================================
47 c SUBROUTINE cal_readparms
48 c ==================================================================
49
50 implicit none
51
52 c == global variables ==
53
54 #include "SIZE.h"
55 #include "EEPARAMS.h"
56 #include "PARAMS.h"
57
58 c == routine arguments ==
59
60 c modstart - start time of the model integration
61 c modend - end time of the model integration
62 c moditerini - initial iteration number of the model
63 c moditerend - last iteration number of the model
64 c modstep - timestep of the numerical model
65 c modintsteps - number of timesteps that are to be performed.
66 c mythid - number of this instance of the subrotuine.
67
68 _RL modstart
69 _RL modend
70 _RL modstep
71 integer moditerini
72 integer moditerend
73 integer modintsteps
74 integer mythid
75
76 c == local variables ==
77
78 integer errio
79 integer ierr
80 integer il
81 integer enddate_1
82 integer enddate_2
83
84 c Variables related to the calendar tool.
85 character*(9) TheCalendar
86 integer startdate_1
87 integer startdate_2
88
89 character*(max_len_prec) record
90
91 c == external ==
92
93 integer ilnblnk
94 external ilnblnk
95
96 c == end of interface ==
97
98 c Calendar parameters
99 c (version 0.1.3 >> START << )
100
101 namelist /CAL_NML/
102 & TheCalendar,
103 & startDate_1,startDate_2
104
105 c (version 0.1.3 >> END << )
106
107
108 _BEGIN_MASTER(myThid)
109
110 c Initialise the calendar's parameters
111 TheCalendar = ' '
112 startdate_1 = 0
113 startdate_2 = 0
114 enddate_1 = 0
115 enddate_2 = 0
116
117 open(unit=scrunit1,status='scratch')
118
119 c Next, read the calendar data file.
120 open(unit = modeldataunit,file = 'data.cal',
121 & status = 'old', iostat = errio)
122 if ( errio .lt. 0 ) then
123 ierr = 1
124 call cal_PrintError( ierr, mythid )
125 stop ' stopped in cal_readparms.'
126 endif
127
128 do while ( .true. )
129 read(modeldataunit, fmt='(a)', end=1001) record
130 il = max(ilnblnk(record),1)
131 if ( record(1:1) .ne. commentcharacter )
132 & write(unit=scrunit1, fmt='(a)') record(:il)
133 enddo
134 1001 continue
135
136 close( modeldataunit )
137
138 rewind( scrunit1 )
139 read(unit = scrunit1, nml = cal_nml)
140 close( scrunit1 )
141
142
143 c Check consistency of the date specifications with the MITgcmUV's
144 c startTime, endTime, and nTimeSteps, then set all the calendar
145 c parameters.
146
147 modstart = startTime
148 modend = endTime
149 modstep = deltaTclock
150 moditerini = nIter0
151 moditerend = nEndIter
152 modintsteps = nTimeSteps
153
154 call cal_Set(
155 I modstart,
156 I modend,
157 I modstep,
158 I TheCalendar,
159 I startdate_1,
160 I startdate_2,
161 I enddate_1,
162 I enddate_2,
163 I moditerini,
164 I moditerend,
165 I modintsteps,
166 I mythid
167 & )
168
169 call cal_Summary( mythid )
170
171 _END_MASTER(myThid)
172
173 c Everyone else must wait for the parameters to be loaded
174 _BARRIER
175
176 return
177 end

  ViewVC Help
Powered by ViewVC 1.1.22