1 |
c $Header: /u/gcmpack/MITgcm/pkg/exf/exf_clim_readparms.F,v 1.2 2003/03/06 00:47:33 heimbach Exp $ |
2 |
|
3 |
#include "EXF_CPPOPTIONS.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 |
|
41 |
c == end of interface == |
42 |
|
43 |
c Surface flux data. |
44 |
namelist /exf_clim_nml/ |
45 |
& climtempstartdate1, climtempstartdate2, climtempperiod, |
46 |
& climsaltstartdate1, climsaltstartdate2, climsaltperiod, |
47 |
& climsststartdate1, climsststartdate2, climsstperiod, |
48 |
& climsssstartdate1, climsssstartdate2, climsssperiod, |
49 |
& climtempfile, climsaltfile, climsstfile, |
50 |
& climsssfile, climsstconst, climsssconst, |
51 |
& exf_clim_iprec, exf_clim_yftype |
52 |
#ifdef USE_EXF_INTERPOLATION |
53 |
& ,climsst_lon0, climsst_lon_inc, |
54 |
& climsst_lat0, climsst_lat_inc, |
55 |
& climsst_nlon, climsst_nlat, |
56 |
& climsss_lon0, climsss_lon_inc, |
57 |
& climsss_lat0, climsss_lat_inc, |
58 |
& climsss_nlon, climsss_nlat |
59 |
#endif |
60 |
|
61 |
_BEGIN_MASTER(mythid) |
62 |
|
63 |
c Set default values. |
64 |
|
65 |
c Calendar data. |
66 |
climtempstartdate1 = 0 |
67 |
climtempstartdate2 = 0 |
68 |
climtempperiod = 0 |
69 |
|
70 |
climsaltstartdate1 = 0 |
71 |
climsaltstartdate2 = 0 |
72 |
climsaltperiod = 0 |
73 |
|
74 |
climsststartdate1 = 0 |
75 |
climsststartdate2 = 0 |
76 |
climsstperiod = 0 |
77 |
|
78 |
climsssstartdate1 = 0 |
79 |
climsssstartdate2 = 0 |
80 |
climsssperiod = 0 |
81 |
|
82 |
c Data files. |
83 |
climtempfile = ' ' |
84 |
climsaltfile = ' ' |
85 |
climsstfile = ' ' |
86 |
climsssfile = ' ' |
87 |
|
88 |
c Initialise the date arrays. |
89 |
do i = 1,4 |
90 |
climtempstartdate(i) = 0 |
91 |
climsaltstartdate(i) = 0 |
92 |
climsststartdate(i) = 0 |
93 |
climsssstartdate(i) = 0 |
94 |
enddo |
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 file type and field precision |
101 |
exf_clim_iprec = 32 |
102 |
exf_clim_yftype = 'RL' |
103 |
|
104 |
c Check for the availability of the right calendar version. |
105 |
if ( calendarversion .ne. usescalendarversion ) then |
106 |
print*,' exf_Init: You are not using the appropriate' |
107 |
print*,' version of the calendar package.' |
108 |
print* |
109 |
print*,' Please use Calendar version: ', |
110 |
& usescalendarversion |
111 |
stop ' stopped in exf_Init.' |
112 |
endif |
113 |
|
114 |
c Next, read the forcing data file. |
115 |
call nml_filter( 'data.exf_clim', scrunit1, myThid ) |
116 |
if (scrunit1 .eq. 0) then |
117 |
stop 'exf_clim_readparms: reading namelist failed' |
118 |
end if |
119 |
read( scrunit1, nml = exf_clim_nml ) |
120 |
close( scrunit1 ) |
121 |
|
122 |
c Complete the start date specifications for the forcing |
123 |
c fields to get a complete calendar date array. |
124 |
|
125 |
c check for consistency |
126 |
|
127 |
if (.NOT. (exf_clim_iprec .EQ. 32 |
128 |
& .OR. exf_clim_iprec .EQ. 64)) then |
129 |
stop 'stopped in exf_clim_readparms: value of iprec not allowed' |
130 |
else if |
131 |
& (.NOT. (exf_clim_yftype .EQ. 'RS' |
132 |
& .OR. exf_clim_yftype .EQ. 'RL')) |
133 |
& then |
134 |
stop 'stopped in exf_clim_readparms: value of yftype not allowed' |
135 |
end if |
136 |
|
137 |
#ifdef ALLOW_CLIMTEMP_RELAXATION |
138 |
call cal_FullDate( climtempstartdate1, climtempstartdate2, |
139 |
& climtempstartdate, mythid ) |
140 |
#endif |
141 |
|
142 |
#ifdef ALLOW_CLIMSALT_RELAXATION |
143 |
call cal_FullDate( climsaltstartdate1, climsaltstartdate2, |
144 |
& climsaltstartdate, mythid ) |
145 |
#endif |
146 |
|
147 |
#ifdef ALLOW_CLIMSST_RELAXATION |
148 |
call cal_FullDate( climsststartdate1, climsststartdate2, |
149 |
& climsststartdate, mythid ) |
150 |
#endif |
151 |
|
152 |
#ifdef ALLOW_CLIMSSS_RELAXATION |
153 |
call cal_FullDate( climsssstartdate1, climsssstartdate2, |
154 |
& climsssstartdate, mythid ) |
155 |
#endif |
156 |
|
157 |
_END_MASTER( mythid ) |
158 |
|
159 |
_BARRIER |
160 |
|
161 |
end |