1 |
c $Header: /u/gcmpack/MITgcm/pkg/exf/exf_clim_readparms.F,v 1.11 2005/01/04 04:18:36 dimitri Exp $ |
2 |
|
3 |
#include "EXF_OPTIONS.h" |
4 |
|
5 |
|
6 |
subroutine exf_clim_readparms( |
7 |
I mythid |
8 |
& ) |
9 |
|
10 |
c ================================================================== |
11 |
c SUBROUTINE exf_clim_readparms |
12 |
c ================================================================== |
13 |
c |
14 |
c o This routine initialises the climatologic forcing |
15 |
c |
16 |
c started: Ralf.Giering@FastOpt.de 25-Mai-20000 |
17 |
c |
18 |
c ================================================================== |
19 |
c SUBROUTINE exf_clim_readparms |
20 |
c ================================================================== |
21 |
|
22 |
implicit none |
23 |
|
24 |
c == global variables == |
25 |
|
26 |
#include "EEPARAMS.h" |
27 |
#include "SIZE.h" |
28 |
#include "PARAMS.h" |
29 |
#include "cal.h" |
30 |
#include "exf.h" |
31 |
#include "exf_param.h" |
32 |
#include "exf_clim_param.h" |
33 |
|
34 |
c == routine arguments == |
35 |
|
36 |
integer mythid |
37 |
|
38 |
c == local variables == |
39 |
|
40 |
integer i |
41 |
integer date_array(4), difftime(4) |
42 |
integer iUnit |
43 |
|
44 |
character*(max_len_mbuf) msgbuf |
45 |
|
46 |
c == end of interface == |
47 |
|
48 |
c Surface flux data. |
49 |
namelist /exf_clim_nml/ |
50 |
& climtempfreeze, |
51 |
& climtempstartdate1, climtempstartdate2, climtempperiod, |
52 |
& climsaltstartdate1, climsaltstartdate2, climsaltperiod, |
53 |
& climsststartdate1, climsststartdate2, climsstperiod, |
54 |
& climsssstartdate1, climsssstartdate2, climsssperiod, |
55 |
& climtempfile, climsaltfile, climsstfile, |
56 |
& climsssfile, climsstconst, climsssconst, |
57 |
& exf_clim_iprec, exf_clim_yftype |
58 |
#ifdef USE_EXF_INTERPOLATION |
59 |
& ,climsst_lon0, climsst_lon_inc, |
60 |
& climsst_lat0, climsst_lat_inc, |
61 |
& climsst_nlon, climsst_nlat, |
62 |
& climsss_lon0, climsss_lon_inc, |
63 |
& climsss_lat0, climsss_lat_inc, |
64 |
& climsss_nlon, climsss_nlat |
65 |
#endif |
66 |
|
67 |
_BEGIN_MASTER(mythid) |
68 |
|
69 |
c Set default values. |
70 |
|
71 |
c Calendar data. |
72 |
climtempstartdate1 = 0 |
73 |
climtempstartdate2 = 0 |
74 |
climtempperiod = 0 |
75 |
|
76 |
climsaltstartdate1 = 0 |
77 |
climsaltstartdate2 = 0 |
78 |
climsaltperiod = 0 |
79 |
|
80 |
climsststartdate1 = 0 |
81 |
climsststartdate2 = 0 |
82 |
climsstperiod = 0 |
83 |
|
84 |
climsssstartdate1 = 0 |
85 |
climsssstartdate2 = 0 |
86 |
climsssperiod = 0 |
87 |
|
88 |
c Data files. |
89 |
climtempfile = ' ' |
90 |
climsaltfile = ' ' |
91 |
climsstfile = ' ' |
92 |
climsssfile = ' ' |
93 |
|
94 |
c Start dates. |
95 |
climtempstartdate = 0. |
96 |
climsaltstartdate = 0. |
97 |
climsststartdate = 0. |
98 |
climsssstartdate = 0. |
99 |
|
100 |
c Initialise constant values for relax. to constant SST, SSS |
101 |
climsstconst = 0. _d 0 |
102 |
climsssconst = 0. _d 0 |
103 |
|
104 |
c Initialise freezing temperature of sea water |
105 |
climtempfreeze = -1.9 _d 0 |
106 |
|
107 |
c Initialise file type and field precision |
108 |
exf_clim_iprec = 32 |
109 |
exf_clim_yftype = 'RL' |
110 |
|
111 |
#ifdef USE_EXF_INTERPOLATION |
112 |
climsst_lon0 = thetaMin + delX(1) / 2 |
113 |
climsss_lon0 = thetaMin + delX(1) / 2 |
114 |
climsst_lat0 = phimin + delY(1) / 2 |
115 |
climsss_lat0 = phimin + delY(1) / 2 |
116 |
climsst_nlon = Nx |
117 |
climsst_nlat = Ny |
118 |
climsss_nlon = Nx |
119 |
climsss_nlat = Ny |
120 |
climsst_lon_inc = delX(1) |
121 |
climsss_lon_inc = delX(1) |
122 |
DO i=1,MAX_LAT_INC |
123 |
IF (i.LT.Ny) THEN |
124 |
climsst_lat_inc(i) = (delY(i) + delY(i)) / 2. |
125 |
climsss_lat_inc(i) = (delY(i) + delY(i)) / 2. |
126 |
ELSE |
127 |
climsst_lat_inc(i) = 0. |
128 |
climsss_lat_inc(i) = 0. |
129 |
ENDIF |
130 |
ENDDO |
131 |
#endif /* USE_EXF_INTERPOLATION */ |
132 |
|
133 |
c Check for the availability of the right calendar version. |
134 |
if ( calendarversion .ne. usescalendarversion ) then |
135 |
print*,' exf_Init: You are not using the appropriate' |
136 |
print*,' version of the calendar package.' |
137 |
print* |
138 |
print*,' Please use Calendar version: ', |
139 |
& usescalendarversion |
140 |
stop ' stopped in exf_Init.' |
141 |
endif |
142 |
|
143 |
c Next, read the forcing data file. |
144 |
WRITE(msgBuf,'(A)') 'EXF_CLIM_READPARMS: opening data.exf_clim' |
145 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
146 |
& SQUEEZE_RIGHT , 1) |
147 |
|
148 |
CALL OPEN_COPY_DATA_FILE( |
149 |
I 'data.exf_clim', 'EXF_CLIM_READPARMS', |
150 |
O iUnit, |
151 |
I myThid ) |
152 |
|
153 |
READ( iUnit, nml = exf_clim_nml ) |
154 |
|
155 |
WRITE(msgBuf,'(A)') |
156 |
& 'EXF_CLIM_READPARMS: finished reading data.exf_clim' |
157 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
158 |
& SQUEEZE_RIGHT , 1) |
159 |
|
160 |
CLOSE( iUnit ) |
161 |
|
162 |
c Complete the start date specifications for the forcing |
163 |
c fields to get a complete calendar date array. |
164 |
|
165 |
c check for consistency |
166 |
|
167 |
if (.NOT. (exf_clim_iprec .EQ. 32 |
168 |
& .OR. exf_clim_iprec .EQ. 64)) then |
169 |
stop 'stopped in exf_clim_readparms: value of iprec not allowed' |
170 |
else if |
171 |
& (.NOT. (exf_clim_yftype .EQ. 'RS' |
172 |
& .OR. exf_clim_yftype .EQ. 'RL')) |
173 |
& then |
174 |
stop 'stopped in exf_clim_readparms: value of yftype not allowed' |
175 |
end if |
176 |
|
177 |
#ifdef USE_EXF_INTERPOLATION |
178 |
if ( climsst_nlat .GT. MAX_LAT_INC ) |
179 |
& stop 'stopped in exf_clim_readparms: climsst_nlat > MAX_LAT_INC' |
180 |
if ( climsss_nlat .GT. MAX_LAT_INC ) |
181 |
& stop 'stopped in exf_clim_readparms: climsss_nlat > MAX_LAT_INC' |
182 |
#endif |
183 |
|
184 |
|
185 |
#ifdef ALLOW_CLIMTEMP_RELAXATION |
186 |
if ( climtempfile .NE. ' ' .AND. climtempperiod .NE. 0. ) then |
187 |
call cal_FullDate( climtempstartdate1, climtempstartdate2, |
188 |
& date_array, mythid ) |
189 |
call cal_TimePassed(modelstartdate,date_array,difftime,mythid) |
190 |
call cal_ToSeconds (difftime, climtempstartdate ,mythid) |
191 |
climtempstartdate=modelstart+climtempstartdate |
192 |
endif |
193 |
#endif |
194 |
|
195 |
#ifdef ALLOW_CLIMSALT_RELAXATION |
196 |
if ( climsaltfile .NE. ' ' .AND. climsaltperiod .NE. 0. ) then |
197 |
call cal_FullDate( climsaltstartdate1, climsaltstartdate2, |
198 |
& date_array, mythid ) |
199 |
call cal_TimePassed(modelstartdate,date_array,difftime,mythid) |
200 |
call cal_ToSeconds (difftime, climsaltstartdate ,mythid) |
201 |
climsaltstartdate=modelstart+climsaltstartdate |
202 |
endif |
203 |
#endif |
204 |
|
205 |
#ifdef ALLOW_CLIMSST_RELAXATION |
206 |
if ( climsstfile .NE. ' ' .AND. climsstperiod .NE. 0. ) then |
207 |
call cal_FullDate( climsststartdate1, climsststartdate2, |
208 |
& date_array, mythid ) |
209 |
call cal_TimePassed(modelstartdate,date_array,difftime,mythid) |
210 |
call cal_ToSeconds (difftime, climsststartdate ,mythid) |
211 |
climsststartdate=modelstart+climsststartdate |
212 |
endif |
213 |
#endif |
214 |
|
215 |
#ifdef ALLOW_CLIMSSS_RELAXATION |
216 |
if ( climsssfile .NE. ' ' .AND. climsssperiod .NE. 0. ) then |
217 |
call cal_FullDate( climsssstartdate1, climsssstartdate2, |
218 |
& date_array, mythid ) |
219 |
call cal_TimePassed(modelstartdate,date_array,difftime,mythid) |
220 |
call cal_ToSeconds (difftime, climsssstartdate ,mythid) |
221 |
climsssstartdate=modelstart+climsssstartdate |
222 |
endif |
223 |
#endif |
224 |
|
225 |
_END_MASTER( mythid ) |
226 |
|
227 |
_BARRIER |
228 |
|
229 |
end |