File indexing completed on 2024-06-06 05:10:14 UTC
view on githubraw file Latest commit af61e5eb on 2024-06-06 03:30:35 UTC
c842b53753 Jean*0001 #include "PACKAGES_CONFIG.h"
0002 #include "CPP_OPTIONS.h"
f59d76b0dd Ed D*0003 #ifdef ALLOW_MOM_COMMON
0004 # include "MOM_COMMON_OPTIONS.h"
0005 #endif
517dbdc414 Jean*0006 #ifdef ALLOW_AUTODIFF
0007 # include "AUTODIFF_OPTIONS.h"
0008 #endif
0009 #ifdef ALLOW_CTRL
0010 # include "CTRL_OPTIONS.h"
0011 #endif
1f89baba18 Patr*0012 #ifdef ALLOW_SALT_PLUME
0013 # include "SALT_PLUME_OPTIONS.h"
0014 #endif
ecaa45da39 An T*0015 #ifdef ALLOW_ECCO
0016 # include "ECCO_OPTIONS.h"
0017 #endif
c842b53753 Jean*0018
517dbdc414 Jean*0019 #ifdef ALLOW_AUTODIFF
685f7544b6 Patr*0020 # ifdef ALLOW_GGL90
0021 # include "GGL90_OPTIONS.h"
0022 # endif
c842b53753 Jean*0023 # ifdef ALLOW_GMREDI
0024 # include "GMREDI_OPTIONS.h"
0025 # endif
0026 # ifdef ALLOW_KPP
0027 # include "KPP_OPTIONS.h"
0028 # endif
9d4847a995 Jean*0029 # ifdef ALLOW_SEAICE
0030 # include "SEAICE_OPTIONS.h"
0031 # endif
9e3a303fa3 Gael*0032 # ifdef ALLOW_EXF
0033 # include "EXF_OPTIONS.h"
0034 # endif
af61e5eb16 Mart*0035 #ifdef ALLOW_OBCS
0036 # include "OBCS_OPTIONS.h"
0037 #endif
517dbdc414 Jean*0038 #endif /* ALLOW_AUTODIFF */
c842b53753 Jean*0039
0040
0041
0042
0043 SUBROUTINE DO_OCEANIC_PHYS(myTime, myIter, myThid)
0044
0045
765f2ca955 Jean*0046
0047
c842b53753 Jean*0048
0049
0050
0051
0052
0053
8f92343d9b Jean*0054
0055
0056
0057
0058
7eca977925 Jean*0059
0060
8f92343d9b Jean*0061
0062
0063
0064
0065
0066
0067
0068
7eca977925 Jean*0069
0070
00f81e6785 Ou W*0071
8f92343d9b Jean*0072
0073
0074
0075
0076
0077
0078
0079
0080
0081
abfe198bce Mart*0082
0083
8f92343d9b Jean*0084
0085
0086
0087
0088
0089
0090
0091
0092
0093
0094
0095
0096
0097
0098
0099
0100
0101
0102
0103
0104
0105
0106
0107
0108
0109
0110
0111
0112
0113
0114
0115
0116
0117
0118
0119
0120
dc2ebbdaf0 Jean*0121
0122
8f92343d9b Jean*0123
0124
0125
0126
0127
0128
0129
0130
0320e25227 Mart*0131
0132
8f92343d9b Jean*0133
0134
0135
0136
0137
0138
c842b53753 Jean*0139
0140 IMPLICIT NONE
0141
0142 #include "SIZE.h"
0143 #include "EEPARAMS.h"
0144 #include "PARAMS.h"
0145 #include "GRID.h"
1db41719d4 Jean*0146 #include "DYNVARS.h"
c4e20a6b6c Jean*0147 #ifdef ALLOW_TIMEAVE
c8b8efc127 Jean*0148 # include "TIMEAVE_STATV.h"
0149 #endif
0150 #ifdef ALLOW_OFFLINE
0151 # include "OFFLINE_SWITCH.h"
c4e20a6b6c Jean*0152 #endif
c842b53753 Jean*0153
517dbdc414 Jean*0154 #ifdef ALLOW_AUTODIFF
7f4c5015d5 Patr*0155 # include "AUTODIFF_MYFIELDS.h"
7c50f07931 Mart*0156 # ifdef ALLOW_AUTODIFF_TAMC
0157 # include "tamc.h"
0158 # endif
c842b53753 Jean*0159 # include "FFIELDS.h"
81b43af3f0 Patr*0160 # include "SURFACE.h"
c842b53753 Jean*0161 # include "EOS.h"
685f7544b6 Patr*0162 # ifdef ALLOW_GMREDI
0163 # include "GMREDI.h"
0164 # endif
c842b53753 Jean*0165 # ifdef ALLOW_KPP
0166 # include "KPP.h"
0167 # endif
2b52c649e6 Gael*0168 # ifdef ALLOW_GGL90
0169 # include "GGL90.h"
0170 # endif
c842b53753 Jean*0171 # ifdef ALLOW_EBM
0172 # include "EBM.h"
0173 # endif
9d4847a995 Jean*0174 # ifdef ALLOW_EXF
b4daa24319 Shre*0175 # ifdef ALLOW_CTRL
5cf4364659 Mart*0176 # include "CTRL_SIZE.h"
4d72283393 Mart*0177 # include "CTRL.h"
b4daa24319 Shre*0178 # endif
798a745844 Jean*0179 # include "EXF_FIELDS.h"
9d4847a995 Jean*0180 # ifdef ALLOW_BULKFORMULAE
798a745844 Jean*0181 # include "EXF_CONSTANTS.h"
9d4847a995 Jean*0182 # endif
0183 # endif
0184 # ifdef ALLOW_SEAICE
a2c8840cf9 Jean*0185 # include "SEAICE_SIZE.h"
9d4847a995 Jean*0186 # include "SEAICE.h"
2848258862 Gael*0187 # include "SEAICE_PARAMS.h"
9d4847a995 Jean*0188 # endif
ec745395c8 Patr*0189 # ifdef ALLOW_THSICE
0190 # include "THSICE_VARS.h"
0191 # endif
f7911aa28f Patr*0192 # ifdef ALLOW_SALT_PLUME
0193 # include "SALT_PLUME.h"
0194 # endif
af61e5eb16 Mart*0195 # ifdef ALLOW_OBCS
0196 # include "OBCS_PARAMS.h"
0197 # include "OBCS_FIELDS.h"
0198 # endif
517dbdc414 Jean*0199 #endif /* ALLOW_AUTODIFF */
c842b53753 Jean*0200
b4daa24319 Shre*0201 #ifdef ALLOW_TAPENADE
0202
0203
0204
0205 # ifdef ALLOW_SHELFICE
0206 # include "SHELFICE.h"
0207 # endif
0208 #endif /* ALLOW_TAPENADE */
0209
c842b53753 Jean*0210
0211
38ee7d4239 Jean*0212
0213
0214
c842b53753 Jean*0215 _RL myTime
0216 INTEGER myIter
0217 INTEGER myThid
0218
0219
0220
0320e25227 Mart*0221
38ee7d4239 Jean*0222
c842b53753 Jean*0223
38ee7d4239 Jean*0224
7eca977925 Jean*0225
38ee7d4239 Jean*0226
0320e25227 Mart*0227
cf9e43202e Jean*0228 _RL rhoKp1 (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
0229 _RL rhoKm1 (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
c842b53753 Jean*0230 _RL sigmaX (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
0231 _RL sigmaY (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
0232 _RL sigmaR (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
0233 INTEGER iMin, iMax
0234 INTEGER jMin, jMax
0235 INTEGER bi, bj
0320e25227 Mart*0236 INTEGER i, j, k, kSrf
7eca977925 Jean*0237 CHARACTER*(MAX_LEN_MBUF) msgBuf
8ab93ea9a3 Jean*0238 INTEGER doDiagsRho
c8b8efc127 Jean*0239 LOGICAL calcGMRedi, calcKPP, calcConvect
8ab93ea9a3 Jean*0240 #ifdef ALLOW_DIAGNOSTICS
0241 LOGICAL DIAGNOSTICS_IS_ON
0242 EXTERNAL DIAGNOSTICS_IS_ON
0243 #endif /* ALLOW_DIAGNOSTICS */
34de4f2d34 Jean*0244 #ifdef ALLOW_AUTODIFF
0245 _RL thetaRef
0246 #endif /* ALLOW_AUTODIFF */
7c50f07931 Mart*0247 #ifdef ALLOW_AUTODIFF_TAMC
edb6656069 Mart*0248
af61e5eb16 Mart*0249 INTEGER tkey
7c50f07931 Mart*0250 #endif
c842b53753 Jean*0251
0252
0320e25227 Mart*0253 kSrf = 1
0254 IF ( usingPCoords ) kSrf = Nr
0255
c842b53753 Jean*0256 #ifdef ALLOW_DEBUG
8440e8ae5d Jean*0257 IF (debugMode) CALL DEBUG_ENTER('DO_OCEANIC_PHYS',myThid)
c842b53753 Jean*0258 #endif
0ff4deb339 Jean*0259
8ab93ea9a3 Jean*0260 doDiagsRho = 0
0261 #ifdef ALLOW_DIAGNOSTICS
0262 IF ( useDiagnostics .AND. fluidIsWater ) THEN
d497465397 Jean*0263 IF ( DIAGNOSTICS_IS_ON('MXLDEPTH',myThid) )
842349fcb7 Jean*0264 & doDiagsRho = doDiagsRho + 1
0265 IF ( DIAGNOSTICS_IS_ON('DRHODR ',myThid) )
0266 & doDiagsRho = doDiagsRho + 2
d497465397 Jean*0267 IF ( DIAGNOSTICS_IS_ON('WdRHO_P ',myThid) )
842349fcb7 Jean*0268 & doDiagsRho = doDiagsRho + 4
d497465397 Jean*0269 IF ( DIAGNOSTICS_IS_ON('WdRHOdP ',myThid) )
0270 & doDiagsRho = doDiagsRho + 8
8ab93ea9a3 Jean*0271 ENDIF
0272 #endif /* ALLOW_DIAGNOSTICS */
0273
c8b8efc127 Jean*0274 calcGMRedi = useGMRedi
0275 calcKPP = useKPP
0276 calcConvect = ivdc_kappa.NE.0.
0277 #ifdef ALLOW_OFFLINE
0278 IF ( useOffLine ) THEN
0279 calcGMRedi = useGMRedi .AND. .NOT.offlineLoadGMRedi
0280 calcKPP = useKPP .AND. .NOT.offlineLoadKPP
0281 calcConvect=calcConvect.AND. .NOT.offlineLoadConvec
0282 ENDIF
0283 #endif /* ALLOW_OFFLINE */
0284
f7d550a4f6 Jean*0285 #ifdef ALLOW_OBCS
0286 IF (useOBCS) THEN
0287
0288
38b71af82a Patr*0289 # ifdef ALLOW_AUTODIFF_TAMC
0290
0291
af61e5eb16 Mart*0292
0293 # ifdef ALLOW_OBCS_STEVENS
0294
0295
0296 # ifdef ALLOW_OBCS_EAST
0297
0298
0299 # endif
0300 # ifdef ALLOW_OBCS_WEST
0301
0302
0303 # endif
0304 # ifdef ALLOW_OBCS_NORTH
0305
0306
0307 # endif
0308 # ifdef ALLOW_OBCS_SOUTH
0309
0310
0311 # endif
0312 # endif /* ALLOW_OBCS_STEVENS */
38b71af82a Patr*0313 # endif
0314 # ifdef ALLOW_DEBUG
8440e8ae5d Jean*0315 IF (debugMode) CALL DEBUG_CALL('OBCS_CALC',myThid)
38b71af82a Patr*0316 # endif
70075a2466 Jean*0317 CALL OBCS_CALC( myTime+deltaTClock, myIter+1,
3a86c9b47d Oliv*0318 I uVel, vVel, wVel, theta, salt, myThid )
f7d550a4f6 Jean*0319 ENDIF
af61e5eb16 Mart*0320 # if ( defined ALLOW_AUTODIFF_TAMC && defined ALLOW_OBCS_BALANCE )
0321
0322
0323 # ifdef ALLOW_OBCS_NORTH
0324
0325 # endif
0326 # ifdef ALLOW_OBCS_SOUTH
0327
0328 # endif
0329 # ifdef ALLOW_OBCS_EAST
0330
0331 # endif
0332 # ifdef ALLOW_OBCS_WEST
0333
0334 # endif
0335 # endif /* ALLOW_AUTODIFF_TAMC and ALLOW_OBCS_BALANCE */
f7d550a4f6 Jean*0336 #endif /* ALLOW_OBCS */
1db41719d4 Jean*0337
7eca977925 Jean*0338 #ifdef ALLOW_OCN_COMPON_INTERF
0339
0340
0341 IF ( useCoupler ) THEN
0342 CALL OCN_APPLY_IMPORT( .TRUE., myTime, myIter, myThid )
0343 ENDIF
0344 #endif /* ALLOW_OCN_COMPON_INTERF */
0345
517dbdc414 Jean*0346 #ifdef ALLOW_AUTODIFF
79d91b77ec Gael*0347 DO bj=myByLo(myThid),myByHi(myThid)
0348 DO bi=myBxLo(myThid),myBxHi(myThid)
0349 DO j=1-OLy,sNy+OLy
0350 DO i=1-OLx,sNx+OLx
fa323f784d Jean*0351 adjustColdSST_diag(i,j,bi,bj) = 0. _d 0
0352 # ifdef ALLOW_SALT_PLUME
79d91b77ec Gael*0353 saltPlumeDepth(i,j,bi,bj) = 0. _d 0
0354 saltPlumeFlux(i,j,bi,bj) = 0. _d 0
fa323f784d Jean*0355 # endif
79d91b77ec Gael*0356 ENDDO
0357 ENDDO
0358 ENDDO
0359 ENDDO
f59d76b0dd Ed D*0360 #endif /* ALLOW_AUTODIFF */
0361
e0b3e1bdd8 Dimi*0362 #ifdef ALLOW_FRAZIL
0363 IF ( useFRAZIL ) THEN
0364
dde0ec0a2d Patr*0365
0366
e0b3e1bdd8 Dimi*0367 CALL FRAZIL_CALC_RHS( myTime, myIter, myThid )
0368 ENDIF
0369 #endif /* ALLOW_FRAZIL */
0370
de80e32bba Jean*0371 #if (defined ALLOW_THSICE) &&
0372 IF ( useThSIce .AND. fluidIsWater ) THEN
d503ff4f7a Jean*0373 # ifdef ALLOW_AUTODIFF_TAMC
9c41af81f6 Timo*0374 # ifdef ALLOW_SEAICE
ec0d7df165 Mart*0375
9c41af81f6 Timo*0376 # endif
ec0d7df165 Mart*0377
0378
0379
0380
0381
0382
0383
0384
0385
0386
d503ff4f7a Jean*0387 # ifdef NONLIN_FRSURF
ec0d7df165 Mart*0388
d503ff4f7a Jean*0389 # endif
a7828ed4d5 Patr*0390 # endif /* ALLOW_AUTODIFF_TAMC */
de80e32bba Jean*0391 # ifdef ALLOW_DEBUG
0392 IF (debugMode) CALL DEBUG_CALL('THSICE_MAIN',myThid)
0393 # endif
0394
0395
0396 CALL TIMER_START('THSICE_MAIN [DO_OCEANIC_PHYS]', myThid)
0397 CALL THSICE_MAIN( myTime, myIter, myThid )
0398 CALL TIMER_STOP( 'THSICE_MAIN [DO_OCEANIC_PHYS]', myThid)
0399 ENDIF
0400 #endif /* ALLOW_THSICE */
0401
9d4847a995 Jean*0402 #ifdef ALLOW_SEAICE
ec0d7df165 Mart*0403 # ifdef ALLOW_AUTODIFF_TAMC
3314a43a56 Mart*0404
0405
0406
af61e5eb16 Mart*0407 # if (defined ALLOW_EXF) && (defined ALLOW_ATM_TEMP)
3314a43a56 Mart*0408
af61e5eb16 Mart*0409 # endif
0410
0411
0412
0413
0414
0415 # endif
9d4847a995 Jean*0416 IF ( useSEAICE ) THEN
7880c396f6 Patr*0417 # ifdef ALLOW_AUTODIFF_TAMC
3314a43a56 Mart*0418
0419
3c775cbf98 Mart*0420 # ifdef SEAICE_USE_GROWTH_ADX
0421
0422 # endif
3314a43a56 Mart*0423 # ifdef ALLOW_EXF
ec0d7df165 Mart*0424
0425
0426
7880c396f6 Patr*0427 # endif
f4b023d948 Jean*0428 # ifdef SEAICE_VARIABLE_SALINITY
ec0d7df165 Mart*0429
f4b023d948 Jean*0430 # endif
7880c396f6 Patr*0431 # ifdef ATMOSPHERIC_LOADING
ec0d7df165 Mart*0432
7880c396f6 Patr*0433 # endif
0434 # ifdef NONLIN_FRSURF
ec0d7df165 Mart*0435
7880c396f6 Patr*0436 # endif
a7828ed4d5 Patr*0437 # ifdef ALLOW_THSICE
d5254b4e3d Mart*0438
ec0d7df165 Mart*0439
0440
0441
f4b023d948 Jean*0442 # endif /* ALLOW_THSICE */
a7828ed4d5 Patr*0443 # endif /* ALLOW_AUTODIFF_TAMC */
7880c396f6 Patr*0444 # ifdef ALLOW_DEBUG
8440e8ae5d Jean*0445 IF (debugMode) CALL DEBUG_CALL('SEAICE_MODEL',myThid)
7880c396f6 Patr*0446 # endif
9d4847a995 Jean*0447 CALL TIMER_START('SEAICE_MODEL [DO_OCEANIC_PHYS]', myThid)
0448 CALL SEAICE_MODEL( myTime, myIter, myThid )
0449 CALL TIMER_STOP ('SEAICE_MODEL [DO_OCEANIC_PHYS]', myThid)
3314a43a56 Mart*0450 # ifdef ALLOW_AUTODIFF_TAMC
0451
0452
0453
0454
0455
0456
0457 # endif
7880c396f6 Patr*0458 # ifdef ALLOW_COST
1e22f5fc71 Patr*0459 CALL SEAICE_COST_SENSI ( myTime, myIter, myThid )
7880c396f6 Patr*0460 # endif
ec0d7df165 Mart*0461 # ifdef ALLOW_AUTODIFF
0462 ELSEIF ( SEAICEadjMODE .EQ. -1 ) THEN
af61e5eb16 Mart*0463 # ifdef ALLOW_AUTODIFF_TAMC
3314a43a56 Mart*0464
af61e5eb16 Mart*0465 # endif
ec0d7df165 Mart*0466 CALL SEAICE_FAKE( myTime, myIter, myThid )
0467 # endif /* ALLOW_AUTODIFF */
acb47bc07b Patr*0468 ENDIF
9d4847a995 Jean*0469 #endif /* ALLOW_SEAICE */
0470
7eca977925 Jean*0471 #if (defined ALLOW_OCN_COMPON_INTERF) && (defined ALLOW_THSICE)
0472
0473
0474 IF ( useCoupler ) THEN
0475 # ifdef ALLOW_DEBUG
0476 IF (debugMode) CALL DEBUG_CALL('OCN_EXPORT_DATA',myThid)
0477 # endif
0478 CALL TIMER_START('OCN_EXPORT_DATA [DO_OCEANIC_PHYS]', myThid)
0479 CALL OCN_EXPORT_DATA( myTime, myIter, myThid )
0480 CALL TIMER_STOP ('OCN_EXPORT_DATA [DO_OCEANIC_PHYS]', myThid)
0481 ENDIF
0482 #endif /* ALLOW_OCN_COMPON_INTERF & ALLOW_THSICE */
0483
13783cb644 Patr*0484 #ifdef ALLOW_AUTODIFF_TAMC
ec0d7df165 Mart*0485
0486
13783cb644 Patr*0487 # ifdef ALLOW_SEAICE
ec0d7df165 Mart*0488
13783cb644 Patr*0489 # endif
0490 #endif
0491
a6cbc7a360 Mart*0492 #ifdef ALLOW_SHELFICE
0493 IF ( useShelfIce .AND. fluidIsWater ) THEN
dde0ec0a2d Patr*0494 #ifdef ALLOW_AUTODIFF_TAMC
ec0d7df165 Mart*0495
0496
dde0ec0a2d Patr*0497 #endif
00f81e6785 Ou W*0498 #ifdef ALLOW_STEEP_ICECAVITY
0499 IF ( useSTIC ) THEN
0500 # ifdef ALLOW_DEBUG
0501 IF (debugMode) CALL DEBUG_CALL('STIC_THERMODYNAMICS',myThid)
0502 # endif
0503
0504 CALL TIMER_START('STIC_THERMODYNAMICS [DO_OCEANIC_PHYS]',myThid)
0505 CALL STIC_THERMODYNAMICS( myTime, myIter, myThid )
0506 CALL TIMER_STOP ('STIC_THERMODYNAMICS [DO_OCEANIC_PHYS]',myThid)
0507 ELSE
0508 #else
0509 IF ( .TRUE. ) THEN
0510 #endif
0511 #ifdef ALLOW_DEBUG
0512 IF (debugMode) CALL DEBUG_CALL('SHELFICE_THERMODYNAMICS',myThid)
0513 #endif
cf9e43202e Jean*0514
a6cbc7a360 Mart*0515
00f81e6785 Ou W*0516 CALL TIMER_START('SHELFICE_THERMODYNAMICS [DO_OCEANIC_PHYS]',
a6cbc7a360 Mart*0517 & myThid)
00f81e6785 Ou W*0518 CALL SHELFICE_THERMODYNAMICS( myTime, myIter, myThid )
0519 CALL TIMER_STOP ('SHELFICE_THERMODYNAMICS [DO_OCEANIC_PHYS]',
0520 & myThid)
0521 ENDIF
a6cbc7a360 Mart*0522 ENDIF
0523 #endif /* ALLOW_SHELFICE */
0524
5da8ce63fa Dimi*0525 #ifdef ALLOW_ICEFRONT
0526 IF ( useICEFRONT .AND. fluidIsWater ) THEN
0527 #ifdef ALLOW_DEBUG
8440e8ae5d Jean*0528 IF (debugMode) CALL DEBUG_CALL('ICEFRONT_THERMODYNAMICS',myThid)
5da8ce63fa Dimi*0529 #endif
0530
0531
0532 CALL TIMER_START('ICEFRONT_THERMODYNAMICS [DO_OCEANIC_PHYS]',
0533 & myThid)
0534 CALL ICEFRONT_THERMODYNAMICS( myTime, myIter, myThid )
0535 CALL TIMER_STOP( 'ICEFRONT_THERMODYNAMICS [DO_OCEANIC_PHYS]',
0536 & myThid)
0537 ENDIF
0538 #endif /* ALLOW_ICEFRONT */
0539
9d71427857 Jean*0540 #ifdef ALLOW_SALT_PLUME
0541 IF ( useSALT_PLUME ) THEN
1f89baba18 Patr*0542
ec0d7df165 Mart*0543 CALL SALT_PLUME_DO_EXCH( myTime, myIter, myThid )
9d71427857 Jean*0544 ENDIF
0545 #endif /* ALLOW_SALT_PLUME */
0546
c8d39c4db4 Jean*0547
0d6bd11ad2 Patr*0548 IF ( allowFreezing ) THEN
c8d39c4db4 Jean*0549 #ifdef ALLOW_AUTODIFF_TAMC
ec0d7df165 Mart*0550
c8d39c4db4 Jean*0551 #endif
9e647b4f24 Jean*0552 CALL FREEZE_SURFACE( myTime, myIter, myThid )
c8d39c4db4 Jean*0553 ENDIF
0554
cb5aad258c Jean*0555 iMin = 1-OLx
0556 iMax = sNx+OLx
0557 jMin = 1-OLy
0558 jMax = sNy+OLy
0559
0560
0561
517dbdc414 Jean*0562 #ifdef ALLOW_AUTODIFF
af61e5eb16 Mart*0563 # ifdef ALLOW_AUTODIFF_TAMC
ec0d7df165 Mart*0564
af61e5eb16 Mart*0565 # endif
517dbdc414 Jean*0566 #else /* ALLOW_AUTODIFF */
cb5aad258c Jean*0567
0568
2094169490 Jean*0569 IF ( fluidIsWater ) THEN
517dbdc414 Jean*0570 #endif /* ALLOW_AUTODIFF */
dc2ebbdaf0 Jean*0571 #ifdef ALLOW_DEBUG
0572 IF (debugMode) CALL DEBUG_CALL('EXTERNAL_FORCING_SURF',myThid)
0573 #endif
cb5aad258c Jean*0574 CALL EXTERNAL_FORCING_SURF(
0575 I iMin, iMax, jMin, jMax,
0576 I myTime, myIter, myThid )
af61e5eb16 Mart*0577 #ifdef ALLOW_AUTODIFF_TAMC
0578
0579
0580
0581 #endif
22a8d54100 Jean*0582
abfe198bce Mart*0583 #ifdef ALLOW_OBCS
0584 IF (useOBCS) THEN
0585
0586
0587 # ifdef ALLOW_DEBUG
0588 IF (debugMode) CALL DEBUG_CALL('OBCS_ADJUST',myThid)
0589 # endif
0590 CALL OBCS_ADJUST(
0591 I myTime+deltaTClock, myIter+1, myThid )
0592 ENDIF
0593 #endif /* ALLOW_OBCS */
0594
c842b53753 Jean*0595 #ifdef ALLOW_AUTODIFF_TAMC
0596
0597
0598 #endif /* ALLOW_AUTODIFF_TAMC */
0599 DO bj=myByLo(myThid),myByHi(myThid)
0600 #ifdef ALLOW_AUTODIFF_TAMC
460dc72355 Patr*0601
0602
c842b53753 Jean*0603 #endif /* ALLOW_AUTODIFF_TAMC */
0604 DO bi=myBxLo(myThid),myBxHi(myThid)
0605
0606 #ifdef ALLOW_AUTODIFF_TAMC
edb6656069 Mart*0607 tkey = bi + (bj-1)*nSx + (ikey_dynamics-1)*nSx*nSy
741260dd7e Jean*0608 #endif /* ALLOW_AUTODIFF_TAMC */
c842b53753 Jean*0609
0610
0611
0612
0613
0614
c8b8efc127 Jean*0615 DO k=1,Nr
0616 DO j=1-OLy,sNy+OLy
0617 DO i=1-OLx,sNx+OLx
0618
0619 sigmaX(i,j,k) = 0. _d 0
0620 sigmaY(i,j,k) = 0. _d 0
0621 sigmaR(i,j,k) = 0. _d 0
0622 ENDDO
0623 ENDDO
0624 ENDDO
c842b53753 Jean*0625
0626 DO j=1-OLy,sNy+OLy
0627 DO i=1-OLx,sNx+OLx
cf9e43202e Jean*0628 rhoKm1 (i,j) = 0. _d 0
0629 rhoKp1 (i,j) = 0. _d 0
c842b53753 Jean*0630 ENDDO
0631 ENDDO
0320e25227 Mart*0632 #ifdef ALLOW_AUTODIFF
c8b8efc127 Jean*0633
0634
c842b53753 Jean*0635 DO k=1,Nr
0636 DO j=1-OLy,sNy+OLy
0637 DO i=1-OLx,sNx+OLx
958749fddb Patr*0638 rhoInSitu(i,j,k,bi,bj) = 0.
c8b8efc127 Jean*0639 # ifdef ALLOW_GGL90
0640 GGL90viscArU(i,j,k,bi,bj) = 0. _d 0
0641 GGL90viscArV(i,j,k,bi,bj) = 0. _d 0
0642 GGL90diffKr(i,j,k,bi,bj) = 0. _d 0
0643 # endif /* ALLOW_GGL90 */
1f89baba18 Patr*0644 # ifdef ALLOW_SALT_PLUME
0645 # ifdef SALT_PLUME_VOLUME
0646 SPforcingS(i,j,k,bi,bj) = 0. _d 0
0647 SPforcingT(i,j,k,bi,bj) = 0. _d 0
0648 # endif
0649 # endif /* ALLOW_SALT_PLUME */
c8b8efc127 Jean*0650 ENDDO
0651 ENDDO
0652 ENDDO
0653 #ifdef ALLOW_OFFLINE
0654 IF ( calcConvect ) THEN
0655 #endif
0656 DO k=1,Nr
0657 DO j=1-OLy,sNy+OLy
0658 DO i=1-OLx,sNx+OLx
c842b53753 Jean*0659 IVDConvCount(i,j,k,bi,bj) = 0.
c8b8efc127 Jean*0660 ENDDO
0661 ENDDO
0662 ENDDO
0663 #ifdef ALLOW_OFFLINE
0664 ENDIF
0665 IF ( calcGMRedi ) THEN
0666 #endif
c842b53753 Jean*0667 # ifdef ALLOW_GMREDI
c8b8efc127 Jean*0668 DO k=1,Nr
0669 DO j=1-OLy,sNy+OLy
0670 DO i=1-OLx,sNx+OLx
c842b53753 Jean*0671 Kwx(i,j,k,bi,bj) = 0. _d 0
0672 Kwy(i,j,k,bi,bj) = 0. _d 0
0673 Kwz(i,j,k,bi,bj) = 0. _d 0
0674 Kux(i,j,k,bi,bj) = 0. _d 0
0675 Kvy(i,j,k,bi,bj) = 0. _d 0
0676 # ifdef GM_EXTRA_DIAGONAL
0677 Kuz(i,j,k,bi,bj) = 0. _d 0
0678 Kvz(i,j,k,bi,bj) = 0. _d 0
0679 # endif
0680 # ifdef GM_BOLUS_ADVEC
0681 GM_PsiX(i,j,k,bi,bj) = 0. _d 0
0682 GM_PsiY(i,j,k,bi,bj) = 0. _d 0
0683 # endif
0684 # ifdef GM_VISBECK_VARIABLE_K
0685 VisbeckK(i,j,bi,bj) = 0. _d 0
0686 # endif
c8b8efc127 Jean*0687 ENDDO
0688 ENDDO
0689 ENDDO
c842b53753 Jean*0690 # endif /* ALLOW_GMREDI */
c8b8efc127 Jean*0691 #ifdef ALLOW_OFFLINE
0692 ENDIF
0693 IF ( calcKPP ) THEN
0694 #endif
8d29f48513 Patr*0695 # ifdef ALLOW_KPP
c8b8efc127 Jean*0696 DO k=1,Nr
0697 DO j=1-OLy,sNy+OLy
0698 DO i=1-OLx,sNx+OLx
8d29f48513 Patr*0699 KPPdiffKzS(i,j,k,bi,bj) = 0. _d 0
0700 KPPdiffKzT(i,j,k,bi,bj) = 0. _d 0
c842b53753 Jean*0701 ENDDO
0702 ENDDO
0703 ENDDO
c8b8efc127 Jean*0704 # endif /* ALLOW_KPP */
0705 #ifdef ALLOW_OFFLINE
0706 ENDIF
0707 #endif
517dbdc414 Jean*0708 #endif /* ALLOW_AUTODIFF */
c842b53753 Jean*0709
0710 #ifdef ALLOW_AUTODIFF_TAMC
edb6656069 Mart*0711
0712
0713
27cc6013c1 Patr*0714 # ifdef ALLOW_KPP
edb6656069 Mart*0715
0716
27cc6013c1 Patr*0717 # endif
c842b53753 Jean*0718 #endif /* ALLOW_AUTODIFF_TAMC */
0719
842349fcb7 Jean*0720
0721
0722 #ifdef ALLOW_DEBUG
d497465397 Jean*0723 IF (debugMode) CALL DEBUG_CALL('FIND_RHO_2D (xNr)',myThid)
842349fcb7 Jean*0724 #endif
517dbdc414 Jean*0725 #ifdef ALLOW_AUTODIFF
d497465397 Jean*0726 IF ( fluidIsWater ) THEN
517dbdc414 Jean*0727 #endif /* ALLOW_AUTODIFF */
1db41719d4 Jean*0728 #ifdef ALLOW_DOWN_SLOPE
d497465397 Jean*0729 IF ( useDOWN_SLOPE ) THEN
0730 DO k=1,Nr
1db41719d4 Jean*0731 CALL DWNSLP_CALC_RHO(
0732 I theta, salt,
842349fcb7 Jean*0733 O rhoInSitu(1-OLx,1-OLy,k,bi,bj),
1db41719d4 Jean*0734 I k, bi, bj, myTime, myIter, myThid )
d497465397 Jean*0735 ENDDO
0736 ENDIF
842349fcb7 Jean*0737 #endif /* ALLOW_DOWN_SLOPE */
15338fa568 Dimi*0738 #ifdef ALLOW_BBL
d497465397 Jean*0739 IF ( useBBL ) THEN
af61e5eb16 Mart*0740
0741
0742
0743
d497465397 Jean*0744 DO k=Nr,1,-1
15338fa568 Dimi*0745 CALL BBL_CALC_RHO(
0746 I theta, salt,
0747 O rhoInSitu,
0748 I k, bi, bj, myTime, myIter, myThid )
0749
d497465397 Jean*0750 ENDDO
0751 ENDIF
15338fa568 Dimi*0752 #endif /* ALLOW_BBL */
d497465397 Jean*0753 IF ( .NOT. ( useDOWN_SLOPE .OR. useBBL ) ) THEN
0754 DO k=1,Nr
842349fcb7 Jean*0755 CALL FIND_RHO_2D(
0756 I iMin, iMax, jMin, jMax, k,
0757 I theta(1-OLx,1-OLy,k,bi,bj),
0758 I salt (1-OLx,1-OLy,k,bi,bj),
0759 O rhoInSitu(1-OLx,1-OLy,k,bi,bj),
0760 I k, bi, bj, myThid )
d497465397 Jean*0761 ENDDO
0762 ENDIF
517dbdc414 Jean*0763 #ifdef ALLOW_AUTODIFF
d497465397 Jean*0764 ELSE
741260dd7e Jean*0765
d497465397 Jean*0766 DO k=1,Nr
34de4f2d34 Jean*0767 IF ( select_rStar.GE.1 .OR. selectSigmaCoord.GE.1 ) THEN
0768
0769 thetaRef = thetaConst
0770 ELSE
0771
0772 thetaRef = tRef(k)
0773 ENDIF
741260dd7e Jean*0774 DO j=1-OLy,sNy+OLy
0775 DO i=1-OLx,sNx+OLx
34de4f2d34 Jean*0776 rhoInSitu(i,j,k,bi,bj) =
0777 & ( theta(i,j,k,bi,bj)
0778 & *( salt(i,j,k,bi,bj)*atm_Rq + oneRL )
0779 & - thetaRef )*maskC(i,j,k,bi,bj)
741260dd7e Jean*0780 ENDDO
0781 ENDDO
d497465397 Jean*0782 ENDDO
0783 ENDIF
af61e5eb16 Mart*0784 # ifdef ALLOW_AUTODIFF_TAMC
0785
0786 # endif
517dbdc414 Jean*0787 #endif /* ALLOW_AUTODIFF */
1db41719d4 Jean*0788
d497465397 Jean*0789 #ifdef ALLOW_DEBUG
7eca977925 Jean*0790 IF (debugMode) THEN
0791 WRITE(msgBuf,'(A,2(I4,A))')
0792 & 'ENTERING UPWARD K LOOP (bi=', bi, ', bj=', bj,')'
0793 CALL DEBUG_MSG(msgBuf(1:43),myThid)
0794 ENDIF
d497465397 Jean*0795 #endif
0796
0797
0798 DO k=Nr,1,-1
0799
c842b53753 Jean*0800
0801
c8b8efc127 Jean*0802 IF ( calcGMRedi .OR. (k.GT.1 .AND. calcConvect)
d8d1486ca1 Jean*0803 & .OR. usePP81 .OR. useKL10
0804 & .OR. useMY82 .OR. useGGL90
b5aa60a554 Dimi*0805 & .OR. useSALT_PLUME .OR. doDiagsRho.GE.1 ) THEN
c842b53753 Jean*0806 IF (k.GT.1) THEN
0320e25227 Mart*0807 IF ( usingZCoords ) THEN
0808 DO j=jMin,jMax
0809 DO i=iMin,iMax
0810 rhoKp1(i,j) = rhoInSitu(i,j,k,bi,bj)
0811 ENDDO
0812 ENDDO
0813 CALL FIND_RHO_2D(
0f5ba23f97 Jean*0814 I iMin, iMax, jMin, jMax, k,
0815 I theta(1-OLx,1-OLy,k-1,bi,bj),
0816 I salt (1-OLx,1-OLy,k-1,bi,bj),
0817 O rhoKm1,
0818 I k-1, bi, bj, myThid )
0320e25227 Mart*0819 ELSE
0820 CALL FIND_RHO_2D(
0821 I iMin, iMax, jMin, jMax, k-1,
0822 I theta(1-OLx,1-OLy,k,bi,bj),
0823 I salt (1-OLx,1-OLy,k,bi,bj),
0824 O rhoKp1,
0825 I k, bi, bj, myThid )
0826 DO j=jMin,jMax
0827 DO i=iMin,iMax
0828 rhoKm1(i,j) = rhoInSitu(i,j,k-1,bi,bj)
0829 ENDDO
0830 ENDDO
0831 ENDIF
c842b53753 Jean*0832 ENDIF
0833 #ifdef ALLOW_DEBUG
8440e8ae5d Jean*0834 IF (debugMode) CALL DEBUG_CALL('GRAD_SIGMA',myThid)
c842b53753 Jean*0835 #endif
0836 CALL GRAD_SIGMA(
0837 I bi, bj, iMin, iMax, jMin, jMax, k,
842349fcb7 Jean*0838 I rhoInSitu(1-OLx,1-OLy,k,bi,bj), rhoKm1, rhoKp1,
c842b53753 Jean*0839 O sigmaX, sigmaY, sigmaR,
0840 I myThid )
f59d76b0dd Ed D*0841
cda1c18f72 Jean*0842 #ifdef ALLOW_LEITH_QG
ecaa45da39 An T*0843 DO j=jMin,jMax
0844 DO i=iMin,iMax
0845 sigmaRfield(i,j,k,bi,bj)=sigmaR(i,j,k)
0846 ENDDO
0847 ENDDO
cda1c18f72 Jean*0848 #endif /* ALLOW_LEITH_QG */
f59d76b0dd Ed D*0849
517dbdc414 Jean*0850 #ifdef ALLOW_AUTODIFF
1db41719d4 Jean*0851 #ifdef GMREDI_WITH_STABLE_ADJOINT
bc93e58d13 Gael*0852
0853
1db41719d4 Jean*0854 CALL ZERO_ADJ_LOC( Nr, sigmaX, myThid)
0855 CALL ZERO_ADJ_LOC( Nr, sigmaY, myThid)
0856 CALL ZERO_ADJ_LOC( Nr, sigmaR, myThid)
bc93e58d13 Gael*0857 #endif
517dbdc414 Jean*0858 #endif /* ALLOW_AUTODIFF */
c842b53753 Jean*0859 ENDIF
0860
0861
c8b8efc127 Jean*0862 IF (k.GT.1 .AND. calcConvect) THEN
c842b53753 Jean*0863 #ifdef ALLOW_DEBUG
8440e8ae5d Jean*0864 IF (debugMode) CALL DEBUG_CALL('CALC_IVDC',myThid)
c842b53753 Jean*0865 #endif
0866 CALL CALC_IVDC(
0867 I bi, bj, iMin, iMax, jMin, jMax, k,
da9b4e6c91 Mart*0868 I sigmaR,
c842b53753 Jean*0869 I myTime, myIter, myThid)
0870 ENDIF
0871
8ab93ea9a3 Jean*0872 #ifdef ALLOW_DIAGNOSTICS
d497465397 Jean*0873 IF ( doDiagsRho.GE.4 ) THEN
0874 CALL DIAGS_RHO_L( doDiagsRho, k, bi, bj,
0875 I rhoInSitu(1-OLx,1-OLy,1,bi,bj),
741260dd7e Jean*0876 I rhoKm1, wVel,
842349fcb7 Jean*0877 I myTime, myIter, myThid )
8ab93ea9a3 Jean*0878 ENDIF
0879 #endif
0880
c842b53753 Jean*0881
0882 ENDDO
0883
1e22f5fc71 Patr*0884 #ifdef ALLOW_AUTODIFF_TAMC
af61e5eb16 Mart*0885
0886
edb6656069 Mart*0887
1e22f5fc71 Patr*0888 #endif
0889
cf9e43202e Jean*0890
c8b8efc127 Jean*0891 IF ( calcGMRedi .OR. MOD(doDiagsRho,2).EQ.1 ) THEN
842349fcb7 Jean*0892 CALL CALC_OCE_MXLAYER(
0320e25227 Mart*0893 I rhoInSitu(1-OLx,1-OLy,kSrf,bi,bj), sigmaR,
842349fcb7 Jean*0894 I bi, bj, myTime, myIter, myThid )
cf9e43202e Jean*0895 ENDIF
7f82819bd8 Patr*0896
8c3259a14c Dimi*0897 #ifdef ALLOW_SALT_PLUME
b5aa60a554 Dimi*0898 IF ( useSALT_PLUME ) THEN
842349fcb7 Jean*0899 CALL SALT_PLUME_CALC_DEPTH(
0320e25227 Mart*0900 I rhoInSitu(1-OLx,1-OLy,kSrf,bi,bj), sigmaR,
842349fcb7 Jean*0901 I bi, bj, myTime, myIter, myThid )
1f89baba18 Patr*0902 #ifdef SALT_PLUME_VOLUME
0903 CALL SALT_PLUME_VOLFRAC(
0904 I bi, bj, myTime, myIter, myThid )
0905
0906 CALL SALT_PLUME_APPLY(
0320e25227 Mart*0907 I 1, bi, bj, recip_hFacC(1-OLx,1-OLy,kSrf,bi,bj),
1f89baba18 Patr*0908 I theta, 0,
0909 I myTime, myIter, myThid )
0910 CALL SALT_PLUME_APPLY(
0320e25227 Mart*0911 I 2, bi, bj, recip_hFacC(1-OLx,1-OLy,kSrf,bi,bj),
1f89baba18 Patr*0912 I salt, 0,
0913 I myTime, myIter, myThid )
0914
0915 CALL SALT_PLUME_FORCING_SURF(
0916 I bi, bj, iMin, iMax, jMin, jMax,
0917 I myTime, myIter, myThid )
0918 #endif /* SALT_PLUME_VOLUME */
e4775240e5 Dimi*0919 ENDIF
af61e5eb16 Mart*0920 # ifdef ALLOW_AUTODIFF_TAMC
0921
0922
0923 # endif /* ALLOW_AUTODIFF_TAMC */
b5aa60a554 Dimi*0924 #endif /* ALLOW_SALT_PLUME */
0925
9adfd21c8b Jean*0926 #ifdef ALLOW_DIAGNOSTICS
842349fcb7 Jean*0927 IF ( MOD(doDiagsRho,4).GE.2 ) THEN
f57fa1a615 Jean*0928 CALL DIAGNOSTICS_FILL (sigmaR, 'DRHODR ', 0, Nr,
0929 & 2, bi, bj, myThid)
9adfd21c8b Jean*0930 ENDIF
b5aa60a554 Dimi*0931 #endif /* ALLOW_DIAGNOSTICS */
9adfd21c8b Jean*0932
cb5aad258c Jean*0933
0934
c842b53753 Jean*0935
0936 #ifdef ALLOW_AUTODIFF_TAMC
0937
edb6656069 Mart*0938
0939
0940
0941
c842b53753 Jean*0942 #endif /* ALLOW_AUTODIFF_TAMC */
0943
0944 #ifdef ALLOW_KPP
0945
c8b8efc127 Jean*0946 IF ( calcKPP ) THEN
c842b53753 Jean*0947 #ifdef ALLOW_DEBUG
8440e8ae5d Jean*0948 IF (debugMode) CALL DEBUG_CALL('KPP_CALC',myThid)
c842b53753 Jean*0949 #endif
fe0f90ad2c Davi*0950 CALL TIMER_START('KPP_CALC [DO_OCEANIC_PHYS]', myThid)
c842b53753 Jean*0951 CALL KPP_CALC(
bbf50a7383 Jean*0952 I bi, bj, myTime, myIter, myThid )
fe0f90ad2c Davi*0953 CALL TIMER_STOP ('KPP_CALC [DO_OCEANIC_PHYS]', myThid)
517dbdc414 Jean*0954 #if (defined ALLOW_AUTODIFF) &&
c842b53753 Jean*0955 ELSE
0956 CALL KPP_CALC_DUMMY(
bbf50a7383 Jean*0957 I bi, bj, myTime, myIter, myThid )
517dbdc414 Jean*0958 #endif /* ALLOW_AUTODIFF and not ALLOW_OFFLINE */
c842b53753 Jean*0959 ENDIF
0960 #endif /* ALLOW_KPP */
0961
e864122ae8 Mart*0962 #ifdef ALLOW_PP81
0963
0964 IF (usePP81) THEN
0965 #ifdef ALLOW_DEBUG
8440e8ae5d Jean*0966 IF (debugMode) CALL DEBUG_CALL('PP81_CALC',myThid)
e864122ae8 Mart*0967 #endif
0968 CALL PP81_CALC(
728c245bbd Jean*0969 I bi, bj, sigmaR, myTime, myIter, myThid )
e864122ae8 Mart*0970 ENDIF
0971 #endif /* ALLOW_PP81 */
0972
d8d1486ca1 Jean*0973 #ifdef ALLOW_KL10
0974
0975 IF (useKL10) THEN
0976 #ifdef ALLOW_DEBUG
0977 IF (debugMode) CALL DEBUG_CALL('KL10_CALC',myThid)
0978 #endif
0979 CALL KL10_CALC(
0980 I bi, bj, sigmaR, myTime, myIter, myThid )
0981 ENDIF
0982 #endif /* ALLOW_KL10 */
0983
e864122ae8 Mart*0984 #ifdef ALLOW_MY82
0985
0986 IF (useMY82) THEN
0987 #ifdef ALLOW_DEBUG
8440e8ae5d Jean*0988 IF (debugMode) CALL DEBUG_CALL('MY82_CALC',myThid)
e864122ae8 Mart*0989 #endif
0990 CALL MY82_CALC(
728c245bbd Jean*0991 I bi, bj, sigmaR, myTime, myIter, myThid )
e864122ae8 Mart*0992 ENDIF
0993 #endif /* ALLOW_MY82 */
0994
69a7b27187 Mart*0995 #ifdef ALLOW_GGL90
2b52c649e6 Gael*0996 #ifdef ALLOW_AUTODIFF_TAMC
edb6656069 Mart*0997
2b52c649e6 Gael*0998 #endif /* ALLOW_AUTODIFF_TAMC */
69a7b27187 Mart*0999
0320e25227 Mart*1000 IF ( useGGL90 .AND. Nr.GT.1 ) THEN
69a7b27187 Mart*1001 #ifdef ALLOW_DEBUG
8440e8ae5d Jean*1002 IF (debugMode) CALL DEBUG_CALL('GGL90_CALC',myThid)
69a7b27187 Mart*1003 #endif
fe0f90ad2c Davi*1004 CALL TIMER_START('GGL90_CALC [DO_OCEANIC_PHYS]', myThid)
69a7b27187 Mart*1005 CALL GGL90_CALC(
728c245bbd Jean*1006 I bi, bj, sigmaR, myTime, myIter, myThid )
fe0f90ad2c Davi*1007 CALL TIMER_STOP ('GGL90_CALC [DO_OCEANIC_PHYS]', myThid)
69a7b27187 Mart*1008 ENDIF
1009 #endif /* ALLOW_GGL90 */
1010
c4e20a6b6c Jean*1011 #ifdef ALLOW_TIMEAVE
0ff4deb339 Jean*1012 IF ( taveFreq.GT. 0. _d 0 ) THEN
c4e20a6b6c Jean*1013 CALL TIMEAVE_SURF_FLUX( bi, bj, myTime, myIter, myThid)
1014 ENDIF
c8b8efc127 Jean*1015 IF ( taveFreq.GT.0. .AND. calcConvect ) THEN
c4e20a6b6c Jean*1016 CALL TIMEAVE_CUMULATE(ConvectCountTave, IVDConvCount,
70075a2466 Jean*1017 I Nr, deltaTClock, bi, bj, myThid)
c4e20a6b6c Jean*1018 ENDIF
1019 #endif /* ALLOW_TIMEAVE */
1020
1db41719d4 Jean*1021 #ifdef ALLOW_GMREDI
cf9e43202e Jean*1022 #ifdef ALLOW_AUTODIFF_TAMC
1023 # ifndef GM_EXCLUDE_CLIPPING
1024
1025
1026
ff02675122 Jean*1027
edb6656069 Mart*1028
1029
1030
cf9e43202e Jean*1031 # endif
1032 #endif /* ALLOW_AUTODIFF_TAMC */
1033
1034
c8b8efc127 Jean*1035 IF ( calcGMRedi ) THEN
cf9e43202e Jean*1036 #ifdef ALLOW_DEBUG
8440e8ae5d Jean*1037 IF (debugMode) CALL DEBUG_CALL('GMREDI_CALC_TENSOR',myThid)
cf9e43202e Jean*1038 #endif
1039 CALL GMREDI_CALC_TENSOR(
a0290d8c93 Jean*1040 I iMin, iMax, jMin, jMax,
cf9e43202e Jean*1041 I sigmaX, sigmaY, sigmaR,
a0290d8c93 Jean*1042 I bi, bj, myTime, myIter, myThid )
517dbdc414 Jean*1043 #if (defined ALLOW_AUTODIFF) &&
cf9e43202e Jean*1044 ELSE
1045 CALL GMREDI_CALC_TENSOR_DUMMY(
a0290d8c93 Jean*1046 I iMin, iMax, jMin, jMax,
cf9e43202e Jean*1047 I sigmaX, sigmaY, sigmaR,
a0290d8c93 Jean*1048 I bi, bj, myTime, myIter, myThid )
517dbdc414 Jean*1049 #endif /* ALLOW_AUTODIFF and not ALLOW_OFFLINE */
cf9e43202e Jean*1050 ENDIF
1db41719d4 Jean*1051 #endif /* ALLOW_GMREDI */
1052
1053 #ifdef ALLOW_DOWN_SLOPE
1054 IF ( useDOWN_SLOPE ) THEN
1055
1056 IF ( usingPCoords ) THEN
1057 CALL DWNSLP_CALC_FLOW(
842349fcb7 Jean*1058 I bi, bj, kSurfC, rhoInSitu,
1db41719d4 Jean*1059 I myTime, myIter, myThid )
1060 ELSE
1061 CALL DWNSLP_CALC_FLOW(
842349fcb7 Jean*1062 I bi, bj, kLowC, rhoInSitu,
1db41719d4 Jean*1063 I myTime, myIter, myThid )
1064 ENDIF
1065 ENDIF
1066 #endif /* ALLOW_DOWN_SLOPE */
cf9e43202e Jean*1067
3f38e138be Jean*1068
1069 ENDDO
1070 ENDDO
1071
517dbdc414 Jean*1072 #ifndef ALLOW_AUTODIFF
cb5aad258c Jean*1073
9e647b4f24 Jean*1074 ENDIF
1075 #endif
1076
dc2ebbdaf0 Jean*1077 #ifdef ALLOW_OFFLINE
1078 IF ( useOffLine ) THEN
1079 #ifdef ALLOW_DEBUG
1080 IF (debugMode) CALL DEBUG_CALL('OFFLINE_GET_DIFFUS',myThid)
1081 #endif /* ALLOW_DEBUG */
1082 CALL OFFLINE_GET_DIFFUS( myTime, myIter, myThid )
1083 ENDIF
1084 #endif /* ALLOW_OFFLINE */
1085
15338fa568 Dimi*1086 #ifdef ALLOW_BBL
1087 IF ( useBBL ) THEN
1088 CALL BBL_CALC_RHS(
1089 I myTime, myIter, myThid )
1090 ENDIF
1091 #endif /* ALLOW_BBL */
1092
5b0902e193 Dimi*1093 #ifdef ALLOW_MYPACKAGE
3f38e138be Jean*1094 IF ( useMYPACKAGE ) THEN
1095 CALL MYPACKAGE_CALC_RHS(
1096 I myTime, myIter, myThid )
1097 ENDIF
5b0902e193 Dimi*1098 #endif /* ALLOW_MYPACKAGE */
1099
9aea177344 Jean*1100 #ifdef ALLOW_GMREDI
c8b8efc127 Jean*1101 IF ( calcGMRedi ) THEN
9aea177344 Jean*1102 CALL GMREDI_DO_EXCH( myTime, myIter, myThid )
1103 ENDIF
1104 #endif /* ALLOW_GMREDI */
1105
0ce7a76723 Jean*1106 #ifdef ALLOW_KPP
c8b8efc127 Jean*1107 IF ( calcKPP ) THEN
133aa1e926 Jean*1108 CALL KPP_DO_EXCH( myThid )
1109 ENDIF
0ce7a76723 Jean*1110 #endif /* ALLOW_KPP */
133aa1e926 Jean*1111
0320e25227 Mart*1112 #ifdef ALLOW_GGL90
1113 IF ( useGGL90 )
1114 & CALL GGL90_EXCHANGES( myThid )
1115 #endif /* ALLOW_GGL90 */
1116
38ee7d4239 Jean*1117 #ifdef ALLOW_DIAGNOSTICS
1118 IF ( fluidIsWater .AND. useDiagnostics ) THEN
741260dd7e Jean*1119 CALL DIAGS_RHO_G(
d497465397 Jean*1120 I rhoInSitu, uVel, vVel, wVel,
842349fcb7 Jean*1121 I myTime, myIter, myThid )
c18b173e8a Jean*1122 ENDIF
1123 IF ( useDiagnostics ) THEN
38ee7d4239 Jean*1124 CALL DIAGS_OCEANIC_SURF_FLUX( myTime, myIter, myThid )
1125 ENDIF
c8b8efc127 Jean*1126 IF ( calcConvect .AND. useDiagnostics ) THEN
842349fcb7 Jean*1127 CALL DIAGNOSTICS_FILL( IVDConvCount, 'CONVADJ ',
1128 & 0, Nr, 0, 1, 1, myThid )
ad55014c08 Jean*1129 ENDIF
1f89baba18 Patr*1130 #ifdef ALLOW_SALT_PLUME
1131 IF ( useDiagnostics )
1132 & CALL SALT_PLUME_DIAGNOSTICS_FILL(bi,bj,myThid)
1133 #endif
38ee7d4239 Jean*1134 #endif
1135
c842b53753 Jean*1136 #ifdef ALLOW_DEBUG
8440e8ae5d Jean*1137 IF (debugMode) CALL DEBUG_LEAVE('DO_OCEANIC_PHYS',myThid)
c842b53753 Jean*1138 #endif
1139
1140 RETURN
1141 END