151 |
INTEGER i, j |
INTEGER i, j |
152 |
INTEGER k, km1, kup, kDown |
INTEGER k, km1, kup, kDown |
153 |
|
|
|
Cjmc : add for phiHyd output <- but not working if multi tile per CPU |
|
|
c CHARACTER*(MAX_LEN_MBUF) suff |
|
|
c LOGICAL DIFFERENT_MULTIPLE |
|
|
c EXTERNAL DIFFERENT_MULTIPLE |
|
|
Cjmc(end) |
|
154 |
CEOP |
CEOP |
155 |
|
|
156 |
#ifdef ALLOW_AUTODIFF_TAMC |
#ifdef ALLOW_AUTODIFF_TAMC |
339 |
#ifdef ALLOW_OBCS |
#ifdef ALLOW_OBCS |
340 |
C-- Calculate future values on open boundaries |
C-- Calculate future values on open boundaries |
341 |
IF (useOBCS) THEN |
IF (useOBCS) THEN |
342 |
CALL OBCS_CALC( bi, bj, myTime+deltaT, |
CALL OBCS_CALC( bi, bj, myTime+deltaT, myIter+1, |
343 |
I uVel, vVel, wVel, theta, salt, |
I uVel, vVel, wVel, theta, salt, |
344 |
I myThid ) |
I myThid ) |
345 |
ENDIF |
ENDIF |
371 |
#endif /* ALLOW_AUTODIFF_TAMC */ |
#endif /* ALLOW_AUTODIFF_TAMC */ |
372 |
C-- Calculate iso-neutral slopes for the GM/Redi parameterisation |
C-- Calculate iso-neutral slopes for the GM/Redi parameterisation |
373 |
IF (useGMRedi) THEN |
IF (useGMRedi) THEN |
374 |
DO k=1,Nr |
CALL GMREDI_CALC_TENSOR( |
375 |
CALL GMREDI_CALC_TENSOR( |
I bi, bj, iMin, iMax, jMin, jMax, |
|
I bi, bj, iMin, iMax, jMin, jMax, k, |
|
376 |
I sigmaX, sigmaY, sigmaR, |
I sigmaX, sigmaY, sigmaR, |
377 |
I myThid ) |
I myThid ) |
|
ENDDO |
|
378 |
#ifdef ALLOW_AUTODIFF_TAMC |
#ifdef ALLOW_AUTODIFF_TAMC |
379 |
ELSE |
ELSE |
380 |
DO k=1, Nr |
CALL GMREDI_CALC_TENSOR_DUMMY( |
381 |
CALL GMREDI_CALC_TENSOR_DUMMY( |
I bi, bj, iMin, iMax, jMin, jMax, |
|
I bi, bj, iMin, iMax, jMin, jMax, k, |
|
382 |
I sigmaX, sigmaY, sigmaR, |
I sigmaX, sigmaY, sigmaR, |
383 |
I myThid ) |
I myThid ) |
|
ENDDO |
|
384 |
#endif /* ALLOW_AUTODIFF_TAMC */ |
#endif /* ALLOW_AUTODIFF_TAMC */ |
385 |
ENDIF |
ENDIF |
386 |
|
|
436 |
ENDIF |
ENDIF |
437 |
#endif /* ALLOW_AIM */ |
#endif /* ALLOW_AIM */ |
438 |
|
|
439 |
|
#ifdef ALLOW_TIMEAVE |
440 |
|
IF (taveFreq.GT.0. .AND. ivdc_kappa.NE.0.) THEN |
441 |
|
CALL TIMEAVE_CUMULATE(ConvectCountTave, ConvectCount, Nr, |
442 |
|
I deltaTclock, bi, bj, myThid) |
443 |
|
ENDIF |
444 |
|
#endif /* ALLOW_TIMEAVE */ |
445 |
|
|
446 |
|
#ifndef DISABLE_MULTIDIM_ADVECTION |
447 |
C-- Some advection schemes are better calculated using a multi-dimensional |
C-- Some advection schemes are better calculated using a multi-dimensional |
448 |
C method in the absence of any other terms and, if used, is done here. |
C method in the absence of any other terms and, if used, is done here. |
449 |
|
C |
450 |
#ifdef ALLOW_MULTIDIM_ADVECTION |
C The CPP flag DISABLE_MULTIDIM_ADVECTION is currently unset in GAD_OPTIONS.h |
451 |
|
C The default is to use multi-dimensinal advection for non-linear advection |
452 |
|
C schemes. However, for the sake of efficiency of the adjoint it is necessary |
453 |
|
C to be able to exclude this scheme to avoid excessive storage and |
454 |
|
C recomputation. It *is* differentiable, if you need it. |
455 |
|
C Edit GAD_OPTIONS.h and #define DISABLE_MULTIDIM_ADVECTION to |
456 |
|
C disable this section of code. |
457 |
IF (multiDimAdvection) THEN |
IF (multiDimAdvection) THEN |
458 |
IF (tempStepping .AND. |
IF (tempStepping .AND. |
459 |
& tempAdvScheme.NE.ENUM_CENTERED_2ND .AND. |
& tempAdvScheme.NE.ENUM_CENTERED_2ND .AND. |
472 |
I myTime,myIter,myThid) |
I myTime,myIter,myThid) |
473 |
ENDIF |
ENDIF |
474 |
ENDIF |
ENDIF |
475 |
#endif /* ALLOW_MULTIDIM_ADVECTION */ |
C Since passive tracers are configurable separately from T,S we |
476 |
|
C call the multi-dimensional method for PTRACERS regardless |
477 |
|
C of whether multiDimAdvection is set or not. |
478 |
|
#ifdef ALLOW_PTRACERS |
479 |
|
IF ( usePTRACERS ) THEN |
480 |
|
CALL PTRACERS_ADVECTION( bi,bj,myIter,myTime,myThid ) |
481 |
|
ENDIF |
482 |
|
#endif /* ALLOW_PTRACERS */ |
483 |
|
#endif /* DISABLE_MULTIDIM_ADVECTION */ |
484 |
|
|
485 |
C-- Start of thermodynamics loop |
C-- Start of thermodynamics loop |
486 |
DO k=Nr,1,-1 |
DO k=Nr,1,-1 |
569 |
I myIter,myThid) |
I myIter,myThid) |
570 |
ENDIF |
ENDIF |
571 |
#endif |
#endif |
572 |
|
#ifdef ALLOW_PTRACERS |
573 |
|
IF ( usePTRACERS ) THEN |
574 |
|
CALL PTRACERS_INTEGERATE( |
575 |
|
I bi,bj,k, |
576 |
|
I xA,yA,uTrans,vTrans,rTrans,maskUp, |
577 |
|
X KappaRS, |
578 |
|
I myIter,myTime,myThid) |
579 |
|
ENDIF |
580 |
|
#endif /* ALLOW_PTRACERS */ |
581 |
|
|
582 |
#ifdef ALLOW_OBCS |
#ifdef ALLOW_OBCS |
583 |
C-- Apply open boundary conditions |
C-- Apply open boundary conditions |
649 |
ENDIF |
ENDIF |
650 |
#endif |
#endif |
651 |
|
|
652 |
|
#ifdef ALLOW_PTRACERS |
653 |
|
C Vertical diffusion (implicit) for passive tracers |
654 |
|
IF ( usePTRACERS ) THEN |
655 |
|
CALL PTRACERS_IMPLDIFF( bi,bj,KappaRS,myThid ) |
656 |
|
ENDIF |
657 |
|
#endif /* ALLOW_PTRACERS */ |
658 |
|
|
659 |
#ifdef ALLOW_OBCS |
#ifdef ALLOW_OBCS |
660 |
C-- Apply open boundary conditions |
C-- Apply open boundary conditions |
661 |
IF (useOBCS) THEN |
IF (useOBCS) THEN |
685 |
ENDIF |
ENDIF |
686 |
#endif /* ALLOW_AIM */ |
#endif /* ALLOW_AIM */ |
687 |
|
|
688 |
|
#ifndef DISABLE_DEBUGMODE |
689 |
|
If (debugMode) THEN |
690 |
|
CALL DEBUG_STATS_RL(Nr,uVel,'Uvel (THERMODYNAMICS)',myThid) |
691 |
|
CALL DEBUG_STATS_RL(Nr,vVel,'Vvel (THERMODYNAMICS)',myThid) |
692 |
|
CALL DEBUG_STATS_RL(Nr,wVel,'Wvel (THERMODYNAMICS)',myThid) |
693 |
|
CALL DEBUG_STATS_RL(Nr,theta,'Theta (THERMODYNAMICS)',myThid) |
694 |
|
CALL DEBUG_STATS_RL(Nr,salt,'Salt (THERMODYNAMICS)',myThid) |
695 |
|
CALL DEBUG_STATS_RL(Nr,Gt,'Gt (THERMODYNAMICS)',myThid) |
696 |
|
CALL DEBUG_STATS_RL(Nr,Gs,'Gs (THERMODYNAMICS)',myThid) |
697 |
|
CALL DEBUG_STATS_RL(Nr,GtNm1,'GtNm1 (THERMODYNAMICS)',myThid) |
698 |
|
CALL DEBUG_STATS_RL(Nr,GsNm1,'GsNm1 (THERMODYNAMICS)',myThid) |
699 |
|
#ifdef ALLOW_PTRACERS |
700 |
|
IF ( usePTRACERS ) THEN |
701 |
|
CALL PTRACERS_DEBUG(myThid) |
702 |
|
ENDIF |
703 |
|
#endif /* ALLOW_PTRACERS */ |
704 |
|
ENDIF |
705 |
|
#endif |
706 |
|
|
707 |
RETURN |
RETURN |
708 |
END |
END |