/[MITgcm]/MITgcm/pkg/mom_vecinv/mom_vecinv.F
ViewVC logotype

Diff of /MITgcm/pkg/mom_vecinv/mom_vecinv.F

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

revision 1.78 by jmc, Wed Nov 30 00:11:22 2016 UTC revision 1.79 by gforget, Mon Mar 6 20:05:36 2017 UTC
# Line 249  C     Make local copies of horizontal fl Line 249  C     Make local copies of horizontal fl
249         ENDDO         ENDDO
250        ENDDO        ENDDO
251    
252    #ifdef ALLOW_AUTODIFF_TAMC
253    CADJ STORE ufld(:,:) =
254    CADJ &     comlev1_bibj_k, key = imomkey, byte = isbyte
255    CADJ STORE vfld(:,:) =
256    CADJ &     comlev1_bibj_k, key = imomkey, byte = isbyte
257    CADJ STORE hFacZ(:,:) =
258    CADJ &     comlev1_bibj_k, key = imomkey, byte = isbyte
259    CADJ STORE r_hFacZ(:,:) =
260    CADJ &     comlev1_bibj_k, key = imomkey, byte = isbyte
261    CADJ STORE fverukm(:,:) =
262    CADJ &     comlev1_bibj_k, key = imomkey, byte = isbyte
263    CADJ STORE fvervkm(:,:) =
264    CADJ &     comlev1_bibj_k, key = imomkey, byte = isbyte
265    #endif
266    
267  C note (jmc) : Dissipation and Vort3 advection do not necesary  C note (jmc) : Dissipation and Vort3 advection do not necesary
268  C              use the same maskZ (and hFacZ)  => needs 2 call(s)  C              use the same maskZ (and hFacZ)  => needs 2 call(s)
269  c     CALL MOM_VI_HFACZ_DISS(bi,bj,k,hFacZ,r_hFacZ,myThid)  c     CALL MOM_VI_HFACZ_DISS(bi,bj,k,hFacZ,r_hFacZ,myThid)
# Line 257  c     CALL MOM_VI_HFACZ_DISS(bi,bj,k,hFa Line 272  c     CALL MOM_VI_HFACZ_DISS(bi,bj,k,hFa
272    
273        CALL MOM_CALC_RELVORT3(bi,bj,k,uFld,vFld,hFacZ,vort3,myThid)        CALL MOM_CALC_RELVORT3(bi,bj,k,uFld,vFld,hFacZ,vort3,myThid)
274    
275    #ifdef ALLOW_AUTODIFF_TAMC
276    CADJ STORE ke(:,:) =
277    CADJ &     comlev1_bibj_k, key = imomkey, byte = isbyte
278    CADJ STORE vort3(:,:) =
279    CADJ &     comlev1_bibj_k, key = imomkey, byte = isbyte
280    CADJ STORE vort3bc(:,:) =
281    CADJ &     comlev1_bibj_k, key = imomkey, byte = isbyte
282    #endif
283    
284  C-    mask vort3 and account for no-slip / free-slip BC in vort3BC:  C-    mask vort3 and account for no-slip / free-slip BC in vort3BC:
285        DO j=1-OLy,sNy+OLy        DO j=1-OLy,sNy+OLy
286         DO i=1-OLx,sNx+OLx         DO i=1-OLx,sNx+OLx
# Line 268  C-    mask vort3 and account for no-slip Line 292  C-    mask vort3 and account for no-slip
292         ENDDO         ENDDO
293        ENDDO        ENDDO
294    
295    #ifdef ALLOW_AUTODIFF_TAMC
296    CADJ STORE vort3(:,:) =
297    CADJ &     comlev1_bibj_k, key = imomkey, byte = isbyte
298    CADJ STORE vort3bc(:,:) =
299    CADJ &     comlev1_bibj_k, key = imomkey, byte = isbyte
300    #endif
301    
302        IF (momViscosity) THEN        IF (momViscosity) THEN
303  C--    For viscous term, compute horizontal divergence, tension & strain  C--    For viscous term, compute horizontal divergence, tension & strain
304  C      and mask relative vorticity (free-slip case):  C      and mask relative vorticity (free-slip case):
# Line 289  C      and mask relative vorticity (free Line 320  C      and mask relative vorticity (free
320         ENDIF         ENDIF
321  #endif /* NONLIN_FRSURF */  #endif /* NONLIN_FRSURF */
322    
323    #ifdef ALLOW_AUTODIFF_TAMC
324    CADJ STORE h0FacZ(:,:) =
325    CADJ &     comlev1_bibj_k, key = imomkey, byte = isbyte
326    CADJ STORE hFacZ(:,:) =
327    CADJ &     comlev1_bibj_k, key = imomkey, byte = isbyte
328    #endif
329    
330         CALL MOM_CALC_HDIV(bi,bj,k,2,uFld,vFld,hDiv,myThid)         CALL MOM_CALC_HDIV(bi,bj,k,2,uFld,vFld,hDiv,myThid)
331    
332         IF ( useVariableVisc .OR. useStrainTensionVisc ) THEN         IF ( useVariableVisc .OR. useStrainTensionVisc ) THEN
# Line 306  C-    mask strain and account for no-sli Line 344  C-    mask strain and account for no-sli
344          ENDDO          ENDDO
345         ENDIF         ENDIF
346    
347    #ifdef ALLOW_AUTODIFF_TAMC
348    CADJ STORE hdiv(:,:) =
349    CADJ &     comlev1_bibj_k, key = imomkey, byte = isbyte
350    CADJ STORE tension(:,:) =
351    CADJ &     comlev1_bibj_k, key = imomkey, byte = isbyte
352    CADJ STORE strain(:,:) =
353    CADJ &     comlev1_bibj_k, key = imomkey, byte = isbyte
354    CADJ STORE strainbc(:,:) =
355    CADJ &     comlev1_bibj_k, key = imomkey, byte = isbyte
356    #endif
357    
358  C--    Calculate Lateral Viscosities  C--    Calculate Lateral Viscosities
359         DO j=1-OLy,sNy+OLy         DO j=1-OLy,sNy+OLy
360          DO i=1-OLx,sNx+OLx          DO i=1-OLx,sNx+OLx
# Line 323  C-     uses vort3BC & strainBC which acc Line 372  C-     uses vort3BC & strainBC which acc
372       I            myThid )       I            myThid )
373         ENDIF         ENDIF
374    
375    #ifdef ALLOW_AUTODIFF_TAMC
376    CADJ STORE viscAh_Z(:,:) =
377    CADJ &     comlev1_bibj_k, key = imomkey, byte = isbyte
378    CADJ STORE viscAh_D(:,:) =
379    CADJ &     comlev1_bibj_k, key = imomkey, byte = isbyte
380    CADJ STORE viscA4_Z(:,:) =
381    CADJ &     comlev1_bibj_k, key = imomkey, byte = isbyte
382    CADJ STORE viscA4_D(:,:) =
383    CADJ &     comlev1_bibj_k, key = imomkey, byte = isbyte
384    #endif
385    
386    #ifdef ALLOW_AUTODIFF_TAMC
387    CADJ STORE hDiv(:,:) =
388    CADJ &     comlev1_bibj_k, key = imomkey, byte = isbyte
389    CADJ STORE vort3(:,:) =
390    CADJ &     comlev1_bibj_k, key = imomkey, byte = isbyte
391    CADJ STORE hFacZ(:,:) =
392    CADJ &     comlev1_bibj_k, key = imomkey, byte = isbyte
393    #endif
394    
395  C      Calculate del^2 u and del^2 v for bi-harmonic term  C      Calculate del^2 u and del^2 v for bi-harmonic term
396         IF (useBiharmonicVisc) THEN         IF (useBiharmonicVisc) THEN
397           CALL MOM_VI_DEL2UV(bi,bj,k,hDiv,vort3,hFacZ,           CALL MOM_VI_DEL2UV(bi,bj,k,hDiv,vort3,hFacZ,
398       O                      del2u,del2v,       O                      del2u,del2v,
399       I                      myThid)       I                      myThid)
400    #ifdef ALLOW_AUTODIFF_TAMC
401    CADJ STORE del2u(:,:) =
402    CADJ &     comlev1_bibj_k, key = imomkey, byte = isbyte
403    CADJ STORE del2v(:,:) =
404    CADJ &     comlev1_bibj_k, key = imomkey, byte = isbyte
405    #endif
406           CALL MOM_CALC_HDIV(bi,bj,k,2,del2u,del2v,dStar,myThid)           CALL MOM_CALC_HDIV(bi,bj,k,2,del2u,del2v,dStar,myThid)
407           CALL MOM_CALC_RELVORT3(bi,bj,k,           CALL MOM_CALC_RELVORT3(bi,bj,k,
408       &                          del2u,del2v,hFacZ,zStar,myThid)       &                          del2u,del2v,hFacZ,zStar,myThid)
409         ENDIF         ENDIF
410    
411    #ifdef ALLOW_AUTODIFF_TAMC
412    CADJ STORE del2u(:,:) =
413    CADJ &     comlev1_bibj_k, key = imomkey, byte = isbyte
414    CADJ STORE del2v(:,:) =
415    CADJ &     comlev1_bibj_k, key = imomkey, byte = isbyte
416    CADJ STORE dStar(:,:) =
417    CADJ &     comlev1_bibj_k, key = imomkey, byte = isbyte
418    CADJ STORE zStar(:,:) =
419    CADJ &     comlev1_bibj_k, key = imomkey, byte = isbyte
420    #endif
421    
422  C---   Calculate dissipation terms for U and V equations  C---   Calculate dissipation terms for U and V equations
423    
424  C-     in terms of tension and strain  C-     in terms of tension and strain
# Line 366  C     Combine fluxes Line 452  C     Combine fluxes
452           fVerUkp(i,j) = ArDudrFac*vrF(i,j)           fVerUkp(i,j) = ArDudrFac*vrF(i,j)
453          ENDDO          ENDDO
454         ENDDO         ENDDO
455    
456    #ifdef ALLOW_AUTODIFF_TAMC
457    CADJ STORE fVerUkp(:,:) =
458    CADJ &     comlev1_bibj_k, key = imomkey, byte = isbyte
459    #endif
460    
461  C--   Tendency is minus divergence of the fluxes  C--   Tendency is minus divergence of the fluxes
462  C     vert.visc.flx is scaled by deepFac2F (deep-atmos) and rhoFac (anelastic)  C     vert.visc.flx is scaled by deepFac2F (deep-atmos) and rhoFac (anelastic)
463         DO j=jMin,jMax         DO j=jMin,jMax
# Line 433  C     Combine fluxes -> fVerV Line 525  C     Combine fluxes -> fVerV
525           fVerVkp(i,j) = ArDvdrFac*vrF(i,j)           fVerVkp(i,j) = ArDvdrFac*vrF(i,j)
526          ENDDO          ENDDO
527         ENDDO         ENDDO
528    #ifdef ALLOW_AUTODIFF_TAMC
529    CADJ STORE fVerVkp(:,:) =
530    CADJ &     comlev1_bibj_k, key = imomkey, byte = isbyte
531    #endif
532  C--   Tendency is minus divergence of the fluxes  C--   Tendency is minus divergence of the fluxes
533  C     vert.visc.flx is scaled by deepFac2F (deep-atmos) and rhoFac (anelastic)  C     vert.visc.flx is scaled by deepFac2F (deep-atmos) and rhoFac (anelastic)
534         DO j=jMin,jMax         DO j=jMin,jMax
# Line 501  C-    calculate absolute vorticity Line 597  C-    calculate absolute vorticity
597        IF (useAbsVorticity)        IF (useAbsVorticity)
598       &  CALL MOM_CALC_ABSVORT3(bi,bj,k,vort3,omega3,myThid)       &  CALL MOM_CALC_ABSVORT3(bi,bj,k,vort3,omega3,myThid)
599    
600    #ifdef ALLOW_AUTODIFF_TAMC
601    CADJ STORE omega3(:,:) =
602    CADJ &     comlev1_bibj_k, key = imomkey, byte = isbyte
603    #endif
604    
605  C--   Horizontal Coriolis terms  C--   Horizontal Coriolis terms
606  c     IF (useCoriolis .AND. .NOT.useCDscheme  c     IF (useCoriolis .AND. .NOT.useCDscheme
607  c    &    .AND. .NOT. useAbsVorticity) THEN  c    &    .AND. .NOT. useAbsVorticity) THEN
# Line 552  C- jmc: change it to keep the Coriolis t Line 653  C- jmc: change it to keep the Coriolis t
653         ENDDO         ENDDO
654        ENDIF        ENDIF
655    
656    #ifdef ALLOW_AUTODIFF_TAMC
657    CADJ STORE ucf(:,:) =
658    CADJ &     comlev1_bibj_k, key = imomkey, byte = isbyte
659    CADJ STORE vcf(:,:) =
660    CADJ &     comlev1_bibj_k, key = imomkey, byte = isbyte
661    #endif
662    
663        IF (momAdvection) THEN        IF (momAdvection) THEN
664  C--   Horizontal advection of relative (or absolute) vorticity  C--   Horizontal advection of relative (or absolute) vorticity
665         IF ( (highOrderVorticity.OR.upwindVorticity)         IF ( (highOrderVorticity.OR.upwindVorticity)
# Line 593  C--   Horizontal advection of relative ( Line 701  C--   Horizontal advection of relative (
701          ENDDO          ENDDO
702         ENDDO         ENDDO
703    
704    #ifdef ALLOW_AUTODIFF_TAMC
705    CADJ STORE ucf(:,:) =
706    CADJ &     comlev1_bibj_k, key = imomkey, byte = isbyte
707    CADJ STORE vcf(:,:) =
708    CADJ &     comlev1_bibj_k, key = imomkey, byte = isbyte
709    #endif
710    
711         IF ( writeDiag ) THEN         IF ( writeDiag ) THEN
712           IF (snapshot_mdsio) THEN           IF (snapshot_mdsio) THEN
713             CALL WRITE_LOCAL_RL('zV','I10',1,uCf,bi,bj,k,myIter,myThid)             CALL WRITE_LOCAL_RL('zV','I10',1,uCf,bi,bj,k,myIter,myThid)

Legend:
Removed from v.1.78  
changed lines
  Added in v.1.79

  ViewVC Help
Powered by ViewVC 1.1.22