File indexing completed on 2023-05-28 05:10:06 UTC
view on githubraw file Latest commit b4daa243 on 2023-05-28 03:53:22 UTC
5ed655852f Jean*0001 #include "COST_OPTIONS.h"
a40c19bc02 Patr*0002
b4daa24319 Shre*0003 subroutine cost_dependent_init( myThid )
a40c19bc02 Patr*0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
b4daa24319 Shre*0017 IMPLICIT NONE
a40c19bc02 Patr*0018
0019
0020 #include "EEPARAMS.h"
0021 #include "SIZE.h"
0022 #include "cost.h"
0023 #include "adcost.h"
b4daa24319 Shre*0024 #ifdef ALLOW_TAPENADE
0025 # include "COST_TAP_ADJ.h"
0026 #endif
a40c19bc02 Patr*0027
0028
b4daa24319 Shre*0029 integer myThid
a40c19bc02 Patr*0030
0031
9f5240b52a Jean*0032 #if ( defined ALLOW_COST_VECTOR || defined ALLOW_COST_STATE_FINAL )
0033 integer i
0034 #endif
0035 #ifdef ALLOW_COST_STATE_FINAL
0036 integer j, k
0037 #endif
a40c19bc02 Patr*0038 integer bi,bj
0039
0040
092f11c7ee Jean*0041 #ifdef ALLOW_OPENAD
60e3924f90 Patr*0042 fc%v = 0.0
0043 #else
47717436a5 Patr*0044 fc = 0. _d 0
60e3924f90 Patr*0045 #endif
a40c19bc02 Patr*0046
edd57506ae Patr*0047 #ifdef ALLOW_AUTODIFF
a40c19bc02 Patr*0048
b4daa24319 Shre*0049 #ifdef ALLOW_TAPENADE
0050 fcb = 1.0
0051 #endif
0052
092f11c7ee Jean*0053 #ifdef ALLOW_OPENAD
60e3924f90 Patr*0054 adfc = 1.0
0055 #else
47717436a5 Patr*0056 if ( myProcId .EQ. 0 ) then
0057 adfc = 1. _d 0
0058 endif
60e3924f90 Patr*0059 #endif
1826cda3a0 Patr*0060
b4daa24319 Shre*0061 do bj = myByLo(myThid), myByHi(myThid)
0062 do bi = myBxLo(myThid), myBxHi(myThid)
a40c19bc02 Patr*0063 #ifdef ALLOW_COST_VECTOR
b4daa24319 Shre*0064 do i=1,sNx
0065 objf_vector(i,bi,bj) = 0. _d 0
0066 adobjf_vector(i,bi,bj) = 1. _d 0
0067 enddo
9eb96e5404 Patr*0068 #endif
0069 #ifdef ALLOW_COST_STATE_FINAL
b4daa24319 Shre*0070 do k=1,4*Nr+1
0071 do j=1,sNy
0072 do i=1,sNx
f8659cb5d2 Patr*0073 objf_state_final(i,j,bi,bj,k) = 0. _d 0
0074 enddo
b4daa24319 Shre*0075 enddo
0076 enddo
9eb96e5404 Patr*0077
0078
a40c19bc02 Patr*0079 #endif
b4daa24319 Shre*0080 enddo
a40c19bc02 Patr*0081 enddo
0082
edd57506ae Patr*0083 #endif /* ALLOW_AUTODIFF */
a40c19bc02 Patr*0084
0085 return
0086 end