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

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

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


Revision 1.9 - (hide annotations) (download)
Fri Dec 3 07:36:58 2004 UTC (19 years, 6 months ago) by dimitri
Branch: MAIN
CVS Tags: checkpoint57b_post, checkpoint57a_post, checkpoint57a_pre, checkpoint57
Changes since 1.8: +9 -1 lines
increased size of MAX_LAT_INC for exf_interp and added check

1 dimitri 1.9 c $Header: /u/gcmpack/MITgcm/pkg/exf/exf_clim_readparms.F,v 1.8 2004/10/07 01:10:43 dimitri Exp $
2 heimbach 1.1
3 edhill 1.4 #include "EXF_OPTIONS.h"
4 heimbach 1.1
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 dimitri 1.8 #include "PARAMS.h"
29 heimbach 1.1 #include "cal.h"
30     #include "exf.h"
31 dimitri 1.3 #include "exf_param.h"
32 heimbach 1.1 #include "exf_clim_param.h"
33    
34     c == routine arguments ==
35    
36     integer mythid
37    
38     c == local variables ==
39    
40     integer i
41 dimitri 1.5 integer date_array(4), difftime(4)
42 heimbach 1.1
43     c == end of interface ==
44    
45     c Surface flux data.
46     namelist /exf_clim_nml/
47 mlosch 1.6 & climtempfreeze,
48 heimbach 1.1 & climtempstartdate1, climtempstartdate2, climtempperiod,
49     & climsaltstartdate1, climsaltstartdate2, climsaltperiod,
50 heimbach 1.2 & climsststartdate1, climsststartdate2, climsstperiod,
51     & climsssstartdate1, climsssstartdate2, climsssperiod,
52     & climtempfile, climsaltfile, climsstfile,
53     & climsssfile, climsstconst, climsssconst,
54 heimbach 1.1 & exf_clim_iprec, exf_clim_yftype
55 dimitri 1.3 #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 heimbach 1.1
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 dimitri 1.5 c Start dates.
92     climtempstartdate = 0
93     climsaltstartdate = 0
94     climsststartdate = 0
95     climsssstartdate = 0
96 heimbach 1.2
97     c Initialise constant values for relax. to constant SST, SSS
98     climsstconst = 0. _d 0
99     climsssconst = 0. _d 0
100 mlosch 1.6
101     c Initialise freezing temperature of sea water
102     climtempfreeze = -1.9 _d 0
103 heimbach 1.1
104     c Initialise file type and field precision
105     exf_clim_iprec = 32
106     exf_clim_yftype = 'RL'
107    
108 dimitri 1.8 #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 heimbach 1.1 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 dimitri 1.9 #ifdef USE_EXF_INTERPOLATION
164     if ( climsst_nlat .GT. MAX_LAT_INC )
165     & stop 'stopped in exf_clim_readparms: climsst_nlat > MAX_LAT_INC'
166     if ( climsss_nlat .GT. MAX_LAT_INC )
167     & stop 'stopped in exf_clim_readparms: climsss_nlat > MAX_LAT_INC'
168     #endif
169    
170    
171 heimbach 1.1 #ifdef ALLOW_CLIMTEMP_RELAXATION
172 heimbach 1.7 if ( climtempfile .NE. ' ' ) then
173     call cal_FullDate( climtempstartdate1, climtempstartdate2,
174     & date_array, mythid )
175     call cal_TimePassed(modelstartdate,date_array,difftime,mythid)
176     call cal_ToSeconds (difftime, climtempstartdate ,mythid)
177     climtempstartdate=modelstart+climtempstartdate
178     endif
179 heimbach 1.1 #endif
180    
181     #ifdef ALLOW_CLIMSALT_RELAXATION
182 heimbach 1.7 if ( climsaltfile .NE. ' ' ) then
183 heimbach 1.1 call cal_FullDate( climsaltstartdate1, climsaltstartdate2,
184 dimitri 1.5 & date_array, mythid )
185     call cal_TimePassed(modelstartdate,date_array,difftime,mythid)
186     call cal_ToSeconds (difftime, climsaltstartdate ,mythid)
187     climsaltstartdate=modelstart+climsaltstartdate
188 heimbach 1.7 endif
189 heimbach 1.1 #endif
190    
191     #ifdef ALLOW_CLIMSST_RELAXATION
192 heimbach 1.7 if ( climsstfile .NE. ' ' ) then
193     call cal_FullDate( climsststartdate1, climsststartdate2,
194     & date_array, mythid )
195     call cal_TimePassed(modelstartdate,date_array,difftime,mythid)
196     call cal_ToSeconds (difftime, climsststartdate ,mythid)
197     climsststartdate=modelstart+climsststartdate
198     endif
199 heimbach 1.1 #endif
200    
201     #ifdef ALLOW_CLIMSSS_RELAXATION
202 heimbach 1.7 if ( climsssfile .NE. ' ' ) then
203     call cal_FullDate( climsssstartdate1, climsssstartdate2,
204     & date_array, mythid )
205     call cal_TimePassed(modelstartdate,date_array,difftime,mythid)
206     call cal_ToSeconds (difftime, climsssstartdate ,mythid)
207     climsssstartdate=modelstart+climsssstartdate
208     endif
209 heimbach 1.1 #endif
210    
211     _END_MASTER( mythid )
212    
213     _BARRIER
214    
215     end

  ViewVC Help
Powered by ViewVC 1.1.22