1 |
c $Header: /u/gcmpack/MITgcm/pkg/exf/exf_clim_readparms.F,v 1.5 2003/10/20 06:25:16 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 "cal.h" |
29 |
#include "exf.h" |
30 |
#include "exf_param.h" |
31 |
#include "exf_clim_param.h" |
32 |
|
33 |
c == routine arguments == |
34 |
|
35 |
integer mythid |
36 |
|
37 |
c == local variables == |
38 |
|
39 |
integer i |
40 |
integer date_array(4), difftime(4) |
41 |
|
42 |
c == end of interface == |
43 |
|
44 |
c Surface flux data. |
45 |
namelist /exf_clim_nml/ |
46 |
& climtempfreeze, |
47 |
& climtempstartdate1, climtempstartdate2, climtempperiod, |
48 |
& climsaltstartdate1, climsaltstartdate2, climsaltperiod, |
49 |
& climsststartdate1, climsststartdate2, climsstperiod, |
50 |
& climsssstartdate1, climsssstartdate2, climsssperiod, |
51 |
& climtempfile, climsaltfile, climsstfile, |
52 |
& climsssfile, climsstconst, climsssconst, |
53 |
& exf_clim_iprec, exf_clim_yftype |
54 |
#ifdef USE_EXF_INTERPOLATION |
55 |
& ,climsst_lon0, climsst_lon_inc, |
56 |
& climsst_lat0, climsst_lat_inc, |
57 |
& climsst_nlon, climsst_nlat, |
58 |
& climsss_lon0, climsss_lon_inc, |
59 |
& climsss_lat0, climsss_lat_inc, |
60 |
& climsss_nlon, climsss_nlat |
61 |
#endif |
62 |
|
63 |
_BEGIN_MASTER(mythid) |
64 |
|
65 |
c Set default values. |
66 |
|
67 |
c Calendar data. |
68 |
climtempstartdate1 = 0 |
69 |
climtempstartdate2 = 0 |
70 |
climtempperiod = 0 |
71 |
|
72 |
climsaltstartdate1 = 0 |
73 |
climsaltstartdate2 = 0 |
74 |
climsaltperiod = 0 |
75 |
|
76 |
climsststartdate1 = 0 |
77 |
climsststartdate2 = 0 |
78 |
climsstperiod = 0 |
79 |
|
80 |
climsssstartdate1 = 0 |
81 |
climsssstartdate2 = 0 |
82 |
climsssperiod = 0 |
83 |
|
84 |
c Data files. |
85 |
climtempfile = ' ' |
86 |
climsaltfile = ' ' |
87 |
climsstfile = ' ' |
88 |
climsssfile = ' ' |
89 |
|
90 |
c Start dates. |
91 |
climtempstartdate = 0 |
92 |
climsaltstartdate = 0 |
93 |
climsststartdate = 0 |
94 |
climsssstartdate = 0 |
95 |
|
96 |
c Initialise constant values for relax. to constant SST, SSS |
97 |
climsstconst = 0. _d 0 |
98 |
climsssconst = 0. _d 0 |
99 |
|
100 |
c Initialise freezing temperature of sea water |
101 |
climtempfreeze = -1.9 _d 0 |
102 |
|
103 |
c Initialise file type and field precision |
104 |
exf_clim_iprec = 32 |
105 |
exf_clim_yftype = 'RL' |
106 |
|
107 |
c Check for the availability of the right calendar version. |
108 |
if ( calendarversion .ne. usescalendarversion ) then |
109 |
print*,' exf_Init: You are not using the appropriate' |
110 |
print*,' version of the calendar package.' |
111 |
print* |
112 |
print*,' Please use Calendar version: ', |
113 |
& usescalendarversion |
114 |
stop ' stopped in exf_Init.' |
115 |
endif |
116 |
|
117 |
c Next, read the forcing data file. |
118 |
call nml_filter( 'data.exf_clim', scrunit1, myThid ) |
119 |
if (scrunit1 .eq. 0) then |
120 |
stop 'exf_clim_readparms: reading namelist failed' |
121 |
end if |
122 |
read( scrunit1, nml = exf_clim_nml ) |
123 |
close( scrunit1 ) |
124 |
|
125 |
c Complete the start date specifications for the forcing |
126 |
c fields to get a complete calendar date array. |
127 |
|
128 |
c check for consistency |
129 |
|
130 |
if (.NOT. (exf_clim_iprec .EQ. 32 |
131 |
& .OR. exf_clim_iprec .EQ. 64)) then |
132 |
stop 'stopped in exf_clim_readparms: value of iprec not allowed' |
133 |
else if |
134 |
& (.NOT. (exf_clim_yftype .EQ. 'RS' |
135 |
& .OR. exf_clim_yftype .EQ. 'RL')) |
136 |
& then |
137 |
stop 'stopped in exf_clim_readparms: value of yftype not allowed' |
138 |
end if |
139 |
|
140 |
#ifdef ALLOW_CLIMTEMP_RELAXATION |
141 |
call cal_FullDate( climtempstartdate1, climtempstartdate2, |
142 |
& date_array, mythid ) |
143 |
call cal_TimePassed(modelstartdate,date_array,difftime,mythid) |
144 |
call cal_ToSeconds (difftime, climtempstartdate ,mythid) |
145 |
climtempstartdate=modelstart+climtempstartdate |
146 |
#endif |
147 |
|
148 |
#ifdef ALLOW_CLIMSALT_RELAXATION |
149 |
call cal_FullDate( climsaltstartdate1, climsaltstartdate2, |
150 |
& date_array, mythid ) |
151 |
call cal_TimePassed(modelstartdate,date_array,difftime,mythid) |
152 |
call cal_ToSeconds (difftime, climsaltstartdate ,mythid) |
153 |
climsaltstartdate=modelstart+climsaltstartdate |
154 |
#endif |
155 |
|
156 |
#ifdef ALLOW_CLIMSST_RELAXATION |
157 |
call cal_FullDate( climsststartdate1, climsststartdate2, |
158 |
& date_array, mythid ) |
159 |
call cal_TimePassed(modelstartdate,date_array,difftime,mythid) |
160 |
call cal_ToSeconds (difftime, climsststartdate ,mythid) |
161 |
climsststartdate=modelstart+climsststartdate |
162 |
#endif |
163 |
|
164 |
#ifdef ALLOW_CLIMSSS_RELAXATION |
165 |
call cal_FullDate( climsssstartdate1, climsssstartdate2, |
166 |
& date_array, mythid ) |
167 |
call cal_TimePassed(modelstartdate,date_array,difftime,mythid) |
168 |
call cal_ToSeconds (difftime, climsssstartdate ,mythid) |
169 |
climsssstartdate=modelstart+climsssstartdate |
170 |
#endif |
171 |
|
172 |
_END_MASTER( mythid ) |
173 |
|
174 |
_BARRIER |
175 |
|
176 |
end |