/[MITgcm]/MITgcm/pkg/mom_common/mom_calc_visc.F
ViewVC logotype

Diff of /MITgcm/pkg/mom_common/mom_calc_visc.F

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

revision 1.21 by heimbach, Thu Nov 24 00:06:37 2005 UTC revision 1.22 by heimbach, Wed May 31 19:53:15 2006 UTC
# Line 207  C     == Local variables == Line 207  C     == Local variables ==
207        ENDIF        ENDIF
208    
209  #ifdef ALLOW_AUTODIFF_TAMC  #ifdef ALLOW_AUTODIFF_TAMC
210         DO j=1-Oly,sNy+Oly        IF ( calcLeith .OR. calcSmag ) THEN
211           STOP 'calcLeith or calcSmag not implemented for ADJOINT'
212          ENDIF
213          DO j=1-Oly,sNy+Oly
214          DO i=1-Olx,sNx+Olx          DO i=1-Olx,sNx+Olx
215            viscAh_D(i,j)=viscAhD            viscAh_D(i,j)=viscAhD
216            viscAh_Z(i,j)=viscAhZ            viscAh_Z(i,j)=viscAhZ
# Line 230  c Line 233  c
233            viscAh_ZLthD(i,j)= 0. _d 0            viscAh_ZLthD(i,j)= 0. _d 0
234            viscA4_ZLthD(i,j)= 0. _d 0            viscA4_ZLthD(i,j)= 0. _d 0
235          ENDDO          ENDDO
236         ENDDO        ENDDO
237  #endif  #endif
238    
239    
240    
241  C     - Viscosity  C     - Viscosity
242        IF (useVariableViscosity) THEN        IF (useVariableViscosity) THEN
 cph(  
 #ifndef ALLOW_AUTODIFF_TAMC  
 cph)  
243    
244  C-     Initialise to zero gradient of vorticity & divergence:  C-     Initialise to zero gradient of vorticity & divergence:
245         DO j=1-Oly,sNy+Oly         DO j=1-Oly,sNy+Oly
# Line 337  C Velocity Reynolds Scale Line 337  C Velocity Reynolds Scale
337             U4scl=0.             U4scl=0.
338           ENDIF           ENDIF
339    
340    #ifndef ALLOW_AUTODIFF_TAMC
341           IF (useFullLeith.and.calcleith) THEN           IF (useFullLeith.and.calcleith) THEN
342  C This is the vector magnitude of the vorticity gradient squared  C This is the vector magnitude of the vorticity gradient squared
343            grdVrt=0.25 _d 0*( (vrtDx(i,j+1)*vrtDx(i,j+1)            grdVrt=0.25 _d 0*( (vrtDx(i,j+1)*vrtDx(i,j+1)
# Line 382  c This approximation is good to the same Line 383  c This approximation is good to the same
383            viscA4_DlthD(i,j)=0. _d 0            viscA4_DlthD(i,j)=0. _d 0
384           ENDIF           ENDIF
385    
   
386           IF (calcsmag) THEN           IF (calcsmag) THEN
387            viscAh_DSmg(i,j)=L2            viscAh_DSmg(i,j)=L2
388       &       *sqrt(tension(i,j)**2       &       *sqrt(tension(i,j)**2
# Line 394  c This approximation is good to the same Line 394  c This approximation is good to the same
394            viscAh_DSmg(i,j)=0. _d 0            viscAh_DSmg(i,j)=0. _d 0
395            viscA4_DSmg(i,j)=0. _d 0            viscA4_DSmg(i,j)=0. _d 0
396           ENDIF           ENDIF
397    #endif /* ALLOW_AUTODIFF_TAMC */
398    
399  C  Harmonic on Div.u points  C  Harmonic on Div.u points
400           Alin=viscAhD+viscAhGrid*L2rdt           Alin=viscAhD+viscAhGrid*L2rdt
# Line 448  C Velocity Reynolds Scale (Pb here at CS Line 449  C Velocity Reynolds Scale (Pb here at CS
449             U4scl=0.             U4scl=0.
450           ENDIF           ENDIF
451    
452    #ifndef ALLOW_AUTODIFF_TAMC
453  C This is the vector magnitude of the vorticity gradient squared  C This is the vector magnitude of the vorticity gradient squared
454           IF (useFullLeith.and.calcleith) THEN           IF (useFullLeith.and.calcleith) THEN
455            grdVrt=0.25 _d 0*( (vrtDx(i-1,j)*vrtDx(i-1,j)            grdVrt=0.25 _d 0*( (vrtDx(i-1,j)*vrtDx(i-1,j)
# Line 499  C but this approximation will work on cu Line 501  C but this approximation will work on cu
501            viscA4_ZSmg(i,j)=smag4fac*L2*viscAh_ZSmg(i,j)            viscA4_ZSmg(i,j)=smag4fac*L2*viscAh_ZSmg(i,j)
502            viscAh_ZSmg(i,j)=smag2fac*viscAh_ZSmg(i,j)            viscAh_ZSmg(i,j)=smag2fac*viscAh_ZSmg(i,j)
503           ENDIF           ENDIF
504    #endif /* ALLOW_AUTODIFF_TAMC */
505    
506  C  Harmonic on Zeta points  C  Harmonic on Zeta points
507           Alin=viscAhZ+viscAhGrid*L2rdt           Alin=viscAhZ+viscAhGrid*L2rdt
# Line 517  C  BiHarmonic on Zeta points Line 520  C  BiHarmonic on Zeta points
520           viscA4_Z(i,j)=min(viscA4_ZMax(i,j),viscA4_Z(i,j))           viscA4_Z(i,j)=min(viscA4_ZMax(i,j),viscA4_Z(i,j))
521          ENDDO          ENDDO
522         ENDDO         ENDDO
 cph(  
 #else  
        STOP 'useVariableViscosity not implemented for ADJOINT'  
 #endif /* ndef ALLOW_AUTODIFF_TAMC */  
 cph)  
523        ELSE        ELSE
524         DO j=1-Oly,sNy+Oly         DO j=1-Oly,sNy+Oly
525          DO i=1-Olx,sNx+Olx          DO i=1-Olx,sNx+Olx
# Line 533  cph) Line 531  cph)
531         ENDDO         ENDDO
532        ENDIF        ENDIF
533    
534    
535  #ifdef ALLOW_DIAGNOSTICS  #ifdef ALLOW_DIAGNOSTICS
536        IF (useDiagnostics) THEN        IF (useDiagnostics) THEN
537         CALL DIAGNOSTICS_FILL(viscAh_D,'VISCAHD ',k,1,2,bi,bj,myThid)         CALL DIAGNOSTICS_FILL(viscAh_D,'VISCAHD ',k,1,2,bi,bj,myThid)

Legend:
Removed from v.1.21  
changed lines
  Added in v.1.22

  ViewVC Help
Powered by ViewVC 1.1.22