36 |
#include "GRID.h" |
#include "GRID.h" |
37 |
#include "EEPARAMS.h" |
#include "EEPARAMS.h" |
38 |
#include "PARAMS.h" |
#include "PARAMS.h" |
39 |
|
#ifdef ALLOW_AUTODIFF_TAMC |
40 |
|
#include "tamc.h" |
41 |
|
#include "tamc_keys.h" |
42 |
|
#endif /* ALLOW_AUTODIFF_TAMC */ |
43 |
|
|
44 |
C == Routine arguments == |
C == Routine arguments == |
45 |
INTEGER bi,bj,iMin,iMax,jMin,jMax,K |
INTEGER bi,bj,iMin,iMax,jMin,jMax,K |
46 |
_RL theta(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) |
_RL theta(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) |
57 |
_RL ddRm1, ddRp1, ddRm, ddRp |
_RL ddRm1, ddRp1, ddRm, ddRp |
58 |
_RL atm_cp, atm_kappa, atm_po |
_RL atm_cp, atm_kappa, atm_po |
59 |
|
|
60 |
|
#ifdef ALLOW_AUTODIFF_TAMC |
61 |
|
act1 = bi - myBxLo(myThid) |
62 |
|
max1 = myBxHi(myThid) - myBxLo(myThid) + 1 |
63 |
|
|
64 |
|
act2 = bj - myByLo(myThid) |
65 |
|
max2 = myByHi(myThid) - myByLo(myThid) + 1 |
66 |
|
|
67 |
|
act3 = myThid - 1 |
68 |
|
max3 = nTx*nTy |
69 |
|
|
70 |
|
act4 = ikey_dynamics - 1 |
71 |
|
|
72 |
|
ikey = (act1 + 1) + act2*max1 |
73 |
|
& + act3*max1*max2 |
74 |
|
& + act4*max1*max2*max3 |
75 |
|
#endif /* ALLOW_AUTODIFF_TAMC */ |
76 |
|
|
77 |
IF ( buoyancyRelation .eq. 'OCEANIC' ) THEN |
IF ( buoyancyRelation .eq. 'OCEANIC' ) THEN |
78 |
C This is the hydrostatic pressure calculation for the Ocean |
C This is the hydrostatic pressure calculation for the Ocean |
79 |
C which uses the FIND_RHO() routine to calculate density |
C which uses the FIND_RHO() routine to calculate density |
99 |
ENDIF |
ENDIF |
100 |
|
|
101 |
C Calculate density |
C Calculate density |
102 |
|
#ifdef ALLOW_AUTODIFF_TAMC |
103 |
|
kkey = (ikey-1)*Nr + k |
104 |
|
CADJ STORE theta(:,:,k,bi,bj) = comlev1_bibj_k, key=kkey, byte=isbyte |
105 |
|
CADJ STORE salt (:,:,k,bi,bj) = comlev1_bibj_k, key=kkey, byte=isbyte |
106 |
|
#endif /* ALLOW_AUTODIFF_TAMC */ |
107 |
CALL FIND_RHO( bi, bj, iMin, iMax, jMin, jMax, k, k, eosType, |
CALL FIND_RHO( bi, bj, iMin, iMax, jMin, jMax, k, k, eosType, |
108 |
& theta, salt, |
& theta, salt, |
109 |
& alphaRho, myThid) |
& alphaRho, myThid) |
112 |
DO j=jMin,jMax |
DO j=jMin,jMax |
113 |
DO i=iMin,iMax |
DO i=iMin,iMax |
114 |
#ifdef ALLOW_AUTODIFF_TAMC |
#ifdef ALLOW_AUTODIFF_TAMC |
115 |
c Is this directive correct or even necessary in this new code? |
c Patrick, is this directive correct or even necessary in |
116 |
|
c this new code? |
117 |
|
c Yes, because of phiHyd(i,j,k+1)=phiHyd(i,j,k)+... |
118 |
|
c within the k-loop. |
119 |
CADJ GENERAL |
CADJ GENERAL |
120 |
#endif /* ALLOW_AUTODIFF_TAMC */ |
#endif /* ALLOW_AUTODIFF_TAMC */ |
121 |
|
|