/[MITgcm]/MITgcm/model/src/thermodynamics.F
ViewVC logotype

Diff of /MITgcm/model/src/thermodynamics.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.11 by heimbach, Thu Sep 27 20:12:10 2001 UTC revision 1.18 by adcroft, Tue Mar 5 14:15:34 2002 UTC
# Line 151  C     This is currently used by IVDC and Line 151  C     This is currently used by IVDC and
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
# Line 344  CADJ STORE wvel (:,:,:,bi,bj) = comlev1_ Line 339  CADJ STORE wvel (:,:,:,bi,bj) = comlev1_
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
# Line 376  CADJ STORE sigmaR(:,:,:) = comlev1, key= Line 371  CADJ STORE sigmaR(:,:,:) = comlev1, key=
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    
# Line 445  C note(jmc) : phiHyd=0 at this point but Line 436  C note(jmc) : phiHyd=0 at this point but
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.
# Line 467  C       method in the absence of any oth Line 472  C       method in the absence of any oth
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
# Line 556  C        and step forward storing result Line 569  C        and step forward storing result
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
# Line 627  CADJ STORE gTr1(:,:,:,bi,bj) = comlev1_b Line 649  CADJ STORE gTr1(:,:,:,bi,bj) = comlev1_b
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
# Line 656  Ccs- Line 685  Ccs-
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

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.18

  ViewVC Help
Powered by ViewVC 1.1.22