/[MITgcm]/MITgcm_contrib/heimbach/OpenAD/OAD_support/OAD_active.F90
ViewVC logotype

Annotation of /MITgcm_contrib/heimbach/OpenAD/OAD_support/OAD_active.F90

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


Revision 1.4 - (hide annotations) (download)
Fri Dec 18 15:12:26 2009 UTC (16 years, 8 months ago) by utke
Branch: MAIN
Changes since 1.3: +100 -4 lines
allocation support

1 utke 1.1 module OAD_active
2     use w2f__types
3     implicit none
4     private
5 utke 1.3 public :: active, saxpy, sax, zero_deriv, &
6     setderiv, set_neg_deriv, inc_deriv, dec_deriv, &
7     convert_p2a_scalar, convert_a2p_scalar, &
8     convert_p2a_vector, convert_a2p_vector, &
9     convert_p2a_matrix, convert_a2p_matrix, &
10     convert_p2a_three_tensor, convert_a2p_three_tensor, &
11     convert_p2a_four_tensor, convert_a2p_four_tensor, &
12     convert_p2a_five_tensor, convert_a2p_five_tensor, &
13     convert_p2a_six_tensor, convert_a2p_six_tensor, &
14     convert_p2a_seven_tensor, convert_a2p_seven_tensor, &
15     oad_allocateMatching
16 utke 1.1
17    
18     !
19     ! active needs to be a sequence type
20     ! with no initialization
21     !
22     type active
23     sequence
24     real(w2f__8) :: v
25     ! initialization does not work for active variables
26     ! inside of common block, such as in boxmodel
27     ! initialization is required for correct adjoint
28     real(w2f__8) :: d=0.0
29     ! real(w2f__8) :: d
30     end type active
31    
32     interface saxpy
33     module procedure saxpy_a_a
34     end interface
35    
36     interface setderiv
37     module procedure setderiv_a_a
38     end interface
39    
40 utke 1.3 interface set_neg_deriv
41     module procedure set_neg_deriv_a_a
42     end interface set_neg_deriv
43    
44     interface inc_deriv
45     module procedure inc_deriv_a_a
46     end interface inc_deriv
47    
48     interface dec_deriv
49     module procedure dec_deriv_a_a
50     end interface dec_deriv
51    
52 utke 1.1 interface zero_deriv
53     module procedure zero_deriv_a
54     end interface
55    
56     interface sax
57     module procedure sax_d_a_a, sax_i_a_a
58     end interface
59    
60     interface convert_p2a_scalar
61 utke 1.2 #ifdef ALLOW_AUTODIFF_MIXED_PRECISION
62 utke 1.1 module procedure convert_sp2a_scalar_impl
63 utke 1.2 #endif
64 utke 1.1 module procedure convert_p2a_scalar_impl
65     end interface
66     interface convert_a2p_scalar
67 utke 1.2 #ifdef ALLOW_AUTODIFF_MIXED_PRECISION
68 utke 1.1 module procedure convert_a2sp_scalar_impl
69 utke 1.2 #endif
70 utke 1.1 module procedure convert_a2p_scalar_impl
71     end interface
72    
73     interface convert_p2a_vector
74 utke 1.2 #ifdef ALLOW_AUTODIFF_MIXED_PRECISION
75 utke 1.1 module procedure convert_sp2a_vector_impl
76 utke 1.2 #endif
77 utke 1.1 module procedure convert_p2a_vector_impl
78     end interface
79     interface convert_a2p_vector
80 utke 1.2 #ifdef ALLOW_AUTODIFF_MIXED_PRECISION
81 utke 1.1 module procedure convert_a2sp_vector_impl
82 utke 1.2 #endif
83 utke 1.1 module procedure convert_a2p_vector_impl
84     end interface
85    
86     interface convert_p2a_matrix
87 utke 1.2 #ifdef ALLOW_AUTODIFF_MIXED_PRECISION
88 utke 1.1 module procedure convert_sp2a_matrix_impl
89 utke 1.2 #endif
90 utke 1.1 module procedure convert_p2a_matrix_impl
91     end interface
92     interface convert_a2p_matrix
93 utke 1.2 #ifdef ALLOW_AUTODIFF_MIXED_PRECISION
94 utke 1.1 module procedure convert_a2sp_matrix_impl
95 utke 1.2 #endif
96 utke 1.1 module procedure convert_a2p_matrix_impl
97     end interface
98    
99     interface convert_p2a_three_tensor
100 utke 1.2 #ifdef ALLOW_AUTODIFF_MIXED_PRECISION
101 utke 1.1 module procedure convert_sp2a_three_tensor_impl
102 utke 1.2 #endif
103 utke 1.1 module procedure convert_p2a_three_tensor_impl
104     end interface
105     interface convert_a2p_three_tensor
106 utke 1.2 #ifdef ALLOW_AUTODIFF_MIXED_PRECISION
107 utke 1.1 module procedure convert_a2sp_three_tensor_impl
108 utke 1.2 #endif
109 utke 1.1 module procedure convert_a2p_three_tensor_impl
110     end interface
111    
112     interface convert_p2a_four_tensor
113 utke 1.2 #ifdef ALLOW_AUTODIFF_MIXED_PRECISION
114 utke 1.1 module procedure convert_sp2a_four_tensor_impl
115 utke 1.2 #endif
116 utke 1.1 module procedure convert_p2a_four_tensor_impl
117     end interface
118     interface convert_a2p_four_tensor
119 utke 1.2 #ifdef ALLOW_AUTODIFF_MIXED_PRECISION
120 utke 1.1 module procedure convert_a2sp_four_tensor_impl
121 utke 1.2 #endif
122 utke 1.1 module procedure convert_a2p_four_tensor_impl
123     end interface
124    
125     interface convert_p2a_five_tensor
126 utke 1.2 #ifdef ALLOW_AUTODIFF_MIXED_PRECISION
127 utke 1.1 module procedure convert_sp2a_five_tensor_impl
128 utke 1.2 #endif
129 utke 1.1 module procedure convert_p2a_five_tensor_impl
130     end interface
131     interface convert_a2p_five_tensor
132 utke 1.2 #ifdef ALLOW_AUTODIFF_MIXED_PRECISION
133 utke 1.1 module procedure convert_a2sp_five_tensor_impl
134 utke 1.2 #endif
135 utke 1.1 module procedure convert_a2p_five_tensor_impl
136     end interface
137    
138 utke 1.3 interface convert_p2a_six_tensor
139     #ifdef ALLOW_AUTODIFF_MIXED_PRECISION
140     module procedure convert_sp2a_six_tensor_impl
141     #endif
142     module procedure convert_p2a_six_tensor_impl
143     end interface
144     interface convert_a2p_six_tensor
145     #ifdef ALLOW_AUTODIFF_MIXED_PRECISION
146     module procedure convert_a2sp_six_tensor_impl
147     #endif
148     module procedure convert_a2p_six_tensor_impl
149     end interface
150    
151     interface convert_p2a_seven_tensor
152     #ifdef ALLOW_AUTODIFF_MIXED_PRECISION
153     module procedure convert_sp2a_seven_tensor_impl
154     #endif
155     module procedure convert_p2a_seven_tensor_impl
156     end interface
157     interface convert_a2p_seven_tensor
158     #ifdef ALLOW_AUTODIFF_MIXED_PRECISION
159     module procedure convert_a2sp_seven_tensor_impl
160     #endif
161     module procedure convert_a2p_seven_tensor_impl
162     end interface
163    
164     interface oad_allocateMatching
165 utke 1.4 module procedure oad_allocateMatching_av
166     module procedure oad_allocateMatching_pv
167     #ifdef ALLOW_AUTODIFF_MIXED_PRECISION
168     module procedure oad_allocateMatching_p4bv
169     #endif
170     module procedure oad_allocateMatching_am
171     module procedure oad_allocateMatching_pm
172     #ifdef ALLOW_AUTODIFF_MIXED_PRECISION
173     module procedure oad_allocateMatching_p4bm
174     #endif
175     module procedure oad_allocateMatching_at4
176     module procedure oad_allocateMatching_pt4
177     module procedure oad_allocateMatching_at5
178     module procedure oad_allocateMatching_pt5
179 utke 1.3 end interface
180    
181 utke 1.1 contains
182    
183     !
184     ! chain rule saxpy to be used in forward and reverse modes
185     !
186    
187     subroutine saxpy_a_a(a,x,y)
188     real(w2f__8), intent(in) :: a
189     type(active), intent(in) :: x
190     type(active), intent(inout) :: y
191     y%d=y%d+x%d*a
192     end subroutine saxpy_a_a
193    
194     !
195     ! chain rule saxpy to be used in forward and reverse modes
196     ! derivative component of y is equal to zero initially
197     ! note: y needs to be inout as otherwise value component gets
198     ! zeroed out
199     !
200    
201     subroutine sax_d_a_a(a,x,y)
202     real(w2f__8), intent(in) :: a
203     type(active), intent(in) :: x
204     type(active), intent(inout) :: y
205     y%d=x%d*a
206     end subroutine sax_d_a_a
207    
208     subroutine sax_i_a_a(a,x,y)
209     integer(kind=w2f__i8), intent(in) :: a
210     type(active), intent(in) :: x
211     type(active), intent(inout) :: y
212     y%d=x%d*a
213     end subroutine sax_i_a_a
214    
215     !
216     ! set derivative of y to be equal to derivative of x
217     ! note: making y inout allows for already existing active
218     ! variables to become the target of a derivative assignment
219     !
220    
221     subroutine setderiv_a_a(y,x)
222     type(active), intent(inout) :: y
223     type(active), intent(in) :: x
224     y%d=x%d
225     end subroutine setderiv_a_a
226    
227     !
228 utke 1.3 ! set the derivative of y to be the negated derivative of x
229     ! note: making y inout allows for already existing active
230     ! variables to become the target of a derivative assignment
231     !
232    
233     subroutine set_neg_deriv_a_a(y,x)
234     type(active), intent(inout) :: y
235     type(active), intent(in) :: x
236     y%d = -x%d
237     end subroutine set_neg_deriv_a_a
238    
239     !
240     ! increment the derivative of y by the derivative of x
241     ! note: making y inout allows for already existing active
242     ! variables to become the target of a derivative assignment
243     !
244    
245     subroutine inc_deriv_a_a(y,x)
246     type(active), intent(inout) :: y
247     type(active), intent(in) :: x
248     y%d = y%d + x%d
249     end subroutine inc_deriv_a_a
250    
251     !
252     ! decrement the derivative of y by the derivative of x
253     ! note: making y inout allows for already existing active
254     ! variables to become the target of a derivative assignment
255     !
256    
257     subroutine dec_deriv_a_a(y,x)
258     type(active), intent(inout) :: y
259     type(active), intent(in) :: x
260     y%d = y%d - x%d
261     end subroutine dec_deriv_a_a
262    
263     !
264 utke 1.1 ! set derivative components to 0.0
265     !
266     subroutine zero_deriv_a(x)
267     type(active), intent(inout) :: x
268     x%d=0.0d0
269     end subroutine zero_deriv_a
270    
271     !
272     ! active/passive conversions
273     !
274 utke 1.2 #ifdef ALLOW_AUTODIFF_MIXED_PRECISION
275 utke 1.1 subroutine convert_a2sp_scalar_impl(convertTo, convertFrom)
276     real(w2f__4), intent(out) :: convertTo
277     type(active), intent(in) :: convertFrom
278     convertTo=convertFrom%v
279     end subroutine
280 utke 1.2 #endif
281 utke 1.1
282     subroutine convert_a2p_scalar_impl(convertTo, convertFrom)
283     real(w2f__8), intent(out) :: convertTo
284     type(active), intent(in) :: convertFrom
285     convertTo=convertFrom%v
286     end subroutine
287    
288 utke 1.2 #ifdef ALLOW_AUTODIFF_MIXED_PRECISION
289 utke 1.1 subroutine convert_sp2a_scalar_impl(convertTo, convertFrom)
290     real(w2f__4), intent(in) :: convertFrom
291     type(active), intent(inout) :: convertTo
292     convertTo%v=convertFrom
293     end subroutine
294 utke 1.2 #endif
295 utke 1.1
296     subroutine convert_p2a_scalar_impl(convertTo, convertFrom)
297     real(w2f__8), intent(in) :: convertFrom
298     type(active), intent(inout) :: convertTo
299     convertTo%v=convertFrom
300     end subroutine
301    
302 utke 1.2 #ifdef ALLOW_AUTODIFF_MIXED_PRECISION
303 utke 1.1 subroutine convert_a2sp_vector_impl(convertTo, convertFrom)
304     type(active), dimension(:), intent(in) :: convertFrom
305     real(w2f__4), dimension(:), intent(out) :: convertTo
306     convertTo=convertFrom%v
307     end subroutine
308 utke 1.2 #endif
309 utke 1.1
310     subroutine convert_a2p_vector_impl(convertTo, convertFrom)
311     type(active), dimension(:), intent(in) :: convertFrom
312     real(w2f__8), dimension(:), intent(out) :: convertTo
313     convertTo=convertFrom%v
314     end subroutine
315    
316 utke 1.2 #ifdef ALLOW_AUTODIFF_MIXED_PRECISION
317 utke 1.1 subroutine convert_sp2a_vector_impl(convertTo, convertFrom)
318     real(w2f__4), dimension(:), intent(in) :: convertFrom
319     type(active), dimension(:), intent(inout) :: convertTo
320     convertTo%v=convertFrom
321     end subroutine
322 utke 1.2 #endif
323 utke 1.1
324     subroutine convert_p2a_vector_impl(convertTo, convertFrom)
325     real(w2f__8), dimension(:), intent(in) :: convertFrom
326     type(active), dimension(:), intent(inout) :: convertTo
327     convertTo%v=convertFrom
328     end subroutine
329    
330 utke 1.2 #ifdef ALLOW_AUTODIFF_MIXED_PRECISION
331 utke 1.1 subroutine convert_a2sp_matrix_impl(convertTo, convertFrom)
332     type(active), dimension(:,:), intent(in) :: convertFrom
333     real(w2f__4), dimension(:,:), intent(out) :: convertTo
334     convertTo=convertFrom%v
335     end subroutine
336 utke 1.2 #endif
337 utke 1.1
338     subroutine convert_a2p_matrix_impl(convertTo, convertFrom)
339     type(active), dimension(:,:), intent(in) :: convertFrom
340     real(w2f__8), dimension(:,:), intent(out) :: convertTo
341     convertTo=convertFrom%v
342     end subroutine
343    
344 utke 1.2 #ifdef ALLOW_AUTODIFF_MIXED_PRECISION
345     subroutine convert_sp2a_matrix_impl(convertTo, convertFrom)
346     real(w2f__4), dimension(:,:), intent(in) :: convertFrom
347     type(active), dimension(:,:), intent(inout) :: convertTo
348     convertTo%v=convertFrom
349     end subroutine
350     #endif
351 utke 1.1 subroutine convert_p2a_matrix_impl(convertTo, convertFrom)
352     real(w2f__8), dimension(:,:), intent(in) :: convertFrom
353     type(active), dimension(:,:), intent(inout) :: convertTo
354     convertTo%v=convertFrom
355     end subroutine
356    
357 utke 1.2 #ifdef ALLOW_AUTODIFF_MIXED_PRECISION
358 utke 1.1 subroutine convert_a2sp_three_tensor_impl(convertTo, convertFrom)
359     type(active), dimension(:,:,:), intent(in) :: convertFrom
360     real(w2f__4), dimension(:,:,:), intent(out) :: convertTo
361     convertTo=convertFrom%v
362     end subroutine
363 utke 1.2 #endif
364 utke 1.1
365     subroutine convert_a2p_three_tensor_impl(convertTo, convertFrom)
366     type(active), dimension(:,:,:), intent(in) :: convertFrom
367     real(w2f__8), dimension(:,:,:), intent(out) :: convertTo
368     convertTo=convertFrom%v
369     end subroutine
370    
371 utke 1.2 #ifdef ALLOW_AUTODIFF_MIXED_PRECISION
372 utke 1.1 subroutine convert_sp2a_three_tensor_impl(convertTo, convertFrom)
373     real(w2f__4), dimension(:,:,:), intent(in) :: convertFrom
374     type(active), dimension(:,:,:), intent(inout) :: convertTo
375     convertTo%v=convertFrom
376     end subroutine
377 utke 1.2 #endif
378 utke 1.1
379     subroutine convert_p2a_three_tensor_impl(convertTo, convertFrom)
380     real(w2f__8), dimension(:,:,:), intent(in) :: convertFrom
381     type(active), dimension(:,:,:), intent(inout) :: convertTo
382     convertTo%v=convertFrom
383     end subroutine
384    
385 utke 1.2 #ifdef ALLOW_AUTODIFF_MIXED_PRECISION
386 utke 1.1 subroutine convert_a2sp_four_tensor_impl(convertTo, convertFrom)
387     type(active), dimension(:,:,:,:), intent(in) :: convertFrom
388     real(w2f__4), dimension(:,:,:,:), intent(out) :: convertTo
389     convertTo=convertFrom%v
390     end subroutine
391 utke 1.2 #endif
392 utke 1.1
393     subroutine convert_a2p_four_tensor_impl(convertTo, convertFrom)
394     type(active), dimension(:,:,:,:), intent(in) :: convertFrom
395     real(w2f__8), dimension(:,:,:,:), intent(out) :: convertTo
396     convertTo=convertFrom%v
397     end subroutine
398    
399 utke 1.2 #ifdef ALLOW_AUTODIFF_MIXED_PRECISION
400 utke 1.1 subroutine convert_sp2a_four_tensor_impl(convertTo, convertFrom)
401     real(w2f__4), dimension(:,:,:,:), intent(in) :: convertFrom
402     type(active), dimension(:,:,:,:), intent(inout) :: convertTo
403     convertTo%v=convertFrom
404     end subroutine
405 utke 1.2 #endif
406 utke 1.1
407     subroutine convert_p2a_four_tensor_impl(convertTo, convertFrom)
408     real(w2f__8), dimension(:,:,:,:), intent(in) :: convertFrom
409     type(active), dimension(:,:,:,:), intent(inout) :: convertTo
410     convertTo%v=convertFrom
411     end subroutine
412    
413 utke 1.2 #ifdef ALLOW_AUTODIFF_MIXED_PRECISION
414 utke 1.1 subroutine convert_a2sp_five_tensor_impl(convertTo, convertFrom)
415     type(active), dimension(:,:,:,:,:), intent(in) :: convertFrom
416     real(w2f__4), dimension(:,:,:,:,:), intent(out) :: convertTo
417     convertTo=convertFrom%v
418     end subroutine
419 utke 1.2 #endif
420 utke 1.1
421     subroutine convert_a2p_five_tensor_impl(convertTo, convertFrom)
422     type(active), dimension(:,:,:,:,:), intent(in) :: convertFrom
423     real(w2f__8), dimension(:,:,:,:,:), intent(out) :: convertTo
424     convertTo=convertFrom%v
425     end subroutine
426    
427 utke 1.2 #ifdef ALLOW_AUTODIFF_MIXED_PRECISION
428 utke 1.1 subroutine convert_sp2a_five_tensor_impl(convertTo, convertFrom)
429     real(w2f__4), dimension(:,:,:,:,:), intent(in) :: convertFrom
430     type(active), dimension(:,:,:,:,:), intent(inout) :: convertTo
431     convertTo%v=convertFrom
432     end subroutine
433 utke 1.2 #endif
434 utke 1.1
435     subroutine convert_p2a_five_tensor_impl(convertTo, convertFrom)
436     real(w2f__8), dimension(:,:,:,:,:), intent(in) :: convertFrom
437     type(active), dimension(:,:,:,:,:), intent(inout) :: convertTo
438     convertTo%v=convertFrom
439     end subroutine
440    
441 utke 1.3 #ifdef ALLOW_AUTODIFF_MIXED_PRECISION
442     subroutine convert_a2sp_six_tensor_impl(convertTo, convertFrom)
443     type(active), dimension(:,:,:,:,:,:), intent(in) :: convertFrom
444     real(w2f__4), dimension(:,:,:,:,:,:), intent(out) :: convertTo
445     convertTo=convertFrom%v
446     end subroutine
447     #endif
448    
449     subroutine convert_a2p_six_tensor_impl(convertTo, convertFrom)
450     type(active), dimension(:,:,:,:,:,:), intent(in) :: convertFrom
451     real(w2f__8), dimension(:,:,:,:,:,:), intent(out) :: convertTo
452     convertTo=convertFrom%v
453     end subroutine
454    
455     #ifdef ALLOW_AUTODIFF_MIXED_PRECISION
456     subroutine convert_sp2a_six_tensor_impl(convertTo, convertFrom)
457     real(w2f__4), dimension(:,:,:,:,:,:), intent(in) :: convertFrom
458     type(active), dimension(:,:,:,:,:,:), intent(inout) :: convertTo
459     convertTo%v=convertFrom
460     end subroutine
461     #endif
462    
463     subroutine convert_p2a_six_tensor_impl(convertTo, convertFrom)
464     real(w2f__8), dimension(:,:,:,:,:,:), intent(in) :: convertFrom
465     type(active), dimension(:,:,:,:,:,:), intent(inout) :: convertTo
466     convertTo%v=convertFrom
467     end subroutine
468    
469     #ifdef ALLOW_AUTODIFF_MIXED_PRECISION
470     subroutine convert_a2sp_seven_tensor_impl(convertTo, convertFrom)
471     type(active), dimension(:,:,:,:,:,:,:), intent(in) :: convertFrom
472     real(w2f__4), dimension(:,:,:,:,:,:,:), intent(out) :: convertTo
473     convertTo=convertFrom%v
474     end subroutine
475     #endif
476    
477     subroutine convert_a2p_seven_tensor_impl(convertTo, convertFrom)
478     type(active), dimension(:,:,:,:,:,:,:), intent(in) :: convertFrom
479     real(w2f__8), dimension(:,:,:,:,:,:,:), intent(out) :: convertTo
480     convertTo=convertFrom%v
481     end subroutine
482    
483     #ifdef ALLOW_AUTODIFF_MIXED_PRECISION
484     subroutine convert_sp2a_seven_tensor_impl(convertTo, convertFrom)
485     real(w2f__4), dimension(:,:,:,:,:,:,:), intent(in) :: convertFrom
486     type(active), dimension(:,:,:,:,:,:,:), intent(inout) :: convertTo
487     convertTo%v=convertFrom
488     end subroutine
489     #endif
490    
491     subroutine convert_p2a_seven_tensor_impl(convertTo, convertFrom)
492     real(w2f__8), dimension(:,:,:,:,:,:,:), intent(in) :: convertFrom
493     type(active), dimension(:,:,:,:,:,:,:), intent(inout) :: convertTo
494     convertTo%v=convertFrom
495     end subroutine
496    
497 utke 1.4 subroutine oad_allocateMatching_av(toBeAllocated,allocateMatching)
498 utke 1.3 implicit none
499     type(active), dimension(:), allocatable :: toBeAllocated
500     type(active), dimension(:) :: allocateMatching
501 utke 1.4 if (.not. allocated(toBeAllocated)) allocate(toBeAllocated(size(allocateMatching)))
502     end subroutine
503    
504     subroutine oad_allocateMatching_pv(toBeAllocated,allocateMatching)
505     implicit none
506     real(w2f__8), dimension(:), allocatable :: toBeAllocated
507     type(active), dimension(:) :: allocateMatching
508     if (.not. allocated(toBeAllocated)) allocate(toBeAllocated(size(allocateMatching)))
509     end subroutine
510    
511     #ifdef ALLOW_AUTODIFF_MIXED_PRECISION
512     subroutine oad_allocateMatching_p4bv(toBeAllocated,allocateMatching)
513     implicit none
514     real(w2f__4), dimension(:), allocatable :: toBeAllocated
515     type(active), dimension(:) :: allocateMatching
516     if (.not. allocated(toBeAllocated)) allocate(toBeAllocated(size(allocateMatching)))
517     end subroutine
518     #endif
519    
520     subroutine oad_allocateMatching_am(toBeAllocated,allocateMatching)
521     implicit none
522     type(active), dimension(:,:), allocatable :: toBeAllocated
523     type(active), dimension(:,:) :: allocateMatching
524     if (.not. allocated(toBeAllocated)) allocate(toBeAllocated(size(allocateMatching,1), &
525     size(allocateMatching,2)))
526     end subroutine
527    
528     subroutine oad_allocateMatching_pm(toBeAllocated,allocateMatching)
529     implicit none
530     real(w2f__8), dimension(:,:), allocatable :: toBeAllocated
531     type(active), dimension(:,:) :: allocateMatching
532     if (.not. allocated(toBeAllocated)) allocate(toBeAllocated(size(allocateMatching,1), &
533     size(allocateMatching,2)))
534     end subroutine
535    
536     #ifdef ALLOW_AUTODIFF_MIXED_PRECISION
537     subroutine oad_allocateMatching_p4bm(toBeAllocated,allocateMatching)
538     implicit none
539     real(w2f__4), dimension(:,:), allocatable :: toBeAllocated
540     type(active), dimension(:,:) :: allocateMatching
541     if (.not. allocated(toBeAllocated)) allocate(toBeAllocated(size(allocateMatching,1), &
542     size(allocateMatching,2)))
543     end subroutine
544     #endif
545    
546     subroutine oad_allocateMatching_at4(toBeAllocated,allocateMatching)
547     implicit none
548     type(active), dimension(:,:,:,:), allocatable :: toBeAllocated
549     type(active), dimension(:,:,:,:) :: allocateMatching
550     if (.not. allocated(toBeAllocated)) allocate(toBeAllocated(size(allocateMatching,1), &
551     size(allocateMatching,2),&
552     size(allocateMatching,3),&
553     size(allocateMatching,4)))
554 utke 1.3 end subroutine
555    
556 utke 1.4 subroutine oad_allocateMatching_pt4(toBeAllocated,allocateMatching)
557     implicit none
558     real(w2f__8), dimension(:,:,:,:), allocatable :: toBeAllocated
559     type(active), dimension(:,:,:,:) :: allocateMatching
560     if (.not. allocated(toBeAllocated)) allocate(toBeAllocated(size(allocateMatching,1), &
561     size(allocateMatching,2),&
562     size(allocateMatching,3),&
563     size(allocateMatching,4)))
564     end subroutine
565    
566     subroutine oad_allocateMatching_at5(toBeAllocated,allocateMatching)
567     implicit none
568     type(active), dimension(:,:,:,:,:), allocatable :: toBeAllocated
569     type(active), dimension(:,:,:,:,:) :: allocateMatching
570     if (.not. allocated(toBeAllocated)) allocate(toBeAllocated(size(allocateMatching,1), &
571     size(allocateMatching,2),&
572     size(allocateMatching,3),&
573     size(allocateMatching,4),&
574     size(allocateMatching,5)))
575     end subroutine
576    
577     subroutine oad_allocateMatching_pt5(toBeAllocated,allocateMatching)
578     implicit none
579     real(w2f__8), dimension(:,:,:,:,:), allocatable :: toBeAllocated
580     type(active), dimension(:,:,:,:,:) :: allocateMatching
581     if (.not. allocated(toBeAllocated)) allocate(toBeAllocated(size(allocateMatching,1), &
582     size(allocateMatching,2),&
583     size(allocateMatching,3),&
584     size(allocateMatching,4),&
585     size(allocateMatching,5)))
586     end subroutine
587 utke 1.1
588 utke 1.4 end module OAD_active

  ViewVC Help
Powered by ViewVC 1.1.22