1 |
heimbach |
1.1 |
c $Header: /u/gcmpack/development/heimbach/ecco_env/pkg/exf/exf_clim_readparms.F,v 1.1 2001/02/02 19:43:46 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 |
|
|
|
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, |
51 |
|
|
& exf_clim_iprec, exf_clim_yftype |
52 |
|
|
|
53 |
|
|
_BEGIN_MASTER(mythid) |
54 |
|
|
|
55 |
|
|
c Set default values. |
56 |
|
|
|
57 |
|
|
c Calendar data. |
58 |
|
|
climtempstartdate1 = 0 |
59 |
|
|
climtempstartdate2 = 0 |
60 |
|
|
climtempperiod = 0 |
61 |
|
|
|
62 |
|
|
climsaltstartdate1 = 0 |
63 |
|
|
climsaltstartdate2 = 0 |
64 |
|
|
climsaltperiod = 0 |
65 |
|
|
|
66 |
|
|
climsststartdate1 = 0 |
67 |
|
|
climsststartdate2 = 0 |
68 |
|
|
climsstperiod = 0 |
69 |
|
|
|
70 |
|
|
climsssstartdate1 = 0 |
71 |
|
|
climsssstartdate2 = 0 |
72 |
|
|
climsssperiod = 0 |
73 |
|
|
|
74 |
|
|
c Data files. |
75 |
|
|
climtempfile = ' ' |
76 |
|
|
climsaltfile = ' ' |
77 |
|
|
climsstfile = ' ' |
78 |
|
|
climsssfile = ' ' |
79 |
|
|
|
80 |
|
|
c Initialise the date arrays. |
81 |
|
|
do i = 1,4 |
82 |
|
|
climtempstartdate(i) = 0 |
83 |
|
|
climsaltstartdate(i) = 0 |
84 |
|
|
climsststartdate(i) = 0 |
85 |
|
|
climsssstartdate(i) = 0 |
86 |
|
|
enddo |
87 |
|
|
|
88 |
|
|
c Initialise file type and field precision |
89 |
|
|
exf_clim_iprec = 32 |
90 |
|
|
exf_clim_yftype = 'RL' |
91 |
|
|
|
92 |
|
|
c Check for the availability of the right calendar version. |
93 |
|
|
if ( calendarversion .ne. usescalendarversion ) then |
94 |
|
|
print*,' exf_Init: You are not using the appropriate' |
95 |
|
|
print*,' version of the calendar package.' |
96 |
|
|
print* |
97 |
|
|
print*,' Please use Calendar version: ', |
98 |
|
|
& usescalendarversion |
99 |
|
|
stop ' stopped in exf_Init.' |
100 |
|
|
endif |
101 |
|
|
|
102 |
|
|
c Next, read the forcing data file. |
103 |
|
|
call nml_filter( 'data.exf_clim', scrunit1, myThid ) |
104 |
|
|
if (scrunit1 .eq. 0) then |
105 |
|
|
stop 'exf_clim_readparms: reading namelist failed' |
106 |
|
|
end if |
107 |
|
|
read( scrunit1, nml = exf_clim_nml ) |
108 |
|
|
close( scrunit1 ) |
109 |
|
|
|
110 |
|
|
c Complete the start date specifications for the forcing |
111 |
|
|
c fields to get a complete calendar date array. |
112 |
|
|
|
113 |
|
|
c check for consistency |
114 |
|
|
|
115 |
|
|
if (.NOT. (exf_clim_iprec .EQ. 32 |
116 |
|
|
& .OR. exf_clim_iprec .EQ. 64)) then |
117 |
|
|
stop 'stopped in exf_clim_readparms: value of iprec not allowed' |
118 |
|
|
else if |
119 |
|
|
& (.NOT. (exf_clim_yftype .EQ. 'RS' |
120 |
|
|
& .OR. exf_clim_yftype .EQ. 'RL')) |
121 |
|
|
& then |
122 |
|
|
stop 'stopped in exf_clim_readparms: value of yftype not allowed' |
123 |
|
|
end if |
124 |
|
|
|
125 |
|
|
#ifdef ALLOW_CLIMTEMP_RELAXATION |
126 |
|
|
call cal_FullDate( climtempstartdate1, climtempstartdate2, |
127 |
|
|
& climtempstartdate, mythid ) |
128 |
|
|
#endif |
129 |
|
|
|
130 |
|
|
#ifdef ALLOW_CLIMSALT_RELAXATION |
131 |
|
|
call cal_FullDate( climsaltstartdate1, climsaltstartdate2, |
132 |
|
|
& climsaltstartdate, mythid ) |
133 |
|
|
#endif |
134 |
|
|
|
135 |
|
|
#ifdef ALLOW_CLIMSST_RELAXATION |
136 |
|
|
call cal_FullDate( climsststartdate1, climsststartdate2, |
137 |
|
|
& climsststartdate, mythid ) |
138 |
|
|
#endif |
139 |
|
|
|
140 |
|
|
#ifdef ALLOW_CLIMSSS_RELAXATION |
141 |
|
|
call cal_FullDate( climsssstartdate1, climsssstartdate2, |
142 |
|
|
& climsssstartdate, mythid ) |
143 |
|
|
#endif |
144 |
|
|
|
145 |
|
|
_END_MASTER( mythid ) |
146 |
|
|
|
147 |
|
|
_BARRIER |
148 |
|
|
|
149 |
|
|
end |