Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions global_oce_cs32/code/GGL90_OPTIONS.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,19 @@ C Use horizontal averaging for viscosity and diffusivity as
C originally implemented in OPA.
#define ALLOW_GGL90_SMOOTH

C allow IDEMIX model
#undef ALLOW_GGL90_IDEMIX
#ifdef ALLOW_GGL90_IDEMIX
C The cvmix version of idemix uses different regularisations for the
C Coriolis parameter, buoyancy frequency etc, when used in the denominator
# define GGL90_IDEMIX_CVMIX_VERSION
#endif

C include Langmuir circulation parameterization
#undef ALLOW_GGL90_LANGMUIR

C recover old bug prior to Jun 2023
#undef GGL90_MISSING_HFAC_BUG

#endif /* ALLOW_GGL90 */
#endif /* GGL90_OPTIONS_H */
3,879 changes: 2,175 additions & 1,704 deletions global_oce_cs32/results/output.txt

Large diffs are not rendered by default.

2,393 changes: 1,101 additions & 1,292 deletions global_oce_cs32/results/output_adm.sens.txt

Large diffs are not rendered by default.

1,821 changes: 937 additions & 884 deletions global_oce_cs32/results/output_adm.txt

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions global_oce_llc90/code/GGL90_OPTIONS.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,19 @@ C Use horizontal averaging for viscosity and diffusivity as
C originally implemented in OPA.
#define ALLOW_GGL90_SMOOTH

C allow IDEMIX model
#undef ALLOW_GGL90_IDEMIX
#ifdef ALLOW_GGL90_IDEMIX
C The cvmix version of idemix uses different regularisations for the
C Coriolis parameter, buoyancy frequency etc, when used in the denominator
# define GGL90_IDEMIX_CVMIX_VERSION
#endif

C include Langmuir circulation parameterization
#undef ALLOW_GGL90_LANGMUIR

C recover old bug prior to Jun 2023
#undef GGL90_MISSING_HFAC_BUG

#endif /* ALLOW_GGL90 */
#endif /* GGL90_OPTIONS_H */
33 changes: 11 additions & 22 deletions global_oce_llc90/code/mom_calc_visc.F
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ SUBROUTINE MOM_CALC_VISC(
#include "EEPARAMS.h"
#include "PARAMS.h"
#include "MOM_VISC.h"
#ifdef ALLOW_AUTODIFF
#ifdef ALLOW_AUTODIFF_TAMC
#include "tamc.h"
#endif /* ALLOW_AUTODIFF */
#endif /* ALLOW_AUTODIFF_TAMC */

C !INPUT/OUTPUT PARAMETERS:
C myThid :: my thread Id number
Expand All @@ -106,9 +106,9 @@ SUBROUTINE MOM_CALC_VISC(
_RL shiftAh, shiftA4
#endif
#ifdef ALLOW_AUTODIFF_TAMC
INTEGER act1, act2, act3, act4
INTEGER max1, max2, max3
INTEGER ikey, lockey_1, lockey_2
C kkey :: tape key (depends on levels and tiles)
C ijkkey :: tape key (depends on i,j-indices, levels, and tiles)
INTEGER kkey, ijkkey
#endif
_RL smag2fac, smag4fac
_RL leith2fac, leith4fac
Expand Down Expand Up @@ -152,17 +152,8 @@ SUBROUTINE MOM_CALC_VISC(
LOGICAL calcLeith, calcSmag, calcLeithQG

#ifdef ALLOW_AUTODIFF_TAMC
act1 = bi - myBxLo(myThid)
max1 = myBxHi(myThid) - myBxLo(myThid) + 1
act2 = bj - myByLo(myThid)
max2 = myByHi(myThid) - myByLo(myThid) + 1
act3 = myThid - 1
max3 = nTx*nTy
act4 = ikey_dynamics - 1
ikey = (act1 + 1) + act2*max1
& + act3*max1*max2
& + act4*max1*max2*max3
lockey_1 = (ikey-1)*Nr + k
kkey = bi + (bj-1)*nSx + (ikey_dynamics-1)*nSx*nSy
kkey = k + (kkey-1)*Nr
#endif /* ALLOW_AUTODIFF_TAMC */

C-- Set flags which are used in this S/R and elsewhere :
Expand Down Expand Up @@ -383,12 +374,10 @@ SUBROUTINE MOM_CALC_VISC(

#ifdef ALLOW_AUTODIFF_TAMC
# ifndef AUTODIFF_DISABLE_LEITH
lockey_2 = i+OLx + (sNx+2*OLx)*(j+OLy-1)
& + (sNx+2*OLx)*(sNy+2*OLy)*(lockey_1-1)
CADJ STORE viscA4_ZSmg(i,j)
CADJ & = comlev1_mom_ijk_loop , key=lockey_2, byte=isbyte
CADJ STORE viscAh_ZSmg(i,j)
CADJ & = comlev1_mom_ijk_loop , key=lockey_2, byte=isbyte
ijkkey = i+OLx + (j+OLy-1)*(sNx+2*OLx)
& + (kkey-1)*(sNx+2*OLx)*(sNy+2*OLy)
CADJ STORE viscA4_ZSmg(i,j)=comlev1_mom_ijk_loop,key=ijkkey,byte=isbyte
CADJ STORE viscAh_ZSmg(i,j)=comlev1_mom_ijk_loop,key=ijkkey,byte=isbyte
# endif
#endif /* ALLOW_AUTODIFF_TAMC */

Expand Down
Loading