/[MITgcm]/MITgcm/pkg/exf/exf_clim_readparms.F
ViewVC logotype

Contents of /MITgcm/pkg/exf/exf_clim_readparms.F

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


Revision 1.8 - (show annotations) (download)
Thu Oct 7 01:10:43 2004 UTC (19 years, 7 months ago) by dimitri
Branch: MAIN
CVS Tags: checkpoint55d_pre, checkpoint55j_post, checkpoint56b_post, checkpoint55h_post, checkpoint56c_post, checkpoint55g_post, checkpoint55f_post, checkpoint56, checkpoint55e_post, checkpoint55i_post, checkpoint56a_post, checkpoint55d_post
Changes since 1.7: +24 -1 lines
Added default values for exf_interp variables.

1 c $Header: /u/gcmpack/MITgcm/pkg/exf/exf_clim_readparms.F,v 1.7 2004/07/07 19:59:41 heimbach 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
43 c == end of interface ==
44
45 c Surface flux data.
46 namelist /exf_clim_nml/
47 & climtempfreeze,
48 & climtempstartdate1, climtempstartdate2, climtempperiod,
49 & climsaltstartdate1, climsaltstartdate2, climsaltperiod,
50 & climsststartdate1, climsststartdate2, climsstperiod,
51 & climsssstartdate1, climsssstartdate2, climsssperiod,
52 & climtempfile, climsaltfile, climsstfile,
53 & climsssfile, climsstconst, climsssconst,
54 & exf_clim_iprec, exf_clim_yftype
55 #ifdef USE_EXF_INTERPOLATION
56 & ,climsst_lon0, climsst_lon_inc,
57 & climsst_lat0, climsst_lat_inc,
58 & climsst_nlon, climsst_nlat,
59 & climsss_lon0, climsss_lon_inc,
60 & climsss_lat0, climsss_lat_inc,
61 & climsss_nlon, climsss_nlat
62 #endif
63
64 _BEGIN_MASTER(mythid)
65
66 c Set default values.
67
68 c Calendar data.
69 climtempstartdate1 = 0
70 climtempstartdate2 = 0
71 climtempperiod = 0
72
73 climsaltstartdate1 = 0
74 climsaltstartdate2 = 0
75 climsaltperiod = 0
76
77 climsststartdate1 = 0
78 climsststartdate2 = 0
79 climsstperiod = 0
80
81 climsssstartdate1 = 0
82 climsssstartdate2 = 0
83 climsssperiod = 0
84
85 c Data files.
86 climtempfile = ' '
87 climsaltfile = ' '
88 climsstfile = ' '
89 climsssfile = ' '
90
91 c Start dates.
92 climtempstartdate = 0
93 climsaltstartdate = 0
94 climsststartdate = 0
95 climsssstartdate = 0
96
97 c Initialise constant values for relax. to constant SST, SSS
98 climsstconst = 0. _d 0
99 climsssconst = 0. _d 0
100
101 c Initialise freezing temperature of sea water
102 climtempfreeze = -1.9 _d 0
103
104 c Initialise file type and field precision
105 exf_clim_iprec = 32
106 exf_clim_yftype = 'RL'
107
108 #ifdef USE_EXF_INTERPOLATION
109 climsst_lon0 = thetaMin + delX(1) / 2
110 climsss_lon0 = thetaMin + delX(1) / 2
111 climsst_lat0 = phimin + delY(1) / 2
112 climsss_lat0 = phimin + delY(1) / 2
113 climsst_nlon = Nx
114 climsst_nlat = Ny
115 climsss_nlon = Nx
116 climsss_nlat = Ny
117 climsst_lon_inc = delX(1)
118 climsss_lon_inc = delX(1)
119 DO i=1,MAX_LAT_INC
120 IF (i.LT.Ny) THEN
121 climsst_lat_inc(i) = (delY(i) + delY(i)) / 2.
122 climsss_lat_inc(i) = (delY(i) + delY(i)) / 2.
123 ELSE
124 climsst_lat_inc(i) = 0.
125 climsss_lat_inc(i) = 0.
126 ENDIF
127 ENDDO
128 #endif /* USE_EXF_INTERPOLATION */
129
130 c Check for the availability of the right calendar version.
131 if ( calendarversion .ne. usescalendarversion ) then
132 print*,' exf_Init: You are not using the appropriate'
133 print*,' version of the calendar package.'
134 print*
135 print*,' Please use Calendar version: ',
136 & usescalendarversion
137 stop ' stopped in exf_Init.'
138 endif
139
140 c Next, read the forcing data file.
141 call nml_filter( 'data.exf_clim', scrunit1, myThid )
142 if (scrunit1 .eq. 0) then
143 stop 'exf_clim_readparms: reading namelist failed'
144 end if
145 read( scrunit1, nml = exf_clim_nml )
146 close( scrunit1 )
147
148 c Complete the start date specifications for the forcing
149 c fields to get a complete calendar date array.
150
151 c check for consistency
152
153 if (.NOT. (exf_clim_iprec .EQ. 32
154 & .OR. exf_clim_iprec .EQ. 64)) then
155 stop 'stopped in exf_clim_readparms: value of iprec not allowed'
156 else if
157 & (.NOT. (exf_clim_yftype .EQ. 'RS'
158 & .OR. exf_clim_yftype .EQ. 'RL'))
159 & then
160 stop 'stopped in exf_clim_readparms: value of yftype not allowed'
161 end if
162
163 #ifdef ALLOW_CLIMTEMP_RELAXATION
164 if ( climtempfile .NE. ' ' ) then
165 call cal_FullDate( climtempstartdate1, climtempstartdate2,
166 & date_array, mythid )
167 call cal_TimePassed(modelstartdate,date_array,difftime,mythid)
168 call cal_ToSeconds (difftime, climtempstartdate ,mythid)
169 climtempstartdate=modelstart+climtempstartdate
170 endif
171 #endif
172
173 #ifdef ALLOW_CLIMSALT_RELAXATION
174 if ( climsaltfile .NE. ' ' ) then
175 call cal_FullDate( climsaltstartdate1, climsaltstartdate2,
176 & date_array, mythid )
177 call cal_TimePassed(modelstartdate,date_array,difftime,mythid)
178 call cal_ToSeconds (difftime, climsaltstartdate ,mythid)
179 climsaltstartdate=modelstart+climsaltstartdate
180 endif
181 #endif
182
183 #ifdef ALLOW_CLIMSST_RELAXATION
184 if ( climsstfile .NE. ' ' ) then
185 call cal_FullDate( climsststartdate1, climsststartdate2,
186 & date_array, mythid )
187 call cal_TimePassed(modelstartdate,date_array,difftime,mythid)
188 call cal_ToSeconds (difftime, climsststartdate ,mythid)
189 climsststartdate=modelstart+climsststartdate
190 endif
191 #endif
192
193 #ifdef ALLOW_CLIMSSS_RELAXATION
194 if ( climsssfile .NE. ' ' ) then
195 call cal_FullDate( climsssstartdate1, climsssstartdate2,
196 & date_array, mythid )
197 call cal_TimePassed(modelstartdate,date_array,difftime,mythid)
198 call cal_ToSeconds (difftime, climsssstartdate ,mythid)
199 climsssstartdate=modelstart+climsssstartdate
200 endif
201 #endif
202
203 _END_MASTER( mythid )
204
205 _BARRIER
206
207 end

  ViewVC Help
Powered by ViewVC 1.1.22