81 |
#ifdef ALLOW_PASSIVE_TRACER |
#ifdef ALLOW_PASSIVE_TRACER |
82 |
#include "TR1.h" |
#include "TR1.h" |
83 |
#endif |
#endif |
84 |
|
#ifdef ALLOW_OFFLINE |
85 |
|
#include "OFFLINE.h" |
86 |
|
#endif |
87 |
#ifdef ALLOW_PTRACERS |
#ifdef ALLOW_PTRACERS |
88 |
#include "PTRACERS_SIZE.h" |
#include "PTRACERS_SIZE.h" |
89 |
#include "PTRACERS.h" |
#include "PTRACERS.h" |
108 |
# endif |
# endif |
109 |
#endif /* ALLOW_AUTODIFF_TAMC */ |
#endif /* ALLOW_AUTODIFF_TAMC */ |
110 |
|
|
111 |
|
|
112 |
C !INPUT/OUTPUT PARAMETERS: |
C !INPUT/OUTPUT PARAMETERS: |
113 |
C == Routine arguments == |
C == Routine arguments == |
114 |
C myTime - Current time in simulation |
C myTime - Current time in simulation |
318 |
C recomputation. It *is* differentiable, if you need it. |
C recomputation. It *is* differentiable, if you need it. |
319 |
C Edit GAD_OPTIONS.h and #define DISABLE_MULTIDIM_ADVECTION to |
C Edit GAD_OPTIONS.h and #define DISABLE_MULTIDIM_ADVECTION to |
320 |
C disable this section of code. |
C disable this section of code. |
321 |
|
#ifndef ALLOW_OFFLINE |
322 |
IF (tempMultiDimAdvec) THEN |
IF (tempMultiDimAdvec) THEN |
323 |
#ifdef ALLOW_DEBUG |
#ifdef ALLOW_DEBUG |
324 |
IF ( debugLevel .GE. debLevB ) |
IF ( debugLevel .GE. debLevB ) |
331 |
O gT, |
O gT, |
332 |
I bi,bj,myTime,myIter,myThid) |
I bi,bj,myTime,myIter,myThid) |
333 |
ENDIF |
ENDIF |
334 |
|
#endif |
335 |
|
#ifndef ALLOW_OFFLINE |
336 |
IF (saltMultiDimAdvec) THEN |
IF (saltMultiDimAdvec) THEN |
337 |
#ifdef ALLOW_DEBUG |
#ifdef ALLOW_DEBUG |
338 |
IF ( debugLevel .GE. debLevB ) |
IF ( debugLevel .GE. debLevB ) |
345 |
O gS, |
O gS, |
346 |
I bi,bj,myTime,myIter,myThid) |
I bi,bj,myTime,myIter,myThid) |
347 |
ENDIF |
ENDIF |
348 |
|
#endif |
349 |
C Since passive tracers are configurable separately from T,S we |
C Since passive tracers are configurable separately from T,S we |
350 |
C call the multi-dimensional method for PTRACERS regardless |
C call the multi-dimensional method for PTRACERS regardless |
351 |
C of whether multiDimAdvection is set or not. |
C of whether multiDimAdvection is set or not. |
460 |
|
|
461 |
C-- Calculate active tracer tendencies (gT,gS,...) |
C-- Calculate active tracer tendencies (gT,gS,...) |
462 |
C and step forward storing result in gTnm1, gSnm1, etc. |
C and step forward storing result in gTnm1, gSnm1, etc. |
463 |
|
#ifndef ALLOW_OFFLINE |
464 |
IF ( tempStepping ) THEN |
IF ( tempStepping ) THEN |
465 |
CALL CALC_GT( |
CALL CALC_GT( |
466 |
I bi,bj,iMin,iMax,jMin,jMax, k,km1,kup,kDown, |
I bi,bj,iMin,iMax,jMin,jMax, k,km1,kup,kDown, |
473 |
I theta, gT, |
I theta, gT, |
474 |
I myIter, myThid) |
I myIter, myThid) |
475 |
ENDIF |
ENDIF |
476 |
|
#endif |
477 |
|
|
478 |
|
#ifndef ALLOW_OFFLINE |
479 |
IF ( saltStepping ) THEN |
IF ( saltStepping ) THEN |
480 |
CALL CALC_GS( |
CALL CALC_GS( |
481 |
I bi,bj,iMin,iMax,jMin,jMax, k,km1,kup,kDown, |
I bi,bj,iMin,iMax,jMin,jMax, k,km1,kup,kDown, |
488 |
I salt, gS, |
I salt, gS, |
489 |
I myIter, myThid) |
I myIter, myThid) |
490 |
ENDIF |
ENDIF |
491 |
|
#endif |
492 |
#ifdef ALLOW_PASSIVE_TRACER |
#ifdef ALLOW_PASSIVE_TRACER |
493 |
ceh3 needs an IF ( usePASSIVE_TRACER ) THEN |
ceh3 needs an IF ( usePASSIVE_TRACER ) THEN |
494 |
IF ( tr1Stepping ) THEN |
IF ( tr1Stepping ) THEN |
524 |
C-- Freeze water |
C-- Freeze water |
525 |
C this bit of code is left here for backward compatibility. |
C this bit of code is left here for backward compatibility. |
526 |
C freezing at surface level has been moved to FORWARD_STEP |
C freezing at surface level has been moved to FORWARD_STEP |
527 |
|
#ifndef ALLOW_OFFLINE |
528 |
IF ( useOldFreezing .AND. .NOT. useSEAICE |
IF ( useOldFreezing .AND. .NOT. useSEAICE |
529 |
& .AND. .NOT.(useThSIce.AND.k.EQ.1) ) THEN |
& .AND. .NOT.(useThSIce.AND.k.EQ.1) ) THEN |
530 |
#ifdef ALLOW_AUTODIFF_TAMC |
#ifdef ALLOW_AUTODIFF_TAMC |
533 |
#endif /* ALLOW_AUTODIFF_TAMC */ |
#endif /* ALLOW_AUTODIFF_TAMC */ |
534 |
CALL FREEZE( bi, bj, iMin, iMax, jMin, jMax, k, myThid ) |
CALL FREEZE( bi, bj, iMin, iMax, jMin, jMax, k, myThid ) |
535 |
ENDIF |
ENDIF |
536 |
|
#endif |
537 |
|
|
538 |
C-- end of thermodynamic k loop (Nr:1) |
C-- end of thermodynamic k loop (Nr:1) |
539 |
ENDDO |
ENDDO |
540 |
|
|
541 |
|
|
542 |
C-- Implicit vertical advection & diffusion |
C-- Implicit vertical advection & diffusion |
543 |
|
#ifndef ALLOW_OFFLINE |
544 |
#ifdef INCLUDE_IMPLVERTADV_CODE |
#ifdef INCLUDE_IMPLVERTADV_CODE |
545 |
IF ( tempImplVertAdv ) THEN |
IF ( tempImplVertAdv ) THEN |
546 |
CALL GAD_IMPLICIT_R( |
CALL GAD_IMPLICIT_R( |
562 |
U gT, |
U gT, |
563 |
I myThid ) |
I myThid ) |
564 |
ENDIF |
ENDIF |
565 |
|
#endif |
566 |
|
|
567 |
|
#ifndef ALLOW_OFFLINE |
568 |
#ifdef INCLUDE_IMPLVERTADV_CODE |
#ifdef INCLUDE_IMPLVERTADV_CODE |
569 |
IF ( saltImplVertAdv ) THEN |
IF ( saltImplVertAdv ) THEN |
570 |
CALL GAD_IMPLICIT_R( |
CALL GAD_IMPLICIT_R( |
586 |
U gS, |
U gS, |
587 |
I myThid ) |
I myThid ) |
588 |
ENDIF |
ENDIF |
589 |
|
#endif |
590 |
|
|
591 |
#ifdef ALLOW_PASSIVE_TRACER |
#ifdef ALLOW_PASSIVE_TRACER |
592 |
IF ( tr1Stepping .AND. implicitDiffusion ) THEN |
IF ( tr1Stepping .AND. implicitDiffusion ) THEN |