OpenAD

changeset 269:0a6c115c3825

rename location of no-default-init version and remove reference from openad script at least temporarily until http://trac.mcs.anl.gov/projects/openAD/ticket/179 is fixed. The regression test showing the problem is nested_calls_4.(spurious jacobian entries caused by uninitialized derivative components even in forward mode)
author m_utkej@utke2.site
date Wed Dec 02 13:22:54 2009 -0600 (2009-12-02)
parents e425b4d69437
children 0069d445935e
files bin/openad runTimeSupport/scalarF/OAD_active.f90 runTimeSupport/scalarNDI/OAD_active.f90
line diff
     1.1 --- a/bin/openad	Tue Nov 17 13:19:07 2009 -0600
     1.2 +++ b/bin/openad	Wed Dec 02 13:22:54 2009 -0600
     1.3 @@ -52,7 +52,7 @@
     1.4          if self.mode.major==MajorMode.forward:
     1.5            return os.path.join(os.environ["OPENADROOT"],
     1.6                                "runTimeSupport",
     1.7 -                              "scalarF",
     1.8 +                              "scalar",
     1.9                                "OAD_active.f90")
    1.10          elif self.mode.major==MajorMode.trace:
    1.11            return os.path.join(os.environ["OPENADROOT"],
     2.1 --- a/runTimeSupport/scalarF/OAD_active.f90	Tue Nov 17 13:19:07 2009 -0600
     2.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.3 @@ -1,506 +0,0 @@
     2.4 -!#########################################################
     2.5 -! This file is part of OpenAD released under the LGPL.   #
     2.6 -! The full COPYRIGHT notice can be found in the top      #
     2.7 -! level directory of the OpenAD distribution             #
     2.8 -!#########################################################
     2.9 -        module OAD_active
    2.10 -
    2.11 -        use w2f__types
    2.12 -        implicit none
    2.13 -        private
    2.14 -        public :: active, saxpy, sax, zero_deriv, &
    2.15 -setderiv, set_neg_deriv, inc_deriv, dec_deriv, &
    2.16 -convert_p2a_scalar, convert_a2p_scalar, &
    2.17 -convert_p2a_vector, convert_a2p_vector, &
    2.18 -convert_p2a_matrix, convert_a2p_matrix, &
    2.19 -convert_p2a_three_tensor, convert_a2p_three_tensor, &
    2.20 -convert_p2a_four_tensor, convert_a2p_four_tensor, &
    2.21 -convert_p2a_five_tensor, convert_a2p_five_tensor, & 
    2.22 -convert_p2a_six_tensor, convert_a2p_six_tensor, &
    2.23 -convert_p2a_seven_tensor, convert_a2p_seven_tensor, &
    2.24 -oad_allocateMatching
    2.25 -
    2.26 -        integer :: count_mult = 0
    2.27 -        integer :: count_add = 0
    2.28 -
    2.29 -        !
    2.30 -        ! active needs to be a sequence type
    2.31 -        !  with no initialization
    2.32 -        !
    2.33 -        type active
    2.34 -          sequence
    2.35 -          real(w2f__8) :: v 
    2.36 -          real(w2f__8) :: d
    2.37 -        end type active
    2.38 -
    2.39 -        interface saxpy
    2.40 -          module procedure saxpy_d_a_a, saxpy_i8_a_a, saxpy_i4_a_a
    2.41 -        end interface
    2.42 -        
    2.43 -        interface setderiv
    2.44 -          module procedure setderiv_a_a
    2.45 -          module procedure setderiv_av_av
    2.46 -        end interface
    2.47 -
    2.48 -        interface set_neg_deriv
    2.49 -          module procedure set_neg_deriv_a_a
    2.50 -          module procedure set_neg_deriv_av_av
    2.51 -        end interface set_neg_deriv
    2.52 -
    2.53 -        interface inc_deriv
    2.54 -          module procedure inc_deriv_a_a
    2.55 -          module procedure inc_deriv_av_av
    2.56 -        end interface inc_deriv
    2.57 -
    2.58 -        interface dec_deriv
    2.59 -          module procedure dec_deriv_a_a
    2.60 -          module procedure dec_deriv_av_av
    2.61 -        end interface dec_deriv
    2.62 -
    2.63 -        interface zero_deriv
    2.64 -          module procedure zero_deriv_a
    2.65 -          module procedure zero_deriv_av
    2.66 -          module procedure zero_deriv_am
    2.67 -          module procedure zero_deriv_am3
    2.68 -          module procedure zero_deriv_am4
    2.69 -        end interface
    2.70 -        
    2.71 -        interface sax
    2.72 -          module procedure sax_d_a_a, sax_i8_a_a, sax_i4_a_a
    2.73 -        end interface
    2.74 -
    2.75 -        interface convert_p2a_scalar
    2.76 -          module procedure convert_sp2a_scalar_impl
    2.77 -          module procedure convert_p2a_scalar_impl
    2.78 -        end interface
    2.79 -        interface convert_a2p_scalar
    2.80 -          module procedure convert_a2sp_scalar_impl
    2.81 -          module procedure convert_a2p_scalar_impl
    2.82 -        end interface
    2.83 -
    2.84 -        interface convert_p2a_vector
    2.85 -          module procedure convert_sp2a_vector_impl
    2.86 -          module procedure convert_p2a_vector_impl
    2.87 -        end interface
    2.88 -        interface convert_a2p_vector
    2.89 -          module procedure convert_a2sp_vector_impl
    2.90 -          module procedure convert_a2p_vector_impl
    2.91 -        end interface
    2.92 -
    2.93 -        interface convert_p2a_matrix
    2.94 -          module procedure convert_sp2a_matrix_impl
    2.95 -          module procedure convert_p2a_matrix_impl
    2.96 -        end interface
    2.97 -        interface convert_a2p_matrix
    2.98 -          module procedure convert_a2sp_matrix_impl
    2.99 -          module procedure convert_a2p_matrix_impl
   2.100 -        end interface
   2.101 -
   2.102 -        interface convert_p2a_three_tensor
   2.103 -          module procedure convert_sp2a_three_tensor_impl
   2.104 -          module procedure convert_p2a_three_tensor_impl
   2.105 -        end interface
   2.106 -        interface convert_a2p_three_tensor
   2.107 -          module procedure convert_a2sp_three_tensor_impl
   2.108 -          module procedure convert_a2p_three_tensor_impl
   2.109 -        end interface
   2.110 -
   2.111 -        interface convert_p2a_four_tensor
   2.112 -          module procedure convert_sp2a_four_tensor_impl
   2.113 -          module procedure convert_p2a_four_tensor_impl
   2.114 -        end interface
   2.115 -        interface convert_a2p_four_tensor
   2.116 -          module procedure convert_a2sp_four_tensor_impl
   2.117 -          module procedure convert_a2p_four_tensor_impl
   2.118 -        end interface
   2.119 -
   2.120 -        interface convert_p2a_five_tensor
   2.121 -          module procedure convert_sp2a_five_tensor_impl
   2.122 -          module procedure convert_p2a_five_tensor_impl
   2.123 -        end interface
   2.124 -        interface convert_a2p_five_tensor
   2.125 -          module procedure convert_a2sp_five_tensor_impl
   2.126 -          module procedure convert_a2p_five_tensor_impl
   2.127 -        end interface
   2.128 -
   2.129 -        interface convert_p2a_six_tensor
   2.130 -          module procedure convert_sp2a_six_tensor_impl
   2.131 -          module procedure convert_p2a_six_tensor_impl
   2.132 -        end interface
   2.133 -        interface convert_a2p_six_tensor
   2.134 -          module procedure convert_a2sp_six_tensor_impl
   2.135 -          module procedure convert_a2p_six_tensor_impl
   2.136 -        end interface
   2.137 -
   2.138 -        interface convert_p2a_seven_tensor
   2.139 -          module procedure convert_sp2a_seven_tensor_impl
   2.140 -          module procedure convert_p2a_seven_tensor_impl
   2.141 -        end interface
   2.142 -        interface convert_a2p_seven_tensor
   2.143 -          module procedure convert_a2sp_seven_tensor_impl
   2.144 -          module procedure convert_a2p_seven_tensor_impl
   2.145 -        end interface
   2.146 -
   2.147 -        interface oad_allocateMatching
   2.148 -          module procedure oad_allocateMatchingV
   2.149 -        end interface 
   2.150 -
   2.151 -        contains
   2.152 -        
   2.153 -        !
   2.154 -        ! chain rule saxpy to be used in forward and reverse modes
   2.155 -        !
   2.156 -        
   2.157 -        subroutine saxpy_d_a_a(a,x,y)
   2.158 -          real(w2f__8), intent(in) :: a
   2.159 -          type(active), intent(in) :: x
   2.160 -          type(active), intent(inout) :: y
   2.161 -          y%d=y%d+x%d*a
   2.162 -        end subroutine saxpy_d_a_a
   2.163 -        
   2.164 -        subroutine saxpy_i8_a_a(a,x,y)
   2.165 -          integer(kind=w2f__i8), intent(in) :: a
   2.166 -          type(active), intent(in) :: x
   2.167 -          type(active), intent(inout) :: y
   2.168 -          y%d=y%d+x%d*a
   2.169 -        end subroutine saxpy_i8_a_a
   2.170 -        
   2.171 -        subroutine saxpy_i4_a_a(a,x,y)
   2.172 -          integer(kind=w2f__i4), intent(in) :: a
   2.173 -          type(active), intent(in) :: x
   2.174 -          type(active), intent(inout) :: y
   2.175 -          y%d=y%d+x%d*a
   2.176 -        end subroutine saxpy_i4_a_a
   2.177 -        
   2.178 -        !
   2.179 -        ! chain rule saxpy to be used in forward and reverse modes
   2.180 -        ! derivative component of y is equal to zero initially
   2.181 -        ! note: y needs to be inout as otherwise value component gets
   2.182 -        ! zeroed out
   2.183 -        !
   2.184 -        
   2.185 -        subroutine sax_d_a_a(a,x,y)
   2.186 -          real(w2f__8), intent(in) :: a
   2.187 -          type(active), intent(in) :: x
   2.188 -          type(active), intent(inout) :: y
   2.189 -          y%d=x%d*a
   2.190 -        end subroutine sax_d_a_a
   2.191 -
   2.192 -        subroutine sax_i8_a_a(a,x,y)
   2.193 -          integer(kind=w2f__i8), intent(in) :: a
   2.194 -          type(active), intent(in) :: x
   2.195 -          type(active), intent(inout) :: y
   2.196 -          y%d=x%d*a
   2.197 -        end subroutine sax_i8_a_a
   2.198 -        
   2.199 -        subroutine sax_i4_a_a(a,x,y)
   2.200 -          integer(kind=w2f__i4), intent(in) :: a
   2.201 -          type(active), intent(in) :: x
   2.202 -          type(active), intent(inout) :: y
   2.203 -          y%d=x%d*a
   2.204 -        end subroutine sax_i4_a_a
   2.205 -        
   2.206 -        !
   2.207 -        ! set derivative of y to be equal to derivative of x
   2.208 -        ! note: making y inout allows for already existing active
   2.209 -        ! variables to become the target of a derivative assignment
   2.210 -        !
   2.211 -        
   2.212 -        subroutine setderiv_a_a(y,x)
   2.213 -          type(active), intent(inout) :: y
   2.214 -          type(active), intent(in) :: x
   2.215 -          y%d=x%d
   2.216 -        end subroutine setderiv_a_a
   2.217 -
   2.218 -        subroutine setderiv_av_av(y,x)
   2.219 -          type(active), intent(inout), dimension(:) :: y
   2.220 -          type(active), intent(in), dimension(:) :: x
   2.221 -          y%d=x%d
   2.222 -        end subroutine setderiv_av_av
   2.223 -
   2.224 -        !
   2.225 -        ! set the derivative of y to be the negated derivative of x
   2.226 -        ! note: making y inout allows for already existing active
   2.227 -        ! variables to become the target of a derivative assignment
   2.228 -        !
   2.229 -        
   2.230 -        subroutine set_neg_deriv_a_a(y,x)
   2.231 -          type(active), intent(inout) :: y
   2.232 -          type(active), intent(in) :: x
   2.233 -          y%d = -x%d
   2.234 -        end subroutine set_neg_deriv_a_a
   2.235 -
   2.236 -        subroutine set_neg_deriv_av_av(y,x)
   2.237 -          type(active), intent(inout), dimension(:) :: y
   2.238 -          type(active), intent(in), dimension(:) :: x
   2.239 -          y%d = -x%d
   2.240 -        end subroutine set_neg_deriv_av_av
   2.241 -
   2.242 -        !
   2.243 -        ! increment the derivative of y by the derivative of x
   2.244 -        ! note: making y inout allows for already existing active
   2.245 -        ! variables to become the target of a derivative assignment
   2.246 -        !
   2.247 -        
   2.248 -        subroutine inc_deriv_a_a(y,x)
   2.249 -          type(active), intent(inout) :: y
   2.250 -          type(active), intent(in) :: x
   2.251 -          y%d = y%d + x%d
   2.252 -        end subroutine inc_deriv_a_a
   2.253 -
   2.254 -        subroutine inc_deriv_av_av(y,x)
   2.255 -          type(active), intent(inout), dimension(:) :: y
   2.256 -          type(active), intent(in), dimension(:) :: x
   2.257 -          y%d = y%d + x%d
   2.258 -        end subroutine inc_deriv_av_av
   2.259 -
   2.260 -        !
   2.261 -        ! decrement the derivative of y by the derivative of x
   2.262 -        ! note: making y inout allows for already existing active
   2.263 -        ! variables to become the target of a derivative assignment
   2.264 -        !
   2.265 -        
   2.266 -        subroutine dec_deriv_a_a(y,x)
   2.267 -          type(active), intent(inout) :: y
   2.268 -          type(active), intent(in) :: x
   2.269 -          y%d = y%d - x%d
   2.270 -        end subroutine dec_deriv_a_a
   2.271 -
   2.272 -        subroutine dec_deriv_av_av(y,x)
   2.273 -          type(active), intent(inout), dimension(:) :: y
   2.274 -          type(active), intent(in), dimension(:) :: x
   2.275 -          y%d = y%d - x%d
   2.276 -        end subroutine dec_deriv_av_av
   2.277 -
   2.278 -        !
   2.279 -        ! set derivative components to 0.0
   2.280 -        !
   2.281 -        subroutine zero_deriv_a(x)
   2.282 -          type(active), intent(inout) :: x
   2.283 -          x%d=0.0d0
   2.284 -        end subroutine zero_deriv_a
   2.285 -
   2.286 -        subroutine zero_deriv_av(x)
   2.287 -          type(active), dimension(:), intent(inout) :: x
   2.288 -          x%d=0.0d0
   2.289 -        end subroutine zero_deriv_av
   2.290 -
   2.291 -        subroutine zero_deriv_am(x)
   2.292 -          type(active), dimension(:,:), intent(inout) :: x
   2.293 -          x%d = 0.0d0
   2.294 -        end subroutine zero_deriv_am
   2.295 -
   2.296 -        subroutine zero_deriv_am3(x)
   2.297 -          type(active), dimension(:,:,:), intent(inout) :: x
   2.298 -          x%d = 0.0d0
   2.299 -        end subroutine zero_deriv_am3
   2.300 -
   2.301 -        subroutine zero_deriv_am4(x)
   2.302 -          type(active), dimension(:,:,:,:), intent(inout) :: x
   2.303 -          x%d = 0.0d0
   2.304 -        end subroutine zero_deriv_am4
   2.305 -
   2.306 -        !
   2.307 -        ! active/passive conversions
   2.308 -        !
   2.309 -        subroutine convert_a2sp_scalar_impl(convertTo, convertFrom)
   2.310 -          real(w2f__4), intent(out) :: convertTo
   2.311 -          type(active), intent(in) :: convertFrom
   2.312 -          convertTo=convertFrom%v
   2.313 -        end subroutine
   2.314 -
   2.315 -        subroutine convert_a2p_scalar_impl(convertTo, convertFrom)
   2.316 -          real(w2f__8), intent(out) :: convertTo
   2.317 -          type(active), intent(in) :: convertFrom
   2.318 -          convertTo=convertFrom%v
   2.319 -        end subroutine
   2.320 -
   2.321 -        subroutine convert_sp2a_scalar_impl(convertTo, convertFrom)
   2.322 -          real(w2f__4), intent(in) :: convertFrom
   2.323 -          type(active), intent(inout) :: convertTo
   2.324 -          convertTo%v=convertFrom
   2.325 -        end subroutine 
   2.326 -
   2.327 -        subroutine convert_p2a_scalar_impl(convertTo, convertFrom)
   2.328 -          real(w2f__8), intent(in) :: convertFrom
   2.329 -          type(active), intent(inout) :: convertTo
   2.330 -          convertTo%v=convertFrom
   2.331 -        end subroutine 
   2.332 -
   2.333 -        subroutine convert_a2sp_vector_impl(convertTo, convertFrom)
   2.334 -          type(active), dimension(:), intent(in) :: convertFrom
   2.335 -          real(w2f__4), dimension(:), intent(out) :: convertTo
   2.336 -          convertTo=convertFrom%v
   2.337 -        end subroutine
   2.338 -
   2.339 -        subroutine convert_a2p_vector_impl(convertTo, convertFrom)
   2.340 -          type(active), dimension(:), intent(in) :: convertFrom
   2.341 -          real(w2f__8), dimension(:), intent(out) :: convertTo
   2.342 -          convertTo=convertFrom%v
   2.343 -        end subroutine
   2.344 -
   2.345 -        subroutine convert_sp2a_vector_impl(convertTo, convertFrom)
   2.346 -          real(w2f__4), dimension(:), intent(in) :: convertFrom
   2.347 -          type(active), dimension(:), intent(inout) :: convertTo
   2.348 -          convertTo%v=convertFrom
   2.349 -        end subroutine
   2.350 -
   2.351 -        subroutine convert_p2a_vector_impl(convertTo, convertFrom)
   2.352 -          real(w2f__8), dimension(:), intent(in) :: convertFrom
   2.353 -          type(active), dimension(:), intent(inout) :: convertTo
   2.354 -          convertTo%v=convertFrom
   2.355 -        end subroutine
   2.356 -
   2.357 -        subroutine convert_a2sp_matrix_impl(convertTo, convertFrom)
   2.358 -          type(active), dimension(:,:), intent(in) :: convertFrom
   2.359 -          real(w2f__4), dimension(:,:), intent(out) :: convertTo
   2.360 -          convertTo=convertFrom%v
   2.361 -        end subroutine
   2.362 -
   2.363 -        subroutine convert_sp2a_matrix_impl(convertTo, convertFrom)
   2.364 -          real(w2f__4), dimension(:,:), intent(in) :: convertFrom
   2.365 -          type(active), dimension(:,:), intent(inout) :: convertTo
   2.366 -          convertTo%v=convertFrom
   2.367 -        end subroutine
   2.368 -
   2.369 -        subroutine convert_a2p_matrix_impl(convertTo, convertFrom)
   2.370 -          type(active), dimension(:,:), intent(in) :: convertFrom
   2.371 -          real(w2f__8), dimension(:,:), intent(out) :: convertTo
   2.372 -          convertTo=convertFrom%v
   2.373 -        end subroutine
   2.374 -
   2.375 -        subroutine convert_p2a_matrix_impl(convertTo, convertFrom)
   2.376 -          real(w2f__8), dimension(:,:), intent(in) :: convertFrom
   2.377 -          type(active), dimension(:,:), intent(inout) :: convertTo
   2.378 -          convertTo%v=convertFrom
   2.379 -        end subroutine
   2.380 -
   2.381 -        subroutine convert_a2sp_three_tensor_impl(convertTo, convertFrom)
   2.382 -          type(active), dimension(:,:,:), intent(in) :: convertFrom
   2.383 -          real(w2f__4), dimension(:,:,:), intent(out) :: convertTo
   2.384 -          convertTo=convertFrom%v
   2.385 -        end subroutine
   2.386 -
   2.387 -        subroutine convert_a2p_three_tensor_impl(convertTo, convertFrom)
   2.388 -          type(active), dimension(:,:,:), intent(in) :: convertFrom
   2.389 -          real(w2f__8), dimension(:,:,:), intent(out) :: convertTo
   2.390 -          convertTo=convertFrom%v
   2.391 -        end subroutine
   2.392 -
   2.393 -        subroutine convert_sp2a_three_tensor_impl(convertTo, convertFrom)
   2.394 -          real(w2f__4), dimension(:,:,:), intent(in) :: convertFrom
   2.395 -          type(active), dimension(:,:,:), intent(inout) :: convertTo
   2.396 -          convertTo%v=convertFrom
   2.397 -        end subroutine
   2.398 -        
   2.399 -        subroutine convert_p2a_three_tensor_impl(convertTo, convertFrom)
   2.400 -          real(w2f__8), dimension(:,:,:), intent(in) :: convertFrom
   2.401 -          type(active), dimension(:,:,:), intent(inout) :: convertTo
   2.402 -          convertTo%v=convertFrom
   2.403 -        end subroutine
   2.404 -        
   2.405 -        subroutine convert_a2sp_four_tensor_impl(convertTo, convertFrom)
   2.406 -          type(active), dimension(:,:,:,:), intent(in) :: convertFrom
   2.407 -          real(w2f__4), dimension(:,:,:,:), intent(out) :: convertTo
   2.408 -          convertTo=convertFrom%v
   2.409 -        end subroutine
   2.410 -
   2.411 -        subroutine convert_a2p_four_tensor_impl(convertTo, convertFrom)
   2.412 -          type(active), dimension(:,:,:,:), intent(in) :: convertFrom
   2.413 -          real(w2f__8), dimension(:,:,:,:), intent(out) :: convertTo
   2.414 -          convertTo=convertFrom%v
   2.415 -        end subroutine
   2.416 -
   2.417 -        subroutine convert_sp2a_four_tensor_impl(convertTo, convertFrom)
   2.418 -          real(w2f__4), dimension(:,:,:,:), intent(in) :: convertFrom
   2.419 -          type(active), dimension(:,:,:,:), intent(inout) :: convertTo
   2.420 -          convertTo%v=convertFrom
   2.421 -        end subroutine
   2.422 -
   2.423 -        subroutine convert_p2a_four_tensor_impl(convertTo, convertFrom)
   2.424 -          real(w2f__8), dimension(:,:,:,:), intent(in) :: convertFrom
   2.425 -          type(active), dimension(:,:,:,:), intent(inout) :: convertTo
   2.426 -          convertTo%v=convertFrom
   2.427 -        end subroutine
   2.428 -
   2.429 -        subroutine convert_a2sp_five_tensor_impl(convertTo, convertFrom)
   2.430 -          type(active), dimension(:,:,:,:,:), intent(in) :: convertFrom
   2.431 -          real(w2f__4), dimension(:,:,:,:,:), intent(out) :: convertTo
   2.432 -          convertTo=convertFrom%v
   2.433 -        end subroutine
   2.434 -
   2.435 -        subroutine convert_a2p_five_tensor_impl(convertTo, convertFrom)
   2.436 -          type(active), dimension(:,:,:,:,:), intent(in) :: convertFrom
   2.437 -          real(w2f__8), dimension(:,:,:,:,:), intent(out) :: convertTo
   2.438 -          convertTo=convertFrom%v
   2.439 -        end subroutine
   2.440 -
   2.441 -        subroutine convert_sp2a_five_tensor_impl(convertTo, convertFrom)
   2.442 -          real(w2f__4), dimension(:,:,:,:,:), intent(in) :: convertFrom
   2.443 -          type(active), dimension(:,:,:,:,:), intent(inout) :: convertTo
   2.444 -          convertTo%v=convertFrom
   2.445 -        end subroutine
   2.446 -
   2.447 -        subroutine convert_p2a_five_tensor_impl(convertTo, convertFrom)
   2.448 -          real(w2f__8), dimension(:,:,:,:,:), intent(in) :: convertFrom
   2.449 -          type(active), dimension(:,:,:,:,:), intent(inout) :: convertTo
   2.450 -          convertTo%v=convertFrom
   2.451 -        end subroutine
   2.452 -        
   2.453 -        subroutine convert_a2sp_six_tensor_impl(convertTo, convertFrom)
   2.454 -          type(active), dimension(:,:,:,:,:,:), intent(in) :: convertFrom
   2.455 -          real(w2f__4), dimension(:,:,:,:,:,:), intent(out) :: convertTo
   2.456 -          convertTo=convertFrom%v
   2.457 -        end subroutine
   2.458 -
   2.459 -        subroutine convert_a2p_six_tensor_impl(convertTo, convertFrom)
   2.460 -          type(active), dimension(:,:,:,:,:,:), intent(in) :: convertFrom
   2.461 -          real(w2f__8), dimension(:,:,:,:,:,:), intent(out) :: convertTo
   2.462 -          convertTo=convertFrom%v
   2.463 -        end subroutine
   2.464 -
   2.465 -        subroutine convert_sp2a_six_tensor_impl(convertTo, convertFrom)
   2.466 -          real(w2f__4), dimension(:,:,:,:,:,:), intent(in) :: convertFrom
   2.467 -          type(active), dimension(:,:,:,:,:,:), intent(inout) :: convertTo
   2.468 -          convertTo%v=convertFrom
   2.469 -        end subroutine
   2.470 -
   2.471 -        subroutine convert_p2a_six_tensor_impl(convertTo, convertFrom)
   2.472 -          real(w2f__8), dimension(:,:,:,:,:,:), intent(in) :: convertFrom
   2.473 -          type(active), dimension(:,:,:,:,:,:), intent(inout) :: convertTo
   2.474 -          convertTo%v=convertFrom
   2.475 -        end subroutine
   2.476 -        
   2.477 -        subroutine convert_a2sp_seven_tensor_impl(convertTo, convertFrom)
   2.478 -          type(active), dimension(:,:,:,:,:,:,:), intent(in) :: convertFrom
   2.479 -          real(w2f__4), dimension(:,:,:,:,:,:,:), intent(out) :: convertTo
   2.480 -          convertTo=convertFrom%v
   2.481 -        end subroutine
   2.482 -
   2.483 -        subroutine convert_a2p_seven_tensor_impl(convertTo, convertFrom)
   2.484 -          type(active), dimension(:,:,:,:,:,:,:), intent(in) :: convertFrom
   2.485 -          real(w2f__8), dimension(:,:,:,:,:,:,:), intent(out) :: convertTo
   2.486 -          convertTo=convertFrom%v
   2.487 -        end subroutine
   2.488 -
   2.489 -        subroutine convert_sp2a_seven_tensor_impl(convertTo, convertFrom)
   2.490 -          real(w2f__4), dimension(:,:,:,:,:,:,:), intent(in) :: convertFrom
   2.491 -          type(active), dimension(:,:,:,:,:,:,:), intent(inout) :: convertTo
   2.492 -          convertTo%v=convertFrom
   2.493 -        end subroutine
   2.494 -
   2.495 -        subroutine convert_p2a_seven_tensor_impl(convertTo, convertFrom)
   2.496 -          real(w2f__8), dimension(:,:,:,:,:,:,:), intent(in) :: convertFrom
   2.497 -          type(active), dimension(:,:,:,:,:,:,:), intent(inout) :: convertTo
   2.498 -          convertTo%v=convertFrom
   2.499 -        end subroutine
   2.500 -
   2.501 -        subroutine oad_allocateMatchingV(toBeAllocated,allocateMatching)
   2.502 -          implicit none
   2.503 -          type(active), dimension(:), allocatable :: toBeAllocated
   2.504 -          type(active), dimension(:) :: allocateMatching
   2.505 -          allocate(toBeAllocated(size(allocateMatching)));
   2.506 -        end subroutine
   2.507 -
   2.508 -        end module OAD_active
   2.509 -
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/runTimeSupport/scalarNDI/OAD_active.f90	Wed Dec 02 13:22:54 2009 -0600
     3.3 @@ -0,0 +1,506 @@
     3.4 +!#########################################################
     3.5 +! This file is part of OpenAD released under the LGPL.   #
     3.6 +! The full COPYRIGHT notice can be found in the top      #
     3.7 +! level directory of the OpenAD distribution             #
     3.8 +!#########################################################
     3.9 +        module OAD_active
    3.10 +
    3.11 +        use w2f__types
    3.12 +        implicit none
    3.13 +        private
    3.14 +        public :: active, saxpy, sax, zero_deriv, &
    3.15 +setderiv, set_neg_deriv, inc_deriv, dec_deriv, &
    3.16 +convert_p2a_scalar, convert_a2p_scalar, &
    3.17 +convert_p2a_vector, convert_a2p_vector, &
    3.18 +convert_p2a_matrix, convert_a2p_matrix, &
    3.19 +convert_p2a_three_tensor, convert_a2p_three_tensor, &
    3.20 +convert_p2a_four_tensor, convert_a2p_four_tensor, &
    3.21 +convert_p2a_five_tensor, convert_a2p_five_tensor, & 
    3.22 +convert_p2a_six_tensor, convert_a2p_six_tensor, &
    3.23 +convert_p2a_seven_tensor, convert_a2p_seven_tensor, &
    3.24 +oad_allocateMatching
    3.25 +
    3.26 +        integer :: count_mult = 0
    3.27 +        integer :: count_add = 0
    3.28 +
    3.29 +        !
    3.30 +        ! active needs to be a sequence type
    3.31 +        !  with no initialization
    3.32 +        !
    3.33 +        type active
    3.34 +          sequence
    3.35 +          real(w2f__8) :: v 
    3.36 +          real(w2f__8) :: d
    3.37 +        end type active
    3.38 +
    3.39 +        interface saxpy
    3.40 +          module procedure saxpy_d_a_a, saxpy_i8_a_a, saxpy_i4_a_a
    3.41 +        end interface
    3.42 +        
    3.43 +        interface setderiv
    3.44 +          module procedure setderiv_a_a
    3.45 +          module procedure setderiv_av_av
    3.46 +        end interface
    3.47 +
    3.48 +        interface set_neg_deriv
    3.49 +          module procedure set_neg_deriv_a_a
    3.50 +          module procedure set_neg_deriv_av_av
    3.51 +        end interface set_neg_deriv
    3.52 +
    3.53 +        interface inc_deriv
    3.54 +          module procedure inc_deriv_a_a
    3.55 +          module procedure inc_deriv_av_av
    3.56 +        end interface inc_deriv
    3.57 +
    3.58 +        interface dec_deriv
    3.59 +          module procedure dec_deriv_a_a
    3.60 +          module procedure dec_deriv_av_av
    3.61 +        end interface dec_deriv
    3.62 +
    3.63 +        interface zero_deriv
    3.64 +          module procedure zero_deriv_a
    3.65 +          module procedure zero_deriv_av
    3.66 +          module procedure zero_deriv_am
    3.67 +          module procedure zero_deriv_am3
    3.68 +          module procedure zero_deriv_am4
    3.69 +        end interface
    3.70 +        
    3.71 +        interface sax
    3.72 +          module procedure sax_d_a_a, sax_i8_a_a, sax_i4_a_a
    3.73 +        end interface
    3.74 +
    3.75 +        interface convert_p2a_scalar
    3.76 +          module procedure convert_sp2a_scalar_impl
    3.77 +          module procedure convert_p2a_scalar_impl
    3.78 +        end interface
    3.79 +        interface convert_a2p_scalar
    3.80 +          module procedure convert_a2sp_scalar_impl
    3.81 +          module procedure convert_a2p_scalar_impl
    3.82 +        end interface
    3.83 +
    3.84 +        interface convert_p2a_vector
    3.85 +          module procedure convert_sp2a_vector_impl
    3.86 +          module procedure convert_p2a_vector_impl
    3.87 +        end interface
    3.88 +        interface convert_a2p_vector
    3.89 +          module procedure convert_a2sp_vector_impl
    3.90 +          module procedure convert_a2p_vector_impl
    3.91 +        end interface
    3.92 +
    3.93 +        interface convert_p2a_matrix
    3.94 +          module procedure convert_sp2a_matrix_impl
    3.95 +          module procedure convert_p2a_matrix_impl
    3.96 +        end interface
    3.97 +        interface convert_a2p_matrix
    3.98 +          module procedure convert_a2sp_matrix_impl
    3.99 +          module procedure convert_a2p_matrix_impl
   3.100 +        end interface
   3.101 +
   3.102 +        interface convert_p2a_three_tensor
   3.103 +          module procedure convert_sp2a_three_tensor_impl
   3.104 +          module procedure convert_p2a_three_tensor_impl
   3.105 +        end interface
   3.106 +        interface convert_a2p_three_tensor
   3.107 +          module procedure convert_a2sp_three_tensor_impl
   3.108 +          module procedure convert_a2p_three_tensor_impl
   3.109 +        end interface
   3.110 +
   3.111 +        interface convert_p2a_four_tensor
   3.112 +          module procedure convert_sp2a_four_tensor_impl
   3.113 +          module procedure convert_p2a_four_tensor_impl
   3.114 +        end interface
   3.115 +        interface convert_a2p_four_tensor
   3.116 +          module procedure convert_a2sp_four_tensor_impl
   3.117 +          module procedure convert_a2p_four_tensor_impl
   3.118 +        end interface
   3.119 +
   3.120 +        interface convert_p2a_five_tensor
   3.121 +          module procedure convert_sp2a_five_tensor_impl
   3.122 +          module procedure convert_p2a_five_tensor_impl
   3.123 +        end interface
   3.124 +        interface convert_a2p_five_tensor
   3.125 +          module procedure convert_a2sp_five_tensor_impl
   3.126 +          module procedure convert_a2p_five_tensor_impl
   3.127 +        end interface
   3.128 +
   3.129 +        interface convert_p2a_six_tensor
   3.130 +          module procedure convert_sp2a_six_tensor_impl
   3.131 +          module procedure convert_p2a_six_tensor_impl
   3.132 +        end interface
   3.133 +        interface convert_a2p_six_tensor
   3.134 +          module procedure convert_a2sp_six_tensor_impl
   3.135 +          module procedure convert_a2p_six_tensor_impl
   3.136 +        end interface
   3.137 +
   3.138 +        interface convert_p2a_seven_tensor
   3.139 +          module procedure convert_sp2a_seven_tensor_impl
   3.140 +          module procedure convert_p2a_seven_tensor_impl
   3.141 +        end interface
   3.142 +        interface convert_a2p_seven_tensor
   3.143 +          module procedure convert_a2sp_seven_tensor_impl
   3.144 +          module procedure convert_a2p_seven_tensor_impl
   3.145 +        end interface
   3.146 +
   3.147 +        interface oad_allocateMatching
   3.148 +          module procedure oad_allocateMatchingV
   3.149 +        end interface 
   3.150 +
   3.151 +        contains
   3.152 +        
   3.153 +        !
   3.154 +        ! chain rule saxpy to be used in forward and reverse modes
   3.155 +        !
   3.156 +        
   3.157 +        subroutine saxpy_d_a_a(a,x,y)
   3.158 +          real(w2f__8), intent(in) :: a
   3.159 +          type(active), intent(in) :: x
   3.160 +          type(active), intent(inout) :: y
   3.161 +          y%d=y%d+x%d*a
   3.162 +        end subroutine saxpy_d_a_a
   3.163 +        
   3.164 +        subroutine saxpy_i8_a_a(a,x,y)
   3.165 +          integer(kind=w2f__i8), intent(in) :: a
   3.166 +          type(active), intent(in) :: x
   3.167 +          type(active), intent(inout) :: y
   3.168 +          y%d=y%d+x%d*a
   3.169 +        end subroutine saxpy_i8_a_a
   3.170 +        
   3.171 +        subroutine saxpy_i4_a_a(a,x,y)
   3.172 +          integer(kind=w2f__i4), intent(in) :: a
   3.173 +          type(active), intent(in) :: x
   3.174 +          type(active), intent(inout) :: y
   3.175 +          y%d=y%d+x%d*a
   3.176 +        end subroutine saxpy_i4_a_a
   3.177 +        
   3.178 +        !
   3.179 +        ! chain rule saxpy to be used in forward and reverse modes
   3.180 +        ! derivative component of y is equal to zero initially
   3.181 +        ! note: y needs to be inout as otherwise value component gets
   3.182 +        ! zeroed out
   3.183 +        !
   3.184 +        
   3.185 +        subroutine sax_d_a_a(a,x,y)
   3.186 +          real(w2f__8), intent(in) :: a
   3.187 +          type(active), intent(in) :: x
   3.188 +          type(active), intent(inout) :: y
   3.189 +          y%d=x%d*a
   3.190 +        end subroutine sax_d_a_a
   3.191 +
   3.192 +        subroutine sax_i8_a_a(a,x,y)
   3.193 +          integer(kind=w2f__i8), intent(in) :: a
   3.194 +          type(active), intent(in) :: x
   3.195 +          type(active), intent(inout) :: y
   3.196 +          y%d=x%d*a
   3.197 +        end subroutine sax_i8_a_a
   3.198 +        
   3.199 +        subroutine sax_i4_a_a(a,x,y)
   3.200 +          integer(kind=w2f__i4), intent(in) :: a
   3.201 +          type(active), intent(in) :: x
   3.202 +          type(active), intent(inout) :: y
   3.203 +          y%d=x%d*a
   3.204 +        end subroutine sax_i4_a_a
   3.205 +        
   3.206 +        !
   3.207 +        ! set derivative of y to be equal to derivative of x
   3.208 +        ! note: making y inout allows for already existing active
   3.209 +        ! variables to become the target of a derivative assignment
   3.210 +        !
   3.211 +        
   3.212 +        subroutine setderiv_a_a(y,x)
   3.213 +          type(active), intent(inout) :: y
   3.214 +          type(active), intent(in) :: x
   3.215 +          y%d=x%d
   3.216 +        end subroutine setderiv_a_a
   3.217 +
   3.218 +        subroutine setderiv_av_av(y,x)
   3.219 +          type(active), intent(inout), dimension(:) :: y
   3.220 +          type(active), intent(in), dimension(:) :: x
   3.221 +          y%d=x%d
   3.222 +        end subroutine setderiv_av_av
   3.223 +
   3.224 +        !
   3.225 +        ! set the derivative of y to be the negated derivative of x
   3.226 +        ! note: making y inout allows for already existing active
   3.227 +        ! variables to become the target of a derivative assignment
   3.228 +        !
   3.229 +        
   3.230 +        subroutine set_neg_deriv_a_a(y,x)
   3.231 +          type(active), intent(inout) :: y
   3.232 +          type(active), intent(in) :: x
   3.233 +          y%d = -x%d
   3.234 +        end subroutine set_neg_deriv_a_a
   3.235 +
   3.236 +        subroutine set_neg_deriv_av_av(y,x)
   3.237 +          type(active), intent(inout), dimension(:) :: y
   3.238 +          type(active), intent(in), dimension(:) :: x
   3.239 +          y%d = -x%d
   3.240 +        end subroutine set_neg_deriv_av_av
   3.241 +
   3.242 +        !
   3.243 +        ! increment the derivative of y by the derivative of x
   3.244 +        ! note: making y inout allows for already existing active
   3.245 +        ! variables to become the target of a derivative assignment
   3.246 +        !
   3.247 +        
   3.248 +        subroutine inc_deriv_a_a(y,x)
   3.249 +          type(active), intent(inout) :: y
   3.250 +          type(active), intent(in) :: x
   3.251 +          y%d = y%d + x%d
   3.252 +        end subroutine inc_deriv_a_a
   3.253 +
   3.254 +        subroutine inc_deriv_av_av(y,x)
   3.255 +          type(active), intent(inout), dimension(:) :: y
   3.256 +          type(active), intent(in), dimension(:) :: x
   3.257 +          y%d = y%d + x%d
   3.258 +        end subroutine inc_deriv_av_av
   3.259 +
   3.260 +        !
   3.261 +        ! decrement the derivative of y by the derivative of x
   3.262 +        ! note: making y inout allows for already existing active
   3.263 +        ! variables to become the target of a derivative assignment
   3.264 +        !
   3.265 +        
   3.266 +        subroutine dec_deriv_a_a(y,x)
   3.267 +          type(active), intent(inout) :: y
   3.268 +          type(active), intent(in) :: x
   3.269 +          y%d = y%d - x%d
   3.270 +        end subroutine dec_deriv_a_a
   3.271 +
   3.272 +        subroutine dec_deriv_av_av(y,x)
   3.273 +          type(active), intent(inout), dimension(:) :: y
   3.274 +          type(active), intent(in), dimension(:) :: x
   3.275 +          y%d = y%d - x%d
   3.276 +        end subroutine dec_deriv_av_av
   3.277 +
   3.278 +        !
   3.279 +        ! set derivative components to 0.0
   3.280 +        !
   3.281 +        subroutine zero_deriv_a(x)
   3.282 +          type(active), intent(inout) :: x
   3.283 +          x%d=0.0d0
   3.284 +        end subroutine zero_deriv_a
   3.285 +
   3.286 +        subroutine zero_deriv_av(x)
   3.287 +          type(active), dimension(:), intent(inout) :: x
   3.288 +          x%d=0.0d0
   3.289 +        end subroutine zero_deriv_av
   3.290 +
   3.291 +        subroutine zero_deriv_am(x)
   3.292 +          type(active), dimension(:,:), intent(inout) :: x
   3.293 +          x%d = 0.0d0
   3.294 +        end subroutine zero_deriv_am
   3.295 +
   3.296 +        subroutine zero_deriv_am3(x)
   3.297 +          type(active), dimension(:,:,:), intent(inout) :: x
   3.298 +          x%d = 0.0d0
   3.299 +        end subroutine zero_deriv_am3
   3.300 +
   3.301 +        subroutine zero_deriv_am4(x)
   3.302 +          type(active), dimension(:,:,:,:), intent(inout) :: x
   3.303 +          x%d = 0.0d0
   3.304 +        end subroutine zero_deriv_am4
   3.305 +
   3.306 +        !
   3.307 +        ! active/passive conversions
   3.308 +        !
   3.309 +        subroutine convert_a2sp_scalar_impl(convertTo, convertFrom)
   3.310 +          real(w2f__4), intent(out) :: convertTo
   3.311 +          type(active), intent(in) :: convertFrom
   3.312 +          convertTo=convertFrom%v
   3.313 +        end subroutine
   3.314 +
   3.315 +        subroutine convert_a2p_scalar_impl(convertTo, convertFrom)
   3.316 +          real(w2f__8), intent(out) :: convertTo
   3.317 +          type(active), intent(in) :: convertFrom
   3.318 +          convertTo=convertFrom%v
   3.319 +        end subroutine
   3.320 +
   3.321 +        subroutine convert_sp2a_scalar_impl(convertTo, convertFrom)
   3.322 +          real(w2f__4), intent(in) :: convertFrom
   3.323 +          type(active), intent(inout) :: convertTo
   3.324 +          convertTo%v=convertFrom
   3.325 +        end subroutine 
   3.326 +
   3.327 +        subroutine convert_p2a_scalar_impl(convertTo, convertFrom)
   3.328 +          real(w2f__8), intent(in) :: convertFrom
   3.329 +          type(active), intent(inout) :: convertTo
   3.330 +          convertTo%v=convertFrom
   3.331 +        end subroutine 
   3.332 +
   3.333 +        subroutine convert_a2sp_vector_impl(convertTo, convertFrom)
   3.334 +          type(active), dimension(:), intent(in) :: convertFrom
   3.335 +          real(w2f__4), dimension(:), intent(out) :: convertTo
   3.336 +          convertTo=convertFrom%v
   3.337 +        end subroutine
   3.338 +
   3.339 +        subroutine convert_a2p_vector_impl(convertTo, convertFrom)
   3.340 +          type(active), dimension(:), intent(in) :: convertFrom
   3.341 +          real(w2f__8), dimension(:), intent(out) :: convertTo
   3.342 +          convertTo=convertFrom%v
   3.343 +        end subroutine
   3.344 +
   3.345 +        subroutine convert_sp2a_vector_impl(convertTo, convertFrom)
   3.346 +          real(w2f__4), dimension(:), intent(in) :: convertFrom
   3.347 +          type(active), dimension(:), intent(inout) :: convertTo
   3.348 +          convertTo%v=convertFrom
   3.349 +        end subroutine
   3.350 +
   3.351 +        subroutine convert_p2a_vector_impl(convertTo, convertFrom)
   3.352 +          real(w2f__8), dimension(:), intent(in) :: convertFrom
   3.353 +          type(active), dimension(:), intent(inout) :: convertTo
   3.354 +          convertTo%v=convertFrom
   3.355 +        end subroutine
   3.356 +
   3.357 +        subroutine convert_a2sp_matrix_impl(convertTo, convertFrom)
   3.358 +          type(active), dimension(:,:), intent(in) :: convertFrom
   3.359 +          real(w2f__4), dimension(:,:), intent(out) :: convertTo
   3.360 +          convertTo=convertFrom%v
   3.361 +        end subroutine
   3.362 +
   3.363 +        subroutine convert_sp2a_matrix_impl(convertTo, convertFrom)
   3.364 +          real(w2f__4), dimension(:,:), intent(in) :: convertFrom
   3.365 +          type(active), dimension(:,:), intent(inout) :: convertTo
   3.366 +          convertTo%v=convertFrom
   3.367 +        end subroutine
   3.368 +
   3.369 +        subroutine convert_a2p_matrix_impl(convertTo, convertFrom)
   3.370 +          type(active), dimension(:,:), intent(in) :: convertFrom
   3.371 +          real(w2f__8), dimension(:,:), intent(out) :: convertTo
   3.372 +          convertTo=convertFrom%v
   3.373 +        end subroutine
   3.374 +
   3.375 +        subroutine convert_p2a_matrix_impl(convertTo, convertFrom)
   3.376 +          real(w2f__8), dimension(:,:), intent(in) :: convertFrom
   3.377 +          type(active), dimension(:,:), intent(inout) :: convertTo
   3.378 +          convertTo%v=convertFrom
   3.379 +        end subroutine
   3.380 +
   3.381 +        subroutine convert_a2sp_three_tensor_impl(convertTo, convertFrom)
   3.382 +          type(active), dimension(:,:,:), intent(in) :: convertFrom
   3.383 +          real(w2f__4), dimension(:,:,:), intent(out) :: convertTo
   3.384 +          convertTo=convertFrom%v
   3.385 +        end subroutine
   3.386 +
   3.387 +        subroutine convert_a2p_three_tensor_impl(convertTo, convertFrom)
   3.388 +          type(active), dimension(:,:,:), intent(in) :: convertFrom
   3.389 +          real(w2f__8), dimension(:,:,:), intent(out) :: convertTo
   3.390 +          convertTo=convertFrom%v
   3.391 +        end subroutine
   3.392 +
   3.393 +        subroutine convert_sp2a_three_tensor_impl(convertTo, convertFrom)
   3.394 +          real(w2f__4), dimension(:,:,:), intent(in) :: convertFrom
   3.395 +          type(active), dimension(:,:,:), intent(inout) :: convertTo
   3.396 +          convertTo%v=convertFrom
   3.397 +        end subroutine
   3.398 +        
   3.399 +        subroutine convert_p2a_three_tensor_impl(convertTo, convertFrom)
   3.400 +          real(w2f__8), dimension(:,:,:), intent(in) :: convertFrom
   3.401 +          type(active), dimension(:,:,:), intent(inout) :: convertTo
   3.402 +          convertTo%v=convertFrom
   3.403 +        end subroutine
   3.404 +        
   3.405 +        subroutine convert_a2sp_four_tensor_impl(convertTo, convertFrom)
   3.406 +          type(active), dimension(:,:,:,:), intent(in) :: convertFrom
   3.407 +          real(w2f__4), dimension(:,:,:,:), intent(out) :: convertTo
   3.408 +          convertTo=convertFrom%v
   3.409 +        end subroutine
   3.410 +
   3.411 +        subroutine convert_a2p_four_tensor_impl(convertTo, convertFrom)
   3.412 +          type(active), dimension(:,:,:,:), intent(in) :: convertFrom
   3.413 +          real(w2f__8), dimension(:,:,:,:), intent(out) :: convertTo
   3.414 +          convertTo=convertFrom%v
   3.415 +        end subroutine
   3.416 +
   3.417 +        subroutine convert_sp2a_four_tensor_impl(convertTo, convertFrom)
   3.418 +          real(w2f__4), dimension(:,:,:,:), intent(in) :: convertFrom
   3.419 +          type(active), dimension(:,:,:,:), intent(inout) :: convertTo
   3.420 +          convertTo%v=convertFrom
   3.421 +        end subroutine
   3.422 +
   3.423 +        subroutine convert_p2a_four_tensor_impl(convertTo, convertFrom)
   3.424 +          real(w2f__8), dimension(:,:,:,:), intent(in) :: convertFrom
   3.425 +          type(active), dimension(:,:,:,:), intent(inout) :: convertTo
   3.426 +          convertTo%v=convertFrom
   3.427 +        end subroutine
   3.428 +
   3.429 +        subroutine convert_a2sp_five_tensor_impl(convertTo, convertFrom)
   3.430 +          type(active), dimension(:,:,:,:,:), intent(in) :: convertFrom
   3.431 +          real(w2f__4), dimension(:,:,:,:,:), intent(out) :: convertTo
   3.432 +          convertTo=convertFrom%v
   3.433 +        end subroutine
   3.434 +
   3.435 +        subroutine convert_a2p_five_tensor_impl(convertTo, convertFrom)
   3.436 +          type(active), dimension(:,:,:,:,:), intent(in) :: convertFrom
   3.437 +          real(w2f__8), dimension(:,:,:,:,:), intent(out) :: convertTo
   3.438 +          convertTo=convertFrom%v
   3.439 +        end subroutine
   3.440 +
   3.441 +        subroutine convert_sp2a_five_tensor_impl(convertTo, convertFrom)
   3.442 +          real(w2f__4), dimension(:,:,:,:,:), intent(in) :: convertFrom
   3.443 +          type(active), dimension(:,:,:,:,:), intent(inout) :: convertTo
   3.444 +          convertTo%v=convertFrom
   3.445 +        end subroutine
   3.446 +
   3.447 +        subroutine convert_p2a_five_tensor_impl(convertTo, convertFrom)
   3.448 +          real(w2f__8), dimension(:,:,:,:,:), intent(in) :: convertFrom
   3.449 +          type(active), dimension(:,:,:,:,:), intent(inout) :: convertTo
   3.450 +          convertTo%v=convertFrom
   3.451 +        end subroutine
   3.452 +        
   3.453 +        subroutine convert_a2sp_six_tensor_impl(convertTo, convertFrom)
   3.454 +          type(active), dimension(:,:,:,:,:,:), intent(in) :: convertFrom
   3.455 +          real(w2f__4), dimension(:,:,:,:,:,:), intent(out) :: convertTo
   3.456 +          convertTo=convertFrom%v
   3.457 +        end subroutine
   3.458 +
   3.459 +        subroutine convert_a2p_six_tensor_impl(convertTo, convertFrom)
   3.460 +          type(active), dimension(:,:,:,:,:,:), intent(in) :: convertFrom
   3.461 +          real(w2f__8), dimension(:,:,:,:,:,:), intent(out) :: convertTo
   3.462 +          convertTo=convertFrom%v
   3.463 +        end subroutine
   3.464 +
   3.465 +        subroutine convert_sp2a_six_tensor_impl(convertTo, convertFrom)
   3.466 +          real(w2f__4), dimension(:,:,:,:,:,:), intent(in) :: convertFrom
   3.467 +          type(active), dimension(:,:,:,:,:,:), intent(inout) :: convertTo
   3.468 +          convertTo%v=convertFrom
   3.469 +        end subroutine
   3.470 +
   3.471 +        subroutine convert_p2a_six_tensor_impl(convertTo, convertFrom)
   3.472 +          real(w2f__8), dimension(:,:,:,:,:,:), intent(in) :: convertFrom
   3.473 +          type(active), dimension(:,:,:,:,:,:), intent(inout) :: convertTo
   3.474 +          convertTo%v=convertFrom
   3.475 +        end subroutine
   3.476 +        
   3.477 +        subroutine convert_a2sp_seven_tensor_impl(convertTo, convertFrom)
   3.478 +          type(active), dimension(:,:,:,:,:,:,:), intent(in) :: convertFrom
   3.479 +          real(w2f__4), dimension(:,:,:,:,:,:,:), intent(out) :: convertTo
   3.480 +          convertTo=convertFrom%v
   3.481 +        end subroutine
   3.482 +
   3.483 +        subroutine convert_a2p_seven_tensor_impl(convertTo, convertFrom)
   3.484 +          type(active), dimension(:,:,:,:,:,:,:), intent(in) :: convertFrom
   3.485 +          real(w2f__8), dimension(:,:,:,:,:,:,:), intent(out) :: convertTo
   3.486 +          convertTo=convertFrom%v
   3.487 +        end subroutine
   3.488 +
   3.489 +        subroutine convert_sp2a_seven_tensor_impl(convertTo, convertFrom)
   3.490 +          real(w2f__4), dimension(:,:,:,:,:,:,:), intent(in) :: convertFrom
   3.491 +          type(active), dimension(:,:,:,:,:,:,:), intent(inout) :: convertTo
   3.492 +          convertTo%v=convertFrom
   3.493 +        end subroutine
   3.494 +
   3.495 +        subroutine convert_p2a_seven_tensor_impl(convertTo, convertFrom)
   3.496 +          real(w2f__8), dimension(:,:,:,:,:,:,:), intent(in) :: convertFrom
   3.497 +          type(active), dimension(:,:,:,:,:,:,:), intent(inout) :: convertTo
   3.498 +          convertTo%v=convertFrom
   3.499 +        end subroutine
   3.500 +
   3.501 +        subroutine oad_allocateMatchingV(toBeAllocated,allocateMatching)
   3.502 +          implicit none
   3.503 +          type(active), dimension(:), allocatable :: toBeAllocated
   3.504 +          type(active), dimension(:) :: allocateMatching
   3.505 +          allocate(toBeAllocated(size(allocateMatching)));
   3.506 +        end subroutine
   3.507 +
   3.508 +        end module OAD_active
   3.509 +