diff --git a/.readthedocs.yml b/.readthedocs.yml index eca72070c9..4d62a54af3 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -5,7 +5,13 @@ # Required version: 2 -# Build documentation in the docs/ directory with Sphinx +# Set the OS and Python version (required) +build: + os: ubuntu-22.04 + tools: + python: "3.7" + +# Build documentation in the doc/ directory with Sphinx sphinx: configuration: doc/conf.py fail_on_warning: true diff --git a/doc/phys_pkgs/seaice.rst b/doc/phys_pkgs/seaice.rst index 3bf61c05fb..7556ff527c 100644 --- a/doc/phys_pkgs/seaice.rst +++ b/doc/phys_pkgs/seaice.rst @@ -46,7 +46,10 @@ Parts of the :filelink:`seaice ` code can be enabled or disabled at compile time via CPP preprocessor flags. These options are set in :filelink:`SEAICE_OPTIONS.h `. :numref:`tab_phys_pkg_seaice_cpp` summarizes the most important ones. For more -options see :filelink:`SEAICE_OPTIONS.h `. +options see :filelink:`SEAICE_OPTIONS.h `. Note +that defining :varlink:`SEAICE_BGRID_DYNAMICS` turns on legacy code and thus +automatically undefines more recent features, see :filelink:`SEAICE_OPTIONS.h +` for details. .. tabularcolumns:: |\Y{.375}|\Y{.1}|\Y{.55}| @@ -56,8 +59,7 @@ options see :filelink:`SEAICE_OPTIONS.h `. :name: tab_phys_pkg_seaice_cpp :varlink:`SEAICE_DEBUG`, #undef, enhance STDOUT for debugging - :varlink:`SEAICE_ALLOW_DYNAMICS`, #define, sea ice dynamics code - :varlink:`SEAICE_CGRID`, #define, LSR solver on C-grid (rather than original B-grid) + :varlink:`SEAICE_CGRID`, #define, use sea ice dynamics on C-grid :varlink:`SEAICE_ALLOW_EVP`, #define, enable use of EVP rheology solver :varlink:`SEAICE_ALLOW_JFNK`, #define, enable use of JFNK rheology solver :varlink:`SEAICE_ALLOW_KRYLOV`, #define, enable use of Krylov rheology solver @@ -71,12 +73,14 @@ options see :filelink:`SEAICE_OPTIONS.h `. :varlink:`SEAICE_ZETA_SMOOTHREG`, #define, use differentiable regularization for viscosities :varlink:`SEAICE_DELTA_SMOOTHREG`, #undef, use differentiable regularization for :math:`1/\Delta` :varlink:`SEAICE_ALLOW_BOTTOMDRAG`, #undef, enable grounding parameterization for improved fastice in shallow seas + :varlink:`SEAICE_BGRID_DYNAMICS`, #undef, use sea ice dynamics code on legacy B-grid; most of the previous flags are not available with B-grid + :varlink:`SEAICE_BICE_STRESS`, #undef, B-grid only for backward compatiblity: turn on ice-stress on ocean; defined by default if :varlink:`SEAICE_BGRID_DYNAMICS` is defined + :varlink:`EXPLICIT_SSH_SLOPE`, #undef, B-grid only for backward compatiblity: use ETAN for tilt computations rather than geostrophic velocities; defined by default if :varlink:`SEAICE_BGRID_DYNAMICS` is defined + :varlink:`SEAICE_LSRBNEW`, #undef, FV discretization for B-grid :varlink:`SEAICE_ITD`, #undef, run with dynamical sea Ice Thickness Distribution (ITD) :varlink:`SEAICE_VARIABLE_SALINITY`, #undef, enable sea ice with variable salinity :varlink:`SEAICE_CAP_ICELOAD`, #undef, enable to limit seaice load (:varlink:`siceLoad`) on the sea surface :varlink:`ALLOW_SITRACER`, #undef, enable sea ice tracer package - :varlink:`SEAICE_BICE_STRESS`, #undef, B-grid only for backward compatiblity: turn on ice-stress on ocean - :varlink:`EXPLICIT_SSH_SLOPE`, #undef, B-grid only for backward compatiblity: use ETAN for tilt computations rather than geostrophic velocities :varlink:`SEAICE_USE_GROWTH_ADX`, #undef, use of adjointable but more simplified sea ice thermodynamics model in :filelink:`seaice_growth_adx.F ` instead of :filelink:`seaice_growth.F ` .. _ssub_phys_pkg_seaice_runtime: diff --git a/doc/tag-index b/doc/tag-index index 2230a9ff11..7f5de63258 100644 --- a/doc/tag-index +++ b/doc/tag-index @@ -1,6 +1,37 @@ Notes on tags used in MITgcmUV ============================== +checkpoint68s (2023/09/11) +o verification: + - change default ALLOW_IB_CORR (in pkg/ecco/ECCO_OPTIONS.h) to "#undef" and + test that this code compiles in experiment global_oce_biogeo_bling ; + - clean/update AD related CPP header files across all experiments and reduce + differences with standard version in pkg autodiff, cost, ctrl and ecco. +o verification: + - change global_oce_latlon TAF set-up to multi-tiles (4 tiles, as in code_oad + & code_tap) and add SIZE.h_mpi to enable MPI tests (in all 3 code_* dir). +o model/src & pkgs, TAF storage dir: + - rearrange and add storing of variables to reduce number of (unwarned) + recomp. in fluxform & vecinv pkgs and in model/src (e.g., calc_phi_hyd.F) ; + - add store directives in solve_tri/pentadiagonal.F to avoid recomputation + warnings with SOLVE_DIAGONAL_KINNER defined ; + - add CPP condition inside GAD SOM advection S/R (-> empty ".f" file if + neither GAD_ALLOW_TS_SOM_ADV nor PTRACERS_ALLOW_DYN_STATE is defined ) ; + - clean-up/refine many unnecessary store directives -> less TAF warnings ; + - remove unnecessary checkpointing code from pkg/smooth_diff2/3d.F +o pkg/ggl90: + - move computing the mixingLength to a dedicated routine ggl90_mixinglength.F + - adjust/add TAF store directives to avoid hidden recomputations. +o pkg/seaice: + - new option SEAICE_BGRID_DYNAMICS allows to remove/replace + SEAICE_ALLOW_DYNAMICS by ( SEAICE_CGRID or SEAICE_BGRID_DYNAMICS ) ; + - exclude more code if SEAICE_CGRID is undefined and clean up/rearrange + SEAICE.h to form more consistent groups and common-blocks ; + - update SEAICE_OPTIONS.h in verification experiments. +o pkg/mdsio: + - Add 2 new arguments (kLo & kHi) to pkg/mdsio Slice I/O routines that allow + to select which levels in Slice-array to read-in or to write-out to file. + checkpoint68r (2023/08/02) o verification: - adjust amplitude of perturbation (grdchk_eps) to improve Fwd/Adj gradient diff --git a/model/src/calc_3d_diffusivity.F b/model/src/calc_3d_diffusivity.F index b7b22f5a2a..0bd2eb903c 100644 --- a/model/src/calc_3d_diffusivity.F +++ b/model/src/calc_3d_diffusivity.F @@ -261,6 +261,7 @@ SUBROUTINE CALC_3D_DIFFUSIVITY( #ifndef EXCLUDE_PCELL_MIX_CODE # ifdef ALLOW_AUTODIFF_TAMC CADJ INIT loctape_3d_diff = COMMON, Nr +CADJ STORE kappartr = loctape_3d_diff # endif IF ( interDiffKr_pCell ) THEN C-- This is a hack: alter vertical diffusivity (instead of changing many S/R) @@ -310,6 +311,9 @@ SUBROUTINE CALC_3D_DIFFUSIVITY( ENDIF ENDDO ENDDO +# ifdef ALLOW_AUTODIFF_TAMC +CADJ STORE tmpFac = loctape_3d_diff, key = k +# endif IF ( mixBott.EQ.2 ) THEN DO j = 2-OLy, sNy+OLy DO i = 2-OLx, sNx+OLx @@ -363,6 +367,9 @@ SUBROUTINE CALC_3D_DIFFUSIVITY( ENDIF ENDDO ENDDO +# ifdef ALLOW_AUTODIFF_TAMC +CADJ STORE tmpFac = loctape_3d_diff, key = k +# endif IF ( mixSurf.EQ.2 ) THEN DO j = 2-OLy, sNy+OLy DO i = 2-OLx, sNx+OLx diff --git a/model/src/calc_phi_hyd.F b/model/src/calc_phi_hyd.F index 64b0b519b8..22d063460a 100644 --- a/model/src/calc_phi_hyd.F +++ b/model/src/calc_phi_hyd.F @@ -112,6 +112,7 @@ SUBROUTINE CALC_PHI_HYD( #ifdef ALLOW_AUTODIFF_TAMC tkey = bi + (bj-1)*nSx + (ikey_dynamics-1)*nSx*nSy + kkey = k + (tkey-1)*Nr #endif /* ALLOW_AUTODIFF_TAMC */ C-- Initialize phiHydF to zero : @@ -137,11 +138,8 @@ SUBROUTINE CALC_PHI_HYD( IF ( implicitIntGravWave .OR. myIter.LT.0 ) THEN C--- Calculate density #ifdef ALLOW_AUTODIFF_TAMC - kkey = k + (tkey-1)*Nr -CADJ STORE theta(:,:,k,bi,bj) = comlev1_bibj_k, key=kkey, byte=isbyte, -CADJ & kind = isbyte -CADJ STORE salt (:,:,k,bi,bj) = comlev1_bibj_k, key=kkey, byte=isbyte, -CADJ & kind = isbyte +CADJ STORE theta(:,:,k,bi,bj) = comlev1_bibj_k, key=kkey, kind = isbyte +CADJ STORE salt (:,:,k,bi,bj) = comlev1_bibj_k, key=kkey, kind = isbyte #endif /* ALLOW_AUTODIFF_TAMC */ CALL FIND_RHO_2D( I iMin, iMax, jMin, jMax, k, @@ -186,6 +184,9 @@ SUBROUTINE CALC_PHI_HYD( I myTime, myIter, myThid ) ENDIF #endif /* ALLOW_MOM_COMMON */ +#ifdef ALLOW_AUTODIFF_TAMC +CADJ STORE alphaRho = comlev1_bibj_k, key = kkey, kind = isbyte +#endif #ifdef NONLIN_FRSURF IF ( addSurfPhiAnom .AND. @@ -301,11 +302,8 @@ SUBROUTINE CALC_PHI_HYD( IF ( implicitIntGravWave .OR. myIter.LT.0 ) THEN C-- Calculate density #ifdef ALLOW_AUTODIFF_TAMC - kkey = k + (tkey-1)*Nr -CADJ STORE theta(:,:,k,bi,bj) = comlev1_bibj_k, key=kkey, byte=isbyte, -CADJ & kind = isbyte -CADJ STORE salt (:,:,k,bi,bj) = comlev1_bibj_k, key=kkey, byte=isbyte, -CADJ & kind = isbyte +CADJ STORE theta(:,:,k,bi,bj) = comlev1_bibj_k, key=kkey, kind = isbyte +CADJ STORE salt (:,:,k,bi,bj) = comlev1_bibj_k, key=kkey, kind = isbyte #endif /* ALLOW_AUTODIFF_TAMC */ CALL FIND_RHO_2D( I iMin, iMax, jMin, jMax, k, @@ -313,10 +311,6 @@ SUBROUTINE CALC_PHI_HYD( I salt(1-OLx,1-OLy,k,bi,bj), O alphaRho, I k, bi, bj, myThid ) -#ifdef ALLOW_AUTODIFF_TAMC -CADJ STORE alphaRho (:,:) = comlev1_bibj_k, key=kkey, byte=isbyte, -CADJ & kind = isbyte -#endif /* ALLOW_AUTODIFF_TAMC */ ELSE DO j=jMin,jMax DO i=iMin,iMax @@ -325,6 +319,9 @@ SUBROUTINE CALC_PHI_HYD( ENDDO ENDIF +#ifdef ALLOW_AUTODIFF_TAMC +CADJ STORE alphaRho = comlev1_bibj_k, key = kkey, kind = isbyte +#endif C-- Calculate specific volume anomaly : alpha_prime = 1/rho - alpha_Cst DO j=jMin,jMax DO i=iMin,iMax @@ -342,6 +339,9 @@ SUBROUTINE CALC_PHI_HYD( I myTime, myIter, myThid ) ENDIF #endif /* ALLOW_MOM_COMMON */ +#ifdef ALLOW_AUTODIFF_TAMC +CADJ STORE alphaRho = comlev1_bibj_k, key = kkey, kind = isbyte +#endif C---- Hydrostatic pressure at cell centers @@ -450,6 +450,9 @@ SUBROUTINE CALC_PHI_HYD( I myTime, myIter, myThid ) ENDIF #endif /* ALLOW_MOM_COMMON */ +#ifdef ALLOW_AUTODIFF_TAMC +CADJ STORE alphaRho = comlev1_bibj_k, key = kkey, kind = isbyte +#endif C--- Integrate d Phi / d pi @@ -605,6 +608,14 @@ SUBROUTINE CALC_PHI_HYD( STOP 'CALC_PHI_HYD: Bad value of buoyancyRelation !' ENDIF +#ifdef ALLOW_AUTODIFF_TAMC +# ifdef NONLIN_FRSURF +CADJ STORE alphaRho = comlev1_bibj_k, key = kkey, kind = isbyte +CADJ STORE phiHydC = comlev1_bibj_k, key = kkey, kind = isbyte +CADJ STORE phiHydF = comlev1_bibj_k, key = kkey, kind = isbyte +# endif +#endif + IF ( .NOT. useFVgradPhi ) THEN C-- r-coordinate and r*-coordinate cases: diff --git a/model/src/calc_viscosity.F b/model/src/calc_viscosity.F index c750cbb535..eb05d68232 100644 --- a/model/src/calc_viscosity.F +++ b/model/src/calc_viscosity.F @@ -1,5 +1,8 @@ #include "PACKAGES_CONFIG.h" #include "CPP_OPTIONS.h" +#ifdef ALLOW_AUTODIFF +# include "AUTODIFF_OPTIONS.h" +#endif CBOP C !ROUTINE: CALC_VISCOSITY @@ -24,6 +27,11 @@ SUBROUTINE CALC_VISCOSITY( #include "PARAMS.h" #include "DYNVARS.h" #include "GRID.h" +#ifndef EXCLUDE_PCELL_MIX_CODE +# ifdef ALLOW_AUTODIFF +# include "tamc.h" +# endif +#endif C !INPUT/OUTPUT PARAMETERS: C == Routine arguments == @@ -47,6 +55,11 @@ SUBROUTINE CALC_VISCOSITY( INTEGER km, mixSurf, mixBott _RL pC_kFac _RL tmpFac(1-OLx:sNx+OLx,1-OLy:sNy+OLy) +# ifdef ALLOW_AUTODIFF_TAMC +C tkey :: tape key (tile dependent) +C kkey :: tape key (level and tile dependent) + INTEGER tkey, kkey +# endif #endif CEOP @@ -120,6 +133,11 @@ SUBROUTINE CALC_VISCOSITY( ENDDO #ifndef EXCLUDE_PCELL_MIX_CODE +# ifdef ALLOW_AUTODIFF_TAMC + tkey = bi + (bj-1)*nSx + (ikey_dynamics-1)*nSx*nSy +CADJ STORE kappaRU = comlev1_bibj, key = tkey, kind = isbyte +CADJ STORE kappaRV = comlev1_bibj, key = tkey, kind = isbyte +# endif IF ( interViscAr_pCell ) THEN C-- This is a hack: alter vertical viscosity (instead of changing many S/R) C in order to account for missing hFac in viscous term @@ -155,6 +173,9 @@ SUBROUTINE CALC_VISCOSITY( mixSurf = pCellMix_select/10 mixBott = MOD(pCellMix_select,10) DO k = 2,Nr +# ifdef ALLOW_AUTODIFF_TAMC + kkey = k + (tkey-1)*Nr +# endif km = k - 1 pC_kFac = 1. IF ( pCellMix_delR.LT.drF(k) ) @@ -195,6 +216,14 @@ SUBROUTINE CALC_VISCOSITY( DO j = 2-OLy, sNy+OLy DO i = 2-OLx, sNx+OLx tmpFac(i,j) = MIN( tmpFac(i,j), pCellMix_maxFac ) +# ifdef ALLOW_AUTODIFF_TAMC + ENDDO + ENDDO +CADJ STORE tmpFac = comlev1_bibj_k, key = kkey, kind = isbyte +CADJ STORE kappaRU(:,:,k) = comlev1_bibj_k, key = kkey, kind = isbyte + DO j = 2-OLy, sNy+OLy + DO i = 2-OLx, sNx+OLx +# endif kappaRU(i,j,k) = MAX( kappaRU(i,j,k), & pCellMix_viscAr(k)*tmpFac(i,j) ) ENDDO @@ -236,6 +265,14 @@ SUBROUTINE CALC_VISCOSITY( DO j = 2-OLy, sNy+OLy DO i = 2-OLx, sNx+OLx tmpFac(i,j) = MIN( tmpFac(i,j), pCellMix_maxFac ) +# ifdef ALLOW_AUTODIFF_TAMC + ENDDO + ENDDO +CADJ STORE tmpFac = comlev1_bibj_k, key = kkey, kind = isbyte +CADJ STORE kappaRV(:,:,k) = comlev1_bibj_k, key = kkey, kind = isbyte + DO j = 2-OLy, sNy+OLy + DO i = 2-OLx, sNx+OLx +# endif kappaRV(i,j,k) = MAX( kappaRV(i,j,k), & pCellMix_viscAr(k)*tmpFac(i,j) ) ENDDO @@ -279,9 +316,20 @@ SUBROUTINE CALC_VISCOSITY( ENDDO ENDIF C- increase mixing below surface (by ~(1/hFac)^mixSurf) if too thin p-cell +# ifdef ALLOW_AUTODIFF_TAMC +CADJ STORE tmpFac = comlev1_bibj_k, key = kkey, kind = isbyte +# endif DO j = 2-OLy, sNy+OLy DO i = 2-OLx, sNx+OLx tmpFac(i,j) = MIN( tmpFac(i,j), pCellMix_maxFac ) +# ifdef ALLOW_AUTODIFF_TAMC + ENDDO + ENDDO +CADJ STORE tmpFac = comlev1_bibj_k, key = kkey, kind = isbyte +CADJ STORE kappaRU(:,:,k) = comlev1_bibj_k, key = kkey, kind = isbyte + DO j = 2-OLy, sNy+OLy + DO i = 2-OLx, sNx+OLx +# endif kappaRU(i,j,k) = MAX( kappaRU(i,j,k), & pCellMix_viscAr(k)*tmpFac(i,j) ) ENDDO @@ -321,9 +369,20 @@ SUBROUTINE CALC_VISCOSITY( ENDDO ENDIF C- increase mixing below surface (by ~(1/hFac)^mixSurf) if too thin p-cell +# ifdef ALLOW_AUTODIFF_TAMC +CADJ STORE tmpFac = comlev1_bibj_k, key = kkey, kind = isbyte +# endif DO j = 2-OLy, sNy+OLy DO i = 2-OLx, sNx+OLx tmpFac(i,j) = MIN( tmpFac(i,j), pCellMix_maxFac ) +# ifdef ALLOW_AUTODIFF_TAMC + ENDDO + ENDDO +CADJ STORE tmpFac = comlev1_bibj_k, key = kkey, kind = isbyte +CADJ STORE kappaRV(:,:,k) = comlev1_bibj_k, key = kkey, kind = isbyte + DO j = 2-OLy, sNy+OLy + DO i = 2-OLx, sNx+OLx +# endif kappaRV(i,j,k) = MAX( kappaRV(i,j,k), & pCellMix_viscAr(k)*tmpFac(i,j) ) ENDDO diff --git a/model/src/do_atmospheric_phys.F b/model/src/do_atmospheric_phys.F index fe6025d93e..44ca65e7a5 100644 --- a/model/src/do_atmospheric_phys.F +++ b/model/src/do_atmospheric_phys.F @@ -1,8 +1,8 @@ #include "PACKAGES_CONFIG.h" #include "CPP_OPTIONS.h" -#ifdef ALLOW_AUTODIFF -# include "AUTODIFF_OPTIONS.h" -#endif +c#ifdef ALLOW_AUTODIFF +c# include "AUTODIFF_OPTIONS.h" +c#endif CBOP C !ROUTINE: DO_ATMOSPHERIC_PHYS @@ -40,9 +40,9 @@ SUBROUTINE DO_ATMOSPHERIC_PHYS(myTime, myIter, myThid) #include "PARAMS.h" #include "GRID.h" #include "DYNVARS.h" -#ifdef ALLOW_AUTODIFF_TAMC -# include "tamc.h" -#endif /* ALLOW_AUTODIFF_TAMC */ +c#ifdef ALLOW_AUTODIFF_TAMC +c# include "tamc.h" +c#endif /* ALLOW_AUTODIFF_TAMC */ C !INPUT/OUTPUT PARAMETERS: C == Routine arguments == @@ -67,10 +67,12 @@ SUBROUTINE DO_ATMOSPHERIC_PHYS(myTime, myIter, myThid) #endif IF ( fluidIsAir ) THEN -#ifdef ALLOW_AUTODIFF_TAMC -CADJ STORE theta = comlev1, key=ikey_dynamics, kind=isbyte -CADJ STORE salt = comlev1, key=ikey_dynamics, kind=isbyte -#endif +C These store directives do not seem to be necessary, but we leave +C them here as a reminder. +c#ifdef ALLOW_AUTODIFF_TAMC +cCADJ STORE theta = comlev1, key=ikey_dynamics, kind=isbyte +cCADJ STORE salt = comlev1, key=ikey_dynamics, kind=isbyte +c#endif DO bj=myByLo(myThid),myByHi(myThid) DO bi=myBxLo(myThid),myBxHi(myThid) diff --git a/model/src/external_forcing_surf.F b/model/src/external_forcing_surf.F index 270c57de20..791f9cd84a 100644 --- a/model/src/external_forcing_surf.F +++ b/model/src/external_forcing_surf.F @@ -84,6 +84,9 @@ SUBROUTINE EXTERNAL_FORCING_SURF( C balance fluxes # ifdef ALLOW_AUTODIFF tmpVar(1) = oneRS +# ifdef ALLOW_AUTODIFF_TAMC +CADJ INCOMPLETE tmpVar +# endif # endif IF ( selectBalanceEmPmR.GE.1 .AND. & (.NOT.useSeaice .OR. useThSIce) ) THEN diff --git a/model/src/load_fields_driver.F b/model/src/load_fields_driver.F index f9f48ca00f..d855cb5415 100644 --- a/model/src/load_fields_driver.F +++ b/model/src/load_fields_driver.F @@ -132,11 +132,6 @@ SUBROUTINE LOAD_FIELDS_DRIVER( myTime, myIter, myThid ) C-- Map generic time varying controls to xx_gentim2d #ifdef ALLOW_CTRL if (useCTRL) CALL CTRL_MAP_GENTIM2D( myTime, myIter, myThid ) -# if (defined ALLOW_AUTODIFF_TAMC && defined ALLOW_GENTIM2D_CONTROL) -C This store-directive avoids storing xx_gentim2d0/1 and subsequently -C calling this routine in the AD-sweep. -CADJ STORE xx_gentim2d = comlev1, key = ikey_dynamics, kind = isbyte -# endif #endif #ifdef ALLOW_BULK_FORCE @@ -180,13 +175,6 @@ SUBROUTINE LOAD_FIELDS_DRIVER( myTime, myIter, myThid ) CALL TIMER_START('EXTERNAL_FLDS_LOAD [LOAD_FLDS_DRIVER]',myThid) CALL EXTERNAL_FIELDS_LOAD( myTime, myIter, myThid ) CALL TIMER_STOP ('EXTERNAL_FLDS_LOAD [LOAD_FLDS_DRIVER]',myThid) -#ifdef NONLIN_FRSURF -CADJ STORE SST = comlev1, key = ikey_dynamics, kind = isbyte -CADJ STORE SSS = comlev1, key = ikey_dynamics, kind = isbyte -# ifdef SHORTWAVE_HEATING -CADJ STORE Qsw = comlev1, key = ikey_dynamics, kind = isbyte -# endif -#endif ENDIF #ifdef ALLOW_RADTRANS diff --git a/model/src/packages_init_variables.F b/model/src/packages_init_variables.F index 99a3778a9d..84b5f0e3cb 100644 --- a/model/src/packages_init_variables.F +++ b/model/src/packages_init_variables.F @@ -6,6 +6,9 @@ #ifdef ALLOW_CTRL # include "CTRL_OPTIONS.h" #endif +#ifdef ALLOW_ECCO +# include "ECCO_OPTIONS.h" +#endif #ifdef ALLOW_TAPENADE # ifdef ALLOW_GMREDI # include "GMREDI_OPTIONS.h" @@ -567,6 +570,12 @@ SUBROUTINE PACKAGES_INIT_VARIABLES( myThid ) CADJ STORE uvel = tapelev_init, key = 1 CADJ STORE vvel = tapelev_init, key = 1 # endif +# ifdef ALLOW_PSBAR_STERIC +C In some set-ups (e.g. lab_sea), this is necessary +CADJ STORE etaN = tapelev_init, key = 1 +CADJ STORE theta = tapelev_init, key = 1 +CADJ STORE salt = tapelev_init, key = 1 +# endif # endif IF ( useECCO ) CALL ECCO_INIT_VARIA( myThid ) #endif diff --git a/model/src/solve_pentadiagonal.F b/model/src/solve_pentadiagonal.F index 7290be90f4..4799e39612 100644 --- a/model/src/solve_pentadiagonal.F +++ b/model/src/solve_pentadiagonal.F @@ -65,6 +65,9 @@ SUBROUTINE SOLVE_PENTADIAGONAL( INTEGER errCode INTEGER bi, bj, myThid +C/* This flag combination is only false if INCLUDE_IMPLVERTADV_CODE is +C not defined while ALLOW_AUTODIFF is. */ +#if ( defined INCLUDE_IMPLVERTADV_CODE || !defined ALLOW_AUTODIFF ) C !LOCAL VARIABLES: C == Local variables == INTEGER i,j,k @@ -77,6 +80,10 @@ SUBROUTINE SOLVE_PENTADIAGONAL( _RL e5d_prime(Nr) _RL y5d_prime(Nr) _RL y5d_update(Nr) +# ifdef ALLOW_AUTODIFF_TAMC +C kkey :: tape key, depends on i,j,k + INTEGER kkey +# endif # else _RL c5d_prime(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) _RL d5d_prime(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) @@ -201,6 +208,10 @@ SUBROUTINE SOLVE_PENTADIAGONAL( errCode = 0 #ifdef SOLVE_DIAGONAL_KINNER + +#ifdef ALLOW_AUTODIFF_TAMC +CADJ INIT loctape_solvepenta = COMMON, Nr*(sNy+2*OLy)*(sNx+2*OLx) +#endif C-- Temporary array DO k=1,Nr DO j=1-OLy,sNy+OLy @@ -225,6 +236,12 @@ SUBROUTINE SOLVE_PENTADIAGONAL( DO k=1,Nr C-- forward sweep (starting from top) +#ifdef ALLOW_AUTODIFF_TAMC + kkey = k + Nr*(i-1+OLx) + Nr*(sNx+2*OLx)*(j-1+OLy) +CADJ STORE d5d_prime(k) = loctape_solvepenta, key = kkey +CADJ STORE e5d_prime(k) = loctape_solvepenta, key = kkey +CADJ STORE y5d_prime(k) = loctape_solvepenta, key = kkey +#endif IF (k.EQ.1) THEN c just copy terms c5d_prime(k) = c5d(i,j,k) @@ -242,6 +259,9 @@ SUBROUTINE SOLVE_PENTADIAGONAL( & -b5d(i,j,k)*y5d_prime(k-1) ELSE c subtract two terms +#ifdef ALLOW_AUTODIFF_TAMC +CADJ STORE d5d_prime(k) = loctape_solvepenta, key = kkey +#endif c5d_prime(k) = c5d(i,j,k) & -a5d(i,j,k)*e5d_prime(k-2) & -(b5d(i,j,k)-a5d(i,j,k)*d5d_prime(k-2))*d5d_prime(k-1) @@ -406,5 +426,7 @@ SUBROUTINE SOLVE_PENTADIAGONAL( #endif /* SOLVE_DIAGONAL_LOWMEMORY */ +#endif /* INCLUDE_IMPLVERTADV_CODE */ + RETURN END diff --git a/model/src/solve_tridiagonal.F b/model/src/solve_tridiagonal.F index 5e3c0fb950..045f5cbcf1 100644 --- a/model/src/solve_tridiagonal.F +++ b/model/src/solve_tridiagonal.F @@ -1,4 +1,8 @@ +#include "PACKAGES_CONFIG.h" #include "CPP_OPTIONS.h" +#ifdef ALLOW_AUTODIFF +# include "AUTODIFF_OPTIONS.h" +#endif CBOP C !ROUTINE: SOLVE_TRIDIAGONAL @@ -69,6 +73,10 @@ SUBROUTINE SOLVE_TRIDIAGONAL( _RL c3d_prime(Nr) _RL y3d_prime(Nr) _RL y3d_update(Nr) +# ifdef ALLOW_AUTODIFF_TAMC +C kkey :: tape key, depends on i,j,k + INTEGER kkey +# endif # else _RL c3d_prime(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) _RL y3d_prime(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) @@ -142,6 +150,9 @@ SUBROUTINE SOLVE_TRIDIAGONAL( errCode = 0 #ifdef SOLVE_DIAGONAL_KINNER +#ifdef ALLOW_AUTODIFF_TAMC +CADJ INIT loctape_solvetri = COMMON, Nr*(sNy+2*OLy)*(sNx+2*OLx) +#endif C-- Temporary array DO k=1,Nr DO j=1-OLy,sNy+OLy @@ -164,6 +175,11 @@ SUBROUTINE SOLVE_TRIDIAGONAL( C-- Forward sweep DO k=1,Nr +#ifdef ALLOW_AUTODIFF_TAMC + kkey = k + Nr*(i-1+OLx) + Nr*(sNx+2*OLx)*(j-1+OLy) +CADJ STORE c3d_prime(k) = loctape_solvetri, key = kkey +CADJ STORE y3d_prime(k) = loctape_solvetri, key = kkey +#endif IF ( k.EQ.1 ) THEN IF ( b3d(i,j,1).NE.0. _d 0 ) THEN c3d_prime(1) = c3d_m1(i,j,1) / b3d(i,j,1) diff --git a/model/src/the_main_loop.F b/model/src/the_main_loop.F index 151f4175aa..d39588a6c4 100644 --- a/model/src/the_main_loop.F +++ b/model/src/the_main_loop.F @@ -301,7 +301,7 @@ SUBROUTINE THE_MAIN_LOOP( myTime, myIter, myThid ) c-- currently only used in convective_adjustement_ini.F CADJ INIT tapelev_ini_bibj_k = COMMON, nSx*nSy*Nr # endif -# if (defined ALLOW_GENTIM2D_CONTROL || defined ALLOW_ECCO) +# ifdef ALLOW_GENTIM2D_CONTROL c-- exclusive tape for variables with suffix "_dummy" CADJ INIT dummytape = COMMON, 1 # endif @@ -330,10 +330,6 @@ SUBROUTINE THE_MAIN_LOOP( myTime, myIter, myThid ) # ifdef ALLOW_GENTIM2D_CONTROL CADJ STORE xx_gentim2d_dummy = dummytape, key = 1 , kind = isbyte # endif -# ifdef NONLIN_FRSURF -CADJ STORE hFacC = tapelev_init, key = 1 -CADJ STORE recip_hFacC = tapelev_init, key = 1 -# endif # ifdef ALLOW_SHELFICE CADJ STORE shelficeLoadAnomaly = tapelev_init, key=1, kind=isbyte # endif @@ -512,7 +508,7 @@ SUBROUTINE THE_MAIN_LOOP( myTime, myIter, myThid ) # endif /* ALLOW_BULKFORMULAE */ c-- # ifdef ALLOW_SEAICE -# ifdef SEAICE_ALLOW_DYNAMICS +# ifdef SEAICE_CGRID CADJ INIT comlev1_dynsol = COMMON,nchklev_1*MPSEUDOTIMESTEPS # ifdef SEAICE_LSR_ADJOINT_ITER CADJ INIT comlev1_lsr = COMMON,nchklev_1*MPSEUDOTIMESTEPS*SOLV_MAX_FIXED @@ -522,10 +518,10 @@ SUBROUTINE THE_MAIN_LOOP( myTime, myIter, myThid ) CADJ INIT comlev1_lsr = COMMON, nchklev_1*MPSEUDOTIMESTEPS CADJ INIT comlev1_bibj_lsr = COMMON,nSx*nSy*nchklev_1*MPSEUDOTIMESTEPS # endif -# endif -# ifdef SEAICE_ALLOW_EVP +# ifdef SEAICE_ALLOW_EVP CADJ INIT comlev1_evp = COMMON, nEVPstepMax*nchklev_1 CADJ INIT comlev1_bibj_evp = COMMON,nSx*nSy*nEVPstepMax*nchklev_1 +# endif # endif CML# ifdef SEAICE_MULTICATEGORY CMLCADJ INIT comlev1_multdim = COMMON,nchklev_1*nSx*nSy*nitd diff --git a/pkg/autodiff/active_file_control_slice.F b/pkg/autodiff/active_file_control_slice.F index 76a9d1f391..3f0a9661db 100644 --- a/pkg/autodiff/active_file_control_slice.F +++ b/pkg/autodiff/active_file_control_slice.F @@ -102,7 +102,7 @@ SUBROUTINE ACTIVE_READ_XZ_RL( C Read the active variable from file. CALL MDS_READ_SEC_XZ( I activeVar_file, prec, useCurrentDir, - I 'RL', myNr, + I 'RL', myNr, 1, myNr, O active_var, dummyRS, I iRec, myThid ) @@ -124,7 +124,7 @@ SUBROUTINE ACTIVE_READ_XZ_RL( CALL ADD_PREFIX( adpref, activeVar_file, adfname ) CALL MDS_WRITE_SEC_XZ( I adfname, prec, globalFile, useCurrentDir, - I 'RL', myNr, + I 'RL', myNr, 1, myNr, I active_data_t, dummyRS, I iRec, myOptimIter, myThid ) @@ -137,7 +137,7 @@ SUBROUTINE ACTIVE_READ_XZ_RL( CALL MDS_READ_SEC_XZ( I activeVar_file, prec, useCurrentDir, - I 'RL', myNr, + I 'RL', myNr, 1, myNr, O active_data_t, dummyRS, I iRec, myThid ) @@ -157,7 +157,7 @@ SUBROUTINE ACTIVE_READ_XZ_RL( w_globFile = .FALSE. CALL MDS_WRITE_SEC_XZ( I activeVar_file, prec, w_globFile, useCurrentDir, - I 'RL', myNr, + I 'RL', myNr, 1, myNr, I active_data_t, dummyRS, I iRec, myOptimIter, myThid ) @@ -179,7 +179,7 @@ SUBROUTINE ACTIVE_READ_XZ_RL( C Read the active variable from file. CALL MDS_READ_SEC_XZ( I activeVar_file, prec, useCurrentDir, - I 'RL', myNr, + I 'RL', myNr, 1, myNr, O active_var, dummyRS, I iRec, myThid ) ENDIF @@ -270,7 +270,7 @@ SUBROUTINE ACTIVE_READ_XZ_RS( C Read the active variable from file. CALL MDS_READ_SEC_XZ( I activeVar_file, prec, useCurrentDir, - I 'RS', myNr, + I 'RS', myNr, 1, myNr, O dummyRL, active_var, I iRec, myThid ) @@ -292,7 +292,7 @@ SUBROUTINE ACTIVE_READ_XZ_RS( CALL ADD_PREFIX( adpref, activeVar_file, adfname ) CALL MDS_WRITE_SEC_XZ( I adfname, prec, globalFile, useCurrentDir, - I 'RS', myNr, + I 'RS', myNr, 1, myNr, I dummyRL, active_data_t, I iRec, myOptimIter, myThid ) @@ -305,7 +305,7 @@ SUBROUTINE ACTIVE_READ_XZ_RS( CALL MDS_READ_SEC_XZ( I activeVar_file, prec, useCurrentDir, - I 'RS', myNr, + I 'RS', myNr, 1, myNr, O dummyRL, active_data_t, I iRec, myThid ) @@ -325,7 +325,7 @@ SUBROUTINE ACTIVE_READ_XZ_RS( w_globFile = .FALSE. CALL MDS_WRITE_SEC_XZ( I activeVar_file, prec, w_globFile, useCurrentDir, - I 'RS', myNr, + I 'RS', myNr, 1, myNr, I dummyRL, active_data_t, I iRec, myOptimIter, myThid ) @@ -347,7 +347,7 @@ SUBROUTINE ACTIVE_READ_XZ_RS( C Read the active variable from file. CALL MDS_READ_SEC_XZ( I activeVar_file, prec, useCurrentDir, - I 'RS', myNr, + I 'RS', myNr, 1, myNr, O dummyRL, active_var, I iRec, myThid ) ENDIF @@ -437,7 +437,7 @@ SUBROUTINE ACTIVE_READ_YZ_RL( C Read the active variable from file. CALL MDS_READ_SEC_YZ( I activeVar_file, prec, useCurrentDir, - I 'RL', myNr, + I 'RL', myNr, 1, myNr, O active_var, dummyRS, I iRec, myThid ) @@ -459,7 +459,7 @@ SUBROUTINE ACTIVE_READ_YZ_RL( CALL ADD_PREFIX( adpref, activeVar_file, adfname ) CALL MDS_WRITE_SEC_YZ( I adfname, prec, globalFile, useCurrentDir, - I 'RL', myNr, + I 'RL', myNr, 1, myNr, I active_data_t, dummyRS, I iRec, myOptimIter, myThid ) @@ -472,7 +472,7 @@ SUBROUTINE ACTIVE_READ_YZ_RL( CALL MDS_READ_SEC_YZ( I activeVar_file, prec, useCurrentDir, - I 'RL', myNr, + I 'RL', myNr, 1, myNr, O active_data_t, dummyRS, I iRec, myThid ) @@ -492,7 +492,7 @@ SUBROUTINE ACTIVE_READ_YZ_RL( w_globFile = .FALSE. CALL MDS_WRITE_SEC_YZ( I activeVar_file, prec, w_globFile, useCurrentDir, - I 'RL', myNr, + I 'RL', myNr, 1, myNr, I active_data_t, dummyRS, I iRec, myOptimIter, myThid ) @@ -514,7 +514,7 @@ SUBROUTINE ACTIVE_READ_YZ_RL( C Read the active variable from file. CALL MDS_READ_SEC_YZ( I activeVar_file, prec, useCurrentDir, - I 'RL', myNr, + I 'RL', myNr, 1, myNr, O active_var, dummyRS, I iRec, myThid ) ENDIF @@ -605,7 +605,7 @@ SUBROUTINE ACTIVE_READ_YZ_RS( C Read the active variable from file. CALL MDS_READ_SEC_YZ( I activeVar_file, prec, useCurrentDir, - I 'RS', myNr, + I 'RS', myNr, 1, myNr, O dummyRL, active_var, I iRec, myThid ) @@ -627,7 +627,7 @@ SUBROUTINE ACTIVE_READ_YZ_RS( CALL ADD_PREFIX( adpref, activeVar_file, adfname ) CALL MDS_WRITE_SEC_YZ( I adfname, prec, globalFile, useCurrentDir, - I 'RS', myNr, + I 'RS', myNr, 1, myNr, I dummyRL, active_data_t, I iRec, myOptimIter, myThid ) @@ -640,7 +640,7 @@ SUBROUTINE ACTIVE_READ_YZ_RS( CALL MDS_READ_SEC_YZ( I activeVar_file, prec, useCurrentDir, - I 'RS', myNr, + I 'RS', myNr, 1, myNr, O dummyRL, active_data_t, I iRec, myThid ) @@ -660,7 +660,7 @@ SUBROUTINE ACTIVE_READ_YZ_RS( w_globFile = .FALSE. CALL MDS_WRITE_SEC_YZ( I activeVar_file, prec, w_globFile, useCurrentDir, - I 'RS', myNr, + I 'RS', myNr, 1, myNr, I dummyRL, active_data_t, I iRec, myOptimIter, myThid ) @@ -682,7 +682,7 @@ SUBROUTINE ACTIVE_READ_YZ_RS( C Read the active variable from file. CALL MDS_READ_SEC_YZ( I activeVar_file, prec, useCurrentDir, - I 'RS', myNr, + I 'RS', myNr, 1, myNr, O dummyRL, active_var, I iRec, myThid ) ENDIF @@ -761,7 +761,7 @@ SUBROUTINE ACTIVE_WRITE_XZ_RL( IF (theSimulationMode .EQ. FORWARD_SIMULATION) THEN CALL MDS_WRITE_SEC_XZ( I activeVar_file, prec, globalFile, useCurrentDir, - I 'RL', myNr, + I 'RL', myNr, 1, myNr, I active_var, dummyRS, I iRec, myOptimIter, myThid ) ENDIF @@ -771,7 +771,7 @@ SUBROUTINE ACTIVE_WRITE_XZ_RL( CALL MDS_READ_SEC_XZ( I activeVar_file, prec, useCurrentDir, - I 'RL', myNr, + I 'RL', myNr, 1, myNr, O active_data_t, dummyRS, I iRec, myThid ) @@ -789,7 +789,7 @@ SUBROUTINE ACTIVE_WRITE_XZ_RL( ENDDO CALL MDS_WRITE_SEC_XZ( I activeVar_file, prec, globalFile, useCurrentDir, - I 'RL', myNr, + I 'RL', myNr, 1, myNr, I active_data_t, dummyRS, I iRec, myOptimIter, myThid ) @@ -799,7 +799,7 @@ SUBROUTINE ACTIVE_WRITE_XZ_RL( IF (theSimulationMode .EQ. TANGENT_SIMULATION) THEN CALL MDS_WRITE_SEC_XZ( I activeVar_file, prec, globalFile, useCurrentDir, - I 'RL', myNr, + I 'RL', myNr, 1, myNr, I active_var, dummyRS, I iRec, myOptimIter, myThid ) ENDIF @@ -878,7 +878,7 @@ SUBROUTINE ACTIVE_WRITE_XZ_RS( IF (theSimulationMode .EQ. FORWARD_SIMULATION) THEN CALL MDS_WRITE_SEC_XZ( I activeVar_file, prec, globalFile, useCurrentDir, - I 'RS', myNr, + I 'RS', myNr, 1, myNr, I dummyRL, active_var, I iRec, myOptimIter, myThid ) ENDIF @@ -888,7 +888,7 @@ SUBROUTINE ACTIVE_WRITE_XZ_RS( CALL MDS_READ_SEC_XZ( I activeVar_file, prec, useCurrentDir, - I 'RS', myNr, + I 'RS', myNr, 1, myNr, O dummyRL, active_data_t, I iRec, myThid ) @@ -906,7 +906,7 @@ SUBROUTINE ACTIVE_WRITE_XZ_RS( ENDDO CALL MDS_WRITE_SEC_XZ( I activeVar_file, prec, globalFile, useCurrentDir, - I 'RS', myNr, + I 'RS', myNr, 1, myNr, I dummyRL, active_data_t, I iRec, myOptimIter, myThid ) @@ -916,7 +916,7 @@ SUBROUTINE ACTIVE_WRITE_XZ_RS( IF (theSimulationMode .EQ. TANGENT_SIMULATION) THEN CALL MDS_WRITE_SEC_XZ( I activeVar_file, prec, globalFile, useCurrentDir, - I 'RS', myNr, + I 'RS', myNr, 1, myNr, I dummyRL, active_var, I iRec, myOptimIter, myThid ) ENDIF @@ -995,7 +995,7 @@ SUBROUTINE ACTIVE_WRITE_YZ_RL( IF (theSimulationMode .EQ. FORWARD_SIMULATION) THEN CALL MDS_WRITE_SEC_YZ( I activeVar_file, prec, globalFile, useCurrentDir, - I 'RL', myNr, + I 'RL', myNr, 1, myNr, I active_var, dummyRS, I iRec, myOptimIter, myThid ) ENDIF @@ -1005,7 +1005,7 @@ SUBROUTINE ACTIVE_WRITE_YZ_RL( CALL MDS_READ_SEC_YZ( I activeVar_file, prec, useCurrentDir, - I 'RL', myNr, + I 'RL', myNr, 1, myNr, O active_data_t, dummyRS, I iRec, myThid ) @@ -1023,7 +1023,7 @@ SUBROUTINE ACTIVE_WRITE_YZ_RL( ENDDO CALL MDS_WRITE_SEC_YZ( I activeVar_file, prec, globalFile, useCurrentDir, - I 'RL', myNr, + I 'RL', myNr, 1, myNr, I active_data_t, dummyRS, I iRec, myOptimIter, myThid ) @@ -1033,7 +1033,7 @@ SUBROUTINE ACTIVE_WRITE_YZ_RL( IF (theSimulationMode .EQ. TANGENT_SIMULATION) THEN CALL MDS_WRITE_SEC_YZ( I activeVar_file, prec, globalFile, useCurrentDir, - I 'RL', myNr, + I 'RL', myNr, 1, myNr, I active_var, dummyRS, I iRec, myOptimIter, myThid ) ENDIF @@ -1112,7 +1112,7 @@ SUBROUTINE ACTIVE_WRITE_YZ_RS( IF (theSimulationMode .EQ. FORWARD_SIMULATION) THEN CALL MDS_WRITE_SEC_YZ( I activeVar_file, prec, globalFile, useCurrentDir, - I 'RS', myNr, + I 'RS', myNr, 1, myNr, I dummyRL, active_var, I iRec, myOptimIter, myThid ) ENDIF @@ -1122,7 +1122,7 @@ SUBROUTINE ACTIVE_WRITE_YZ_RS( CALL MDS_READ_SEC_YZ( I activeVar_file, prec, useCurrentDir, - I 'RS', myNr, + I 'RS', myNr, 1, myNr, O dummyRL, active_data_t, I iRec, myThid ) @@ -1140,7 +1140,7 @@ SUBROUTINE ACTIVE_WRITE_YZ_RS( ENDDO CALL MDS_WRITE_SEC_YZ( I activeVar_file, prec, globalFile, useCurrentDir, - I 'RS', myNr, + I 'RS', myNr, 1, myNr, I dummyRL, active_data_t, I iRec, myOptimIter, myThid ) @@ -1150,7 +1150,7 @@ SUBROUTINE ACTIVE_WRITE_YZ_RS( IF (theSimulationMode .EQ. TANGENT_SIMULATION) THEN CALL MDS_WRITE_SEC_YZ( I activeVar_file, prec, globalFile, useCurrentDir, - I 'RS', myNr, + I 'RS', myNr, 1, myNr, I dummyRL, active_var, I iRec, myOptimIter, myThid ) ENDIF diff --git a/pkg/autodiff/autodiff_ini_model_io.F b/pkg/autodiff/autodiff_ini_model_io.F index 3940565913..161459818e 100644 --- a/pkg/autodiff/autodiff_ini_model_io.F +++ b/pkg/autodiff/autodiff_ini_model_io.F @@ -385,7 +385,7 @@ SUBROUTINE AUTODIFF_INI_MODEL_IO( myThid ) CALL MNC_CW_ADD_VATTR_TEXT('adhsnow', & 'coordinates','XC YC RC iter', myThid) c -# ifdef SEAICE_ALLOW_DYNAMICS +# ifdef SEAICE_CGRID CALL MNC_CW_ADD_VNAME('aduice', 'U_xy_Hn__-__t', 3,4, myThid) CALL MNC_CW_ADD_VATTR_TEXT('aduice', & 'units','[cost]/[m/s]', myThid) diff --git a/pkg/autodiff/check_lev1_dir_ocephys.h b/pkg/autodiff/check_lev1_dir_ocephys.h index fb6e89960c..f228e72225 100644 --- a/pkg/autodiff/check_lev1_dir_ocephys.h +++ b/pkg/autodiff/check_lev1_dir_ocephys.h @@ -118,8 +118,6 @@ CADJ STORE hFacC, hFacS, hFacW CADJ & = comlev1, key = ikey_dynamics, kind = isbyte CADJ STORE recip_hFacC, recip_hFacS, recip_hFacW CADJ & = comlev1, key = ikey_dynamics, kind = isbyte -CADJ STORE surfaceForcingU, surfaceForcingV = -CADJ & comlev1, key = ikey_dynamics, kind = isbyte #endif cph the following needed to be moved here from do_oceanic_physics @@ -193,3 +191,22 @@ CADJ STORE pTracer = comlev1, key = ikey_dynamics, kind = isbyte CADJ STORE rStarExpC = comlev1, key = ikey_dynamics, kind = isbyte # endif #endif + +#ifndef EXCLUDE_PCELL_MIX_CODE +# ifdef ALLOW_KPP +CADJ STORE KPPviscAz = comlev1, key = ikey_dynamics, kind = isbyte +# endif +# ifdef ALLOW_PP81 +CADJ STORE PPviscAz = comlev1, key = ikey_dynamics, kind = isbyte +# endif +# ifdef ALLOW_KL10 +CADJ STORE KLviscAz = comlev1, key = ikey_dynamics, kind = isbyte +# endif +# ifdef ALLOW_MY82 +CADJ STORE MYviscAz = comlev1, key = ikey_dynamics, kind = isbyte +# endif +# ifdef ALLOW_GGL90 +CADJ STORE GGL90viscArU = comlev1, key = ikey_dynamics, kind = isbyte +CADJ STORE GGL90viscArV = comlev1, key = ikey_dynamics, kind = isbyte +# endif +#endif diff --git a/pkg/autodiff/checkpoint_lev2_directives.h b/pkg/autodiff/checkpoint_lev2_directives.h index bdfc70f26f..efdff0d86f 100644 --- a/pkg/autodiff/checkpoint_lev2_directives.h +++ b/pkg/autodiff/checkpoint_lev2_directives.h @@ -46,39 +46,36 @@ CADJ STORE PmEpR = tapelev2, key = ilev_2 #endif c #ifdef ALLOW_ADAMSBASHFORTH_3 -CADJ STORE gtnm = tapelev2, key = ilev_2 -CADJ STORE gsnm = tapelev2, key = ilev_2 -CADJ STORE gunm = tapelev2, key = ilev_2 -CADJ STORE gvnm = tapelev2, key = ilev_2 +CADJ STORE gtnm = tapelev2, key = ilev_2 +CADJ STORE gsnm = tapelev2, key = ilev_2 +CADJ STORE gunm = tapelev2, key = ilev_2 +CADJ STORE gvnm = tapelev2, key = ilev_2 #else -CADJ STORE gtnm1 = tapelev2, key = ilev_2 -CADJ STORE gsnm1 = tapelev2, key = ilev_2 -CADJ STORE gunm1 = tapelev2, key = ilev_2 -CADJ STORE gvnm1 = tapelev2, key = ilev_2 +CADJ STORE gtnm1 = tapelev2, key = ilev_2 +CADJ STORE gsnm1 = tapelev2, key = ilev_2 +CADJ STORE gunm1 = tapelev2, key = ilev_2 +CADJ STORE gvnm1 = tapelev2, key = ilev_2 #endif -CADJ STORE theta = tapelev2, key = ilev_2 +CADJ STORE theta = tapelev2, key = ilev_2 CADJ STORE salt = tapelev2, key = ilev_2 CADJ STORE uvel = tapelev2, key = ilev_2 CADJ STORE vvel = tapelev2, key = ilev_2 CADJ STORE wvel = tapelev2, key = ilev_2 -CADJ STORE totphihyd = tapelev2, key = ilev_2 +CADJ STORE totphihyd = tapelev2, key = ilev_2 c #endif /* AUTODIFF_USE_STORE_RESTORE */ -CADJ STORE phi0surf = tapelev2, key = ilev_2 -CADJ STORE saltflux = tapelev2, key = ilev_2 - #ifdef EXACT_CONSERV -cphCADJ STORE hDivFlow = tapelev2, key = ilev_2 +cphCADJ STORE hDivFlow = tapelev2, key = ilev_2 #endif /* EXACT_CONSERV */ #ifdef NONLIN_FRSURF CADJ STORE hfac_surfc = tapelev2, key = ilev_2 CADJ STORE hfac_surfs = tapelev2, key = ilev_2 CADJ STORE hfac_surfw = tapelev2, key = ilev_2 -CADJ STORE hFac_surfNm1C= tapelev2, key = ilev_2 -CADJ STORE hFac_surfNm1S= tapelev2, key = ilev_2 -CADJ STORE hFac_surfNm1W= tapelev2, key = ilev_2 +CADJ STORE hFac_surfNm1C = tapelev2, key = ilev_2 +CADJ STORE hFac_surfNm1S = tapelev2, key = ilev_2 +CADJ STORE hFac_surfNm1W = tapelev2, key = ilev_2 # ifndef DISABLE_RSTAR_CODE CADJ STORE rstarexpc,rstarexps,rstarexpw @@ -87,8 +84,11 @@ CADJ STORE rstarfacc,rstarfacs,rstarfacw CADJ & = tapelev2, key = ilev_2 CADJ STORE rStarFacNm1C,rStarFacNm1S,rStarFacNm1W CADJ & = tapelev2, key = ilev_2 +# if (defined ALLOW_MOM_FLUXFORM || \ + defined ALLOW_CG2D_NSA || defined ALLOW_DEPTH_CONTROL) CADJ STORE rstardhcdt,rstardhsdt,rstardhwdt CADJ & = tapelev2, key = ilev_2 +# endif # endif #endif /* NONLIN_FRSURF */ @@ -179,6 +179,10 @@ CADJ STORE empmr = tapelev2, key = ilev_2 #endif /* ALLOW_EBM */ #ifdef ALLOW_COST +C Whether the following store directives are necessary depends +C heavily on the details of the cost function, so we stick to the +C strategy of inserting these store directives regardless of the +C "not necessary" warnings they produce. CADJ STORE cMeanTheta = tapelev2, key = ilev_2 CADJ STORE cMeanUVel = tapelev2, key = ilev_2 CADJ STORE cMeanVVel = tapelev2, key = ilev_2 diff --git a/pkg/autodiff/checkpoint_lev3_directives.h b/pkg/autodiff/checkpoint_lev3_directives.h index 026b4fe2ca..42f70785c6 100644 --- a/pkg/autodiff/checkpoint_lev3_directives.h +++ b/pkg/autodiff/checkpoint_lev3_directives.h @@ -51,34 +51,31 @@ CADJ STORE gsnm = tapelev3, key = ilev_3 CADJ STORE gunm = tapelev3, key = ilev_3 CADJ STORE gvnm = tapelev3, key = ilev_3 #else -CADJ STORE gtnm1 = tapelev3, key = ilev_3 -CADJ STORE gsnm1 = tapelev3, key = ilev_3 -CADJ STORE gunm1 = tapelev3, key = ilev_3 -CADJ STORE gvnm1 = tapelev3, key = ilev_3 +CADJ STORE gtnm1 = tapelev3, key = ilev_3 +CADJ STORE gsnm1 = tapelev3, key = ilev_3 +CADJ STORE gunm1 = tapelev3, key = ilev_3 +CADJ STORE gvnm1 = tapelev3, key = ilev_3 #endif -CADJ STORE theta = tapelev3, key = ilev_3 +CADJ STORE theta = tapelev3, key = ilev_3 CADJ STORE salt = tapelev3, key = ilev_3 CADJ STORE uvel = tapelev3, key = ilev_3 CADJ STORE vvel = tapelev3, key = ilev_3 CADJ STORE wvel = tapelev3, key = ilev_3 -CADJ STORE totphihyd = tapelev3, key = ilev_3 +CADJ STORE totphihyd = tapelev3, key = ilev_3 c #endif /* AUTODIFF_USE_STORE_RESTORE */ -CADJ STORE phi0surf = tapelev3, key = ilev_3 -CADJ STORE saltflux = tapelev3, key = ilev_3 - #ifdef EXACT_CONSERV -cphCADJ STORE hDivFlow = tapelev3, key = ilev_3 +cphCADJ STORE hDivFlow = tapelev3, key = ilev_3 #endif /* EXACT_CONSERV */ #ifdef NONLIN_FRSURF CADJ STORE hfac_surfc = tapelev3, key = ilev_3 CADJ STORE hfac_surfs = tapelev3, key = ilev_3 CADJ STORE hfac_surfw = tapelev3, key = ilev_3 -CADJ STORE hFac_surfNm1C= tapelev3, key = ilev_3 -CADJ STORE hFac_surfNm1S= tapelev3, key = ilev_3 -CADJ STORE hFac_surfNm1W= tapelev3, key = ilev_3 +CADJ STORE hFac_surfNm1C = tapelev3, key = ilev_3 +CADJ STORE hFac_surfNm1S = tapelev3, key = ilev_3 +CADJ STORE hFac_surfNm1W = tapelev3, key = ilev_3 # ifndef DISABLE_RSTAR_CODE CADJ STORE rstarexpc,rstarexps,rstarexpw @@ -87,8 +84,11 @@ CADJ STORE rstarfacc,rstarfacs,rstarfacw CADJ & = tapelev3, key = ilev_3 CADJ STORE rStarFacNm1C,rStarFacNm1S,rStarFacNm1W CADJ & = tapelev3, key = ilev_3 +# if (defined ALLOW_MOM_FLUXFORM || \ + defined ALLOW_CG2D_NSA || defined ALLOW_DEPTH_CONTROL) CADJ STORE rstardhcdt,rstardhsdt,rstardhwdt CADJ & = tapelev3, key = ilev_3 +# endif # endif #endif /* NONLIN_FRSURF */ @@ -179,6 +179,10 @@ CADJ STORE empmr = tapelev3, key = ilev_3 #endif /* ALLOW_EBM */ #ifdef ALLOW_COST +C Whether or not the following store directives are necessary +C depends heavily on the details of the cost function, so we stick +C to the strategy of inserting these store directives regardless of +C the "not necessary" warnings they produce. CADJ STORE cMeanTheta = tapelev3, key = ilev_3 CADJ STORE cMeanUVel = tapelev3, key = ilev_3 CADJ STORE cMeanVVel = tapelev3, key = ilev_3 diff --git a/pkg/autodiff/checkpoint_lev4_directives.h b/pkg/autodiff/checkpoint_lev4_directives.h index 1de973c3e1..7e75da2965 100644 --- a/pkg/autodiff/checkpoint_lev4_directives.h +++ b/pkg/autodiff/checkpoint_lev4_directives.h @@ -46,39 +46,36 @@ CADJ STORE PmEpR = tapelev4, key = ilev_4 #endif c #ifdef ALLOW_ADAMSBASHFORTH_3 -CADJ STORE gtnm = tapelev4, key = ilev_4 -CADJ STORE gsnm = tapelev4, key = ilev_4 -CADJ STORE gunm = tapelev4, key = ilev_4 -CADJ STORE gvnm = tapelev4, key = ilev_4 +CADJ STORE gtnm = tapelev4, key = ilev_4 +CADJ STORE gsnm = tapelev4, key = ilev_4 +CADJ STORE gunm = tapelev4, key = ilev_4 +CADJ STORE gvnm = tapelev4, key = ilev_4 #else -CADJ STORE gtnm1 = tapelev4, key = ilev_4 -CADJ STORE gsnm1 = tapelev4, key = ilev_4 -CADJ STORE gunm1 = tapelev4, key = ilev_4 -CADJ STORE gvnm1 = tapelev4, key = ilev_4 +CADJ STORE gtnm1 = tapelev4, key = ilev_4 +CADJ STORE gsnm1 = tapelev4, key = ilev_4 +CADJ STORE gunm1 = tapelev4, key = ilev_4 +CADJ STORE gvnm1 = tapelev4, key = ilev_4 #endif -CADJ STORE theta = tapelev4, key = ilev_4 +CADJ STORE theta = tapelev4, key = ilev_4 CADJ STORE salt = tapelev4, key = ilev_4 CADJ STORE uvel = tapelev4, key = ilev_4 CADJ STORE vvel = tapelev4, key = ilev_4 CADJ STORE wvel = tapelev4, key = ilev_4 -CADJ STORE totphihyd = tapelev4, key = ilev_4 +CADJ STORE totphihyd = tapelev4, key = ilev_4 c #endif /* AUTODIFF_USE_STORE_RESTORE */ -CADJ STORE phi0surf = tapelev4, key = ilev_4 -CADJ STORE saltflux = tapelev4, key = ilev_4 - #ifdef EXACT_CONSERV -cphCADJ STORE hDivFlow = tapelev4, key = ilev_4 +cphCADJ STORE hDivFlow = tapelev4, key = ilev_4 #endif /* EXACT_CONSERV */ #ifdef NONLIN_FRSURF CADJ STORE hfac_surfc = tapelev4, key = ilev_4 CADJ STORE hfac_surfs = tapelev4, key = ilev_4 CADJ STORE hfac_surfw = tapelev4, key = ilev_4 -CADJ STORE hFac_surfNm1C= tapelev4, key = ilev_4 -CADJ STORE hFac_surfNm1S= tapelev4, key = ilev_4 -CADJ STORE hFac_surfNm1W= tapelev4, key = ilev_4 +CADJ STORE hFac_surfNm1C = tapelev4, key = ilev_4 +CADJ STORE hFac_surfNm1S = tapelev4, key = ilev_4 +CADJ STORE hFac_surfNm1W = tapelev4, key = ilev_4 # ifndef DISABLE_RSTAR_CODE CADJ STORE rstarexpc,rstarexps,rstarexpw @@ -87,8 +84,11 @@ CADJ STORE rstarfacc,rstarfacs,rstarfacw CADJ & = tapelev4, key = ilev_4 CADJ STORE rStarFacNm1C,rStarFacNm1S,rStarFacNm1W CADJ & = tapelev4, key = ilev_4 +# if (defined ALLOW_MOM_FLUXFORM || \ + defined ALLOW_CG2D_NSA || defined ALLOW_DEPTH_CONTROL) CADJ STORE rstardhcdt,rstardhsdt,rstardhwdt CADJ & = tapelev4, key = ilev_4 +# endif # endif #endif /* NONLIN_FRSURF */ @@ -179,6 +179,10 @@ CADJ STORE empmr = tapelev4, key = ilev_4 #endif /* ALLOW_EBM */ #ifdef ALLOW_COST +C Whether or not the following store directives are necessary +C depends heavily on the details of the cost function, so we stick +C to the strategy of inserting these store directives regardless of +C the "not necessary" warnings they produce. CADJ STORE cMeanTheta = tapelev4, key = ilev_4 CADJ STORE cMeanUVel = tapelev4, key = ilev_4 CADJ STORE cMeanVVel = tapelev4, key = ilev_4 diff --git a/pkg/bling/bling_ad_check_lev2_dir.h b/pkg/bling/bling_ad_check_lev2_dir.h index ff1b7e7c6a..dc7f7b1d68 100644 --- a/pkg/bling/bling_ad_check_lev2_dir.h +++ b/pkg/bling/bling_ad_check_lev2_dir.h @@ -1,18 +1,18 @@ #ifdef ALLOW_BLING CADJ STORE pH = tapelev2, key = ilev_2 -CADJ STORE fice = tapelev2, key = ilev_2 -CADJ STORE atmosP = tapelev2, key = ilev_2 -CADJ STORE wind = tapelev2, key = ilev_2 -CADJ STORE silica = tapelev2, key = ilev_2 -CADJ STORE ak1 = tapelev2, key = ilev_2 -CADJ STORE ak2 = tapelev2, key = ilev_2 -CADJ STORE akf = tapelev2, key = ilev_2 -CADJ STORE ft = tapelev2, key = ilev_2 +cCADJ STORE fice = tapelev2, key = ilev_2 +cCADJ STORE atmosP = tapelev2, key = ilev_2 +cCADJ STORE wind = tapelev2, key = ilev_2 +cCADJ STORE silica = tapelev2, key = ilev_2 +cCADJ STORE ak1 = tapelev2, key = ilev_2 +cCADJ STORE ak2 = tapelev2, key = ilev_2 +cCADJ STORE akf = tapelev2, key = ilev_2 +cCADJ STORE ft = tapelev2, key = ilev_2 CADJ STORE irr_mem = tapelev2, key = ilev_2 -CADJ STORE chl = tapelev2, key = ilev_2 -CADJ STORE poc = tapelev2, key = ilev_2 +cCADJ STORE chl = tapelev2, key = ilev_2 +cCADJ STORE poc = tapelev2, key = ilev_2 CADJ STORE phyto_sm = tapelev2, key = ilev_2 CADJ STORE phyto_lg = tapelev2, key = ilev_2 # ifndef USE_BLING_V1 @@ -38,4 +38,3 @@ CADJ STORE apco21 = tapelev2, key = ilev_2 # endif #endif /* ALLOW_BLING */ - diff --git a/pkg/bling/bling_ad_check_lev3_dir.h b/pkg/bling/bling_ad_check_lev3_dir.h index cf6387dd08..d6c844e085 100644 --- a/pkg/bling/bling_ad_check_lev3_dir.h +++ b/pkg/bling/bling_ad_check_lev3_dir.h @@ -1,18 +1,18 @@ #ifdef ALLOW_BLING CADJ STORE pH = tapelev3, key = ilev_3 -CADJ STORE fice = tapelev3, key = ilev_3 -CADJ STORE atmosP = tapelev3, key = ilev_3 -CADJ STORE wind = tapelev3, key = ilev_3 -CADJ STORE silica = tapelev3, key = ilev_3 -CADJ STORE ak1 = tapelev3, key = ilev_3 -CADJ STORE ak2 = tapelev3, key = ilev_3 -CADJ STORE akf = tapelev3, key = ilev_3 -CADJ STORE ft = tapelev3, key = ilev_3 +cCADJ STORE fice = tapelev3, key = ilev_3 +cCADJ STORE atmosP = tapelev3, key = ilev_3 +cCADJ STORE wind = tapelev3, key = ilev_3 +cCADJ STORE silica = tapelev3, key = ilev_3 +cCADJ STORE ak1 = tapelev3, key = ilev_3 +cCADJ STORE ak2 = tapelev3, key = ilev_3 +cCADJ STORE akf = tapelev3, key = ilev_3 +cCADJ STORE ft = tapelev3, key = ilev_3 CADJ STORE irr_mem = tapelev3, key = ilev_3 -CADJ STORE chl = tapelev3, key = ilev_3 -CADJ STORE poc = tapelev3, key = ilev_3 +cCADJ STORE chl = tapelev3, key = ilev_3 +cCADJ STORE poc = tapelev3, key = ilev_3 CADJ STORE phyto_sm = tapelev3, key = ilev_3 CADJ STORE phyto_lg = tapelev3, key = ilev_3 # ifndef USE_BLING_V1 @@ -38,4 +38,3 @@ CADJ STORE apco21 = tapelev3, key = ilev_3 # endif #endif /* ALLOW_BLING */ - diff --git a/pkg/bling/bling_ad_check_lev4_dir.h b/pkg/bling/bling_ad_check_lev4_dir.h index a3a371b063..ef133f4e90 100644 --- a/pkg/bling/bling_ad_check_lev4_dir.h +++ b/pkg/bling/bling_ad_check_lev4_dir.h @@ -1,18 +1,18 @@ #ifdef ALLOW_BLING CADJ STORE pH = tapelev4, key = ilev_4 -CADJ STORE fice = tapelev4, key = ilev_4 -CADJ STORE atmosP = tapelev4, key = ilev_4 -CADJ STORE wind = tapelev4, key = ilev_4 -CADJ STORE silica = tapelev4, key = ilev_4 -CADJ STORE ak1 = tapelev4, key = ilev_4 -CADJ STORE ak2 = tapelev4, key = ilev_4 -CADJ STORE akf = tapelev4, key = ilev_4 -CADJ STORE ft = tapelev4, key = ilev_4 +cCADJ STORE fice = tapelev4, key = ilev_4 +cCADJ STORE atmosP = tapelev4, key = ilev_4 +cCADJ STORE wind = tapelev4, key = ilev_4 +cCADJ STORE silica = tapelev4, key = ilev_4 +cCADJ STORE ak1 = tapelev4, key = ilev_4 +cCADJ STORE ak2 = tapelev4, key = ilev_4 +cCADJ STORE akf = tapelev4, key = ilev_4 +cCADJ STORE ft = tapelev4, key = ilev_4 CADJ STORE irr_mem = tapelev4, key = ilev_4 -CADJ STORE chl = tapelev4, key = ilev_4 -CADJ STORE poc = tapelev4, key = ilev_4 +cCADJ STORE chl = tapelev4, key = ilev_4 +cCADJ STORE poc = tapelev4, key = ilev_4 CADJ STORE phyto_sm = tapelev4, key = ilev_4 CADJ STORE phyto_lg = tapelev4, key = ilev_4 # ifndef USE_BLING_V1 @@ -38,4 +38,3 @@ CADJ STORE apco21 = tapelev4, key = ilev_4 # endif #endif /* ALLOW_BLING */ - diff --git a/pkg/cost/COST_OPTIONS.h b/pkg/cost/COST_OPTIONS.h index 6a06aad094..85e00453af 100644 --- a/pkg/cost/COST_OPTIONS.h +++ b/pkg/cost/COST_OPTIONS.h @@ -34,8 +34,8 @@ C >>> Cost function contributions #undef ALLOW_COST_ATLANTIC_HEAT_DOMASS #undef ALLOW_COST_TEST -#undef ALLOW_COST_DEPTH #undef ALLOW_COST_TSQUARED +#undef ALLOW_COST_DEPTH #undef ALLOW_COST_TRACER C List these options here: diff --git a/pkg/ctrl/ctrl_set_globfld_xz.F b/pkg/ctrl/ctrl_set_globfld_xz.F index 03a0b9a76a..6e71c4c800 100644 --- a/pkg/ctrl/ctrl_set_globfld_xz.F +++ b/pkg/ctrl/ctrl_set_globfld_xz.F @@ -81,13 +81,13 @@ SUBROUTINE ctrl_set_globfld_xz( C In this call, value "False" is passed to 3rd arg "globalFile" C and value "False" is passed to 4th arg "useCurrentDir," c CALL MDS_WRITE_SEC_XZ( fname, ctrlprec, .FALSE., .FALSE., -c I 'RL', Nr, globfldxz, dummyRS, +c I 'RL', Nr, 1, Nr, globfldxz, dummyRS, c I irec, optimcycle, myThid ) C-- The only difference here (vs initial MDSWRITEFIELDXZ call) is that, -C in WRITE_REC_XZ_RL, argument "globalFile" is not set to false but -C instead is taken from global setting "globalFiles" ; -C But this might be more consistent with call to WRITE_REC_3D_RL above +C in WRITE_REC_XZ_RL, argument "globalFile" is not set to FALSE but is +C instead taken from RD_WR_SEC common block (but currently set to FALSE +C in ini_model_io.F if using OBCS) CALL WRITE_REC_XZ_RL( fname, ctrlprec, I Nr, globfldxz, I irec, optimcycle, myThid ) diff --git a/pkg/ctrl/ctrl_set_globfld_yz.F b/pkg/ctrl/ctrl_set_globfld_yz.F index c0d263c6f7..233cef7300 100644 --- a/pkg/ctrl/ctrl_set_globfld_yz.F +++ b/pkg/ctrl/ctrl_set_globfld_yz.F @@ -76,18 +76,18 @@ SUBROUTINE ctrl_set_globfld_yz( ENDDO DO irec = nrec_nl*Nx+1, ncvarrecs(ivartype) -C-- Call directly MDS_WRITE_SEC_yZ (instead of indirectly via MDSWRITEFIELDyZ) +C-- Call directly MDS_WRITE_SEC_YZ (instead of indirectly via MDSWRITEFIELDYZ) C --> expect zero difference. C In this call, value "False" is passed to 3rd arg "globalFile" C and value "False" is passed to 4th arg "useCurrentDir," c CALL MDS_WRITE_SEC_YZ( fname, ctrlprec, .FALSE., .FALSE., -c I 'RL', Nr, globfldyz, dummyRS, +c I 'RL', Nr, 1, Nr, globfldyz, dummyRS, c I irec, optimcycle, myThid ) C-- The only difference here (vs initial MDSWRITEFIELDYZ call) is that, -C in WRITE_REC_YZ_RL, argument "globalFile" is not set to false but -C instead is taken from global setting "globalFiles" ; -C But this might be more consistent with call to WRITE_REC_3D_RL above +C in WRITE_REC_YZ_RL, argument "globalFile" is not set to FALSE but is +C instead taken from RD_WR_SEC common block (but currently set to FALSE +C in ini_model_io.F if using OBCS) CALL WRITE_REC_YZ_RL( fname, ctrlprec, I Nr, globfldyz, I irec, optimcycle, myThid ) diff --git a/pkg/dic/dic_ad_check_lev2_dir.h b/pkg/dic/dic_ad_check_lev2_dir.h index 10d341aaa3..7e14bcb122 100644 --- a/pkg/dic/dic_ad_check_lev2_dir.h +++ b/pkg/dic/dic_ad_check_lev2_dir.h @@ -2,12 +2,12 @@ C common CARBON_NEEDS CADJ STORE pH = tapelev2, key = ilev_2 -CADJ STORE pCO2 = tapelev2, key = ilev_2 -CADJ STORE fIce = tapelev2, key = ilev_2 -CADJ STORE silicaSurf = tapelev2, key = ilev_2 +cCADJ STORE pCO2 = tapelev2, key = ilev_2 +cCADJ STORE fIce = tapelev2, key = ilev_2 +cCADJ STORE silicaSurf = tapelev2, key = ilev_2 CADJ STORE atmosPCO2 = tapelev2, key = ilev_2 -CADJ STORE gsm_s = tapelev2, key = ilev_2 +cCADJ STORE gsm_s = tapelev2, key = ilev_2 CADJ STORE co2atmos = tapelev2, key = ilev_2 CADJ STORE total_atmos_carbon = tapelev2, key = ilev_2 diff --git a/pkg/dic/dic_ad_check_lev3_dir.h b/pkg/dic/dic_ad_check_lev3_dir.h index bd1317c450..596f5c3f02 100644 --- a/pkg/dic/dic_ad_check_lev3_dir.h +++ b/pkg/dic/dic_ad_check_lev3_dir.h @@ -2,12 +2,12 @@ C common CARBON_NEEDS CADJ STORE pH = tapelev3, key = ilev_3 -CADJ STORE pCO2 = tapelev3, key = ilev_3 -CADJ STORE fIce = tapelev3, key = ilev_3 -CADJ STORE silicaSurf = tapelev3, key = ilev_3 +cCADJ STORE pCO2 = tapelev3, key = ilev_3 +cCADJ STORE fIce = tapelev3, key = ilev_3 +cCADJ STORE silicaSurf = tapelev3, key = ilev_3 CADJ STORE atmosPCO2 = tapelev3, key = ilev_3 -CADJ STORE gsm_s = tapelev3, key = ilev_3 +cCADJ STORE gsm_s = tapelev3, key = ilev_3 CADJ STORE co2atmos = tapelev3, key = ilev_3 CADJ STORE total_atmos_carbon = tapelev3, key = ilev_3 diff --git a/pkg/dic/dic_ad_check_lev4_dir.h b/pkg/dic/dic_ad_check_lev4_dir.h index c0430c6f27..830d397102 100644 --- a/pkg/dic/dic_ad_check_lev4_dir.h +++ b/pkg/dic/dic_ad_check_lev4_dir.h @@ -2,12 +2,12 @@ C common CARBON_NEEDS CADJ STORE pH = tapelev4, key = ilev_4 -CADJ STORE pCO2 = tapelev4, key = ilev_4 -CADJ STORE fIce = tapelev4, key = ilev_4 -CADJ STORE silicaSurf = tapelev4, key = ilev_4 -CADJ STORE atmosPCO2 = tapelev4, key = ilev_4 +cCADJ STORE pCO2 = tapelev4, key = ilev_4 +cCADJ STORE fIce = tapelev4, key = ilev_4 +cCADJ STORE silicaSurf = tapelev4, key = ilev_4 +cCADJ STORE atmosPCO2 = tapelev4, key = ilev_4 -CADJ STORE gsm_s = tapelev4, key = ilev_4 +cCADJ STORE gsm_s = tapelev4, key = ilev_4 CADJ STORE co2atmos = tapelev4, key = ilev_4 CADJ STORE total_atmos_carbon = tapelev4, key = ilev_4 diff --git a/pkg/dic/dic_surfforcing_init.F b/pkg/dic/dic_surfforcing_init.F index af4208f655..14e944d95c 100644 --- a/pkg/dic/dic_surfforcing_init.F +++ b/pkg/dic/dic_surfforcing_init.F @@ -301,8 +301,8 @@ SUBROUTINE DIC_SURFFORCING_INIT( ENDIF #endif DO it=1,10 -C$TAF STORE pH(i,j,bi,bj) = dic_surf -C$TAF STORE surfalk(i,j), surfphos(i,j), surfsi(i,j) = dic_surf +cC$TAF STORE pH(i,j,bi,bj) = dic_surf +cC$TAF STORE surfalk(i,j), surfphos(i,j), surfsi(i,j) = dic_surf CALL CALC_PCO2_APPROX( I surftemp(i,j),surfsalt(i,j), I surfdic(i,j), surfphos(i,j), diff --git a/pkg/ecco/ECCO_OPTIONS.h b/pkg/ecco/ECCO_OPTIONS.h index b27dcf229b..6764235a78 100644 --- a/pkg/ecco/ECCO_OPTIONS.h +++ b/pkg/ecco/ECCO_OPTIONS.h @@ -64,8 +64,8 @@ C o Set ALLOW_OBCS_COST_CONTRIBUTION (Do not edit/modify): C o Include global mean steric sea level correction #undef ALLOW_PSBAR_STERIC #ifdef ATMOSPHERIC_LOADING -C Apply inverse barometer correction -# define ALLOW_IB_CORR +C Apply inverse barometer correction (coded within ATMOSPHERIC_LOADING) +# undef ALLOW_IB_CORR #endif C o Allow for near-shore and high-latitude altimetry #undef ALLOW_SHALLOW_ALTIMETRY diff --git a/pkg/exf/exf_ad_check_lev2_dir.h b/pkg/exf/exf_ad_check_lev2_dir.h index 774795648f..2880ce67fc 100644 --- a/pkg/exf/exf_ad_check_lev2_dir.h +++ b/pkg/exf/exf_ad_check_lev2_dir.h @@ -14,16 +14,8 @@ CADJ STORE hflux0 = tapelev2, key = ilev_2 CADJ STORE hflux1 = tapelev2, key = ilev_2 CADJ STORE sflux0 = tapelev2, key = ilev_2 CADJ STORE sflux1 = tapelev2, key = ilev_2 -CADJ STORE ustress0 = tapelev2, key = ilev_2 -CADJ STORE ustress1 = tapelev2, key = ilev_2 -CADJ STORE vstress0 = tapelev2, key = ilev_2 -CADJ STORE vstress1 = tapelev2, key = ilev_2 CADJ STORE wspeed0 = tapelev2, key = ilev_2 CADJ STORE wspeed1 = tapelev2, key = ilev_2 -# ifdef SHORTWAVE_HEATING -CADJ STORE swflux0 = tapelev2, key = ilev_2 -CADJ STORE swflux1 = tapelev2, key = ilev_2 -# endif # ifdef ALLOW_RUNOFF CADJ STORE runoff0 = tapelev2, key = ilev_2 CADJ STORE runoff1 = tapelev2, key = ilev_2 @@ -46,14 +38,16 @@ CADJ STORE saltflx0 = tapelev2, key = ilev_2 CADJ STORE saltflx1 = tapelev2, key = ilev_2 # endif # ifdef ALLOW_ATM_TEMP +CADJ STORE ustress0 = tapelev2, key = ilev_2 +CADJ STORE ustress1 = tapelev2, key = ilev_2 +CADJ STORE vstress0 = tapelev2, key = ilev_2 +CADJ STORE vstress1 = tapelev2, key = ilev_2 CADJ STORE aqh0 = tapelev2, key = ilev_2 CADJ STORE aqh1 = tapelev2, key = ilev_2 CADJ STORE atemp0 = tapelev2, key = ilev_2 CADJ STORE atemp1 = tapelev2, key = ilev_2 CADJ STORE precip0 = tapelev2, key = ilev_2 CADJ STORE precip1 = tapelev2, key = ilev_2 -CADJ STORE lwflux0 = tapelev2, key = ilev_2 -CADJ STORE lwflux1 = tapelev2, key = ilev_2 CADJ STORE snowprecip0 = tapelev2, key = ilev_2 CADJ STORE snowprecip1 = tapelev2, key = ilev_2 # ifdef ALLOW_READ_TURBFLUXES @@ -66,13 +60,18 @@ CADJ STORE hl1 = tapelev2, key = ilev_2 CADJ STORE evap0 = tapelev2, key = ilev_2 CADJ STORE evap1 = tapelev2, key = ilev_2 # endif /* EXF_READ_EVAP */ -# ifdef ALLOW_DOWNWARD_RADIATION +# endif /* ALLOW_ATM_TEMP */ +# ifdef ALLOW_DOWNWARD_RADIATION CADJ STORE swdown0 = tapelev2, key = ilev_2 CADJ STORE swdown1 = tapelev2, key = ilev_2 CADJ STORE lwdown0 = tapelev2, key = ilev_2 CADJ STORE lwdown1 = tapelev2, key = ilev_2 +# else +# ifdef SHORTWAVE_HEATING +CADJ STORE swflux0 = tapelev2, key = ilev_2 +CADJ STORE swflux1 = tapelev2, key = ilev_2 # endif -# endif /* ALLOW_ATM_TEMP */ +# endif /* ALLOW_DOWNWARD_RADIATION */ CADJ STORE uwind0 = tapelev2, key = ilev_2 CADJ STORE uwind1 = tapelev2, key = ilev_2 CADJ STORE vwind0 = tapelev2, key = ilev_2 diff --git a/pkg/exf/exf_ad_check_lev3_dir.h b/pkg/exf/exf_ad_check_lev3_dir.h index 1394e274bd..120c70ba44 100644 --- a/pkg/exf/exf_ad_check_lev3_dir.h +++ b/pkg/exf/exf_ad_check_lev3_dir.h @@ -14,16 +14,8 @@ CADJ STORE hflux0 = tapelev3, key = ilev_3 CADJ STORE hflux1 = tapelev3, key = ilev_3 CADJ STORE sflux0 = tapelev3, key = ilev_3 CADJ STORE sflux1 = tapelev3, key = ilev_3 -CADJ STORE ustress0 = tapelev3, key = ilev_3 -CADJ STORE ustress1 = tapelev3, key = ilev_3 -CADJ STORE vstress0 = tapelev3, key = ilev_3 -CADJ STORE vstress1 = tapelev3, key = ilev_3 CADJ STORE wspeed0 = tapelev3, key = ilev_3 CADJ STORE wspeed1 = tapelev3, key = ilev_3 -# ifdef SHORTWAVE_HEATING -CADJ STORE swflux0 = tapelev3, key = ilev_3 -CADJ STORE swflux1 = tapelev3, key = ilev_3 -# endif # ifdef ALLOW_RUNOFF CADJ STORE runoff0 = tapelev3, key = ilev_3 CADJ STORE runoff1 = tapelev3, key = ilev_3 @@ -46,14 +38,16 @@ CADJ STORE saltflx0 = tapelev3, key = ilev_3 CADJ STORE saltflx1 = tapelev3, key = ilev_3 # endif # ifdef ALLOW_ATM_TEMP +CADJ STORE ustress0 = tapelev3, key = ilev_3 +CADJ STORE ustress1 = tapelev3, key = ilev_3 +CADJ STORE vstress0 = tapelev3, key = ilev_3 +CADJ STORE vstress1 = tapelev3, key = ilev_3 CADJ STORE aqh0 = tapelev3, key = ilev_3 CADJ STORE aqh1 = tapelev3, key = ilev_3 CADJ STORE atemp0 = tapelev3, key = ilev_3 CADJ STORE atemp1 = tapelev3, key = ilev_3 CADJ STORE precip0 = tapelev3, key = ilev_3 CADJ STORE precip1 = tapelev3, key = ilev_3 -CADJ STORE lwflux0 = tapelev3, key = ilev_3 -CADJ STORE lwflux1 = tapelev3, key = ilev_3 CADJ STORE snowprecip0 = tapelev3, key = ilev_3 CADJ STORE snowprecip1 = tapelev3, key = ilev_3 # ifdef ALLOW_READ_TURBFLUXES @@ -66,13 +60,18 @@ CADJ STORE hl1 = tapelev3, key = ilev_3 CADJ STORE evap0 = tapelev3, key = ilev_3 CADJ STORE evap1 = tapelev3, key = ilev_3 # endif /* EXF_READ_EVAP */ -# ifdef ALLOW_DOWNWARD_RADIATION +# endif /* ALLOW_ATM_TEMP */ +# ifdef ALLOW_DOWNWARD_RADIATION CADJ STORE swdown0 = tapelev3, key = ilev_3 CADJ STORE swdown1 = tapelev3, key = ilev_3 CADJ STORE lwdown0 = tapelev3, key = ilev_3 CADJ STORE lwdown1 = tapelev3, key = ilev_3 +# else +# ifdef SHORTWAVE_HEATING +CADJ STORE swflux0 = tapelev3, key = ilev_3 +CADJ STORE swflux1 = tapelev3, key = ilev_3 # endif -# endif /* ALLOW_ATM_TEMP */ +# endif /* ALLOW_DOWNWARD_RADIATION */ CADJ STORE uwind0 = tapelev3, key = ilev_3 CADJ STORE uwind1 = tapelev3, key = ilev_3 CADJ STORE vwind0 = tapelev3, key = ilev_3 diff --git a/pkg/exf/exf_ad_check_lev4_dir.h b/pkg/exf/exf_ad_check_lev4_dir.h index 5020eac4ce..938d68ec0c 100644 --- a/pkg/exf/exf_ad_check_lev4_dir.h +++ b/pkg/exf/exf_ad_check_lev4_dir.h @@ -14,16 +14,8 @@ CADJ STORE hflux0 = tapelev4, key = ilev_4 CADJ STORE hflux1 = tapelev4, key = ilev_4 CADJ STORE sflux0 = tapelev4, key = ilev_4 CADJ STORE sflux1 = tapelev4, key = ilev_4 -CADJ STORE ustress0 = tapelev4, key = ilev_4 -CADJ STORE ustress1 = tapelev4, key = ilev_4 -CADJ STORE vstress0 = tapelev4, key = ilev_4 -CADJ STORE vstress1 = tapelev4, key = ilev_4 CADJ STORE wspeed0 = tapelev4, key = ilev_4 CADJ STORE wspeed1 = tapelev4, key = ilev_4 -# ifdef SHORTWAVE_HEATING -CADJ STORE swflux0 = tapelev4, key = ilev_4 -CADJ STORE swflux1 = tapelev4, key = ilev_4 -# endif # ifdef ALLOW_RUNOFF CADJ STORE runoff0 = tapelev4, key = ilev_4 CADJ STORE runoff1 = tapelev4, key = ilev_4 @@ -46,14 +38,16 @@ CADJ STORE saltflx0 = tapelev4, key = ilev_4 CADJ STORE saltflx1 = tapelev4, key = ilev_4 # endif # ifdef ALLOW_ATM_TEMP +CADJ STORE ustress0 = tapelev4, key = ilev_4 +CADJ STORE ustress1 = tapelev4, key = ilev_4 +CADJ STORE vstress0 = tapelev4, key = ilev_4 +CADJ STORE vstress1 = tapelev4, key = ilev_4 CADJ STORE aqh0 = tapelev4, key = ilev_4 CADJ STORE aqh1 = tapelev4, key = ilev_4 CADJ STORE atemp0 = tapelev4, key = ilev_4 CADJ STORE atemp1 = tapelev4, key = ilev_4 CADJ STORE precip0 = tapelev4, key = ilev_4 CADJ STORE precip1 = tapelev4, key = ilev_4 -CADJ STORE lwflux0 = tapelev4, key = ilev_4 -CADJ STORE lwflux1 = tapelev4, key = ilev_4 CADJ STORE snowprecip0 = tapelev4, key = ilev_4 CADJ STORE snowprecip1 = tapelev4, key = ilev_4 # ifdef ALLOW_READ_TURBFLUXES @@ -66,13 +60,18 @@ CADJ STORE hl1 = tapelev4, key = ilev_4 CADJ STORE evap0 = tapelev4, key = ilev_4 CADJ STORE evap1 = tapelev4, key = ilev_4 # endif /* EXF_READ_EVAP */ -# ifdef ALLOW_DOWNWARD_RADIATION +# endif /* ALLOW_ATM_TEMP */ +# ifdef ALLOW_DOWNWARD_RADIATION CADJ STORE swdown0 = tapelev4, key = ilev_4 CADJ STORE swdown1 = tapelev4, key = ilev_4 CADJ STORE lwdown0 = tapelev4, key = ilev_4 CADJ STORE lwdown1 = tapelev4, key = ilev_4 +# else +# ifdef SHORTWAVE_HEATING +CADJ STORE swflux0 = tapelev4, key = ilev_4 +CADJ STORE swflux1 = tapelev4, key = ilev_4 # endif -# endif /* ALLOW_ATM_TEMP */ +# endif /* ALLOW_DOWNWARD_RADIATION */ CADJ STORE uwind0 = tapelev4, key = ilev_4 CADJ STORE uwind1 = tapelev4, key = ilev_4 CADJ STORE vwind0 = tapelev4, key = ilev_4 diff --git a/pkg/exf/exf_bulkformulae.F b/pkg/exf/exf_bulkformulae.F index d1bf5c0cfc..d125f684a7 100644 --- a/pkg/exf/exf_bulkformulae.F +++ b/pkg/exf/exf_bulkformulae.F @@ -418,7 +418,9 @@ SUBROUTINE EXF_BULKFORMULAE( myTime, myIter, myThid ) & ( exf_two*LOG(exf_half*(exf_one+xsq)) ) IF ( solve4Stress ) THEN +#ifdef ALLOW_AUTODIFF_TAMC CADJ STORE rdn(i,j) = comlev1_exf_2, key = ikey_2 +#endif C- Shift wind speed using old coefficient #ifdef ALLOW_BULK_LARGEYEAGER04 C-- Large&Yeager04: diff --git a/pkg/exf/exf_getclim.F b/pkg/exf/exf_getclim.F index da8e3ec62b..c84de31e1c 100644 --- a/pkg/exf/exf_getclim.F +++ b/pkg/exf/exf_getclim.F @@ -4,9 +4,6 @@ #endif #ifdef ALLOW_ECCO # include "ECCO_OPTIONS.h" -#endif -#ifdef ALLOW_AUTODIFF -# include "AUTODIFF_OPTIONS.h" #endif SUBROUTINE EXF_GETCLIM( @@ -49,9 +46,6 @@ SUBROUTINE EXF_GETCLIM( #include "EXF_INTERP_SIZE.h" #include "EXF_INTERP_PARAM.h" #include "EXF_FIELDS.h" -#ifdef ALLOW_AUTODIFF_TAMC -# include "tamc.h" -#endif c == routine arguments == @@ -87,10 +81,6 @@ SUBROUTINE EXF_GETCLIM( #endif I myTime, myIter, myThid ) -#ifdef ALLOW_AUTODIFF_TAMC -C this avoids storing climsst0/1 -CADJ STORE climsst = comlev1, key=ikey_dynamics, kind=isbyte -#endif DO bj = myByLo(myThid),myByHi(myThid) DO bi = myBxLo(myThid),myBxHi(myThid) DO j = 1,sNy diff --git a/pkg/generic_advdiff/gad_advection.F b/pkg/generic_advdiff/gad_advection.F index 9f5eeb053d..415326691b 100644 --- a/pkg/generic_advdiff/gad_advection.F +++ b/pkg/generic_advdiff/gad_advection.F @@ -461,7 +461,7 @@ SUBROUTINE GAD_ADVECTION( C- Advective flux in X : done ENDIF -#ifdef ALLOW_AUTODIFF_TAMC +#if ( defined ALLOW_AUTODIFF_TAMC && defined NONLIN_FRSURF ) CADJ STORE af = loctape_gad_adv_k_pass, key = dkey, kind = isbyte #endif C- Update the local tracer field where needed: @@ -682,7 +682,7 @@ SUBROUTINE GAD_ADVECTION( C- Advective flux in Y : done ENDIF -#ifdef ALLOW_AUTODIFF_TAMC +#if ( defined ALLOW_AUTODIFF_TAMC && defined NONLIN_FRSURF ) CADJ STORE af = loctape_gad_adv_k_pass, key = dkey, kind = isbyte #endif C- Update the local tracer field where needed: @@ -1021,11 +1021,13 @@ SUBROUTINE GAD_ADVECTION( #ifdef ALLOW_AUTODIFF_TAMC CADJ STORE rtrans = loctape_gad_adv_k, key = k, kind = isbyte CADJ STORE rtransKp = loctape_gad_adv_k, key = k, kind = isbyte +# ifdef NONLIN_FRSURF cph --- following storing of fVerT is critical for correct cph --- gradient with multiDimAdvection cph --- Without it, kDown component is not properly recomputed cph --- This is a TAF bug (and no warning available) CADJ STORE fVerT(:,:,:) = loctape_gad_adv_k, key = k, kind = isbyte +# endif #endif C-- Divergence of vertical fluxes diff --git a/pkg/generic_advdiff/gad_dst3fl_impl_r.F b/pkg/generic_advdiff/gad_dst3fl_impl_r.F index 41ac6b8796..6054b0450f 100644 --- a/pkg/generic_advdiff/gad_dst3fl_impl_r.F +++ b/pkg/generic_advdiff/gad_dst3fl_impl_r.F @@ -78,12 +78,12 @@ SUBROUTINE GAD_DST3FL_IMPL_R( _RL mskM, mskP, maskM2, maskP1 _RL Rj, Rjh, cL1, cH3, cM2, th1, th2 _RL deltaTcfl -#ifdef ALLOW_AUTODIFF_TAMC +#if ( defined ALLOW_AUTODIFF_TAMC && defined INCLUDE_IMPLVERTADV_CODE ) INTEGER ikey #endif CEOP -#ifdef ALLOW_AUTODIFF_TAMC +#if ( defined ALLOW_AUTODIFF_TAMC && defined INCLUDE_IMPLVERTADV_CODE ) CADJ INIT loctape_gad = COMMON, (sNx+2*OLx)*(sNy+2*OLy) #endif C-- process interior interface only: @@ -105,7 +105,7 @@ SUBROUTINE GAD_DST3FL_IMPL_R( C lowFac & highFac are set such as Psi*Rj = lowFac*Rj + highFac*Rjh DO j=jMin,jMax DO i=iMin,iMax -#ifdef ALLOW_AUTODIFF_TAMC +#if ( defined ALLOW_AUTODIFF_TAMC && defined INCLUDE_IMPLVERTADV_CODE ) ikey = i + (sNx+2*OLx)*(j-1) #endif wCFL = deltaTcfl*ABS(rTrans(i,j)) @@ -127,7 +127,7 @@ SUBROUTINE GAD_DST3FL_IMPL_R( lowFac(i,j) = 0. _d 0 highFac(i,j)= 0. _d 0 ELSE -#ifdef ALLOW_AUTODIFF_TAMC +#if ( defined ALLOW_AUTODIFF_TAMC && defined INCLUDE_IMPLVERTADV_CODE ) C These stores to local tape avoid recomputations and associated warnings CADJ STORE Rjh, Rj = loctape_gad, key = ikey #endif diff --git a/pkg/generic_advdiff/gad_som_adv_r.F b/pkg/generic_advdiff/gad_som_adv_r.F index 7b30bf1856..9b6dead4a3 100644 --- a/pkg/generic_advdiff/gad_som_adv_r.F +++ b/pkg/generic_advdiff/gad_som_adv_r.F @@ -1,4 +1,7 @@ #include "GAD_OPTIONS.h" +#ifdef ALLOW_PTRACERS +# include "PTRACERS_OPTIONS.h" +#endif #ifdef ALLOW_AUTODIFF # include "AUTODIFF_OPTIONS.h" #endif @@ -106,6 +109,7 @@ SUBROUTINE GAD_SOM_ADV_R( _RL fn_yz(1-OLx:sNx+OLx,1-OLy:sNy+OLy,2) _RL wT (1-OLx:sNx+OLx,1-OLy:sNy+OLy) +#if ( defined GAD_ALLOW_TS_SOM_ADV || defined PTRACERS_ALLOW_DYN_STATE ) C !LOCAL VARIABLES: ==================================================== C i,j :: loop indices C wLoc :: volume transported (per time step) @@ -360,6 +364,7 @@ SUBROUTINE GAD_SOM_ADV_R( #endif /* ALLOW_OBCS */ ENDDO ENDDO +#endif /* GAD_ALLOW_TS_SOM_ADV or PTRACERS_ALLOW_DYN_STATE */ RETURN END diff --git a/pkg/generic_advdiff/gad_som_adv_x.F b/pkg/generic_advdiff/gad_som_adv_x.F index f1836cf114..72796ec881 100644 --- a/pkg/generic_advdiff/gad_som_adv_x.F +++ b/pkg/generic_advdiff/gad_som_adv_x.F @@ -1,4 +1,7 @@ #include "GAD_OPTIONS.h" +#ifdef ALLOW_PTRACERS +# include "PTRACERS_OPTIONS.h" +#endif #ifdef ALLOW_AUTODIFF # include "AUTODIFF_OPTIONS.h" #endif @@ -81,6 +84,7 @@ SUBROUTINE GAD_SOM_ADV_X( _RL sm_yz (1-OLx:sNx+OLx,1-OLy:sNy+OLy) _RL uT (1-OLx:sNx+OLx,1-OLy:sNy+OLy) +#if ( defined GAD_ALLOW_TS_SOM_ADV || defined PTRACERS_ALLOW_DYN_STATE ) C !LOCAL VARIABLES: ==================================================== C i,j :: loop indices C uLoc :: volume transported (per time step) @@ -159,7 +163,7 @@ SUBROUTINE GAD_SOM_ADV_X( IF ( limiter.EQ.1 ) THEN #ifdef ALLOW_AUTODIFF_TAMC -CADJ STORE sm_o,sm_x,sm_xx,sm_xy,sm_xz,sm_y,sm_yy,sm_yz,sm_z,sm_zz +CADJ STORE sm_o,sm_x,sm_xx,sm_xy,sm_xz CADJ & = somtape_x, key = ns, kind = isbyte #endif DO j=jMinUpd(ns),jMaxUpd(ns) @@ -236,7 +240,7 @@ SUBROUTINE GAD_SOM_ADV_X( c ENDDO #ifdef ALLOW_AUTODIFF_TAMC -CADJ STORE sm_o,sm_v,sm_x,sm_xx,sm_xy,sm_xz,sm_y,sm_yy,sm_yz,sm_z,sm_zz +CADJ STORE sm_o,sm_v,sm_x,sm_y,sm_z,sm_xx,sm_xy,sm_xz CADJ & = somtape_x, key = ns, kind = isbyte #endif C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| @@ -320,6 +324,7 @@ SUBROUTINE GAD_SOM_ADV_X( C-- end 2nd loop on strip number "ns" ENDDO +#endif /* GAD_ALLOW_TS_SOM_ADV or PTRACERS_ALLOW_DYN_STATE */ RETURN END diff --git a/pkg/generic_advdiff/gad_som_adv_y.F b/pkg/generic_advdiff/gad_som_adv_y.F index c4a70c53c3..6551c6f1d5 100644 --- a/pkg/generic_advdiff/gad_som_adv_y.F +++ b/pkg/generic_advdiff/gad_som_adv_y.F @@ -1,4 +1,7 @@ #include "GAD_OPTIONS.h" +#ifdef ALLOW_PTRACERS +# include "PTRACERS_OPTIONS.h" +#endif #ifdef ALLOW_AUTODIFF # include "AUTODIFF_OPTIONS.h" #endif @@ -81,6 +84,7 @@ SUBROUTINE GAD_SOM_ADV_Y( _RL sm_yz (1-OLx:sNx+OLx,1-OLy:sNy+OLy) _RL vT (1-OLx:sNx+OLx,1-OLy:sNy+OLy) +#if ( defined GAD_ALLOW_TS_SOM_ADV || defined PTRACERS_ALLOW_DYN_STATE ) C !LOCAL VARIABLES: ==================================================== C i,j :: loop indices C vLoc :: volume transported (per time step) @@ -159,7 +163,7 @@ SUBROUTINE GAD_SOM_ADV_Y( IF ( limiter.EQ.1 ) THEN #ifdef ALLOW_AUTODIFF_TAMC -CADJ STORE sm_o,sm_v,sm_x,sm_xx,sm_xy,sm_xz,sm_y,sm_yy,sm_yz,sm_z,sm_zz +CADJ STORE sm_o,sm_y,sm_yy,sm_xy,sm_yz CADJ & = somtape_y, key = ns, kind = isbyte #endif DO j=jMinUpd(1)-1,jMaxUpd(1)+1 @@ -237,7 +241,7 @@ SUBROUTINE GAD_SOM_ADV_Y( c ENDDO #ifdef ALLOW_AUTODIFF_TAMC -CADJ STORE sm_o,sm_v,sm_x,sm_xx,sm_xy,sm_xz,sm_y,sm_yy,sm_yz,sm_z,sm_zz +CADJ STORE sm_o,sm_v,sm_x,sm_y,sm_z,sm_xy,sm_yy,sm_yz CADJ & = somtape_y, key = ns, kind = isbyte #endif C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| @@ -321,6 +325,7 @@ SUBROUTINE GAD_SOM_ADV_Y( C-- end 2nd loop on strip number "ns" ENDDO +#endif /* GAD_ALLOW_TS_SOM_ADV or PTRACERS_ALLOW_DYN_STATE */ RETURN END diff --git a/pkg/generic_advdiff/gad_som_advect.F b/pkg/generic_advdiff/gad_som_advect.F index a1a0d5a439..055330b84c 100644 --- a/pkg/generic_advdiff/gad_som_advect.F +++ b/pkg/generic_advdiff/gad_som_advect.F @@ -1,4 +1,7 @@ #include "GAD_OPTIONS.h" +#ifdef ALLOW_PTRACERS +# include "PTRACERS_OPTIONS.h" +#endif #ifdef ALLOW_AUTODIFF # include "AUTODIFF_OPTIONS.h" #endif @@ -73,6 +76,7 @@ SUBROUTINE GAD_SOM_ADVECT( _RL smTr (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy,nSOM) _RL gTracer(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) +#if ( defined GAD_ALLOW_TS_SOM_ADV || defined PTRACERS_ALLOW_DYN_STATE ) C !LOCAL VARIABLES: ==================================================== C maskUp :: 2-D array mask for W points C i,j,k :: loop indices @@ -666,6 +670,7 @@ SUBROUTINE GAD_SOM_ADVECT( ENDDO C-- end of if not.implicitAdvection block ENDIF +#endif /* GAD_ALLOW_TS_SOM_ADV or PTRACERS_ALLOW_DYN_STATE */ RETURN END diff --git a/pkg/ggl90/GGL90.h b/pkg/ggl90/GGL90.h index 1cbf94430d..bf9815bd79 100644 --- a/pkg/ggl90/GGL90.h +++ b/pkg/ggl90/GGL90.h @@ -26,12 +26,16 @@ C GGL90alpha - constant relating viscosity to GGL90 diffusivity C (default=1 in Gaspar etal.) C GGL90TKEsurfmin - minimum of surface kinetic energy boundary condition C (default=GGL90TKEmin) -C GGL90TKEmin - minimum kinetic energy, leads to minimum mixing if TKE=0. +C GGL90TKEmin - minimum kinetic energy, both numerical regularisation +C and source of due to unresolved processes, +C e.g. internal gravity waves C GGL90TKEbottom - bottom bounardy condition for kinetic energy C (default=GGL90TKEmin) C GGL90TKEFile - File with initial field of TKE C GGL90mixingLengthMin - Mininum mixing length C mxlMaxFlag - Flag for limiting mixing-length method (default=0) +C adMxlMaxFlag - in AD-mode, use adMxlMaxFlag instead of mxlMaxFlag +C (default=mxlMaxFlag) C mxlSurfFlag - Flag to force mixing near ocean surface (default= F ) C calcMeanVertShear :: calculate the mean (@ grid-cell center) of vertical C shear compon. (instead of vert. shear of mean flow); @@ -75,6 +79,7 @@ CEOP _RL GGL90viscMax, GGL90diffMax _RL GGL90dumpFreq INTEGER mxlMaxFlag + INTEGER adMxlMaxFlag COMMON /GGL90_PARMS_R/ & GGL90ck, GGL90ceps, & GGL90alpha, GGL90m2, @@ -82,7 +87,7 @@ CEOP & GGL90mixingLengthMin, & GGL90TKEmin, GGL90TKEsurfMin, GGL90TKEbottom, & GGL90viscMax, GGL90diffMax, - & GGL90dumpFreq, mxlMaxFlag + & GGL90dumpFreq, mxlMaxFlag, adMxlMaxFlag _RL GGL90TKE (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) _RL GGL90viscArU(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) diff --git a/pkg/ggl90/GGL90_OPTIONS.h b/pkg/ggl90/GGL90_OPTIONS.h index 9597ea414f..4d042d7eb2 100644 --- a/pkg/ggl90/GGL90_OPTIONS.h +++ b/pkg/ggl90/GGL90_OPTIONS.h @@ -32,6 +32,9 @@ C Coriolis parameter, buoyancy frequency etc, when used in the denominator C include Langmuir circulation parameterization #undef ALLOW_GGL90_LANGMUIR +C Replace MAX(mxl,mxlMin) by SQRT(mxl**2+mxlMin**2) to help adjoint +#undef GGL90_REGULARIZE_MIXINGLENGTH + C recover old bug prior to Jun 2023 #undef GGL90_MISSING_HFAC_BUG diff --git a/pkg/ggl90/ggl90_ad_check_lev2_dir.h b/pkg/ggl90/ggl90_ad_check_lev2_dir.h index b16f958f65..39e38f0506 100644 --- a/pkg/ggl90/ggl90_ad_check_lev2_dir.h +++ b/pkg/ggl90/ggl90_ad_check_lev2_dir.h @@ -1,5 +1 @@ -CADJ STORE GGL90viscArU = tapelev2, key=ilev_2 -CADJ STORE GGL90viscArV = tapelev2, key=ilev_2 -CADJ STORE GGL90diffKr = tapelev2, key=ilev_2 CADJ STORE GGL90TKE = tapelev2, key=ilev_2 - diff --git a/pkg/ggl90/ggl90_ad_check_lev3_dir.h b/pkg/ggl90/ggl90_ad_check_lev3_dir.h index d4cd4da1e6..0dd9deb2ff 100644 --- a/pkg/ggl90/ggl90_ad_check_lev3_dir.h +++ b/pkg/ggl90/ggl90_ad_check_lev3_dir.h @@ -1,5 +1 @@ -CADJ STORE GGL90viscArU = tapelev3, key=ilev_3 -CADJ STORE GGL90viscArV = tapelev3, key=ilev_3 -CADJ STORE GGL90diffKr = tapelev3, key=ilev_3 CADJ STORE GGL90TKE = tapelev3, key=ilev_3 - diff --git a/pkg/ggl90/ggl90_ad_check_lev4_dir.h b/pkg/ggl90/ggl90_ad_check_lev4_dir.h index beaa3f39b4..1812850ba0 100644 --- a/pkg/ggl90/ggl90_ad_check_lev4_dir.h +++ b/pkg/ggl90/ggl90_ad_check_lev4_dir.h @@ -1,5 +1 @@ -CADJ STORE GGL90viscArU = tapelev4, key=ilev_4 -CADJ STORE GGL90viscArV = tapelev4, key=ilev_4 -CADJ STORE GGL90diffKr = tapelev4, key=ilev_4 CADJ STORE GGL90TKE = tapelev4, key=ilev_4 - diff --git a/pkg/ggl90/ggl90_ad_diff.list b/pkg/ggl90/ggl90_ad_diff.list index 934253aace..851784dd65 100644 --- a/pkg/ggl90/ggl90_ad_diff.list +++ b/pkg/ggl90/ggl90_ad_diff.list @@ -2,6 +2,7 @@ ggl90_add_stokesdrift.f ggl90_calc_diff.f ggl90_calc_visc.f ggl90_calc.f +ggl90_mixinglength.f ggl90_exchanges.f ggl90_init_fixed.f ggl90_init_varia.f diff --git a/pkg/ggl90/ggl90_calc.F b/pkg/ggl90/ggl90_calc.F index d28594413c..dc19670318 100644 --- a/pkg/ggl90/ggl90_calc.F +++ b/pkg/ggl90/ggl90_calc.F @@ -80,7 +80,6 @@ SUBROUTINE GGL90_CALC( C between k and k-1), all 2D variables are also defined at W-points C or at the very surface level (like uStarSquare) C -C totalDepth :: thickness of water column (inverse of recip_Rcol) C uStarSquare :: square of friction velocity C verticalShear :: (squared) vertical shear of horizontal velocity C Nsquare :: squared buoyancy freqency @@ -99,7 +98,6 @@ SUBROUTINE GGL90_CALC( INTEGER errCode _RL deltaTloc _RL explDissFac, implDissFac - _RL totalDepth (1-OLx:sNx+OLx,1-OLy:sNy+OLy) _RL uStarSquare (1-OLx:sNx+OLx,1-OLy:sNy+OLy) _RL verticalShear(1-OLx:sNx+OLx,1-OLy:sNy+OLy) _RL KappaM (1-OLx:sNx+OLx,1-OLy:sNy+OLy) @@ -113,12 +111,10 @@ SUBROUTINE GGL90_CALC( _RL IDEMIX_RiNumber #endif _RL TKEdissipation - _RL tempU, tempUp, tempV, tempVp, prTemp - _RL MaxLength, tmpmlx, tmpVisc + _RL tempU, tempUp, tempV, tempVp, prTemp, tmpVisc _RL TKEPrandtlNumber (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) _RL GGL90mixingLength(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) _RL rMixingLength (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) - _RL mxLength_Dn (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) _RL KappaE (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) _RL GGL90visctmp (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) #ifdef ALLOW_GGL90_IDEMIX @@ -128,10 +124,9 @@ SUBROUTINE GGL90_CALC( _RL IDEMIX_gTKE (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) #endif /* ALLOW_GGL90_IDEMIX */ #ifdef ALLOW_GGL90_LANGMUIR - CHARACTER*(MAX_LEN_MBUF) msgBuf C uStar, vStar :: frictional velocity component _RL uStar, vStar, depthFac - _RL MLtmp, recip_Lasq, recip_LD + _RL recip_Lasq, recip_LD _RL LCmixingLength(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) _RL stokesterm(1-OLx:sNx+OLx,1-OLy:sNy+OLy) _RL dstokesUdR(1-OLx:sNx+OLx,1-OLy:sNy+OLy) @@ -272,12 +267,10 @@ SUBROUTINE GGL90_CALC( DO j=1-OLy,sNy+OLy DO i=1-OLx,sNx+OLx rMixingLength(i,j,k) = 0. _d 0 - mxLength_Dn(i,j,k) = 0. _d 0 GGL90visctmp(i,j,k) = 0. _d 0 KappaE(i,j,k) = 0. _d 0 TKEPrandtlNumber(i,j,k) = 1. _d 0 GGL90mixingLength(i,j,k) = GGL90mixingLengthMin - GGL90visctmp(i,j,k) = 0. _d 0 #ifndef SOLVE_DIAGONAL_LOWMEMORY a3d(i,j,k) = 0. _d 0 b3d(i,j,k) = 1. _d 0 @@ -296,11 +289,10 @@ SUBROUTINE GGL90_CALC( KappaM(i,j) = 0. _d 0 uStarSquare(i,j) = 0. _d 0 verticalShear(i,j) = 0. _d 0 - totalDepth(i,j) = Ro_surf(i,j,bi,bj) - R_low(i,j,bi,bj) c rMixingLength(i,j,1) = 0. _d 0 - mxLength_Dn(i,j,1) = GGL90mixingLengthMin #ifdef ALLOW_AUTODIFF - IF ( usingZCoords .AND. maskC(i,j,1,bi,bj).EQ.oneRS ) THEN + IF ( usingZCoords .AND. maskC(i,j,1,bi,bj).EQ.oneRS + & .AND. GGL90TKE(i,j,1,bi,bj) .GT. zeroRL ) THEN #endif SQRTTKE(i,j,1) = SQRT( GGL90TKE(i,j,1,bi,bj) ) #ifdef ALLOW_AUTODIFF @@ -330,13 +322,6 @@ SUBROUTINE GGL90_CALC( dstokesVdR(i,j) = 0. _d 0 ENDDO ENDDO - DO k=1,Nr - DO j=1-OLy,sNy+OLy - DO i=1-OLx,sNx+OLx - LCmixingLength(i,j,k) = GGL90mixingLengthMin - ENDDO - ENDDO - ENDDO ENDIF #endif @@ -345,7 +330,8 @@ SUBROUTINE GGL90_CALC( DO i=iMin,iMax mskLoc = maskC(i,j,k,bi,bj)*maskC(i,j,k-1,bi,bj) #ifdef ALLOW_AUTODIFF - IF ( mskLoc.EQ.oneRS ) THEN + IF ( mskLoc.EQ.oneRS + & .AND. GGL90TKE(i,j,k,bi,bj) .GT. zeroRL ) THEN #endif SQRTTKE(i,j,k)=SQRT( GGL90TKE(i,j,k,bi,bj) ) #ifdef ALLOW_AUTODIFF @@ -359,7 +345,7 @@ SUBROUTINE GGL90_CALC( & * sigmaR(i,j,k) * coordFac C vertical shear term (dU/dz)^2+(dV/dz)^2 is computed later C to save some memory -C mixing length +C Initialise mixing length (eq. 2.35) GGL90mixingLength(i,j,k) = SQRTTWO * & SQRTTKE(i,j,k)/SQRT( MAX(Nsquare(i,j,k),GGL90eps) ) & * mskLoc @@ -367,423 +353,28 @@ SUBROUTINE GGL90_CALC( ENDDO ENDDO -C- ensure mixing between first and second level - IF (mxlSurfFlag) THEN - DO j=jMin,jMax - DO i=iMin,iMax -#ifdef ALLOW_SHELFICE - IF ( useShelfIce ) THEN - kSrf = MAX(1,kTopC(i,j,bi,bj)) - kTop = MIN(kSrf+1,Nr) - ENDIF -#endif - GGL90mixingLength(i,j,kTop)=drF(kSrf)*recip_coordFac - ENDDO - ENDDO - ENDIF - -C-- Impose upper and lower bound for mixing length -#ifdef ALLOW_AUTODIFF -CADJ INCOMPLETE GGL90mixingLength -#endif - IF ( mxlMaxFlag .EQ. 0 ) THEN - - DO k=2,Nr - DO j=jMin,jMax - DO i=iMin,iMax - MaxLength=totalDepth(i,j)*recip_coordFac - GGL90mixingLength(i,j,k) = MIN(GGL90mixingLength(i,j,k), - & MaxLength) - ENDDO - ENDDO - ENDDO - - ELSEIF ( mxlMaxFlag .EQ. 1 ) THEN - - DO k=2,Nr - DO j=jMin,jMax - DO i=iMin,iMax - MaxLength=MIN(Ro_surf(i,j,bi,bj)-rF(k),rF(k)-R_low(i,j,bi,bj)) - & * recip_coordFac -c MaxLength=MAX(MaxLength,20. _d 0) - GGL90mixingLength(i,j,k) = MIN(GGL90mixingLength(i,j,k), - & MaxLength) - ENDDO - ENDDO - ENDDO - - ELSEIF ( mxlMaxFlag .EQ. 2 ) THEN - - IF ( usingPcoords ) THEN -#ifdef ALLOW_AUTODIFF_TAMC -CADJ STORE GGL90mixingLength(:,:,Nr) -CADJ & = comlev1_bibj, key = tkey, kind=isbyte -#endif /* ALLOW_AUTODIFF_TAMC */ -C Downward sweep, extra treatment of k=Nr for p-coordinates -C because level Nr+1 is not available - DO j=jMin,jMax - DO i=iMin,iMax - GGL90mixingLength(i,j,Nr) = MIN(GGL90mixingLength(i,j,Nr), - & GGL90mixingLengthMin+drF(Nr)*recip_coordFac) - ENDDO - ENDDO - DO k=Nr-1,2,-1 -#ifdef ALLOW_AUTODIFF_TAMC - kkey = k + (tkey-1)*Nr -CADJ STORE GGL90mixingLength(:,:,k+1) -CADJ & = comlev1_bibj_k, key = kkey, kind=isbyte -#endif /* ALLOW_AUTODIFF_TAMC */ - DO j=jMin,jMax - DO i=iMin,iMax - GGL90mixingLength(i,j,k) = MIN(GGL90mixingLength(i,j,k), - & GGL90mixingLength(i,j,k+1)+drF(k)*recip_coordFac) - ENDDO - ENDDO - ENDDO -C Upward sweep - DO k=2,Nr -#ifdef ALLOW_AUTODIFF_TAMC - kkey = k + (tkey-1)*Nr -CADJ STORE GGL90mixingLength(:,:,k-1) -CADJ & = comlev1_bibj_k, key = kkey, kind=isbyte -#endif /* ALLOW_AUTODIFF_TAMC */ - DO j=jMin,jMax - DO i=iMin,iMax - GGL90mixingLength(i,j,k) = MIN(GGL90mixingLength(i,j,k), - & GGL90mixingLength(i,j,k-1)+drF(k-1)*recip_coordFac) - ENDDO - ENDDO - ENDDO - ELSE -#ifdef ALLOW_AUTODIFF_TAMC -CADJ STORE GGL90mixingLength(:,:,Nr) -CADJ & = comlev1_bibj, key = tkey, kind=isbyte -#endif /* ALLOW_AUTODIFF_TAMC */ -C Downward sweep - DO k=2,Nr -#ifdef ALLOW_AUTODIFF_TAMC - kkey = k + (tkey-1)*Nr -CADJ STORE GGL90mixingLength(:,:,k-1) -CADJ & = comlev1_bibj_k, key = kkey, kind=isbyte -#endif /* ALLOW_AUTODIFF_TAMC */ - DO j=jMin,jMax - DO i=iMin,iMax - GGL90mixingLength(i,j,k) = MIN(GGL90mixingLength(i,j,k), - & GGL90mixingLength(i,j,k-1)+drF(k-1)*recip_coordFac) - ENDDO - ENDDO - ENDDO -C Upward sweep, extra treatment of k=Nr for z-coordinates -C because level Nr+1 is not available - DO j=jMin,jMax - DO i=iMin,iMax - GGL90mixingLength(i,j,Nr) = MIN(GGL90mixingLength(i,j,Nr), - & GGL90mixingLengthMin+drF(Nr)*recip_coordFac) - ENDDO - ENDDO - DO k=Nr-1, 2,-1 -#ifdef ALLOW_AUTODIFF_TAMC - kkey = k + (tkey-1)*Nr -CADJ STORE GGL90mixingLength(:,:,k+1) -CADJ & = comlev1_bibj_k, key = kkey, kind=isbyte -#endif /* ALLOW_AUTODIFF_TAMC */ - DO j=jMin,jMax - DO i=iMin,iMax - GGL90mixingLength(i,j,k) = MIN(GGL90mixingLength(i,j,k), - & GGL90mixingLength(i,j,k+1)+drF(k)*recip_coordFac) - ENDDO - ENDDO - ENDDO - ENDIF - - ELSEIF ( mxlMaxFlag .EQ. 3 ) THEN - - IF ( usingPcoords ) THEN -#ifdef ALLOW_AUTODIFF_TAMC -CADJ STORE GGL90mixingLength(:,:,Nr) -CADJ & = comlev1_bibj, key = tkey, kind=isbyte -#endif /* ALLOW_AUTODIFF_TAMC */ -C Downward sweep, extra treatment of k=Nr for p-coordinates -C because level Nr+1 is not available - DO j=jMin,jMax - DO i=iMin,iMax - mxLength_Dn(i,j,Nr) = MIN(GGL90mixingLength(i,j,Nr), - & GGL90mixingLengthMin+drF(Nr)*recip_coordFac) - ENDDO - ENDDO - DO k=Nr-1,2,-1 -#ifdef ALLOW_AUTODIFF_TAMC - kkey = k + (tkey-1)*Nr -CADJ STORE mxLength_Dn(:,:,k+1) -CADJ & = comlev1_bibj_k, key = kkey, kind=isbyte -#endif /* ALLOW_AUTODIFF_TAMC */ - DO j=jMin,jMax - DO i=iMin,iMax - mxLength_Dn(i,j,k) = MIN(GGL90mixingLength(i,j,k), - & mxLength_Dn(i,j,k+1)+drF(k)*recip_coordFac) - ENDDO - ENDDO - ENDDO -C Upward sweep - DO k=2,Nr -#ifdef ALLOW_AUTODIFF_TAMC - kkey = k + (tkey-1)*Nr -CADJ STORE GGL90mixingLength(:,:,k-1) -CADJ & = comlev1_bibj_k, key = kkey, kind=isbyte -#endif /* ALLOW_AUTODIFF_TAMC */ - DO j=jMin,jMax - DO i=iMin,iMax - GGL90mixingLength(i,j,k) = MIN(GGL90mixingLength(i,j,k), - & GGL90mixingLength(i,j,k-1)+drF(k-1)*recip_coordFac) - ENDDO - ENDDO - ENDDO - ELSE -#ifdef ALLOW_AUTODIFF_TAMC -CADJ STORE GGL90mixingLength(:,:,Nr) -CADJ & = comlev1_bibj, key = tkey, kind=isbyte -#endif /* ALLOW_AUTODIFF_TAMC */ -C Downward sweep - DO k=2,Nr -#ifdef ALLOW_AUTODIFF_TAMC - kkey = k + (tkey-1)*Nr -CADJ STORE mxLength_Dn(:,:,k-1) -CADJ & = comlev1_bibj_k, key = kkey, kind=isbyte -#endif /* ALLOW_AUTODIFF_TAMC */ - DO j=jMin,jMax - DO i=iMin,iMax - mxLength_Dn(i,j,k) = MIN(GGL90mixingLength(i,j,k), - & mxLength_Dn(i,j,k-1)+drF(k-1)*recip_coordFac) - ENDDO - ENDDO - ENDDO -C Upward sweep, extra treatment of k=Nr for z-coordinates -C because level Nr+1 is not available - DO j=jMin,jMax - DO i=iMin,iMax - GGL90mixingLength(i,j,Nr) = MIN(GGL90mixingLength(i,j,Nr), - & GGL90mixingLengthMin+drF(Nr)*recip_coordFac) - ENDDO - ENDDO - DO k=Nr-1,2,-1 -#ifdef ALLOW_AUTODIFF_TAMC - kkey = k + (tkey-1)*Nr -CADJ STORE GGL90mixingLength(:,:,k-1) -CADJ & = comlev1_bibj_k, key = kkey, kind=isbyte -#endif /* ALLOW_AUTODIFF_TAMC */ - DO j=jMin,jMax - DO i=iMin,iMax - GGL90mixingLength(i,j,k) = MIN(GGL90mixingLength(i,j,k), - & GGL90mixingLength(i,j,k+1)+drF(k)*recip_coordFac) - ENDDO - ENDDO - ENDDO - ENDIF - - ELSE - STOP 'GGL90_CALC: Wrong mxlMaxFlag (mixing length limit)' - ENDIF -C-- Impose minimum mixing length to avoid division by zero -C and compute inverse - IF ( mxlMaxFlag.EQ.3 ) THEN -#ifdef ALLOW_AUTODIFF_TAMC -CADJ STORE GGL90mixingLength = comlev1_bibj, key = tkey, kind=isbyte -#endif /* ALLOW_AUTODIFF_TAMC */ - DO k=2,Nr - DO j=jMin,jMax - DO i=iMin,iMax - GGL90mixingLength(i,j,k) = MIN(GGL90mixingLength(i,j,k), - & mxLength_Dn(i,j,k)) -#ifdef ALLOW_AUTODIFF - ENDDO - ENDDO - ENDDO - DO k=2,Nr - DO j=jMin,jMax - DO i=iMin,iMax + CALL GGL90_MIXINGLENGTH( + U GGL90mixingLength, +#ifdef ALLOW_GGL90_LANGMUIR + O LCmixingLength, #endif - tmpmlx = SQRT( GGL90mixingLength(i,j,k)*mxLength_Dn(i,j,k) ) - tmpmlx = MAX( tmpmlx, GGL90mixingLengthMin) - rMixingLength(i,j,k) = 1. _d 0 / tmpmlx - ENDDO - ENDDO - ENDDO - ELSE + O rMixingLength, + I iMin ,iMax ,jMin ,jMax, + I bi, bj, myTime, myIter, myThid ) #ifdef ALLOW_AUTODIFF_TAMC CADJ STORE GGL90mixingLength = comlev1_bibj, key=tkey, kind=isbyte +CADJ STORE rMixingLength = comlev1_bibj, key=tkey, kind=isbyte +# ifdef ALLOW_GGL90_LANGMUIR +CADJ STORE LCmixingLength = comlev1_bibj, key=tkey, kind=isbyte +# endif #endif - DO k=2,Nr - DO j=jMin,jMax - DO i=iMin,iMax - GGL90mixingLength(i,j,k) = MAX(GGL90mixingLength(i,j,k), - & GGL90mixingLengthMin) -#ifdef ALLOW_AUTODIFF - ENDDO - ENDDO - ENDDO - DO k=2,Nr - DO j=jMin,jMax - DO i=iMin,iMax -#endif - rMixingLength(i,j,k) = 1. _d 0 / GGL90mixingLength(i,j,k) - ENDDO - ENDDO - ENDDO - ENDIF - -#ifdef ALLOW_GGL90_LANGMUIR - IF (useLANGMUIR) THEN -C Compute the mixing length scale with Langmuir circulation. -C The calculation closely follows that for GGL90mixingLength. - IF ( mxlMaxFlag .EQ. 1 ) THEN - DO k=2,Nr - DO j=jMin,jMax - DO i=iMin,iMax - MLtmp = (Ro_surf(i,j,bi,bj)-rF(k))*recip_coordFac - IF (GGL90mixingLength(i,j,k) .EQ. MLtmp) THEN - LCmixingLength(i,j,k) = LC_Gamma - & * GGL90mixingLength(i,j,k) - ELSE - LCmixingLength(i,j,k) = GGL90mixingLength(i,j,k) - ENDIF - ENDDO - ENDDO - ENDDO - - ELSEIF ( mxlMaxFlag .EQ. 2 ) THEN - - IF ( usingPcoords ) THEN -#ifdef ALLOW_AUTODIFF_TAMC -CADJ STORE GGL90mixingLength(:,:,Nr) -CADJ & = comlev1_bibj, key = tkey, kind=isbyte -#endif /* ALLOW_AUTODIFF_TAMC */ -C Upward sweep - DO k=2,Nr -#ifdef ALLOW_AUTODIFF_TAMC - kkey = k + (tkey-1)*Nr -CADJ STORE GGL90mixingLength(:,:,k-1) -CADJ & = comlev1_bibj_k, key = kkey, kind=isbyte -#endif /* ALLOW_AUTODIFF_TAMC */ - DO j=jMin,jMax - DO i=iMin,iMax - MLtmp = GGL90mixingLength(i,j,k-1)+drF(k-1)*recip_coordFac - IF (GGL90mixingLength(i,j,k) .EQ. MLtmp) THEN - LCmixingLength(i,j,k) = LC_Gamma - & * GGL90mixingLength(i,j,k) - ELSE - LCmixingLength(i,j,k) = GGL90mixingLength(i,j,k) - ENDIF - ENDDO - ENDDO - ENDDO - ELSE -#ifdef ALLOW_AUTODIFF_TAMC -CADJ STORE GGL90mixingLength(:,:,Nr) -CADJ & = comlev1_bibj, key = tkey, kind=isbyte -#endif /* ALLOW_AUTODIFF_TAMC */ -C Downward sweep - DO k=2,Nr -#ifdef ALLOW_AUTODIFF_TAMC - kkey = k + (tkey-1)*Nr -CADJ STORE GGL90mixingLength(:,:,k-1) -CADJ & = comlev1_bibj_k, key = kkey, kind=isbyte -#endif /* ALLOW_AUTODIFF_TAMC */ - DO j=jMin,jMax - DO i=iMin,iMax - MLtmp = GGL90mixingLength(i,j,k-1)+drF(k-1)*recip_coordFac - IF (GGL90mixingLength(i,j,k) .EQ. MLtmp) THEN - LCmixingLength(i,j,k) = LC_Gamma - & * GGL90mixingLength(i,j,k) - ELSE - LCmixingLength(i,j,k) = GGL90mixingLength(i,j,k) - ENDIF - ENDDO - ENDDO - ENDDO - DO k=Nr-1, 2,-1 -#ifdef ALLOW_AUTODIFF_TAMC - kkey = k + (tkey-1)*Nr -CADJ STORE GGL90mixingLength(:,:,k+1) -CADJ & = comlev1_bibj_k, key = kkey, kind=isbyte -#endif /* ALLOW_AUTODIFF_TAMC */ - DO j=jMin,jMax - DO i=iMin,iMax - LCmixingLength(i,j,k) = MIN(GGL90mixingLength(i,j,k), - & GGL90mixingLength(i,j,k+1)+drF(k)*recip_coordFac) - ENDDO - ENDDO - ENDDO - - ENDIF - - ELSEIF ( mxlMaxFlag .EQ. 3 ) THEN - - IF ( usingPcoords ) THEN -#ifdef ALLOW_AUTODIFF_TAMC -CADJ STORE GGL90mixingLength(:,:,Nr) -CADJ & = comlev1_bibj, key = tkey, kind=isbyte -#endif /* ALLOW_AUTODIFF_TAMC */ -C Upward sweep - DO k=2,Nr -#ifdef ALLOW_AUTODIFF_TAMC - kkey = k + (tkey-1)*Nr -CADJ STORE GGL90mixingLength(:,:,k-1) -CADJ & = comlev1_bibj_k, key = kkey, kind=isbyte -#endif /* ALLOW_AUTODIFF_TAMC */ - DO j=jMin,jMax - DO i=iMin,iMax - MLtmp = GGL90mixingLength(i,j,k-1)+drF(k-1)*recip_coordFac - IF (GGL90mixingLength(i,j,k) .EQ. MLtmp) THEN - LCmixingLength(i,j,k) = LC_Gamma - & * GGL90mixingLength(i,j,k) - ELSE - LCmixingLength(i,j,k) = GGL90mixingLength(i,j,k) - ENDIF - ENDDO - ENDDO - ENDDO - ELSE -#ifdef ALLOW_AUTODIFF_TAMC -CADJ STORE GGL90mixingLength(:,:,Nr) -CADJ & = comlev1_bibj, key = tkey, kind=isbyte -#endif /* ALLOW_AUTODIFF_TAMC */ -C Downward sweep - DO k=2,Nr -#ifdef ALLOW_AUTODIFF_TAMC - kkey = k + (tkey-1)*Nr -CADJ STORE mxLength_Dn(:,:,k-1) -CADJ & = comlev1_bibj_k, key = kkey, kind=isbyte -#endif /* ALLOW_AUTODIFF_TAMC */ - DO j=jMin,jMax - DO i=iMin,iMax - MLtmp = mxLength_Dn(i,j,k-1)+drF(k-1)*recip_coordFac - IF (GGL90mixingLength(i,j,k) .EQ. MLtmp) THEN - LCmixingLength(i,j,k) = LC_Gamma - & * GGL90mixingLength(i,j,k) - ELSE - LCmixingLength(i,j,k) = GGL90mixingLength(i,j,k) - ENDIF - ENDDO - ENDDO - ENDDO - ENDIF - - ELSE - WRITE(msgBuf,'(A,I5,A)') - & 'GGL90_CALC: Langmuir Circ. Parameterization with mxlMaxFlag=', - & mxlMaxFlag,' not implemented' - CALL PRINT_ERROR( msgBuf, myThid ) - STOP 'ABNORMAL END: S/R GGL90_CALC' - ENDIF - ENDIF -#endif /* ALLOW_GGL90_LANGMUIR */ - -C start "proper" k-loop (the code above was moved out and up to -C implemement various mixing parameters efficiently) +C start "proper" k-loop DO k=2,Nr km1 = k-1 - +#ifdef ALLOW_AUTODIFF_TAMC + kkey = k + (tkey-1)*Nr +#endif #ifdef ALLOW_GGL90_HORIZDIFF IF ( GGL90diffTKEh .GT. 0. _d 0 ) THEN C horizontal diffusion of TKE (requires an exchange in @@ -902,6 +493,10 @@ SUBROUTINE GGL90_CALC( ENDDO ENDDO ENDIF +#ifdef ALLOW_AUTODIFF_TAMC +CADJ STORE kappaM = comlev1_bibj_k, key = kkey, kind=isbyte +CADJ STORE verticalShear = comlev1_bibj_k, key = kkey, kind=isbyte +#endif /* ALLOW_AUTODIFF_TAMC */ #ifdef ALLOW_GGL90_LANGMUIR IF (useLANGMUIR) THEN @@ -988,6 +583,9 @@ SUBROUTINE GGL90_CALC( #ifdef ALLOW_GGL90_IDEMIX ENDIF #endif /* ALLOW_GGL90_IDEMIX */ +#ifdef ALLOW_AUTODIFF_TAMC +CADJ STORE TKEPrandtlNumber(:,:,k)=comlev1_bibj_k,key=kkey,kind=isbyte +#endif /* ALLOW_AUTODIFF_TAMC */ DO j=jMin,jMax DO i=iMin,iMax @@ -1168,15 +766,15 @@ SUBROUTINE GGL90_CALC( tempUp = surfaceForcingU(i+1,j,bi,bj) tempV = surfaceForcingV(i, j ,bi,bj) tempVp = surfaceForcingV(i,j+1,bi,bj) - uStarSquare(i,j) = SQRT( + uStarSquare(i,j) = & ( tempU*tempU + tempUp*tempUp & + tempV*tempV + tempVp*tempVp - & )*halfRL )*recip_coordFac + & )*halfRL C Note: adding parenthesis in 4 terms sum (-> 2 group of 2) as below: -c uStarSquare(i,j) = SQRT( +c uStarSquare(i,j) = c & ( ( tempU*tempU + tempUp*tempUp ) c & + ( tempV*tempV + tempVp*tempVp ) -c & )*halfRL )*recip_coordFac +c & )*halfRL C seems to break restart ! ENDDO ENDDO @@ -1184,12 +782,11 @@ SUBROUTINE GGL90_CALC( DO j=jMin,jMax DO i=iMin,iMax C estimate friction velocity uStar from surface forcing - uStarSquare(i,j) = SQRT( + uStarSquare(i,j) = & ( .5 _d 0*( surfaceForcingU(i, j, bi,bj) & + surfaceForcingU(i+1,j, bi,bj) ) )**2 & + ( .5 _d 0*( surfaceForcingV(i, j, bi,bj) & + surfaceForcingV(i, j+1,bi,bj) ) )**2 - & )*recip_coordFac ENDDO ENDDO ENDIF @@ -1249,15 +846,35 @@ SUBROUTINE GGL90_CALC( DO j=jMin,jMax DO i=jMin,jMax IF ( kTopC(i,j,bi,bj) .GT. 0 ) THEN - uStarSquare(i,j) = SQRT( + uStarSquare(i,j) = & ( stressU(i,j)*stressU(i,j)+stressU(i+1,j)*stressU(i+1,j) & + stressV(i,j)*stressV(i,j)+stressV(i,j+1)*stressV(i,j+1) - & )*halfRL )*recip_coordFac + & )*halfRL ENDIF ENDDO ENDDO ENDIF #endif +#ifdef ALLOW_AUTODIFF_TAMC +CADJ STORE uStarSquare = comlev1_bibj, key = tkey, kind = isbyte +#endif + DO j=jMin,jMax + DO i=iMin,iMax +#ifdef ALLOW_AUTODIFF + IF ( uStarSquare(i,j) .GT. zeroRL ) + & uStarSquare(i,j) = SQRT(uStarSquare(i,j))*recip_coordFac +#else + uStarSquare(i,j) = SQRT(uStarSquare(i,j))*recip_coordFac +#endif + ENDDO + ENDDO +#ifdef ALLOW_AUTODIFF_TAMC +C avoid recomputing the above multiple times in AD routine +CADJ STORE TKEPrandtlNumber = comlev1_bibj, key = tkey, kind = isbyte +CADJ STORE GGL90visctmp = comlev1_bibj, key = tkey, kind = isbyte +CADJ STORE kappaE = comlev1_bibj, key = tkey, kind = isbyte +CADJ STORE a3d, b3d, c3d = comlev1_bibj, key = tkey, kind = isbyte +#endif C Dirichlet surface boundary condition for TKE IF ( usingPCoords ) THEN diff --git a/pkg/ggl90/ggl90_check.F b/pkg/ggl90/ggl90_check.F index fa71053a9b..c9fcc8ee2a 100644 --- a/pkg/ggl90/ggl90_check.F +++ b/pkg/ggl90/ggl90_check.F @@ -13,6 +13,9 @@ SUBROUTINE GGL90_CHECK( myThid ) #include "EEPARAMS.h" #include "PARAMS.h" #include "GGL90.h" +#ifdef ALLOW_AUTODIFF +# include "AUTODIFF_PARAMS.h" +#endif C === Routine arguments === C myThid :: Number of this instance of GGL90_CHECK @@ -126,6 +129,28 @@ SUBROUTINE GGL90_CHECK( myThid ) errCount = errCount + 1 ENDIF +#ifdef ALLOW_AUTODIFF +C Not everything works stably with AD code + IF ( useGGL90inAdMode .AND. adMxlMaxFlag .GT. 1 ) THEN + WRITE(msgBuf,'(2A,L1,A,I2,A)') '** WARNING ** GGL90_CHECK: ', + & 'useGGL90inAdMode = ', useGGL90inAdMode, + & ' with adMxlMaxFlag =', adMxlMaxFlag, ' (> 1)' + CALL PRINT_MESSAGE( msgBuf, errorMessageUnit, + & SQUEEZE_RIGHT, myThid ) + WRITE(msgBuf,'(2A)') '** WARNING ** GGL90_CHECK: ', + & 'tends to be unstable, use (ad)mxlMaxFlag = 0 or 1.' + CALL PRINT_MESSAGE( msgBuf, errorMessageUnit, + & SQUEEZE_RIGHT, myThid ) + ENDIF + IF ( useGGL90inAdMode .AND. adMxlMaxFlag .NE. mxlMaxFlag ) THEN + WRITE(msgBuf,'(2A,I2,A)') '** WARNING ** GGL90_CHECK: ', + & 'In AD-mode only, using adMxlMaxFlag =', adMxlMaxFlag, + & ' (instead of mxlMaxFlag).' + CALL PRINT_MESSAGE( msgBuf, errorMessageUnit, + & SQUEEZE_RIGHT, myThid ) + ENDIF +#endif + C- Stop cleanly when error was detected IF ( errCount.GE.1 ) THEN WRITE(msgBuf,'(A,I3,A)') diff --git a/pkg/ggl90/ggl90_mixinglength.F b/pkg/ggl90/ggl90_mixinglength.F new file mode 100644 index 0000000000..f7a26fe0d4 --- /dev/null +++ b/pkg/ggl90/ggl90_mixinglength.F @@ -0,0 +1,501 @@ +#include "GGL90_OPTIONS.h" +#ifdef ALLOW_AUTODIFF +# include "AUTODIFF_OPTIONS.h" +#endif + +CBOP +C !ROUTINE: GGL90_MIXINGLENGTH + +C !INTERFACE: ====================================================== + SUBROUTINE GGL90_MIXINGLENGTH( + U GGL90mixingLength, +#ifdef ALLOW_GGL90_LANGMUIR + O LCmixingLength, +#endif + O rMixingLength, + I iMin ,iMax ,jMin ,jMax, + I bi, bj, myTime, myIter, myThid ) + +C !DESCRIPTION: \bv +C *==========================================================* +C | SUBROUTINE GGL90_MIXINGLENGTH | +C | o Compute GGL90mixingLength (and LCmixingLength) | +C *==========================================================* +C | Equation numbers refer to | +C | Gaspar et al. (1990), JGR 95 (C9), pp 16,179 | +C | Some parts of the implementation follow Blanke and | +C | Delecuse (1993), JPO, and OPA code, in particular the | +C | computation of the | +C | mixing length = max(min(lk,depth),lkmin) | +C | Note: Only call this S/R if Nr > 1 (no use if Nr=1) | +C *==========================================================* + +C \ev + +C !USES: ============================================================ + IMPLICIT NONE +#include "SIZE.h" +#include "EEPARAMS.h" +#include "PARAMS.h" +#include "GRID.h" +#include "GGL90.h" +#ifdef ALLOW_SHELFICE +# include "SHELFICE.h" +#endif +#ifdef ALLOW_AUTODIFF +# include "AUTODIFF_PARAMS.h" +#endif +#ifdef ALLOW_AUTODIFF_TAMC +# include "tamc.h" +#endif + +C !INPUT PARAMETERS: =================================================== +C Routine arguments +C iMin,iMax,jMin,jMax :: index boundaries of computation domain +C bi, bj :: Current tile indices +C GGL90mixingLength :: mixing length (m) +C myTime :: Current time in simulation +C myIter :: Current time-step number +C myThid :: My Thread Id number + INTEGER iMin ,iMax ,jMin ,jMax + INTEGER bi, bj + _RL GGL90mixingLength(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) +#ifdef ALLOW_GGL90_LANGMUIR + _RL LCmixingLength (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) +#endif + _RL rMixingLength (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) + _RL myTime + INTEGER myIter + INTEGER myThid + +#ifdef ALLOW_GGL90 +C !LOCAL VARIABLES: ==================================================== +C i, j, k :: array computation indices +C kSrf :: vertical index of surface level +C kTop :: index of top interface (just below surf. level) +C +C In general, all 3D variables are defined at W-points (i.e., +C between k and k-1), all 2D variables are also defined at W-points +C or at the very surface level (like uStarSquare) +C +C GGL90mixingLength:: mixing length of scheme following Banke+Delecuse +C rMixingLength:: inverse of mixing length + INTEGER i, j, k + INTEGER kSrf, kTop + _RL MaxLength + _RL mxLength_Dn(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) + CHARACTER*(MAX_LEN_MBUF) msgBuf + _RL MLtmp +C This mixed layer model is not invariant under coordinate +C transformation to pressure coordinates, so we need these +C factors to scale the vertical (pressure) coordinates + _RL coordFac, recip_coordFac + INTEGER locMxlMaxFlag +#ifdef ALLOW_AUTODIFF_TAMC +C tkey :: tape key (depends on tiles) +C kkey :: tape key (depends on levels and tiles) + INTEGER tkey, kkey +#endif +CEOP + + IF ( usingPCoords ) THEN + kSrf = Nr + kTop = Nr + ELSE + kSrf = 1 + kTop = 2 + ENDIF + + coordFac = 1. _d 0 + IF ( usingPCoords) coordFac = gravity * rhoConst + recip_coordFac = 1./coordFac + + locMxlMaxFlag = mxlMaxFlag +#ifdef ALLOW_AUTODIFF + IF ( inAdMode ) locMxlMaxFlag = adMxlMaxFlag +#endif +#ifdef ALLOW_AUTODIFF_TAMC + tkey = bi + (bj-1)*nSx + (ikey_dynamics-1)*nSx*nSy +#endif /* ALLOW_AUTODIFF_TAMC */ + +C Initialize local fields + DO k=1,Nr + DO j=1-OLy,sNy+OLy + DO i=1-OLx,sNx+OLx + rMixingLength(i,j,k) = 0. _d 0 + mxLength_Dn (i,j,k) = 0. _d 0 + ENDDO + ENDDO + ENDDO + DO j=1-OLy,sNy+OLy + DO i=1-OLx,sNx+OLx +c rMixingLength(i,j,1) = 0. _d 0 + mxLength_Dn(i,j,1) = GGL90mixingLengthMin + ENDDO + ENDDO + +#ifdef ALLOW_GGL90_LANGMUIR + IF (useLANGMUIR) THEN + DO k=1,Nr + DO j=1-OLy,sNy+OLy + DO i=1-OLx,sNx+OLx + LCmixingLength(i,j,k) = GGL90mixingLengthMin + ENDDO + ENDDO + ENDDO + ENDIF +#endif + +C- ensure mixing between first and second level + IF (mxlSurfFlag) THEN + DO j=jMin,jMax + DO i=iMin,iMax +#ifdef ALLOW_SHELFICE + IF ( useShelfIce ) THEN + kSrf = MAX(1,kTopC(i,j,bi,bj)) + kTop = MIN(kSrf+1,Nr) + ENDIF +#endif + GGL90mixingLength(i,j,kTop)=drF(kSrf)*recip_coordFac + ENDDO + ENDDO + ENDIF + +C-- Impose upper and lower bound for mixing length +#ifdef ALLOW_AUTODIFF +CADJ STORE GGL90mixingLength = comlev1_bibj, key=tkey, kind=isbyte +#endif + IF ( locMxlMaxFlag .EQ. 0 ) THEN + + DO k=2,Nr + DO j=jMin,jMax + DO i=iMin,iMax +C Use thickness of water column (inverse of recip_Rcol) as the +C maximum length. + MaxLength = + & ( Ro_surf(i,j,bi,bj) - R_low(i,j,bi,bj) )*recip_coordFac + GGL90mixingLength(i,j,k) = MIN(GGL90mixingLength(i,j,k), + & MaxLength) + ENDDO + ENDDO + ENDDO + + ELSEIF ( locMxlMaxFlag .EQ. 1 ) THEN + + DO k=2,Nr + DO j=jMin,jMax + DO i=iMin,iMax + MaxLength=MIN(Ro_surf(i,j,bi,bj)-rF(k),rF(k)-R_low(i,j,bi,bj)) + & * recip_coordFac +c MaxLength=MAX(MaxLength,20. _d 0) + GGL90mixingLength(i,j,k) = MIN(GGL90mixingLength(i,j,k), + & MaxLength) + ENDDO + ENDDO + ENDDO + + ELSEIF ( locMxlMaxFlag .EQ. 2 .OR. locMxlMaxFlag .EQ. 3 ) THEN + + IF ( usingPcoords ) THEN +#ifdef ALLOW_AUTODIFF_TAMC +CADJ STORE GGL90mixingLength = comlev1_bibj, key = tkey, kind=isbyte +#endif /* ALLOW_AUTODIFF_TAMC */ +C Downward sweep, extra treatment of k=Nr for p-coordinates +C because level Nr+1 is not available + DO j=jMin,jMax + DO i=iMin,iMax + mxLength_Dn(i,j,Nr) = MIN(GGL90mixingLength(i,j,Nr), + & GGL90mixingLengthMin+drF(Nr)*recip_coordFac) + ENDDO + ENDDO + DO k=Nr-1,2,-1 +#ifdef ALLOW_AUTODIFF_TAMC + kkey = k + (tkey-1)*Nr +CADJ STORE mxLength_Dn(:,:,k+1) +CADJ & = comlev1_bibj_k, key = kkey, kind=isbyte +#endif /* ALLOW_AUTODIFF_TAMC */ + DO j=jMin,jMax + DO i=iMin,iMax + mxLength_Dn(i,j,k) = MIN(GGL90mixingLength(i,j,k), + & mxLength_Dn(i,j,k+1)+drF(k)*recip_coordFac) + ENDDO + ENDDO + ENDDO +C Upward sweep + DO k=2,Nr +#ifdef ALLOW_AUTODIFF_TAMC + kkey = k + (tkey-1)*Nr +C It is important that the two k-levels of these fields are stored +C in one statement because otherwise taf will only store one, which +C is wrong (i.e. was wrong in previous versions). +CADJ STORE GGL90mixingLength(:,:,k-1), GGL90mixingLength(:,:,k) +CADJ & = comlev1_bibj_k, key = kkey, kind=isbyte +#endif /* ALLOW_AUTODIFF_TAMC */ + DO j=jMin,jMax + DO i=iMin,iMax + GGL90mixingLength(i,j,k) = MIN(GGL90mixingLength(i,j,k), + & GGL90mixingLength(i,j,k-1)+drF(k-1)*recip_coordFac) + ENDDO + ENDDO + ENDDO + ELSE +#ifdef ALLOW_AUTODIFF_TAMC +CADJ STORE GGL90mixingLength = comlev1_bibj, key = tkey, kind=isbyte +#endif /* ALLOW_AUTODIFF_TAMC */ +C Downward sweep + DO k=2,Nr +#ifdef ALLOW_AUTODIFF_TAMC + kkey = k + (tkey-1)*Nr +CADJ STORE mxLength_Dn(:,:,k-1) +CADJ & = comlev1_bibj_k, key = kkey, kind=isbyte +#endif /* ALLOW_AUTODIFF_TAMC */ + DO j=jMin,jMax + DO i=iMin,iMax + mxLength_Dn(i,j,k) = MIN(GGL90mixingLength(i,j,k), + & mxLength_Dn(i,j,k-1)+drF(k-1)*recip_coordFac) + ENDDO + ENDDO + ENDDO +C Upward sweep, extra treatment of k=Nr for z-coordinates +C because level Nr+1 is not available + DO j=jMin,jMax + DO i=iMin,iMax + GGL90mixingLength(i,j,Nr) = MIN(GGL90mixingLength(i,j,Nr), + & GGL90mixingLengthMin+drF(Nr)*recip_coordFac) + ENDDO + ENDDO + DO k=Nr-1,2,-1 +#ifdef ALLOW_AUTODIFF_TAMC + kkey = k + (tkey-1)*Nr +C It is important that the two k-levels of these fields are stored +C in one statement because otherwise taf will only store one, which +C is wrong (i.e. was wrong in previous versions). +CADJ STORE GGL90mixingLength(:,:,k+1), GGL90mixingLength(:,:,k) +CADJ & = comlev1_bibj_k, key = kkey, kind=isbyte +#endif /* ALLOW_AUTODIFF_TAMC */ + DO j=jMin,jMax + DO i=iMin,iMax + GGL90mixingLength(i,j,k) = MIN(GGL90mixingLength(i,j,k), + & GGL90mixingLength(i,j,k+1)+drF(k)*recip_coordFac) + ENDDO + ENDDO + ENDDO + ENDIF +#ifdef ALLOW_AUTODIFF_TAMC +CADJ STORE mxLength_Dn = comlev1_bibj, key = tkey, kind=isbyte +CADJ STORE GGL90mixingLength = comlev1_bibj, key = tkey, kind=isbyte +#endif +C Impose minimum from downward sweep + DO k=2,Nr + DO j=jMin,jMax + DO i=iMin,iMax + GGL90mixingLength(i,j,k) = MIN(GGL90mixingLength(i,j,k), + & mxLength_Dn(i,j,k)) + ENDDO + ENDDO + ENDDO + + ELSE + WRITE(msgBuf,'(A,I5,A)') + & 'GGL90_MIXINGLENGTH: mxlMaxFlag=', + & locMxlMaxFlag,' not implemented' + CALL PRINT_ERROR( msgBuf, myThid ) + STOP 'ABNORMAL END: S/R GGL90_MIXINGLENGTH' + ENDIF + +#ifdef ALLOW_AUTODIFF_TAMC +CADJ STORE GGL90mixingLength = comlev1_bibj, key = tkey, kind=isbyte +#endif +C-- Impose minimum mixing length to avoid division by zero +C and compute inverse + IF ( locMxlMaxFlag.EQ.3 ) THEN +#ifdef ALLOW_AUTODIFF_TAMC +CADJ STORE mxLength_Dn = comlev1_bibj, key = tkey, kind=isbyte +#endif + DO k=2,Nr + DO j=jMin,jMax + DO i=iMin,iMax +#ifdef GGL90_REGULARIZE_MIXINGLENGTH + MLtmp = SQRT( GGL90mixingLength(i,j,k)*mxLength_Dn(i,j,k) + & + GGL90mixingLengthMin**2 ) +#else + MLtmp = SQRT( GGL90mixingLength(i,j,k)*mxLength_Dn(i,j,k) ) + MLtmp = MAX( MLtmp, GGL90mixingLengthMin ) +#endif + rMixingLength(i,j,k) = 1. _d 0 / MLtmp + ENDDO + ENDDO + ENDDO + ELSE + DO k=2,Nr + DO j=jMin,jMax + DO i=iMin,iMax +#ifdef GGL90_REGULARIZE_MIXINGLENGTH + MLtmp = SQRT( GGL90mixingLength(i,j,k)**2 + & + GGL90mixingLengthMin**2 ) +#else + MLtmp = MAX(GGL90mixingLength(i,j,k),GGL90mixingLengthMin) +#endif + GGL90mixingLength(i,j,k) = MLtmp + rMixingLength(i,j,k) = 1. _d 0 / MLtmp + ENDDO + ENDDO + ENDDO + ENDIF + +#ifdef ALLOW_GGL90_LANGMUIR + IF (useLANGMUIR) THEN +# ifdef ALLOW_AUTODIFF_TAMC +CADJ STORE GGL90mixingLength = comlev1_bibj, key = tkey, kind=isbyte +# endif +C Compute the mixing length scale with Langmuir circulation. +C The calculation closely follows that for GGL90mixingLength. + IF ( locMxlMaxFlag .EQ. 1 ) THEN + + DO k=2,Nr + DO j=jMin,jMax + DO i=iMin,iMax + MLtmp = (Ro_surf(i,j,bi,bj)-rF(k))*recip_coordFac + IF (GGL90mixingLength(i,j,k) .EQ. MLtmp) THEN + LCmixingLength(i,j,k) = LC_Gamma + & * GGL90mixingLength(i,j,k) + ELSE + LCmixingLength(i,j,k) = GGL90mixingLength(i,j,k) + ENDIF + ENDDO + ENDDO + ENDDO + + ELSEIF ( locMxlMaxFlag .EQ. 2 ) THEN + + IF ( usingPcoords ) THEN +#ifdef ALLOW_AUTODIFF_TAMC +CADJ STORE GGL90mixingLength(:,:,Nr) +CADJ & = comlev1_bibj, key = tkey, kind=isbyte +#endif /* ALLOW_AUTODIFF_TAMC */ +C Upward sweep + DO k=2,Nr +#ifdef ALLOW_AUTODIFF_TAMC + kkey = k + (tkey-1)*Nr +CADJ STORE GGL90mixingLength(:,:,k-1) +CADJ & = comlev1_bibj_k, key = kkey, kind=isbyte +#endif /* ALLOW_AUTODIFF_TAMC */ + DO j=jMin,jMax + DO i=iMin,iMax + MLtmp = GGL90mixingLength(i,j,k-1)+drF(k-1)*recip_coordFac + IF (GGL90mixingLength(i,j,k) .EQ. MLtmp) THEN + LCmixingLength(i,j,k) = LC_Gamma + & * GGL90mixingLength(i,j,k) + ELSE + LCmixingLength(i,j,k) = GGL90mixingLength(i,j,k) + ENDIF + ENDDO + ENDDO + ENDDO + ELSE +#ifdef ALLOW_AUTODIFF_TAMC +CADJ STORE GGL90mixingLength(:,:,Nr) +CADJ & = comlev1_bibj, key = tkey, kind=isbyte +#endif /* ALLOW_AUTODIFF_TAMC */ +C Downward sweep + DO k=2,Nr +#ifdef ALLOW_AUTODIFF_TAMC + kkey = k + (tkey-1)*Nr +CADJ STORE GGL90mixingLength(:,:,k-1) +CADJ & = comlev1_bibj_k, key = kkey, kind=isbyte +#endif /* ALLOW_AUTODIFF_TAMC */ + DO j=jMin,jMax + DO i=iMin,iMax + MLtmp = GGL90mixingLength(i,j,k-1)+drF(k-1)*recip_coordFac + IF (GGL90mixingLength(i,j,k) .EQ. MLtmp) THEN + LCmixingLength(i,j,k) = LC_Gamma + & * GGL90mixingLength(i,j,k) + ELSE + LCmixingLength(i,j,k) = GGL90mixingLength(i,j,k) + ENDIF + ENDDO + ENDDO + ENDDO + DO k=Nr-1, 2,-1 +#ifdef ALLOW_AUTODIFF_TAMC + kkey = k + (tkey-1)*Nr +CADJ STORE GGL90mixingLength(:,:,k+1) +CADJ & = comlev1_bibj_k, key = kkey, kind=isbyte +#endif /* ALLOW_AUTODIFF_TAMC */ + DO j=jMin,jMax + DO i=iMin,iMax + LCmixingLength(i,j,k) = MIN(GGL90mixingLength(i,j,k), + & GGL90mixingLength(i,j,k+1)+drF(k)*recip_coordFac) + ENDDO + ENDDO + ENDDO + + ENDIF + + ELSEIF ( locMxlMaxFlag .EQ. 3 ) THEN + + IF ( usingPcoords ) THEN +#ifdef ALLOW_AUTODIFF_TAMC +CADJ STORE GGL90mixingLength(:,:,Nr) +CADJ & = comlev1_bibj, key = tkey, kind=isbyte +#endif /* ALLOW_AUTODIFF_TAMC */ +C Upward sweep + DO k=2,Nr +#ifdef ALLOW_AUTODIFF_TAMC + kkey = k + (tkey-1)*Nr +CADJ STORE GGL90mixingLength(:,:,k-1) +CADJ & = comlev1_bibj_k, key = kkey, kind=isbyte +#endif /* ALLOW_AUTODIFF_TAMC */ + DO j=jMin,jMax + DO i=iMin,iMax + MLtmp = GGL90mixingLength(i,j,k-1)+drF(k-1)*recip_coordFac + IF (GGL90mixingLength(i,j,k) .EQ. MLtmp) THEN + LCmixingLength(i,j,k) = LC_Gamma + & * GGL90mixingLength(i,j,k) + ELSE + LCmixingLength(i,j,k) = GGL90mixingLength(i,j,k) + ENDIF + ENDDO + ENDDO + ENDDO + ELSE +#ifdef ALLOW_AUTODIFF_TAMC +CADJ STORE GGL90mixingLength(:,:,Nr) +CADJ & = comlev1_bibj, key = tkey, kind=isbyte +#endif /* ALLOW_AUTODIFF_TAMC */ +C Downward sweep + DO k=2,Nr +#ifdef ALLOW_AUTODIFF_TAMC + kkey = k + (tkey-1)*Nr +CADJ STORE mxLength_Dn(:,:,k-1) +CADJ & = comlev1_bibj_k, key = kkey, kind=isbyte +#endif /* ALLOW_AUTODIFF_TAMC */ + DO j=jMin,jMax + DO i=iMin,iMax + MLtmp = mxLength_Dn(i,j,k-1)+drF(k-1)*recip_coordFac + IF (GGL90mixingLength(i,j,k) .EQ. MLtmp) THEN + LCmixingLength(i,j,k) = LC_Gamma + & * GGL90mixingLength(i,j,k) + ELSE + LCmixingLength(i,j,k) = GGL90mixingLength(i,j,k) + ENDIF + ENDDO + ENDDO + ENDDO + ENDIF + + ELSE + WRITE(msgBuf,'(2A,I5,A)') + & 'GGL90_MIXINGLENGTH: ', + & 'Langmuir Circ. Parameterization with mxlMaxFlag=', + & locMxlMaxFlag,' not implemented' + CALL PRINT_ERROR( msgBuf, myThid ) + STOP 'ABNORMAL END: S/R GGL90_MIXINGLENGTH' + ENDIF + ENDIF +#endif /* ALLOW_GGL90_LANGMUIR */ + +#endif /* ALLOW_GGL90 */ + + RETURN + END diff --git a/pkg/ggl90/ggl90_readparms.F b/pkg/ggl90/ggl90_readparms.F index cf19fc54f5..f1e2449a86 100644 --- a/pkg/ggl90/ggl90_readparms.F +++ b/pkg/ggl90/ggl90_readparms.F @@ -51,7 +51,7 @@ SUBROUTINE GGL90_READPARMS( myThid ) & GGL90mixingMaps, GGL90writeState, & GGL90ck, GGL90ceps, GGL90alpha, GGL90m2, & GGL90TKEmin, GGL90TKEsurfMin, GGL90TKEbottom, - & GGL90mixingLengthMin, mxlMaxFlag, mxlSurfFlag, + & GGL90mixingLengthMin, mxlMaxFlag, adMxlMaxFlag, mxlSurfFlag, & GGL90viscMax, GGL90diffMax, GGL90TKEFile, & GGL90_dirichlet, calcMeanVertShear, useIDEMIX, & useLANGMUIR @@ -119,6 +119,7 @@ SUBROUTINE GGL90_READPARMS( myThid ) GGL90diffTKEh = 0.0 _d 0 GGL90mixingLengthMin = 1.0 _d -08 mxlMaxFlag = 0 + adMxlMaxFlag = UNSET_I mxlSurfFlag = .FALSE. GGL90TKEFile = ' ' GGL90_dirichlet = .TRUE. @@ -250,6 +251,9 @@ SUBROUTINE GGL90_READPARMS( myThid ) IF ( GGL90TKEbottom .EQ. UNSET_RL ) THEN GGL90TKEbottom = GGL90TKEmin ENDIF + IF ( adMxlMaxFlag .EQ. UNSET_I ) THEN + adMxlMaxFlag = mxlMaxFlag + ENDIF #ifdef ALLOW_GGL90_IDEMIX IF ( GGL90TKEmin .LT. 0. ) THEN ! CE: changed le to lt !!! #else @@ -353,6 +357,10 @@ SUBROUTINE GGL90_READPARMS( myThid ) & ' /* GGL90 minimum mixing length (m) */') CALL WRITE_0D_I(mxlMaxFlag, INDEX_NONE, 'mxlMaxFlag =', & ' /* Flag for limiting mixing-length method */') +#ifdef ALLOW_AUTODIFF + CALL WRITE_0D_I(adMxlMaxFlag, INDEX_NONE, 'adMxlMaxFlag =', + & ' /* Flag for limiting mixing-length method in AD-mode */') +#endif CALL WRITE_0D_L(mxlSurfFlag,INDEX_NONE, & 'mxlSurfFlag =', & ' /* GGL90 flag for near surface mixing */') diff --git a/pkg/gmredi/gmredi_slope_limit.F b/pkg/gmredi/gmredi_slope_limit.F index 11e7e5421a..052f26faac 100644 --- a/pkg/gmredi/gmredi_slope_limit.F +++ b/pkg/gmredi/gmredi_slope_limit.F @@ -148,7 +148,9 @@ SUBROUTINE GMREDI_SLOPE_LIMIT( C so we do it here explicitly with a local tape and live without the C corresponding warning. CADJ INIT loctape_gm = COMMON, 1 -CADJ STORE dSigmaDr = loctape_gm +C Note that this directive is not necessary in any verification +C experiment, so we leave it commented out for now. +cCADJ STORE dSigmaDr = loctape_gm C C Alternatively one can use a global tape, to be defined in C the_main_loop.F. This option is still here but commented out with diff --git a/pkg/gmredi/gmredi_slope_psi.F b/pkg/gmredi/gmredi_slope_psi.F index f8f18da365..7c9b505ca5 100644 --- a/pkg/gmredi/gmredi_slope_psi.F +++ b/pkg/gmredi/gmredi_slope_psi.F @@ -386,9 +386,10 @@ SUBROUTINE GMREDI_SLOPE_PSI( slopeMaxSpec=1. _d -4 +#ifdef ALLOW_AUTODIFF_TAMC CADJ STORE slopeX(:,:) = comlev1_bibj_k, key=kkey, byte=isbyte CADJ STORE slopeY(:,:) = comlev1_bibj_k, key=kkey, byte=isbyte - +#endif DO j=1-OLy,sNy+OLy DO i=1-OLx+1,sNx+OLx Smod = ABS(SlopeX(i,j)) diff --git a/pkg/kpp/kpp_forcing_surf.F b/pkg/kpp/kpp_forcing_surf.F index 002f92b825..7cf0f5bd63 100644 --- a/pkg/kpp/kpp_forcing_surf.F +++ b/pkg/kpp/kpp_forcing_surf.F @@ -1,7 +1,4 @@ #include "KPP_OPTIONS.h" -#ifdef ALLOW_AUTODIFF -# include "AUTODIFF_OPTIONS.h" -#endif #ifdef ALLOW_SALT_PLUME #include "SALT_PLUME_OPTIONS.h" #endif @@ -198,9 +195,6 @@ SUBROUTINE KPP_FORCING_SURF( & (surfForcV(i,j,bi,bj) + surfForcV(i,jp1,bi,bj)) ENDDO ENDDO -#ifdef ALLOW_AUTODIFF_TAMC -CADJ store work3 = comlev1_kpp, key = ikey -#endif epsLocSq = phepsi*phepsi*drF(1)*drF(1) epsLoc = SQRT ( p5*phepsi*drF(1) ) DO j = jmin, jmax @@ -277,10 +271,6 @@ SUBROUTINE KPP_FORCING_SURF( ENDIF #endif /* ALLOW_SALT_PLUME */ -#ifdef ALLOW_AUTODIFF_TAMC -CADJ store ustar = comlev1_kpp, key = ikey -#endif - #ifdef ALLOW_DIAGNOSTICS IF ( useDiagnostics ) THEN CALL DIAGNOSTICS_FILL(bo ,'KPPbo ',0,1,2,bi,bj,myThid) diff --git a/pkg/kpp/kpp_routines.F b/pkg/kpp/kpp_routines.F index 8576f30125..de085cb449 100644 --- a/pkg/kpp/kpp_routines.F +++ b/pkg/kpp/kpp_routines.F @@ -648,6 +648,10 @@ subroutine bldepth ( ENDDO #ifdef ALLOW_SALT_PLUME +# ifdef ALLOW_AUTODIFF_TAMC +C suppress a TAF warning +CADJ incomplete worka +# endif IF ( useSALT_PLUME ) THEN #ifndef SALT_PLUME_VOLUME DO i = 1, imt @@ -1169,15 +1173,11 @@ subroutine z121 ( i = 0 C-- HPF directive to help TAMC CHPF$ INDEPENDENT -CADJ INIT z121tape = common, Nr #endif /* ALLOW_AUTODIFF_TAMC */ DO i = 1, imt k = 1 -#ifdef ALLOW_AUTODIFF_TAMC -CADJ STORE v(i,k) = z121tape -#endif v(i,Nrp1) = v(i,Nr) DO k = 1, Nr @@ -1193,9 +1193,6 @@ subroutine z121 ( v(i,1) = v(i,1) / zflag DO k = 2, Nr -#ifdef ALLOW_AUTODIFF_TAMC -CADJ STORE v(i,k), zwork = z121tape -#endif km1 = k - 1 kp1 = k + 1 zflag = v(i,k) diff --git a/pkg/mdsio/mdsio_ad.flow b/pkg/mdsio/mdsio_ad.flow index 4ef903ae50..4218088603 100644 --- a/pkg/mdsio/mdsio_ad.flow +++ b/pkg/mdsio/mdsio_ad.flow @@ -1,16 +1,16 @@ C---------------------------------------- C subroutine mds_read_field C---------------------------------------- -CADJ SUBROUTINE mds_read_field INPUT = 1,2,3,4,5,6,7, 10,11 -CADJ SUBROUTINE mds_read_field OUTPUT = 8,9 -CADJ SUBROUTINE mds_read_field DEPEND = 1,2,3,4,5,6,7,8,9,10,11 -CADJ SUBROUTINE mds_read_field REQUIRED +CADJ SUBROUTINE MDS_READ_FIELD INPUT = 1,2,3,4,5,6,7, 10,11 +CADJ SUBROUTINE MDS_READ_FIELD OUTPUT = 8,9 +CADJ SUBROUTINE MDS_READ_FIELD DEPEND = 1,2,3,4,5,6,7,8,9,10,11 +CADJ SUBROUTINE MDS_READ_FIELD REQUIRED C---------------------------------------- C subroutine mds_write_field C---------------------------------------- -CADJ SUBROUTINE mds_write_field INPUT = 1,2,3,4,5,6,7,8,9,10,11,12,13 -CADJ SUBROUTINE mds_write_field OUTPUT = +CADJ SUBROUTINE MDS_WRITE_FIELD INPUT = 1,2,3,4,5,6,7,8,9,10,11,12,13 +CADJ SUBROUTINE MDS_WRITE_FIELD OUTPUT = C---------------------------------------- C subroutine mds_read_rec_xz @@ -31,30 +31,30 @@ cCADJ SUBROUTINE mds_read_rec_yz REQUIRED C---------------------------------------- C subroutine mds_read_sec_xz C---------------------------------------- -CADJ SUBROUTINE mds_read_sec_xz INPUT = 1,2,3,4,5, 8,9 -CADJ SUBROUTINE mds_read_sec_xz OUTPUT = 6,7 -CADJ SUBROUTINE mds_read_sec_xz DEPEND = 1,2,3,4,5,6,7,8,9 -CADJ SUBROUTINE mds_read_sec_xz REQUIRED +CADJ SUBROUTINE MDS_READ_SEC_XZ INPUT = 1,2,3,4,5,6,7, 10,11 +CADJ SUBROUTINE MDS_READ_SEC_XZ OUTPUT = 8,9 +CADJ SUBROUTINE MDS_READ_SEC_XZ DEPEND = 1,2,3,4,5,6,7,8,9,10,11 +CADJ SUBROUTINE MDS_READ_SEC_XZ REQUIRED C---------------------------------------- C subroutine mds_read_sec_yz C---------------------------------------- -CADJ SUBROUTINE mds_read_sec_yz INPUT = 1,2,3,4,5, 8,9 -CADJ SUBROUTINE mds_read_sec_yz OUTPUT = 6,7 -CADJ SUBROUTINE mds_read_sec_yz DEPEND = 1,2,3,4,5,6,7,8,9 -CADJ SUBROUTINE mds_read_sec_yz REQUIRED +CADJ SUBROUTINE MDS_READ_SEC_YZ INPUT = 1,2,3,4,5,6,7, 10,11 +CADJ SUBROUTINE MDS_READ_SEC_YZ OUTPUT = 8,9 +CADJ SUBROUTINE MDS_READ_SEC_YZ DEPEND = 1,2,3,4,5,6,7,8,9,10,11 +CADJ SUBROUTINE MDS_READ_SEC_YZ REQUIRED C---------------------------------------- C subroutine mds_write_sec_xz C---------------------------------------- -CADJ SUBROUTINE mds_write_sec_xz INPUT = 1,2,3,4,5,6,7,8,9,10,11 -CADJ SUBROUTINE mds_write_sec_xz OUTPUT = +CADJ SUBROUTINE MDS_WRITE_SEC_XZ INPUT = 1,2,3,4,5,6,7,8,9,10,11,12,13 +CADJ SUBROUTINE MDS_WRITE_SEC_XZ OUTPUT = C---------------------------------------- C subroutine mds_write_sec_yz C---------------------------------------- -CADJ SUBROUTINE mds_write_sec_yz INPUT = 1,2,3,4,5,6,7,8,9,10,11 -CADJ SUBROUTINE mds_write_sec_yz OUTPUT = +CADJ SUBROUTINE MDS_WRITE_SEC_YZ INPUT = 1,2,3,4,5,6,7,8,9,10,11,12,13 +CADJ SUBROUTINE MDS_WRITE_SEC_YZ OUTPUT = C---------------------------------------- C subroutine mdsreadfield diff --git a/pkg/mdsio/mdsio_read_section.F b/pkg/mdsio/mdsio_read_section.F index f446f53c92..6dfa3e77ed 100644 --- a/pkg/mdsio/mdsio_read_section.F +++ b/pkg/mdsio/mdsio_read_section.F @@ -15,7 +15,7 @@ SUBROUTINE MDS_READ_SEC_XZ( I filePrec, I useCurrentDir, I arrType, - I kSize, + I kSize, kLo, kHi, O fldRL, fldRS, I irecord, I myThid ) @@ -28,7 +28,9 @@ SUBROUTINE MDS_READ_SEC_XZ( C useCurrentDir(logic):: always read from the current directory (even if C "mdsioLocalDir" is set) C arrType char(2) :: which array (fldRL/RS) to read into, either "RL" or "RS" -C kSize integer :: size of third dimension, normally either 1 or Nr +C kSize integer :: size of second dimension, normally either 1 or Nr +C kLo integer :: 1rst vertical level (of array fldRL/RS) to read-in +C kHi integer :: last vertical level (of array fldRL/RS) to read-in C fldRL RL :: array to read into if arrType="RL", fldRL(:,kSize,:,:) C fldRS RS :: array to read into if arrType="RS", fldRS(:,kSize,:,:) C irecord integer :: record number to read @@ -64,7 +66,7 @@ SUBROUTINE MDS_READ_SEC_XZ( INTEGER filePrec LOGICAL useCurrentDir CHARACTER*(2) arrType - INTEGER kSize + INTEGER kSize, kLo, kHi INTEGER irecord INTEGER myThid C !OUTPUT PARAMETERS: @@ -77,16 +79,17 @@ SUBROUTINE MDS_READ_SEC_XZ( EXTERNAL ILNBLNK, MDS_RECLEN C !LOCAL VARIABLES: - CHARACTER*(MAX_LEN_FNAM) dataFName,pfName - INTEGER iG,jG,irec,bi,bj,k,dUnit,IL,pIL + CHARACTER*(MAX_LEN_FNAM) dataFName, pfName + INTEGER IL, pIL, dUnit, nLev, irec + INTEGER iG, jG, bi, bj, k, kL LOGICAL exst Real*4 r4seg(sNx) Real*8 r8seg(sNx) - LOGICAL globalFile,fileIsOpen + LOGICAL globalFile, fileIsOpen INTEGER length_of_rec - CHARACTER*(max_len_mbuf) msgBuf + CHARACTER*(MAX_LEN_MBUF) msgBuf #ifdef ALLOW_EXCH2 - INTEGER tGx,tNx,tN + INTEGER tGx, tNx, tN #endif /* ALLOW_EXCH2 */ C ------------------------------------------------------------------ @@ -119,6 +122,9 @@ SUBROUTINE MDS_READ_SEC_XZ( ENDIF pIL=ILNBLNK( pfName ) +C Set number of levels to read: + nLev = kHi - kLo + 1 + C Assign a free unit number as the I/O channel for this routine CALL MDSFINDUNIT( dUnit, myThid ) @@ -201,23 +207,24 @@ SUBROUTINE MDS_READ_SEC_XZ( tGx = exch2_txXStackLo(tN) tNx = exch2_tNx(tN) #endif /* ALLOW_EXCH2 */ - DO k=1,kSize + DO k=1,nLev + kL = k + kLo - 1 IF (globalFile) THEN #ifdef ALLOW_EXCH2 C record length is sNx==tNx irec = 1 + ( tGx-1 - & + ( k-1 + (irecord-1)*kSize )*exch2_xStack_Nx + & + ( k-1 + (irecord-1)*nLev )*exch2_xStack_Nx & )/tNx #else /* ALLOW_EXCH2 */ iG = myXGlobalLo-1 + (bi-1)*sNx jG = (myYGlobalLo-1)/sNy + (bj-1) - irec=1 + INT(iG/sNx) + nSx*nPx*(k-1) - & + nSx*nPx*kSize*(irecord-1) + irec = 1 + INT(iG/sNx) + nSx*nPx*(k-1) + & + nSx*nPx*nLev*(irecord-1) #endif /* ALLOW_EXCH2 */ ELSE iG = 0 jG = 0 - irec=k + kSize*(irecord-1) + irec = k + nLev*(irecord-1) ENDIF IF (filePrec .EQ. precFloat32) THEN READ(dUnit,rec=irec) r4seg @@ -225,10 +232,10 @@ SUBROUTINE MDS_READ_SEC_XZ( CALL MDS_BYTESWAPR4(sNx,r4seg) #endif IF (arrType .EQ. 'RS') THEN - CALL MDS_SEG4toRS_2D( sNx,oLx,kSize,bi,bj,k,.TRUE., + CALL MDS_SEG4toRS_2D( sNx,OLx,kSize,bi,bj,kL,.TRUE., & r4seg,fldRS ) ELSEIF (arrType .EQ. 'RL') THEN - CALL MDS_SEG4toRL_2D( sNx,oLx,kSize,bi,bj,k,.TRUE., + CALL MDS_SEG4toRL_2D( sNx,OLx,kSize,bi,bj,kL,.TRUE., & r4seg,fldRL ) ELSE WRITE(msgBuf,'(A)') @@ -242,10 +249,10 @@ SUBROUTINE MDS_READ_SEC_XZ( CALL MDS_BYTESWAPR8( sNx, r8seg ) #endif IF (arrType .EQ. 'RS') THEN - CALL MDS_SEG8toRS_2D(sNx,oLx,kSize,bi,bj,k,.TRUE., + CALL MDS_SEG8toRS_2D(sNx,OLx,kSize,bi,bj,kL,.TRUE., & r8seg,fldRS ) ELSEIF (arrType .EQ. 'RL') THEN - CALL MDS_SEG8toRL_2D(sNx,oLx,kSize,bi,bj,k,.TRUE., + CALL MDS_SEG8toRL_2D(sNx,OLx,kSize,bi,bj,kL,.TRUE., & r8seg,fldRL ) ELSE WRITE(msgBuf,'(A)') @@ -292,7 +299,7 @@ SUBROUTINE MDS_READ_SEC_YZ( I filePrec, I useCurrentDir, I arrType, - I kSize, + I kSize, kLo, kHi, O fldRL, fldRS, I irecord, I myThid ) @@ -305,7 +312,9 @@ SUBROUTINE MDS_READ_SEC_YZ( C useCurrentDir(logic):: always read from the current directory (even if C "mdsioLocalDir" is set) C arrType char(2) :: which array (fldRL/RS) to read into, either "RL" or "RS" -C kSize integer :: size of third dimension, normally either 1 or Nr +C kSize integer :: size of second dimension, normally either 1 or Nr +C kLo integer :: 1rst vertical level (of array fldRL/RS) to read-in +C kHi integer :: last vertical level (of array fldRL/RS) to read-in C fldRL RL :: array to read into if arrType="RL", fldRL(:,kSize,:,:) C fldRS RS :: array to read into if arrType="RS", fldRS(:,kSize,:,:) C irecord integer :: record number to read @@ -341,7 +350,7 @@ SUBROUTINE MDS_READ_SEC_YZ( INTEGER filePrec LOGICAL useCurrentDir CHARACTER*(2) arrType - INTEGER kSize + INTEGER kSize, kLo, kHi INTEGER irecord INTEGER myThid C !OUTPUT PARAMETERS: @@ -354,16 +363,17 @@ SUBROUTINE MDS_READ_SEC_YZ( EXTERNAL ILNBLNK, MDS_RECLEN C !LOCAL VARIABLES: - CHARACTER*(MAX_LEN_FNAM) dataFName,pfName - INTEGER iG,jG,irec,bi,bj,k,dUnit,IL,pIL + CHARACTER*(MAX_LEN_FNAM) dataFName, pfName + INTEGER IL, pIL, dUnit, nLev, irec + INTEGER iG, jG, bi, bj, k, kL LOGICAL exst Real*4 r4seg(sNy) Real*8 r8seg(sNy) - LOGICAL globalFile,fileIsOpen + LOGICAL globalFile, fileIsOpen INTEGER length_of_rec - CHARACTER*(max_len_mbuf) msgBuf + CHARACTER*(MAX_LEN_MBUF) msgBuf #ifdef ALLOW_EXCH2 - INTEGER tGy,tNy,tN + INTEGER tGy, tNy, tN #endif /* ALLOW_EXCH2 */ C ------------------------------------------------------------------ @@ -397,6 +407,9 @@ SUBROUTINE MDS_READ_SEC_YZ( ENDIF pIL=ILNBLNK( pfName ) +C Set number of levels to read: + nLev = kHi - kLo + 1 + C Assign a free unit number as the I/O channel for this routine CALL MDSFINDUNIT( dUnit, myThid ) @@ -479,23 +492,24 @@ SUBROUTINE MDS_READ_SEC_YZ( tGy = exch2_tyYStackLo(tN) tNy = exch2_tNy(tN) #endif /* ALLOW_EXCH2 */ - DO k=1,kSize + DO k=1,nLev + kL = k + kLo - 1 IF (globalFile) THEN #ifdef ALLOW_EXCH2 C record length is sNy==tNy irec = 1 + ( tGy-1 - & + ( k-1 + (irecord-1)*kSize )*exch2_yStack_Ny + & + ( k-1 + (irecord-1)*nLev )*exch2_yStack_Ny & )/tNy #else /* ALLOW_EXCH2 */ iG = (myXGlobalLo-1)/sNx + (bi-1) jG = myYGlobalLo-1 + (bj-1)*sNy - irec=1 + INT(jG/sNy) + nSy*nPy*(k-1) - & + nSy*nPy*kSize*(irecord-1) + irec = 1 + INT(jG/sNy) + nSy*nPy*(k-1) + & + nSy*nPy*nLev*(irecord-1) #endif /* ALLOW_EXCH2 */ ELSE iG = 0 jG = 0 - irec=k + kSize*(irecord-1) + irec = k + nLev*(irecord-1) ENDIF IF (filePrec .EQ. precFloat32) THEN READ(dUnit,rec=irec) r4seg @@ -503,10 +517,10 @@ SUBROUTINE MDS_READ_SEC_YZ( CALL MDS_BYTESWAPR4(sNy,r4seg) #endif IF (arrType .EQ. 'RS') THEN - CALL MDS_SEG4toRS_2D( sNy,oLy,kSize,bi,bj,k,.TRUE., + CALL MDS_SEG4toRS_2D( sNy,OLy,kSize,bi,bj,kL,.TRUE., & r4seg,fldRS ) ELSEIF (arrType .EQ. 'RL') THEN - CALL MDS_SEG4toRL_2D( sNy,oLy,kSize,bi,bj,k,.TRUE., + CALL MDS_SEG4toRL_2D( sNy,OLy,kSize,bi,bj,kL,.TRUE., & r4seg,fldRL ) ELSE WRITE(msgBuf,'(A)') @@ -520,10 +534,10 @@ SUBROUTINE MDS_READ_SEC_YZ( CALL MDS_BYTESWAPR8( sNy, r8seg ) #endif IF (arrType .EQ. 'RS') THEN - CALL MDS_SEG8toRS_2D( sNy,oLy,kSize,bi,bj,k,.TRUE., + CALL MDS_SEG8toRS_2D( sNy,OLy,kSize,bi,bj,kL,.TRUE., & r8seg,fldRS ) ELSEIF (arrType .EQ. 'RL') THEN - CALL MDS_SEG8toRL_2D( sNy,oLy,kSize,bi,bj,k,.TRUE., + CALL MDS_SEG8toRL_2D( sNy,OLy,kSize,bi,bj,kL,.TRUE., & r8seg,fldRL ) ELSE WRITE(msgBuf,'(A)') diff --git a/pkg/mdsio/mdsio_rw_slice.F b/pkg/mdsio/mdsio_rw_slice.F index 5acdc01ec1..53a0c149e2 100644 --- a/pkg/mdsio/mdsio_rw_slice.F +++ b/pkg/mdsio/mdsio_rw_slice.F @@ -62,12 +62,12 @@ SUBROUTINE MDSREADFIELDXZ( IF ( arrType.EQ.'RL' ) THEN CALL MDS_READ_SEC_XZ( - I fName, filePrec, .FALSE., arrType, nNz, + I fName, filePrec, .FALSE., arrType, nNz, 1, nNz, O arr, dummyRS, I irecord, myThid ) ELSE CALL MDS_READ_SEC_XZ( - I fName, filePrec, .FALSE., arrType, nNz, + I fName, filePrec, .FALSE., arrType, nNz, 1, nNz, O dummyRL, arr, I irecord, myThid ) ENDIF @@ -127,12 +127,12 @@ SUBROUTINE MDSREADFIELDYZ( IF ( arrType.EQ.'RL' ) THEN CALL MDS_READ_SEC_YZ( - I fName, filePrec, .FALSE., arrType, nNz, + I fName, filePrec, .FALSE., arrType, nNz, 1, nNz, O arr, dummyRS, I irecord, myThid ) ELSE CALL MDS_READ_SEC_YZ( - I fName, filePrec, .FALSE., arrType, nNz, + I fName, filePrec, .FALSE., arrType, nNz, 1, nNz, O dummyRL, arr, I irecord, myThid ) ENDIF @@ -192,12 +192,12 @@ SUBROUTINE MDSREADFIELDXZ_LOC( IF ( arrType.EQ.'RL' ) THEN CALL MDS_READ_SEC_XZ( - I fName, filePrec, .TRUE., arrType, nNz, + I fName, filePrec, .TRUE., arrType, nNz, 1, nNz, O arr, dummyRS, I irecord, myThid ) ELSE CALL MDS_READ_SEC_XZ( - I fName, filePrec, .TRUE., arrType, nNz, + I fName, filePrec, .TRUE., arrType, nNz, 1, nNz, O dummyRL, arr, I irecord, myThid ) ENDIF @@ -257,12 +257,12 @@ SUBROUTINE MDSREADFIELDYZ_LOC( IF ( arrType.EQ.'RL' ) THEN CALL MDS_READ_SEC_YZ( - I fName, filePrec, .TRUE., arrType, nNz, + I fName, filePrec, .TRUE., arrType, nNz, 1, nNz, O arr, dummyRS, I irecord, myThid ) ELSE CALL MDS_READ_SEC_YZ( - I fName, filePrec, .TRUE., arrType, nNz, + I fName, filePrec, .TRUE., arrType, nNz, 1, nNz, O dummyRL, arr, I irecord, myThid ) ENDIF @@ -329,12 +329,12 @@ SUBROUTINE MDSWRITEFIELDXZ( IF ( arrType.EQ.'RL' ) THEN CALL MDS_WRITE_SEC_XZ( I fName, filePrec, globalFile, .FALSE., - I arrType, nNz, arr, dummyRS, + I arrType, nNz, 1, nNz, arr, dummyRS, I irecord, myIter, myThid ) ELSE CALL MDS_WRITE_SEC_XZ( I fName, filePrec, globalFile, .FALSE., - I arrType, nNz, dummyRL, arr, + I arrType, nNz, 1, nNz, dummyRL, arr, I irecord, myIter, myThid ) ENDIF @@ -400,12 +400,12 @@ SUBROUTINE MDSWRITEFIELDYZ( IF ( arrType.EQ.'RL' ) THEN CALL MDS_WRITE_SEC_YZ( I fName, filePrec, globalFile, .FALSE., - I arrType, nNz, arr, dummyRS, + I arrType, nNz, 1, nNz, arr, dummyRS, I irecord, myIter, myThid ) ELSE CALL MDS_WRITE_SEC_YZ( I fName, filePrec, globalFile, .FALSE., - I arrType, nNz, dummyRL, arr, + I arrType, nNz, 1, nNz, dummyRL, arr, I irecord, myIter, myThid ) ENDIF @@ -471,12 +471,12 @@ SUBROUTINE MDSWRITEFIELDXZ_LOC( IF ( arrType.EQ.'RL' ) THEN CALL MDS_WRITE_SEC_XZ( I fName, filePrec, globalFile, .TRUE., - I arrType, nNz, arr, dummyRS, + I arrType, nNz, 1, nNz, arr, dummyRS, I irecord, myIter, myThid ) ELSE CALL MDS_WRITE_SEC_XZ( I fName, filePrec, globalFile, .TRUE., - I arrType, nNz, dummyRL, arr, + I arrType, nNz, 1, nNz, dummyRL, arr, I irecord, myIter, myThid ) ENDIF @@ -542,12 +542,12 @@ SUBROUTINE MDSWRITEFIELDYZ_LOC( IF ( arrType.EQ.'RL' ) THEN CALL MDS_WRITE_SEC_YZ( I fName, filePrec, globalFile, .TRUE., - I arrType, nNz, arr, dummyRS, + I arrType, nNz, 1, nNz, arr, dummyRS, I irecord, myIter, myThid ) ELSE CALL MDS_WRITE_SEC_YZ( I fName, filePrec, globalFile, .TRUE., - I arrType, nNz, dummyRL, arr, + I arrType, nNz, 1, nNz, dummyRL, arr, I irecord, myIter, myThid ) ENDIF diff --git a/pkg/mdsio/mdsio_write_section.F b/pkg/mdsio/mdsio_write_section.F index eb4ab4ec62..dad4c0d7f4 100644 --- a/pkg/mdsio/mdsio_write_section.F +++ b/pkg/mdsio/mdsio_write_section.F @@ -16,7 +16,7 @@ SUBROUTINE MDS_WRITE_SEC_XZ( I globalFile, I useCurrentDir, I arrType, - I kSize, + I kSize, kLo, kHi, I fldRL, fldRS, I irecord, I myIter, @@ -31,7 +31,9 @@ SUBROUTINE MDS_WRITE_SEC_XZ( C useCurrentDir logic :: always write to the current directory (even if C "mdsioLocalDir" is set) C arrType char(2) :: which array (fldRL/RS) to write, either "RL" or "RS" -C kSize integer :: size of third dimension, normally either 1 or Nr +C kSize integer :: size of second dimension: normally either 1 or Nr +C kLo integer :: 1rst vertical level (of array fldRL/RS) to write +C kHi integer :: last vertical level (of array fldRL/RS) to write C fldRL RL :: array to write if arrType="RL", fldRL(:,kSize,:,:) C fldRS RS :: array to write if arrType="RS", fldRS(:,kSize,:,:) C irecord integer :: record number to read @@ -70,7 +72,7 @@ SUBROUTINE MDS_WRITE_SEC_XZ( LOGICAL globalFile LOGICAL useCurrentDir CHARACTER*(2) arrType - INTEGER kSize + INTEGER kSize, kLo, kHi _RL fldRL(*) _RS fldRS(*) INTEGER irecord @@ -84,15 +86,16 @@ SUBROUTINE MDS_WRITE_SEC_XZ( EXTERNAL ILNBLNK, MDS_RECLEN C !LOCAL VARIABLES: - CHARACTER*(MAX_LEN_FNAM) dataFName,pfName - INTEGER iG,jG,irec,bi,bj,k,dUnit,IL,pIL + CHARACTER*(MAX_LEN_FNAM) dataFName, pfName + INTEGER IL, pIL, dUnit, nLev, irec + INTEGER iG, jG, bi, bj, k, kL Real*4 r4seg(sNx) Real*8 r8seg(sNx) INTEGER length_of_rec LOGICAL fileIsOpen - CHARACTER*(max_len_mbuf) msgBuf + CHARACTER*(MAX_LEN_MBUF) msgBuf #ifdef ALLOW_EXCH2 - INTEGER tGx,tNx,tN + INTEGER tGx, tNx, tN #endif /* ALLOW_EXCH2 */ C ------------------------------------------------------------------ @@ -125,6 +128,9 @@ SUBROUTINE MDS_WRITE_SEC_XZ( ENDIF pIL=ILNBLNK( pfName ) +C Set number of levels to write: + nLev = kHi - kLo + 1 + C Assign a free unit number as the I/O channel for this routine CALL MDSFINDUNIT( dUnit, myThid ) @@ -172,30 +178,31 @@ SUBROUTINE MDS_WRITE_SEC_XZ( tGx = exch2_txXStackLo(tN) tNx = exch2_tNx(tN) #endif /* ALLOW_EXCH2 */ - DO k=1,kSize + DO k=1,nLev + kL = k + kLo - 1 IF (globalFile) THEN #ifdef ALLOW_EXCH2 C record length is sNx==tNx irec = 1 + ( tGx-1 - & + ( k-1 + (irecord-1)*kSize )*exch2_xStack_Nx + & + ( k-1 + (irecord-1)*nLev )*exch2_xStack_Nx & )/tNx #else /* ALLOW_EXCH2 */ iG = myXGlobalLo-1 + (bi-1)*sNx jG = (myYGlobalLo-1)/sNy + (bj-1) - irec=1 + INT(iG/sNx) + nSx*nPx*(k-1) - & + nSx*nPx*kSize*(irecord-1) + irec = 1 + INT(iG/sNx) + nSx*nPx*(k-1) + & + nSx*nPx*nLev*(irecord-1) #endif /* ALLOW_EXCH2 */ ELSE iG = 0 jG = 0 - irec=k + kSize*(irecord-1) + irec = k + nLev*(irecord-1) ENDIF IF (filePrec .EQ. precFloat32) THEN IF (arrType .EQ. 'RS') THEN - CALL MDS_SEG4toRS_2D( sNx,oLx,kSize,bi,bj,k,.FALSE., + CALL MDS_SEG4toRS_2D( sNx,OLx,kSize,bi,bj,kL,.FALSE., & r4seg,fldRS ) ELSEIF (arrType .EQ. 'RL') THEN - CALL MDS_SEG4toRL_2D( sNx,oLx,kSize,bi,bj,k,.FALSE., + CALL MDS_SEG4toRL_2D( sNx,OLx,kSize,bi,bj,kL,.FALSE., & r4seg,fldRL ) ELSE WRITE(msgBuf,'(A)') @@ -209,10 +216,10 @@ SUBROUTINE MDS_WRITE_SEC_XZ( WRITE(dUnit,rec=irec) r4seg ELSEIF (filePrec .EQ. precFloat64) THEN IF (arrType .EQ. 'RS') THEN - CALL MDS_SEG8toRS_2D( sNx,oLx,kSize,bi,bj,k,.FALSE., + CALL MDS_SEG8toRS_2D( sNx,OLx,kSize,bi,bj,kL,.FALSE., & r8seg,fldRS ) ELSEIF (arrType .EQ. 'RL') THEN - CALL MDS_SEG8toRL_2D( sNx,oLx,kSize,bi,bj,k,.FALSE., + CALL MDS_SEG8toRL_2D( sNx,OLx,kSize,bi,bj,kL,.FALSE., & r8seg,fldRL ) ELSE WRITE(msgBuf,'(A)') @@ -270,7 +277,7 @@ SUBROUTINE MDS_WRITE_SEC_YZ( I globalFile, I useCurrentDir, I arrType, - I kSize, + I kSize, kLo, kHi, I fldRL, fldRS, I irecord, I myIter, @@ -285,7 +292,9 @@ SUBROUTINE MDS_WRITE_SEC_YZ( C useCurrentDir logic :: always write to the current directory (even if C "mdsioLocalDir" is set) C arrType char(2) :: which array (fldRL/RS) to write, either "RL" or "RS" -C kSize integer :: size of third dimension, normally either 1 or Nr +C kSize integer :: size of second dimension: normally either 1 or Nr +C kLo integer :: 1rst vertical level (of array fldRL/RS) to write +C kHi integer :: last vertical level (of array fldRL/RS) to write C fldRL RL :: array to write if arrType="RL", fldRL(:,kSize,:,:) C fldRS RS :: array to write if arrType="RS", fldRS(:,kSize,:,:) C irecord integer :: record number to read @@ -324,7 +333,7 @@ SUBROUTINE MDS_WRITE_SEC_YZ( LOGICAL globalFile LOGICAL useCurrentDir CHARACTER*(2) arrType - INTEGER kSize + INTEGER kSize, kLo, kHi _RL fldRL(*) _RS fldRS(*) INTEGER irecord @@ -338,15 +347,16 @@ SUBROUTINE MDS_WRITE_SEC_YZ( EXTERNAL ILNBLNK, MDS_RECLEN C !LOCAL VARIABLES: - CHARACTER*(MAX_LEN_FNAM) dataFName,pfName - INTEGER iG,jG,irec,bi,bj,k,dUnit,IL,pIL + CHARACTER*(MAX_LEN_FNAM) dataFName, pfName + INTEGER IL, pIL, dUnit, nLev, irec + INTEGER iG, jG, bi, bj, k, kL Real*4 r4seg(sNy) Real*8 r8seg(sNy) INTEGER length_of_rec LOGICAL fileIsOpen - CHARACTER*(max_len_mbuf) msgBuf + CHARACTER*(MAX_LEN_MBUF) msgBuf #ifdef ALLOW_EXCH2 - INTEGER tGy,tNy,tN + INTEGER tGy, tNy, tN #endif /* ALLOW_EXCH2 */ C ------------------------------------------------------------------ @@ -378,6 +388,9 @@ SUBROUTINE MDS_WRITE_SEC_YZ( ENDIF pIL=ILNBLNK( pfName ) +C Set number of levels to write: + nLev = kHi - kLo + 1 + C Assign a free unit number as the I/O channel for this routine CALL MDSFINDUNIT( dUnit, myThid ) @@ -425,30 +438,31 @@ SUBROUTINE MDS_WRITE_SEC_YZ( tGy = exch2_tyYStackLo(tN) tNy = exch2_tNy(tN) #endif /* ALLOW_EXCH2 */ - DO k=1,kSize + DO k=1,nLev + kL = k + kLo - 1 IF (globalFile) THEN #ifdef ALLOW_EXCH2 C record length is sNy==tNy irec = 1 + ( tGy-1 - & + ( k-1 + (irecord-1)*kSize )*exch2_yStack_Ny + & + ( k-1 + (irecord-1)*nLev )*exch2_yStack_Ny & )/tNy #else /* ALLOW_EXCH2 */ iG = (myXGlobalLo-1)/sNx + (bi-1) jG = myYGlobalLo-1 + (bj-1)*sNy - irec=1 + INT(jG/sNy) + nSy*nPy*(k-1) - & + nSy*nPy*kSize*(irecord-1) + irec = 1 + INT(jG/sNy) + nSy*nPy*(k-1) + & + nSy*nPy*nLev*(irecord-1) #endif /* ALLOW_EXCH2 */ ELSE iG = 0 jG = 0 - irec=k + kSize*(irecord-1) + irec = k + nLev*(irecord-1) ENDIF IF (filePrec .EQ. precFloat32) THEN IF (arrType .EQ. 'RS') THEN - CALL MDS_SEG4toRS_2D( sNy,oLy,kSize,bi,bj,k,.FALSE., + CALL MDS_SEG4toRS_2D( sNy,OLy,kSize,bi,bj,kL,.FALSE., & r4seg,fldRS ) ELSEIF (arrType .EQ. 'RL') THEN - CALL MDS_SEG4toRL_2D( sNy,oLy,kSize,bi,bj,k,.FALSE., + CALL MDS_SEG4toRL_2D( sNy,OLy,kSize,bi,bj,kL,.FALSE., & r4seg,fldRL ) ELSE WRITE(msgBuf,'(A)') @@ -462,10 +476,10 @@ SUBROUTINE MDS_WRITE_SEC_YZ( WRITE(dUnit,rec=irec) r4seg ELSEIF (filePrec .EQ. precFloat64) THEN IF (arrType .EQ. 'RS') THEN - CALL MDS_SEG8toRS_2D( sNy,oLy,kSize,bi,bj,k,.FALSE., + CALL MDS_SEG8toRS_2D( sNy,OLy,kSize,bi,bj,kL,.FALSE., & r8seg,fldRS ) ELSEIF (arrType .EQ. 'RL') THEN - CALL MDS_SEG8toRL_2D( sNy,oLy,kSize,bi,bj,k,.FALSE., + CALL MDS_SEG8toRL_2D( sNy,OLy,kSize,bi,bj,kL,.FALSE., & r8seg,fldRL ) ELSE WRITE(msgBuf,'(A)') diff --git a/pkg/mom_common/mom_u_botdrag_coeff.F b/pkg/mom_common/mom_u_botdrag_coeff.F index 63d8c2b5ff..35248cd704 100644 --- a/pkg/mom_common/mom_u_botdrag_coeff.F +++ b/pkg/mom_common/mom_u_botdrag_coeff.F @@ -89,6 +89,15 @@ SUBROUTINE MOM_U_BOTDRAG_COEFF( recDrC = recip_drC(kLowF) ENDIF +#ifdef ALLOW_AUTODIFF +C-- Initialise drag-coeff + DO j=1-OLy,sNy+OLy + DO i=1-OLx,sNx+OLx + cDrag(i,j) = 0. _d 0 + ENDDO + ENDDO +#endif + C-- Linear bottom drag contribution to cDrag: DO j=1-OLy,sNy+OLy DO i=1-OLx+1,sNx+OLx diff --git a/pkg/mom_common/mom_v_botdrag_coeff.F b/pkg/mom_common/mom_v_botdrag_coeff.F index fa3f808030..73682663e3 100644 --- a/pkg/mom_common/mom_v_botdrag_coeff.F +++ b/pkg/mom_common/mom_v_botdrag_coeff.F @@ -89,6 +89,15 @@ SUBROUTINE MOM_V_BOTDRAG_COEFF( recDrC = recip_drC(kLowF) ENDIF +#ifdef ALLOW_AUTODIFF +C-- Initialise drag-coeff + DO j=1-OLy,sNy+OLy + DO i=1-OLx,sNx+OLx + cDrag(i,j) = 0. _d 0 + ENDDO + ENDDO +#endif + C-- Linear bottom drag contribution to cDrag: DO j=1-OLy+1,sNy+OLy DO i=1-OLx,sNx+OLx diff --git a/pkg/mom_fluxform/mom_fluxform.F b/pkg/mom_fluxform/mom_fluxform.F index 055d77ed17..9a1998b1ce 100644 --- a/pkg/mom_fluxform/mom_fluxform.F +++ b/pkg/mom_fluxform/mom_fluxform.F @@ -277,6 +277,9 @@ SUBROUTINE MOM_FLUXFORM( C-- Calculate open water fraction at vorticity points CALL MOM_CALC_HFACZ( bi,bj,k,hFacZ,r_hFacZ,myThid ) +#ifdef ALLOW_AUTODIFF_TAMC +CADJ STORE hFacZ(:,:) = comlev1_bibj_k, key = kkey, byte = isbyte +#endif C---- Calculate common quantities used in both U and V equations C Calculate tracer cell face open areas @@ -299,7 +302,10 @@ SUBROUTINE MOM_FLUXFORM( & MIN( h0FacS(i,j,k,bi,bj), h0FacS(i-1,j,k,bi,bj) ) ) ENDDO ENDDO - ENDIF + ENDIF +# ifdef ALLOW_AUTODIFF_TAMC +CADJ STORE h0FacZ(:,:) = comlev1_bibj_k, key = kkey, byte = isbyte +# endif #endif /* NONLIN_FRSURF */ C Make local copies of horizontal flow field @@ -358,6 +364,21 @@ SUBROUTINE MOM_FLUXFORM( ENDIF #endif ENDIF +#ifdef ALLOW_AUTODIFF_TAMC +C KE is used a lot, so we save here in order to avoid multiple +C recomputations of this variable. +CADJ STORE KE(:,:) = comlev1_bibj_k, key = kkey, byte = isbyte +C Variables tension and strain are relatively cheap to recompute, so +C we do not save them here (but saving them would clearly avoid +C the recomputations). +cCADJ STORE tension(:,:) = comlev1_bibj_k, key = kkey, byte = isbyte +cCADJ STORE strain(:,:) = comlev1_bibj_k, key = kkey, byte = isbyte +C hDiv and vort3 are relatively expensive to recompute, so we save +C them here. +CADJ STORE hDiv(:,:) = comlev1_bibj_k, key = kkey, byte = isbyte +CADJ STORE vort3(:,:) = comlev1_bibj_k, key = kkey, byte = isbyte +#endif + C--- First call (k=1): compute vertical adv. flux fVerUkm & fVerVkm IF (momAdvection.AND.k.EQ.1) THEN @@ -401,6 +422,12 @@ SUBROUTINE MOM_FLUXFORM( O rTransU, rTransV, I myTime, myIter, myThid ) ENDIF +#ifdef ALLOW_AUTODIFF_TAMC +C This saves us from calling the relatively expensive +C mom_calc_rtrans in AD mode. +CADJ STORE rTransU(:,:) = comlev1_bibj_k, key = kkey, byte = isbyte +CADJ STORE rTransV(:,:) = comlev1_bibj_k, key = kkey, byte = isbyte +#endif #ifdef MOM_BOUNDARY_CONSERVE IF ( momAdvection .AND. k.LT.Nr ) THEN @@ -427,6 +454,17 @@ SUBROUTINE MOM_FLUXFORM( I hDiv, vort3, tension, strain, stretching, KE, hFacZ, I myThid ) ENDIF +#ifdef ALLOW_AUTODIFF_TAMC +# ifndef AUTODIFF_ALLOW_VISCFACADJ +C These store directive must not be here, if you want to recompute +C these viscosity coefficients with a modified viscFacAdj = viscFacInAd +C because the store directives intentionally prevent the recomputation. +CADJ STORE viscAh_Z(:,:) = comlev1_bibj_k, key = kkey, byte = isbyte +CADJ STORE viscAh_D(:,:) = comlev1_bibj_k, key = kkey, byte = isbyte +CADJ STORE viscA4_Z(:,:) = comlev1_bibj_k, key = kkey, byte = isbyte +CADJ STORE viscA4_D(:,:) = comlev1_bibj_k, key = kkey, byte = isbyte +# endif /* AUTODIFF_ALLOW_VISCFACADJ */ +#endif /* ALLOW_AUTODIFF_TAMC */ ENDIF C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| @@ -541,6 +579,9 @@ SUBROUTINE MOM_FLUXFORM( IF ( useBiharmonicVisc ) & CALL MOM_U_DEL2U( bi, bj, k, uFld, hFacZ, h0FacZ, O v4f, myThid ) +#ifdef ALLOW_AUTODIFF_TAMC +CADJ STORE v4f(:,:) = comlev1_bibj_k, key = kkey, byte = isbyte +#endif C Laplacian and bi-harmonic terms, Zonal Fluxes -> fZon CALL MOM_U_XVISCFLUX( bi,bj,k,uFld,v4F,fZon, @@ -609,6 +650,9 @@ SUBROUTINE MOM_FLUXFORM( I uFld, vFld, kappaRU, KE, O cDrag, I myIter, myThid ) +#ifdef ALLOW_AUTODIFF_TAMC +CADJ STORE cDrag(:,:) = comlev1_bibj_k, key = kkey, byte = isbyte +#endif DO j=jMin,jMax DO i=iMin,iMax guDiss(i,j) = guDiss(i,j) @@ -635,6 +679,9 @@ SUBROUTINE MOM_FLUXFORM( I uFld, vFld, kappaRU, KE, O cDrag, I myIter, myThid ) +#ifdef ALLOW_AUTODIFF_TAMC +CADJ STORE cDrag(:,:) = comlev1_bibj_k, key = kkey, byte = isbyte +#endif DO j=jMin,jMax DO i=iMin,iMax guDiss(i,j) = guDiss(i,j) @@ -791,6 +838,9 @@ SUBROUTINE MOM_FLUXFORM( IF ( useBiharmonicVisc ) & CALL MOM_V_DEL2V( bi, bj, k, vFld, hFacZ, h0FacZ, O v4f, myThid ) +#ifdef ALLOW_AUTODIFF_TAMC +CADJ STORE v4f(:,:) = comlev1_bibj_k, key = kkey, byte = isbyte +#endif C Laplacian and bi-harmonic terms, Zonal Fluxes -> fZon CALL MOM_V_XVISCFLUX( bi,bj,k,vFld,v4f,hFacZ,fZon, @@ -859,6 +909,9 @@ SUBROUTINE MOM_FLUXFORM( I uFld, vFld, kappaRV, KE, O cDrag, I myIter, myThid ) +#ifdef ALLOW_AUTODIFF_TAMC +CADJ STORE cDrag(:,:) = comlev1_bibj_k, key = kkey, byte = isbyte +#endif DO j=jMin,jMax DO i=iMin,iMax gvDiss(i,j) = gvDiss(i,j) @@ -885,6 +938,9 @@ SUBROUTINE MOM_FLUXFORM( I uFld, vFld, kappaRV, KE, O cDrag, I myIter, myThid ) +#ifdef ALLOW_AUTODIFF_TAMC +CADJ STORE cDrag(:,:) = comlev1_bibj_k, key = kkey, byte = isbyte +#endif DO j=jMin,jMax DO i=iMin,iMax gvDiss(i,j) = gvDiss(i,j) diff --git a/pkg/mom_vecinv/mom_vecinv.F b/pkg/mom_vecinv/mom_vecinv.F index 7fb509aea9..05e5bfaf49 100644 --- a/pkg/mom_vecinv/mom_vecinv.F +++ b/pkg/mom_vecinv/mom_vecinv.F @@ -259,8 +259,6 @@ SUBROUTINE MOM_VECINV( ENDDO #ifdef ALLOW_AUTODIFF_TAMC -CADJ STORE ufld(:,:) = comlev1_bibj_k, key = kkey, byte = isbyte -CADJ STORE vfld(:,:) = comlev1_bibj_k, key = kkey, byte = isbyte CADJ STORE hFacZ(:,:) = comlev1_bibj_k, key = kkey, byte = isbyte CADJ STORE r_hFacZ(:,:) = comlev1_bibj_k, key = kkey, byte = isbyte CADJ STORE fverukm(:,:) = comlev1_bibj_k, key = kkey, byte = isbyte @@ -275,12 +273,6 @@ SUBROUTINE MOM_VECINV( CALL MOM_CALC_RELVORT3(bi,bj,k,uFld,vFld,hFacZ,vort3,myThid) -#ifdef ALLOW_AUTODIFF_TAMC -CADJ STORE KE(:,:) = comlev1_bibj_k, key = kkey, byte = isbyte -CADJ STORE vort3(:,:) = comlev1_bibj_k, key = kkey, byte = isbyte -CADJ STORE vort3bc(:,:) = comlev1_bibj_k, key = kkey, byte = isbyte -#endif - C- mask vort3 and account for no-slip / free-slip BC in vort3BC: DO j=1-OLy,sNy+OLy DO i=1-OLx,sNx+OLx @@ -293,6 +285,7 @@ SUBROUTINE MOM_VECINV( ENDDO #ifdef ALLOW_AUTODIFF_TAMC +CADJ STORE KE(:,:) = comlev1_bibj_k, key = kkey, byte = isbyte CADJ STORE vort3(:,:) = comlev1_bibj_k, key = kkey, byte = isbyte CADJ STORE vort3bc(:,:) = comlev1_bibj_k, key = kkey, byte = isbyte #endif @@ -316,12 +309,10 @@ SUBROUTINE MOM_VECINV( ENDDO ENDDO ENDIF -#endif /* NONLIN_FRSURF */ - -#ifdef ALLOW_AUTODIFF_TAMC +# ifdef ALLOW_AUTODIFF_TAMC CADJ STORE h0FacZ(:,:) = comlev1_bibj_k, key = kkey, byte = isbyte -CADJ STORE hFacZ(:,:) = comlev1_bibj_k, key = kkey, byte = isbyte -#endif +# endif +#endif /* NONLIN_FRSURF */ CALL MOM_CALC_HDIV(bi,bj,k,2,uFld,vFld,hDiv,myThid) @@ -352,10 +343,10 @@ SUBROUTINE MOM_VECINV( ENDIF #ifdef ALLOW_AUTODIFF_TAMC -CADJ STORE hdiv(:,:) = comlev1_bibj_k, key = kkey, byte = isbyte +CADJ STORE hDiv(:,:) = comlev1_bibj_k, key = kkey, byte = isbyte CADJ STORE tension(:,:) = comlev1_bibj_k, key = kkey, byte = isbyte CADJ STORE strain(:,:) = comlev1_bibj_k, key = kkey, byte = isbyte -CADJ STORE strainbc(:,:) = comlev1_bibj_k, key = kkey, byte = isbyte +CADJ STORE strainBC(:,:) = comlev1_bibj_k, key = kkey, byte = isbyte #endif C-- Calculate Lateral Viscosities @@ -486,6 +477,9 @@ SUBROUTINE MOM_VECINV( I uFld, vFld, kappaRU, KE, O cDrag, I myIter, myThid ) +#ifdef ALLOW_AUTODIFF_TAMC +CADJ STORE cDrag(:,:) = comlev1_bibj_k, key = kkey, byte = isbyte +#endif DO j=jMin,jMax DO i=iMin,iMax gUdiss(i,j) = gUdiss(i,j) @@ -511,6 +505,9 @@ SUBROUTINE MOM_VECINV( I uFld, vFld, kappaRU, KE, O cDrag, I myIter, myThid ) +#ifdef ALLOW_AUTODIFF_TAMC +CADJ STORE cDrag(:,:) = comlev1_bibj_k, key = kkey, byte = isbyte +#endif DO j=jMin,jMax DO i=iMin,iMax gUdiss(i,j) = gUdiss(i,j) @@ -574,6 +571,9 @@ SUBROUTINE MOM_VECINV( I uFld, vFld, kappaRV, KE, O cDrag, I myIter, myThid ) +#ifdef ALLOW_AUTODIFF_TAMC +CADJ STORE cDrag(:,:) = comlev1_bibj_k, key = kkey, byte = isbyte +#endif DO j=jMin,jMax DO i=iMin,iMax gvDiss(i,j) = gvDiss(i,j) @@ -599,6 +599,9 @@ SUBROUTINE MOM_VECINV( I uFld, vFld, kappaRV, KE, O cDrag, I myIter, myThid ) +#ifdef ALLOW_AUTODIFF_TAMC +CADJ STORE cDrag(:,:) = comlev1_bibj_k, key = kkey, byte = isbyte +#endif DO j=jMin,jMax DO i=iMin,iMax gvDiss(i,j) = gvDiss(i,j) diff --git a/pkg/ptracers/ptracers_check.F b/pkg/ptracers/ptracers_check.F index feb4cbdbef..a47a90eb6e 100644 --- a/pkg/ptracers/ptracers_check.F +++ b/pkg/ptracers/ptracers_check.F @@ -235,6 +235,18 @@ SUBROUTINE PTRACERS_CHECK( myThid ) errCount = errCount + 1 ENDIF #endif /* ndef GAD_SMOLARKIEWICZ_HACK */ +#ifndef PTRACERS_ALLOW_DYN_STATE + IF ( PTRACERS_SOM_Advection(iTracer) ) THEN + WRITE(msgBuf,'(2A,I4,A)') 'PTRACERS_CHECK:', + & ' PTRACERS_SOM_Advection(', iTracer, ') = T, but' + CALL PRINT_ERROR( msgBuf, myThid ) + WRITE(msgBuf,'(3A)') 'PTRACERS_CHECK:', + & ' PTRACERS_ALLOW_DYN_STATE is not defined', + & ' in PTRACERS_OPTIONS.h.' + CALL PRINT_ERROR( msgBuf, myThid ) + errCount = errCount + 1 + ENDIF +#endif ENDDO IF ( errCount.GE.1 ) THEN diff --git a/pkg/rw/read_rec.F b/pkg/rw/read_rec.F index 311be2d618..ccb9c305bd 100644 --- a/pkg/rw/read_rec.F +++ b/pkg/rw/read_rec.F @@ -33,7 +33,7 @@ SUBROUTINE READ_REC_XY_RS( fName,field,iRec,myIter,myThid ) C !INPUT/OUTPUT PARAMETERS: C Arguments CHARACTER*(*) fName - _RS field(1-Olx:sNx+Olx,1-Oly:sNy+Oly,nSx,nSy) + _RS field(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) INTEGER iRec INTEGER myIter INTEGER myThid @@ -92,7 +92,7 @@ SUBROUTINE READ_REC_XY_RL( fName,field,iRec,myIter,myThid ) C !INPUT/OUTPUT PARAMETERS: C Arguments CHARACTER*(*) fName - _RL field(1-Olx:sNx+Olx,1-Oly:sNy+Oly,nSx,nSy) + _RL field(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) INTEGER iRec INTEGER myIter INTEGER myThid @@ -151,7 +151,7 @@ SUBROUTINE READ_REC_XYZ_RS( fName,field,iRec,myIter,myThid ) C !INPUT/OUTPUT PARAMETERS: C Arguments CHARACTER*(*) fName - _RS field(1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nr,nSx,nSy) + _RS field(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) INTEGER iRec INTEGER myIter INTEGER myThid @@ -169,7 +169,6 @@ SUBROUTINE READ_REC_XYZ_RS( fName,field,iRec,myIter,myThid ) c CHARACTER*(MAX_LEN_FNAM) fullName CEOP - c IF (myIter.GE.0) THEN c IL=ILNBLNK( fName ) c WRITE(fullName,'(2a,i10.10)') fName(1:IL),'.',myIter @@ -211,7 +210,7 @@ SUBROUTINE READ_REC_XYZ_RL( fName,field,iRec,myIter,myThid ) C !INPUT/OUTPUT PARAMETERS: C Arguments CHARACTER*(*) fName - _RL field(1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nr,nSx,nSy) + _RL field(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) INTEGER iRec INTEGER myIter INTEGER myThid @@ -229,7 +228,6 @@ SUBROUTINE READ_REC_XYZ_RL( fName,field,iRec,myIter,myThid ) c CHARACTER*(MAX_LEN_FNAM) fullName CEOP - c IF (myIter.GE.0) THEN c IL=ILNBLNK( fName ) c WRITE(fullName,'(2a,i10.10)') fName(1:IL),'.',myIter @@ -277,7 +275,7 @@ SUBROUTINE READ_REC_3D_RS( CHARACTER*(*) fName INTEGER fPrec INTEGER nNz - _RS field(1-Olx:sNx+Olx,1-Oly:sNy+Oly,nNz,nSx,nSy) + _RS field(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nNz,nSx,nSy) INTEGER iRec INTEGER myIter INTEGER myThid @@ -294,7 +292,6 @@ SUBROUTINE READ_REC_3D_RS( c CHARACTER*(MAX_LEN_FNAM) fullName CEOP - c IF (myIter.GE.0) THEN c IL=ILNBLNK( fName ) c WRITE(fullName,'(2a,i10.10)') fName(1:IL),'.',myIter @@ -341,7 +338,7 @@ SUBROUTINE READ_REC_3D_RL( CHARACTER*(*) fName INTEGER fPrec INTEGER nNz - _RL field(1-Olx:sNx+Olx,1-Oly:sNy+Oly,nNz,nSx,nSy) + _RL field(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nNz,nSx,nSy) INTEGER iRec INTEGER myIter INTEGER myThid @@ -358,7 +355,6 @@ SUBROUTINE READ_REC_3D_RL( c CHARACTER*(MAX_LEN_FNAM) fullName CEOP - c IF (myIter.GE.0) THEN c IL=ILNBLNK( fName ) c WRITE(fullName,'(2a,i10.10)') fName(1:IL),'.',myIter @@ -406,7 +402,7 @@ SUBROUTINE READ_REC_LEV_RS( CHARACTER*(*) fName INTEGER fPrec INTEGER kSiz, kLo, kHi - _RS field(1-Olx:sNx+Olx,1-Oly:sNy+Oly,kSiz,nSx,nSy) + _RS field(1-OLx:sNx+OLx,1-OLy:sNy+OLy,kSiz,nSx,nSy) INTEGER iRec INTEGER myIter INTEGER myThid @@ -423,7 +419,6 @@ SUBROUTINE READ_REC_LEV_RS( c CHARACTER*(MAX_LEN_FNAM) fullName CEOP - c IF (myIter.GE.0) THEN c IL=ILNBLNK( fName ) c WRITE(fullName,'(2a,i10.10)') fName(1:IL),'.',myIter @@ -471,7 +466,7 @@ SUBROUTINE READ_REC_LEV_RL( CHARACTER*(*) fName INTEGER fPrec INTEGER kSiz, kLo, kHi - _RL field(1-Olx:sNx+Olx,1-Oly:sNy+Oly,kSiz,nSx,nSy) + _RL field(1-OLx:sNx+OLx,1-OLy:sNy+OLy,kSiz,nSx,nSy) INTEGER iRec INTEGER myIter INTEGER myThid @@ -488,7 +483,6 @@ SUBROUTINE READ_REC_LEV_RL( c CHARACTER*(MAX_LEN_FNAM) fullName CEOP - c IF (myIter.GE.0) THEN c IL=ILNBLNK( fName ) c WRITE(fullName,'(2a,i10.10)') fName(1:IL),'.',myIter @@ -533,7 +527,7 @@ SUBROUTINE READ_REC_XZ_RS( CHARACTER*(*) fName INTEGER fPrec INTEGER nNz - _RS field(1-Olx:sNx+Olx,nNz,nSx,nSy) + _RS field(1-OLx:sNx+OLx,nNz,nSx,nSy) INTEGER iRec INTEGER myIter INTEGER myThid @@ -562,7 +556,7 @@ SUBROUTINE READ_REC_XZ_RS( #ifdef ALLOW_MDSIO CALL MDS_READ_SEC_XZ( I fName, fPrec, useCurrentDir, - I fType, nNz, + I fType, nNz, 1, nNz, O dummyRL, field, I iRec, myThid ) #endif @@ -595,7 +589,7 @@ SUBROUTINE READ_REC_XZ_RL( CHARACTER*(*) fName INTEGER fPrec INTEGER nNz - _RL field(1-Olx:sNx+Olx,nNz,nSx,nSy) + _RL field(1-OLx:sNx+OLx,nNz,nSx,nSy) INTEGER iRec INTEGER myIter INTEGER myThid @@ -624,7 +618,7 @@ SUBROUTINE READ_REC_XZ_RL( #ifdef ALLOW_MDSIO CALL MDS_READ_SEC_XZ( I fName, fPrec, useCurrentDir, - I fType, nNz, + I fType, nNz, 1, nNz, O field, dummyRS, I iRec, myThid ) #endif @@ -657,7 +651,7 @@ SUBROUTINE READ_REC_YZ_RS( CHARACTER*(*) fName INTEGER fPrec INTEGER nNz - _RS field(1-Oly:sNy+Oly,nNz,nSx,nSy) + _RS field(1-OLy:sNy+OLy,nNz,nSx,nSy) INTEGER iRec INTEGER myIter INTEGER myThid @@ -674,7 +668,6 @@ SUBROUTINE READ_REC_YZ_RS( c CHARACTER*(MAX_LEN_FNAM) fullName CEOP - c IF (myIter.GE.0) THEN c IL=ILNBLNK( fName ) c WRITE(fullName,'(2a,i10.10)') fName(1:IL),'.',myIter @@ -687,7 +680,7 @@ SUBROUTINE READ_REC_YZ_RS( #ifdef ALLOW_MDSIO CALL MDS_READ_SEC_YZ( I fName, fPrec, useCurrentDir, - I fType, nNz, + I fType, nNz, 1, nNz, O dummyRL, field, I iRec, myThid ) #endif @@ -720,7 +713,7 @@ SUBROUTINE READ_REC_YZ_RL( CHARACTER*(*) fName INTEGER fPrec INTEGER nNz - _RL field(1-Oly:sNy+Oly,nNz,nSx,nSy) + _RL field(1-OLy:sNy+OLy,nNz,nSx,nSy) INTEGER iRec INTEGER myIter INTEGER myThid @@ -737,7 +730,6 @@ SUBROUTINE READ_REC_YZ_RL( c CHARACTER*(MAX_LEN_FNAM) fullName CEOP - c IF (myIter.GE.0) THEN c IL=ILNBLNK( fName ) c WRITE(fullName,'(2a,i10.10)') fName(1:IL),'.',myIter @@ -750,7 +742,7 @@ SUBROUTINE READ_REC_YZ_RL( #ifdef ALLOW_MDSIO CALL MDS_READ_SEC_YZ( I fName, fPrec, useCurrentDir, - I fType, nNz, + I fType, nNz, 1, nNz, O field, dummyRS, I iRec, myThid ) #endif diff --git a/pkg/rw/write_rec.F b/pkg/rw/write_rec.F index a3e94612c8..d1345c850c 100644 --- a/pkg/rw/write_rec.F +++ b/pkg/rw/write_rec.F @@ -96,7 +96,7 @@ SUBROUTINE WRITE_REC_XY_RS( fName,field,iRec,myIter,myThid ) C !INPUT/OUTPUT PARAMETERS: C Arguments CHARACTER*(*) fName - _RS field(1-Olx:sNx+Olx,1-Oly:sNy+Oly,nSx,nSy) + _RS field(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) INTEGER iRec INTEGER myIter INTEGER myThid @@ -118,7 +118,6 @@ SUBROUTINE WRITE_REC_XY_RS( fName,field,iRec,myIter,myThid ) c CHARACTER*(MAX_LEN_FNAM) fullName CEOP - c IF (myIter.GE.0) THEN c IL=ILNBLNK( fName ) c WRITE(fullName,'(2a,i10.10)') fName(1:IL),'.',myIter @@ -160,7 +159,7 @@ SUBROUTINE WRITE_REC_XY_RL( fName,field,iRec,myIter,myThid ) C !INPUT/OUTPUT PARAMETERS: C Arguments CHARACTER*(*) fName - _RL field(1-Olx:sNx+Olx,1-Oly:sNy+Oly,nSx,nSy) + _RL field(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) INTEGER iRec INTEGER myIter INTEGER myThid @@ -182,7 +181,6 @@ SUBROUTINE WRITE_REC_XY_RL( fName,field,iRec,myIter,myThid ) c CHARACTER*(MAX_LEN_FNAM) fullName CEOP - c IF (myIter.GE.0) THEN c IL=ILNBLNK( fName ) c WRITE(fullName,'(2a,i10.10)') fName(1:IL),'.',myIter @@ -224,7 +222,7 @@ SUBROUTINE WRITE_REC_XYZ_RS( fName,field,iRec,myIter,myThid ) C !INPUT/OUTPUT PARAMETERS: C Arguments CHARACTER*(*) fName - _RS field(1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nr,nSx,nSy) + _RS field(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) INTEGER iRec INTEGER myIter INTEGER myThid @@ -246,7 +244,6 @@ SUBROUTINE WRITE_REC_XYZ_RS( fName,field,iRec,myIter,myThid ) c CHARACTER*(MAX_LEN_FNAM) fullName CEOP - c IF (myIter.GE.0) THEN c IL=ILNBLNK( fName ) c WRITE(fullName,'(2a,i10.10)') fName(1:IL),'.',myIter @@ -288,7 +285,7 @@ SUBROUTINE WRITE_REC_XYZ_RL( fName,field,iRec,myIter,myThid ) C !INPUT/OUTPUT PARAMETERS: C Arguments CHARACTER*(*) fName - _RL field(1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nr,nSx,nSy) + _RL field(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) INTEGER iRec INTEGER myIter INTEGER myThid @@ -310,7 +307,6 @@ SUBROUTINE WRITE_REC_XYZ_RL( fName,field,iRec,myIter,myThid ) c CHARACTER*(MAX_LEN_FNAM) fullName CEOP - c IF (myIter.GE.0) THEN c IL=ILNBLNK( fName ) c WRITE(fullName,'(2a,i10.10)') fName(1:IL),'.',myIter @@ -357,7 +353,7 @@ SUBROUTINE WRITE_REC_3D_RS( CHARACTER*(*) fName INTEGER fPrec INTEGER nNz - _RS field(1-Olx:sNx+Olx,1-Oly:sNy+Oly,nNz,nSx,nSy) + _RS field(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nNz,nSx,nSy) INTEGER iRec INTEGER myIter INTEGER myThid @@ -378,7 +374,6 @@ SUBROUTINE WRITE_REC_3D_RS( c CHARACTER*(MAX_LEN_FNAM) fullName CEOP - c IF (myIter.GE.0) THEN c IL=ILNBLNK( fName ) c WRITE(fullName,'(2a,i10.10)') fName(1:IL),'.',myIter @@ -423,7 +418,7 @@ SUBROUTINE WRITE_REC_3D_RL( CHARACTER*(*) fName INTEGER fPrec INTEGER nNz - _RL field(1-Olx:sNx+Olx,1-Oly:sNy+Oly,nNz,nSx,nSy) + _RL field(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nNz,nSx,nSy) INTEGER iRec INTEGER myIter INTEGER myThid @@ -444,7 +439,6 @@ SUBROUTINE WRITE_REC_3D_RL( c CHARACTER*(MAX_LEN_FNAM) fullName CEOP - c IF (myIter.GE.0) THEN c IL=ILNBLNK( fName ) c WRITE(fullName,'(2a,i10.10)') fName(1:IL),'.',myIter @@ -490,7 +484,7 @@ SUBROUTINE WRITE_REC_LEV_RS( CHARACTER*(*) fName INTEGER fPrec INTEGER kSiz, kLo, kHi - _RS field(1-Olx:sNx+Olx,1-Oly:sNy+Oly,kSiz,nSx,nSy) + _RS field(1-OLx:sNx+OLx,1-OLy:sNy+OLy,kSiz,nSx,nSy) INTEGER iRec INTEGER myIter INTEGER myThid @@ -511,7 +505,6 @@ SUBROUTINE WRITE_REC_LEV_RS( c CHARACTER*(MAX_LEN_FNAM) fullName CEOP - c IF (myIter.GE.0) THEN c IL=ILNBLNK( fName ) c WRITE(fullName,'(2a,i10.10)') fName(1:IL),'.',myIter @@ -557,7 +550,7 @@ SUBROUTINE WRITE_REC_LEV_RL( CHARACTER*(*) fName INTEGER fPrec INTEGER kSiz, kLo, kHi - _RL field(1-Olx:sNx+Olx,1-Oly:sNy+Oly,kSiz,nSx,nSy) + _RL field(1-OLx:sNx+OLx,1-OLy:sNy+OLy,kSiz,nSx,nSy) INTEGER iRec INTEGER myIter INTEGER myThid @@ -578,7 +571,6 @@ SUBROUTINE WRITE_REC_LEV_RL( c CHARACTER*(MAX_LEN_FNAM) fullName CEOP - c IF (myIter.GE.0) THEN c IL=ILNBLNK( fName ) c WRITE(fullName,'(2a,i10.10)') fName(1:IL),'.',myIter @@ -622,7 +614,7 @@ SUBROUTINE WRITE_REC_XZ_RS( CHARACTER*(*) fName INTEGER fPrec INTEGER nNz - _RS field(1-Olx:sNx+Olx,nNz,nSx,nSy) + _RS field(1-OLx:sNx+OLx,nNz,nSx,nSy) INTEGER iRec INTEGER myIter INTEGER myThid @@ -655,7 +647,7 @@ SUBROUTINE WRITE_REC_XZ_RS( #ifdef ALLOW_MDSIO CALL MDS_WRITE_SEC_XZ( I fName, fPrec, globalFile, useCurrentDir, - I fType, nNz, + I fType, nNz, 1, nNz, I dummyRL, field, I iRec, myIter, myThid ) #endif @@ -688,7 +680,7 @@ SUBROUTINE WRITE_REC_XZ_RL( CHARACTER*(*) fName INTEGER fPrec INTEGER nNz - _RL field(1-Olx:sNx+Olx,nNz,nSx,nSy) + _RL field(1-OLx:sNx+OLx,nNz,nSx,nSy) INTEGER iRec INTEGER myIter INTEGER myThid @@ -721,7 +713,7 @@ SUBROUTINE WRITE_REC_XZ_RL( #ifdef ALLOW_MDSIO CALL MDS_WRITE_SEC_XZ( I fName, fPrec, globalFile, useCurrentDir, - I fType, nNz, + I fType, nNz, 1, nNz, I field, dummyRS, I iRec, myIter, myThid ) #endif @@ -754,7 +746,7 @@ SUBROUTINE WRITE_REC_YZ_RS( CHARACTER*(*) fName INTEGER fPrec INTEGER nNz - _RS field(1-Oly:sNy+Oly,nNz,nSx,nSy) + _RS field(1-OLy:sNy+OLy,nNz,nSx,nSy) INTEGER iRec INTEGER myIter INTEGER myThid @@ -775,7 +767,6 @@ SUBROUTINE WRITE_REC_YZ_RS( c CHARACTER*(MAX_LEN_FNAM) fullName CEOP - c IF (myIter.GE.0) THEN c IL=ILNBLNK( fName ) c WRITE(fullName,'(2a,i10.10)') fName(1:IL),'.',myIter @@ -788,7 +779,7 @@ SUBROUTINE WRITE_REC_YZ_RS( #ifdef ALLOW_MDSIO CALL MDS_WRITE_SEC_YZ( I fName, fPrec, globalFile, useCurrentDir, - I fType, nNz, + I fType, nNz, 1, nNz, I dummyRL, field, I iRec, myIter, myThid ) #endif @@ -821,7 +812,7 @@ SUBROUTINE WRITE_REC_YZ_RL( CHARACTER*(*) fName INTEGER fPrec INTEGER nNz - _RL field(1-Oly:sNy+Oly,nNz,nSx,nSy) + _RL field(1-OLy:sNy+OLy,nNz,nSx,nSy) INTEGER iRec INTEGER myIter INTEGER myThid @@ -842,7 +833,6 @@ SUBROUTINE WRITE_REC_YZ_RL( c CHARACTER*(MAX_LEN_FNAM) fullName CEOP - c IF (myIter.GE.0) THEN c IL=ILNBLNK( fName ) c WRITE(fullName,'(2a,i10.10)') fName(1:IL),'.',myIter @@ -855,7 +845,7 @@ SUBROUTINE WRITE_REC_YZ_RL( #ifdef ALLOW_MDSIO CALL MDS_WRITE_SEC_YZ( I fName, fPrec, globalFile, useCurrentDir, - I fType, nNz, + I fType, nNz, 1, nNz, I field, dummyRS, I iRec, myIter, myThid ) #endif diff --git a/pkg/salt_plume/salt_plume_ad_check_lev2_dir.h b/pkg/salt_plume/salt_plume_ad_check_lev2_dir.h index 34b0863f27..28c420ae2c 100644 --- a/pkg/salt_plume/salt_plume_ad_check_lev2_dir.h +++ b/pkg/salt_plume/salt_plume_ad_check_lev2_dir.h @@ -1,2 +1 @@ -CADJ STORE saltplumeflux = tapelev2, key = ilev_2 - +cCADJ STORE saltplumeflux = tapelev2, key = ilev_2 diff --git a/pkg/salt_plume/salt_plume_ad_check_lev3_dir.h b/pkg/salt_plume/salt_plume_ad_check_lev3_dir.h index 196e46f5db..a7931ad721 100644 --- a/pkg/salt_plume/salt_plume_ad_check_lev3_dir.h +++ b/pkg/salt_plume/salt_plume_ad_check_lev3_dir.h @@ -1,2 +1 @@ -CADJ STORE saltplumeflux = tapelev3, key = ilev_3 - +cCADJ STORE saltplumeflux = tapelev3, key = ilev_3 diff --git a/pkg/salt_plume/salt_plume_ad_check_lev4_dir.h b/pkg/salt_plume/salt_plume_ad_check_lev4_dir.h index a66c2860c2..35546fc77f 100644 --- a/pkg/salt_plume/salt_plume_ad_check_lev4_dir.h +++ b/pkg/salt_plume/salt_plume_ad_check_lev4_dir.h @@ -1,2 +1 @@ -CADJ STORE saltplumeflux = tapelev4, key = ilev_4 - +cCADJ STORE saltplumeflux = tapelev4, key = ilev_4 diff --git a/pkg/salt_plume/salt_plume_calc_depth.F b/pkg/salt_plume/salt_plume_calc_depth.F index 2616e31b5c..cd91b62939 100644 --- a/pkg/salt_plume/salt_plume_calc_depth.F +++ b/pkg/salt_plume/salt_plume_calc_depth.F @@ -76,6 +76,10 @@ SUBROUTINE SALT_PLUME_CALC_DEPTH( ENDDO ENDDO +#ifdef ALLOW_AUTODIFF_TAMC +C suppress a warning +CADJ INCOMPLETE SaltPlumeDepth(:,:,bi,bj), SPIND +#endif C CriterionType 1 = use delta_rho to determine salt plume depth IF (CriterionType.EQ.1) THEN diff --git a/pkg/seaice/SEAICE.h b/pkg/seaice/SEAICE.h index 79ef9b0616..1fa0ae6fe2 100644 --- a/pkg/seaice/SEAICE.h +++ b/pkg/seaice/SEAICE.h @@ -36,6 +36,13 @@ C SIMaskU/V :: land-sea mask at U/V-points (copies of maskW/S(k=kSrf)) _RL HEFFM (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) _RL SIMaskU (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) _RL SIMaskV (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) + +#if ( defined SEAICE_CGRID || defined SEAICE_BGRID_DYNAMICS ) + COMMON/ARRAYMETRIC/ k1AtC, k2AtC + _RS k1AtC (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) + _RS k2AtC (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) +#endif + #ifdef SEAICE_CGRID COMMON/ARRAYC/ seaiceMaskU, seaiceMaskV C dynamic masks (depend on area) @@ -43,32 +50,46 @@ C dynamic masks (depend on area) _RL seaiceMaskV(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) C k1/2AtZ :: coefficients at C and Z points C k1/2AtC for metric terms in U/V ice equations. - COMMON/ARRAYCMETRIC/ k1AtC, k1AtZ, k2AtC, k2AtZ - _RS k1AtC (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) + COMMON/ARRAYCMETRIC/ k1AtZ, k2AtZ _RS k1AtZ (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) - _RS k2AtC (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) _RS k2AtZ (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) -#else +#endif /* SEAICE_CGRID */ + +#ifdef SEAICE_BGRID_DYNAMICS C UVM :: B-grid velocity-point mask COMMON/ARRAYB/ UVM _RS UVM (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) C k1/2AtC/U/V :: coefficients at C, U, and V points C for metric terms in U/V ice equations. - COMMON/ARRAYBMETRIC/ - & k1AtC, k1AtU, k1AtV, k2AtC, k2AtU, k2AtV - _RS k1AtC (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) + COMMON/ARRAYBMETRIC/ k1AtU, k1AtV, k2AtU, k2AtV _RS k1AtU (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) _RS k1AtV (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) - _RS k2AtC (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) _RS k2AtU (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) _RS k2AtV (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) -#endif /* SEAICE_CGRID */ +#endif /* SEAICE_BGRID_DYNAMICS */ C-- Dynamical variables - COMMON/SEAICE_DYNVARS_1/AREA,HEFF,HSNOW,UICE,VICE + COMMON/SEAICE_DYNVARS_1/ + & AREA, HEFF, HSNOW, UICE, VICE + _RL AREA (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) + _RL HEFF (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) + _RL HSNOW (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) + _RL UICE (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) + _RL VICE (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) +C DWATN :: (linear) ice-ocean drag coefficient +C ( units of [rho|u|] = kg/m^2/s ) +C u/vIceNm1 :: sea ice drift velocities of previous timestep (m/s) + COMMON/SEAICE_DYNVARS_2/ + & DWATN, + & uIceNm1, vIceNm1 + _RL DWATN (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) + _RL uIceNm1 (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) + _RL vIceNm1 (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) + #ifdef SEAICE_ITD - & ,AREAITD,HEFFITD,HSNOWITD, - & opnWtrFrac, fw2ObyRidge + COMMON/SEAICE_DYNVARS_ITD/ + & AREAITD, HEFFITD, HSNOWITD, + & opnWtrFrac, fw2ObyRidge C Fields for dynamic ice thickness distribution (ITD) C AREAITD :: area classes C HEFFITD :: ice thickenss classes (in meters) @@ -82,12 +103,28 @@ C ocean during ridging _RL opnWtrFrac (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) _RL fw2ObyRidge(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) #endif /* SEAICE_ITD */ - _RL AREA (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) - _RL HEFF (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) - _RL HSNOW (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) - _RL UICE (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) - _RL VICE (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) +#ifdef SEAICE_CGRID +C stressDivergenceX/Y :: div of (vert. integr.) stress tensor (N/m^2) + COMMON /SEAICE_STRESSDIV/ + & stressDivergenceX, stressDivergenceY + _RL stressDivergenceX(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) + _RL stressDivergenceY(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) +# ifdef SEAICE_ALLOW_EVP +C-- Additional fields needed by the EVP solver: +C (vertically integrated) stress tensor, with diagonal terms sigma11/22 +C seaice_sigma1 :: sigma11+sigma22, defined at C-points (N/m) +C seaice_sigma2 :: sigma11-sigma22, defined at C-points (N/m) +C seaice_sigma12 :: off-diagonal term, defined at Z-points (N/m) + COMMON /SEAICE_EVP_FIELDS/ + & seaice_sigma1, seaice_sigma2, seaice_sigma12 + _RL seaice_sigma1 (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) + _RL seaice_sigma2 (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) + _RL seaice_sigma12 (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) +# endif /* SEAICE_ALLOW_EVP */ +#endif + +#if ( defined SEAICE_CGRID || defined SEAICE_BGRID_DYNAMICS ) C ETA, etaZ :: shear viscosity as C-points, at Z-points (N s/m = kg/s) C ZETA, zetaA :: bulk viscosity at C-points, at Z-points C PRESS :: maximum vertically integrated ice strength/pressure (N/m) @@ -96,46 +133,39 @@ C deltaC :: deformation rate tensor invariant, for VP sea ice C = sqrt( (e11+e22)**2 + (1/e)*(e11-e22)**2 + 4*e12**2) ) C FORCEX/Y :: momentum forcing C ( units of [rho * h * u / deltaT] = kg/m/s^2 ) -C u/vIceNm1 :: sea ice drift velocities of previous timestep (m/s) +C tensileStrFac :: factor k to compute the maximal tensile stress k*PRESS0 COMMON/SEAICE_DYNVARS_3/ - & ETA,etaZ,ZETA,zetaZ,PRESS, e11, e22, e12, deltaC, - & FORCEX,FORCEY, - & uIceNm1, vIceNm1 + & ETA, etaZ, ZETA, zetaZ, PRESS, tensileStrFac, + & e11, e22, e12, deltaC, + & FORCEX,FORCEY + _RL ETA (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) _RL etaZ (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) _RL ZETA (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) _RL zetaZ (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) C ice strength/pressure term _RL PRESS (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) + _RL tensileStrFac(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) C strain rate tensor _RL e11 (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) _RL e22 (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) _RL e12 (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) -C deformation rate tensor invariant, for viscous plastic sea ice = -C sqrt[(e11**2+e22**2)*(1+1/e**2)+ 4./e**2*e12C**2 + 2*e11*e22*(1-1/e**2)) _RL deltaC (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) C _RL FORCEX (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) _RL FORCEY (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) - _RL uIceNm1 (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) - _RL vIceNm1 (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) -C DWATN :: (linear) ice-ocean drag coefficient -C ( units of [rho|u|] = kg/m^2/s ) C PRESS0 :: maximal compressive stress/strength (N/m) C FORCEX/Y0 :: external momentum forcing fields (part of FORCEX/Y) C SEAICE_zMax/zMin :: maximum/minimum bulk viscosities -C tensileStrFac :: factor k to compute the maximal tensile stress k*PRESS0 COMMON/SEAICE_DYNVARS_4/ - & DWATN, PRESS0, FORCEX0, FORCEY0, - & SEAICE_zMax, SEAICE_zMin, tensileStrFac - _RL DWATN (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) - _RL PRESS0 (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) - _RL FORCEX0 (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) - _RL FORCEY0 (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) - _RL SEAICE_zMax (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) - _RL SEAICE_zMin (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) - _RL tensileStrFac(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) + & PRESS0, FORCEX0, FORCEY0, SEAICE_zMax, SEAICE_zMin + _RL PRESS0 (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) + _RL FORCEX0 (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) + _RL FORCEY0 (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) + _RL SEAICE_zMax(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) + _RL SEAICE_zMin(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) +#endif #ifdef SEAICE_CGRID C seaiceMassC/U/V :: mass (ice+snow) at C/U/V-points ( kg/m^2 ) @@ -144,11 +174,6 @@ C seaiceMassC/U/V :: mass (ice+snow) at C/U/V-points ( kg/m^2 ) _RL seaiceMassC(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) _RL seaiceMassU(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) _RL seaiceMassV(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) -C stressDivergenceX/Y :: div of (vert. integr.) stress tensor (N/m^2) - COMMON /SEAICE_STRESSDIV/ - & stressDivergenceX, stressDivergenceY - _RL stressDivergenceX(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) - _RL stressDivergenceY(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) # ifdef SEAICE_ALLOW_FREEDRIFT C u/vice_fd :: free drift velocities (m/s) COMMON /SEAICE_FD_FIELDS/ @@ -157,26 +182,13 @@ C u/vice_fd :: free drift velocities (m/s) _RL vice_fd (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) # endif -# ifdef SEAICE_ALLOW_EVP -C-- Additional fields needed by the EVP solver: -C (vertically integrated) stress tensor, with diagonal terms sigma11/22 -C seaice_sigma1 :: sigma11+sigma22, defined at C-points (N/m) -C seaice_sigma2 :: sigma11-sigma22, defined at C-points (N/m) -C seaice_sigma12 :: off-diagonal term, defined at Z-points (N/m) - COMMON /SEAICE_EVP_FIELDS/ - & seaice_sigma1, seaice_sigma2, seaice_sigma12 - _RL seaice_sigma1 (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) - _RL seaice_sigma2 (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) - _RL seaice_sigma12 (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) -# endif /* SEAICE_ALLOW_EVP */ - # ifdef SEAICE_ALLOW_BOTTOMDRAG C CbobC :: (linear) bottom drag coefficient for basals stress param. COMMON/SEAICE_BOTTOMDRAG/ CbotC _RL CbotC (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) # endif /* SEAICE_ALLOW_BOTTOMDRAG */ -# if (defined SEAICE_ALLOW_JFNK) || (defined SEAICE_ALLOW_KRYLOV) +# if ( defined SEAICE_ALLOW_JFNK || defined SEAICE_ALLOW_KRYLOV ) C diagnostics for the JFNK and Krylov solver INTEGER totalNewtonIters INTEGER totalNewtonFails @@ -187,22 +199,26 @@ C diagnostics for the JFNK and Krylov solver & totalNewtonIters, totalNewtonFails, & totalKrylovIters, totalKrylovFails, & totalJFNKtimeSteps +C Scalar product used in FGMRES needs a metric INTEGER nVec PARAMETER ( nVec=2*sNx*sNy ) _RL scalarProductMetric( nVec, 1, nSx, nSy ) COMMON /SEAICE_KRYLOV_RL/ scalarProductMetric # endif /* SEAICE_ALLOW_JFNK or SEAICE_ALLOW_KRYLOV */ -#else /* ndef SEAICE_CGRID */ +#endif /* SEAICE_CGRID */ + +#ifdef SEAICE_BGRID_DYNAMICS C AMASS :: sea ice mass C DAIRN :: (linear) atmosphere-ice drag coefficient -C uIceC :: average of UICE between last two time steps -C vIceC :: average of VICE between last two time steps - COMMON/SEAICE_DYNVARS_BGRID/ AMASS, DAIRN, uIceC, vIceC +C u/vIceC has been renamed to u/vIceC to avoid conficts with C-grid code +C uIceB :: average of UICE between last two time steps +C vIceB :: average of VICE between last two time steps + COMMON/SEAICE_DYNVARS_BGRID/ AMASS, DAIRN, uIceB, vIceB _RL AMASS (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) _RL DAIRN (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) - _RL uIceC (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) - _RL vIceC (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) + _RL uIceB (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) + _RL vIceB (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) COMMON/WIND_STRESS_OCE/WINDX,WINDY C WINDX - zonal wind stress over water at C points @@ -218,7 +234,7 @@ C GWATX/Y :: geostrophic ocean velocities C-- KGEO Level used as a proxy for geostrophic velocity. COMMON/SEAICE_KGEO/KGEO INTEGER KGEO (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) -#endif /* SEAICE_CGRID */ +#endif /* SEAICE_BGRID_DYNAMICS */ COMMON/SEAICE_REG_NEG/d_HEFFbyNEG,d_HSNWbyNEG C The change of mean ice thickness due to out-of-bounds values following diff --git a/pkg/seaice/SEAICE_OPTIONS.h b/pkg/seaice/SEAICE_OPTIONS.h index 425e9afcff..b9f92251f8 100644 --- a/pkg/seaice/SEAICE_OPTIONS.h +++ b/pkg/seaice/SEAICE_OPTIONS.h @@ -79,10 +79,19 @@ C computed the "call diagnostics_fill" statement is commented out. # undef ALLOW_SITRACER_DEBUG_DIAG #endif /* ALLOW_SITRACER */ +C-- Allow sea-ice dynamic code. These options are provided so that, +C if turned off (#undef), to compile (and process with TAF) only the +C the thermodynamics component of the code. Note that, if needed, +C sea-ice dynamics can be turned off at runtime (SEAICEuseDYNAMICS=F). + C-- Historically, the seaice model was discretized on a B-Grid. This -C discretization should still work but it is not longer actively tested -C and supported. The following flag should always be set in order to use -C the operational C-grid discretization. +C discretization should still work but it is not longer actively +C tested and supported. Define this flag to compile it. It cannot be +C defined together with SEAICE_CGRID +#undef SEAICE_BGRID_DYNAMICS + +C-- The following flag should always be set in order to use C the +C-- operational C-grid discretization. #define SEAICE_CGRID #ifdef SEAICE_CGRID @@ -174,7 +183,9 @@ C Use parameterisation of grounding ice for a better representation C of fastice in shallow seas # undef SEAICE_ALLOW_BOTTOMDRAG -#else /* not SEAICE_CGRID, but old B-grid */ +#endif /* SEAICE_CGRID */ + +#ifdef SEAICE_BGRID_DYNAMICS C-- Options for the B-grid version only: C- By default for B-grid dynamics solver wind stress under sea-ice is @@ -192,7 +203,7 @@ C It is smoother and includes all metric terms, similar to C-grid solvers. C It is here for completeness, but its usefulness is unclear. # undef SEAICE_LSRBNEW -#endif /* SEAICE_CGRID */ +#endif /* SEAICE_BGRID_DYNAMICS */ C-- Some regularisations C- When set limit the Ice-Loading to mass of 1/5 of Surface ocean grid-box @@ -242,12 +253,6 @@ C- Do not compile growth/thermodynamics code (avoiding this code can C also be done by setting runtime parameter usePWthermodynamics=F) #undef DISABLE_SEAICE_GROWTH -C- Allow sea-ice dynamic code. This option is provided so that, -C if turned off (#undef), to compile (and process with TAF) only the -C the thermodynamics component of the code. Note that, if needed, -C sea-ice dynamics can be turned off at runtime (SEAICEuseDYNAMICS=F). -#define SEAICE_ALLOW_DYNAMICS - C- Do not compile/use seaice-related obcs code when using obcs. #undef DISABLE_SEAICE_OBCS diff --git a/pkg/seaice/dynsolver.F b/pkg/seaice/dynsolver.F index 0a4b92b5f5..49e12788f6 100644 --- a/pkg/seaice/dynsolver.F +++ b/pkg/seaice/dynsolver.F @@ -10,8 +10,8 @@ SUBROUTINE DYNSOLVER( myTime, myIter, myThid ) C *==========================================================* C | SUBROUTINE DYNSOLVER | -C | o Ice dynamics using LSR solver | -C | Zhang and Hibler, JGR, 102, 8691-8702, 1997 | +C | o B-grid version of ice dynamics using LSR solver | +C | Zhang and Hibler, JGR, 102, 8691-8702, 1997 | C *==========================================================* C *==========================================================* IMPLICIT NONE @@ -42,7 +42,7 @@ SUBROUTINE DYNSOLVER( myTime, myIter, myThid ) INTEGER myThid CEndOfInterface -#ifndef SEAICE_CGRID +#ifdef SEAICE_BGRID_DYNAMICS #ifdef EXPLICIT_SSH_SLOPE #include "SURFACE.h" @@ -233,8 +233,6 @@ SUBROUTINE DYNSOLVER( myTime, myIter, myThid ) ENDDO ENDDO -#ifdef SEAICE_ALLOW_DYNAMICS - IF ( SEAICEuseDYNAMICS ) THEN #ifdef ALLOW_AUTODIFF_TAMC @@ -255,8 +253,8 @@ SUBROUTINE DYNSOLVER( myTime, myIter, myThid ) DO i=1-OLx,sNx+OLx UICENM1(i,j,bi,bj)=UICE(i,j,bi,bj) VICENM1(i,j,bi,bj)=VICE(i,j,bi,bj) - UICEC(i,j,bi,bj)=UICE(i,j,bi,bj) - VICEC(i,j,bi,bj)=VICE(i,j,bi,bj) + UICEB(i,j,bi,bj)=UICE(i,j,bi,bj) + VICEB(i,j,bi,bj)=VICE(i,j,bi,bj) ENDDO ENDDO ENDDO @@ -276,8 +274,8 @@ SUBROUTINE DYNSOLVER( myTime, myIter, myThid ) DO i=1-OLx,sNx+OLx UICE(i,j,bi,bj)=HALF*(UICE(i,j,bi,bj)+UICENM1(i,j,bi,bj)) VICE(i,j,bi,bj)=HALF*(VICE(i,j,bi,bj)+VICENM1(i,j,bi,bj)) - UICEC(i,j,bi,bj)=UICE(i,j,bi,bj) - VICEC(i,j,bi,bj)=VICE(i,j,bi,bj) + UICEB(i,j,bi,bj)=UICE(i,j,bi,bj) + VICEB(i,j,bi,bj)=VICE(i,j,bi,bj) ENDDO ENDDO ENDDO @@ -289,7 +287,6 @@ SUBROUTINE DYNSOLVER( myTime, myIter, myThid ) cdm c$taf store uice,vice = comlev1, key=ikey_dynamics ENDIF -#endif /* SEAICE_ALLOW_DYNAMICS */ #ifdef ALLOW_DIAGNOSTICS IF ( useDiagnostics ) THEN @@ -302,7 +299,6 @@ SUBROUTINE DYNSOLVER( myTime, myIter, myThid ) C Calculate ocean surface stress CALL OSTRES ( COR_ICE, myThid ) -#ifdef SEAICE_ALLOW_DYNAMICS #ifdef SEAICE_ALLOW_CLIPVELS IF ( SEAICEuseDYNAMICS .AND. SEAICE_clipVelocities) THEN #ifdef ALLOW_AUTODIFF_TAMC @@ -347,8 +343,7 @@ SUBROUTINE DYNSOLVER( myTime, myIter, myThid ) ENDIF #endif /* SEAICE_ALLOW_CLIPVELS */ -#endif /* SEAICE_ALLOW_DYNAMICS */ -#endif /* NOT SEAICE_CGRID */ +#endif /* SEAICE_BGRID_DYNAMICS */ RETURN END diff --git a/pkg/seaice/lsr.F b/pkg/seaice/lsr.F index 886788f2ce..dbbee44679 100644 --- a/pkg/seaice/lsr.F +++ b/pkg/seaice/lsr.F @@ -40,8 +40,7 @@ SUBROUTINE lsr( ilcall, myThid ) INTEGER myThid CEndOfInterface -#ifndef SEAICE_CGRID -#ifdef SEAICE_ALLOW_DYNAMICS +#ifdef SEAICE_BGRID_DYNAMICS C === Local variables === C i,j,bi,bj - Loop counters @@ -168,30 +167,30 @@ SUBROUTINE lsr( ilcall, myThid ) DO j=1-OLy,sNy+OLy-1 DO i=1-OLx,sNx+OLx-1 ucLoc(I,J,bi,bj) = 0.25 _d 0 * ( - & + uIceC(I+1,J,bi,bj) + uIceC(I+1,J+1,bi,bj) - & + uIceC(I ,J,bi,bj) + uIceC(I, J+1,bi,bj) ) + & + uIceB(I+1,J,bi,bj) + uIceB(I+1,J+1,bi,bj) + & + uIceB(I ,J,bi,bj) + uIceB(I, J+1,bi,bj) ) vcLoc(I,J,bi,bj) = 0.25 _d 0 * ( - & + vIceC(I+1,J,bi,bj) + vIceC(I+1,J+1,bi,bj) - & + vIceC(I ,J,bi,bj) + vIceC(I, J+1,bi,bj) ) + & + vIceB(I+1,J,bi,bj) + vIceB(I+1,J+1,bi,bj) + & + vIceB(I ,J,bi,bj) + vIceB(I, J+1,bi,bj) ) ENDDO ENDDO DO J=1-OLy,sNy+OLy-1 DO I=1-OLy,sNx+OLy-1 e11loc = 0.5 _d 0 * _recip_dxF(I,J,bi,bj) * - & (uIceC(I+1,J+1,bi,bj)+uIceC(I+1,J,bi,bj) - & -uIceC(I, J+1,bi,bj)-uIceC(I, J,bi,bj)) + & (uIceB(I+1,J+1,bi,bj)+uIceB(I+1,J,bi,bj) + & -uIceB(I, J+1,bi,bj)-uIceB(I, J,bi,bj)) & + vcLoc(I,J,bi,bj) * k2AtC(I,J,bi,bj) e22loc = 0.5 _d 0 * _recip_dyF(I,J,bi,bj) * - & (vIceC(I+1,J+1,bi,bj)+vIceC(I,J+1,bi,bj) - & -vIceC(I+1,J, bi,bj)-vIceC(I,J, bi,bj)) + & (vIceB(I+1,J+1,bi,bj)+vIceB(I,J+1,bi,bj) + & -vIceB(I+1,J, bi,bj)-vIceB(I,J, bi,bj)) & + ucLoc(I,J,bi,bj) * k1AtC(I,J,bi,bj) e12loc = 0.5 _d 0*( & 0.5 _d 0 * _recip_dyF(I,J,bi,bj) * - & (uIceC(I+1,J+1,bi,bj)+uIceC(I,J+1,bi,bj) - & -uIceC(I+1,J, bi,bj)-uIceC(I,J, bi,bj)) + & (uIceB(I+1,J+1,bi,bj)+uIceB(I,J+1,bi,bj) + & -uIceB(I+1,J, bi,bj)-uIceB(I,J, bi,bj)) & + 0.5 _d 0 * _recip_dxF(I,J,bi,bj) * - & (vIceC(I+1,J+1,bi,bj)+vIceC(I+1,J,bi,bj) - & -vIceC(I, J+1,bi,bj)-vIceC(I, J,bi,bj)) + & (vIceB(I+1,J+1,bi,bj)+vIceB(I+1,J,bi,bj) + & -vIceB(I, J+1,bi,bj)-vIceB(I, J,bi,bj)) & - vcLoc(I,J,bi,bj)*k1AtC(I,J,bi,bj) & - ucLoc(I,J,bi,bj)*k2AtC(I,J,bi,bj) ) C NOW EVALUATE VISCOSITIES @@ -412,13 +411,13 @@ SUBROUTINE lsr( ilcall, myThid ) & * (vcLoc(I,J,bi,bj)-vcLoc(I,J-1,bi,bj)) & * _recip_dyC(I,J,bi,bj) & + (zetaV(I,J)+etaV(I,J))*k2atV(I,J,bi,bj) - & * 0.5 _d 0 * (vIceC(I,J,bi,bj)+vIceC(I+1,J,bi,bj)) + & * 0.5 _d 0 * (vIceB(I,J,bi,bj)+vIceB(I+1,J,bi,bj)) & - 0.5 _d 0 * (PRESS(I,J,bi,bj)+PRESS(I,J-1,bi,bj)) sig12(I,J) = etaV(I,J) & * (ucLoc(I,J,bi,bj)-ucLoc(I,J-1,bi,bj)) & * _recip_dyC(I,J,bi,bj) & - etaV(I,J) * k2AtV(I,J,bi,bj) - & * 0.5 _d 0 * (uIceC(I,J,bi,bj)+uIceC(I+1,J,bi,bj)) + & * 0.5 _d 0 * (uIceB(I,J,bi,bj)+uIceB(I+1,J,bi,bj)) ENDDO ENDDO DO j=0,sNy @@ -429,25 +428,25 @@ SUBROUTINE lsr( ilcall, myThid ) & * (ucLoc(I,J,bi,bj)-ucLoc(I-1,J,bi,bj)) & * _recip_dxC(I,J,bi,bj) & + (zetaU(I,J)+etaU(I,J))*k2atU(I,J,bi,bj) - & * 0.5 _d 0 * (uIceC(I,J,bi,bj)+uIceC(I,J+1,bi,bj)) + & * 0.5 _d 0 * (uIceB(I,J,bi,bj)+uIceB(I,J+1,bi,bj)) & - 0.5 _d 0 * (PRESS(I,J,bi,bj)+PRESS(I-1,J,bi,bj)) sig21(I,J) = etaU(I,J) & * (vcLoc(I,J,bi,bj)-vcLoc(I-1,J,bi,bj)) & * _recip_dxC(I,J,bi,bj) & - etaU(I,J) * k1AtU(I,J,bi,bj) - & * 0.5 _d 0 * (vIceC(I,J,bi,bj)+vIceC(I,J+1,bi,bj)) + & * 0.5 _d 0 * (vIceB(I,J,bi,bj)+vIceB(I,J+1,bi,bj)) ENDDO ENDDO DO j=1,sNy DO i=1,sNx - rhsU(I,J,bi,bj) = DRAGA(I,J,bi,bj)*vIceC(I,J,bi,bj) + rhsU(I,J,bi,bj) = DRAGA(I,J,bi,bj)*vIceB(I,J,bi,bj) & +FORCEX(I,J,bi,bj) & + ( _dyC(I, J, bi,bj) * sig11(I, J ) & - _dyC(I-1,J, bi,bj) * sig11(I-1,J ) & + _dxC(I, J, bi,bj) * sig21(I, J ) & - _dxC(I, J-1,bi,bj) * sig21(I, J-1) ) & * recip_rAz(I,J,bi,bj) * UVM(I,J,bi,bj) - rhsV(I,J,bi,bj) = - DRAGA(I,J,bi,bj)*uIceC(I,J,bi,bj) + rhsV(I,J,bi,bj) = - DRAGA(I,J,bi,bj)*uIceB(I,J,bi,bj) & +FORCEY(I,J,bi,bj) & + ( _dyC(I, J, bi,bj) * sig12(I, J ) & - _dyC(I-1,J, bi,bj) * sig12(I-1,J ) @@ -746,14 +745,14 @@ SUBROUTINE lsr( ilcall, myThid ) DO J=1-OLy,sNy+OLy-1 DO I=1-OLx,sNx+OLx-1 dVdy(I,J) = 0.5 _d 0 * ( - & ( VICEC(I+1,J+1,bi,bj) - VICEC(I+1,J ,bi,bj) ) + & ( vIceB(I+1,J+1,bi,bj) - vIceB(I+1,J ,bi,bj) ) & * _recip_dyG(I+1,J,bi,bj) - & +(VICEC(I ,J+1,bi,bj) - VICEC(I ,J ,bi,bj) ) + & +(vIceB(I ,J+1,bi,bj) - vIceB(I ,J ,bi,bj) ) & * _recip_dyG(I, J,bi,bj) ) dVdx(I,J) = 0.5 _d 0 * ( - & ( VICEC(I+1,J+1,bi,bj) - VICEC(I ,J+1,bi,bj) ) + & ( vIceB(I+1,J+1,bi,bj) - vIceB(I ,J+1,bi,bj) ) & * _recip_dxG(I,J+1,bi,bj) - & +(VICEC(I+1,J ,bi,bj) - VICEC(I ,J ,bi,bj) ) + & +(vIceB(I+1,J ,bi,bj) - vIceB(I ,J ,bi,bj) ) & * _recip_dxG(I,J, bi,bj) ) ENDDO ENDDO @@ -761,15 +760,15 @@ SUBROUTINE lsr( ilcall, myThid ) DO j=1-OLy,sNy+OLy-1 DO i=1-OLx,sNx+OLx-1 vz(i,j) = quart * ( - & vicec(i,j,bi,bj) + vicec(i+1,j,bi,bj) ) + & vIceB(i,j,bi,bj) + vIceB(i+1,j,bi,bj) ) vz(i,j)= vz(i,j) + quart * ( - & vicec(i,j+1,bi,bj) + vicec(i+1,j+1,bi,bj) ) + & vIceB(i,j+1,bi,bj) + vIceB(i+1,j+1,bi,bj) ) ENDDO ENDDO #endif DO J=1,sNy DO I=1,sNx - rhsU(I,J,bi,bj)=DRAGA(I,J,bi,bj)*VICEC(I,J,bi,bj) + rhsU(I,J,bi,bj)=DRAGA(I,J,bi,bj)*vIceB(I,J,bi,bj) & +FORCEX(I,J,bi,bj) #ifdef SEAICE_TEST & + ( 0.5 _d 0 * @@ -795,18 +794,18 @@ SUBROUTINE lsr( ilcall, myThid ) & & -(etaPlusZeta(I ,J ,bi,bj)+etaPlusZeta(I ,J-1,bi,bj) & -etaPlusZeta(I-1,J-1,bi,bj)-etaPlusZeta(I-1,J ,bi,bj)) - & * VICEC(I,J,bi,bj) + & * vIceB(I,J,bi,bj) & * _tanPhiAtV(I,J,bi,bj) & * 0.5 _d 0 * _recip_dxV(I,J,bi,bj)*recip_rSphere & & -(ETAMEAN(I,J,bi,bj)+ZETAMEAN(I,J,bi,bj)) - & *(VICEC(I+1,J,bi,bj) - VICEC(I-1,J,bi,bj)) + & *(vIceB(I+1,J,bi,bj) - vIceB(I-1,J,bi,bj)) & * _tanPhiAtV(I,J,bi,bj) & * 1.0 _d 0 /( _dxG(I,J,bi,bj) + _dxG(I-1,J,bi,bj) ) & *recip_rSphere & & -ETAMEAN(I,J,bi,bj) - & *(VICEC(I+1,J,bi,bj) - VICEC(I-1,J,bi,bj)) + & *(vIceB(I+1,J,bi,bj) - vIceB(I-1,J,bi,bj)) & *TWO* _tanPhiAtV(I,J,bi,bj) & * 1.0 _d 0 /( _dxG(I,J,bi,bj) + _dxG(I-1,J,bi,bj) ) & *recip_rSphere @@ -989,14 +988,14 @@ SUBROUTINE lsr( ilcall, myThid ) DO J=1-OLy,sNy+OLy-1 DO I=1-OLx,sNx+OLx-1 dUdx(I,J) = 0.5 _d 0 * ( - & ( UICEC(I+1,J+1,bi,bj) - UICEC(I ,J+1,bi,bj) ) + & ( uIceB(I+1,J+1,bi,bj) - uIceB(I ,J+1,bi,bj) ) & * _recip_dxG(I,J+1,bi,bj) - & +(UICEC(I+1,J ,bi,bj) - UICEC(I ,J ,bi,bj) ) + & +(uIceB(I+1,J ,bi,bj) - uIceB(I ,J ,bi,bj) ) & * _recip_dxG(I,J ,bi,bj) ) dUdy(I,J) = 0.5 _d 0 * ( - & ( UICEC(I+1,J+1,bi,bj) - UICEC(I+1,J ,bi,bj) ) + & ( uIceB(I+1,J+1,bi,bj) - uIceB(I+1,J ,bi,bj) ) & * _recip_dyG(I+1,J,bi,bj) - & +(UICEC(I ,J+1,bi,bj) - UICEC(I ,J ,bi,bj) ) + & +(uIceB(I ,J+1,bi,bj) - uIceB(I ,J ,bi,bj) ) & * _recip_dyG(I, J,bi,bj) ) ENDDO ENDDO @@ -1004,15 +1003,15 @@ SUBROUTINE lsr( ilcall, myThid ) DO j=1-OLy,sNy+OLy-1 DO i=1-OLx,sNx+OLx-1 uz(i,j) = quart * ( - & uicec(i,j,bi,bj) + uicec(i+1,j,bi,bj) ) + & uIceB(i,j,bi,bj) + uIceB(i+1,j,bi,bj) ) uz(i,j)= uz(i,j) + quart * ( - & uicec(i,j+1,bi,bj) + uicec(i+1,j+1,bi,bj) ) + & uIceB(i,j+1,bi,bj) + uIceB(i+1,j+1,bi,bj) ) ENDDO ENDDO #endif DO J=1,sNy DO I=1,sNx - rhsV(I,J,bi,bj)=-DRAGA(I,J,bi,bj)*UICEC(I,J,bi,bj) + rhsV(I,J,bi,bj)=-DRAGA(I,J,bi,bj)*uIceB(I,J,bi,bj) & +FORCEY(I,J,bi,bj) & #ifdef SEAICE_TEST @@ -1039,15 +1038,15 @@ SUBROUTINE lsr( ilcall, myThid ) & & +(ETA(I ,J ,bi,bj) + ETA(I ,J-1,bi,bj) & -ETA(I-1,J-1,bi,bj) - ETA(I-1,J ,bi,bj)) - & * UICEC(I,J,bi,bj) + & * uIceB(I,J,bi,bj) & * _tanPhiAtV(I,J,bi,bj) & * 0.5 _d 0 * _recip_dxV(I,J,bi,bj)*recip_rSphere & +ETAMEAN(I,J,bi,bj) * _tanPhiAtV(I,J,bi,bj) - & *(UICEC(I+1,J,bi,bj)-UICEC(I-1,J,bi,bj)) + & *(uIceB(I+1,J,bi,bj)-uIceB(I-1,J,bi,bj)) & * 0.5 _d 0 * _recip_dxV(I,J,bi,bj)*recip_rSphere & & +ETAMEAN(I,J,bi,bj)*TWO * _tanPhiAtV(I,J,bi,bj) - & *(UICEC(I+1,J,bi,bj)-UICEC(I-1,J,bi,bj)) + & *(uIceB(I+1,J,bi,bj)-uIceB(I-1,J,bi,bj)) & * 1. _d 0 /( _dxG(I,J,bi,bj) + _dxG(I-1,J,bi,bj)) & *recip_rSphere VRT1(I,J,bi,bj)= 0.5 _d 0 * ( @@ -1197,8 +1196,7 @@ SUBROUTINE lsr( ilcall, myThid ) ENDDO ENDDO -#endif /* SEAICE_ALLOW_DYNAMICS */ -#endif /* SEAICE_CGRID */ +#endif /* SEAICE_BGRID_DYNAMICS */ RETURN END diff --git a/pkg/seaice/ostres.F b/pkg/seaice/ostres.F index e9f012c3fb..3692635e55 100644 --- a/pkg/seaice/ostres.F +++ b/pkg/seaice/ostres.F @@ -23,15 +23,15 @@ SUBROUTINE ostres( COR_ICE, myThid ) INTEGER myThid CEndOfInterface -#ifndef SEAICE_CGRID +#ifdef SEAICE_BGRID_DYNAMICS C === Local variables === C i,j,bi,bj - Loop counters INTEGER i, j, bi, bj _RL SINWIN, COSWIN, SINWAT, COSWAT -#ifdef SEAICE_BICE_STRESS +# ifdef SEAICE_BICE_STRESS _RL fuIce, fvIce -#endif +# endif c introduce turning angle (default is zero) SINWIN=SIN(SEAICE_airTurnAngle*deg2rad) @@ -42,7 +42,7 @@ SUBROUTINE ostres( COR_ICE, myThid ) C-- Update overlap regions CALL EXCH_UV_XY_RL(WINDX, WINDY, .TRUE., myThid) -#ifndef SEAICE_EXTERNAL_FLUXES +# ifndef SEAICE_EXTERNAL_FLUXES C-- Interpolate wind stress (N/m^2) from South-West B-grid C to South-West C-grid for forcing ocean model. DO bj=myByLo(myThid),myByHi(myThid) @@ -58,9 +58,9 @@ SUBROUTINE ostres( COR_ICE, myThid ) ENDDO ENDDO CALL EXCH_UV_XY_RS(fu, fv, .TRUE., myThid) -#endif /* ifndef SEAICE_EXTERNAL_FLUXES */ +# endif /* ifndef SEAICE_EXTERNAL_FLUXES */ -#ifdef SEAICE_BICE_STRESS +# ifdef SEAICE_BICE_STRESS C-- Compute ice-affected wind stress DO bj=myByLo(myThid),myByHi(myThid) DO bi=myBxLo(myThid),myBxHi(myThid) @@ -91,8 +91,8 @@ SUBROUTINE ostres( COR_ICE, myThid ) ENDDO ENDDO CALL EXCH_UV_XY_RS(fu, fv, .TRUE., myThid) -#endif /* SEAICE_BICE_STRESS */ -#endif /* not SEAICE_CGRID */ +# endif /* SEAICE_BICE_STRESS */ +#endif /* SEAICE_BCGRID_DYNAMICS */ RETURN END diff --git a/pkg/seaice/seaice_ad_check_lev1_dir.h b/pkg/seaice/seaice_ad_check_lev1_dir.h index 9dc3a8f78f..ce280d1192 100644 --- a/pkg/seaice/seaice_ad_check_lev1_dir.h +++ b/pkg/seaice/seaice_ad_check_lev1_dir.h @@ -16,7 +16,7 @@ CADJ STORE salt = comlev1, key=ikey_dynamics, kind=isbyte CADJ STORE totphihyd = comlev1, key=ikey_dynamics, kind=isbyte cphCADJ STORE runoff = comlev1, key=ikey_dynamics, kind=isbyte -# ifdef SEAICE_ALLOW_DYNAMICS +# ifdef SEAICE_CGRID cphCADJ STORE zeta = comlev1, key=ikey_dynamics, kind=isbyte cphCADJ STORE eta = comlev1, key=ikey_dynamics, kind=isbyte # endif @@ -25,17 +25,13 @@ cphCADJ STORE eta = comlev1, key=ikey_dynamics, kind=isbyte #ifdef SEAICE_CGRID CADJ STORE stressdivergencex = comlev1, key=ikey_dynamics, kind=isbyte CADJ STORE stressdivergencey = comlev1, key=ikey_dynamics, kind=isbyte -#endif -#ifdef SEAICE_ALLOW_DYNAMICS -# ifdef SEAICE_CGRID CADJ STORE etan = comlev1, key=ikey_dynamics, kind=isbyte CADJ STORE dwatn = comlev1, key=ikey_dynamics, kind=isbyte -# ifdef SEAICE_ALLOW_BOTTOMDRAG +# ifdef SEAICE_ALLOW_BOTTOMDRAG CADJ STORE cbotc = comlev1, key=ikey_dynamics, kind=isbyte -# endif +# endif CADJ STORE seaicemasku = comlev1, key=ikey_dynamics, kind=isbyte CADJ STORE seaicemaskv = comlev1, key=ikey_dynamics, kind=isbyte -# endif # ifdef SEAICE_ALLOW_EVP CADJ STORE seaice_sigma1 = comlev1, key=ikey_dynamics, kind=isbyte CADJ STORE seaice_sigma2 = comlev1, key=ikey_dynamics, kind=isbyte diff --git a/pkg/seaice/seaice_ad_check_lev2_dir.h b/pkg/seaice/seaice_ad_check_lev2_dir.h index 8b7c03b319..107de2e625 100644 --- a/pkg/seaice/seaice_ad_check_lev2_dir.h +++ b/pkg/seaice/seaice_ad_check_lev2_dir.h @@ -10,24 +10,18 @@ CADJ STORE vice = tapelev2, key = ilev_2 CADJ STORE AREA = tapelev2, key = ilev_2 CADJ STORE HEFF = tapelev2, key = ilev_2 CADJ STORE HSNOW = tapelev2, key = ilev_2 -CADJ STORE RUNOFF = tapelev2, key = ilev_2 CADJ STORE UICE = tapelev2, key = ilev_2 CADJ STORE VICE = tapelev2, key = ilev_2 -CADJ STORE ZETA = tapelev2, key = ilev_2 -CADJ STORE ETA = tapelev2, key = ilev_2 CADJ STORE TICES = tapelev2, key = ilev_2 # ifdef SEAICE_CGRID CADJ STORE dwatn = tapelev2, key = ilev_2 -# ifdef SEAICE_ALLOW_BOTTOMDRAG -CADJ STORE cbotc = tapelev2, key = ilev_2 -# endif /* SEAICE_ALLOW_BOTTOMDRAG */ CADJ STORE stressDivergenceX = tapelev2, key = ilev_2 CADJ STORE stressDivergenceY = tapelev2, key = ilev_2 -# ifdef SEAICE_ALLOW_EVP +# ifdef SEAICE_ALLOW_EVP CADJ STORE seaice_sigma1 = tapelev2, key = ilev_2 CADJ STORE seaice_sigma2 = tapelev2, key = ilev_2 CADJ STORE seaice_sigma12 = tapelev2, key = ilev_2 -# endif /* SEAICE_ALLOW_EVP */ +# endif /* SEAICE_ALLOW_EVP */ # endif /* SEAICE_CGRID */ # ifdef SEAICE_VARIABLE_SALINITY CADJ STORE HSALT = tapelev2, key = ilev_2 diff --git a/pkg/seaice/seaice_ad_check_lev3_dir.h b/pkg/seaice/seaice_ad_check_lev3_dir.h index ea4ff789de..aed2dcc9d0 100644 --- a/pkg/seaice/seaice_ad_check_lev3_dir.h +++ b/pkg/seaice/seaice_ad_check_lev3_dir.h @@ -10,24 +10,18 @@ CADJ STORE vice = tapelev3, key = ilev_3 CADJ STORE AREA = tapelev3, key = ilev_3 CADJ STORE HEFF = tapelev3, key = ilev_3 CADJ STORE HSNOW = tapelev3, key = ilev_3 -CADJ STORE RUNOFF = tapelev3, key = ilev_3 CADJ STORE UICE = tapelev3, key = ilev_3 CADJ STORE VICE = tapelev3, key = ilev_3 -CADJ STORE ZETA = tapelev3, key = ilev_3 -CADJ STORE ETA = tapelev3, key = ilev_3 CADJ STORE TICES = tapelev3, key = ilev_3 # ifdef SEAICE_CGRID CADJ STORE dwatn = tapelev3, key = ilev_3 -# ifdef SEAICE_ALLOW_BOTTOMDRAG -CADJ STORE cbotc = tapelev3, key = ilev_3 -# endif /* SEAICE_ALLOW_BOTTOMDRAG */ CADJ STORE stressDivergenceX = tapelev3, key = ilev_3 CADJ STORE stressDivergenceY = tapelev3, key = ilev_3 -# ifdef SEAICE_ALLOW_EVP +# ifdef SEAICE_ALLOW_EVP CADJ STORE seaice_sigma1 = tapelev3, key = ilev_3 CADJ STORE seaice_sigma2 = tapelev3, key = ilev_3 CADJ STORE seaice_sigma12 = tapelev3, key = ilev_3 -# endif /* SEAICE_ALLOW_EVP */ +# endif /* SEAICE_ALLOW_EVP */ # endif /* SEAICE_CGRID */ # ifdef SEAICE_VARIABLE_SALINITY CADJ STORE HSALT = tapelev3, key = ilev_3 @@ -36,11 +30,11 @@ CADJ STORE HSALT = tapelev3, key = ilev_3 #ifdef ALLOW_COST_ICE CADJ STORE objf_ice = tapelev3, key = ilev_3 -#endif # ifdef ALLOW_SEAICE_COST_EXPORT CADJ STORE uHeffExportCell = tapelev3, key = ilev_3 CADJ STORE vHeffExportCell = tapelev3, key = ilev_3 # endif +#endif #ifdef ALLOW_OBCS # ifdef ALLOW_OBCS_EAST diff --git a/pkg/seaice/seaice_ad_check_lev4_dir.h b/pkg/seaice/seaice_ad_check_lev4_dir.h index 55cd8a8fdb..e603ef5528 100644 --- a/pkg/seaice/seaice_ad_check_lev4_dir.h +++ b/pkg/seaice/seaice_ad_check_lev4_dir.h @@ -10,24 +10,18 @@ CADJ STORE vice = tapelev4, key = ilev_4 CADJ STORE AREA = tapelev4, key = ilev_4 CADJ STORE HEFF = tapelev4, key = ilev_4 CADJ STORE HSNOW = tapelev4, key = ilev_4 -CADJ STORE RUNOFF = tapelev4, key = ilev_4 CADJ STORE UICE = tapelev4, key = ilev_4 CADJ STORE VICE = tapelev4, key = ilev_4 -CADJ STORE ZETA = tapelev4, key = ilev_4 -CADJ STORE ETA = tapelev4, key = ilev_4 CADJ STORE TICES = tapelev4, key = ilev_4 # ifdef SEAICE_CGRID CADJ STORE dwatn = tapelev4, key = ilev_4 -# ifdef SEAICE_ALLOW_BOTTOMDRAG -CADJ STORE cbotc = tapelev4, key = ilev_4 -# endif /* SEAICE_ALLOW_BOTTOMDRAG */ CADJ STORE stressDivergenceX = tapelev4, key = ilev_4 CADJ STORE stressDivergenceY = tapelev4, key = ilev_4 -# ifdef SEAICE_ALLOW_EVP +# ifdef SEAICE_ALLOW_EVP CADJ STORE seaice_sigma1 = tapelev4, key = ilev_4 CADJ STORE seaice_sigma2 = tapelev4, key = ilev_4 CADJ STORE seaice_sigma12 = tapelev4, key = ilev_4 -# endif /* SEAICE_ALLOW_EVP */ +# endif /* SEAICE_ALLOW_EVP */ # endif /* SEAICE_CGRID */ # ifdef SEAICE_VARIABLE_SALINITY CADJ STORE HSALT = tapelev4, key = ilev_4 diff --git a/pkg/seaice/seaice_ad_dump.F b/pkg/seaice/seaice_ad_dump.F index 92be4bceae..610c17a354 100644 --- a/pkg/seaice/seaice_ad_dump.F +++ b/pkg/seaice/seaice_ad_dump.F @@ -140,14 +140,14 @@ SUBROUTINE SEAICE_AD_DUMP( myTime, myIter, myThid ) & 12, doDump, dumpAdRecSi, myTime, myIter, myThid ) CALL DUMP_ADJ_XY( dumRS, adhsnow, 'ADJhsnow', 'ADJhsnow.', & 12, doDump, dumpAdRecSi, myTime, myIter, myThid ) -# ifdef SEAICE_ALLOW_DYNAMICS +# if ( defined SEAICE_CGRID || defined SEAICE_BGRID_DYNAMICS ) C IF (SEAICEuseDYNAMICS) THEN CALL DUMP_ADJ_XY_UV( & dumRS, aduice, 'ADJuice ', 'ADJuice.', & dumRS, advice, 'ADJvice ', 'ADJvice.', & 34, doDump, dumpAdRecSi, myTime, myIter, myThid) C ENDIF -# endif /* SEAICE_ALLOW_DYNAMICS */ +# endif IF ( doDump ) THEN #ifdef ALLOW_MNC @@ -170,7 +170,7 @@ SUBROUTINE SEAICE_AD_DUMP( myTime, myIter, myThid ) CALL COPY_ADVAR_OUTP( dumRS, adhsnow, var2Du, 1 , 12, myThid ) CALL MNC_CW_RL_W('D','adseaice',0,0,'adhsnow', & var2Du, myThid) -# ifdef SEAICE_ALLOW_DYNAMICS +# if ( defined SEAICE_CGRID || defined SEAICE_BGRID_DYNAMICS ) C IF (SEAICEuseDYNAMICS) THEN CALL COPY_AD_UV_OUTP( dumRS, dumRS, aduice, advice, & var2Du, var2Dv, 1, 34, myThid ) @@ -187,7 +187,7 @@ SUBROUTINE SEAICE_AD_DUMP( myTime, myIter, myThid ) & adheff, myThid) CALL MNC_CW_RL_W('D','adseaice',0,0,'adhsnow', & adhsnow, myThid) -# ifdef SEAICE_ALLOW_DYNAMICS +# if ( defined SEAICE_CGRID || defined SEAICE_BGRID_DYNAMICS ) C IF (SEAICEuseDYNAMICS) THEN CALL MNC_CW_RL_W('D','adseaice',0,0,'aduice', & aduice, myThid) diff --git a/pkg/seaice/seaice_advdiff.F b/pkg/seaice/seaice_advdiff.F index e9a6987551..55b5b6188f 100644 --- a/pkg/seaice/seaice_advdiff.F +++ b/pkg/seaice/seaice_advdiff.F @@ -90,39 +90,41 @@ SUBROUTINE SEAICE_ADVDIFF( _RS xA (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) _RS yA (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) _RL recip_heff(1-OLx:sNx+OLx,1-OLy:sNy+OLy) +#if ( defined SEAICE_ITD || !defined ALLOW_GENERIC_ADVDIFF ) CHARACTER*(MAX_LEN_MBUF) msgBuf +#endif CEOP C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| -C-- make a local copy of the velocities for compatibility with B-grid -C-- alternatively interpolate to C-points if necessary +C-- compute cell areas used by all tracers DO bj=myByLo(myThid),myByHi(myThid) DO bi=myBxLo(myThid),myBxHi(myThid) -#ifndef SEAICE_CGRID /* not SEAICE_CGRID = BGRID */ + DO j=1-OLy,sNy+OLy + DO i=1-OLx,sNx+OLx + xA(i,j,bi,bj) = _dyG(i,j,bi,bj)*SIMaskU(i,j,bi,bj) + yA(i,j,bi,bj) = _dxG(i,j,bi,bj)*SIMaskV(i,j,bi,bj) + ENDDO + ENDDO + ENDDO + ENDDO + +#ifdef SEAICE_BGRID_DYNAMICS C-- hack to ensure backward compatibility: C average B-grid seaice velocity to C-grid + DO bj=myByLo(myThid),myByHi(myThid) + DO bi=myBxLo(myThid),myBxHi(myThid) DO j=1-OLy,sNy+OLy-1 DO i=1-OLx,sNx+OLx-1 uc(i,j,bi,bj)=.5 _d 0*(UICE(i,j,bi,bj)+UICE(i,j+1,bi,bj)) vc(i,j,bi,bj)=.5 _d 0*(VICE(i,j,bi,bj)+VICE(i+1,j,bi,bj)) ENDDO ENDDO -#endif /* SEAICE_CGRID */ -C- compute cell areas used by all tracers - DO j=1-OLy,sNy+OLy - DO i=1-OLx,sNx+OLx - xA(i,j,bi,bj) = _dyG(i,j,bi,bj)*SIMaskU(i,j,bi,bj) - yA(i,j,bi,bj) = _dxG(i,j,bi,bj)*SIMaskV(i,j,bi,bj) - ENDDO - ENDDO ENDDO ENDDO - -#ifndef SEAICE_CGRID C Do we need this? I am afraid so. CALL EXCH_UV_XY_RL(uc,vc,.TRUE.,myThid) -#endif /* not SEAICE_CGRID */ +#endif #ifdef ALLOW_AUTODIFF_TAMC CADJ STORE uc = comlev1, key = ikey_dynamics, kind=isbyte diff --git a/pkg/seaice/seaice_calc_ice_strength.F b/pkg/seaice/seaice_calc_ice_strength.F index e05918ae6b..2d8bba7ec2 100644 --- a/pkg/seaice/seaice_calc_ice_strength.F +++ b/pkg/seaice/seaice_calc_ice_strength.F @@ -45,6 +45,7 @@ SUBROUTINE SEAICE_CALC_ICE_STRENGTH( INTEGER myThid CEOP +#if ( defined SEAICE_CGRID || defined SEAICE_BGRID_DYNAMICS ) C !LOCAL VARIABLES: ==================================================== C === Local variables === C i,j,k :: inner loop counters @@ -192,6 +193,7 @@ SUBROUTINE SEAICE_CALC_ICE_STRENGTH( CML ENDDO CML ENDIF CML#endif /* SEAICE_CGRID */ +#endif /* SEAICE_CGRID or SEAICE_BGRID_DYNAMICS */ RETURN END diff --git a/pkg/seaice/seaice_calc_lhs.F b/pkg/seaice/seaice_calc_lhs.F index ee9a33dc65..9eea1c16a9 100644 --- a/pkg/seaice/seaice_calc_lhs.F +++ b/pkg/seaice/seaice_calc_lhs.F @@ -60,7 +60,8 @@ SUBROUTINE SEAICE_CALC_LHS( _RL uIceLHS(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) _RL vIceLHS(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) -#ifdef SEAICE_ALLOW_JFNK +#if ( defined SEAICE_CGRID \ + && ( defined SEAICE_ALLOW_JFNK || defined SEAICE_ALLOW_KRYLOV ) ) C i,j,bi,bj,k :: loop indices INTEGER i,j,bi,bj INTEGER k @@ -206,7 +207,7 @@ SUBROUTINE SEAICE_CALC_LHS( ENDDO ENDDO -#endif /* SEAICE_ALLOW_JFNK */ +#endif /* SEAICE_CGRID, SEAICE_ALLOW_JFNK and KRYLOV */ RETURN END diff --git a/pkg/seaice/seaice_calc_residual.F b/pkg/seaice/seaice_calc_residual.F index a34846237b..77558f21ed 100644 --- a/pkg/seaice/seaice_calc_residual.F +++ b/pkg/seaice/seaice_calc_residual.F @@ -49,7 +49,7 @@ SUBROUTINE SEAICE_CALC_RESIDUAL( _RL uIceRes(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) _RL vIceRes(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) -#ifdef SEAICE_ALLOW_JFNK +#if ( defined SEAICE_CGRID && defined SEAICE_ALLOW_JFNK ) C u/vIceLHS :: left hand side of momentum equations _RL uIceLHS(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) _RL vIceLHS(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) @@ -141,7 +141,7 @@ SUBROUTINE SEAICE_CALC_RESIDUAL( ENDDO ENDDO -#endif /* SEAICE_ALLOW_JFNK */ +#endif /* SEAICE_CGRID and SEAICE_ALLOW_JFNK */ RETURN END diff --git a/pkg/seaice/seaice_calc_rhs.F b/pkg/seaice/seaice_calc_rhs.F index 9a82c5aed8..2c112e2a87 100644 --- a/pkg/seaice/seaice_calc_rhs.F +++ b/pkg/seaice/seaice_calc_rhs.F @@ -47,7 +47,8 @@ SUBROUTINE SEAICE_CALC_RHS( _RL uIceRHS(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) _RL vIceRHS(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) -#ifdef SEAICE_ALLOW_JFNK +#if ( defined SEAICE_CGRID \ + && ( defined SEAICE_ALLOW_JFNK || defined SEAICE_ALLOW_KRYLOV ) ) C i,j,bi,bj,kSrf :: loop indices INTEGER i,j,bi,bj INTEGER kSrf @@ -116,7 +117,7 @@ SUBROUTINE SEAICE_CALC_RHS( ENDDO ENDDO -#endif /* SEAICE_ALLOW_JFNK */ +#endif /* SEAICE_CGRID, SEAICE_ALLOW_JFNK and KRYLOV */ RETURN END diff --git a/pkg/seaice/seaice_calc_strainrates.F b/pkg/seaice/seaice_calc_strainrates.F index 926b6de249..9dfeba61eb 100644 --- a/pkg/seaice/seaice_calc_strainrates.F +++ b/pkg/seaice/seaice_calc_strainrates.F @@ -57,7 +57,6 @@ SUBROUTINE SEAICE_CALC_STRAINRATES( CEOP #ifdef SEAICE_CGRID -#ifdef SEAICE_ALLOW_DYNAMICS C !LOCAL VARIABLES: C === Local variables === C i,j,bi,bj :: Loop counters @@ -199,7 +198,6 @@ SUBROUTINE SEAICE_CALC_STRAINRATES( #endif #endif /* ALLOW_AUTODIFF */ -#endif /* SEAICE_ALLOW_DYNAMICS */ #endif /* SEAICE_CGRID */ RETURN END diff --git a/pkg/seaice/seaice_calc_viscosities.F b/pkg/seaice/seaice_calc_viscosities.F index 467dfd0237..bbacdc1223 100644 --- a/pkg/seaice/seaice_calc_viscosities.F +++ b/pkg/seaice/seaice_calc_viscosities.F @@ -59,7 +59,7 @@ SUBROUTINE SEAICE_CALC_VISCOSITIES( _RL zetaZ (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) CEndOfInterface -#if ( defined (SEAICE_CGRID) && defined (SEAICE_ALLOW_DYNAMICS) ) +#ifdef SEAICE_CGRID C === Local variables === C i,j,bi,bj - Loop counters C e11, e12, e22 - components of strain rate tensor @@ -477,6 +477,6 @@ SUBROUTINE SEAICE_CALC_VISCOSITIES( ENDDO ENDDO -#endif /* SEAICE_ALLOW_DYNAMICS and SEAICE_CGRID */ +#endif /* SEAICE_CGRID */ RETURN END diff --git a/pkg/seaice/seaice_check.F b/pkg/seaice/seaice_check.F index 621e194a0f..ce8fa20de6 100644 --- a/pkg/seaice/seaice_check.F +++ b/pkg/seaice/seaice_check.F @@ -540,11 +540,19 @@ SUBROUTINE SEAICE_CHECK( myThid ) ENDIF #endif -C-- SEAICE_ALLOW_DYNAMICS and SEAICEuseDYNAMICS -#ifndef SEAICE_ALLOW_DYNAMICS +C-- SEAICE_CGRID, SEAICE_BGRID_DYNAMICS and SEAICEuseDYNAMICS +#if ( defined SEAICE_CGRID && defined SEAICE_BGRID_DYNAMICS ) + WRITE(msgBuf,'(A,A)') + & 'SEAICE_CHECK: SEAICE_CGRID and SEAICE_BGRID_DYNAMICS ', + & 'cannot be defined at the same time.' + CALL PRINT_ERROR( msgBuf, myThid ) + errCount = errCount + 1 +#endif +#if !( defined SEAICE_CGRID || defined SEAICE_BGRID_DYNAMICS ) IF (SEAICEuseDYNAMICS) THEN - WRITE(msgBuf,'(A)') - & 'SEAICE_ALLOW_DYNAMICS needed for SEAICEuseDYNAMICS' + WRITE(msgBuf,'(A,A)') + & 'SEAICE_CHECK: either SEAICE_CGRID ', + & 'or SEAICE_BGRID_DYNAMICS needed for SEAICEuseDYNAMICS = T' CALL PRINT_ERROR( msgBuf, myThid ) errCount = errCount + 1 ENDIF @@ -783,7 +791,7 @@ SUBROUTINE SEAICE_CHECK( myThid ) CALL PRINT_MESSAGE( msgBuf, ioUnit, SQUEEZE_RIGHT, myThid ) ENDIF -#ifdef SEAICE_ALLOW_DYNAMICS +#ifdef SEAICE_CGRID IF ( SEAICEuseDynamics ) THEN C-- Check Overlap size: IF ( SEAICEuseJFNK ) THEN @@ -873,7 +881,7 @@ SUBROUTINE SEAICE_CHECK( myThid ) ENDIF # endif /* SEAICE_ALLOW_EVP */ -#ifdef SEAICE_ALLOW_EVP +# ifdef SEAICE_ALLOW_EVP IF ( SEAICEuseEVP .AND. (SEAICE_eccfr.NE.SEAICE_eccen) ) THEN WRITE(msgBuf,'(2A)') 'SEAICE_CHECK: SEAICEuseEVP = .TRUE., ', & 'so EVP is turned on by setting appropriate' @@ -904,11 +912,11 @@ SUBROUTINE SEAICE_CHECK( myThid ) CALL PRINT_ERROR( msgBuf, myThid ) errCount = errCount + 1 ENDIF -#endif /* SEAICE_ALLOW_EVP */ +# endif /* SEAICE_ALLOW_EVP */ C SEAICEuseDynamics ENDIF -#endif /* SEAICE_ALLOW_DYNAMICS */ +#endif /* SEAICE_CGRID */ #ifndef SEAICE_GLOBAL_3DIAG_SOLVER IF ( SEAICEuseMultiTileSolver ) THEN @@ -1003,8 +1011,7 @@ SUBROUTINE SEAICE_CHECK( myThid ) errCount = errCount + 1 ENDIF -#ifndef SEAICE_CGRID - +#ifdef SEAICE_BGRID_DYNAMICS IF ( i .GE. 1 ) THEN WRITE(msgBuf,'(2A)') 'SEAICE_CHECK: non-default rheologies ', & 'require that SEAICE_CGRID is defined.' @@ -1036,7 +1043,7 @@ SUBROUTINE SEAICE_CHECK( myThid ) CALL PRINT_ERROR( msgBuf, myThid ) C errCount = errCount + 1 ENDIF -#endif /* ndef SEAICE_CGRID */ +#endif /* SEAICE_BGRID_DYNAMICS */ C-- SEAICE_ALLOW_FREEDRIFT and SEAICEuseFREEDRIFT #ifndef SEAICE_ALLOW_FREEDRIFT diff --git a/pkg/seaice/seaice_dynsolver.F b/pkg/seaice/seaice_dynsolver.F index 398301d1a3..851bcdeffe 100644 --- a/pkg/seaice/seaice_dynsolver.F +++ b/pkg/seaice/seaice_dynsolver.F @@ -8,20 +8,19 @@ C !INTERFACE: SUBROUTINE SEAICE_DYNSOLVER( myTime, myIter, myThid ) -C *==========================================================* -C | SUBROUTINE SEAICE_DYNSOLVER -C | o Ice dynamics using LSR solver -C | Zhang and Hibler, JGR, 102, 8691-8702, 1997 -C | or EVP explicit solver by Hunke and Dukowicz, JPO 27, -C | 1849-1867 (1997) -C *==========================================================* -C | written by Martin Losch, March 2006 -C *==========================================================* -C \ev +C !DESCRIPTION: +C *=============================================================* +C | SUBROUTINE SEAICE_DYNSOLVER | +C | C-grid version of ice dynamics using either | +C | o free drift | +C | o LSR solver, Zhang and Hibler, JGR, 102, 8691-8702, 1997 | +C | o Krylov solver, after Lemieux and Tremblay, JGR, 114, 2009 | +C | o JFNK solver, Losch et al., JCP, 257 901-911, 2014 | +C | o EVP solver, Hunke and Dukowicz, JPO 27, 1849-1867 1997 | +C *=============================================================* C !USES: IMPLICIT NONE - C === Global variables === #include "SIZE.h" #include "EEPARAMS.h" @@ -38,7 +37,7 @@ SUBROUTINE SEAICE_DYNSOLVER( myTime, myIter, myThid ) # include "tamc.h" #endif -C !INPUT/OUTPUT PARAMETERS: +C !INPUT PARAMETERS: C === Routine arguments === C myTime :: Simulation time C myIter :: Simulation timestep number @@ -46,23 +45,21 @@ SUBROUTINE SEAICE_DYNSOLVER( myTime, myIter, myThid ) _RL myTime INTEGER myIter INTEGER myThid -CEOP -#ifdef SEAICE_CGRID C !FUNCTIONS: LOGICAL DIFFERENT_MULTIPLE EXTERNAL DIFFERENT_MULTIPLE -#ifdef ALLOW_DIAGNOSTICS +#if ( defined ALLOW_DIAGNOSTICS && defined SEAICE_CGRID ) LOGICAL DIAGNOSTICS_IS_ON EXTERNAL DIAGNOSTICS_IS_ON -#endif /* ALLOW_DIAGNOSTICS */ +#endif C !LOCAL VARIABLES: C === Local variables === C i,j :: Loop counters C bi,bj :: tile counters INTEGER i, j, bi, bj -#ifdef SEAICE_ALLOW_DYNAMICS +#ifdef SEAICE_CGRID # ifndef ALLOW_AUTODIFF _RL mask_uice, mask_vice # endif @@ -73,7 +70,7 @@ SUBROUTINE SEAICE_DYNSOLVER( myTime, myIter, myThid ) C TAUY :: meridional wind stress over seaice at V point _RL TAUX (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) _RL TAUY (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) -#ifdef ALLOW_DIAGNOSTICS +#if ( defined ALLOW_DIAGNOSTICS && defined SEAICE_CGRID ) # ifdef ALLOW_AUTODIFF _RL strDivX(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) _RL strDivY(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) @@ -88,13 +85,14 @@ SUBROUTINE SEAICE_DYNSOLVER( myTime, myIter, myThid ) LOGICAL diag_SIsigma_isOn, diag_SIshear_isOn LOGICAL diag_SIenpi_isOn, diag_SIenpot_isOn LOGICAL diag_SIpRfric_isOn, diag_SIpSfric_isOn -#endif /* ALLOW_DIAGNOSTICS */ +#endif +CEOP DO bj=myByLo(myThid),myByHi(myThid) DO bi=myBxLo(myThid),myBxHi(myThid) DO j=1-OLy,sNy+OLy DO i=1-OLx,sNx+OLx -#ifdef ALLOW_AUTODIFF +#if ( defined ALLOW_AUTODIFF && defined SEAICE_CGRID ) C Following re-initialisation breaks some "artificial" AD dependencies C incured by IF (DIFFERENT_MULTIPLE ... statement PRESS0 (i,j,bi,bj) = SEAICE_strength*HEFF(i,j,bi,bj) @@ -106,11 +104,11 @@ SUBROUTINE SEAICE_DYNSOLVER( myTime, myIter, myThid ) uice_fd(i,j,bi,bj)= 0. _d 0 vice_fd(i,j,bi,bj)= 0. _d 0 # endif -# ifdef ALLOW_DIAGNOSTICS +#if ( defined ALLOW_DIAGNOSTICS && defined SEAICE_CGRID ) strDivX(i,j,bi,bj)= 0. _d 0 strDivY(i,j,bi,bj)= 0. _d 0 # endif -#endif /* ALLOW_AUTODIFF */ +#endif /* ALLOW_AUTODIFF and SEAICE_CGRID */ C Always initialise these local variables, needed for TAF, but also C because they are not completely filled in S/R seaice_get_dynforcing TAUX(i,j,bi,bj) = 0. _d 0 @@ -119,12 +117,12 @@ SUBROUTINE SEAICE_DYNSOLVER( myTime, myIter, myThid ) ENDDO ENDDO ENDDO -# ifdef ALLOW_AUTODIFF_TAMC +#ifdef ALLOW_AUTODIFF_TAMC CADJ STORE uice = comlev1, key=ikey_dynamics, kind=isbyte CADJ STORE vice = comlev1, key=ikey_dynamics, kind=isbyte CADJ STORE uicenm1 = comlev1, key=ikey_dynamics, kind=isbyte CADJ STORE vicenm1 = comlev1, key=ikey_dynamics, kind=isbyte -# endif /* ALLOW_AUTODIFF_TAMC */ +#endif /* ALLOW_AUTODIFF_TAMC */ C-- interface of dynamics with atmopheric forcing fields (wind/stress) C Call this in each time step so that we can use the surface stress C in S/R seaice_ocean_stress @@ -133,7 +131,7 @@ SUBROUTINE SEAICE_DYNSOLVER( myTime, myIter, myThid ) O TAUX, TAUY, I myTime, myIter, myThid ) -#ifdef SEAICE_ALLOW_DYNAMICS +#ifdef SEAICE_CGRID IF ( SEAICEuseDYNAMICS .AND. & DIFFERENT_MULTIPLE(SEAICE_deltaTdyn,myTime,SEAICE_deltaTtherm) & ) THEN @@ -173,7 +171,7 @@ SUBROUTINE SEAICE_DYNSOLVER( myTime, myIter, myThid ) ENDDO ENDDO -#ifndef ALLOW_AUTODIFF +# ifndef ALLOW_AUTODIFF IF ( SEAICE_maskRHS ) THEN C dynamic masking of areas with no ice, not recommended C and only kept for testing purposes @@ -203,12 +201,12 @@ SUBROUTINE SEAICE_DYNSOLVER( myTime, myIter, myThid ) ENDDO CALL EXCH_UV_XY_RL( seaiceMaskU, seaiceMaskV, .FALSE., myThid ) ENDIF -#endif /* ndef ALLOW_AUTODIFF */ +# endif /* ndef ALLOW_AUTODIFF */ C-- NOW SET UP FORCING FIELDS C initialise fields -#if (defined ALLOW_AUTODIFF && defined SEAICE_ALLOW_EVP) +# if (defined ALLOW_AUTODIFF && defined SEAICE_ALLOW_EVP) DO bj=myByLo(myThid),myByHi(myThid) DO bi=myBxLo(myThid),myBxHi(myThid) DO j=1-OLy,sNy+OLy @@ -219,7 +217,7 @@ SUBROUTINE SEAICE_DYNSOLVER( myTime, myIter, myThid ) ENDDO ENDDO ENDDO -#endif +# endif DO bj=myByLo(myThid),myByHi(myThid) DO bi=myBxLo(myThid),myBxHi(myThid) @@ -238,7 +236,7 @@ SUBROUTINE SEAICE_DYNSOLVER( myTime, myIter, myThid ) ENDDO ENDDO ENDIF -#ifdef ATMOSPHERIC_LOADING +# ifdef ATMOSPHERIC_LOADING C-- add atmospheric loading and Sea-Ice loading as it is done for phi0surf C-- in S/R external_forcing_surf IF ( usingZCoords ) THEN @@ -263,7 +261,7 @@ SUBROUTINE SEAICE_DYNSOLVER( myTime, myIter, myThid ) C The true atmospheric P-loading is not yet implemented for P-coord C (requires time varying dP(Nr) like dP(k-bottom) with NonLin FS). ENDIF -#endif /* ATMOSPHERIC_LOADING */ +# endif /* ATMOSPHERIC_LOADING */ C-- basic forcing by wind stress IF ( SEAICEscaleSurfStress ) THEN DO j=1-OLy+1,sNy+OLy @@ -302,7 +300,7 @@ SUBROUTINE SEAICE_DYNSOLVER( myTime, myIter, myThid ) ENDDO ENDDO -#ifdef SEAICE_ALLOW_FREEDRIFT +# ifdef SEAICE_ALLOW_FREEDRIFT IF ( SEAICEuseFREEDRIFT .OR. SEAICEuseEVP & .OR. LSR_mixIniGuess.EQ.0 ) THEN CALL SEAICE_FREEDRIFT( myTime, myIter, myThid ) @@ -321,70 +319,72 @@ SUBROUTINE SEAICE_DYNSOLVER( myTime, myIter, myThid ) ENDDO ENDDO ENDIF -#endif /* SEAICE_ALLOW_FREEDRIFT */ +# endif /* SEAICE_ALLOW_FREEDRIFT */ -#ifdef ALLOW_OBCS +# ifdef ALLOW_OBCS IF ( useOBCS ) THEN CALL OBCS_APPLY_UVICE( uIce, vIce, myThid ) ENDIF -#endif /* ALLOW_OBCS */ +# endif -#ifdef SEAICE_ALLOW_EVP -# ifdef ALLOW_AUTODIFF_TAMC +# ifdef SEAICE_ALLOW_EVP +# ifdef ALLOW_AUTODIFF_TAMC CADJ STORE uice = comlev1, key=ikey_dynamics, kind=isbyte CADJ STORE vice = comlev1, key=ikey_dynamics, kind=isbyte CADJ STORE uicenm1 = comlev1, key=ikey_dynamics, kind=isbyte CADJ STORE vicenm1 = comlev1, key=ikey_dynamics, kind=isbyte -# endif /* ALLOW_AUTODIFF_TAMC */ +# endif /* ALLOW_AUTODIFF_TAMC */ IF ( SEAICEuseEVP ) THEN C Elastic-Viscous-Plastic solver, following Hunke (2001) CALL SEAICE_EVP( myTime, myIter, myThid ) ENDIF -#endif /* SEAICE_ALLOW_EVP */ +# endif /* SEAICE_ALLOW_EVP */ IF ( SEAICEuseLSR ) THEN C Picard solver with LSR scheme (Zhang-J/Hibler 1997), ported to a C-grid CALL SEAICE_LSR( myTime, myIter, myThid ) ENDIF -#ifdef SEAICE_ALLOW_KRYLOV -# ifdef ALLOW_AUTODIFF +# ifdef SEAICE_ALLOW_KRYLOV +# ifdef ALLOW_AUTODIFF STOP 'Adjoint does not work with Picard-Krylov solver.' -# else +# else IF ( SEAICEuseKrylov ) THEN C Picard solver with Matrix-free Krylov solver (Lemieux et al. 2008) CALL SEAICE_KRYLOV( myTime, myIter, myThid ) ENDIF -# endif /* ALLOW_AUTODIFF */ -#endif /* SEAICE_ALLOW_KRYLOV */ +# endif /* ALLOW_AUTODIFF */ +# endif /* SEAICE_ALLOW_KRYLOV */ -#ifdef SEAICE_ALLOW_JFNK -# ifdef ALLOW_AUTODIFF +# ifdef SEAICE_ALLOW_JFNK +# ifdef ALLOW_AUTODIFF STOP 'Adjoint does not work with JFNK solver.' -# else +# else IF ( SEAICEuseJFNK ) THEN C Jacobian-free Newton Krylov solver (Lemieux et al. 2010, 2012) CALL SEAICE_JFNK( myTime, myIter, myThid ) ENDIF -# endif /* ALLOW_AUTODIFF */ -#endif /* SEAICE_ALLOW_JFNK */ +# endif /* ALLOW_AUTODIFF */ +# endif /* SEAICE_ALLOW_JFNK */ C End of IF (SEAICEuseDYNAMICS and DIFFERENT_MULTIPLE ... ENDIF -#endif /* SEAICE_ALLOW_DYNAMICS */ +#endif /* SEAICE_CGRID */ C Update ocean surface stress IF ( SEAICEupdateOceanStress ) THEN #ifdef ALLOW_AUTODIFF_TAMC CADJ STORE uice, vice, DWATN = comlev1, key=ikey_dynamics, kind=isbyte +# ifdef SEAICE_CGRID CADJ STORE stressDivergenceX = comlev1, key=ikey_dynamics, kind=isbyte CADJ STORE stressDivergenceY = comlev1, key=ikey_dynamics, kind=isbyte +# endif #endif /* ALLOW_AUTODIFF_TAMC */ CALL SEAICE_OCEAN_STRESS ( I TAUX, TAUY, myTime, myIter, myThid ) ENDIF -#if (defined SEAICE_ALLOW_DYNAMICS && defined SEAICE_ALLOW_CLIPVELS) +#ifdef SEAICE_ALLOW_CLIPVELS IF ( SEAICEuseDYNAMICS .AND. SEAICE_clipVelocities) THEN # ifdef ALLOW_AUTODIFF_TAMC CADJ STORE uice = comlev1, key=ikey_dynamics, kind=isbyte @@ -406,9 +406,9 @@ SUBROUTINE SEAICE_DYNSOLVER( myTime, myIter, myThid ) ENDDO ENDDO ENDIF -#endif /* SEAICE_ALLOW_DYNAMICS and SEAICE_ALLOW_CLIPVELS */ +#endif /* SEAICE_ALLOW_CLIPVELS */ -#ifdef ALLOW_DIAGNOSTICS +#if ( defined ALLOW_DIAGNOSTICS && defined SEAICE_CGRID ) C diagnostics related to mechanics/dynamics/momentum equations IF ( useDiagnostics .AND. SEAICEuseDYNAMICS ) THEN CALL DIAGNOSTICS_FILL(zeta ,'SIzeta ',0,1,0,1,1,myThid) @@ -704,10 +704,9 @@ SUBROUTINE SEAICE_DYNSOLVER( myTime, myIter, myThid ) C bi/bj-loop ENDDO ENDDO -C useDiagnostics +C useDiagnostics & SEAICEuseDYNAMICS ENDIF -#endif /* ALLOW_DIAGNOSTICS */ -#endif /* SEAICE_CGRID */ +#endif /* ALLOW_DIAGNOSTICS and SEAICE_CGRID */ RETURN END diff --git a/pkg/seaice/seaice_evp.F b/pkg/seaice/seaice_evp.F index 20a0c10805..08e2a890f7 100644 --- a/pkg/seaice/seaice_evp.F +++ b/pkg/seaice/seaice_evp.F @@ -51,9 +51,7 @@ SUBROUTINE SEAICE_EVP( myTime, myIter, myThid ) INTEGER myIter INTEGER myThid -#if ( defined (SEAICE_CGRID) && \ - defined (SEAICE_ALLOW_EVP) && \ - defined (SEAICE_ALLOW_DYNAMICS) ) +#if ( defined SEAICE_CGRID && defined SEAICE_ALLOW_EVP ) C === Local variables === C i,j,bi,bj :: Loop counters @@ -962,7 +960,7 @@ SUBROUTINE SEAICE_EVP( myTime, myIter, myThid ) C end of the main time loop ENDDO -#endif /* SEAICE_ALLOW_DYNAMICS and SEAICE_CGRID and SEAICE_ALLOW_EVP */ +#endif /* SEAICE_CGRID and SEAICE_ALLOW_EVP */ RETURN END diff --git a/pkg/seaice/seaice_freedrift.F b/pkg/seaice/seaice_freedrift.F index 099df702d9..328058d73e 100644 --- a/pkg/seaice/seaice_freedrift.F +++ b/pkg/seaice/seaice_freedrift.F @@ -27,8 +27,7 @@ SUBROUTINE SEAICE_FREEDRIFT( myTime, myIter, myThid ) INTEGER myThid CEOP -#ifdef SEAICE_ALLOW_FREEDRIFT -#ifdef SEAICE_CGRID +#if ( defined SEAICE_CGRID && defined SEAICE_ALLOW_FREEDRIFT ) C === Local variables === INTEGER i, j, kSrf, bi, bj @@ -172,7 +171,6 @@ SUBROUTINE SEAICE_FREEDRIFT( myTime, myIter, myThid ) ENDDO ENDDO -#endif /* SEAICE_CGRID */ -#endif /* SEAICE_ALLOW_FREEDRIFT */ +#endif /* SEAICE_CGRID and SEAICE_ALLOW_FREEDRIFT */ RETURN END diff --git a/pkg/seaice/seaice_get_dynforcing.F b/pkg/seaice/seaice_get_dynforcing.F index 0c149e20ec..441a4bc571 100644 --- a/pkg/seaice/seaice_get_dynforcing.F +++ b/pkg/seaice/seaice_get_dynforcing.F @@ -67,7 +67,6 @@ SUBROUTINE SEAICE_GET_DYNFORCING( INTEGER myThid CEOP -#ifdef SEAICE_CGRID C !LOCAL VARIABLES: C i,j,bi,bj :: Loop counters C ks :: vertical index of surface layer @@ -278,7 +277,5 @@ SUBROUTINE SEAICE_GET_DYNFORCING( ENDIF #endif /* ALLOW_DIAGNOSTICS */ -#endif /* SEAICE_CGRID */ - RETURN END diff --git a/pkg/seaice/seaice_init_fixed.F b/pkg/seaice/seaice_init_fixed.F index 5f050caef9..246f930c9a 100644 --- a/pkg/seaice/seaice_init_fixed.F +++ b/pkg/seaice/seaice_init_fixed.F @@ -47,7 +47,7 @@ SUBROUTINE SEAICE_INIT_FIXED( myThid ) #endif /* SHORTWAVE_HEATING */ C local copy of surface layer thickness in meters _RL dzSurf -#ifndef SEAICE_CGRID +#ifdef SEAICE_BGRID_DYNAMICS _RL mask_uice #endif @@ -268,7 +268,7 @@ SUBROUTINE SEAICE_INIT_FIXED( myThid ) SIMaskV(i,j,bi,bj) = maskS(i,j,kSrf,bi,bj) ENDDO ENDDO -#ifndef SEAICE_CGRID +#ifdef SEAICE_BGRID_DYNAMICS DO j=1-OLy+1,sNy+OLy DO i=1-OLx+1,sNx+OLx UVM(i,j,bi,bj)=0. _d 0 @@ -277,7 +277,7 @@ SUBROUTINE SEAICE_INIT_FIXED( myThid ) IF(mask_uice.GT.3.5 _d 0) UVM(i,j,bi,bj)=1. _d 0 ENDDO ENDDO -#endif /* ndef SEAICE_CGRID */ +#endif C coefficients for metric terms #ifdef SEAICE_CGRID @@ -334,7 +334,9 @@ SUBROUTINE SEAICE_INIT_FIXED( myThid ) ENDDO ENDDO ENDIF -#else /* not SEAICE_CGRID */ +#endif /* SEAICE_CGRID */ + +#ifdef SEAICE_BGRID_DYNAMICS DO j=1-OLy,sNy+OLy DO i=1-OLx,sNx+OLx k1AtC(i,j,bi,bj) = 0.0 _d 0 @@ -405,7 +407,30 @@ SUBROUTINE SEAICE_INIT_FIXED( myThid ) ENDDO ENDDO ENDIF -#endif /* not SEAICE_CGRID */ +C-- Choose a proxy level for geostrophic velocity, + DO j=1-OLy,sNy+OLy + DO i=1-OLx,sNx+OLx + KGEO(i,j,bi,bj) = 0 + ENDDO + ENDDO + DO j=1-OLy,sNy+OLy + DO i=1-OLx,sNx+OLx +#ifdef SEAICE_BICE_STRESS + KGEO(i,j,bi,bj) = 1 +#else /* SEAICE_BICE_STRESS */ + IF (klowc(i,j,bi,bj) .LT. 2) THEN + KGEO(i,j,bi,bj) = 1 + ELSE + KGEO(i,j,bi,bj) = 2 + DO WHILE ( abs(rC(KGEO(i,j,bi,bj))) .LT. 50.0 _d 0 .AND. + & KGEO(i,j,bi,bj) .LT. (klowc(i,j,bi,bj)-1) ) + KGEO(i,j,bi,bj) = KGEO(i,j,bi,bj) + 1 + ENDDO + ENDIF +#endif /* SEAICE_BICE_STRESS */ + ENDDO + ENDDO +#endif /* SEAICE_BGRID_DYNAMICS */ C- end bi,bj loops ENDDO ENDDO @@ -434,35 +459,5 @@ SUBROUTINE SEAICE_INIT_FIXED( myThid ) ENDIF #endif /* ALLOW_SHELFICE */ -#ifndef SEAICE_CGRID -C-- Choose a proxy level for geostrophic velocity, - DO bj=myByLo(myThid),myByHi(myThid) - DO bi=myBxLo(myThid),myBxHi(myThid) - DO j=1-OLy,sNy+OLy - DO i=1-OLx,sNx+OLx - KGEO(i,j,bi,bj) = 0 - ENDDO - ENDDO - DO j=1-OLy,sNy+OLy - DO i=1-OLx,sNx+OLx -#ifdef SEAICE_BICE_STRESS - KGEO(i,j,bi,bj) = 1 -#else /* SEAICE_BICE_STRESS */ - IF (klowc(i,j,bi,bj) .LT. 2) THEN - KGEO(i,j,bi,bj) = 1 - ELSE - KGEO(i,j,bi,bj) = 2 - DO WHILE ( abs(rC(KGEO(i,j,bi,bj))) .LT. 50.0 _d 0 .AND. - & KGEO(i,j,bi,bj) .LT. (klowc(i,j,bi,bj)-1) ) - KGEO(i,j,bi,bj) = KGEO(i,j,bi,bj) + 1 - ENDDO - ENDIF -#endif /* SEAICE_BICE_STRESS */ - ENDDO - ENDDO - ENDDO - ENDDO -#endif /* ndef SEAICE_CGRID */ - RETURN END diff --git a/pkg/seaice/seaice_init_varia.F b/pkg/seaice/seaice_init_varia.F index 338a09fe90..692808de92 100644 --- a/pkg/seaice/seaice_init_varia.F +++ b/pkg/seaice/seaice_init_varia.F @@ -38,7 +38,6 @@ SUBROUTINE SEAICE_INIT_VARIA( myThid ) INTEGER i, j, bi, bj INTEGER kSrf - _RS mask_uice INTEGER k #ifdef ALLOW_SITRACER INTEGER iTr, jTh @@ -47,6 +46,7 @@ SUBROUTINE SEAICE_INIT_VARIA( myThid ) INTEGER I_obc, J_obc #endif /* ALLOW_OBCS */ #ifdef SEAICE_CGRID + _RS mask_uice _RL recip_tensilDepth #endif @@ -63,72 +63,69 @@ SUBROUTINE SEAICE_INIT_VARIA( myThid ) DO i=1-OLx,sNx+OLx HEFF(i,j,bi,bj)=0. _d 0 AREA(i,j,bi,bj)=0. _d 0 -CToM<<< + HSNOW(i,j,bi,bj) = 0. _d 0 #ifdef SEAICE_ITD DO k=1,nITD AREAITD(i,j,k,bi,bj) =0. _d 0 HEFFITD(i,j,k,bi,bj) =0. _d 0 + HSNOWITD(i,j,k,bi,bj)=0. _d 0 ENDDO #endif -C>>>ToM UICE(i,j,bi,bj)=0. _d 0 VICE(i,j,bi,bj)=0. _d 0 -#ifdef SEAICE_ALLOW_FREEDRIFT - uice_fd(i,j,bi,bj)=0. _d 0 - vice_fd(i,j,bi,bj)=0. _d 0 -#endif C uIceNm1(i,j,bi,bj) = 0. _d 0 vIceNm1(i,j,bi,bj) = 0. _d 0 + DWATN (i,j,bi,bj) = 0. _d 0 +#ifdef SEAICE_CGRID + stressDivergenceX(i,j,bi,bj) = 0. _d 0 + stressDivergenceY(i,j,bi,bj) = 0. _d 0 +# ifdef SEAICE_ALLOW_EVP + seaice_sigma1 (i,j,bi,bj) = 0. _d 0 + seaice_sigma2 (i,j,bi,bj) = 0. _d 0 + seaice_sigma12(i,j,bi,bj) = 0. _d 0 +# endif /* SEAICE_ALLOW_EVP */ +#endif +#if ( defined SEAICE_CGRID || defined SEAICE_BGRID_DYNAMICS ) e11 (i,j,bi,bj) = 0. _d 0 e22 (i,j,bi,bj) = 0. _d 0 e12 (i,j,bi,bj) = 0. _d 0 deltaC (i,j,bi,bj) = 0. _d 0 + PRESS (i,j,bi,bj) = 0. _d 0 ETA (i,j,bi,bj) = 0. _d 0 etaZ (i,j,bi,bj) = 0. _d 0 ZETA (i,j,bi,bj) = 0. _d 0 FORCEX (i,j,bi,bj) = 0. _d 0 FORCEY (i,j,bi,bj) = 0. _d 0 + tensileStrFac(i,j,bi,bj) = 0. _d 0 + PRESS0(i,j,bi,bj) = 0. _d 0 + FORCEX0(i,j,bi,bj) = 0. _d 0 + FORCEY0(i,j,bi,bj) = 0. _d 0 + SEAICE_zMax(i,j,bi,bj) = 0. _d 0 + SEAICE_zMin(i,j,bi,bj) = 0. _d 0 +#endif #ifdef SEAICE_CGRID seaiceMassC(i,j,bi,bj)=0. _d 0 seaiceMassU(i,j,bi,bj)=0. _d 0 seaiceMassV(i,j,bi,bj)=0. _d 0 - stressDivergenceX(i,j,bi,bj) = 0. _d 0 - stressDivergenceY(i,j,bi,bj) = 0. _d 0 -# ifdef SEAICE_ALLOW_EVP - seaice_sigma1 (i,j,bi,bj) = 0. _d 0 - seaice_sigma2 (i,j,bi,bj) = 0. _d 0 - seaice_sigma12(i,j,bi,bj) = 0. _d 0 -# endif /* SEAICE_ALLOW_EVP */ -#else /* SEAICE_CGRID */ - uIceC(i,j,bi,bj) = 0. _d 0 - vIceC(i,j,bi,bj) = 0. _d 0 +# ifdef SEAICE_ALLOW_FREEDRIFT + uice_fd(i,j,bi,bj) = 0. _d 0 + vice_fd(i,j,bi,bj) = 0. _d 0 +# endif +# ifdef SEAICE_ALLOW_BOTTOMDRAG + CbotC(i,j,bi,bj) = 0. _d 0 +# endif /* SEAICE_ALLOW_BOTTOMDRAG */ +#endif /* SEAICE_CGRID */ +#ifdef SEAICE_BGRID_DYNAMICS + uIceB(i,j,bi,bj) = 0. _d 0 + vIceB(i,j,bi,bj) = 0. _d 0 AMASS(i,j,bi,bj) = 0. _d 0 DAIRN(i,j,bi,bj) = 0. _d 0 WINDX(i,j,bi,bj) = 0. _d 0 WINDY(i,j,bi,bj) = 0. _d 0 GWATX(i,j,bi,bj) = 0. _d 0 GWATY(i,j,bi,bj) = 0. _d 0 -#endif /* SEAICE_CGRID */ - DWATN(i,j,bi,bj) = 0. _d 0 -#ifdef SEAICE_ALLOW_BOTTOMDRAG - CbotC(i,j,bi,bj) = 0. _d 0 -#endif /* SEAICE_ALLOW_BOTTOMDRAG */ - PRESS0(i,j,bi,bj) = 0. _d 0 - PRESS (i,j,bi,bj) = 0. _d 0 - FORCEX0(i,j,bi,bj) = 0. _d 0 - FORCEY0(i,j,bi,bj) = 0. _d 0 - HSNOW(i,j,bi,bj) = 0. _d 0 - SEAICE_zMax (i,j,bi,bj) = 0. _d 0 - SEAICE_zMin (i,j,bi,bj) = 0. _d 0 - tensileStrFac(i,j,bi,bj) = 0. _d 0 -CToM<<< -#ifdef SEAICE_ITD - DO k=1,nITD - HSNOWITD(i,j,k,bi,bj)=0. _d 0 - ENDDO -#endif -C>>>ToM +#endif /* SEAICE_BGRID_DYNAMICS */ #ifdef SEAICE_VARIABLE_SALINITY HSALT(i,j,bi,bj) = 0. _d 0 #endif @@ -185,9 +182,9 @@ SUBROUTINE SEAICE_INIT_VARIA( myThid ) C-- Initialize (variable) grid info. As long as we allow masking of C-- velocities outside of ice covered areas (in seaice_dynsolver) C-- we need to re-initialize seaiceMaskU/V here for TAF/TAMC -#ifdef SEAICE_CGRID DO bj=myByLo(myThid),myByHi(myThid) DO bi=myBxLo(myThid),myBxHi(myThid) +#ifdef SEAICE_CGRID DO j=1-OLy+1,sNy+OLy DO i=1-OLx+1,sNx+OLx seaiceMaskU(i,j,bi,bj)= 0.0 _d 0 @@ -198,14 +195,7 @@ SUBROUTINE SEAICE_INIT_VARIA( myThid ) IF(mask_uice.GT.1.5 _d 0) seaiceMaskV(i,j,bi,bj)=1.0 _d 0 ENDDO ENDDO - ENDDO - ENDDO -#endif /* SEAICE_CGRID */ - - DO bj=myByLo(myThid),myByHi(myThid) - DO bi=myBxLo(myThid),myBxHi(myThid) -#ifdef OBCS_UVICE_OLD -#ifdef SEAICE_CGRID +# ifdef OBCS_UVICE_OLD IF (useOBCS) THEN C-- If OBCS is turned on, close southern and western boundaries DO i=1-OLx,sNx+OLx @@ -225,20 +215,21 @@ SUBROUTINE SEAICE_INIT_VARIA( myThid ) ENDIF ENDDO ENDIF +# endif /* OBCS_UVICE_OLD */ #endif /* SEAICE_CGRID */ -#endif /* OBCS_UVICE_OLD */ DO j=1-OLy,sNy+OLy DO i=1-OLx,sNx+OLx DO k=1,nITD TICES(i,j,k,bi,bj)=273.0 _d 0 ENDDO -#ifndef SEAICE_CGRID - AMASS (i,j,bi,bj)=1000.0 _d 0 -#else +#ifdef SEAICE_CGRID seaiceMassC(i,j,bi,bj)=1000.0 _d 0 seaiceMassU(i,j,bi,bj)=1000.0 _d 0 seaiceMassV(i,j,bi,bj)=1000.0 _d 0 +#endif +#ifdef SEAICE_BGRID_DYNAMICS + AMASS (i,j,bi,bj)=1000.0 _d 0 #endif ENDDO ENDDO @@ -249,7 +240,8 @@ SUBROUTINE SEAICE_INIT_VARIA( myThid ) C-- Update overlap regions #ifdef SEAICE_CGRID CALL EXCH_UV_XY_RL(seaiceMaskU,seaiceMaskV,.FALSE.,myThid) -#else +#endif +#ifdef SEAICE_BGRID_DYNAMICS _EXCH_XY_RS(UVM, myThid) #endif @@ -262,7 +254,8 @@ SUBROUTINE SEAICE_INIT_VARIA( myThid ) & nIter0, myThid ) CALL PLOT_FIELD_XYRL( seaiceMaskV, 'Current seaiceMaskV', & nIter0, myThid ) -#else +#endif +#ifdef SEAICE_BGRID_DYNAMICS CALL PLOT_FIELD_XYRS( UVM , 'Current UVM ' , & nIter0, myThid ) #endif @@ -449,25 +442,10 @@ SUBROUTINE SEAICE_INIT_VARIA( myThid ) c ENDIF #endif /* ALLOW_OBCS */ -#ifdef SEAICE_ALLOW_JFNK -C Computing this metric cannot be done in S/R SEAICE_INIT_FIXED -C where it belongs, because globalArea is only defined later after -C S/R PACKAGES_INIT_FIXED, so we move this computation here. - CALL SEAICE_MAP_RS2VEC( nVec, rAw, rAs, - & scalarProductMetric, .TRUE., myThid ) - DO bj=myByLo(myThid),myByHi(myThid) - DO bi=myBxLo(myThid),myBxHi(myThid) - DO i=1,nVec - scalarProductMetric(i,1,bi,bj) = - & scalarProductMetric(i,1,bi,bj)/globalArea - ENDDO - ENDDO - ENDDO -#endif /* SEAICE_ALLOW_JFNK */ - C--- Complete initialization DO bj=myByLo(myThid),myByHi(myThid) DO bi=myBxLo(myThid),myBxHi(myThid) +#if ( defined SEAICE_CGRID || defined SEAICE_BGRID_DYNAMICS ) DO j=1-OLy,sNy+OLy DO i=1-OLx,sNx+OLx ZETA(i,j,bi,bj) = HEFF(i,j,bi,bj)*(1.0 _d 11) @@ -479,6 +457,7 @@ SUBROUTINE SEAICE_INIT_VARIA( myThid ) PRESS0(i,j,bi,bj) = PRESS0(i,j,bi,bj)*HEFFM(i,j,bi,bj) ENDDO ENDDO +#endif IF ( useRealFreshWaterFlux .AND. .NOT.useThSIce ) THEN DO j=1-OLy,sNy+OLy DO i=1-OLx,sNx+OLx @@ -509,6 +488,22 @@ SUBROUTINE SEAICE_INIT_VARIA( myThid ) ENDDO ENDDO ENDIF +# if ( defined SEAICE_ALLOW_JFNK || defined SEAICE_ALLOW_KRYLOV ) +C Computing this metric cannot be done in S/R SEAICE_INIT_FIXED +C where it belongs, because globalArea is only defined later after +C S/R PACKAGES_INIT_FIXED, so we move this computation here. + CALL SEAICE_MAP_RS2VEC( nVec, rAw, rAs, + & scalarProductMetric, .TRUE., myThid ) + DO bj=myByLo(myThid),myByHi(myThid) + DO bi=myBxLo(myThid),myBxHi(myThid) + DO i=1,nVec + scalarProductMetric(i,1,bi,bj) = + & scalarProductMetric(i,1,bi,bj)/globalArea + ENDDO + ENDDO + ENDDO +# endif /* SEAICE_ALLOW_JFNK or KRYLOV */ + #endif /* SEAICE_CGRID */ #ifdef ALLOW_AUTODIFF diff --git a/pkg/seaice/seaice_jfnk.F b/pkg/seaice/seaice_jfnk.F index bf08f80fc0..a82a90cefd 100644 --- a/pkg/seaice/seaice_jfnk.F +++ b/pkg/seaice/seaice_jfnk.F @@ -46,7 +46,7 @@ SUBROUTINE SEAICE_JFNK( myTime, myIter, myThid ) INTEGER myIter INTEGER myThid -#ifdef SEAICE_ALLOW_JFNK +#if ( defined SEAICE_CGRID && defined SEAICE_ALLOW_JFNK ) C !FUNCTIONS: LOGICAL DIFFERENT_MULTIPLE EXTERNAL DIFFERENT_MULTIPLE @@ -595,7 +595,7 @@ SUBROUTINE SEAICE_JFNK_UPDATE( C This is the new residual JFNKresidual = resLoc -#endif /* SEAICE_ALLOW_JFNK */ +#endif /* SEAICE_CGRID and SEAICE_ALLOW_JFNK */ RETURN END diff --git a/pkg/seaice/seaice_krylov.F b/pkg/seaice/seaice_krylov.F index f32f338dc9..a95b620fb5 100644 --- a/pkg/seaice/seaice_krylov.F +++ b/pkg/seaice/seaice_krylov.F @@ -44,7 +44,7 @@ SUBROUTINE SEAICE_KRYLOV( myTime, myIter, myThid ) INTEGER myIter INTEGER myThid -#ifdef SEAICE_ALLOW_KRYLOV +#if ( defined SEAICE_CGRID && defined SEAICE_ALLOW_KRYLOV ) C !FUNCTIONS: LOGICAL DIFFERENT_MULTIPLE EXTERNAL DIFFERENT_MULTIPLE @@ -520,7 +520,7 @@ SUBROUTINE SEAICE_KRYLOV( myTime, myIter, myThid ) _END_MASTER( myThid ) ENDIF -#endif /* SEAICE_ALLOW_KRYLOV */ +#endif /* SEAICE_CGRID and SEAICE_ALLOW_KRYLOV */ RETURN END diff --git a/pkg/seaice/seaice_lsr.F b/pkg/seaice/seaice_lsr.F index bef85641f2..34b90fb582 100644 --- a/pkg/seaice/seaice_lsr.F +++ b/pkg/seaice/seaice_lsr.F @@ -66,7 +66,6 @@ SUBROUTINE SEAICE_LSR( myTime, myIter, myThid ) CEOP #ifdef SEAICE_CGRID -#ifdef SEAICE_ALLOW_DYNAMICS C !FUNCTIONS: LOGICAL DIFFERENT_MULTIPLE EXTERNAL DIFFERENT_MULTIPLE @@ -988,9 +987,6 @@ SUBROUTINE SEAICE_LSR( myTime, myIter, myThid ) C endif useHB87StressCoupling ENDIF -#endif /* SEAICE_ALLOW_DYNAMICS */ -#endif /* SEAICE_CGRID */ - RETURN END @@ -1054,9 +1050,6 @@ SUBROUTINE SEAICE_RESIDUAL( INTEGER myThid CEOP -#ifdef SEAICE_CGRID -#ifdef SEAICE_ALLOW_DYNAMICS - C !LOCAL VARIABLES: C === Local variables === C i,j,bi,bj :: Loop counters @@ -1116,9 +1109,6 @@ SUBROUTINE SEAICE_RESIDUAL( C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| -#endif /* SEAICE_ALLOW_DYNAMICS */ -#endif /* SEAICE_CGRID */ - RETURN END @@ -1184,8 +1174,6 @@ SUBROUTINE SEAICE_LSR_CALC_COEFFS( _RL vRt2 (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) CEOP -#ifdef SEAICE_CGRID -#ifdef SEAICE_ALLOW_DYNAMICS C !LOCAL VARIABLES: C === Local variables === C i,j,bi,bj :: Loop counters @@ -1997,7 +1985,6 @@ SUBROUTINE SEAICE_LSR_TRIDIAGV( ENDDO #endif /* SEAICE_LSR_ZEBRA */ -#endif /* SEAICE_ALLOW_DYNAMICS */ #endif /* SEAICE_CGRID */ RETURN diff --git a/pkg/seaice/seaice_model.F b/pkg/seaice/seaice_model.F index 4b205e90a1..27a6483821 100644 --- a/pkg/seaice/seaice_model.F +++ b/pkg/seaice/seaice_model.F @@ -23,7 +23,8 @@ SUBROUTINE SEAICE_MODEL( myTime, myIter, myThid ) C | Parallel forward ice model written by Jinlun Zhang PSC/UW| C | & coupled into MITgcm by Dimitris Menemenlis (JPL) 2/2001| C | zhang@apl.washington.edu / menemenlis@jpl.nasa.gov | -C *===========================================================* +C | o The code has been rewritten substantially to use the | +C | MITgcm C-grid, see Losch et al. OM, 33, 129- 144, 2010 | C *===========================================================* IMPLICIT NONE C \ev @@ -64,7 +65,7 @@ SUBROUTINE SEAICE_MODEL( myTime, myIter, myThid ) #ifdef ALLOW_SITRACER INTEGER iTr #endif -#ifndef SEAICE_CGRID +#ifdef SEAICE_BGRID_DYNAMICS _RL uLoc(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) _RL vLoc(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) #endif @@ -147,7 +148,7 @@ SUBROUTINE SEAICE_MODEL( myTime, myIter, myThid ) CADJ STORE heff = comlev1, key=ikey_dynamics, kind=isbyte CADJ STORE area = comlev1, key=ikey_dynamics, kind=isbyte CADJ STORE hsnow = comlev1, key=ikey_dynamics, kind=isbyte -# if (defined SEAICE_ALLOW_DYNAMICS) && (defined SEAICE_CGRID) +# ifdef SEAICE_CGRID CADJ STORE fu = comlev1, key=ikey_dynamics, kind=isbyte CADJ STORE fv = comlev1, key=ikey_dynamics, kind=isbyte # ifdef SEAICE_ALLOW_EVP @@ -155,26 +156,28 @@ SUBROUTINE SEAICE_MODEL( myTime, myIter, myThid ) CADJ STORE seaice_sigma2 = comlev1, key=ikey_dynamics, kind=isbyte CADJ STORE seaice_sigma12 = comlev1, key=ikey_dynamics, kind=isbyte # endif /* SEAICE_ALLOW_EVP */ -# endif /* SEAICE_ALLOW_DYNAMICS) && SEAICE_CGRID */ +# endif /* SEAICE_CGRID */ # ifdef ALLOW_SITRACER CADJ STORE siceload = comlev1, key=ikey_dynamics, kind=isbyte CADJ STORE sitracer = comlev1, key=ikey_dynamics, kind=isbyte # endif #endif /* ALLOW_AUTODIFF_TAMC */ -C solve ice momentum equations and calculate ocean surface stress +C-- Solve ice momentum equations and calculate ocean surface stress. +C The surface stress always needs to be updated, even if neither B- +C or C-grid dynamics are compiled, and SEAICEuseDYNAMICS = F. #ifdef ALLOW_DEBUG IF (debugMode) CALL DEBUG_CALL( 'SEAICE_DYNSOLVER', myThid ) #endif -#ifdef SEAICE_CGRID - CALL TIMER_START('SEAICE_DYNSOLVER [SEAICE_MODEL]',myThid) - CALL SEAICE_DYNSOLVER ( myTime, myIter, myThid ) - CALL TIMER_STOP ('SEAICE_DYNSOLVER [SEAICE_MODEL]',myThid) -#else +#ifdef SEAICE_BGRID_DYNAMICS CALL TIMER_START('DYNSOLVER [SEAICE_MODEL]',myThid) CALL DYNSOLVER ( myTime, myIter, myThid ) CALL TIMER_STOP ('DYNSOLVER [SEAICE_MODEL]',myThid) -#endif /* SEAICE_CGRID */ +#else /* use default C-grid solver */ + CALL TIMER_START('SEAICE_DYNSOLVER [SEAICE_MODEL]',myThid) + CALL SEAICE_DYNSOLVER ( myTime, myIter, myThid ) + CALL TIMER_STOP ('SEAICE_DYNSOLVER [SEAICE_MODEL]',myThid) +#endif C-- Apply ice velocity open boundary conditions #ifdef ALLOW_OBCS @@ -183,8 +186,7 @@ SUBROUTINE SEAICE_MODEL( myTime, myIter, myThid ) # endif /* DISABLE_SEAICE_OBCS */ #endif /* ALLOW_OBCS */ -#if (defined ALLOW_AUTODIFF_TAMC) && (defined SEAICE_ALLOW_DYNAMICS) \ - && (defined SEAICE_CGRID) +#if ( defined ALLOW_AUTODIFF_TAMC && defined SEAICE_CGRID ) CADJ STORE uice = comlev1, key=ikey_dynamics, kind=isbyte CADJ STORE vice = comlev1, key=ikey_dynamics, kind=isbyte C Note: Storing u/vice **after** seaice_dynsolver (and obcs_adjust_uvice) @@ -193,7 +195,7 @@ SUBROUTINE SEAICE_MODEL( myTime, myIter, myThid ) C complicated code in the backward integration (see pkg/autodiff), C the extra call would update the ice velocities with the wrong C set of flag values. -#endif /* ALLOW_AUTODIFF_TAMC && SEAICE_ALLOW_DYNAMICS && SEAICE_CGRID */ +#endif #ifdef ALLOW_THSICE IF ( useThSice ) THEN @@ -213,11 +215,13 @@ SUBROUTINE SEAICE_MODEL( myTime, myIter, myThid ) #ifdef ALLOW_DEBUG IF (debugMode) CALL DEBUG_CALL( 'SEAICE_ADVDIFF', myThid ) #endif -#ifdef SEAICE_CGRID - CALL SEAICE_ADVDIFF( uIce, vIce, myTime, myIter, myThid ) -#else /* SEAICE_CGRID */ +C-- There always needs to be advection, even if neither B- or C-grid +C dynamics are compiled. +#ifdef SEAICE_BGRID_DYNAMICS CALL SEAICE_ADVDIFF( uLoc, vLoc, myTime, myIter, myThid ) -#endif /* SEAICE_CGRID */ +#else /* default C-grid advection */ + CALL SEAICE_ADVDIFF( uIce, vIce, myTime, myIter, myThid ) +#endif ENDIF #ifdef ALLOW_AUTODIFF_TAMC CADJ STORE heff = comlev1, key=ikey_dynamics, kind=isbyte @@ -253,17 +257,17 @@ SUBROUTINE SEAICE_MODEL( myTime, myIter, myThid ) C must call growth after calling advection C because of ugly time level business IF ( usePW79thermodynamics ) THEN -#ifdef SEAICE_USE_GROWTH_ADX -#ifdef ALLOW_DEBUG +# ifdef SEAICE_USE_GROWTH_ADX +# ifdef ALLOW_DEBUG IF (debugMode) CALL DEBUG_CALL( 'SEAICE_GROWTH_ADX', myThid ) -#endif +# endif CALL SEAICE_GROWTH_ADX( myTime, myIter, myThid ) -#else -#ifdef ALLOW_DEBUG +# else /* SEAICE_USE_GROWTH_ADX */ +# ifdef ALLOW_DEBUG IF (debugMode) CALL DEBUG_CALL( 'SEAICE_GROWTH', myThid ) -#endif +# endif CALL SEAICE_GROWTH( myTime, myIter, myThid ) -#endif +# endif /* SEAICE_USE_GROWTH_ADX */ ELSE #endif /* DISABLE_SEAICE_GROWTH */ DO bj=myByLo(myThid),myByHi(myThid) diff --git a/pkg/seaice/seaice_monitor.F b/pkg/seaice/seaice_monitor.F index 9e18f471a5..089e8d76c2 100644 --- a/pkg/seaice/seaice_monitor.F +++ b/pkg/seaice/seaice_monitor.F @@ -100,14 +100,12 @@ SUBROUTINE SEAICE_MONITOR( #ifdef SEAICE_CGRID CALL MON_WRITESTATS_RL( 1, UICE, '_uice', & maskInW, maskInW, rAw, drF, dummyRL, myThid ) -#else - CALL MON_WRITESTATS_RL( 1, UICE, '_uice', - & UVM, UVM, rAz, drF, dummyRL, myThid ) -#endif -#ifdef SEAICE_CGRID CALL MON_WRITESTATS_RL( 1, VICE, '_vice', & maskInS, maskInS, rAs, drF, dummyRL, myThid ) -#else +#endif +#ifdef SEAICE_BGRID_DYNAMICS + CALL MON_WRITESTATS_RL( 1, UICE, '_uice', + & UVM, UVM, rAz, drF, dummyRL, myThid ) CALL MON_WRITESTATS_RL( 1, VICE, '_vice', & UVM, UVM, rAz, drF, dummyRL, myThid ) #endif diff --git a/pkg/seaice/seaice_monitor_ad.F b/pkg/seaice/seaice_monitor_ad.F index 170f7e1152..818c9acb13 100644 --- a/pkg/seaice/seaice_monitor_ad.F +++ b/pkg/seaice/seaice_monitor_ad.F @@ -109,14 +109,12 @@ SUBROUTINE ADSEAICE_MONITOR( #ifdef SEAICE_CGRID CALL MON_WRITESTATS_RL( 1, ADUICE, '_aduice', & maskInW, maskInW, rAw, drF, dummyRL, myThid ) -#else - CALL MON_WRITESTATS_RL( 1, ADUICE, '_aduice', - & UVM, UVM, rAz, drF, dummyRL, myThid ) -#endif -#ifdef SEAICE_CGRID CALL MON_WRITESTATS_RL( 1, ADVICE, '_advice', & maskInS, maskInS, rAs, drF, dummyRL, myThid ) -#else +#endif +#ifdef SEAICE_BGRID_DYNAMICS + CALL MON_WRITESTATS_RL( 1, ADUICE, '_aduice', + & UVM, UVM, rAz, drF, dummyRL, myThid ) CALL MON_WRITESTATS_RL( 1, ADVICE, '_advice', & UVM, UVM, rAz, drF, dummyRL, myThid ) #endif diff --git a/pkg/seaice/seaice_ocean_stress.F b/pkg/seaice/seaice_ocean_stress.F index cc7abe5ece..2480649fb8 100644 --- a/pkg/seaice/seaice_ocean_stress.F +++ b/pkg/seaice/seaice_ocean_stress.F @@ -40,7 +40,6 @@ SUBROUTINE SEAICE_OCEAN_STRESS( INTEGER myIter INTEGER myThid -#ifdef SEAICE_CGRID C !LOCAL VARIABLES: C i,j,bi,bj :: Loop counters C kSrf :: vertical index of surface layer @@ -77,7 +76,9 @@ SUBROUTINE SEAICE_OCEAN_STRESS( & * SEAICEstressFactor fu(I,J,bi,bj)=(ONE-areaW)*fu(I,J,bi,bj) & + areaW*windTauX(I,J,bi,bj) +#ifdef SEAICE_CGRID & + stressDivergenceX(I,J,bi,bj) * SEAICEstressFactor +#endif ENDDO ENDDO C This loop separation makes the adjoint code vectorize @@ -87,7 +88,9 @@ SUBROUTINE SEAICE_OCEAN_STRESS( & * SEAICEstressFactor fv(I,J,bi,bj)=(ONE-areaS)*fv(I,J,bi,bj) & + areaS*windTauY(I,J,bi,bj) +#ifdef SEAICE_CGRID & + stressDivergenceY(I,J,bi,bj) * SEAICEstressFactor +#endif ENDDO ENDDO ENDDO @@ -138,7 +141,5 @@ SUBROUTINE SEAICE_OCEAN_STRESS( ENDIF CALL EXCH_UV_XY_RS(fu, fv, .TRUE., myThid) -#endif /* SEAICE_CGRID */ - RETURN END diff --git a/pkg/seaice/seaice_oceandrag_coeffs.F b/pkg/seaice/seaice_oceandrag_coeffs.F index ae35a61ef4..8386d3c7a2 100644 --- a/pkg/seaice/seaice_oceandrag_coeffs.F +++ b/pkg/seaice/seaice_oceandrag_coeffs.F @@ -51,7 +51,7 @@ SUBROUTINE SEAICE_OCEANDRAG_COEFFS( C CwatC :: drag coefficients _RL CwatC(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) -#if ( (defined SEAICE_CGRID) && (defined SEAICE_ALLOW_DYNAMICS) ) +#ifdef SEAICE_CGRID C === local variables === C i,j,bi,bj,ksrf :: loop indices INTEGER i,j,bi,bj @@ -110,7 +110,7 @@ SUBROUTINE SEAICE_OCEANDRAG_COEFFS( ENDDO ENDDO -#endif /* SEAICE_ALLOW_DYNAMICS and SEAICE_CGRID */ +#endif /* SEAICE_CGRID */ RETURN END diff --git a/pkg/seaice/seaice_preconditioner.F b/pkg/seaice/seaice_preconditioner.F index 0a280771a3..74de68182d 100644 --- a/pkg/seaice/seaice_preconditioner.F +++ b/pkg/seaice/seaice_preconditioner.F @@ -68,7 +68,8 @@ SUBROUTINE SEAICE_PRECONDITIONER( _RL dvIce(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) CEOP -#if (defined SEAICE_ALLOW_DYNAMICS && defined SEAICE_ALLOW_JFNK) +#if ( defined SEAICE_CGRID && \ + ( defined SEAICE_ALLOW_JFNK || defined SEAICE_ALLOW_KRYLOV ) ) C !FUNCTIONS: LOGICAL DIFFERENT_MULTIPLE EXTERNAL DIFFERENT_MULTIPLE @@ -633,7 +634,7 @@ SUBROUTINE SEAICE_PRECOND_RHSV ( ENDDO ENDIF -#endif /* SEAICE_ALLOW_JFNK */ +#endif /* SEAICE_CGRID, SEAICE_ALLOW_JFNK and KRYLOV */ RETURN END diff --git a/pkg/seaice/seaice_readparms.F b/pkg/seaice/seaice_readparms.F index 4d8c8c15a4..1975e9210d 100644 --- a/pkg/seaice/seaice_readparms.F +++ b/pkg/seaice/seaice_readparms.F @@ -234,7 +234,7 @@ SUBROUTINE SEAICE_READPARMS( myThid ) _BEGIN_MASTER(myThid) C-- set default sea ice parameters -#ifdef SEAICE_ALLOW_DYNAMICS +#if ( defined SEAICE_CGRID || defined SEAICE_BGRID_DYNAMICS ) SEAICEuseDYNAMICS = .TRUE. #else SEAICEuseDYNAMICS = .FALSE. diff --git a/pkg/shelfice/shelfice_ad_check_lev2_dir.h b/pkg/shelfice/shelfice_ad_check_lev2_dir.h index 6c5c5c13fb..80b6495ffd 100644 --- a/pkg/shelfice/shelfice_ad_check_lev2_dir.h +++ b/pkg/shelfice/shelfice_ad_check_lev2_dir.h @@ -1,4 +1,5 @@ #ifdef ALLOW_SHELFICE +CADJ STORE phi0surf = tapelev2, key = ilev_2 CADJ STORE shelficeMass = tapelev2, key = ilev_2 CADJ STORE kTopC = tapelvi2, key = ilev_2 CADJ STORE shelficeForcingT = tapelev2, key = ilev_2 diff --git a/pkg/shelfice/shelfice_ad_check_lev3_dir.h b/pkg/shelfice/shelfice_ad_check_lev3_dir.h index 9f0208de4c..993a1ced6b 100644 --- a/pkg/shelfice/shelfice_ad_check_lev3_dir.h +++ b/pkg/shelfice/shelfice_ad_check_lev3_dir.h @@ -1,4 +1,5 @@ #ifdef ALLOW_SHELFICE +CADJ STORE phi0surf = tapelev3, key = ilev_3 CADJ STORE shelficeMass = tapelev3, key = ilev_3 CADJ STORE kTopC = tapelvi3, key = ilev_3 CADJ STORE shelficeForcingT = tapelev3, key = ilev_3 diff --git a/pkg/shelfice/shelfice_ad_check_lev4_dir.h b/pkg/shelfice/shelfice_ad_check_lev4_dir.h index fed8e59cb7..8d698b4aee 100644 --- a/pkg/shelfice/shelfice_ad_check_lev4_dir.h +++ b/pkg/shelfice/shelfice_ad_check_lev4_dir.h @@ -1,4 +1,5 @@ #ifdef ALLOW_SHELFICE +CADJ STORE phi0surf = tapelev4, key = ilev_4 CADJ STORE shelficeMass = tapelev4, key = ilev_4 CADJ STORE kTopC = tapelvi4, key = ilev_4 CADJ STORE shelficeForcingT = tapelev4, key = ilev_4 diff --git a/pkg/smooth/smooth_diff2d.F b/pkg/smooth/smooth_diff2d.F index a1c408492f..3e95365a97 100644 --- a/pkg/smooth/smooth_diff2d.F +++ b/pkg/smooth/smooth_diff2d.F @@ -1,7 +1,4 @@ #include "SMOOTH_OPTIONS.h" -#ifdef ALLOW_AUTODIFF -# include "AUTODIFF_OPTIONS.h" -#endif SUBROUTINE SMOOTH_DIFF2D( & fld_in, smooth2Dmask, nbt_in, myThid ) @@ -16,9 +13,6 @@ SUBROUTINE SMOOTH_DIFF2D( #include "EEPARAMS.h" #include "GRID.h" #include "PARAMS.h" -#ifdef ALLOW_AUTODIFF_TAMC -#include "tamc.h" -#endif /* ALLOW_AUTODIFF_TAMC */ #include "SMOOTH.h" _RL fld_in (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) @@ -32,20 +26,6 @@ SUBROUTINE SMOOTH_DIFF2D( _RL gt_tmp _RL gt_in (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) _RL gtm1_in(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) -#ifdef ALLOW_TAMC_CHECKPOINTING - INTEGER ilev_1, ilev_2, ilev_3 - INTEGER max_lev2, max_lev3, key_in -#endif - -#ifdef ALLOW_TAMC_CHECKPOINTING -c for now: useless, because level 3 is recomputed anyway -c but : if level3 was computed during the fwd loop by calling -c mdsmooth_diff3D (assumes that it would be called -c directly by the_main_loop) then I would need to pass key_in -c as a parameter, with different values for T, S, ... -c in order not to overwrite the same tape - key_in = 0 -#endif DO bj=myByLo(myThid),myByHi(myThid) DO bi=myBxLo(myThid),myBxHi(myThid) @@ -62,52 +42,7 @@ SUBROUTINE SMOOTH_DIFF2D( CALL EXCH_XY_RL( gt_in, myThid ) CALL EXCH_XY_RL( gtm1_in, myThid ) -#ifdef ALLOW_TAMC_CHECKPOINTING - -c checkpointing: - max_lev3 = nbt_in/(nchklev_1*nchklev_2)+1 - max_lev2 = nbt_in/nchklev_1+1 -#ifdef ALLOW_AUTODIFF_TAMC -CADJ INIT tape_smooth2D_lev3 = USER -#endif /* ALLOW_AUTODIFF_TAMC */ - DO ilev_3 = 1,nchklev_3 - IF (ilev_3.LE.max_lev3) THEN -#ifdef ALLOW_AUTODIFF_TAMC -CADJ STORE fld_in = tape_smooth2D_lev3 , -CADJ & key = key_in*max_lev3 + ilev_3 -CADJ STORE gTm1_in = tape_smooth2D_lev3 , -CADJ & key = key_in*max_lev3 + ilev_3 -#endif /* ALLOW_AUTODIFF_TAMC */ -#ifdef ALLOW_AUTODIFF_TAMC -CADJ INIT tape_smooth2D_lev2 = USER -#endif /* ALLOW_AUTODIFF_TAMC */ - - DO ilev_2 = 1,nchklev_2 - IF (ilev_2.LE.max_lev2) THEN -#ifdef ALLOW_AUTODIFF_TAMC -CADJ STORE fld_in = tape_smooth2D_lev2 , -CADJ & key = key_in*nchklev_2 + ilev_2 -CADJ STORE gTm1_in = tape_smooth2D_lev2 , -CADJ & key = key_in*nchklev_2 + ilev_2 -#endif /* ALLOW_AUTODIFF_TAMC */ -#ifdef ALLOW_AUTODIFF_TAMC -CADJ INIT tape_smooth2D_lev1 = COMMON, nchklev_1*nSx*nSy -#endif /* ALLOW_AUTODIFF_TAMC */ - - DO ilev_1 = 1,nchklev_1 - iloop = (ilev_2 - 1)*nchklev_1 + ilev_1 - & + (ilev_3 - 1)*nchklev_2*nchklev_1 - IF ( iloop .LE. nbt_in ) THEN -#ifdef ALLOW_AUTODIFF_TAMC -c needed?? CADJ STORE fld_in = tape_smooth2D_lev1 , -c CADJ & key = key_in*nchklev_1 + ilev_1 -CADJ STORE gtm1_in = tape_smooth2D_lev1 , -CADJ & key = key_in*nchklev_1 + ilev_1 -#endif /* ALLOW_AUTODIFF_TAMC */ - -#else /* ALLOW_TAMC_CHECKPOINTING */ DO iloop=1,nbt_in -#endif DO bj=myByLo(myThid),myByHi(myThid) DO bi=myBxLo(myThid),myBxHi(myThid) @@ -179,16 +114,7 @@ SUBROUTINE SMOOTH_DIFF2D( CALL EXCH_XY_RL( fld_in, myThid ) CALL EXCH_XY_RL( gtm1_in, myThid ) -#ifdef ALLOW_TAMC_CHECKPOINTING - ENDIF - ENDDO - ENDIF - ENDDO - ENDIF - ENDDO -#else /* ALLOW_TAMC_CHECKPOINTING */ ENDDO -#endif RETURN END diff --git a/pkg/smooth/smooth_diff3d.F b/pkg/smooth/smooth_diff3d.F index 54b431a3b8..6338013f69 100644 --- a/pkg/smooth/smooth_diff3d.F +++ b/pkg/smooth/smooth_diff3d.F @@ -1,7 +1,4 @@ #include "SMOOTH_OPTIONS.h" -#ifdef ALLOW_AUTODIFF -# include "AUTODIFF_OPTIONS.h" -#endif SUBROUTINE SMOOTH_DIFF3D( fld_in, nbt_in, myThid ) @@ -15,9 +12,6 @@ SUBROUTINE SMOOTH_DIFF3D( fld_in, nbt_in, myThid ) #include "SIZE.h" #include "PARAMS.h" #include "GRID.h" -#ifdef ALLOW_AUTODIFF_TAMC -#include "tamc.h" -#endif /* ALLOW_AUTODIFF_TAMC */ #include "SMOOTH.h" _RL fld_in(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) @@ -29,20 +23,6 @@ SUBROUTINE SMOOTH_DIFF3D( fld_in, nbt_in, myThid ) _RL gT_in (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) _RL gTm1_in(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) _RL gt_AB (1-OLx:sNx+OLx,1-OLy:sNy+OLy) -#ifdef ALLOW_TAMC_CHECKPOINTING - INTEGER ilev_1, ilev_2, ilev_3 - INTEGER max_lev2, max_lev3, key_in -#endif - -#ifdef ALLOW_TAMC_CHECKPOINTING -c for now: useless, because level 3 is recomputed anyway -c but : if level3 was computed during the fwd loop by callung -c mdsmooth_diff3D (assumes that it would be called -c directly by the_main_loop) then I would need to pass key_in -c as a parameter, with different values for T, S, ... -c in order not to overwrite the same tape - key_in = 0 -#endif DO bj=myByLo(myThid),myByHi(myThid) DO bi=myBxLo(myThid),myBxHi(myThid) @@ -61,49 +41,7 @@ SUBROUTINE SMOOTH_DIFF3D( fld_in, nbt_in, myThid ) CALL EXCH_XYZ_RL( gt_in, myThid ) CALL EXCH_XYZ_RL( gtm1_in, myThid ) -#ifdef ALLOW_TAMC_CHECKPOINTING - -c checkpointing: - max_lev3=nbt_in/(nchklev_1*nchklev_2)+1 - max_lev2=nbt_in/nchklev_1+1 -#ifdef ALLOW_AUTODIFF_TAMC -CADJ INIT tape_smooth_lev3 = USER -#endif /* ALLOW_AUTODIFF_TAMC */ - DO ilev_3 = 1,nchklev_3 - IF (ilev_3.LE.max_lev3) THEN -#ifdef ALLOW_AUTODIFF_TAMC -CADJ STORE fld_in = tape_smooth_lev3 , -CADJ & key = key_in*max_lev3 + ilev_3 -CADJ STORE gTm1_in = tape_smooth_lev3 , -CADJ & key = key_in*max_lev3 + ilev_3 -#endif /* ALLOW_AUTODIFF_TAMC */ -#ifdef ALLOW_AUTODIFF_TAMC -CADJ INIT tape_smooth_lev2 = USER -#endif /* ALLOW_AUTODIFF_TAMC */ - DO ilev_2 = 1,nchklev_2 - IF (ilev_2.LE.max_lev2) THEN -#ifdef ALLOW_AUTODIFF_TAMC -CADJ STORE fld_in = tape_smooth_lev2 , -CADJ & key = key_in*nchklev_2 + ilev_2 -CADJ STORE gTm1_in = tape_smooth_lev2 , -CADJ & key = key_in*nchklev_2 + ilev_2 -#endif /* ALLOW_AUTODIFF_TAMC */ -#ifdef ALLOW_AUTODIFF_TAMC -CADJ INIT tape_smooth_lev1 = COMMON, nchklev_1*nsx*nsy -#endif /* ALLOW_AUTODIFF_TAMC */ - DO ilev_1 = 1,nchklev_1 - iloop = (ilev_2 - 1)*nchklev_1 + ilev_1 - & + (ilev_3 - 1)*nchklev_2*nchklev_1 - IF ( iloop .LE. nbt_in ) THEN - -#ifdef ALLOW_AUTODIFF_TAMC -CADJ STORE gTm1_in(:,:,:,bi,bj) = tape_smooth_lev1 , -CADJ & key = key_in*nchklev_1 + ilev_1 -#endif /* ALLOW_AUTODIFF_TAMC */ - -#else /* ALLOW_TAMC_CHECKPOINTING */ DO iloop=1,nbt_in -#endif DO bj=myByLo(myThid),myByHi(myThid) DO bi=myBxLo(myThid),myBxHi(myThid) @@ -120,7 +58,7 @@ SUBROUTINE SMOOTH_DIFF3D( fld_in, nbt_in, myThid ) CALL EXCH_XYZ_RL( gt_in, myThid ) c compute gT_in: - CALL smooth_rhs( fld_in, gT_in, myThid ) + CALL SMOOTH_RHS( fld_in, gT_in, myThid ) DO bj=myByLo(myThid),myByHi(myThid) DO bi=myBxLo(myThid),myBxHi(myThid) @@ -146,11 +84,6 @@ SUBROUTINE SMOOTH_DIFF3D( fld_in, nbt_in, myThid ) ENDDO ENDDO -#ifdef ALLOW_AUTODIFF_TAMC -CADJ STORE fld_in(:,:,:,bi,bj) = tape_smooth_lev1, -CADJ & key = key_in*nchklev_1 + ilev_1 -#endif /* ALLOW_AUTODIFF_TAMC */ - IF ( smooth3DdoImpldiff ) THEN CALL SMOOTH_IMPLDIFF( I bi, bj, 1, sNx, 1, sNy , @@ -167,16 +100,7 @@ SUBROUTINE SMOOTH_DIFF3D( fld_in, nbt_in, myThid ) CALL EXCH_XYZ_RL ( gt_in , myThid ) CALL EXCH_XYZ_RL ( gtm1_in , myThid ) -#ifdef ALLOW_TAMC_CHECKPOINTING - ENDIF - ENDDO - ENDIF - ENDDO - ENDIF - ENDDO -#else /* ALLOW_TAMC_CHECKPOINTING */ ENDDO -#endif RETURN END diff --git a/pkg/thsice/thsice_ad_check_lev2_dir.h b/pkg/thsice/thsice_ad_check_lev2_dir.h index 8d4d192ec1..e9759053b8 100644 --- a/pkg/thsice/thsice_ad_check_lev2_dir.h +++ b/pkg/thsice/thsice_ad_check_lev2_dir.h @@ -1,23 +1,12 @@ -CADJ STORE iceMask = tapelev2, key = ilev_2 +CADJ STORE iceMask = tapelev2, key = ilev_2 CADJ STORE iceHeight = tapelev2, key = ilev_2 CADJ STORE snowHeight = tapelev2, key = ilev_2 -CADJ STORE snowAge = tapelev2, key = ilev_2 -CADJ STORE Tsrf = tapelev2, key = ilev_2 -CADJ STORE Qice1 = tapelev2, key = ilev_2 -CADJ STORE Qice2 = tapelev2, key = ilev_2 -CADJ STORE hOceMxL = tapelev2, key = ilev_2 -CADJ STORE ocefwfx = tapelev2, key = ilev_2 -CADJ STORE oceqnet = tapelev2, key = ilev_2 -CADJ STORE ocesflx = tapelev2, key = ilev_2 - -CADJ STORE saltflux = tapelev2, key = ilev_2 - -#ifdef ATMOSPHERIC_LOADING -CADJ STORE siceload = tapelev2, key = ilev_2 -#endif - -CADJ STORE sheating = tapelev2, key = ilev_2 -CADJ STORE tice1,tice2 = tapelev2, key = ilev_2 +CADJ STORE snowAge = tapelev2, key = ilev_2 +CADJ STORE Tsrf = tapelev2, key = ilev_2 +CADJ STORE Qice1 = tapelev2, key = ilev_2 +CADJ STORE Qice2 = tapelev2, key = ilev_2 +CADJ STORE hOceMxL = tapelev2, key = ilev_2 +CADJ STORE sheating = tapelev2, key = ilev_2 #ifdef ALLOW_THSICE_COST_TEST CADJ STORE objf_thsice = tapelev2, key = ilev_2 diff --git a/pkg/thsice/thsice_ad_check_lev3_dir.h b/pkg/thsice/thsice_ad_check_lev3_dir.h index a90977981a..e18c7ce32a 100644 --- a/pkg/thsice/thsice_ad_check_lev3_dir.h +++ b/pkg/thsice/thsice_ad_check_lev3_dir.h @@ -1,23 +1,12 @@ CADJ STORE iceMask = tapelev3, key = ilev_3 CADJ STORE iceHeight = tapelev3, key = ilev_3 CADJ STORE snowHeight = tapelev3, key = ilev_3 -CADJ STORE snowAge = tapelev3, key = ilev_3 -CADJ STORE Tsrf = tapelev3, key = ilev_3 -CADJ STORE Qice1 = tapelev3, key = ilev_3 -CADJ STORE Qice2 = tapelev3, key = ilev_3 -CADJ STORE hOceMxL = tapelev3, key = ilev_3 -CADJ STORE ocefwfx = tapelev3, key = ilev_3 -CADJ STORE oceqnet = tapelev3, key = ilev_3 -CADJ STORE ocesflx = tapelev3, key = ilev_3 - -CADJ STORE saltflux = tapelev3, key = ilev_3 - -#ifdef ATMOSPHERIC_LOADING -CADJ STORE siceload = tapelev3, key = ilev_3 -#endif - -CADJ STORE sheating = tapelev3, key = ilev_3 -CADJ STORE tice1,tice2 = tapelev3, key = ilev_3 +CADJ STORE snowAge = tapelev3, key = ilev_3 +CADJ STORE Tsrf = tapelev3, key = ilev_3 +CADJ STORE Qice1 = tapelev3, key = ilev_3 +CADJ STORE Qice2 = tapelev3, key = ilev_3 +CADJ STORE hOceMxL = tapelev3, key = ilev_3 +CADJ STORE sheating = tapelev3, key = ilev_3 #ifdef ALLOW_THSICE_COST_TEST CADJ STORE objf_thsice = tapelev3, key = ilev_3 diff --git a/pkg/thsice/thsice_ad_check_lev4_dir.h b/pkg/thsice/thsice_ad_check_lev4_dir.h index 78f0e63863..75d707297e 100644 --- a/pkg/thsice/thsice_ad_check_lev4_dir.h +++ b/pkg/thsice/thsice_ad_check_lev4_dir.h @@ -1,23 +1,12 @@ CADJ STORE iceMask = tapelev4, key = ilev_4 CADJ STORE iceHeight = tapelev4, key = ilev_4 CADJ STORE snowHeight = tapelev4, key = ilev_4 -CADJ STORE snowAge = tapelev4, key = ilev_4 -CADJ STORE Tsrf = tapelev4, key = ilev_4 -CADJ STORE Qice1 = tapelev4, key = ilev_4 -CADJ STORE Qice2 = tapelev4, key = ilev_4 -CADJ STORE hOceMxL = tapelev4, key = ilev_4 -CADJ STORE ocefwfx = tapelev4, key = ilev_4 -CADJ STORE oceqnet = tapelev4, key = ilev_4 -CADJ STORE ocesflx = tapelev4, key = ilev_4 - -CADJ STORE saltflux = tapelev4, key = ilev_4 - -#ifdef ATMOSPHERIC_LOADING -CADJ STORE siceload = tapelev4, key = ilev_4 -#endif - -CADJ STORE sheating = tapelev4, key = ilev_4 -CADJ STORE tice1,tice2 = tapelev4, key = ilev_4 +CADJ STORE snowAge = tapelev4, key = ilev_4 +CADJ STORE Tsrf = tapelev4, key = ilev_4 +CADJ STORE Qice1 = tapelev4, key = ilev_4 +CADJ STORE Qice2 = tapelev4, key = ilev_4 +CADJ STORE hOceMxL = tapelev4, key = ilev_4 +CADJ STORE sheating = tapelev4, key = ilev_4 #ifdef ALLOW_THSICE_COST_TEST CADJ STORE objf_thsice = tapelev4, key = ilev_4 diff --git a/verification/1D_ocean_ice_column/code/SEAICE_OPTIONS.h b/verification/1D_ocean_ice_column/code/SEAICE_OPTIONS.h index 4fa80e74d7..b52657adb4 100644 --- a/verification/1D_ocean_ice_column/code/SEAICE_OPTIONS.h +++ b/verification/1D_ocean_ice_column/code/SEAICE_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef SEAICE_OPTIONS_H +#define SEAICE_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + C *==========================================================* C | SEAICE_OPTIONS.h C | o CPP options file for sea ice package. @@ -6,24 +11,12 @@ C | Use this file for selecting options within the sea ice C | package. C *==========================================================* -#ifndef SEAICE_OPTIONS_H -#define SEAICE_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_SEAICE -C Package-specific Options & Macros go here +C--- Package-specific Options & Macros go here C-- Write "text-plots" of certain fields in STDOUT for debugging. #undef SEAICE_DEBUG -C-- Allow sea-ice dynamic code. -C This option is provided to allow use of TAMC -C on the thermodynamics component of the code only. -C Sea-ice dynamics can also be turned off at runtime -C using variable SEAICEuseDYNAMICS. -#define SEAICE_ALLOW_DYNAMICS - C-- By default, the sea-ice package uses its own integrated bulk C formulae to compute fluxes (fu, fv, EmPmR, Qnet, and Qsw) over C open-ocean. When this flag is set, these variables are computed @@ -42,8 +35,6 @@ C-- run with sea Ice Thickness Distribution (ITD); C set number of categories (nITD) in SEAICE_SIZE.h #undef SEAICE_ITD -#undef SEAICE_MODIFY_GROWTH_ADJ - C-- Since the missing sublimation term is now included C this flag is needed for backward compatibility #define SEAICE_DISABLE_SUBLIM @@ -57,66 +48,116 @@ C seaice with a fraction (=SEAICE_saltFrac) of freezing seawater salinity. C- Note: SItracer also offers an alternative way to handle variable salinity. #define SEAICE_VARIABLE_SALINITY -C-- Tracers of ice and/or ice cover. -#undef ALLOW_SITRACER -#ifdef ALLOW_SITRACER -C-- To try avoid 'spontaneous generation' of tracer maxima by advdiff. -# define ALLOW_SITRACER_ADVCAP -#endif - -C-- Enable grease ice parameterization -C The grease ice parameterization delays formation of solid -C sea ice from frazil ice by a time constant and provides a -C dynamic calculation of the initial solid sea ice thickness -C HO as a function of winds, currents and available grease ice -C volume. Grease ice does not significantly reduce heat loss -C from the ocean in winter and area covered by grease is thus -C handled like open water. -C (For details see Smedsrud and Martin, 2014, Ann.Glac.) +C-- Enable grease ice parameterization (requires to define ALLOW_SITRACER): +C The grease ice parameterization delays formation of solid sea ice from +C frazil ice by a time constant and provides a dynamic calculation of the +C initial solid sea ice thickness HO as a function of winds, currents and +C available grease ice volume. Grease ice does not significantly reduce heat +C loss from the ocean in winter and area covered by grease is thus handled +C like open water (For details see Smedsrud and Martin, 2014, Ann.Glac.). C Set SItrName(1) = 'grease' in namelist SEAICE_PARM03 in data.seaice C then output SItr01 is SItrNameLong(1) = 'grease ice volume fraction', -C with SItrUnit(1) = '[0-1]', which needs to be multiplied by SIheff -C to yield grease ice volume. Additionally, the actual grease ice -C layer thickness (diagnostic SIgrsLT) can be saved. +C with SItrUnit(1) = '[0-1]', which needs to be multiplied by SIheff to +C yield grease ice volume. Additionally, the actual grease ice layer +C thickness (diagnostic SIgrsLT) can be saved. #undef SEAICE_GREASE -C-- grease ice uses SItracer: + +C-- Tracers of ice and/or ice cover. #ifdef SEAICE_GREASE +C SEAICE_GREASE code requires to define ALLOW_SITRACER # define ALLOW_SITRACER -# define ALLOW_SITRACER_ADVCAP +#else +# undef ALLOW_SITRACER #endif +#ifdef ALLOW_SITRACER +C- To try avoid 'spontaneous generation' of tracer maxima by advdiff. +# define ALLOW_SITRACER_ADVCAP + +C- Include code to diagnose sea ice tracer budgets in +C seaice_advdiff.F and seaice_tracer_phys.F. Diagnostics are +C computed the "call diagnostics_fill" statement is commented out. +# undef ALLOW_SITRACER_DEBUG_DIAG +#endif /* ALLOW_SITRACER */ + +C-- Allow sea-ice dynamic code. These options are provided so that, +C if turned off (#undef), to compile (and process with TAF) only the +C the thermodynamics component of the code. Note that, if needed, +C sea-ice dynamics can be turned off at runtime (SEAICEuseDYNAMICS=F). C-- Historically, the seaice model was discretized on a B-Grid. This -C discretization should still work but it is not longer actively tested -C and supported. The following flag should always be set in order to use -C the operational C-grid discretization. -#define SEAICE_CGRID +C discretization should still work but it is not longer actively +C tested and supported. Define this flag to compile it. It cannot be +C defined together with SEAICE_CGRID +#define SEAICE_BGRID_DYNAMICS + +C-- The following flag should always be set in order to use C the +C-- operational C-grid discretization. +#undef SEAICE_CGRID -C-- Only for the C-grid version it is possible to #ifdef SEAICE_CGRID +C-- Options for the C-grid version only: + C enable advection of sea ice momentum # undef SEAICE_ALLOW_MOM_ADVECTION + C enable JFNK code by defining the following flag # define SEAICE_ALLOW_JFNK + C enable Krylov code by defining the following flag # undef SEAICE_ALLOW_KRYLOV + +C-- Use a different order when mapping 2D velocity arrays to 1D vector +C before passing it to FGMRES. +# undef SEAICE_JFNK_MAP_REORDER + +C to reproduce old verification results for JFNK +# undef SEAICE_PRECOND_EXTRA_EXCHANGE + C enable LSR to use global (multi-tile) tri-diagonal solver # undef SEAICE_GLOBAL_3DIAG_SOLVER + C enable EVP code by defining the following flag # define SEAICE_ALLOW_EVP # ifdef SEAICE_ALLOW_EVP -C-- When set use SEAICE_zetaMin and SEAICE_evpDampC to limit viscosities +C- When set use SEAICE_zetaMin and SEAICE_evpDampC to limit viscosities C from below and above in seaice_evp: not necessary, and not recommended # undef SEAICE_ALLOW_CLIPZETA + +C Include code to avoid underflows in EVP-code (copied from CICE). +C Many compilers can handle this more efficiently with the help of a flag. +# undef SEAICE_EVP_ELIMINATE_UNDERFLOWS + +C Include code to print residual of EVP iteration for debugging/diagnostics +# undef ALLOW_SEAICE_EVP_RESIDUAL # endif /* SEAICE_ALLOW_EVP */ + C smooth regularization (without max-function) of delta for C better differentiability # undef SEAICE_DELTA_SMOOTHREG + C regularize zeta to zmax with a smooth tanh-function instead C of a min(zeta,zmax). This improves convergence of iterative C solvers (Lemieux and Tremblay 2009, JGR). No effect on EVP # undef SEAICE_ZETA_SMOOTHREG + +C-- Different yield curves within the VP rheology framework C allow the truncated ellipse rheology (runtime flag SEAICEuseTEM) # undef SEAICE_ALLOW_TEM + +C allow the use of the Mohr Coulomb rheology (runtime flag SEAICEuseMCS) +C as defined in (Ip 1991) /!\ This is known to give unstable results, +C use with caution +# undef SEAICE_ALLOW_MCS + +C allow the use of Mohr Coulomb with elliptical plastic potential +C (runtime flag SEAICEuseMCE) +# undef SEAICE_ALLOW_MCE + +C allow the teardrop and parabolic lens rheology +C (runtime flag SEAICEuseTD and SEAICEusePL) +# undef SEAICE_ALLOW_TEARDROP + +C-- LSR solver settings C Use LSR vector code; not useful on non-vector machines, because it C slows down convergence considerably, but the extra iterations are C more than made up by the much faster code on vector machines. For @@ -124,54 +165,108 @@ C the only regularly test vector machine these flags a specified C in the build options file SUPER-UX_SX-8_sxf90_awi, so that we comment C them out here. # undef SEAICE_VECTORIZE_LSR + C Use zebra-method (alternate lines) for line-successive-relaxation C This modification improves the convergence of the vector code C dramatically, so that is may actually be useful in general, but C that needs to be tested. Can be used without vectorization options. # undef SEAICE_LSR_ZEBRA + +C Include code to print residual of nonlinear outer loop of LSR +# undef SEAICE_ALLOW_CHECK_LSR_CONVERGENCE + +C This flag is also required for an actual adjoint of seaice_lsr; +C increases memory requirements a lot. +# undef SEAICE_LSR_ADJOINT_ITER + C Use parameterisation of grounding ice for a better representation C of fastice in shallow seas # undef SEAICE_ALLOW_BOTTOMDRAG -#else /* not SEAICE_CGRID, but old B-grid */ -C-- By default for B-grid dynamics solver wind stress under sea-ice is + +#endif /* SEAICE_CGRID */ + +#ifdef SEAICE_BGRID_DYNAMICS +C-- Options for the B-grid version only: + +C- By default for B-grid dynamics solver wind stress under sea-ice is C set to the same value as it would be if there was no sea-ice. C Define following CPP flag for B-grid ice-ocean stress coupling. # define SEAICE_BICE_STRESS -C-- By default for B-grid dynamics solver surface tilt is obtained +C- By default for B-grid dynamics solver surface tilt is obtained C indirectly via geostrophic velocities. Define following CPP C in order to use ETAN instead. # define EXPLICIT_SSH_SLOPE -C-- Defining this flag turns on FV-discretization of the B-grid LSOR solver. + +C- Defining this flag turns on FV-discretization of the B-grid LSOR solver. C It is smoother and includes all metric terms, similar to C-grid solvers. C It is here for completeness, but its usefulness is unclear. # undef SEAICE_LSRBNEW -#endif /* SEAICE_CGRID */ -C-- When set limit the Ice-Loading to mass of 1/5 of Surface ocean grid-box +#endif /* SEAICE_BGRID_DYNAMICS */ + +C-- Some regularisations +C- When set limit the Ice-Loading to mass of 1/5 of Surface ocean grid-box #undef SEAICE_CAP_ICELOAD -C-- When set use SEAICE_clipVelocties = .true., to clip U/VICE at 40cm/s, + +C- When set use SEAICE_clipVelocties = .true., to clip U/VICE at 40cm/s, C not recommended #undef SEAICE_ALLOW_CLIPVELS -C-- When set cap the sublimation latent heat flux in solve4temp according + +C- When set cap the sublimation latent heat flux in solve4temp according C to the available amount of ice+snow. Otherwise this term is treated C like all of the others -- residuals heat and fw stocks are passed to C the ocean at the end of seaice_growth in a conservative manner. C SEAICE_CAP_SUBLIM is not needed as of now, but kept just in case. #undef SEAICE_CAP_SUBLIM +C-- AD flags +C- TAF related flag, currently only used in seaice_ad_check_lev[1-4]_dir.h; +C it is unclear if this is ever needed. +#undef AUTODIFF_SOMETIMES_NEEDED + +C- Reset fields to zero to stabilise AD code of dynamics solver +C (resulting in wrong gradients) +#undef SEAICE_DYN_STABLE_ADJOINT + +C- Another flag to simplify dependencies for TAF-generated AD-code +C the thermodynamic part, mostly by resetting variables to zero +#undef SEAICE_MODIFY_GROWTH_ADJ + +C- Special seaice flag for AD testing +#undef SEAICE_EXCLUDE_FOR_EXACT_AD_TESTING + +C-- Use the adjointable sea-ice thermodynamic model +C in seaice_growth_adx.F instead of seaice_growth.F +C This options excludes more complex physics such +C as sublimation, ITD, and frazil. +#undef SEAICE_USE_GROWTH_ADX + +C-- These flags are not strictly AD-related but may help obtaining +C simpler AD-code: +C- Do not compile code that resets AREA (or AREAITD) to a mininum value +C of SEAICE_area_floor (=SIeps with default of 1e-5) if there is +C some finite sea ice thickness +#undef DISABLE_AREA_FLOOR + +C- Do not compile growth/thermodynamics code (avoiding this code can +C also be done by setting runtime parameter usePWthermodynamics=F) +#undef DISABLE_SEAICE_GROWTH + +C- Do not compile/use seaice-related obcs code when using obcs. +#undef DISABLE_SEAICE_OBCS + C-- Enable free drift code #undef SEAICE_ALLOW_FREEDRIFT C-- pkg/seaice cost functions compile flags -c >>> Sea-ice volume (requires pkg/cost) +C- Sea-ice volume (requires pkg/cost) #undef ALLOW_COST_ICE -c >>> Sea-ice misfit to obs (requires pkg/cost and ecco) -#undef ALLOW_SEAICE_COST_SMR_AREA +#ifdef ALLOW_COST_ICE +C- Enable template for sea-ice volume export in seaice_cost_export.F +C (requires pkg/cost & ALLOW_COST_ICE defined) +# undef ALLOW_SEAICE_COST_EXPORT +#endif /* ALLOW_COST_ICE */ #endif /* ALLOW_SEAICE */ #endif /* SEAICE_OPTIONS_H */ - -CEH3 ;;; Local Variables: *** -CEH3 ;;; mode:fortran *** -CEH3 ;;; End: *** diff --git a/verification/1D_ocean_ice_column/code_ad/CTRL_OPTIONS.h b/verification/1D_ocean_ice_column/code_ad/CTRL_OPTIONS.h index 74553c95b7..05bb0dbd10 100644 --- a/verification/1D_ocean_ice_column/code_ad/CTRL_OPTIONS.h +++ b/verification/1D_ocean_ice_column/code_ad/CTRL_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef CTRL_OPTIONS_H +#define CTRL_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: CTRL_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef CTRL_OPTIONS_H -#define CTRL_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_CTRL #ifdef ECCO_CPPOPTIONS_H @@ -26,61 +26,68 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -C o Re-activate deprecated codes in pkg/ecco & pkg/ctrl (but not recommended) -C and since pkg/ctrl can be used without pkg/ecco, better to have it here -#undef ECCO_CTRL_DEPRECATED - +C o I/O and pack settings +#undef CTRL_SET_PREC_32 +C This option is only relevant (for pack/unpack) with OBCS_CONTROL: +#undef ALLOW_NONDIMENSIONAL_CONTROL_IO #undef EXCLUDE_CTRL_PACK -#define ALLOW_NONDIMENSIONAL_CONTROL_IO #define ALLOW_PACKUNPACK_METHOD2 - -C >>> Initial values. -#define ALLOW_THETA0_CONTROL -#define ALLOW_SALT0_CONTROL -#undef ALLOW_UVEL0_CONTROL -#undef ALLOW_VVEL0_CONTROL -#undef ALLOW_TR10_CONTROL -#undef ALLOW_TAUU0_CONTROL -#undef ALLOW_TAUV0_CONTROL -#undef ALLOW_SFLUX0_CONTROL -#undef ALLOW_HFLUX0_CONTROL -#undef ALLOW_SSS0_CONTROL -#undef ALLOW_SST0_CONTROL - -C >>> Surface fluxes. -#undef ALLOW_HFLUX_CONTROL -#undef ALLOW_SFLUX_CONTROL -#undef ALLOW_USTRESS_CONTROL -#undef ALLOW_VSTRESS_CONTROL -#undef ALLOW_SWFLUX_CONTROL -#undef ALLOW_LWFLUX_CONTROL - -C >>> Atmospheric state. -#undef ALLOW_ATEMP_CONTROL -#undef ALLOW_AQH_CONTROL -#undef ALLOW_UWIND_CONTROL -#undef ALLOW_VWIND_CONTROL -#undef ALLOW_PRECIP_CONTROL +#undef CTRL_DO_PACK_UNPACK_ONLY +#undef CTRL_PACK_PRECISE +#undef CTRL_UNPACK_PRECISE +#undef CTRL_DELZNORM +#undef ALLOW_CTRL_WETV C >>> Other Control. -#undef ALLOW_DIFFKR_CONTROL +C Allows for GMREDI controls #undef ALLOW_KAPGM_CONTROL #undef ALLOW_KAPREDI_CONTROL +C Allows for Vertical Diffusivity controls +#undef ALLOW_DIFFKR_CONTROL #undef ALLOW_BOTTOMDRAG_CONTROL - -C >>> Backward compatibility option (before checkpoint 65p) -#undef ALLOW_KAPGM_CONTROL_OLD -#undef ALLOW_KAPREDI_CONTROL_OLD - -C >>> Initial seaice -#undef ALLOW_SIAREA_CONTROL -#undef ALLOW_SIHEFF_CONTROL -#undef ALLOW_SIHSNOW_CONTROL +#undef ALLOW_DIC_CONTROL + +C Allows bathymetry as a control vector +C Note: keep this Option separated from generic control since this control +C involves many new dependencies that we would like to avoid in general. +#undef ALLOW_DEPTH_CONTROL +#ifdef ALLOW_DEPTH_CONTROL +C Only relevant within DEPTH_CONTROL code: +# define USE_SMOOTH_MIN +# undef ALLOW_HFACC_CONTROL +# undef ALLOW_HFACC3D_CONTROL +#endif /* ALLOW_DEPTH_CONTROL */ C >>> Generic Control. #undef ALLOW_GENARR2D_CONTROL #define ALLOW_GENARR3D_CONTROL #define ALLOW_GENTIM2D_CONTROL +# undef ALLOW_UVEL0_CONTROL +# undef ALLOW_VVEL0_CONTROL +# undef CTRL_SET_OLD_MAXCVARS_30 +# undef CTRL_SET_OLD_MAXCVARS_40 + +C >>> Open boundaries +#ifdef ALLOW_OBCS +C Control of Open-Boundaries is meaningless without compiling pkg/obcs +C Note: Make sure that corresponding OBCS N/S/W/E Option is defined +# define ALLOW_OBCSN_CONTROL +# define ALLOW_OBCSS_CONTROL +# define ALLOW_OBCSW_CONTROL +# define ALLOW_OBCSE_CONTROL +# undef ALLOW_OBCS_CONTROL_MODES +#endif /* ALLOW_OBCS */ + +C o Set ALLOW_OBCS_CONTROL (Do not edit/modify): +#if (defined (ALLOW_OBCSN_CONTROL) || \ + defined (ALLOW_OBCSS_CONTROL) || \ + defined (ALLOW_OBCSW_CONTROL) || \ + defined (ALLOW_OBCSE_CONTROL)) +# define ALLOW_OBCS_CONTROL +#endif + +C o Impose bounds on controls +#undef ALLOW_ADCTRLBOUND C o Rotation of wind/stress controls adjustments C from Eastward/Northward to model grid directions @@ -92,19 +99,16 @@ C The CTRL_SKIP_FIRST_TWO_ATM_REC_ALL option extends this C to the other the time variable atmospheric controls. #undef CTRL_SKIP_FIRST_TWO_ATM_REC_ALL -C o use pkg/smooth correlation operator (incl. smoother) for 2D controls (Weaver, Courtier 01) -C This CPP option just sets the default for ctrlSmoothCorrel2D to .TRUE. -#undef ALLOW_SMOOTH_CORREL2D -C o use pkg/smooth correlation operator (incl. smoother) for 3D controls (Weaver, Courtier 01) -C This CPP option just sets the default for ctrlSmoothCorrel3D to .TRUE. -#undef ALLOW_SMOOTH_CORREL3D - -C o apply pkg/ctrl/ctrl_smooth.F to 2D controls (outside of ctrlSmoothCorrel2D) -#undef ALLOW_CTRL_SMOOTH -C o apply pkg/smooth/smooth_diff2d.F to 2D controls (outside of ctrlSmoothCorrel2D) +C Note: this flag turns on extra smoothing code in ctrl_get_gen.F which +C is inconsistent with the Weaver and Courtier, 2001 algorithm, and +C should probably not be used. The corresponding 3D flag applied only +C to deprecated code that is now removed. At some point we will remove +C this flag and associated code as well. +C o apply pkg/smooth/smooth_diff2d.F to 2D controls (outside of Smooth_Correl2D) #undef ALLOW_SMOOTH_CTRL2D -C o apply pkg/smooth/smooth_diff3d.F to 3D controls (outside of ctrlSmoothCorrel3D) -#undef ALLOW_SMOOTH_CTRL3D + +C o Print more debug info to STDOUT +#undef ALLOW_CTRL_DEBUG C ================================================================== #endif /* ndef ECCO_CPPOPTIONS_H */ diff --git a/verification/1D_ocean_ice_column/code_ad/SEAICE_OPTIONS.h b/verification/1D_ocean_ice_column/code_ad/SEAICE_OPTIONS.h index c673406748..e73d735ef1 100644 --- a/verification/1D_ocean_ice_column/code_ad/SEAICE_OPTIONS.h +++ b/verification/1D_ocean_ice_column/code_ad/SEAICE_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef SEAICE_OPTIONS_H +#define SEAICE_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + C *==========================================================* C | SEAICE_OPTIONS.h C | o CPP options file for sea ice package. @@ -6,29 +11,12 @@ C | Use this file for selecting options within the sea ice C | package. C *==========================================================* -#ifndef SEAICE_OPTIONS_H -#define SEAICE_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_SEAICE -C Package-specific Options & Macros go here - -C Moved here from obsolete ECCO_CPPOPTIONS.h -cph >>>>>> !!!!!! SPECIAL SEAICE FLAG FOR TESTING !!!!!! <<<<<< -#define SEAICE_EXCLUDE_FOR_EXACT_AD_TESTING -cph >>>>>> !!!!!! SPECIAL SEAICE FLAG FOR TESTING !!!!!! <<<<<< +C--- Package-specific Options & Macros go here C-- Write "text-plots" of certain fields in STDOUT for debugging. #undef SEAICE_DEBUG -C-- Allow sea-ice dynamic code. -C This option is provided to allow use of TAMC -C on the thermodynamics component of the code only. -C Sea-ice dynamics can also be turned off at runtime -C using variable SEAICEuseDYNAMICS. -#undef SEAICE_ALLOW_DYNAMICS - C-- By default, the sea-ice package uses its own integrated bulk C formulae to compute fluxes (fu, fv, EmPmR, Qnet, and Qsw) over C open-ocean. When this flag is set, these variables are computed @@ -47,8 +35,6 @@ C-- run with sea Ice Thickness Distribution (ITD); C set number of categories (nITD) in SEAICE_SIZE.h #undef SEAICE_ITD -#undef SEAICE_MODIFY_GROWTH_ADJ - C-- Since the missing sublimation term is now included C this flag is needed for backward compatibility #define SEAICE_DISABLE_SUBLIM @@ -62,66 +48,116 @@ C seaice with a fraction (=SEAICE_saltFrac) of freezing seawater salinity. C- Note: SItracer also offers an alternative way to handle variable salinity. #define SEAICE_VARIABLE_SALINITY -C-- Tracers of ice and/or ice cover. -#undef ALLOW_SITRACER -#ifdef ALLOW_SITRACER -C-- To try avoid 'spontaneous generation' of tracer maxima by advdiff. -# define ALLOW_SITRACER_ADVCAP -#endif - -C-- Enable grease ice parameterization -C The grease ice parameterization delays formation of solid -C sea ice from frazil ice by a time constant and provides a -C dynamic calculation of the initial solid sea ice thickness -C HO as a function of winds, currents and available grease ice -C volume. Grease ice does not significantly reduce heat loss -C from the ocean in winter and area covered by grease is thus -C handled like open water. -C (For details see Smedsrud and Martin, 2014, Ann.Glac.) +C-- Enable grease ice parameterization (requires to define ALLOW_SITRACER): +C The grease ice parameterization delays formation of solid sea ice from +C frazil ice by a time constant and provides a dynamic calculation of the +C initial solid sea ice thickness HO as a function of winds, currents and +C available grease ice volume. Grease ice does not significantly reduce heat +C loss from the ocean in winter and area covered by grease is thus handled +C like open water (For details see Smedsrud and Martin, 2014, Ann.Glac.). C Set SItrName(1) = 'grease' in namelist SEAICE_PARM03 in data.seaice C then output SItr01 is SItrNameLong(1) = 'grease ice volume fraction', -C with SItrUnit(1) = '[0-1]', which needs to be multiplied by SIheff -C to yield grease ice volume. Additionally, the actual grease ice -C layer thickness (diagnostic SIgrsLT) can be saved. +C with SItrUnit(1) = '[0-1]', which needs to be multiplied by SIheff to +C yield grease ice volume. Additionally, the actual grease ice layer +C thickness (diagnostic SIgrsLT) can be saved. #undef SEAICE_GREASE -C-- grease ice uses SItracer: + +C-- Tracers of ice and/or ice cover. #ifdef SEAICE_GREASE +C SEAICE_GREASE code requires to define ALLOW_SITRACER # define ALLOW_SITRACER -# define ALLOW_SITRACER_ADVCAP +#else +# undef ALLOW_SITRACER #endif +#ifdef ALLOW_SITRACER +C- To try avoid 'spontaneous generation' of tracer maxima by advdiff. +# define ALLOW_SITRACER_ADVCAP + +C- Include code to diagnose sea ice tracer budgets in +C seaice_advdiff.F and seaice_tracer_phys.F. Diagnostics are +C computed the "call diagnostics_fill" statement is commented out. +# undef ALLOW_SITRACER_DEBUG_DIAG +#endif /* ALLOW_SITRACER */ + +C-- Allow sea-ice dynamic code. These options are provided so that, +C if turned off (#undef), to compile (and process with TAF) only the +C the thermodynamics component of the code. Note that, if needed, +C sea-ice dynamics can be turned off at runtime (SEAICEuseDYNAMICS=F). C-- Historically, the seaice model was discretized on a B-Grid. This -C discretization should still work but it is not longer actively tested -C and supported. The following flag should always be set in order to use -C the operational C-grid discretization. -#define SEAICE_CGRID +C discretization should still work but it is not longer actively +C tested and supported. Define this flag to compile it. It cannot be +C defined together with SEAICE_CGRID +#undef SEAICE_BGRID_DYNAMICS + +C-- The following flag should always be set in order to use C the +C-- operational C-grid discretization. +#undef SEAICE_CGRID -C-- Only for the C-grid version it is possible to #ifdef SEAICE_CGRID +C-- Options for the C-grid version only: + C enable advection of sea ice momentum # undef SEAICE_ALLOW_MOM_ADVECTION + C enable JFNK code by defining the following flag # undef SEAICE_ALLOW_JFNK + C enable Krylov code by defining the following flag # undef SEAICE_ALLOW_KRYLOV + +C-- Use a different order when mapping 2D velocity arrays to 1D vector +C before passing it to FGMRES. +# undef SEAICE_JFNK_MAP_REORDER + +C to reproduce old verification results for JFNK +# undef SEAICE_PRECOND_EXTRA_EXCHANGE + C enable LSR to use global (multi-tile) tri-diagonal solver # undef SEAICE_GLOBAL_3DIAG_SOLVER + C enable EVP code by defining the following flag # define SEAICE_ALLOW_EVP # ifdef SEAICE_ALLOW_EVP -C-- When set use SEAICE_zetaMin and SEAICE_evpDampC to limit viscosities +C- When set use SEAICE_zetaMin and SEAICE_evpDampC to limit viscosities C from below and above in seaice_evp: not necessary, and not recommended # undef SEAICE_ALLOW_CLIPZETA + +C Include code to avoid underflows in EVP-code (copied from CICE). +C Many compilers can handle this more efficiently with the help of a flag. +# undef SEAICE_EVP_ELIMINATE_UNDERFLOWS + +C Include code to print residual of EVP iteration for debugging/diagnostics +# undef ALLOW_SEAICE_EVP_RESIDUAL # endif /* SEAICE_ALLOW_EVP */ + C smooth regularization (without max-function) of delta for C better differentiability # undef SEAICE_DELTA_SMOOTHREG + C regularize zeta to zmax with a smooth tanh-function instead C of a min(zeta,zmax). This improves convergence of iterative C solvers (Lemieux and Tremblay 2009, JGR). No effect on EVP # undef SEAICE_ZETA_SMOOTHREG + +C-- Different yield curves within the VP rheology framework C allow the truncated ellipse rheology (runtime flag SEAICEuseTEM) # undef SEAICE_ALLOW_TEM + +C allow the use of the Mohr Coulomb rheology (runtime flag SEAICEuseMCS) +C as defined in (Ip 1991) /!\ This is known to give unstable results, +C use with caution +# undef SEAICE_ALLOW_MCS + +C allow the use of Mohr Coulomb with elliptical plastic potential +C (runtime flag SEAICEuseMCE) +# undef SEAICE_ALLOW_MCE + +C allow the teardrop and parabolic lens rheology +C (runtime flag SEAICEuseTD and SEAICEusePL) +# undef SEAICE_ALLOW_TEARDROP + +C-- LSR solver settings C Use LSR vector code; not useful on non-vector machines, because it C slows down convergence considerably, but the extra iterations are C more than made up by the much faster code on vector machines. For @@ -129,52 +165,108 @@ C the only regularly test vector machine these flags a specified C in the build options file SUPER-UX_SX-8_sxf90_awi, so that we comment C them out here. # undef SEAICE_VECTORIZE_LSR + C Use zebra-method (alternate lines) for line-successive-relaxation C This modification improves the convergence of the vector code C dramatically, so that is may actually be useful in general, but C that needs to be tested. Can be used without vectorization options. # undef SEAICE_LSR_ZEBRA + +C Include code to print residual of nonlinear outer loop of LSR +# undef SEAICE_ALLOW_CHECK_LSR_CONVERGENCE + +C This flag is also required for an actual adjoint of seaice_lsr; +C increases memory requirements a lot. +# undef SEAICE_LSR_ADJOINT_ITER + C Use parameterisation of grounding ice for a better representation C of fastice in shallow seas # undef SEAICE_ALLOW_BOTTOMDRAG -#else /* not SEAICE_CGRID, but old B-grid */ -C-- By default for B-grid dynamics solver wind stress under sea-ice is + +#endif /* SEAICE_CGRID */ + +#ifdef SEAICE_BGRID_DYNAMICS +C-- Options for the B-grid version only: + +C- By default for B-grid dynamics solver wind stress under sea-ice is C set to the same value as it would be if there was no sea-ice. C Define following CPP flag for B-grid ice-ocean stress coupling. # define SEAICE_BICE_STRESS -C-- By default for B-grid dynamics solver surface tilt is obtained +C- By default for B-grid dynamics solver surface tilt is obtained C indirectly via geostrophic velocities. Define following CPP C in order to use ETAN instead. # define EXPLICIT_SSH_SLOPE -C-- Defining this flag turns on FV-discretization of the B-grid LSOR solver. + +C- Defining this flag turns on FV-discretization of the B-grid LSOR solver. C It is smoother and includes all metric terms, similar to C-grid solvers. C It is here for completeness, but its usefulness is unclear. # undef SEAICE_LSRBNEW -#endif /* SEAICE_CGRID */ -C-- When set limit the Ice-Loading to mass of 1/5 of Surface ocean grid-box +#endif /* SEAICE_BGRID_DYNAMICS */ + +C-- Some regularisations +C- When set limit the Ice-Loading to mass of 1/5 of Surface ocean grid-box #undef SEAICE_CAP_ICELOAD -C-- When set use SEAICE_clipVelocties = .true., to clip U/VICE at 40cm/s, + +C- When set use SEAICE_clipVelocties = .true., to clip U/VICE at 40cm/s, C not recommended #undef SEAICE_ALLOW_CLIPVELS -C-- When set cap the sublimation latent heat flux in solve4temp according + +C- When set cap the sublimation latent heat flux in solve4temp according C to the available amount of ice+snow. Otherwise this term is treated C like all of the others -- residuals heat and fw stocks are passed to C the ocean at the end of seaice_growth in a conservative manner. C SEAICE_CAP_SUBLIM is not needed as of now, but kept just in case. #undef SEAICE_CAP_SUBLIM +C-- AD flags +C- TAF related flag, currently only used in seaice_ad_check_lev[1-4]_dir.h; +C it is unclear if this is ever needed. +#undef AUTODIFF_SOMETIMES_NEEDED + +C- Reset fields to zero to stabilise AD code of dynamics solver +C (resulting in wrong gradients) +#undef SEAICE_DYN_STABLE_ADJOINT + +C- Another flag to simplify dependencies for TAF-generated AD-code +C the thermodynamic part, mostly by resetting variables to zero +#undef SEAICE_MODIFY_GROWTH_ADJ + +C- Special seaice flag for AD testing +#define SEAICE_EXCLUDE_FOR_EXACT_AD_TESTING + +C-- Use the adjointable sea-ice thermodynamic model +C in seaice_growth_adx.F instead of seaice_growth.F +C This options excludes more complex physics such +C as sublimation, ITD, and frazil. +#undef SEAICE_USE_GROWTH_ADX + +C-- These flags are not strictly AD-related but may help obtaining +C simpler AD-code: +C- Do not compile code that resets AREA (or AREAITD) to a mininum value +C of SEAICE_area_floor (=SIeps with default of 1e-5) if there is +C some finite sea ice thickness +#undef DISABLE_AREA_FLOOR + +C- Do not compile growth/thermodynamics code (avoiding this code can +C also be done by setting runtime parameter usePWthermodynamics=F) +#undef DISABLE_SEAICE_GROWTH + +C- Do not compile/use seaice-related obcs code when using obcs. +#undef DISABLE_SEAICE_OBCS + C-- Enable free drift code #undef SEAICE_ALLOW_FREEDRIFT C-- pkg/seaice cost functions compile flags -c >>> Sea-ice volume (requires pkg/cost) +C- Sea-ice volume (requires pkg/cost) #define ALLOW_COST_ICE +#ifdef ALLOW_COST_ICE +C- Enable template for sea-ice volume export in seaice_cost_export.F +C (requires pkg/cost & ALLOW_COST_ICE defined) +# undef ALLOW_SEAICE_COST_EXPORT +#endif /* ALLOW_COST_ICE */ #endif /* ALLOW_SEAICE */ #endif /* SEAICE_OPTIONS_H */ - -CEH3 ;;; Local Variables: *** -CEH3 ;;; mode:fortran *** -CEH3 ;;; End: *** diff --git a/verification/bottom_ctrl_5x5/code_ad/AUTODIFF_OPTIONS.h b/verification/bottom_ctrl_5x5/code_ad/AUTODIFF_OPTIONS.h index 95b2249e05..07c904ef34 100644 --- a/verification/bottom_ctrl_5x5/code_ad/AUTODIFF_OPTIONS.h +++ b/verification/bottom_ctrl_5x5/code_ad/AUTODIFF_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef AUTODIFF_OPTIONS_H +#define AUTODIFF_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: AUTODIFF_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef AUTODIFF_OPTIONS_H -#define AUTODIFF_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_AUTODIFF #ifdef ECCO_CPPOPTIONS_H @@ -26,10 +26,11 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -C o Include/exclude code in order to be able to automatically -C differentiate the MITgcmUV by using the Tangent Linear and -C Adjoint Model Compiler (TAMC). +C o Include/exclude code in order to automatically differentiate MITgcm code +C using TAF (Transformation of Algorithms in Fortran, http://www.FastOpt.de) +C or using TAMC (Tangent Linear & Adjoint Model Compiler, needs both defined): #define ALLOW_AUTODIFF_TAMC +#undef AUTODIFF_TAMC_COMPATIBILITY C >>> Checkpointing as handled by TAMC #define ALLOW_TAMC_CHECKPOINTING @@ -40,19 +41,19 @@ C >>> and DYNVARS_DIAG adjoint state #undef ALLOW_AUTODIFF_MONITOR_DIAG C >>> DO 2-level checkpointing instead of 3-level -c#undef AUTODIFF_2_LEVEL_CHECKPOINT +#undef AUTODIFF_2_LEVEL_CHECKPOINT C extend to 4-level checkpointing -c#undef AUTODIFF_4_LEVEL_CHECKPOINT +#undef AUTODIFF_4_LEVEL_CHECKPOINT C o use divided adjoint to split adjoint computations #undef ALLOW_DIVIDED_ADJOINT -#undef ALLOW_PACKUNPACK_METHOD2 - C o This flag is incredibly useful as it reduces the number of C tape-files on the disc. Maybe it should even be the default. #define ALLOW_AUTODIFF_WHTAPEIO +C and related to above: +#undef ALLOW_INIT_WHTAPEIO C o use standard MDSFINDUINTS instead of local pkg/autodiff version for C WHTAPEIO code I/O. @@ -70,6 +71,10 @@ C Might still be used for OBCS since WHTAPEIO does not support OBCS fields. C o allow using viscFacInAd to recompute viscosities in AD #define AUTODIFF_ALLOW_VISCFACADJ +C o To remove part of MOM_CALC_VISC (better name would be: MOM_DISABLE_*) +#undef AUTODIFF_DISABLE_LEITH +#undef AUTODIFF_DISABLE_REYNOLDS_SCALE + C o for output of AD-variables (ALLOW_AUTODIFF_MONITOR), specific code (e.g., C in addummy_in_stepping.F) relies on adexch_uv_xy_rs and adexch_xy_rs S/R C which might not always be generated by TAF (e.g., when controls do not diff --git a/verification/bottom_ctrl_5x5/code_ad/COST_OPTIONS.h b/verification/bottom_ctrl_5x5/code_ad/COST_OPTIONS.h index c75cce689a..b1e8dea7b4 100644 --- a/verification/bottom_ctrl_5x5/code_ad/COST_OPTIONS.h +++ b/verification/bottom_ctrl_5x5/code_ad/COST_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef COST_OPTIONS_H +#define COST_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: COST_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef COST_OPTIONS_H -#define COST_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_COST #ifdef ECCO_CPPOPTIONS_H @@ -26,51 +26,24 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -C >>> Use the EGM-96 geoid error covariance. -#undef ALLOW_EGM96_ERROR_COV -#undef ALLOW_READ_EGM_DATA +#undef ALLOW_COST_STATE_FINAL +#undef ALLOW_COST_VECTOR + C >>> Cost function contributions -#undef ALLOW_HFLUX_COST_CONTRIBUTION -#undef ALLOW_SFLUX_COST_CONTRIBUTION -#undef ALLOW_USTRESS_COST_CONTRIBUTION -#undef ALLOW_VSTRESS_COST_CONTRIBUTION -#undef ALLOW_THETA_COST_CONTRIBUTION -#undef ALLOW_SALT_COST_CONTRIBUTION -#undef ALLOW_SST_COST_CONTRIBUTION -#undef ALLOW_SSS_COST_CONTRIBUTION -#undef ALLOW_SSH_COST_CONTRIBUTION -#undef ALLOW_CTDT_COST_CONTRIBUTION -#undef ALLOW_CTDS_COST_CONTRIBUTION -#undef ALLOW_COST_ATLANTIC #undef ALLOW_COST_ATLANTIC_HEAT +#undef ALLOW_COST_ATLANTIC_HEAT_DOMASS #define ALLOW_COST_TEST -#define ALLOW_COST_DEPTH #undef ALLOW_COST_TSQUARED +#define ALLOW_COST_DEPTH #undef ALLOW_COST_TRACER -C >>> ALLOW_GENCOST_CONTRIBUTION: interactive way to add basic 2D cost -C function terms. -C > In data.ecco, this requires the specification of data file (name, -C frequency, etc.), bar file name for corresp. model average, standard -C error file name, etc. -C > In addition, adding such cost terms requires editing ecco_cost.h to -C increase NGENCOST, and editing cost_gencost_customize.F to implement -C the actual model average (i.e. the bar file content). -#undef ALLOW_GENCOST_CONTRIBUTION -C >>> free form version of GENCOST: allows one to use otherwise defined -C elements (e.g. psbar and and topex data) while taking advantage of the -C cost function/namelist slots that can be made available using -C ALLOW_GENCOST_CONTRIBUTION. To this end ALLOW_GENCOST_CONTRIBUTION -C simply switches off tests that check whether all of the gencost -C elements (e.g. gencost_barfile and gencost_datafile) are specified -C in data.ecco. -C > While this option increases flexibility within the gencost framework, -C it implies more room for error, so it should be used cautiously, and -C with good knowledge of the rest of pkg/ecco. -C > It requires providing a specific cost function routine, and editing -C cost_gencost_all.F accordingly. -#undef ALLOW_GENCOST_FREEFORM +C List these options here: +#undef ALLOW_COST_TEMP +#undef ALLOW_COST_HFLUXM +#undef ALLOW_DIC_COST +#undef ALLOW_THSICE_COST_TEST +#undef ALLOW_COST_SHELFICE C ================================================================== #endif /* ndef ECCO_CPPOPTIONS_H */ diff --git a/verification/bottom_ctrl_5x5/code_ad/CTRL_OPTIONS.h b/verification/bottom_ctrl_5x5/code_ad/CTRL_OPTIONS.h index ff7570eeef..0271634148 100644 --- a/verification/bottom_ctrl_5x5/code_ad/CTRL_OPTIONS.h +++ b/verification/bottom_ctrl_5x5/code_ad/CTRL_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef CTRL_OPTIONS_H +#define CTRL_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: CTRL_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef CTRL_OPTIONS_H -#define CTRL_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_CTRL #ifdef ECCO_CPPOPTIONS_H @@ -26,65 +26,68 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -C o Re-activate deprecated codes in pkg/ecco & pkg/ctrl (but not recommended) -C and since pkg/ctrl can be used without pkg/ecco, better to have it here -#undef ECCO_CTRL_DEPRECATED - -#undef EXCLUDE_CTRL_PACK +C o I/O and pack settings +#undef CTRL_SET_PREC_32 +C This option is only relevant (for pack/unpack) with OBCS_CONTROL: #undef ALLOW_NONDIMENSIONAL_CONTROL_IO - -C >>> Initial values. -#undef ALLOW_THETA0_CONTROL -#undef ALLOW_SALT0_CONTROL -#undef ALLOW_UVEL0_CONTROL -#undef ALLOW_VVEL0_CONTROL -#undef ALLOW_TR10_CONTROL -#undef ALLOW_TAUU0_CONTROL -#undef ALLOW_TAUV0_CONTROL -#undef ALLOW_SFLUX0_CONTROL -#undef ALLOW_HFLUX0_CONTROL -#undef ALLOW_SSS0_CONTROL -#undef ALLOW_SST0_CONTROL - -C >>> Surface fluxes. -#undef ALLOW_HFLUX_CONTROL -#undef ALLOW_SFLUX_CONTROL -#undef ALLOW_USTRESS_CONTROL -#undef ALLOW_VSTRESS_CONTROL -#undef ALLOW_SWFLUX_CONTROL -#undef ALLOW_LWFLUX_CONTROL - -C >>> Atmospheric state. -#undef ALLOW_ATEMP_CONTROL -#undef ALLOW_AQH_CONTROL -#undef ALLOW_UWIND_CONTROL -#undef ALLOW_VWIND_CONTROL -#undef ALLOW_PRECIP_CONTROL +#undef EXCLUDE_CTRL_PACK +#undef ALLOW_PACKUNPACK_METHOD2 +#undef CTRL_DO_PACK_UNPACK_ONLY +#undef CTRL_PACK_PRECISE +#undef CTRL_UNPACK_PRECISE +#undef CTRL_DELZNORM +#undef ALLOW_CTRL_WETV C >>> Other Control. -#undef ALLOW_DIFFKR_CONTROL +C Allows for GMREDI controls #undef ALLOW_KAPGM_CONTROL #undef ALLOW_KAPREDI_CONTROL +C Allows for Vertical Diffusivity controls +#undef ALLOW_DIFFKR_CONTROL #undef ALLOW_BOTTOMDRAG_CONTROL +#undef ALLOW_DIC_CONTROL -C >>> Backward compatibility option (before checkpoint 65p) -#undef ALLOW_KAPGM_CONTROL_OLD -#undef ALLOW_KAPREDI_CONTROL_OLD - -C >>> only topography as a control vector -C Note that this is special and we keep this flag even for the -C generic control variable code, because using depth as a control -C variable incurs many new dependencies that we would like to avoid -C in general. +C Allows bathymetry as a control vector +C Note: keep this Option separated from generic control since this control +C involves many new dependencies that we would like to avoid in general. #define ALLOW_DEPTH_CONTROL #ifdef ALLOW_DEPTH_CONTROL +C Only relevant within DEPTH_CONTROL code: # define USE_SMOOTH_MIN +# undef ALLOW_HFACC_CONTROL +# undef ALLOW_HFACC3D_CONTROL #endif /* ALLOW_DEPTH_CONTROL */ C >>> Generic Control. #define ALLOW_GENARR2D_CONTROL #undef ALLOW_GENARR3D_CONTROL #undef ALLOW_GENTIM2D_CONTROL +# undef ALLOW_UVEL0_CONTROL +# undef ALLOW_VVEL0_CONTROL +# undef CTRL_SET_OLD_MAXCVARS_30 +# undef CTRL_SET_OLD_MAXCVARS_40 + +C >>> Open boundaries +#ifdef ALLOW_OBCS +C Control of Open-Boundaries is meaningless without compiling pkg/obcs +C Note: Make sure that corresponding OBCS N/S/W/E Option is defined +# define ALLOW_OBCSN_CONTROL +# define ALLOW_OBCSS_CONTROL +# define ALLOW_OBCSW_CONTROL +# define ALLOW_OBCSE_CONTROL +# undef ALLOW_OBCS_CONTROL_MODES +#endif /* ALLOW_OBCS */ + +C o Set ALLOW_OBCS_CONTROL (Do not edit/modify): +#if (defined (ALLOW_OBCSN_CONTROL) || \ + defined (ALLOW_OBCSS_CONTROL) || \ + defined (ALLOW_OBCSW_CONTROL) || \ + defined (ALLOW_OBCSE_CONTROL)) +# define ALLOW_OBCS_CONTROL +#endif + +C o Impose bounds on controls +#undef ALLOW_ADCTRLBOUND C o Rotation of wind/stress controls adjustments C from Eastward/Northward to model grid directions @@ -96,19 +99,16 @@ C The CTRL_SKIP_FIRST_TWO_ATM_REC_ALL option extends this C to the other the time variable atmospheric controls. #undef CTRL_SKIP_FIRST_TWO_ATM_REC_ALL -C o use pkg/smooth correlation operator (incl. smoother) for 2D controls (Weaver, Courtier 01) -C This CPP option just sets the default for ctrlSmoothCorrel2D to .TRUE. -#undef ALLOW_SMOOTH_CORREL2D -C o use pkg/smooth correlation operator (incl. smoother) for 3D controls (Weaver, Courtier 01) -C This CPP option just sets the default for ctrlSmoothCorrel3D to .TRUE. -#undef ALLOW_SMOOTH_CORREL3D - -C o apply pkg/ctrl/ctrl_smooth.F to 2D controls (outside of ctrlSmoothCorrel2D) -#undef ALLOW_CTRL_SMOOTH -C o apply pkg/smooth/smooth_diff2d.F to 2D controls (outside of ctrlSmoothCorrel2D) +C Note: this flag turns on extra smoothing code in ctrl_get_gen.F which +C is inconsistent with the Weaver and Courtier, 2001 algorithm, and +C should probably not be used. The corresponding 3D flag applied only +C to deprecated code that is now removed. At some point we will remove +C this flag and associated code as well. +C o apply pkg/smooth/smooth_diff2d.F to 2D controls (outside of Smooth_Correl2D) #undef ALLOW_SMOOTH_CTRL2D -C o apply pkg/smooth/smooth_diff3d.F to 3D controls (outside of ctrlSmoothCorrel3D) -#undef ALLOW_SMOOTH_CTRL3D + +C o Print more debug info to STDOUT +#undef ALLOW_CTRL_DEBUG C ================================================================== #endif /* ndef ECCO_CPPOPTIONS_H */ diff --git a/verification/cpl_aim+ocn/code_ocn/SEAICE_OPTIONS.h b/verification/cpl_aim+ocn/code_ocn/SEAICE_OPTIONS.h index 5d6956b933..4cc1e1b511 100644 --- a/verification/cpl_aim+ocn/code_ocn/SEAICE_OPTIONS.h +++ b/verification/cpl_aim+ocn/code_ocn/SEAICE_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef SEAICE_OPTIONS_H +#define SEAICE_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + C *==========================================================* C | SEAICE_OPTIONS.h C | o CPP options file for sea ice package. @@ -6,24 +11,12 @@ C | Use this file for selecting options within the sea ice C | package. C *==========================================================* -#ifndef SEAICE_OPTIONS_H -#define SEAICE_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_SEAICE -C Package-specific Options & Macros go here +C--- Package-specific Options & Macros go here C-- Write "text-plots" of certain fields in STDOUT for debugging. #undef SEAICE_DEBUG -C-- Allow sea-ice dynamic code. -C This option is provided to allow use of TAMC -C on the thermodynamics component of the code only. -C Sea-ice dynamics can also be turned off at runtime -C using variable SEAICEuseDYNAMICS. -#define SEAICE_ALLOW_DYNAMICS - C-- By default, the sea-ice package uses its own integrated bulk C formulae to compute fluxes (fu, fv, EmPmR, Qnet, and Qsw) over C open-ocean. When this flag is set, these variables are computed @@ -55,76 +48,116 @@ C seaice with a fraction (=SEAICE_saltFrac) of freezing seawater salinity. C- Note: SItracer also offers an alternative way to handle variable salinity. #undef SEAICE_VARIABLE_SALINITY -C-- Tracers of ice and/or ice cover. -#undef ALLOW_SITRACER -#ifdef ALLOW_SITRACER -C-- To try avoid 'spontaneous generation' of tracer maxima by advdiff. -# define ALLOW_SITRACER_ADVCAP -#endif - -C-- Enable grease ice parameterization -C The grease ice parameterization delays formation of solid -C sea ice from frazil ice by a time constant and provides a -C dynamic calculation of the initial solid sea ice thickness -C HO as a function of winds, currents and available grease ice -C volume. Grease ice does not significantly reduce heat loss -C from the ocean in winter and area covered by grease is thus -C handled like open water. -C (For details see Smedsrud and Martin, 2014, Ann.Glac.) +C-- Enable grease ice parameterization (requires to define ALLOW_SITRACER): +C The grease ice parameterization delays formation of solid sea ice from +C frazil ice by a time constant and provides a dynamic calculation of the +C initial solid sea ice thickness HO as a function of winds, currents and +C available grease ice volume. Grease ice does not significantly reduce heat +C loss from the ocean in winter and area covered by grease is thus handled +C like open water (For details see Smedsrud and Martin, 2014, Ann.Glac.). C Set SItrName(1) = 'grease' in namelist SEAICE_PARM03 in data.seaice C then output SItr01 is SItrNameLong(1) = 'grease ice volume fraction', -C with SItrUnit(1) = '[0-1]', which needs to be multiplied by SIheff -C to yield grease ice volume. Additionally, the actual grease ice -C layer thickness (diagnostic SIgrsLT) can be saved. +C with SItrUnit(1) = '[0-1]', which needs to be multiplied by SIheff to +C yield grease ice volume. Additionally, the actual grease ice layer +C thickness (diagnostic SIgrsLT) can be saved. #undef SEAICE_GREASE -C-- grease ice uses SItracer: + +C-- Tracers of ice and/or ice cover. #ifdef SEAICE_GREASE +C SEAICE_GREASE code requires to define ALLOW_SITRACER # define ALLOW_SITRACER -# define ALLOW_SITRACER_ADVCAP +#else +# undef ALLOW_SITRACER #endif +#ifdef ALLOW_SITRACER +C- To try avoid 'spontaneous generation' of tracer maxima by advdiff. +# define ALLOW_SITRACER_ADVCAP + +C- Include code to diagnose sea ice tracer budgets in +C seaice_advdiff.F and seaice_tracer_phys.F. Diagnostics are +C computed the "call diagnostics_fill" statement is commented out. +# undef ALLOW_SITRACER_DEBUG_DIAG +#endif /* ALLOW_SITRACER */ + +C-- Allow sea-ice dynamic code. These options are provided so that, +C if turned off (#undef), to compile (and process with TAF) only the +C the thermodynamics component of the code. Note that, if needed, +C sea-ice dynamics can be turned off at runtime (SEAICEuseDYNAMICS=F). C-- Historically, the seaice model was discretized on a B-Grid. This -C discretization should still work but it is not longer actively tested -C and supported. The following flag should always be set in order to use -C the operational C-grid discretization. +C discretization should still work but it is not longer actively +C tested and supported. Define this flag to compile it. It cannot be +C defined together with SEAICE_CGRID +#undef SEAICE_BGRID_DYNAMICS + +C-- The following flag should always be set in order to use C the +C-- operational C-grid discretization. #define SEAICE_CGRID -C-- Only for the C-grid version it is possible to #ifdef SEAICE_CGRID +C-- Options for the C-grid version only: + C enable advection of sea ice momentum # undef SEAICE_ALLOW_MOM_ADVECTION + C enable JFNK code by defining the following flag # define SEAICE_ALLOW_JFNK + C enable Krylov code by defining the following flag # define SEAICE_ALLOW_KRYLOV + +C-- Use a different order when mapping 2D velocity arrays to 1D vector +C before passing it to FGMRES. +# undef SEAICE_JFNK_MAP_REORDER + +C to reproduce old verification results for JFNK +# undef SEAICE_PRECOND_EXTRA_EXCHANGE + C enable LSR to use global (multi-tile) tri-diagonal solver # undef SEAICE_GLOBAL_3DIAG_SOLVER + C enable EVP code by defining the following flag # undef SEAICE_ALLOW_EVP # ifdef SEAICE_ALLOW_EVP -C-- When set use SEAICE_zetaMin and SEAICE_evpDampC to limit viscosities +C- When set use SEAICE_zetaMin and SEAICE_evpDampC to limit viscosities C from below and above in seaice_evp: not necessary, and not recommended # undef SEAICE_ALLOW_CLIPZETA + +C Include code to avoid underflows in EVP-code (copied from CICE). +C Many compilers can handle this more efficiently with the help of a flag. +# undef SEAICE_EVP_ELIMINATE_UNDERFLOWS + +C Include code to print residual of EVP iteration for debugging/diagnostics +# undef ALLOW_SEAICE_EVP_RESIDUAL # endif /* SEAICE_ALLOW_EVP */ + C smooth regularization (without max-function) of delta for C better differentiability # undef SEAICE_DELTA_SMOOTHREG + C regularize zeta to zmax with a smooth tanh-function instead C of a min(zeta,zmax). This improves convergence of iterative C solvers (Lemieux and Tremblay 2009, JGR). No effect on EVP # define SEAICE_ZETA_SMOOTHREG + +C-- Different yield curves within the VP rheology framework C allow the truncated ellipse rheology (runtime flag SEAICEuseTEM) # undef SEAICE_ALLOW_TEM + C allow the use of the Mohr Coulomb rheology (runtime flag SEAICEuseMCS) C as defined in (Ip 1991) /!\ This is known to give unstable results, C use with caution # undef SEAICE_ALLOW_MCS + C allow the use of Mohr Coulomb with elliptical plastic potential C (runtime flag SEAICEuseMCE) # undef SEAICE_ALLOW_MCE + C allow the teardrop and parabolic lens rheology C (runtime flag SEAICEuseTD and SEAICEusePL) # undef SEAICE_ALLOW_TEARDROP + +C-- LSR solver settings C Use LSR vector code; not useful on non-vector machines, because it C slows down convergence considerably, but the extra iterations are C more than made up by the much faster code on vector machines. For @@ -132,58 +165,108 @@ C the only regularly test vector machine these flags a specified C in the build options file SUPER-UX_SX-8_sxf90_awi, so that we comment C them out here. # undef SEAICE_VECTORIZE_LSR + C Use zebra-method (alternate lines) for line-successive-relaxation C This modification improves the convergence of the vector code C dramatically, so that is may actually be useful in general, but C that needs to be tested. Can be used without vectorization options. # undef SEAICE_LSR_ZEBRA + +C Include code to print residual of nonlinear outer loop of LSR +# undef SEAICE_ALLOW_CHECK_LSR_CONVERGENCE + +C This flag is also required for an actual adjoint of seaice_lsr; +C increases memory requirements a lot. +# undef SEAICE_LSR_ADJOINT_ITER + C Use parameterisation of grounding ice for a better representation C of fastice in shallow seas # undef SEAICE_ALLOW_BOTTOMDRAG -#else /* not SEAICE_CGRID, but old B-grid */ -C-- By default for B-grid dynamics solver wind stress under sea-ice is + +#endif /* SEAICE_CGRID */ + +#ifdef SEAICE_BGRID_DYNAMICS +C-- Options for the B-grid version only: + +C- By default for B-grid dynamics solver wind stress under sea-ice is C set to the same value as it would be if there was no sea-ice. C Define following CPP flag for B-grid ice-ocean stress coupling. # define SEAICE_BICE_STRESS -C-- By default for B-grid dynamics solver surface tilt is obtained +C- By default for B-grid dynamics solver surface tilt is obtained C indirectly via geostrophic velocities. Define following CPP C in order to use ETAN instead. # define EXPLICIT_SSH_SLOPE -C-- Defining this flag turns on FV-discretization of the B-grid LSOR solver. + +C- Defining this flag turns on FV-discretization of the B-grid LSOR solver. C It is smoother and includes all metric terms, similar to C-grid solvers. C It is here for completeness, but its usefulness is unclear. # undef SEAICE_LSRBNEW -#endif /* SEAICE_CGRID */ -C-- When set limit the Ice-Loading to mass of 1/5 of Surface ocean grid-box +#endif /* SEAICE_BGRID_DYNAMICS */ + +C-- Some regularisations +C- When set limit the Ice-Loading to mass of 1/5 of Surface ocean grid-box #undef SEAICE_CAP_ICELOAD -C-- When set use SEAICE_clipVelocties = .true., to clip U/VICE at 40cm/s, + +C- When set use SEAICE_clipVelocties = .true., to clip U/VICE at 40cm/s, C not recommended #define SEAICE_ALLOW_CLIPVELS -C-- When set cap the sublimation latent heat flux in solve4temp according + +C- When set cap the sublimation latent heat flux in solve4temp according C to the available amount of ice+snow. Otherwise this term is treated C like all of the others -- residuals heat and fw stocks are passed to C the ocean at the end of seaice_growth in a conservative manner. C SEAICE_CAP_SUBLIM is not needed as of now, but kept just in case. #undef SEAICE_CAP_SUBLIM +C-- AD flags +C- TAF related flag, currently only used in seaice_ad_check_lev[1-4]_dir.h; +C it is unclear if this is ever needed. +#undef AUTODIFF_SOMETIMES_NEEDED + +C- Reset fields to zero to stabilise AD code of dynamics solver +C (resulting in wrong gradients) +#undef SEAICE_DYN_STABLE_ADJOINT + +C- Another flag to simplify dependencies for TAF-generated AD-code +C the thermodynamic part, mostly by resetting variables to zero +#undef SEAICE_MODIFY_GROWTH_ADJ + +C- Special seaice flag for AD testing +#undef SEAICE_EXCLUDE_FOR_EXACT_AD_TESTING + C-- Use the adjointable sea-ice thermodynamic model C in seaice_growth_adx.F instead of seaice_growth.F +C This options excludes more complex physics such +C as sublimation, ITD, and frazil. #undef SEAICE_USE_GROWTH_ADX +C-- These flags are not strictly AD-related but may help obtaining +C simpler AD-code: +C- Do not compile code that resets AREA (or AREAITD) to a mininum value +C of SEAICE_area_floor (=SIeps with default of 1e-5) if there is +C some finite sea ice thickness +#undef DISABLE_AREA_FLOOR + +C- Do not compile growth/thermodynamics code (avoiding this code can +C also be done by setting runtime parameter usePWthermodynamics=F) +#undef DISABLE_SEAICE_GROWTH + +C- Do not compile/use seaice-related obcs code when using obcs. +#undef DISABLE_SEAICE_OBCS + C-- Enable free drift code #undef SEAICE_ALLOW_FREEDRIFT C-- pkg/seaice cost functions compile flags -c >>> Sea-ice volume (requires pkg/cost) +C- Sea-ice volume (requires pkg/cost) #undef ALLOW_COST_ICE -c >>> Sea-ice misfit to obs (requires pkg/cost and ecco) -#undef ALLOW_SEAICE_COST_SMR_AREA +#ifdef ALLOW_COST_ICE +C- Enable template for sea-ice volume export in seaice_cost_export.F +C (requires pkg/cost & ALLOW_COST_ICE defined) +# undef ALLOW_SEAICE_COST_EXPORT +#endif /* ALLOW_COST_ICE */ #endif /* ALLOW_SEAICE */ #endif /* SEAICE_OPTIONS_H */ - -CEH3 ;;; Local Variables: *** -CEH3 ;;; mode:fortran *** -CEH3 ;;; End: *** diff --git a/verification/global_oce_biogeo_bling/code_ad/CTRL_OPTIONS.h b/verification/global_oce_biogeo_bling/code_ad/CTRL_OPTIONS.h index c61f59502f..a054296d82 100644 --- a/verification/global_oce_biogeo_bling/code_ad/CTRL_OPTIONS.h +++ b/verification/global_oce_biogeo_bling/code_ad/CTRL_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef CTRL_OPTIONS_H +#define CTRL_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: CTRL_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef CTRL_OPTIONS_H -#define CTRL_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_CTRL #ifdef ECCO_CPPOPTIONS_H @@ -28,33 +28,89 @@ C-- Package-specific Options & Macros go here C o I/O and pack settings #define CTRL_SET_PREC_32 +C This option is only relevant (for pack/unpack) with OBCS_CONTROL: #undef ALLOW_NONDIMENSIONAL_CONTROL_IO -#define ALLOW_PACKUNPACK_METHOD2 -CMM( #define EXCLUDE_CTRL_PACK -CMM) +#define ALLOW_PACKUNPACK_METHOD2 +#undef CTRL_DO_PACK_UNPACK_ONLY +#undef CTRL_PACK_PRECISE +#undef CTRL_UNPACK_PRECISE +#undef CTRL_DELZNORM +#undef ALLOW_CTRL_WETV -C o sets of controls -#define ALLOW_GENTIM2D_CONTROL +C >>> Other Control. +C Allows for GMREDI controls +#undef ALLOW_KAPGM_CONTROL +#undef ALLOW_KAPREDI_CONTROL +C Allows for Vertical Diffusivity controls +#undef ALLOW_DIFFKR_CONTROL +#undef ALLOW_BOTTOMDRAG_CONTROL +#undef ALLOW_DIC_CONTROL + +C Allows bathymetry as a control vector +C Note: keep this Option separated from generic control since this control +C involves many new dependencies that we would like to avoid in general. +#undef ALLOW_DEPTH_CONTROL +#ifdef ALLOW_DEPTH_CONTROL +C Only relevant within DEPTH_CONTROL code: +# define USE_SMOOTH_MIN +# undef ALLOW_HFACC_CONTROL +# undef ALLOW_HFACC3D_CONTROL +#endif /* ALLOW_DEPTH_CONTROL */ + +C >>> Generic Control. #define ALLOW_GENARR2D_CONTROL #define ALLOW_GENARR3D_CONTROL +#define ALLOW_GENTIM2D_CONTROL +# undef ALLOW_UVEL0_CONTROL +# undef ALLOW_VVEL0_CONTROL +# undef CTRL_SET_OLD_MAXCVARS_30 +# undef CTRL_SET_OLD_MAXCVARS_40 -C o use pkg/smooth correlation operator (incl. smoother) for 3D controls (Weaver, Courtier 01) -C This CPP option just sets the default for ctrlSmoothCorrel23 to .TRUE. -#undef ALLOW_SMOOTH_CORREL3D -C o use pkg/smooth correlation operator (incl. smoother) for 2D controls (Weaver, Courtier 01) -C This CPP option just sets the default for ctrlSmoothCorrel2D to .TRUE. -#undef ALLOW_SMOOTH_CORREL2D +C >>> Open boundaries +#ifdef ALLOW_OBCS +C Control of Open-Boundaries is meaningless without compiling pkg/obcs +C Note: Make sure that corresponding OBCS N/S/W/E Option is defined +# define ALLOW_OBCSN_CONTROL +# define ALLOW_OBCSS_CONTROL +# define ALLOW_OBCSW_CONTROL +# define ALLOW_OBCSE_CONTROL +# undef ALLOW_OBCS_CONTROL_MODES +#endif /* ALLOW_OBCS */ -C o impose bounds on controls -CMM#define ALLOW_ADCTRLBOUND +C o Set ALLOW_OBCS_CONTROL (Do not edit/modify): +#if (defined (ALLOW_OBCSN_CONTROL) || \ + defined (ALLOW_OBCSS_CONTROL) || \ + defined (ALLOW_OBCSW_CONTROL) || \ + defined (ALLOW_OBCSE_CONTROL)) +# define ALLOW_OBCS_CONTROL +#endif -C o rotate u/v vector control to zonal/meridional -C components -CMM#define ALLOW_ROTATE_UV_CONTROLS +C o Impose bounds on controls +#undef ALLOW_ADCTRLBOUND + +C o Rotation of wind/stress controls adjustments +C from Eastward/Northward to model grid directions +#undef ALLOW_ROTATE_UV_CONTROLS + +C o Originally the first two time-reccords of control +C variable tau u and tau v were skipped. +C The CTRL_SKIP_FIRST_TWO_ATM_REC_ALL option extends this +C to the other the time variable atmospheric controls. +#undef CTRL_SKIP_FIRST_TWO_ATM_REC_ALL + +C Note: this flag turns on extra smoothing code in ctrl_get_gen.F which +C is inconsistent with the Weaver and Courtier, 2001 algorithm, and +C should probably not be used. The corresponding 3D flag applied only +C to deprecated code that is now removed. At some point we will remove +C this flag and associated code as well. +C o apply pkg/smooth/smooth_diff2d.F to 2D controls (outside of Smooth_Correl2D) +#undef ALLOW_SMOOTH_CTRL2D + +C o Print more debug info to STDOUT +#undef ALLOW_CTRL_DEBUG C ================================================================== #endif /* ndef ECCO_CPPOPTIONS_H */ #endif /* ALLOW_CTRL */ #endif /* CTRL_OPTIONS_H */ - diff --git a/verification/global_oce_biogeo_bling/code_ad/ECCO_OPTIONS.h b/verification/global_oce_biogeo_bling/code_ad/ECCO_OPTIONS.h index 312710da1f..6b59908c1f 100644 --- a/verification/global_oce_biogeo_bling/code_ad/ECCO_OPTIONS.h +++ b/verification/global_oce_biogeo_bling/code_ad/ECCO_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef ECCO_OPTIONS_H +#define ECCO_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: ECCO_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef ECCO_OPTIONS_H -#define ECCO_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_ECCO #ifdef ECCO_CPPOPTIONS_H @@ -23,49 +23,70 @@ C in CPP_OPTIONS.h), this option file is left empty since all options that C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h #else /* ndef ECCO_CPPOPTIONS_H */ -C ================================================================== -C-- Package-specific Options & Macros go here -C - -C >>> use model/src/forward_step.F -CMM obsolete now #define ALLOW_ECCO_EVOLUTION -C >>> Cost function contributions -#define ALLOW_ECCO_OLD_FC_PRINT +C-- Package-specific Options & Macros go here -C >>> ALLOW_GENCOST_CONTRIBUTION: interactive way to add basic 2D cost function terms. -C > In data.ecco, this requires the specification of data file (name, frequency, -C etc.), bar file name for corresp. model average, standard error file name, etc. -C > In addition, adding such cost terms requires editing ecco_cost.h to increase -C NGENCOST, and editing cost_gencost_customize.F to implement the actual -C model average (i.e. the bar file content). +C o Allow for generic cost function and integral terms with pkg/ecco: #define ALLOW_GENCOST_CONTRIBUTION -C >>> free form version of GENCOST: allows one to use otherwise defined elements (e.g. -C psbar and and topex data) while taking advantage of the cost function/namelist slots -C that can be made available using ALLOW_GENCOST_CONTRIBUTION. To this end -C ALLOW_GENCOST_CONTRIBUTION simply switches off tests that check whether all of the -C gencost elements (e.g. gencost_barfile and gencost_datafile) are specified in data.ecco. -C > While this option increases flexibility within the gencost framework, it implies more room -C for error, so it should be used cautiously, and with good knowledge of the rest of pkg/ecco. -C > It requires providing a specific cost function routine, and editing cost_gencost_all.F accordingly. -#define ALLOW_GENCOST_FREEFORM -C >>> 3 dimensional version of GENCOST: +C o Allow for 3 dimensional generic cost terms with pkg/ecco: #define ALLOW_GENCOST3D +C Note regarding GENCOST usage: +C > In data.ecco, this requires the specification of data file (name, +C frequency, etc.), bar file name for corresp. model average, standard +C error file name, etc. +C > In addition, adding such cost terms requires editing ECCO_SIZE.h to +C increase NGENCOST/NGENCOST3D, and editing cost_gencost_customize.F to +C implement the actual model average (i.e. the bar file content). +# undef ALLOW_GENCOST_1D +# undef ALLOW_GENCOST_SSTV4_OUTPUT + +C o Allow Open-Boundary cost contributions +#ifdef ALLOW_OBCS +C Open-Boundary cost is meaningless without compiling pkg/obcs +C Note: Make sure that coresponding OBCS N/S/W/E Option is defined +# define ALLOW_OBCSN_COST_CONTRIBUTION +# define ALLOW_OBCSS_COST_CONTRIBUTION +# define ALLOW_OBCSW_COST_CONTRIBUTION +# define ALLOW_OBCSE_COST_CONTRIBUTION +# undef OBCS_AGEOS_COST_CONTRIBUTION +# undef OBCS_VOLFLUX_COST_CONTRIBUTION +# undef BAROTROPIC_OBVEL_CONTROL +#endif /* ALLOW_OBCS */ -c in case there is a single observational file (rather than yearly files) -c assume it contains a climatology (otherwise, assume it is a full time series) -#define COST_GENERIC_ASSUME_CYCLIC +C o Set ALLOW_OBCS_COST_CONTRIBUTION (Do not edit/modify): +#if (defined (ALLOW_OBCSN_COST_CONTRIBUTION) || \ + defined (ALLOW_OBCSS_COST_CONTRIBUTION) || \ + defined (ALLOW_OBCSW_COST_CONTRIBUTION) || \ + defined (ALLOW_OBCSE_COST_CONTRIBUTION)) +# define ALLOW_OBCS_COST_CONTRIBUTION +#endif -c include global mean steric sea level correction in etanFull -CMM #define ALLOW_PSBAR_STERIC -CMM#define ALLOW_SHALLOW_ALTIMETRY -#undef ALLOW_HIGHLAT_ALTIMETRY +C o Include global mean steric sea level correction +#undef ALLOW_PSBAR_STERIC +#ifdef ATMOSPHERIC_LOADING +C Apply inverse barometer correction (coded within ATMOSPHERIC_LOADING) +# define ALLOW_IB_CORR +#endif +C o Allow for near-shore and high-latitude altimetry +#undef ALLOW_SHALLOW_ALTIMETRY +#undef ALLOW_HIGHLAT_ALTIMETRY -C >>> In-Situ Profiles. +C o Allow for In-Situ Profiles cost function contribution #define ALLOW_PROFILES_CONTRIBUTION +C o Cost function output format +#define ALLOW_ECCO_OLD_FC_PRINT + +C o Generate more text in STDOUT +#undef ECCO_VERBOSE +#undef ALLOW_ECCO_DEBUG + +C-- partially retired options (i.e., only used to set default switch): +# undef ALLOW_SSH_COST_CONTRIBUTION +# undef ALLOW_SST_COST_CONTRIBUTION +# undef ALLOW_SEAICE_COST_CONTRIBUTION + C ================================================================== #endif /* ndef ECCO_CPPOPTIONS_H */ #endif /* ALLOW_ECCO */ #endif /* ECCO_OPTIONS_H */ - diff --git a/verification/global_oce_biogeo_bling/code_tap/AUTODIFF_OPTIONS.h b/verification/global_oce_biogeo_bling/code_tap/AUTODIFF_OPTIONS.h index b92794d8d2..7bcb6fdc8a 100644 --- a/verification/global_oce_biogeo_bling/code_tap/AUTODIFF_OPTIONS.h +++ b/verification/global_oce_biogeo_bling/code_tap/AUTODIFF_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef AUTODIFF_OPTIONS_H +#define AUTODIFF_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: AUTODIFF_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef AUTODIFF_OPTIONS_H -#define AUTODIFF_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_AUTODIFF #ifdef ECCO_CPPOPTIONS_H @@ -26,10 +26,11 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -C o Include/exclude code in order to be able to automatically -C differentiate the MITgcmUV by using the Tangent Linear and -C Adjoint Model Compiler (TAMC). +C o Include/exclude code in order to automatically differentiate MITgcm code +C using TAF (Transformation of Algorithms in Fortran, http://www.FastOpt.de) +C or using TAMC (Tangent Linear & Adjoint Model Compiler, needs both defined): #undef ALLOW_AUTODIFF_TAMC +#undef AUTODIFF_TAMC_COMPATIBILITY C >>> Checkpointing as handled by TAMC #undef ALLOW_TAMC_CHECKPOINTING @@ -40,19 +41,19 @@ C >>> and DYNVARS_DIAG adjoint state #undef ALLOW_AUTODIFF_MONITOR_DIAG C >>> DO 2-level checkpointing instead of 3-level -c#undef AUTODIFF_2_LEVEL_CHECKPOINT +#undef AUTODIFF_2_LEVEL_CHECKPOINT C extend to 4-level checkpointing -c#undef AUTODIFF_4_LEVEL_CHECKPOINT +#undef AUTODIFF_4_LEVEL_CHECKPOINT C o use divided adjoint to split adjoint computations #undef ALLOW_DIVIDED_ADJOINT -#undef ALLOW_PACKUNPACK_METHOD2 - C o This flag is incredibly useful as it reduces the number of C tape-files on the disc. Maybe it should even be the default. #undef ALLOW_AUTODIFF_WHTAPEIO +C and related to above: +#undef ALLOW_INIT_WHTAPEIO C o use standard MDSFINDUINTS instead of local pkg/autodiff version for C WHTAPEIO code I/O. @@ -70,6 +71,10 @@ C Might still be used for OBCS since WHTAPEIO does not support OBCS fields. C o allow using viscFacInAd to recompute viscosities in AD #define AUTODIFF_ALLOW_VISCFACADJ +C o To remove part of MOM_CALC_VISC (better name would be: MOM_DISABLE_*) +#undef AUTODIFF_DISABLE_LEITH +#undef AUTODIFF_DISABLE_REYNOLDS_SCALE + C o for output of AD-variables (ALLOW_AUTODIFF_MONITOR), specific code (e.g., C in addummy_in_stepping.F) relies on adexch_uv_xy_rs and adexch_xy_rs S/R C which might not always be generated by TAF (e.g., when controls do not diff --git a/verification/global_oce_biogeo_bling/code_tap/CTRL_OPTIONS.h b/verification/global_oce_biogeo_bling/code_tap/CTRL_OPTIONS.h index c61f59502f..a054296d82 100644 --- a/verification/global_oce_biogeo_bling/code_tap/CTRL_OPTIONS.h +++ b/verification/global_oce_biogeo_bling/code_tap/CTRL_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef CTRL_OPTIONS_H +#define CTRL_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: CTRL_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef CTRL_OPTIONS_H -#define CTRL_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_CTRL #ifdef ECCO_CPPOPTIONS_H @@ -28,33 +28,89 @@ C-- Package-specific Options & Macros go here C o I/O and pack settings #define CTRL_SET_PREC_32 +C This option is only relevant (for pack/unpack) with OBCS_CONTROL: #undef ALLOW_NONDIMENSIONAL_CONTROL_IO -#define ALLOW_PACKUNPACK_METHOD2 -CMM( #define EXCLUDE_CTRL_PACK -CMM) +#define ALLOW_PACKUNPACK_METHOD2 +#undef CTRL_DO_PACK_UNPACK_ONLY +#undef CTRL_PACK_PRECISE +#undef CTRL_UNPACK_PRECISE +#undef CTRL_DELZNORM +#undef ALLOW_CTRL_WETV -C o sets of controls -#define ALLOW_GENTIM2D_CONTROL +C >>> Other Control. +C Allows for GMREDI controls +#undef ALLOW_KAPGM_CONTROL +#undef ALLOW_KAPREDI_CONTROL +C Allows for Vertical Diffusivity controls +#undef ALLOW_DIFFKR_CONTROL +#undef ALLOW_BOTTOMDRAG_CONTROL +#undef ALLOW_DIC_CONTROL + +C Allows bathymetry as a control vector +C Note: keep this Option separated from generic control since this control +C involves many new dependencies that we would like to avoid in general. +#undef ALLOW_DEPTH_CONTROL +#ifdef ALLOW_DEPTH_CONTROL +C Only relevant within DEPTH_CONTROL code: +# define USE_SMOOTH_MIN +# undef ALLOW_HFACC_CONTROL +# undef ALLOW_HFACC3D_CONTROL +#endif /* ALLOW_DEPTH_CONTROL */ + +C >>> Generic Control. #define ALLOW_GENARR2D_CONTROL #define ALLOW_GENARR3D_CONTROL +#define ALLOW_GENTIM2D_CONTROL +# undef ALLOW_UVEL0_CONTROL +# undef ALLOW_VVEL0_CONTROL +# undef CTRL_SET_OLD_MAXCVARS_30 +# undef CTRL_SET_OLD_MAXCVARS_40 -C o use pkg/smooth correlation operator (incl. smoother) for 3D controls (Weaver, Courtier 01) -C This CPP option just sets the default for ctrlSmoothCorrel23 to .TRUE. -#undef ALLOW_SMOOTH_CORREL3D -C o use pkg/smooth correlation operator (incl. smoother) for 2D controls (Weaver, Courtier 01) -C This CPP option just sets the default for ctrlSmoothCorrel2D to .TRUE. -#undef ALLOW_SMOOTH_CORREL2D +C >>> Open boundaries +#ifdef ALLOW_OBCS +C Control of Open-Boundaries is meaningless without compiling pkg/obcs +C Note: Make sure that corresponding OBCS N/S/W/E Option is defined +# define ALLOW_OBCSN_CONTROL +# define ALLOW_OBCSS_CONTROL +# define ALLOW_OBCSW_CONTROL +# define ALLOW_OBCSE_CONTROL +# undef ALLOW_OBCS_CONTROL_MODES +#endif /* ALLOW_OBCS */ -C o impose bounds on controls -CMM#define ALLOW_ADCTRLBOUND +C o Set ALLOW_OBCS_CONTROL (Do not edit/modify): +#if (defined (ALLOW_OBCSN_CONTROL) || \ + defined (ALLOW_OBCSS_CONTROL) || \ + defined (ALLOW_OBCSW_CONTROL) || \ + defined (ALLOW_OBCSE_CONTROL)) +# define ALLOW_OBCS_CONTROL +#endif -C o rotate u/v vector control to zonal/meridional -C components -CMM#define ALLOW_ROTATE_UV_CONTROLS +C o Impose bounds on controls +#undef ALLOW_ADCTRLBOUND + +C o Rotation of wind/stress controls adjustments +C from Eastward/Northward to model grid directions +#undef ALLOW_ROTATE_UV_CONTROLS + +C o Originally the first two time-reccords of control +C variable tau u and tau v were skipped. +C The CTRL_SKIP_FIRST_TWO_ATM_REC_ALL option extends this +C to the other the time variable atmospheric controls. +#undef CTRL_SKIP_FIRST_TWO_ATM_REC_ALL + +C Note: this flag turns on extra smoothing code in ctrl_get_gen.F which +C is inconsistent with the Weaver and Courtier, 2001 algorithm, and +C should probably not be used. The corresponding 3D flag applied only +C to deprecated code that is now removed. At some point we will remove +C this flag and associated code as well. +C o apply pkg/smooth/smooth_diff2d.F to 2D controls (outside of Smooth_Correl2D) +#undef ALLOW_SMOOTH_CTRL2D + +C o Print more debug info to STDOUT +#undef ALLOW_CTRL_DEBUG C ================================================================== #endif /* ndef ECCO_CPPOPTIONS_H */ #endif /* ALLOW_CTRL */ #endif /* CTRL_OPTIONS_H */ - diff --git a/verification/global_oce_biogeo_bling/code_tap/ECCO_OPTIONS.h b/verification/global_oce_biogeo_bling/code_tap/ECCO_OPTIONS.h index 312710da1f..6b59908c1f 100644 --- a/verification/global_oce_biogeo_bling/code_tap/ECCO_OPTIONS.h +++ b/verification/global_oce_biogeo_bling/code_tap/ECCO_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef ECCO_OPTIONS_H +#define ECCO_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: ECCO_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef ECCO_OPTIONS_H -#define ECCO_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_ECCO #ifdef ECCO_CPPOPTIONS_H @@ -23,49 +23,70 @@ C in CPP_OPTIONS.h), this option file is left empty since all options that C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h #else /* ndef ECCO_CPPOPTIONS_H */ -C ================================================================== -C-- Package-specific Options & Macros go here -C - -C >>> use model/src/forward_step.F -CMM obsolete now #define ALLOW_ECCO_EVOLUTION -C >>> Cost function contributions -#define ALLOW_ECCO_OLD_FC_PRINT +C-- Package-specific Options & Macros go here -C >>> ALLOW_GENCOST_CONTRIBUTION: interactive way to add basic 2D cost function terms. -C > In data.ecco, this requires the specification of data file (name, frequency, -C etc.), bar file name for corresp. model average, standard error file name, etc. -C > In addition, adding such cost terms requires editing ecco_cost.h to increase -C NGENCOST, and editing cost_gencost_customize.F to implement the actual -C model average (i.e. the bar file content). +C o Allow for generic cost function and integral terms with pkg/ecco: #define ALLOW_GENCOST_CONTRIBUTION -C >>> free form version of GENCOST: allows one to use otherwise defined elements (e.g. -C psbar and and topex data) while taking advantage of the cost function/namelist slots -C that can be made available using ALLOW_GENCOST_CONTRIBUTION. To this end -C ALLOW_GENCOST_CONTRIBUTION simply switches off tests that check whether all of the -C gencost elements (e.g. gencost_barfile and gencost_datafile) are specified in data.ecco. -C > While this option increases flexibility within the gencost framework, it implies more room -C for error, so it should be used cautiously, and with good knowledge of the rest of pkg/ecco. -C > It requires providing a specific cost function routine, and editing cost_gencost_all.F accordingly. -#define ALLOW_GENCOST_FREEFORM -C >>> 3 dimensional version of GENCOST: +C o Allow for 3 dimensional generic cost terms with pkg/ecco: #define ALLOW_GENCOST3D +C Note regarding GENCOST usage: +C > In data.ecco, this requires the specification of data file (name, +C frequency, etc.), bar file name for corresp. model average, standard +C error file name, etc. +C > In addition, adding such cost terms requires editing ECCO_SIZE.h to +C increase NGENCOST/NGENCOST3D, and editing cost_gencost_customize.F to +C implement the actual model average (i.e. the bar file content). +# undef ALLOW_GENCOST_1D +# undef ALLOW_GENCOST_SSTV4_OUTPUT + +C o Allow Open-Boundary cost contributions +#ifdef ALLOW_OBCS +C Open-Boundary cost is meaningless without compiling pkg/obcs +C Note: Make sure that coresponding OBCS N/S/W/E Option is defined +# define ALLOW_OBCSN_COST_CONTRIBUTION +# define ALLOW_OBCSS_COST_CONTRIBUTION +# define ALLOW_OBCSW_COST_CONTRIBUTION +# define ALLOW_OBCSE_COST_CONTRIBUTION +# undef OBCS_AGEOS_COST_CONTRIBUTION +# undef OBCS_VOLFLUX_COST_CONTRIBUTION +# undef BAROTROPIC_OBVEL_CONTROL +#endif /* ALLOW_OBCS */ -c in case there is a single observational file (rather than yearly files) -c assume it contains a climatology (otherwise, assume it is a full time series) -#define COST_GENERIC_ASSUME_CYCLIC +C o Set ALLOW_OBCS_COST_CONTRIBUTION (Do not edit/modify): +#if (defined (ALLOW_OBCSN_COST_CONTRIBUTION) || \ + defined (ALLOW_OBCSS_COST_CONTRIBUTION) || \ + defined (ALLOW_OBCSW_COST_CONTRIBUTION) || \ + defined (ALLOW_OBCSE_COST_CONTRIBUTION)) +# define ALLOW_OBCS_COST_CONTRIBUTION +#endif -c include global mean steric sea level correction in etanFull -CMM #define ALLOW_PSBAR_STERIC -CMM#define ALLOW_SHALLOW_ALTIMETRY -#undef ALLOW_HIGHLAT_ALTIMETRY +C o Include global mean steric sea level correction +#undef ALLOW_PSBAR_STERIC +#ifdef ATMOSPHERIC_LOADING +C Apply inverse barometer correction (coded within ATMOSPHERIC_LOADING) +# define ALLOW_IB_CORR +#endif +C o Allow for near-shore and high-latitude altimetry +#undef ALLOW_SHALLOW_ALTIMETRY +#undef ALLOW_HIGHLAT_ALTIMETRY -C >>> In-Situ Profiles. +C o Allow for In-Situ Profiles cost function contribution #define ALLOW_PROFILES_CONTRIBUTION +C o Cost function output format +#define ALLOW_ECCO_OLD_FC_PRINT + +C o Generate more text in STDOUT +#undef ECCO_VERBOSE +#undef ALLOW_ECCO_DEBUG + +C-- partially retired options (i.e., only used to set default switch): +# undef ALLOW_SSH_COST_CONTRIBUTION +# undef ALLOW_SST_COST_CONTRIBUTION +# undef ALLOW_SEAICE_COST_CONTRIBUTION + C ================================================================== #endif /* ndef ECCO_CPPOPTIONS_H */ #endif /* ALLOW_ECCO */ #endif /* ECCO_OPTIONS_H */ - diff --git a/verification/global_oce_latlon/code_ad/AUTODIFF_OPTIONS.h b/verification/global_oce_latlon/code_ad/AUTODIFF_OPTIONS.h index 2604c81b9a..578310ceb3 100644 --- a/verification/global_oce_latlon/code_ad/AUTODIFF_OPTIONS.h +++ b/verification/global_oce_latlon/code_ad/AUTODIFF_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef AUTODIFF_OPTIONS_H +#define AUTODIFF_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: AUTODIFF_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef AUTODIFF_OPTIONS_H -#define AUTODIFF_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_AUTODIFF #ifdef ECCO_CPPOPTIONS_H @@ -26,10 +26,11 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -C o Include/exclude code in order to be able to automatically -C differentiate the MITgcmUV by using the Tangent Linear and -C Adjoint Model Compiler (TAMC). +C o Include/exclude code in order to automatically differentiate MITgcm code +C using TAF (Transformation of Algorithms in Fortran, http://www.FastOpt.de) +C or using TAMC (Tangent Linear & Adjoint Model Compiler, needs both defined): #define ALLOW_AUTODIFF_TAMC +#undef AUTODIFF_TAMC_COMPATIBILITY C >>> Checkpointing as handled by TAMC #define ALLOW_TAMC_CHECKPOINTING @@ -40,19 +41,19 @@ C >>> and DYNVARS_DIAG adjoint state #undef ALLOW_AUTODIFF_MONITOR_DIAG C >>> DO 2-level checkpointing instead of 3-level -c#undef AUTODIFF_2_LEVEL_CHECKPOINT +#undef AUTODIFF_2_LEVEL_CHECKPOINT C extend to 4-level checkpointing -c#undef AUTODIFF_4_LEVEL_CHECKPOINT +#undef AUTODIFF_4_LEVEL_CHECKPOINT C o use divided adjoint to split adjoint computations #undef ALLOW_DIVIDED_ADJOINT -#undef ALLOW_PACKUNPACK_METHOD2 - C o This flag is incredibly useful as it reduces the number of C tape-files on the disc. Maybe it should even be the default. #define ALLOW_AUTODIFF_WHTAPEIO +C and related to above: +#undef ALLOW_INIT_WHTAPEIO C o use standard MDSFINDUINTS instead of local pkg/autodiff version for C WHTAPEIO code I/O. @@ -70,6 +71,10 @@ C Might still be used for OBCS since WHTAPEIO does not support OBCS fields. C o allow using viscFacInAd to recompute viscosities in AD #define AUTODIFF_ALLOW_VISCFACADJ +C o To remove part of MOM_CALC_VISC (better name would be: MOM_DISABLE_*) +#undef AUTODIFF_DISABLE_LEITH +#undef AUTODIFF_DISABLE_REYNOLDS_SCALE + C o for output of AD-variables (ALLOW_AUTODIFF_MONITOR), specific code (e.g., C in addummy_in_stepping.F) relies on adexch_uv_xy_rs and adexch_xy_rs S/R C which might not always be generated by TAF (e.g., when controls do not diff --git a/verification/global_oce_latlon/code_ad/COST_OPTIONS.h b/verification/global_oce_latlon/code_ad/COST_OPTIONS.h index b9ce4eb93e..64a1943d48 100644 --- a/verification/global_oce_latlon/code_ad/COST_OPTIONS.h +++ b/verification/global_oce_latlon/code_ad/COST_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef COST_OPTIONS_H +#define COST_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: COST_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef COST_OPTIONS_H -#define COST_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_COST #ifdef ECCO_CPPOPTIONS_H @@ -26,51 +26,24 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -C >>> Use the EGM-96 geoid error covariance. -#undef ALLOW_EGM96_ERROR_COV -#undef ALLOW_READ_EGM_DATA +#undef ALLOW_COST_STATE_FINAL +#undef ALLOW_COST_VECTOR + C >>> Cost function contributions -#undef ALLOW_HFLUX_COST_CONTRIBUTION -#undef ALLOW_SFLUX_COST_CONTRIBUTION -#undef ALLOW_USTRESS_COST_CONTRIBUTION -#undef ALLOW_VSTRESS_COST_CONTRIBUTION -#undef ALLOW_THETA_COST_CONTRIBUTION -#undef ALLOW_SALT_COST_CONTRIBUTION -#undef ALLOW_SST_COST_CONTRIBUTION -#undef ALLOW_SSS_COST_CONTRIBUTION -#undef ALLOW_SSH_COST_CONTRIBUTION -#undef ALLOW_CTDT_COST_CONTRIBUTION -#undef ALLOW_CTDS_COST_CONTRIBUTION -#undef ALLOW_COST_ATLANTIC #undef ALLOW_COST_ATLANTIC_HEAT #undef ALLOW_COST_ATLANTIC_HEAT_DOMASS #define ALLOW_COST_TEST #define ALLOW_COST_TSQUARED +#undef ALLOW_COST_DEPTH #undef ALLOW_COST_TRACER -C >>> ALLOW_GENCOST_CONTRIBUTION: interactive way to add basic 2D cost -C function terms. -C > In data.ecco, this requires the specification of data file (name, -C frequency, etc.), bar file name for corresp. model average, standard -C error file name, etc. -C > In addition, adding such cost terms requires editing ecco_cost.h to -C increase NGENCOST, and editing cost_gencost_customize.F to implement -C the actual model average (i.e. the bar file content). -#undef ALLOW_GENCOST_CONTRIBUTION -C >>> free form version of GENCOST: allows one to use otherwise defined -C elements (e.g. psbar and and topex data) while taking advantage of the -C cost function/namelist slots that can be made available using -C ALLOW_GENCOST_CONTRIBUTION. To this end ALLOW_GENCOST_CONTRIBUTION -C simply switches off tests that check whether all of the gencost -C elements (e.g. gencost_barfile and gencost_datafile) are specified -C in data.ecco. -C > While this option increases flexibility within the gencost framework, -C it implies more room for error, so it should be used cautiously, and -C with good knowledge of the rest of pkg/ecco. -C > It requires providing a specific cost function routine, and editing -C cost_gencost_all.F accordingly. -#undef ALLOW_GENCOST_FREEFORM +C List these options here: +#undef ALLOW_COST_TEMP +#undef ALLOW_COST_HFLUXM +#undef ALLOW_DIC_COST +#undef ALLOW_THSICE_COST_TEST +#undef ALLOW_COST_SHELFICE C ================================================================== #endif /* ndef ECCO_CPPOPTIONS_H */ diff --git a/verification/global_oce_latlon/code_ad/CTRL_OPTIONS.h b/verification/global_oce_latlon/code_ad/CTRL_OPTIONS.h index c68aa4ebc9..4e1523ae42 100644 --- a/verification/global_oce_latlon/code_ad/CTRL_OPTIONS.h +++ b/verification/global_oce_latlon/code_ad/CTRL_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef CTRL_OPTIONS_H +#define CTRL_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: CTRL_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef CTRL_OPTIONS_H -#define CTRL_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_CTRL #ifdef ECCO_CPPOPTIONS_H @@ -26,55 +26,68 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -C o Re-activate deprecated codes in pkg/ecco & pkg/ctrl (but not recommended) -C and since pkg/ctrl can be used without pkg/ecco, better to have it here -#undef ECCO_CTRL_DEPRECATED - -#undef EXCLUDE_CTRL_PACK +C o I/O and pack settings +#undef CTRL_SET_PREC_32 +C This option is only relevant (for pack/unpack) with OBCS_CONTROL: #undef ALLOW_NONDIMENSIONAL_CONTROL_IO - -C >>> Initial values. -#undef ALLOW_THETA0_CONTROL -#undef ALLOW_SALT0_CONTROL -#undef ALLOW_UVEL0_CONTROL -#undef ALLOW_VVEL0_CONTROL -#undef ALLOW_TR10_CONTROL -#undef ALLOW_TAUU0_CONTROL -#undef ALLOW_TAUV0_CONTROL -#undef ALLOW_SFLUX0_CONTROL -#undef ALLOW_HFLUX0_CONTROL -#undef ALLOW_SSS0_CONTROL -#undef ALLOW_SST0_CONTROL - -C >>> Surface fluxes. -#undef ALLOW_HFLUX_CONTROL -#undef ALLOW_SFLUX_CONTROL -#undef ALLOW_USTRESS_CONTROL -#undef ALLOW_VSTRESS_CONTROL -#undef ALLOW_SWFLUX_CONTROL -#undef ALLOW_LWFLUX_CONTROL - -C >>> Atmospheric state. -#undef ALLOW_ATEMP_CONTROL -#undef ALLOW_AQH_CONTROL -#undef ALLOW_UWIND_CONTROL -#undef ALLOW_VWIND_CONTROL -#undef ALLOW_PRECIP_CONTROL +#undef EXCLUDE_CTRL_PACK +#undef ALLOW_PACKUNPACK_METHOD2 +#undef CTRL_DO_PACK_UNPACK_ONLY +#undef CTRL_PACK_PRECISE +#undef CTRL_UNPACK_PRECISE +#undef CTRL_DELZNORM +#undef ALLOW_CTRL_WETV C >>> Other Control. -#define ALLOW_DIFFKR_CONTROL +C Allows for GMREDI controls #define ALLOW_KAPGM_CONTROL #undef ALLOW_KAPREDI_CONTROL +C Allows for Vertical Diffusivity controls +#define ALLOW_DIFFKR_CONTROL #undef ALLOW_BOTTOMDRAG_CONTROL - -C >>> Backward compatibility option (before checkpoint 65p) -#undef ALLOW_KAPGM_CONTROL_OLD -#undef ALLOW_KAPREDI_CONTROL_OLD +#undef ALLOW_DIC_CONTROL + +C Allows bathymetry as a control vector +C Note: keep this Option separated from generic control since this control +C involves many new dependencies that we would like to avoid in general. +#undef ALLOW_DEPTH_CONTROL +#ifdef ALLOW_DEPTH_CONTROL +C Only relevant within DEPTH_CONTROL code: +# define USE_SMOOTH_MIN +# undef ALLOW_HFACC_CONTROL +# undef ALLOW_HFACC3D_CONTROL +#endif /* ALLOW_DEPTH_CONTROL */ C >>> Generic Control. #undef ALLOW_GENARR2D_CONTROL #define ALLOW_GENARR3D_CONTROL #undef ALLOW_GENTIM2D_CONTROL +# undef ALLOW_UVEL0_CONTROL +# undef ALLOW_VVEL0_CONTROL +# undef CTRL_SET_OLD_MAXCVARS_30 +# undef CTRL_SET_OLD_MAXCVARS_40 + +C >>> Open boundaries +#ifdef ALLOW_OBCS +C Control of Open-Boundaries is meaningless without compiling pkg/obcs +C Note: Make sure that corresponding OBCS N/S/W/E Option is defined +# define ALLOW_OBCSN_CONTROL +# define ALLOW_OBCSS_CONTROL +# define ALLOW_OBCSW_CONTROL +# define ALLOW_OBCSE_CONTROL +# undef ALLOW_OBCS_CONTROL_MODES +#endif /* ALLOW_OBCS */ + +C o Set ALLOW_OBCS_CONTROL (Do not edit/modify): +#if (defined (ALLOW_OBCSN_CONTROL) || \ + defined (ALLOW_OBCSS_CONTROL) || \ + defined (ALLOW_OBCSW_CONTROL) || \ + defined (ALLOW_OBCSE_CONTROL)) +# define ALLOW_OBCS_CONTROL +#endif + +C o Impose bounds on controls +#undef ALLOW_ADCTRLBOUND C o Rotation of wind/stress controls adjustments C from Eastward/Northward to model grid directions @@ -86,19 +99,16 @@ C The CTRL_SKIP_FIRST_TWO_ATM_REC_ALL option extends this C to the other the time variable atmospheric controls. #undef CTRL_SKIP_FIRST_TWO_ATM_REC_ALL -C o use pkg/smooth correlation operator (incl. smoother) for 2D controls (Weaver, Courtier 01) -C This CPP option just sets the default for ctrlSmoothCorrel2D to .TRUE. -#undef ALLOW_SMOOTH_CORREL2D -C o use pkg/smooth correlation operator (incl. smoother) for 3D controls (Weaver, Courtier 01) -C This CPP option just sets the default for ctrlSmoothCorrel3D to .TRUE. -#undef ALLOW_SMOOTH_CORREL3D - -C o apply pkg/ctrl/ctrl_smooth.F to 2D controls (outside of ctrlSmoothCorrel2D) -#undef ALLOW_CTRL_SMOOTH -C o apply pkg/smooth/smooth_diff2d.F to 2D controls (outside of ctrlSmoothCorrel2D) +C Note: this flag turns on extra smoothing code in ctrl_get_gen.F which +C is inconsistent with the Weaver and Courtier, 2001 algorithm, and +C should probably not be used. The corresponding 3D flag applied only +C to deprecated code that is now removed. At some point we will remove +C this flag and associated code as well. +C o apply pkg/smooth/smooth_diff2d.F to 2D controls (outside of Smooth_Correl2D) #undef ALLOW_SMOOTH_CTRL2D -C o apply pkg/smooth/smooth_diff3d.F to 3D controls (outside of ctrlSmoothCorrel3D) -#undef ALLOW_SMOOTH_CTRL3D + +C o Print more debug info to STDOUT +#undef ALLOW_CTRL_DEBUG C ================================================================== #endif /* ndef ECCO_CPPOPTIONS_H */ diff --git a/verification/global_oce_latlon/code_ad/SIZE.h b/verification/global_oce_latlon/code_ad/SIZE.h index df51fbd561..0a9c5c2eb1 100644 --- a/verification/global_oce_latlon/code_ad/SIZE.h +++ b/verification/global_oce_latlon/code_ad/SIZE.h @@ -42,12 +42,12 @@ CEOP INTEGER Ny INTEGER Nr PARAMETER ( - & sNx = 90, - & sNy = 40, + & sNx = 45, + & sNy = 20, & OLx = 3, & OLy = 3, - & nSx = 1, - & nSy = 1, + & nSx = 2, + & nSy = 2, & nPx = 1, & nPy = 1, & Nx = sNx*nSx*nPx, diff --git a/verification/global_oce_latlon/code_ad/SIZE.h_mpi b/verification/global_oce_latlon/code_ad/SIZE.h_mpi new file mode 100644 index 0000000000..9734aa7941 --- /dev/null +++ b/verification/global_oce_latlon/code_ad/SIZE.h_mpi @@ -0,0 +1,64 @@ +CBOP +C !ROUTINE: SIZE.h +C !INTERFACE: +C include SIZE.h +C !DESCRIPTION: \bv +C *==========================================================* +C | SIZE.h Declare size of underlying computational grid. +C *==========================================================* +C | The design here supports a three-dimensional model grid +C | with indices I,J and K. The three-dimensional domain +C | is comprised of nPx*nSx blocks (or tiles) of size sNx +C | along the first (left-most index) axis, nPy*nSy blocks +C | of size sNy along the second axis and one block of size +C | Nr along the vertical (third) axis. +C | Blocks/tiles have overlap regions of size OLx and OLy +C | along the dimensions that are subdivided. +C *==========================================================* +C \ev +C +C Voodoo numbers controlling data layout: +C sNx :: Number of X points in tile. +C sNy :: Number of Y points in tile. +C OLx :: Tile overlap extent in X. +C OLy :: Tile overlap extent in Y. +C nSx :: Number of tiles per process in X. +C nSy :: Number of tiles per process in Y. +C nPx :: Number of processes to use in X. +C nPy :: Number of processes to use in Y. +C Nx :: Number of points in X for the full domain. +C Ny :: Number of points in Y for the full domain. +C Nr :: Number of points in vertical direction. +CEOP + INTEGER sNx + INTEGER sNy + INTEGER OLx + INTEGER OLy + INTEGER nSx + INTEGER nSy + INTEGER nPx + INTEGER nPy + INTEGER Nx + INTEGER Ny + INTEGER Nr + PARAMETER ( + & sNx = 45, + & sNy = 20, + & OLx = 3, + & OLy = 3, + & nSx = 1, + & nSy = 1, + & nPx = 2, + & nPy = 2, + & Nx = sNx*nSx*nPx, + & Ny = sNy*nSy*nPy, + & Nr = 15) + +C MAX_OLX :: Set to the maximum overlap region size of any array +C MAX_OLY that will be exchanged. Controls the sizing of exch +C routine buffers. + INTEGER MAX_OLX + INTEGER MAX_OLY + PARAMETER ( MAX_OLX = OLx, + & MAX_OLY = OLy ) + diff --git a/verification/global_oce_latlon/code_oad/AUTODIFF_OPTIONS.h b/verification/global_oce_latlon/code_oad/AUTODIFF_OPTIONS.h index b69f4d1f96..320d430d84 100644 --- a/verification/global_oce_latlon/code_oad/AUTODIFF_OPTIONS.h +++ b/verification/global_oce_latlon/code_oad/AUTODIFF_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef AUTODIFF_OPTIONS_H +#define AUTODIFF_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: AUTODIFF_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef AUTODIFF_OPTIONS_H -#define AUTODIFF_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_AUTODIFF #ifdef ECCO_CPPOPTIONS_H @@ -26,10 +26,11 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -C o Include/exclude code in order to be able to automatically -C differentiate the MITgcmUV by using the Tangent Linear and -C Adjoint Model Compiler (TAMC). +C o Include/exclude code in order to automatically differentiate MITgcm code +C using TAF (Transformation of Algorithms in Fortran, http://www.FastOpt.de) +C or using TAMC (Tangent Linear & Adjoint Model Compiler, needs both defined): #undef ALLOW_AUTODIFF_TAMC +#undef AUTODIFF_TAMC_COMPATIBILITY C >>> Checkpointing as handled by TAMC #define ALLOW_TAMC_CHECKPOINTING @@ -40,19 +41,19 @@ C >>> and DYNVARS_DIAG adjoint state #undef ALLOW_AUTODIFF_MONITOR_DIAG C >>> DO 2-level checkpointing instead of 3-level -c#undef AUTODIFF_2_LEVEL_CHECKPOINT +#undef AUTODIFF_2_LEVEL_CHECKPOINT C extend to 4-level checkpointing -c#undef AUTODIFF_4_LEVEL_CHECKPOINT +#undef AUTODIFF_4_LEVEL_CHECKPOINT C o use divided adjoint to split adjoint computations #undef ALLOW_DIVIDED_ADJOINT -#undef ALLOW_PACKUNPACK_METHOD2 - C o This flag is incredibly useful as it reduces the number of C tape-files on the disc. Maybe it should even be the default. #undef ALLOW_AUTODIFF_WHTAPEIO +C and related to above: +#undef ALLOW_INIT_WHTAPEIO C o use standard MDSFINDUINTS instead of local pkg/autodiff version for C WHTAPEIO code I/O. @@ -67,12 +68,13 @@ C Might still be used for OBCS since WHTAPEIO does not support OBCS fields. #undef AUTODIFF_USE_STORE_RESTORE #undef AUTODIFF_USE_STORE_RESTORE_OBCS -C o write separate tape files for each ptracer (has no effect, to be removed) -#undef AUTODIFF_PTRACERS_SPLIT_FILES - C o allow using viscFacInAd to recompute viscosities in AD #undef AUTODIFF_ALLOW_VISCFACADJ +C o To remove part of MOM_CALC_VISC (better name would be: MOM_DISABLE_*) +#undef AUTODIFF_DISABLE_LEITH +#undef AUTODIFF_DISABLE_REYNOLDS_SCALE + C o for output of AD-variables (ALLOW_AUTODIFF_MONITOR), specific code (e.g., C in addummy_in_stepping.F) relies on adexch_uv_xy_rs and adexch_xy_rs S/R C which might not always be generated by TAF (e.g., when controls do not diff --git a/verification/global_oce_latlon/code_oad/COST_OPTIONS.h b/verification/global_oce_latlon/code_oad/COST_OPTIONS.h index b9ce4eb93e..64a1943d48 100644 --- a/verification/global_oce_latlon/code_oad/COST_OPTIONS.h +++ b/verification/global_oce_latlon/code_oad/COST_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef COST_OPTIONS_H +#define COST_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: COST_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef COST_OPTIONS_H -#define COST_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_COST #ifdef ECCO_CPPOPTIONS_H @@ -26,51 +26,24 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -C >>> Use the EGM-96 geoid error covariance. -#undef ALLOW_EGM96_ERROR_COV -#undef ALLOW_READ_EGM_DATA +#undef ALLOW_COST_STATE_FINAL +#undef ALLOW_COST_VECTOR + C >>> Cost function contributions -#undef ALLOW_HFLUX_COST_CONTRIBUTION -#undef ALLOW_SFLUX_COST_CONTRIBUTION -#undef ALLOW_USTRESS_COST_CONTRIBUTION -#undef ALLOW_VSTRESS_COST_CONTRIBUTION -#undef ALLOW_THETA_COST_CONTRIBUTION -#undef ALLOW_SALT_COST_CONTRIBUTION -#undef ALLOW_SST_COST_CONTRIBUTION -#undef ALLOW_SSS_COST_CONTRIBUTION -#undef ALLOW_SSH_COST_CONTRIBUTION -#undef ALLOW_CTDT_COST_CONTRIBUTION -#undef ALLOW_CTDS_COST_CONTRIBUTION -#undef ALLOW_COST_ATLANTIC #undef ALLOW_COST_ATLANTIC_HEAT #undef ALLOW_COST_ATLANTIC_HEAT_DOMASS #define ALLOW_COST_TEST #define ALLOW_COST_TSQUARED +#undef ALLOW_COST_DEPTH #undef ALLOW_COST_TRACER -C >>> ALLOW_GENCOST_CONTRIBUTION: interactive way to add basic 2D cost -C function terms. -C > In data.ecco, this requires the specification of data file (name, -C frequency, etc.), bar file name for corresp. model average, standard -C error file name, etc. -C > In addition, adding such cost terms requires editing ecco_cost.h to -C increase NGENCOST, and editing cost_gencost_customize.F to implement -C the actual model average (i.e. the bar file content). -#undef ALLOW_GENCOST_CONTRIBUTION -C >>> free form version of GENCOST: allows one to use otherwise defined -C elements (e.g. psbar and and topex data) while taking advantage of the -C cost function/namelist slots that can be made available using -C ALLOW_GENCOST_CONTRIBUTION. To this end ALLOW_GENCOST_CONTRIBUTION -C simply switches off tests that check whether all of the gencost -C elements (e.g. gencost_barfile and gencost_datafile) are specified -C in data.ecco. -C > While this option increases flexibility within the gencost framework, -C it implies more room for error, so it should be used cautiously, and -C with good knowledge of the rest of pkg/ecco. -C > It requires providing a specific cost function routine, and editing -C cost_gencost_all.F accordingly. -#undef ALLOW_GENCOST_FREEFORM +C List these options here: +#undef ALLOW_COST_TEMP +#undef ALLOW_COST_HFLUXM +#undef ALLOW_DIC_COST +#undef ALLOW_THSICE_COST_TEST +#undef ALLOW_COST_SHELFICE C ================================================================== #endif /* ndef ECCO_CPPOPTIONS_H */ diff --git a/verification/global_oce_latlon/code_oad/CTRL_OPTIONS.h b/verification/global_oce_latlon/code_oad/CTRL_OPTIONS.h index 09c6405623..ef978d6407 100644 --- a/verification/global_oce_latlon/code_oad/CTRL_OPTIONS.h +++ b/verification/global_oce_latlon/code_oad/CTRL_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef CTRL_OPTIONS_H +#define CTRL_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: CTRL_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef CTRL_OPTIONS_H -#define CTRL_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_CTRL #ifdef ECCO_CPPOPTIONS_H @@ -26,55 +26,68 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -C o Re-activate deprecated codes in pkg/ecco & pkg/ctrl (but not recommended) -C and since pkg/ctrl can be used without pkg/ecco, better to have it here -#undef ECCO_CTRL_DEPRECATED - -#undef EXCLUDE_CTRL_PACK +C o I/O and pack settings +#undef CTRL_SET_PREC_32 +C This option is only relevant (for pack/unpack) with OBCS_CONTROL: #undef ALLOW_NONDIMENSIONAL_CONTROL_IO - -C >>> Initial values. -#undef ALLOW_THETA0_CONTROL -#undef ALLOW_SALT0_CONTROL -#undef ALLOW_UVEL0_CONTROL -#undef ALLOW_VVEL0_CONTROL -#undef ALLOW_TR10_CONTROL -#undef ALLOW_TAUU0_CONTROL -#undef ALLOW_TAUV0_CONTROL -#undef ALLOW_SFLUX0_CONTROL -#undef ALLOW_HFLUX0_CONTROL -#undef ALLOW_SSS0_CONTROL -#undef ALLOW_SST0_CONTROL - -C >>> Surface fluxes. -#undef ALLOW_HFLUX_CONTROL -#undef ALLOW_SFLUX_CONTROL -#undef ALLOW_USTRESS_CONTROL -#undef ALLOW_VSTRESS_CONTROL -#undef ALLOW_SWFLUX_CONTROL -#undef ALLOW_LWFLUX_CONTROL - -C >>> Atmospheric state. -#undef ALLOW_ATEMP_CONTROL -#undef ALLOW_AQH_CONTROL -#undef ALLOW_UWIND_CONTROL -#undef ALLOW_VWIND_CONTROL -#undef ALLOW_PRECIP_CONTROL +#undef EXCLUDE_CTRL_PACK +#undef ALLOW_PACKUNPACK_METHOD2 +#undef CTRL_DO_PACK_UNPACK_ONLY +#undef CTRL_PACK_PRECISE +#undef CTRL_UNPACK_PRECISE +#undef CTRL_DELZNORM +#undef ALLOW_CTRL_WETV C >>> Other Control. -#undef ALLOW_DIFFKR_CONTROL +C Allows for GMREDI controls #undef ALLOW_KAPGM_CONTROL #undef ALLOW_KAPREDI_CONTROL +C Allows for Vertical Diffusivity controls +#undef ALLOW_DIFFKR_CONTROL #undef ALLOW_BOTTOMDRAG_CONTROL - -C >>> Backward compatibility option (before checkpoint 65p) -#undef ALLOW_KAPGM_CONTROL_OLD -#undef ALLOW_KAPREDI_CONTROL_OLD +#undef ALLOW_DIC_CONTROL + +C Allows bathymetry as a control vector +C Note: keep this Option separated from generic control since this control +C involves many new dependencies that we would like to avoid in general. +#undef ALLOW_DEPTH_CONTROL +#ifdef ALLOW_DEPTH_CONTROL +C Only relevant within DEPTH_CONTROL code: +# define USE_SMOOTH_MIN +# undef ALLOW_HFACC_CONTROL +# undef ALLOW_HFACC3D_CONTROL +#endif /* ALLOW_DEPTH_CONTROL */ C >>> Generic Control. #define ALLOW_GENARR2D_CONTROL #define ALLOW_GENARR3D_CONTROL #undef ALLOW_GENTIM2D_CONTROL +# undef ALLOW_UVEL0_CONTROL +# undef ALLOW_VVEL0_CONTROL +# undef CTRL_SET_OLD_MAXCVARS_30 +# undef CTRL_SET_OLD_MAXCVARS_40 + +C >>> Open boundaries +#ifdef ALLOW_OBCS +C Control of Open-Boundaries is meaningless without compiling pkg/obcs +C Note: Make sure that corresponding OBCS N/S/W/E Option is defined +# define ALLOW_OBCSN_CONTROL +# define ALLOW_OBCSS_CONTROL +# define ALLOW_OBCSW_CONTROL +# define ALLOW_OBCSE_CONTROL +# undef ALLOW_OBCS_CONTROL_MODES +#endif /* ALLOW_OBCS */ + +C o Set ALLOW_OBCS_CONTROL (Do not edit/modify): +#if (defined (ALLOW_OBCSN_CONTROL) || \ + defined (ALLOW_OBCSS_CONTROL) || \ + defined (ALLOW_OBCSW_CONTROL) || \ + defined (ALLOW_OBCSE_CONTROL)) +# define ALLOW_OBCS_CONTROL +#endif + +C o Impose bounds on controls +#undef ALLOW_ADCTRLBOUND C o Rotation of wind/stress controls adjustments C from Eastward/Northward to model grid directions @@ -86,19 +99,16 @@ C The CTRL_SKIP_FIRST_TWO_ATM_REC_ALL option extends this C to the other the time variable atmospheric controls. #undef CTRL_SKIP_FIRST_TWO_ATM_REC_ALL -C o use pkg/smooth correlation operator (incl. smoother) for 2D controls (Weaver, Courtier 01) -C This CPP option just sets the default for ctrlSmoothCorrel2D to .TRUE. -#undef ALLOW_SMOOTH_CORREL2D -C o use pkg/smooth correlation operator (incl. smoother) for 3D controls (Weaver, Courtier 01) -C This CPP option just sets the default for ctrlSmoothCorrel3D to .TRUE. -#undef ALLOW_SMOOTH_CORREL3D - -C o apply pkg/ctrl/ctrl_smooth.F to 2D controls (outside of ctrlSmoothCorrel2D) -#undef ALLOW_CTRL_SMOOTH -C o apply pkg/smooth/smooth_diff2d.F to 2D controls (outside of ctrlSmoothCorrel2D) +C Note: this flag turns on extra smoothing code in ctrl_get_gen.F which +C is inconsistent with the Weaver and Courtier, 2001 algorithm, and +C should probably not be used. The corresponding 3D flag applied only +C to deprecated code that is now removed. At some point we will remove +C this flag and associated code as well. +C o apply pkg/smooth/smooth_diff2d.F to 2D controls (outside of Smooth_Correl2D) #undef ALLOW_SMOOTH_CTRL2D -C o apply pkg/smooth/smooth_diff3d.F to 3D controls (outside of ctrlSmoothCorrel3D) -#undef ALLOW_SMOOTH_CTRL3D + +C o Print more debug info to STDOUT +#undef ALLOW_CTRL_DEBUG C ================================================================== #endif /* ndef ECCO_CPPOPTIONS_H */ diff --git a/verification/global_oce_latlon/code_oad/SIZE.h_mpi b/verification/global_oce_latlon/code_oad/SIZE.h_mpi new file mode 100644 index 0000000000..9734aa7941 --- /dev/null +++ b/verification/global_oce_latlon/code_oad/SIZE.h_mpi @@ -0,0 +1,64 @@ +CBOP +C !ROUTINE: SIZE.h +C !INTERFACE: +C include SIZE.h +C !DESCRIPTION: \bv +C *==========================================================* +C | SIZE.h Declare size of underlying computational grid. +C *==========================================================* +C | The design here supports a three-dimensional model grid +C | with indices I,J and K. The three-dimensional domain +C | is comprised of nPx*nSx blocks (or tiles) of size sNx +C | along the first (left-most index) axis, nPy*nSy blocks +C | of size sNy along the second axis and one block of size +C | Nr along the vertical (third) axis. +C | Blocks/tiles have overlap regions of size OLx and OLy +C | along the dimensions that are subdivided. +C *==========================================================* +C \ev +C +C Voodoo numbers controlling data layout: +C sNx :: Number of X points in tile. +C sNy :: Number of Y points in tile. +C OLx :: Tile overlap extent in X. +C OLy :: Tile overlap extent in Y. +C nSx :: Number of tiles per process in X. +C nSy :: Number of tiles per process in Y. +C nPx :: Number of processes to use in X. +C nPy :: Number of processes to use in Y. +C Nx :: Number of points in X for the full domain. +C Ny :: Number of points in Y for the full domain. +C Nr :: Number of points in vertical direction. +CEOP + INTEGER sNx + INTEGER sNy + INTEGER OLx + INTEGER OLy + INTEGER nSx + INTEGER nSy + INTEGER nPx + INTEGER nPy + INTEGER Nx + INTEGER Ny + INTEGER Nr + PARAMETER ( + & sNx = 45, + & sNy = 20, + & OLx = 3, + & OLy = 3, + & nSx = 1, + & nSy = 1, + & nPx = 2, + & nPy = 2, + & Nx = sNx*nSx*nPx, + & Ny = sNy*nSy*nPy, + & Nr = 15) + +C MAX_OLX :: Set to the maximum overlap region size of any array +C MAX_OLY that will be exchanged. Controls the sizing of exch +C routine buffers. + INTEGER MAX_OLX + INTEGER MAX_OLY + PARAMETER ( MAX_OLX = OLx, + & MAX_OLY = OLy ) + diff --git a/verification/global_oce_latlon/code_tap/AUTODIFF_OPTIONS.h b/verification/global_oce_latlon/code_tap/AUTODIFF_OPTIONS.h index 7339a3b301..b9b62682c6 100644 --- a/verification/global_oce_latlon/code_tap/AUTODIFF_OPTIONS.h +++ b/verification/global_oce_latlon/code_tap/AUTODIFF_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef AUTODIFF_OPTIONS_H +#define AUTODIFF_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: AUTODIFF_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef AUTODIFF_OPTIONS_H -#define AUTODIFF_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_AUTODIFF #ifdef ECCO_CPPOPTIONS_H @@ -26,10 +26,11 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -C o Include/exclude code in order to be able to automatically -C differentiate the MITgcmUV by using the Tangent Linear and -C Adjoint Model Compiler (TAMC). +C o Include/exclude code in order to automatically differentiate MITgcm code +C using TAF (Transformation of Algorithms in Fortran, http://www.FastOpt.de) +C or using TAMC (Tangent Linear & Adjoint Model Compiler, needs both defined): #undef ALLOW_AUTODIFF_TAMC +#undef AUTODIFF_TAMC_COMPATIBILITY C >>> Checkpointing as handled by TAMC #undef ALLOW_TAMC_CHECKPOINTING @@ -40,19 +41,19 @@ C >>> and DYNVARS_DIAG adjoint state #undef ALLOW_AUTODIFF_MONITOR_DIAG C >>> DO 2-level checkpointing instead of 3-level -c#undef AUTODIFF_2_LEVEL_CHECKPOINT +#undef AUTODIFF_2_LEVEL_CHECKPOINT C extend to 4-level checkpointing -c#undef AUTODIFF_4_LEVEL_CHECKPOINT +#undef AUTODIFF_4_LEVEL_CHECKPOINT C o use divided adjoint to split adjoint computations #undef ALLOW_DIVIDED_ADJOINT -#undef ALLOW_PACKUNPACK_METHOD2 - C o This flag is incredibly useful as it reduces the number of C tape-files on the disc. Maybe it should even be the default. #undef ALLOW_AUTODIFF_WHTAPEIO +C and related to above: +#undef ALLOW_INIT_WHTAPEIO C o use standard MDSFINDUINTS instead of local pkg/autodiff version for C WHTAPEIO code I/O. @@ -67,12 +68,13 @@ C Might still be used for OBCS since WHTAPEIO does not support OBCS fields. #undef AUTODIFF_USE_STORE_RESTORE #undef AUTODIFF_USE_STORE_RESTORE_OBCS -C o write separate tape files for each ptracer (has no effect, to be removed) -#undef AUTODIFF_PTRACERS_SPLIT_FILES - C o allow using viscFacInAd to recompute viscosities in AD #undef AUTODIFF_ALLOW_VISCFACADJ +C o To remove part of MOM_CALC_VISC (better name would be: MOM_DISABLE_*) +#undef AUTODIFF_DISABLE_LEITH +#undef AUTODIFF_DISABLE_REYNOLDS_SCALE + C o for output of AD-variables (ALLOW_AUTODIFF_MONITOR), specific code (e.g., C in addummy_in_stepping.F) relies on adexch_uv_xy_rs and adexch_xy_rs S/R C which might not always be generated by TAF (e.g., when controls do not diff --git a/verification/global_oce_latlon/code_tap/COST_OPTIONS.h b/verification/global_oce_latlon/code_tap/COST_OPTIONS.h index b9ce4eb93e..64a1943d48 100644 --- a/verification/global_oce_latlon/code_tap/COST_OPTIONS.h +++ b/verification/global_oce_latlon/code_tap/COST_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef COST_OPTIONS_H +#define COST_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: COST_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef COST_OPTIONS_H -#define COST_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_COST #ifdef ECCO_CPPOPTIONS_H @@ -26,51 +26,24 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -C >>> Use the EGM-96 geoid error covariance. -#undef ALLOW_EGM96_ERROR_COV -#undef ALLOW_READ_EGM_DATA +#undef ALLOW_COST_STATE_FINAL +#undef ALLOW_COST_VECTOR + C >>> Cost function contributions -#undef ALLOW_HFLUX_COST_CONTRIBUTION -#undef ALLOW_SFLUX_COST_CONTRIBUTION -#undef ALLOW_USTRESS_COST_CONTRIBUTION -#undef ALLOW_VSTRESS_COST_CONTRIBUTION -#undef ALLOW_THETA_COST_CONTRIBUTION -#undef ALLOW_SALT_COST_CONTRIBUTION -#undef ALLOW_SST_COST_CONTRIBUTION -#undef ALLOW_SSS_COST_CONTRIBUTION -#undef ALLOW_SSH_COST_CONTRIBUTION -#undef ALLOW_CTDT_COST_CONTRIBUTION -#undef ALLOW_CTDS_COST_CONTRIBUTION -#undef ALLOW_COST_ATLANTIC #undef ALLOW_COST_ATLANTIC_HEAT #undef ALLOW_COST_ATLANTIC_HEAT_DOMASS #define ALLOW_COST_TEST #define ALLOW_COST_TSQUARED +#undef ALLOW_COST_DEPTH #undef ALLOW_COST_TRACER -C >>> ALLOW_GENCOST_CONTRIBUTION: interactive way to add basic 2D cost -C function terms. -C > In data.ecco, this requires the specification of data file (name, -C frequency, etc.), bar file name for corresp. model average, standard -C error file name, etc. -C > In addition, adding such cost terms requires editing ecco_cost.h to -C increase NGENCOST, and editing cost_gencost_customize.F to implement -C the actual model average (i.e. the bar file content). -#undef ALLOW_GENCOST_CONTRIBUTION -C >>> free form version of GENCOST: allows one to use otherwise defined -C elements (e.g. psbar and and topex data) while taking advantage of the -C cost function/namelist slots that can be made available using -C ALLOW_GENCOST_CONTRIBUTION. To this end ALLOW_GENCOST_CONTRIBUTION -C simply switches off tests that check whether all of the gencost -C elements (e.g. gencost_barfile and gencost_datafile) are specified -C in data.ecco. -C > While this option increases flexibility within the gencost framework, -C it implies more room for error, so it should be used cautiously, and -C with good knowledge of the rest of pkg/ecco. -C > It requires providing a specific cost function routine, and editing -C cost_gencost_all.F accordingly. -#undef ALLOW_GENCOST_FREEFORM +C List these options here: +#undef ALLOW_COST_TEMP +#undef ALLOW_COST_HFLUXM +#undef ALLOW_DIC_COST +#undef ALLOW_THSICE_COST_TEST +#undef ALLOW_COST_SHELFICE C ================================================================== #endif /* ndef ECCO_CPPOPTIONS_H */ diff --git a/verification/global_oce_latlon/code_tap/CTRL_OPTIONS.h b/verification/global_oce_latlon/code_tap/CTRL_OPTIONS.h index 74e0d2bcf1..86bb07f7cb 100644 --- a/verification/global_oce_latlon/code_tap/CTRL_OPTIONS.h +++ b/verification/global_oce_latlon/code_tap/CTRL_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef CTRL_OPTIONS_H +#define CTRL_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: CTRL_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef CTRL_OPTIONS_H -#define CTRL_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_CTRL #ifdef ECCO_CPPOPTIONS_H @@ -26,55 +26,68 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -C o Re-activate deprecated codes in pkg/ecco & pkg/ctrl (but not recommended) -C and since pkg/ctrl can be used without pkg/ecco, better to have it here -#undef ECCO_CTRL_DEPRECATED - -#undef EXCLUDE_CTRL_PACK +C o I/O and pack settings +#undef CTRL_SET_PREC_32 +C This option is only relevant (for pack/unpack) with OBCS_CONTROL: #undef ALLOW_NONDIMENSIONAL_CONTROL_IO - -C >>> Initial values. -#undef ALLOW_THETA0_CONTROL -#undef ALLOW_SALT0_CONTROL -#undef ALLOW_UVEL0_CONTROL -#undef ALLOW_VVEL0_CONTROL -#undef ALLOW_TR10_CONTROL -#undef ALLOW_TAUU0_CONTROL -#undef ALLOW_TAUV0_CONTROL -#undef ALLOW_SFLUX0_CONTROL -#undef ALLOW_HFLUX0_CONTROL -#undef ALLOW_SSS0_CONTROL -#undef ALLOW_SST0_CONTROL - -C >>> Surface fluxes. -#undef ALLOW_HFLUX_CONTROL -#undef ALLOW_SFLUX_CONTROL -#undef ALLOW_USTRESS_CONTROL -#undef ALLOW_VSTRESS_CONTROL -#undef ALLOW_SWFLUX_CONTROL -#undef ALLOW_LWFLUX_CONTROL - -C >>> Atmospheric state. -#undef ALLOW_ATEMP_CONTROL -#undef ALLOW_AQH_CONTROL -#undef ALLOW_UWIND_CONTROL -#undef ALLOW_VWIND_CONTROL -#undef ALLOW_PRECIP_CONTROL +#undef EXCLUDE_CTRL_PACK +#undef ALLOW_PACKUNPACK_METHOD2 +#undef CTRL_DO_PACK_UNPACK_ONLY +#undef CTRL_PACK_PRECISE +#undef CTRL_UNPACK_PRECISE +#undef CTRL_DELZNORM +#undef ALLOW_CTRL_WETV C >>> Other Control. -#define ALLOW_DIFFKR_CONTROL +C Allows for GMREDI controls #define ALLOW_KAPGM_CONTROL #undef ALLOW_KAPREDI_CONTROL +C Allows for Vertical Diffusivity controls +#define ALLOW_DIFFKR_CONTROL #undef ALLOW_BOTTOMDRAG_CONTROL - -C >>> Backward compatibility option (before checkpoint 65p) -#undef ALLOW_KAPGM_CONTROL_OLD -#undef ALLOW_KAPREDI_CONTROL_OLD +#undef ALLOW_DIC_CONTROL + +C Allows bathymetry as a control vector +C Note: keep this Option separated from generic control since this control +C involves many new dependencies that we would like to avoid in general. +#undef ALLOW_DEPTH_CONTROL +#ifdef ALLOW_DEPTH_CONTROL +C Only relevant within DEPTH_CONTROL code: +# define USE_SMOOTH_MIN +# undef ALLOW_HFACC_CONTROL +# undef ALLOW_HFACC3D_CONTROL +#endif /* ALLOW_DEPTH_CONTROL */ C >>> Generic Control. #define ALLOW_GENARR2D_CONTROL #define ALLOW_GENARR3D_CONTROL #undef ALLOW_GENTIM2D_CONTROL +# undef ALLOW_UVEL0_CONTROL +# undef ALLOW_VVEL0_CONTROL +# undef CTRL_SET_OLD_MAXCVARS_30 +# undef CTRL_SET_OLD_MAXCVARS_40 + +C >>> Open boundaries +#ifdef ALLOW_OBCS +C Control of Open-Boundaries is meaningless without compiling pkg/obcs +C Note: Make sure that corresponding OBCS N/S/W/E Option is defined +# define ALLOW_OBCSN_CONTROL +# define ALLOW_OBCSS_CONTROL +# define ALLOW_OBCSW_CONTROL +# define ALLOW_OBCSE_CONTROL +# undef ALLOW_OBCS_CONTROL_MODES +#endif /* ALLOW_OBCS */ + +C o Set ALLOW_OBCS_CONTROL (Do not edit/modify): +#if (defined (ALLOW_OBCSN_CONTROL) || \ + defined (ALLOW_OBCSS_CONTROL) || \ + defined (ALLOW_OBCSW_CONTROL) || \ + defined (ALLOW_OBCSE_CONTROL)) +# define ALLOW_OBCS_CONTROL +#endif + +C o Impose bounds on controls +#undef ALLOW_ADCTRLBOUND C o Rotation of wind/stress controls adjustments C from Eastward/Northward to model grid directions @@ -86,19 +99,16 @@ C The CTRL_SKIP_FIRST_TWO_ATM_REC_ALL option extends this C to the other the time variable atmospheric controls. #undef CTRL_SKIP_FIRST_TWO_ATM_REC_ALL -C o use pkg/smooth correlation operator (incl. smoother) for 2D controls (Weaver, Courtier 01) -C This CPP option just sets the default for ctrlSmoothCorrel2D to .TRUE. -#undef ALLOW_SMOOTH_CORREL2D -C o use pkg/smooth correlation operator (incl. smoother) for 3D controls (Weaver, Courtier 01) -C This CPP option just sets the default for ctrlSmoothCorrel3D to .TRUE. -#undef ALLOW_SMOOTH_CORREL3D - -C o apply pkg/ctrl/ctrl_smooth.F to 2D controls (outside of ctrlSmoothCorrel2D) -#undef ALLOW_CTRL_SMOOTH -C o apply pkg/smooth/smooth_diff2d.F to 2D controls (outside of ctrlSmoothCorrel2D) +C Note: this flag turns on extra smoothing code in ctrl_get_gen.F which +C is inconsistent with the Weaver and Courtier, 2001 algorithm, and +C should probably not be used. The corresponding 3D flag applied only +C to deprecated code that is now removed. At some point we will remove +C this flag and associated code as well. +C o apply pkg/smooth/smooth_diff2d.F to 2D controls (outside of Smooth_Correl2D) #undef ALLOW_SMOOTH_CTRL2D -C o apply pkg/smooth/smooth_diff3d.F to 3D controls (outside of ctrlSmoothCorrel3D) -#undef ALLOW_SMOOTH_CTRL3D + +C o Print more debug info to STDOUT +#undef ALLOW_CTRL_DEBUG C ================================================================== #endif /* ndef ECCO_CPPOPTIONS_H */ diff --git a/verification/global_oce_latlon/code_tap/SIZE.h_mpi b/verification/global_oce_latlon/code_tap/SIZE.h_mpi new file mode 100644 index 0000000000..9734aa7941 --- /dev/null +++ b/verification/global_oce_latlon/code_tap/SIZE.h_mpi @@ -0,0 +1,64 @@ +CBOP +C !ROUTINE: SIZE.h +C !INTERFACE: +C include SIZE.h +C !DESCRIPTION: \bv +C *==========================================================* +C | SIZE.h Declare size of underlying computational grid. +C *==========================================================* +C | The design here supports a three-dimensional model grid +C | with indices I,J and K. The three-dimensional domain +C | is comprised of nPx*nSx blocks (or tiles) of size sNx +C | along the first (left-most index) axis, nPy*nSy blocks +C | of size sNy along the second axis and one block of size +C | Nr along the vertical (third) axis. +C | Blocks/tiles have overlap regions of size OLx and OLy +C | along the dimensions that are subdivided. +C *==========================================================* +C \ev +C +C Voodoo numbers controlling data layout: +C sNx :: Number of X points in tile. +C sNy :: Number of Y points in tile. +C OLx :: Tile overlap extent in X. +C OLy :: Tile overlap extent in Y. +C nSx :: Number of tiles per process in X. +C nSy :: Number of tiles per process in Y. +C nPx :: Number of processes to use in X. +C nPy :: Number of processes to use in Y. +C Nx :: Number of points in X for the full domain. +C Ny :: Number of points in Y for the full domain. +C Nr :: Number of points in vertical direction. +CEOP + INTEGER sNx + INTEGER sNy + INTEGER OLx + INTEGER OLy + INTEGER nSx + INTEGER nSy + INTEGER nPx + INTEGER nPy + INTEGER Nx + INTEGER Ny + INTEGER Nr + PARAMETER ( + & sNx = 45, + & sNy = 20, + & OLx = 3, + & OLy = 3, + & nSx = 1, + & nSy = 1, + & nPx = 2, + & nPy = 2, + & Nx = sNx*nSx*nPx, + & Ny = sNy*nSy*nPy, + & Nr = 15) + +C MAX_OLX :: Set to the maximum overlap region size of any array +C MAX_OLY that will be exchanged. Controls the sizing of exch +C routine buffers. + INTEGER MAX_OLX + INTEGER MAX_OLY + PARAMETER ( MAX_OLX = OLx, + & MAX_OLY = OLy ) + diff --git a/verification/global_oce_latlon/input_ad/data.grdchk b/verification/global_oce_latlon/input_ad/data.grdchk index 4c8ef1c702..e6bfeb4fa1 100644 --- a/verification/global_oce_latlon/input_ad/data.grdchk +++ b/verification/global_oce_latlon/input_ad/data.grdchk @@ -4,16 +4,18 @@ # ******************* &GRDCHK_NML grdchk_eps = 1.d-2, - iGloPos = 71, -#jGloPos = 39, + iGloTile = 2, + jGloTile = 2, + iGloPos = 26, +#jGloPos = 19, # This original setting would start the gradient check for temperatures # that are below the freezing point in the inital conditions. Because of # allowFreezing=True in data&PARM01 and the unphysical nature of this # freezing parameterisation, the FD gradients depend very much on the # whether they are evaluated above and below freezing or not leading -# to inconsistent results. Moving the starting point to jGloPos=37 +# to inconsistent results. Moving the starting point to jGloPos=17 # avoids this. - jGloPos = 37, + jGloPos = 17, kGloPos = 1, ### nbeg = 1, nstep = 1, diff --git a/verification/global_oce_latlon/input_oad/data.grdchk b/verification/global_oce_latlon/input_oad/data.grdchk index e8c7806f56..e6bfeb4fa1 100644 --- a/verification/global_oce_latlon/input_oad/data.grdchk +++ b/verification/global_oce_latlon/input_oad/data.grdchk @@ -14,7 +14,7 @@ # freezing parameterisation, the FD gradients depend very much on the # whether they are evaluated above and below freezing or not leading # to inconsistent results. Moving the starting point to jGloPos=17 -# avoids this. This is similar to input_ad but here we use jGloTile = 2. +# avoids this. jGloPos = 17, kGloPos = 1, ### nbeg = 1, diff --git a/verification/global_oce_latlon/results/output_adm.txt b/verification/global_oce_latlon/results/output_adm.txt index ffeada547a..2d98cfdb89 100644 --- a/verification/global_oce_latlon/results/output_adm.txt +++ b/verification/global_oce_latlon/results/output_adm.txt @@ -5,10 +5,10 @@ (PID.TID 0000.0001) // ====================================================== (PID.TID 0000.0001) // execution environment starting up... (PID.TID 0000.0001) -(PID.TID 0000.0001) // MITgcmUV version: checkpoint68q +(PID.TID 0000.0001) // MITgcmUV version: checkpoint68r (PID.TID 0000.0001) // Build user: jm_c (PID.TID 0000.0001) // Build host: villon -(PID.TID 0000.0001) // Build date: Tue Jul 25 15:34:07 EDT 2023 +(PID.TID 0000.0001) // Build date: Thu Sep 7 11:28:41 EDT 2023 (PID.TID 0000.0001) (PID.TID 0000.0001) // ======================================================= (PID.TID 0000.0001) // Execution Environment parameter file "eedata" @@ -30,10 +30,10 @@ (PID.TID 0000.0001) // ======================================================= (PID.TID 0000.0001) nPx = 1 ; /* No. processes in X */ (PID.TID 0000.0001) nPy = 1 ; /* No. processes in Y */ -(PID.TID 0000.0001) nSx = 1 ; /* No. tiles in X per process */ -(PID.TID 0000.0001) nSy = 1 ; /* No. tiles in Y per process */ -(PID.TID 0000.0001) sNx = 90 ; /* Tile size in X */ -(PID.TID 0000.0001) sNy = 40 ; /* Tile size in Y */ +(PID.TID 0000.0001) nSx = 2 ; /* No. tiles in X per process */ +(PID.TID 0000.0001) nSy = 2 ; /* No. tiles in Y per process */ +(PID.TID 0000.0001) sNx = 45 ; /* Tile size in X */ +(PID.TID 0000.0001) sNy = 20 ; /* Tile size in Y */ (PID.TID 0000.0001) OLx = 3 ; /* Tile overlap distance in X */ (PID.TID 0000.0001) OLy = 3 ; /* Tile overlap distance in Y */ (PID.TID 0000.0001) nTx = 1 ; /* No. threads in X per process */ @@ -41,7 +41,7 @@ (PID.TID 0000.0001) Nr = 15 ; /* No. levels in the vertical */ (PID.TID 0000.0001) Nx = 90 ; /* Total domain size in X ( = nPx*nSx*sNx ) */ (PID.TID 0000.0001) Ny = 40 ; /* Total domain size in Y ( = nPy*nSy*sNy ) */ -(PID.TID 0000.0001) nTiles = 1 ; /* Total no. tiles per process ( = nSx*nSy ) */ +(PID.TID 0000.0001) nTiles = 4 ; /* Total no. tiles per process ( = nSx*nSy ) */ (PID.TID 0000.0001) nProcs = 1 ; /* Total no. processes ( = nPx*nPy ) */ (PID.TID 0000.0001) nThreads = 1 ; /* Total no. threads per process ( = nTx*nTy ) */ (PID.TID 0000.0001) usingMPI = F ; /* Flag used to control whether MPI is in use */ @@ -59,20 +59,47 @@ (PID.TID 0000.0001) // ====================================================== (PID.TID 0000.0001) // Mapping of tiles to threads (PID.TID 0000.0001) // ====================================================== -(PID.TID 0000.0001) // -o- Thread 1, tiles ( 1: 1, 1: 1) +(PID.TID 0000.0001) // -o- Thread 1, tiles ( 1: 2, 1: 2) (PID.TID 0000.0001) (PID.TID 0000.0001) // ====================================================== (PID.TID 0000.0001) // Tile <-> Tile connectvity table (PID.TID 0000.0001) // ====================================================== (PID.TID 0000.0001) // Tile number: 000001 (process no. = 000000) +(PID.TID 0000.0001) // WEST: Tile = 000002, Process = 000000, Comm = put +(PID.TID 0000.0001) // bi = 000002, bj = 000001 +(PID.TID 0000.0001) // EAST: Tile = 000002, Process = 000000, Comm = put +(PID.TID 0000.0001) // bi = 000002, bj = 000001 +(PID.TID 0000.0001) // SOUTH: Tile = 000003, Process = 000000, Comm = put +(PID.TID 0000.0001) // bi = 000001, bj = 000002 +(PID.TID 0000.0001) // NORTH: Tile = 000003, Process = 000000, Comm = put +(PID.TID 0000.0001) // bi = 000001, bj = 000002 +(PID.TID 0000.0001) // Tile number: 000002 (process no. = 000000) (PID.TID 0000.0001) // WEST: Tile = 000001, Process = 000000, Comm = put (PID.TID 0000.0001) // bi = 000001, bj = 000001 (PID.TID 0000.0001) // EAST: Tile = 000001, Process = 000000, Comm = put (PID.TID 0000.0001) // bi = 000001, bj = 000001 +(PID.TID 0000.0001) // SOUTH: Tile = 000004, Process = 000000, Comm = put +(PID.TID 0000.0001) // bi = 000002, bj = 000002 +(PID.TID 0000.0001) // NORTH: Tile = 000004, Process = 000000, Comm = put +(PID.TID 0000.0001) // bi = 000002, bj = 000002 +(PID.TID 0000.0001) // Tile number: 000003 (process no. = 000000) +(PID.TID 0000.0001) // WEST: Tile = 000004, Process = 000000, Comm = put +(PID.TID 0000.0001) // bi = 000002, bj = 000002 +(PID.TID 0000.0001) // EAST: Tile = 000004, Process = 000000, Comm = put +(PID.TID 0000.0001) // bi = 000002, bj = 000002 (PID.TID 0000.0001) // SOUTH: Tile = 000001, Process = 000000, Comm = put (PID.TID 0000.0001) // bi = 000001, bj = 000001 (PID.TID 0000.0001) // NORTH: Tile = 000001, Process = 000000, Comm = put (PID.TID 0000.0001) // bi = 000001, bj = 000001 +(PID.TID 0000.0001) // Tile number: 000004 (process no. = 000000) +(PID.TID 0000.0001) // WEST: Tile = 000003, Process = 000000, Comm = put +(PID.TID 0000.0001) // bi = 000001, bj = 000002 +(PID.TID 0000.0001) // EAST: Tile = 000003, Process = 000000, Comm = put +(PID.TID 0000.0001) // bi = 000001, bj = 000002 +(PID.TID 0000.0001) // SOUTH: Tile = 000002, Process = 000000, Comm = put +(PID.TID 0000.0001) // bi = 000002, bj = 000001 +(PID.TID 0000.0001) // NORTH: Tile = 000002, Process = 000000, Comm = put +(PID.TID 0000.0001) // bi = 000002, bj = 000001 (PID.TID 0000.0001) (PID.TID 0000.0001) INI_PARMS: opening model parameter file "data" (PID.TID 0000.0001) OPEN_COPY_DATA_FILE: opening file data @@ -410,16 +437,18 @@ (PID.TID 0000.0001) ># ******************* (PID.TID 0000.0001) > &GRDCHK_NML (PID.TID 0000.0001) > grdchk_eps = 1.d-2, -(PID.TID 0000.0001) > iGloPos = 71, -(PID.TID 0000.0001) >#jGloPos = 39, +(PID.TID 0000.0001) > iGloTile = 2, +(PID.TID 0000.0001) > jGloTile = 2, +(PID.TID 0000.0001) > iGloPos = 26, +(PID.TID 0000.0001) >#jGloPos = 19, (PID.TID 0000.0001) ># This original setting would start the gradient check for temperatures (PID.TID 0000.0001) ># that are below the freezing point in the inital conditions. Because of (PID.TID 0000.0001) ># allowFreezing=True in data&PARM01 and the unphysical nature of this (PID.TID 0000.0001) ># freezing parameterisation, the FD gradients depend very much on the (PID.TID 0000.0001) ># whether they are evaluated above and below freezing or not leading -(PID.TID 0000.0001) ># to inconsistent results. Moving the starting point to jGloPos=37 +(PID.TID 0000.0001) ># to inconsistent results. Moving the starting point to jGloPos=17 (PID.TID 0000.0001) ># avoids this. -(PID.TID 0000.0001) > jGloPos = 37, +(PID.TID 0000.0001) > jGloPos = 17, (PID.TID 0000.0001) > kGloPos = 1, (PID.TID 0000.0001) >### nbeg = 1, (PID.TID 0000.0001) > nstep = 1, @@ -439,7 +468,7 @@ (PID.TID 0000.0001) Last location: 7 (PID.TID 0000.0001) Increment: 1 (PID.TID 0000.0001) grdchkWhichProc: 0 -(PID.TID 0000.0001) iLocTile = 1 , jLocTile = 1 +(PID.TID 0000.0001) iLocTile = 2 , jLocTile = 2 (PID.TID 0000.0001) (PID.TID 0000.0001) // ======================================================= (PID.TID 0000.0001) // Gradient check configuration >>> END <<< @@ -465,11 +494,11 @@ (PID.TID 0000.0001) %MON DXF_sd = 1.1216447457560E+05 (PID.TID 0000.0001) %MON DXG_max = 4.4470989340816E+05 (PID.TID 0000.0001) %MON DXG_min = 7.7223062580781E+04 -(PID.TID 0000.0001) %MON DXG_mean = 3.1353386340260E+05 +(PID.TID 0000.0001) %MON DXG_mean = 3.1353386340261E+05 (PID.TID 0000.0001) %MON DXG_sd = 1.1256651772502E+05 (PID.TID 0000.0001) %MON DXV_max = 4.4470989340816E+05 (PID.TID 0000.0001) %MON DXV_min = 7.7223062580781E+04 -(PID.TID 0000.0001) %MON DXV_mean = 3.1353386340260E+05 +(PID.TID 0000.0001) %MON DXV_mean = 3.1353386340261E+05 (PID.TID 0000.0001) %MON DXV_sd = 1.1256651772502E+05 (PID.TID 0000.0001) %MON YC_max = 7.8000000000000E+01 (PID.TID 0000.0001) %MON YC_min = -7.8000000000000E+01 @@ -481,36 +510,36 @@ (PID.TID 0000.0001) %MON YG_sd = 4.6173585522461E+01 (PID.TID 0000.0001) %MON DYC_max = 4.4470989340816E+05 (PID.TID 0000.0001) %MON DYC_min = 4.4470989340816E+05 -(PID.TID 0000.0001) %MON DYC_mean = 4.4470989340814E+05 -(PID.TID 0000.0001) %MON DYC_sd = 1.9848812371492E-08 +(PID.TID 0000.0001) %MON DYC_mean = 4.4470989340816E+05 +(PID.TID 0000.0001) %MON DYC_sd = 5.2968971431255E-09 (PID.TID 0000.0001) %MON DYF_max = 4.4470989340816E+05 (PID.TID 0000.0001) %MON DYF_min = 4.4470989340816E+05 -(PID.TID 0000.0001) %MON DYF_mean = 4.4470989340814E+05 -(PID.TID 0000.0001) %MON DYF_sd = 1.9848812371492E-08 +(PID.TID 0000.0001) %MON DYF_mean = 4.4470989340816E+05 +(PID.TID 0000.0001) %MON DYF_sd = 5.2968971431255E-09 (PID.TID 0000.0001) %MON DYG_max = 4.4470989340816E+05 (PID.TID 0000.0001) %MON DYG_min = 4.4470989340816E+05 -(PID.TID 0000.0001) %MON DYG_mean = 4.4470989340814E+05 -(PID.TID 0000.0001) %MON DYG_sd = 1.9848812371492E-08 +(PID.TID 0000.0001) %MON DYG_mean = 4.4470989340816E+05 +(PID.TID 0000.0001) %MON DYG_sd = 5.2968971431255E-09 (PID.TID 0000.0001) %MON DYU_max = 4.4470989340816E+05 (PID.TID 0000.0001) %MON DYU_min = 4.4470989340816E+05 -(PID.TID 0000.0001) %MON DYU_mean = 4.4470989340814E+05 -(PID.TID 0000.0001) %MON DYU_sd = 1.9848812371492E-08 +(PID.TID 0000.0001) %MON DYU_mean = 4.4470989340816E+05 +(PID.TID 0000.0001) %MON DYU_sd = 5.2968971431255E-09 (PID.TID 0000.0001) %MON RA_max = 1.9760627980089E+11 (PID.TID 0000.0001) %MON RA_min = 4.1109698667290E+10 -(PID.TID 0000.0001) %MON RA_mean = 1.3948826965197E+11 +(PID.TID 0000.0001) %MON RA_mean = 1.3948826965196E+11 (PID.TID 0000.0001) %MON RA_sd = 4.9870522472902E+10 (PID.TID 0000.0001) %MON RAW_max = 1.9760627980089E+11 (PID.TID 0000.0001) %MON RAW_min = 4.1109698667290E+10 -(PID.TID 0000.0001) %MON RAW_mean = 1.3948826965197E+11 +(PID.TID 0000.0001) %MON RAW_mean = 1.3948826965196E+11 (PID.TID 0000.0001) %MON RAW_sd = 4.9870522472902E+10 (PID.TID 0000.0001) %MON RAS_max = 1.9772672958215E+11 (PID.TID 0000.0001) %MON RAS_min = 3.4334886267983E+10 (PID.TID 0000.0001) %MON RAS_mean = 1.3940329716694E+11 -(PID.TID 0000.0001) %MON RAS_sd = 5.0049278732354E+10 +(PID.TID 0000.0001) %MON RAS_sd = 5.0049278732353E+10 (PID.TID 0000.0001) %MON RAZ_max = 1.9772672958215E+11 (PID.TID 0000.0001) %MON RAZ_min = 3.4334886267983E+10 (PID.TID 0000.0001) %MON RAZ_mean = 1.3940329716694E+11 -(PID.TID 0000.0001) %MON RAZ_sd = 5.0049278732354E+10 +(PID.TID 0000.0001) %MON RAZ_sd = 5.0049278732353E+10 (PID.TID 0000.0001) %MON AngleCS_max = 1.0000000000000E+00 (PID.TID 0000.0001) %MON AngleCS_min = 1.0000000000000E+00 (PID.TID 0000.0001) %MON AngleCS_mean = 1.0000000000000E+00 @@ -562,11 +591,11 @@ (PID.TID 0000.0001) ; (PID.TID 0000.0001) // =================================== (PID.TID 0000.0001) ctrl-wet 1: nvarlength = 117236 -(PID.TID 0000.0001) ctrl-wet 2: surface wet C = 2315 -(PID.TID 0000.0001) ctrl-wet 3: surface wet W = 2206 -(PID.TID 0000.0001) ctrl-wet 4: surface wet S = 2149 +(PID.TID 0000.0001) ctrl-wet 2: surface wet C = 669 +(PID.TID 0000.0001) ctrl-wet 3: surface wet W = 640 +(PID.TID 0000.0001) ctrl-wet 4: surface wet S = 610 (PID.TID 0000.0001) ctrl-wet 4a:surface wet V = 0 -(PID.TID 0000.0001) ctrl-wet 5: 3D wet points = 29309 +(PID.TID 0000.0001) ctrl-wet 5: 3D wet points = 8651 (PID.TID 0000.0001) ctrl-wet 6: no recs for i = 1 0 (PID.TID 0000.0001) ctrl-wet 6: no recs for i = 2 0 (PID.TID 0000.0001) ctrl-wet 6: no recs for i = 3 0 @@ -967,8 +996,8 @@ (PID.TID 0000.0001) ctrl-wet 6: no recs for i = 398 0 (PID.TID 0000.0001) ctrl-wet 6: no recs for i = 399 0 (PID.TID 0000.0001) ctrl-wet 6: no recs for i = 400 0 -(PID.TID 0000.0001) ctrl-wet 7: flux 58618 -(PID.TID 0000.0001) ctrl-wet 8: atmos 58618 +(PID.TID 0000.0001) ctrl-wet 7: flux 17302 +(PID.TID 0000.0001) ctrl-wet 8: atmos 17302 (PID.TID 0000.0001) ctrl-wet ------------------------------------------------- (PID.TID 0000.0001) ctrl-wet 13: global nvarlength for Nr = 15 117236 (PID.TID 0000.0001) ctrl-wet ------------------------------------------------- @@ -999,11 +1028,14 @@ (PID.TID 0000.0001) (PID.TID 0000.0001) Total number of ocean points per tile: (PID.TID 0000.0001) -------------------------------------- -(PID.TID 0000.0001) snx*sny*nr = 54000 +(PID.TID 0000.0001) snx*sny*nr = 13500 (PID.TID 0000.0001) (PID.TID 0000.0001) Number of ocean points per tile: (PID.TID 0000.0001) -------------------------------- -(PID.TID 0000.0001) bi,bj,#(c/s/w): 0001 0001 029309 026636 027324 +(PID.TID 0000.0001) bi,bj,#(c/s/w): 0001 0001 008651 007584 008016 +(PID.TID 0000.0001) bi,bj,#(c/s/w): 0002 0001 010278 009360 009834 +(PID.TID 0000.0001) bi,bj,#(c/s/w): 0001 0002 003504 003232 003049 +(PID.TID 0000.0001) bi,bj,#(c/s/w): 0002 0002 006876 006460 006425 (PID.TID 0000.0001) (PID.TID 0000.0001) Settings of generic controls: (PID.TID 0000.0001) ----------------------------- @@ -1035,11 +1067,11 @@ (PID.TID 0000.0001) (PID.TID 0000.0001) %MON fCori_max = 1.4226580169407E-04 (PID.TID 0000.0001) %MON fCori_min = -1.4226580169407E-04 -(PID.TID 0000.0001) %MON fCori_mean = 7.5291817533716E-23 -(PID.TID 0000.0001) %MON fCori_sd = 9.6335367303778E-05 +(PID.TID 0000.0001) %MON fCori_mean = -1.9274705288631E-19 +(PID.TID 0000.0001) %MON fCori_sd = 9.6335367303779E-05 (PID.TID 0000.0001) %MON fCoriG_max = 1.4112379284621E-04 (PID.TID 0000.0001) %MON fCoriG_min = -1.4323448157692E-04 -(PID.TID 0000.0001) %MON fCoriG_mean = -3.5808620394229E-06 +(PID.TID 0000.0001) %MON fCoriG_mean = -3.5808620394228E-06 (PID.TID 0000.0001) %MON fCoriG_sd = 9.6285194120965E-05 (PID.TID 0000.0001) %MON fCoriCos_max = 1.4535550371427E-04 (PID.TID 0000.0001) %MON fCoriCos_min = 3.0239529651320E-05 @@ -2196,7 +2228,7 @@ (PID.TID 0000.0001) 4.783442523123625E+10 /* J = 40 */ (PID.TID 0000.0001) ; (PID.TID 0000.0001) globalArea = /* Integrated horizontal Area (m^2) */ -(PID.TID 0000.0001) 3.450614146649838E+14 +(PID.TID 0000.0001) 3.450614146649749E+14 (PID.TID 0000.0001) ; (PID.TID 0000.0001) // ======================================================= (PID.TID 0000.0001) // End of Model config. summary @@ -2321,13 +2353,13 @@ (PID.TID 0000.0001) %MON dynstat_wvel_del2 = 0.0000000000000E+00 (PID.TID 0000.0001) %MON dynstat_theta_max = 2.9733388900757E+01 (PID.TID 0000.0001) %MON dynstat_theta_min = -1.9000000000000E+00 -(PID.TID 0000.0001) %MON dynstat_theta_mean = 3.6197074666129E+00 -(PID.TID 0000.0001) %MON dynstat_theta_sd = 4.4174614518568E+00 +(PID.TID 0000.0001) %MON dynstat_theta_mean = 3.6197074666132E+00 +(PID.TID 0000.0001) %MON dynstat_theta_sd = 4.4174614518570E+00 (PID.TID 0000.0001) %MON dynstat_theta_del2 = 5.6229722638211E-03 (PID.TID 0000.0001) %MON dynstat_salt_max = 3.7475627899170E+01 (PID.TID 0000.0001) %MON dynstat_salt_min = 2.9752769470215E+01 -(PID.TID 0000.0001) %MON dynstat_salt_mean = 3.4718006161475E+01 -(PID.TID 0000.0001) %MON dynstat_salt_sd = 2.9628819587990E-01 +(PID.TID 0000.0001) %MON dynstat_salt_mean = 3.4718006161478E+01 +(PID.TID 0000.0001) %MON dynstat_salt_sd = 2.9628819587991E-01 (PID.TID 0000.0001) %MON dynstat_salt_del2 = 1.0127003139695E-03 (PID.TID 0000.0001) %MON trAdv_CFL_u_max = 0.0000000000000E+00 (PID.TID 0000.0001) %MON trAdv_CFL_v_max = 0.0000000000000E+00 @@ -2339,12 +2371,12 @@ (PID.TID 0000.0001) %MON pe_b_mean = 0.0000000000000E+00 (PID.TID 0000.0001) %MON ke_max = 0.0000000000000E+00 (PID.TID 0000.0001) %MON ke_mean = 0.0000000000000E+00 -(PID.TID 0000.0001) %MON ke_vol = 1.3226782436723E+18 +(PID.TID 0000.0001) %MON ke_vol = 1.3226782436722E+18 (PID.TID 0000.0001) %MON vort_r_min = 0.0000000000000E+00 (PID.TID 0000.0001) %MON vort_r_max = 0.0000000000000E+00 -(PID.TID 0000.0001) %MON vort_a_mean = -2.5205769728595E-05 +(PID.TID 0000.0001) %MON vort_a_mean = -2.5205769728597E-05 (PID.TID 0000.0001) %MON vort_a_sd = 7.3403301351718E-05 -(PID.TID 0000.0001) %MON vort_p_mean = -3.1758669979758E-05 +(PID.TID 0000.0001) %MON vort_p_mean = -3.1758669979760E-05 (PID.TID 0000.0001) %MON vort_p_sd = 1.3126616755304E-04 (PID.TID 0000.0001) %MON surfExpan_theta_mean = 0.0000000000000E+00 (PID.TID 0000.0001) %MON surfExpan_salt_mean = 0.0000000000000E+00 @@ -2354,11 +2386,11 @@ (PID.TID 0000.0001) whio : write lev 3 rec 1 EXTERNAL_FIELDS_LOAD, it= 0 : Reading new data, i0,i1= 12 1 (prev= 12 0 ) (PID.TID 0000.0001) SOLVE_FOR_PRESSURE: putPmEinXvector = F - cg2d: Sum(rhs),rhsMax = 1.05956909912663E-14 2.53674886388737E+00 - cg2d: Sum(rhs),rhsMax = -1.15185638804860E-15 5.04325900480939E+00 + cg2d: Sum(rhs),rhsMax = 1.15463194561016E-14 2.53674886388737E+00 + cg2d: Sum(rhs),rhsMax = 8.88178419700125E-16 5.04325900480939E+00 (PID.TID 0000.0001) cg2d_init_res = 3.36819573987926E+00 (PID.TID 0000.0001) cg2d_iters(min,last) = -1 36 -(PID.TID 0000.0001) cg2d_last_res = 4.72603213756132E-20 +(PID.TID 0000.0001) cg2d_last_res = 4.72603213685402E-20 (PID.TID 0000.0001) // ======================================================= (PID.TID 0000.0001) // Begin MONITOR dynamic field statistics (PID.TID 0000.0001) // ======================================================= @@ -2366,33 +2398,33 @@ (PID.TID 0000.0001) %MON time_secondsf = 8.6400000000000E+04 (PID.TID 0000.0001) %MON dynstat_eta_max = 3.7801774105274E-01 (PID.TID 0000.0001) %MON dynstat_eta_min = -2.5442413411575E-01 -(PID.TID 0000.0001) %MON dynstat_eta_mean = -5.7690067231264E-18 +(PID.TID 0000.0001) %MON dynstat_eta_mean = -7.9243140026388E-19 (PID.TID 0000.0001) %MON dynstat_eta_sd = 6.0204479085973E-02 (PID.TID 0000.0001) %MON dynstat_eta_del2 = 2.2874265953536E-03 (PID.TID 0000.0001) %MON dynstat_uvel_max = 1.8891126566953E-02 (PID.TID 0000.0001) %MON dynstat_uvel_min = -1.7242415708016E-02 -(PID.TID 0000.0001) %MON dynstat_uvel_mean = -8.8944578754593E-04 -(PID.TID 0000.0001) %MON dynstat_uvel_sd = 2.1243052636259E-03 +(PID.TID 0000.0001) %MON dynstat_uvel_mean = -8.8944578754598E-04 +(PID.TID 0000.0001) %MON dynstat_uvel_sd = 2.1243052636260E-03 (PID.TID 0000.0001) %MON dynstat_uvel_del2 = 2.3141625125843E-05 (PID.TID 0000.0001) %MON dynstat_vvel_max = 3.3406292931411E-02 (PID.TID 0000.0001) %MON dynstat_vvel_min = -1.7994571139087E-02 (PID.TID 0000.0001) %MON dynstat_vvel_mean = 1.7505325745996E-03 -(PID.TID 0000.0001) %MON dynstat_vvel_sd = 6.1903921924015E-03 +(PID.TID 0000.0001) %MON dynstat_vvel_sd = 6.1903921924016E-03 (PID.TID 0000.0001) %MON dynstat_vvel_del2 = 2.8851036604616E-05 (PID.TID 0000.0001) %MON dynstat_wvel_max = 2.0881245119247E-04 (PID.TID 0000.0001) %MON dynstat_wvel_min = -1.4685952519113E-04 -(PID.TID 0000.0001) %MON dynstat_wvel_mean = -1.1671338524540E-21 -(PID.TID 0000.0001) %MON dynstat_wvel_sd = 2.4143621261042E-05 +(PID.TID 0000.0001) %MON dynstat_wvel_mean = -2.4661779484094E-22 +(PID.TID 0000.0001) %MON dynstat_wvel_sd = 2.4143621261041E-05 (PID.TID 0000.0001) %MON dynstat_wvel_del2 = 2.9138609751269E-07 (PID.TID 0000.0001) %MON dynstat_theta_max = 2.9678646889493E+01 (PID.TID 0000.0001) %MON dynstat_theta_min = -1.9016727707239E+00 -(PID.TID 0000.0001) %MON dynstat_theta_mean = 3.6189381779999E+00 -(PID.TID 0000.0001) %MON dynstat_theta_sd = 4.4154222862262E+00 +(PID.TID 0000.0001) %MON dynstat_theta_mean = 3.6189381780001E+00 +(PID.TID 0000.0001) %MON dynstat_theta_sd = 4.4154222862264E+00 (PID.TID 0000.0001) %MON dynstat_theta_del2 = 5.5157879665219E-03 (PID.TID 0000.0001) %MON dynstat_salt_max = 3.7465356199095E+01 (PID.TID 0000.0001) %MON dynstat_salt_min = 2.9756623562822E+01 -(PID.TID 0000.0001) %MON dynstat_salt_mean = 3.4717943185031E+01 -(PID.TID 0000.0001) %MON dynstat_salt_sd = 2.9610617170209E-01 +(PID.TID 0000.0001) %MON dynstat_salt_mean = 3.4717943185034E+01 +(PID.TID 0000.0001) %MON dynstat_salt_sd = 2.9610617170210E-01 (PID.TID 0000.0001) %MON dynstat_salt_del2 = 1.0206468323167E-03 (PID.TID 0000.0001) %MON trAdv_CFL_u_max = 2.7444977268794E-03 (PID.TID 0000.0001) %MON trAdv_CFL_v_max = 1.8885517877413E-03 @@ -2401,26 +2433,26 @@ (PID.TID 0000.0001) %MON advcfl_vvel_max = 3.2451534720241E-03 (PID.TID 0000.0001) %MON advcfl_wvel_max = 2.8752584079558E-01 (PID.TID 0000.0001) %MON advcfl_W_hf_max = 1.4915123266219E-01 -(PID.TID 0000.0001) %MON pe_b_mean = 4.6380860977297E-06 +(PID.TID 0000.0001) %MON pe_b_mean = 4.6380860977301E-06 (PID.TID 0000.0001) %MON ke_max = 3.9750126324262E-04 -(PID.TID 0000.0001) %MON ke_mean = 2.0989275005882E-05 -(PID.TID 0000.0001) %MON ke_vol = 1.3226782436723E+18 +(PID.TID 0000.0001) %MON ke_mean = 2.0989275005884E-05 +(PID.TID 0000.0001) %MON ke_vol = 1.3226782436722E+18 (PID.TID 0000.0001) %MON vort_r_min = -1.0400172285883E-07 (PID.TID 0000.0001) %MON vort_r_max = 1.2612267171956E-07 -(PID.TID 0000.0001) %MON vort_a_mean = -2.5205769283946E-05 -(PID.TID 0000.0001) %MON vort_a_sd = 7.3403114614120E-05 -(PID.TID 0000.0001) %MON vort_p_mean = -3.1758669419511E-05 +(PID.TID 0000.0001) %MON vort_a_mean = -2.5205769283947E-05 +(PID.TID 0000.0001) %MON vort_a_sd = 7.3403114614122E-05 +(PID.TID 0000.0001) %MON vort_p_mean = -3.1758669419512E-05 (PID.TID 0000.0001) %MON vort_p_sd = 1.3126589427123E-04 -(PID.TID 0000.0001) %MON surfExpan_theta_mean = 8.3024294304498E-05 -(PID.TID 0000.0001) %MON surfExpan_salt_mean = 6.6180314817953E-06 +(PID.TID 0000.0001) %MON surfExpan_theta_mean = 8.3024294304500E-05 +(PID.TID 0000.0001) %MON surfExpan_salt_mean = 6.6180314817954E-06 (PID.TID 0000.0001) // ======================================================= (PID.TID 0000.0001) // End MONITOR dynamic field statistics (PID.TID 0000.0001) // ======================================================= - cg2d: Sum(rhs),rhsMax = -5.10043396406701E-14 6.29008403763954E+00 - cg2d: Sum(rhs),rhsMax = 4.86659323950533E-14 6.70003306073569E+00 + cg2d: Sum(rhs),rhsMax = -1.84297022087776E-14 6.29008403763954E+00 + cg2d: Sum(rhs),rhsMax = 1.33226762955019E-14 6.70003306073569E+00 (PID.TID 0000.0001) cg2d_init_res = 1.87275603038141E+00 (PID.TID 0000.0001) cg2d_iters(min,last) = -1 36 -(PID.TID 0000.0001) cg2d_last_res = 5.46089734381062E-20 +(PID.TID 0000.0001) cg2d_last_res = 5.46089734252481E-20 (PID.TID 0000.0001) // ======================================================= (PID.TID 0000.0001) // Begin MONITOR dynamic field statistics (PID.TID 0000.0001) // ======================================================= @@ -2428,33 +2460,33 @@ (PID.TID 0000.0001) %MON time_secondsf = 1.7280000000000E+05 (PID.TID 0000.0001) %MON dynstat_eta_max = 5.8496771725807E-01 (PID.TID 0000.0001) %MON dynstat_eta_min = -4.8994750021282E-01 -(PID.TID 0000.0001) %MON dynstat_eta_mean = 1.8252233404906E-17 +(PID.TID 0000.0001) %MON dynstat_eta_mean = 1.8112717720317E-18 (PID.TID 0000.0001) %MON dynstat_eta_sd = 1.2168470902780E-01 (PID.TID 0000.0001) %MON dynstat_eta_del2 = 2.9494651408836E-03 (PID.TID 0000.0001) %MON dynstat_uvel_max = 4.2629915149354E-02 (PID.TID 0000.0001) %MON dynstat_uvel_min = -4.2512701955552E-02 -(PID.TID 0000.0001) %MON dynstat_uvel_mean = -2.3370404210283E-03 -(PID.TID 0000.0001) %MON dynstat_uvel_sd = 4.0261162313369E-03 -(PID.TID 0000.0001) %MON dynstat_uvel_del2 = 4.7406854803217E-05 +(PID.TID 0000.0001) %MON dynstat_uvel_mean = -2.3370404210284E-03 +(PID.TID 0000.0001) %MON dynstat_uvel_sd = 4.0261162313370E-03 +(PID.TID 0000.0001) %MON dynstat_uvel_del2 = 4.7406854803216E-05 (PID.TID 0000.0001) %MON dynstat_vvel_max = 5.1624397417113E-02 (PID.TID 0000.0001) %MON dynstat_vvel_min = -3.5456974498627E-02 -(PID.TID 0000.0001) %MON dynstat_vvel_mean = 3.1962471453806E-03 +(PID.TID 0000.0001) %MON dynstat_vvel_mean = 3.1962471453808E-03 (PID.TID 0000.0001) %MON dynstat_vvel_sd = 1.0312808344268E-02 -(PID.TID 0000.0001) %MON dynstat_vvel_del2 = 5.9793773811553E-05 +(PID.TID 0000.0001) %MON dynstat_vvel_del2 = 5.9793773811552E-05 (PID.TID 0000.0001) %MON dynstat_wvel_max = 1.9706938614065E-04 (PID.TID 0000.0001) %MON dynstat_wvel_min = -1.9619512296597E-04 -(PID.TID 0000.0001) %MON dynstat_wvel_mean = 1.9540538027333E-21 -(PID.TID 0000.0001) %MON dynstat_wvel_sd = 2.8047412065753E-05 +(PID.TID 0000.0001) %MON dynstat_wvel_mean = -9.3949636129883E-23 +(PID.TID 0000.0001) %MON dynstat_wvel_sd = 2.8047412065752E-05 (PID.TID 0000.0001) %MON dynstat_wvel_del2 = 2.5108140951239E-07 (PID.TID 0000.0001) %MON dynstat_theta_max = 2.9645873194189E+01 (PID.TID 0000.0001) %MON dynstat_theta_min = -1.9206080316285E+00 -(PID.TID 0000.0001) %MON dynstat_theta_mean = 3.6163785043410E+00 -(PID.TID 0000.0001) %MON dynstat_theta_sd = 4.4100884547553E+00 +(PID.TID 0000.0001) %MON dynstat_theta_mean = 3.6163785043413E+00 +(PID.TID 0000.0001) %MON dynstat_theta_sd = 4.4100884547555E+00 (PID.TID 0000.0001) %MON dynstat_theta_del2 = 5.3743705803124E-03 (PID.TID 0000.0001) %MON dynstat_salt_max = 3.7457616070424E+01 (PID.TID 0000.0001) %MON dynstat_salt_min = 2.9762702431823E+01 -(PID.TID 0000.0001) %MON dynstat_salt_mean = 3.4717726655502E+01 -(PID.TID 0000.0001) %MON dynstat_salt_sd = 2.9612541609774E-01 +(PID.TID 0000.0001) %MON dynstat_salt_mean = 3.4717726655505E+01 +(PID.TID 0000.0001) %MON dynstat_salt_sd = 2.9612541609775E-01 (PID.TID 0000.0001) %MON dynstat_salt_del2 = 1.0162880189411E-03 (PID.TID 0000.0001) %MON trAdv_CFL_u_max = 7.4439105816517E-03 (PID.TID 0000.0001) %MON trAdv_CFL_v_max = 4.5506406165286E-03 @@ -2463,36 +2495,39 @@ (PID.TID 0000.0001) %MON advcfl_vvel_max = 5.0148962311761E-03 (PID.TID 0000.0001) %MON advcfl_wvel_max = 2.3599463665017E-01 (PID.TID 0000.0001) %MON advcfl_W_hf_max = 1.1819181155376E-01 -(PID.TID 0000.0001) %MON pe_b_mean = 1.8947556732029E-05 +(PID.TID 0000.0001) %MON pe_b_mean = 1.8947556732030E-05 (PID.TID 0000.0001) %MON ke_max = 1.1655787739935E-03 -(PID.TID 0000.0001) %MON ke_mean = 6.2179020182627E-05 -(PID.TID 0000.0001) %MON ke_vol = 1.3226782436723E+18 +(PID.TID 0000.0001) %MON ke_mean = 6.2179020182632E-05 +(PID.TID 0000.0001) %MON ke_vol = 1.3226782436722E+18 (PID.TID 0000.0001) %MON vort_r_min = -2.0216007593326E-07 (PID.TID 0000.0001) %MON vort_r_max = 2.2693374161035E-07 -(PID.TID 0000.0001) %MON vort_a_mean = -2.5205769302465E-05 -(PID.TID 0000.0001) %MON vort_a_sd = 7.3402831168457E-05 -(PID.TID 0000.0001) %MON vort_p_mean = -3.1758669442844E-05 -(PID.TID 0000.0001) %MON vort_p_sd = 1.3126526380848E-04 +(PID.TID 0000.0001) %MON vort_a_mean = -2.5205769302466E-05 +(PID.TID 0000.0001) %MON vort_a_sd = 7.3402831168459E-05 +(PID.TID 0000.0001) %MON vort_p_mean = -3.1758669442845E-05 +(PID.TID 0000.0001) %MON vort_p_sd = 1.3126526380849E-04 (PID.TID 0000.0001) %MON surfExpan_theta_mean = 1.3217658437323E-04 -(PID.TID 0000.0001) %MON surfExpan_salt_mean = 1.1031313674778E-05 +(PID.TID 0000.0001) %MON surfExpan_salt_mean = 1.1031313674779E-05 (PID.TID 0000.0001) // ======================================================= (PID.TID 0000.0001) // End MONITOR dynamic field statistics (PID.TID 0000.0001) // ======================================================= (PID.TID 0000.0001) %CHECKPOINT 4 ckptA (PID.TID 0000.0001) early fc = 0.000000000000000D+00 - --> objf_test(bi,bj) = 0.804687744759401D+06 -(PID.TID 0000.0001) local fc = 0.804687744759401D+06 -(PID.TID 0000.0001) global fc = 0.804687744759401D+06 + --> objf_test(bi,bj) = 0.221431048007422D+06 + --> objf_test(bi,bj) = 0.241096917459820D+06 + --> objf_test(bi,bj) = 0.137155804089993D+06 + --> objf_test(bi,bj) = 0.205003975202165D+06 +(PID.TID 0000.0001) local fc = 0.804687744759400D+06 +(PID.TID 0000.0001) global fc = 0.804687744759400D+06 (PID.TID 0000.0001) whio : write lev 2 rec 1 EXTERNAL_FIELDS_LOAD, it= 0 : Reading new data, i0,i1= 12 1 (prev= 12 1 ) (PID.TID 0000.0001) SOLVE_FOR_PRESSURE: putPmEinXvector = F - cg2d: Sum(rhs),rhsMax = 1.05956909912663E-14 2.53674886388737E+00 - cg2d: Sum(rhs),rhsMax = -1.15185638804860E-15 5.04325900480939E+00 - cg2d: Sum(rhs),rhsMax = -5.10043396406701E-14 6.29008403763954E+00 + cg2d: Sum(rhs),rhsMax = 1.15463194561016E-14 2.53674886388737E+00 + cg2d: Sum(rhs),rhsMax = 8.88178419700125E-16 5.04325900480939E+00 + cg2d: Sum(rhs),rhsMax = -1.84297022087776E-14 6.29008403763954E+00 (PID.TID 0000.0001) whio : write lev 2 rec 2 - cg2d: Sum(rhs),rhsMax = 4.86659323950533E-14 6.70003306073569E+00 + cg2d: Sum(rhs),rhsMax = 1.33226762955019E-14 6.70003306073569E+00 (PID.TID 0000.0001) Did not write pickup because writePickupAtEnd = FALSE - cg2d: Sum(rhs),rhsMax = 4.86659323950533E-14 6.70003306073569E+00 + cg2d: Sum(rhs),rhsMax = 1.33226762955019E-14 6.70003306073569E+00 (PID.TID 0000.0001) Did not write pickup because writePickupAtEnd = FALSE (PID.TID 0000.0001) Did not write pickup because writePickupAtEnd = FALSE (PID.TID 0000.0001) // ======================================================= @@ -2522,9 +2557,9 @@ (PID.TID 0000.0001) %MON ad_dynstat_adwvel_del2 = 0.0000000000000E+00 (PID.TID 0000.0001) %MON ad_dynstat_adtheta_max = 5.9291746388377E+01 (PID.TID 0000.0001) %MON ad_dynstat_adtheta_min = -3.8024197906327E+00 -(PID.TID 0000.0001) %MON ad_dynstat_adtheta_mean = 4.8245755940932E-01 +(PID.TID 0000.0001) %MON ad_dynstat_adtheta_mean = 4.8245755940936E-01 (PID.TID 0000.0001) %MON ad_dynstat_adtheta_sd = 4.6884307335535E+00 -(PID.TID 0000.0001) %MON ad_dynstat_adtheta_del2 = 8.8096338546303E-03 +(PID.TID 0000.0001) %MON ad_dynstat_adtheta_del2 = 2.4399137593221E-02 (PID.TID 0000.0001) %MON ad_dynstat_adsalt_max = 0.0000000000000E+00 (PID.TID 0000.0001) %MON ad_dynstat_adsalt_min = 0.0000000000000E+00 (PID.TID 0000.0001) %MON ad_dynstat_adsalt_mean = 0.0000000000000E+00 @@ -2537,11 +2572,11 @@ cg2d: Sum(rhs),rhsMax = 0.00000000000000E+00 0.00000000000000E+00 EXTERNAL_FIELDS_LOAD, it= 0 : Reading new data, i0,i1= 12 1 (prev= 12 1 ) (PID.TID 0000.0001) SOLVE_FOR_PRESSURE: putPmEinXvector = F - cg2d: Sum(rhs),rhsMax = 1.05956909912663E-14 2.53674886388737E+00 - cg2d: Sum(rhs),rhsMax = -1.15185638804860E-15 5.04325900480939E+00 - cg2d: Sum(rhs),rhsMax = -5.10043396406701E-14 6.29008403763954E+00 + cg2d: Sum(rhs),rhsMax = 1.15463194561016E-14 2.53674886388737E+00 + cg2d: Sum(rhs),rhsMax = 8.88178419700125E-16 5.04325900480939E+00 + cg2d: Sum(rhs),rhsMax = -1.84297022087776E-14 6.29008403763954E+00 Calling cg2d from S/R CG2D_MAD - cg2d: Sum(rhs),rhsMax = -1.03261583311864E-14 7.86983807726830E-04 + cg2d: Sum(rhs),rhsMax = 4.44089209850063E-16 7.86983807726830E-04 (PID.TID 0000.0001) // ======================================================= (PID.TID 0000.0001) // Begin AD_MONITOR dynamic field statistics (PID.TID 0000.0001) // ======================================================= @@ -2551,74 +2586,74 @@ (PID.TID 0000.0001) %MON ad_dynstat_adeta_min = -2.2878732433042E+01 (PID.TID 0000.0001) %MON ad_dynstat_adeta_mean = 6.8010820341981E-02 (PID.TID 0000.0001) %MON ad_dynstat_adeta_sd = 6.8233686763742E+00 -(PID.TID 0000.0001) %MON ad_dynstat_adeta_del2 = 2.8301420991010E-01 +(PID.TID 0000.0001) %MON ad_dynstat_adeta_del2 = 2.8700058762625E-01 (PID.TID 0000.0001) %MON ad_dynstat_aduvel_max = 7.7653322362537E+01 (PID.TID 0000.0001) %MON ad_dynstat_aduvel_min = -7.8753198967107E+01 -(PID.TID 0000.0001) %MON ad_dynstat_aduvel_mean = -1.5847448652989E+00 +(PID.TID 0000.0001) %MON ad_dynstat_aduvel_mean = -1.5847448652990E+00 (PID.TID 0000.0001) %MON ad_dynstat_aduvel_sd = 1.0587610151857E+01 -(PID.TID 0000.0001) %MON ad_dynstat_aduvel_del2 = 6.4653246604227E-02 +(PID.TID 0000.0001) %MON ad_dynstat_aduvel_del2 = 6.7777488697129E-02 (PID.TID 0000.0001) %MON ad_dynstat_advvel_max = 1.5840779075806E+02 (PID.TID 0000.0001) %MON ad_dynstat_advvel_min = -1.7191114512059E+02 (PID.TID 0000.0001) %MON ad_dynstat_advvel_mean = -1.6241998514220E+00 -(PID.TID 0000.0001) %MON ad_dynstat_advvel_sd = 2.6216739596418E+01 -(PID.TID 0000.0001) %MON ad_dynstat_advvel_del2 = 1.4915909728064E-01 +(PID.TID 0000.0001) %MON ad_dynstat_advvel_sd = 2.6216739596419E+01 +(PID.TID 0000.0001) %MON ad_dynstat_advvel_del2 = 1.5563478377784E-01 (PID.TID 0000.0001) %MON ad_dynstat_adwvel_max = 1.7983938989145E+04 (PID.TID 0000.0001) %MON ad_dynstat_adwvel_min = -2.2262847461829E+05 -(PID.TID 0000.0001) %MON ad_dynstat_adwvel_mean = -7.3033998585888E+02 -(PID.TID 0000.0001) %MON ad_dynstat_adwvel_sd = 8.1341361286186E+03 -(PID.TID 0000.0001) %MON ad_dynstat_adwvel_del2 = 4.4695422301760E+01 +(PID.TID 0000.0001) %MON ad_dynstat_adwvel_mean = -7.3033998585881E+02 +(PID.TID 0000.0001) %MON ad_dynstat_adwvel_sd = 8.1341361286185E+03 +(PID.TID 0000.0001) %MON ad_dynstat_adwvel_del2 = 6.1241528477232E+01 (PID.TID 0000.0001) %MON ad_dynstat_adtheta_max = 7.5833391504053E+01 (PID.TID 0000.0001) %MON ad_dynstat_adtheta_min = -4.1525354898429E+01 -(PID.TID 0000.0001) %MON ad_dynstat_adtheta_mean = 4.7187967725433E-01 -(PID.TID 0000.0001) %MON ad_dynstat_adtheta_sd = 4.5695083189871E+00 -(PID.TID 0000.0001) %MON ad_dynstat_adtheta_del2 = 1.6684315275265E-02 +(PID.TID 0000.0001) %MON ad_dynstat_adtheta_mean = 4.7187967725437E-01 +(PID.TID 0000.0001) %MON ad_dynstat_adtheta_sd = 4.5695083189873E+00 +(PID.TID 0000.0001) %MON ad_dynstat_adtheta_del2 = 2.7678253453933E-02 (PID.TID 0000.0001) %MON ad_dynstat_adsalt_max = 1.4448309853227E+02 (PID.TID 0000.0001) %MON ad_dynstat_adsalt_min = -1.4320181175150E+02 -(PID.TID 0000.0001) %MON ad_dynstat_adsalt_mean = 1.4162166902169E-02 -(PID.TID 0000.0001) %MON ad_dynstat_adsalt_sd = 1.8817920709165E+00 -(PID.TID 0000.0001) %MON ad_dynstat_adsalt_del2 = 3.6516769974595E-02 +(PID.TID 0000.0001) %MON ad_dynstat_adsalt_mean = 1.4162166902171E-02 +(PID.TID 0000.0001) %MON ad_dynstat_adsalt_sd = 1.8817920709166E+00 +(PID.TID 0000.0001) %MON ad_dynstat_adsalt_del2 = 3.6546086504076E-02 (PID.TID 0000.0001) // ======================================================= (PID.TID 0000.0001) // End AD_MONITOR dynamic field statistics (PID.TID 0000.0001) // ======================================================= Calling cg2d from S/R CG2D_MAD - cg2d: Sum(rhs),rhsMax = -6.61211536912010E-15 1.33029393421496E-03 + cg2d: Sum(rhs),rhsMax = -7.99360577730113E-15 1.33029393421496E-03 Calling cg2d from S/R CG2D_MAD - cg2d: Sum(rhs),rhsMax = 5.01204980296599E-15 1.40191055720658E-03 + cg2d: Sum(rhs),rhsMax = -9.76996261670138E-15 1.40191055720658E-03 (PID.TID 0000.0001) // ======================================================= (PID.TID 0000.0001) // Begin AD_MONITOR dynamic field statistics (PID.TID 0000.0001) // ======================================================= (PID.TID 0000.0001) %MON ad_time_tsnumber = 0 (PID.TID 0000.0001) %MON ad_time_secondsf = 0.0000000000000E+00 (PID.TID 0000.0001) %MON ad_dynstat_adeta_max = 1.3550683205742E+02 -(PID.TID 0000.0001) %MON ad_dynstat_adeta_min = -4.3068281185577E+01 +(PID.TID 0000.0001) %MON ad_dynstat_adeta_min = -4.3068281185578E+01 (PID.TID 0000.0001) %MON ad_dynstat_adeta_mean = 3.0864811552139E-01 (PID.TID 0000.0001) %MON ad_dynstat_adeta_sd = 1.6951595218077E+01 -(PID.TID 0000.0001) %MON ad_dynstat_adeta_del2 = 4.8323265865025E-01 -(PID.TID 0000.0001) %MON ad_dynstat_aduvel_max = 5.5954280681837E+01 +(PID.TID 0000.0001) %MON ad_dynstat_adeta_del2 = 5.0918010294720E-01 +(PID.TID 0000.0001) %MON ad_dynstat_aduvel_max = 5.5954280681838E+01 (PID.TID 0000.0001) %MON ad_dynstat_aduvel_min = -1.0780668343557E+02 -(PID.TID 0000.0001) %MON ad_dynstat_aduvel_mean = -3.6363581261081E+00 -(PID.TID 0000.0001) %MON ad_dynstat_aduvel_sd = 1.4356156918440E+01 -(PID.TID 0000.0001) %MON ad_dynstat_aduvel_del2 = 5.7258676444572E-02 +(PID.TID 0000.0001) %MON ad_dynstat_aduvel_mean = -3.6363581261084E+00 +(PID.TID 0000.0001) %MON ad_dynstat_aduvel_sd = 1.4356156918441E+01 +(PID.TID 0000.0001) %MON ad_dynstat_aduvel_del2 = 6.4091132732370E-02 (PID.TID 0000.0001) %MON ad_dynstat_advvel_max = 1.6191225597068E+02 (PID.TID 0000.0001) %MON ad_dynstat_advvel_min = -1.5508690881795E+02 -(PID.TID 0000.0001) %MON ad_dynstat_advvel_mean = -3.5089813411513E+00 -(PID.TID 0000.0001) %MON ad_dynstat_advvel_sd = 3.3429443019238E+01 -(PID.TID 0000.0001) %MON ad_dynstat_advvel_del2 = 1.0630213533164E-01 +(PID.TID 0000.0001) %MON ad_dynstat_advvel_mean = -3.5089813411515E+00 +(PID.TID 0000.0001) %MON ad_dynstat_advvel_sd = 3.3429443019239E+01 +(PID.TID 0000.0001) %MON ad_dynstat_advvel_del2 = 1.2331337118135E-01 (PID.TID 0000.0001) %MON ad_dynstat_adwvel_max = 9.6291369464420E+03 (PID.TID 0000.0001) %MON ad_dynstat_adwvel_min = -8.0212598087631E+04 -(PID.TID 0000.0001) %MON ad_dynstat_adwvel_mean = -2.8566486397398E+02 -(PID.TID 0000.0001) %MON ad_dynstat_adwvel_sd = 3.1351831455068E+03 -(PID.TID 0000.0001) %MON ad_dynstat_adwvel_del2 = 1.7209629792256E+01 +(PID.TID 0000.0001) %MON ad_dynstat_adwvel_mean = -2.8566486397395E+02 +(PID.TID 0000.0001) %MON ad_dynstat_adwvel_sd = 3.1351831455067E+03 +(PID.TID 0000.0001) %MON ad_dynstat_adwvel_del2 = 2.3512571434853E+01 (PID.TID 0000.0001) %MON ad_dynstat_adtheta_max = 8.2651719664678E+01 (PID.TID 0000.0001) %MON ad_dynstat_adtheta_min = -4.8880614970975E+01 -(PID.TID 0000.0001) %MON ad_dynstat_adtheta_mean = 4.6180891894873E-01 -(PID.TID 0000.0001) %MON ad_dynstat_adtheta_sd = 4.5299733854328E+00 -(PID.TID 0000.0001) %MON ad_dynstat_adtheta_del2 = 2.0428647971614E-02 +(PID.TID 0000.0001) %MON ad_dynstat_adtheta_mean = 4.6180891894876E-01 +(PID.TID 0000.0001) %MON ad_dynstat_adtheta_sd = 4.5299733854330E+00 +(PID.TID 0000.0001) %MON ad_dynstat_adtheta_del2 = 2.9648865751902E-02 (PID.TID 0000.0001) %MON ad_dynstat_adsalt_max = 1.7196765112890E+02 (PID.TID 0000.0001) %MON ad_dynstat_adsalt_min = -1.7060821975003E+02 -(PID.TID 0000.0001) %MON ad_dynstat_adsalt_mean = 3.8434763110441E-02 -(PID.TID 0000.0001) %MON ad_dynstat_adsalt_sd = 2.8167187528791E+00 -(PID.TID 0000.0001) %MON ad_dynstat_adsalt_del2 = 4.7705225892907E-02 +(PID.TID 0000.0001) %MON ad_dynstat_adsalt_mean = 3.8434763110445E-02 +(PID.TID 0000.0001) %MON ad_dynstat_adsalt_sd = 2.8167187528792E+00 +(PID.TID 0000.0001) %MON ad_dynstat_adsalt_del2 = 4.7875242441850E-02 (PID.TID 0000.0001) // ======================================================= (PID.TID 0000.0001) // End AD_MONITOR dynamic field statistics (PID.TID 0000.0001) // ======================================================= @@ -2627,17 +2662,17 @@ (PID.TID 0000.0001) // ======================================================= (PID.TID 0000.0001) // Gradient-check starts (grdchk_main) (PID.TID 0000.0001) // ======================================================= -(PID.TID 0000.0001) grdchk reference fc: fcref = 8.04687744759401E+05 +(PID.TID 0000.0001) grdchk reference fc: fcref = 8.04687744759400E+05 grad-res ------------------------------- grad-res proc # i j k bi bj iobc fc ref fc + eps fc - eps grad-res proc # i j k bi bj iobc adj grad fd grad 1 - fd/adj grad-res exact position met: - grad-res 0 2229 71 37 1 1 1 + grad-res 0 526 26 17 1 2 2 (PID.TID 0000.0001) ====== Starts gradient-check number 1 (=ichknum) ======= - ph-test icomp, ncvarcomp, ichknum 2229 29309 1 - ph-grd _loc: bi, bj, icomptest, ichknum 1 1 0 1 - ph-grd -->hit<-- 71 37 1 1 -(PID.TID 0000.0001) grdchk pos: i,j,k= 71 37 1 ; bi,bj= 1 1 ; iobc= 1 ; rec= 1 + ph-test icomp, ncvarcomp, ichknum 526 29309 1 + ph-grd _loc: bi, bj, icomptest, ichknum 2 2 0 1 + ph-grd -->hit<-- 26 17 1 1 +(PID.TID 0000.0001) grdchk pos: i,j,k= 26 17 1 ; bi,bj= 2 2 ; iobc= 1 ; rec= 1 (PID.TID 0000.0001) Start initial hydrostatic pressure computation (PID.TID 0000.0001) Pressure is predetermined for buoyancyRelation OCEANIC (PID.TID 0000.0001) @@ -2647,16 +2682,19 @@ grad-res ------------------------------- (PID.TID 0000.0001) EXTERNAL_FIELDS_LOAD, it= 0 : Reading new data, i0,i1= 12 1 (prev= 12 0 ) (PID.TID 0000.0001) SOLVE_FOR_PRESSURE: putPmEinXvector = F - cg2d: Sum(rhs),rhsMax = 1.05956909912663E-14 2.53674886388737E+00 - cg2d: Sum(rhs),rhsMax = 5.48866507799062E-15 5.04325900480939E+00 - cg2d: Sum(rhs),rhsMax = -2.96429547574917E-14 6.29008403763954E+00 - cg2d: Sum(rhs),rhsMax = 2.17499629417972E-14 6.70003306073569E+00 + cg2d: Sum(rhs),rhsMax = 1.13242748511766E-14 2.53674886388737E+00 + cg2d: Sum(rhs),rhsMax = 3.99680288865056E-15 5.04325900480939E+00 + cg2d: Sum(rhs),rhsMax = -6.10622663543836E-15 6.29008403763954E+00 + cg2d: Sum(rhs),rhsMax = 2.75335310107039E-14 6.70003306073569E+00 (PID.TID 0000.0001) Did not write pickup because writePickupAtEnd = FALSE (PID.TID 0000.0001) early fc = 0.000000000000000D+00 - --> objf_test(bi,bj) = 0.804687766750478D+06 -(PID.TID 0000.0001) local fc = 0.804687766750478D+06 -(PID.TID 0000.0001) global fc = 0.804687766750478D+06 -(PID.TID 0000.0001) grdchk perturb(+)fc: fcpertplus = 8.04687766750478E+05 + --> objf_test(bi,bj) = 0.221431048007422D+06 + --> objf_test(bi,bj) = 0.241096917459820D+06 + --> objf_test(bi,bj) = 0.137155804089993D+06 + --> objf_test(bi,bj) = 0.205003997193242D+06 +(PID.TID 0000.0001) local fc = 0.804687766750477D+06 +(PID.TID 0000.0001) global fc = 0.804687766750477D+06 +(PID.TID 0000.0001) grdchk perturb(+)fc: fcpertplus = 8.04687766750477E+05 (PID.TID 0000.0001) Start initial hydrostatic pressure computation (PID.TID 0000.0001) Pressure is predetermined for buoyancyRelation OCEANIC (PID.TID 0000.0001) @@ -2666,28 +2704,31 @@ grad-res ------------------------------- (PID.TID 0000.0001) EXTERNAL_FIELDS_LOAD, it= 0 : Reading new data, i0,i1= 12 1 (prev= 12 0 ) (PID.TID 0000.0001) SOLVE_FOR_PRESSURE: putPmEinXvector = F - cg2d: Sum(rhs),rhsMax = 1.06512021424976E-14 2.53674886388737E+00 - cg2d: Sum(rhs),rhsMax = 5.83560977318598E-15 5.04325900480939E+00 - cg2d: Sum(rhs),rhsMax = -4.54740411992560E-14 6.29008403763954E+00 - cg2d: Sum(rhs),rhsMax = 3.78898301622854E-14 6.70003306073569E+00 + cg2d: Sum(rhs),rhsMax = 1.13242748511766E-14 2.53674886388737E+00 + cg2d: Sum(rhs),rhsMax = -4.21884749357559E-15 5.04325900480939E+00 + cg2d: Sum(rhs),rhsMax = -3.99680288865056E-15 6.29008403763954E+00 + cg2d: Sum(rhs),rhsMax = 1.82076576038526E-14 6.70003306073569E+00 (PID.TID 0000.0001) Did not write pickup because writePickupAtEnd = FALSE (PID.TID 0000.0001) early fc = 0.000000000000000D+00 - --> objf_test(bi,bj) = 0.804687722952049D+06 + --> objf_test(bi,bj) = 0.221431048007422D+06 + --> objf_test(bi,bj) = 0.241096917459820D+06 + --> objf_test(bi,bj) = 0.137155804089993D+06 + --> objf_test(bi,bj) = 0.205003953394813D+06 (PID.TID 0000.0001) local fc = 0.804687722952049D+06 (PID.TID 0000.0001) global fc = 0.804687722952049D+06 (PID.TID 0000.0001) grdchk perturb(-)fc: fcpertminus = 8.04687722952049E+05 grad-res ------------------------------- - grad-res 0 1 71 37 1 1 1 1 8.04687744759E+05 8.04687766750E+05 8.04687722952E+05 - grad-res 0 1 1 2229 0 1 1 1 2.18992150034E+00 2.18992143054E+00 3.18732082949E-08 -(PID.TID 0000.0001) ADM ref_cost_function = 8.04687744759401E+05 + grad-res 0 1 26 17 1 2 2 1 8.04687744759E+05 8.04687766750E+05 8.04687722952E+05 + grad-res 0 1 1 526 0 2 2 1 2.18992150034E+00 2.18992143637E+00 2.92152290138E-08 +(PID.TID 0000.0001) ADM ref_cost_function = 8.04687744759400E+05 (PID.TID 0000.0001) ADM adjoint_gradient = 2.18992150034475E+00 -(PID.TID 0000.0001) ADM finite-diff_grad = 2.18992143054493E+00 +(PID.TID 0000.0001) ADM finite-diff_grad = 2.18992143636569E+00 (PID.TID 0000.0001) ====== End of gradient-check number 1 (ierr= 0) ======= (PID.TID 0000.0001) ====== Starts gradient-check number 2 (=ichknum) ======= - ph-test icomp, ncvarcomp, ichknum 2230 29309 2 - ph-grd _loc: bi, bj, icomptest, ichknum 1 1 2229 2 - ph-grd -->hit<-- 75 37 1 1 -(PID.TID 0000.0001) grdchk pos: i,j,k= 75 37 1 ; bi,bj= 1 1 ; iobc= 1 ; rec= 1 + ph-test icomp, ncvarcomp, ichknum 527 29309 2 + ph-grd _loc: bi, bj, icomptest, ichknum 2 2 526 2 + ph-grd -->hit<-- 30 17 1 1 +(PID.TID 0000.0001) grdchk pos: i,j,k= 30 17 1 ; bi,bj= 2 2 ; iobc= 1 ; rec= 1 (PID.TID 0000.0001) Start initial hydrostatic pressure computation (PID.TID 0000.0001) Pressure is predetermined for buoyancyRelation OCEANIC (PID.TID 0000.0001) @@ -2697,16 +2738,19 @@ grad-res ------------------------------- (PID.TID 0000.0001) EXTERNAL_FIELDS_LOAD, it= 0 : Reading new data, i0,i1= 12 1 (prev= 12 0 ) (PID.TID 0000.0001) SOLVE_FOR_PRESSURE: putPmEinXvector = F - cg2d: Sum(rhs),rhsMax = 1.05956909912663E-14 2.53674886388737E+00 - cg2d: Sum(rhs),rhsMax = -5.87030424270552E-15 5.04325900480939E+00 - cg2d: Sum(rhs),rhsMax = -2.34152974787349E-14 6.29008403763954E+00 - cg2d: Sum(rhs),rhsMax = 4.31286950597354E-14 6.70003306073569E+00 + cg2d: Sum(rhs),rhsMax = 1.15463194561016E-14 2.53674886388737E+00 + cg2d: Sum(rhs),rhsMax = 6.99440505513849E-15 5.04325900480939E+00 + cg2d: Sum(rhs),rhsMax = -5.88418203051333E-15 6.29008403763954E+00 + cg2d: Sum(rhs),rhsMax = 2.57571741713036E-14 6.70003306073569E+00 (PID.TID 0000.0001) Did not write pickup because writePickupAtEnd = FALSE (PID.TID 0000.0001) early fc = 0.000000000000000D+00 - --> objf_test(bi,bj) = 0.804687754249786D+06 -(PID.TID 0000.0001) local fc = 0.804687754249786D+06 -(PID.TID 0000.0001) global fc = 0.804687754249786D+06 -(PID.TID 0000.0001) grdchk perturb(+)fc: fcpertplus = 8.04687754249786E+05 + --> objf_test(bi,bj) = 0.221431048007422D+06 + --> objf_test(bi,bj) = 0.241096917459820D+06 + --> objf_test(bi,bj) = 0.137155804089993D+06 + --> objf_test(bi,bj) = 0.205003984692549D+06 +(PID.TID 0000.0001) local fc = 0.804687754249784D+06 +(PID.TID 0000.0001) global fc = 0.804687754249784D+06 +(PID.TID 0000.0001) grdchk perturb(+)fc: fcpertplus = 8.04687754249784E+05 (PID.TID 0000.0001) Start initial hydrostatic pressure computation (PID.TID 0000.0001) Pressure is predetermined for buoyancyRelation OCEANIC (PID.TID 0000.0001) @@ -2716,28 +2760,31 @@ grad-res ------------------------------- (PID.TID 0000.0001) EXTERNAL_FIELDS_LOAD, it= 0 : Reading new data, i0,i1= 12 1 (prev= 12 0 ) (PID.TID 0000.0001) SOLVE_FOR_PRESSURE: putPmEinXvector = F - cg2d: Sum(rhs),rhsMax = 1.06512021424976E-14 2.53674886388737E+00 - cg2d: Sum(rhs),rhsMax = 4.67681449123347E-15 5.04325900480939E+00 - cg2d: Sum(rhs),rhsMax = -3.02882718905551E-14 6.29008403763954E+00 - cg2d: Sum(rhs),rhsMax = 1.67470204370801E-14 6.70003306073569E+00 + cg2d: Sum(rhs),rhsMax = 1.16573417585641E-14 2.53674886388737E+00 + cg2d: Sum(rhs),rhsMax = 3.49720252756924E-15 5.04325900480939E+00 + cg2d: Sum(rhs),rhsMax = -6.99440505513849E-15 6.29008403763954E+00 + cg2d: Sum(rhs),rhsMax = 9.76996261670138E-15 6.70003306073569E+00 (PID.TID 0000.0001) Did not write pickup because writePickupAtEnd = FALSE (PID.TID 0000.0001) early fc = 0.000000000000000D+00 - --> objf_test(bi,bj) = 0.804687735451473D+06 -(PID.TID 0000.0001) local fc = 0.804687735451473D+06 -(PID.TID 0000.0001) global fc = 0.804687735451473D+06 -(PID.TID 0000.0001) grdchk perturb(-)fc: fcpertminus = 8.04687735451473E+05 + --> objf_test(bi,bj) = 0.221431048007422D+06 + --> objf_test(bi,bj) = 0.241096917459820D+06 + --> objf_test(bi,bj) = 0.137155804089993D+06 + --> objf_test(bi,bj) = 0.205003965894237D+06 +(PID.TID 0000.0001) local fc = 0.804687735451472D+06 +(PID.TID 0000.0001) global fc = 0.804687735451472D+06 +(PID.TID 0000.0001) grdchk perturb(-)fc: fcpertminus = 8.04687735451472E+05 grad-res ------------------------------- - grad-res 0 2 75 37 1 1 1 1 8.04687744759E+05 8.04687754250E+05 8.04687735451E+05 - grad-res 0 2 2 2230 0 1 1 1 9.39915722870E-01 9.39915608615E-01 1.21559244670E-07 -(PID.TID 0000.0001) ADM ref_cost_function = 8.04687744759401E+05 + grad-res 0 2 30 17 1 2 2 1 8.04687744759E+05 8.04687754250E+05 8.04687735451E+05 + grad-res 0 2 2 527 0 2 2 1 9.39915722870E-01 9.39915596973E-01 1.33944963787E-07 +(PID.TID 0000.0001) ADM ref_cost_function = 8.04687744759400E+05 (PID.TID 0000.0001) ADM adjoint_gradient = 9.39915722870128E-01 -(PID.TID 0000.0001) ADM finite-diff_grad = 9.39915608614683E-01 +(PID.TID 0000.0001) ADM finite-diff_grad = 9.39915596973151E-01 (PID.TID 0000.0001) ====== End of gradient-check number 2 (ierr= 0) ======= (PID.TID 0000.0001) ====== Starts gradient-check number 3 (=ichknum) ======= - ph-test icomp, ncvarcomp, ichknum 2231 29309 3 - ph-grd _loc: bi, bj, icomptest, ichknum 1 1 2230 3 - ph-grd -->hit<-- 76 37 1 1 -(PID.TID 0000.0001) grdchk pos: i,j,k= 76 37 1 ; bi,bj= 1 1 ; iobc= 1 ; rec= 1 + ph-test icomp, ncvarcomp, ichknum 528 29309 3 + ph-grd _loc: bi, bj, icomptest, ichknum 2 2 527 3 + ph-grd -->hit<-- 31 17 1 1 +(PID.TID 0000.0001) grdchk pos: i,j,k= 31 17 1 ; bi,bj= 2 2 ; iobc= 1 ; rec= 1 (PID.TID 0000.0001) Start initial hydrostatic pressure computation (PID.TID 0000.0001) Pressure is predetermined for buoyancyRelation OCEANIC (PID.TID 0000.0001) @@ -2747,16 +2794,19 @@ grad-res ------------------------------- (PID.TID 0000.0001) EXTERNAL_FIELDS_LOAD, it= 0 : Reading new data, i0,i1= 12 1 (prev= 12 0 ) (PID.TID 0000.0001) SOLVE_FOR_PRESSURE: putPmEinXvector = F - cg2d: Sum(rhs),rhsMax = 1.06512021424976E-14 2.53674886388737E+00 - cg2d: Sum(rhs),rhsMax = 8.32667268468867E-15 5.04325900480939E+00 - cg2d: Sum(rhs),rhsMax = -2.41126563160776E-14 6.29008403763954E+00 - cg2d: Sum(rhs),rhsMax = 2.45983788893511E-15 6.70003306073569E+00 + cg2d: Sum(rhs),rhsMax = 1.13242748511766E-14 2.53674886388737E+00 + cg2d: Sum(rhs),rhsMax = 1.94289029309402E-15 5.04325900480939E+00 + cg2d: Sum(rhs),rhsMax = -9.32587340685131E-15 6.29008403763954E+00 + cg2d: Sum(rhs),rhsMax = 1.33226762955019E-14 6.70003306073569E+00 (PID.TID 0000.0001) Did not write pickup because writePickupAtEnd = FALSE (PID.TID 0000.0001) early fc = 0.000000000000000D+00 - --> objf_test(bi,bj) = 0.804687750220327D+06 -(PID.TID 0000.0001) local fc = 0.804687750220327D+06 -(PID.TID 0000.0001) global fc = 0.804687750220327D+06 -(PID.TID 0000.0001) grdchk perturb(+)fc: fcpertplus = 8.04687750220327E+05 + --> objf_test(bi,bj) = 0.221431048007422D+06 + --> objf_test(bi,bj) = 0.241096917459820D+06 + --> objf_test(bi,bj) = 0.137155804089993D+06 + --> objf_test(bi,bj) = 0.205003980663090D+06 +(PID.TID 0000.0001) local fc = 0.804687750220325D+06 +(PID.TID 0000.0001) global fc = 0.804687750220325D+06 +(PID.TID 0000.0001) grdchk perturb(+)fc: fcpertplus = 8.04687750220325E+05 (PID.TID 0000.0001) Start initial hydrostatic pressure computation (PID.TID 0000.0001) Pressure is predetermined for buoyancyRelation OCEANIC (PID.TID 0000.0001) @@ -2766,28 +2816,31 @@ grad-res ------------------------------- (PID.TID 0000.0001) EXTERNAL_FIELDS_LOAD, it= 0 : Reading new data, i0,i1= 12 1 (prev= 12 0 ) (PID.TID 0000.0001) SOLVE_FOR_PRESSURE: putPmEinXvector = F - cg2d: Sum(rhs),rhsMax = 1.05956909912663E-14 2.53674886388737E+00 - cg2d: Sum(rhs),rhsMax = 3.98292510084275E-15 5.04325900480939E+00 - cg2d: Sum(rhs),rhsMax = -2.40640840587503E-14 6.29008403763954E+00 - cg2d: Sum(rhs),rhsMax = -1.23304144672431E-14 6.70003306073569E+00 + cg2d: Sum(rhs),rhsMax = 1.16573417585641E-14 2.53674886388737E+00 + cg2d: Sum(rhs),rhsMax = -2.55351295663786E-15 5.04325900480939E+00 + cg2d: Sum(rhs),rhsMax = -1.31006316905768E-14 6.29008403763954E+00 + cg2d: Sum(rhs),rhsMax = 1.95399252334028E-14 6.70003306073569E+00 (PID.TID 0000.0001) Did not write pickup because writePickupAtEnd = FALSE (PID.TID 0000.0001) early fc = 0.000000000000000D+00 - --> objf_test(bi,bj) = 0.804687739478537D+06 + --> objf_test(bi,bj) = 0.221431048007422D+06 + --> objf_test(bi,bj) = 0.241096917459820D+06 + --> objf_test(bi,bj) = 0.137155804089993D+06 + --> objf_test(bi,bj) = 0.205003969921301D+06 (PID.TID 0000.0001) local fc = 0.804687739478537D+06 (PID.TID 0000.0001) global fc = 0.804687739478537D+06 (PID.TID 0000.0001) grdchk perturb(-)fc: fcpertminus = 8.04687739478537E+05 grad-res ------------------------------- - grad-res 0 3 76 37 1 1 1 1 8.04687744759E+05 8.04687750220E+05 8.04687739479E+05 - grad-res 0 3 3 2231 0 1 1 1 5.37089397047E-01 5.37089502905E-01 -1.97094450094E-07 -(PID.TID 0000.0001) ADM ref_cost_function = 8.04687744759401E+05 + grad-res 0 3 31 17 1 2 2 1 8.04687744759E+05 8.04687750220E+05 8.04687739479E+05 + grad-res 0 3 3 528 0 2 2 1 5.37089397047E-01 5.37089438876E-01 -7.78807263124E-08 +(PID.TID 0000.0001) ADM ref_cost_function = 8.04687744759400E+05 (PID.TID 0000.0001) ADM adjoint_gradient = 5.37089397047225E-01 -(PID.TID 0000.0001) ADM finite-diff_grad = 5.37089502904564E-01 +(PID.TID 0000.0001) ADM finite-diff_grad = 5.37089438876137E-01 (PID.TID 0000.0001) ====== End of gradient-check number 3 (ierr= 0) ======= (PID.TID 0000.0001) ====== Starts gradient-check number 4 (=ichknum) ======= - ph-test icomp, ncvarcomp, ichknum 2232 29309 4 - ph-grd _loc: bi, bj, icomptest, ichknum 1 1 2231 4 - ph-grd -->hit<-- 77 37 1 1 -(PID.TID 0000.0001) grdchk pos: i,j,k= 77 37 1 ; bi,bj= 1 1 ; iobc= 1 ; rec= 1 + ph-test icomp, ncvarcomp, ichknum 529 29309 4 + ph-grd _loc: bi, bj, icomptest, ichknum 2 2 528 4 + ph-grd -->hit<-- 32 17 1 1 +(PID.TID 0000.0001) grdchk pos: i,j,k= 32 17 1 ; bi,bj= 2 2 ; iobc= 1 ; rec= 1 (PID.TID 0000.0001) Start initial hydrostatic pressure computation (PID.TID 0000.0001) Pressure is predetermined for buoyancyRelation OCEANIC (PID.TID 0000.0001) @@ -2797,16 +2850,19 @@ grad-res ------------------------------- (PID.TID 0000.0001) EXTERNAL_FIELDS_LOAD, it= 0 : Reading new data, i0,i1= 12 1 (prev= 12 0 ) (PID.TID 0000.0001) SOLVE_FOR_PRESSURE: putPmEinXvector = F - cg2d: Sum(rhs),rhsMax = 1.06512021424976E-14 2.53674886388737E+00 - cg2d: Sum(rhs),rhsMax = 7.25808302348696E-15 5.04325900480939E+00 - cg2d: Sum(rhs),rhsMax = -1.51371970513736E-14 6.29008403763954E+00 - cg2d: Sum(rhs),rhsMax = 4.99357499794684E-14 6.70003306073569E+00 + cg2d: Sum(rhs),rhsMax = 1.16573417585641E-14 2.53674886388737E+00 + cg2d: Sum(rhs),rhsMax = -3.49720252756924E-15 5.04325900480939E+00 + cg2d: Sum(rhs),rhsMax = -9.88098491916389E-15 6.29008403763954E+00 + cg2d: Sum(rhs),rhsMax = 1.99840144432528E-14 6.70003306073569E+00 (PID.TID 0000.0001) Did not write pickup because writePickupAtEnd = FALSE (PID.TID 0000.0001) early fc = 0.000000000000000D+00 - --> objf_test(bi,bj) = 0.804687766878618D+06 -(PID.TID 0000.0001) local fc = 0.804687766878618D+06 -(PID.TID 0000.0001) global fc = 0.804687766878618D+06 -(PID.TID 0000.0001) grdchk perturb(+)fc: fcpertplus = 8.04687766878618E+05 + --> objf_test(bi,bj) = 0.221431048007422D+06 + --> objf_test(bi,bj) = 0.241096917459820D+06 + --> objf_test(bi,bj) = 0.137155804089993D+06 + --> objf_test(bi,bj) = 0.205003997321381D+06 +(PID.TID 0000.0001) local fc = 0.804687766878617D+06 +(PID.TID 0000.0001) global fc = 0.804687766878617D+06 +(PID.TID 0000.0001) grdchk perturb(+)fc: fcpertplus = 8.04687766878617E+05 (PID.TID 0000.0001) Start initial hydrostatic pressure computation (PID.TID 0000.0001) Pressure is predetermined for buoyancyRelation OCEANIC (PID.TID 0000.0001) @@ -2816,28 +2872,31 @@ grad-res ------------------------------- (PID.TID 0000.0001) EXTERNAL_FIELDS_LOAD, it= 0 : Reading new data, i0,i1= 12 1 (prev= 12 0 ) (PID.TID 0000.0001) SOLVE_FOR_PRESSURE: putPmEinXvector = F - cg2d: Sum(rhs),rhsMax = 1.06512021424976E-14 2.53674886388737E+00 - cg2d: Sum(rhs),rhsMax = -1.33226762955019E-15 5.04325900480939E+00 - cg2d: Sum(rhs),rhsMax = -2.82378287419505E-14 6.29008403763954E+00 - cg2d: Sum(rhs),rhsMax = 3.28244376124331E-14 6.70003306073569E+00 + cg2d: Sum(rhs),rhsMax = 1.16573417585641E-14 2.53674886388737E+00 + cg2d: Sum(rhs),rhsMax = 9.76996261670138E-15 5.04325900480939E+00 + cg2d: Sum(rhs),rhsMax = 6.66133814775094E-16 6.29008403763954E+00 + cg2d: Sum(rhs),rhsMax = 2.39808173319034E-14 6.70003306073569E+00 (PID.TID 0000.0001) Did not write pickup because writePickupAtEnd = FALSE (PID.TID 0000.0001) early fc = 0.000000000000000D+00 - --> objf_test(bi,bj) = 0.804687722827863D+06 -(PID.TID 0000.0001) local fc = 0.804687722827863D+06 -(PID.TID 0000.0001) global fc = 0.804687722827863D+06 -(PID.TID 0000.0001) grdchk perturb(-)fc: fcpertminus = 8.04687722827863E+05 + --> objf_test(bi,bj) = 0.221431048007422D+06 + --> objf_test(bi,bj) = 0.241096917459820D+06 + --> objf_test(bi,bj) = 0.137155804089993D+06 + --> objf_test(bi,bj) = 0.205003953270627D+06 +(PID.TID 0000.0001) local fc = 0.804687722827862D+06 +(PID.TID 0000.0001) global fc = 0.804687722827862D+06 +(PID.TID 0000.0001) grdchk perturb(-)fc: fcpertminus = 8.04687722827862E+05 grad-res ------------------------------- - grad-res 0 4 77 37 1 1 1 1 8.04687744759E+05 8.04687766879E+05 8.04687722828E+05 - grad-res 0 4 4 2232 0 1 1 1 2.20253900008E+00 2.20253771986E+00 5.81250154674E-07 -(PID.TID 0000.0001) ADM ref_cost_function = 8.04687744759401E+05 + grad-res 0 4 32 17 1 2 2 1 8.04687744759E+05 8.04687766879E+05 8.04687722828E+05 + grad-res 0 4 4 529 0 2 2 1 2.20253900008E+00 2.20253771986E+00 5.81250154674E-07 +(PID.TID 0000.0001) ADM ref_cost_function = 8.04687744759400E+05 (PID.TID 0000.0001) ADM adjoint_gradient = 2.20253900008494E+00 (PID.TID 0000.0001) ADM finite-diff_grad = 2.20253771985881E+00 (PID.TID 0000.0001) ====== End of gradient-check number 4 (ierr= 0) ======= (PID.TID 0000.0001) ====== Starts gradient-check number 5 (=ichknum) ======= - ph-test icomp, ncvarcomp, ichknum 2233 29309 5 - ph-grd _loc: bi, bj, icomptest, ichknum 1 1 2232 5 - ph-grd -->hit<-- 81 37 1 1 -(PID.TID 0000.0001) grdchk pos: i,j,k= 81 37 1 ; bi,bj= 1 1 ; iobc= 1 ; rec= 1 + ph-test icomp, ncvarcomp, ichknum 530 29309 5 + ph-grd _loc: bi, bj, icomptest, ichknum 2 2 529 5 + ph-grd -->hit<-- 36 17 1 1 +(PID.TID 0000.0001) grdchk pos: i,j,k= 36 17 1 ; bi,bj= 2 2 ; iobc= 1 ; rec= 1 (PID.TID 0000.0001) Start initial hydrostatic pressure computation (PID.TID 0000.0001) Pressure is predetermined for buoyancyRelation OCEANIC (PID.TID 0000.0001) @@ -2847,13 +2906,16 @@ grad-res ------------------------------- (PID.TID 0000.0001) EXTERNAL_FIELDS_LOAD, it= 0 : Reading new data, i0,i1= 12 1 (prev= 12 0 ) (PID.TID 0000.0001) SOLVE_FOR_PRESSURE: putPmEinXvector = F - cg2d: Sum(rhs),rhsMax = 1.06512021424976E-14 2.53674886388737E+00 - cg2d: Sum(rhs),rhsMax = 5.31519273039294E-15 5.04325900480939E+00 - cg2d: Sum(rhs),rhsMax = -1.99493199737333E-14 6.29008403763954E+00 - cg2d: Sum(rhs),rhsMax = 2.68327027264093E-14 6.70003306073569E+00 + cg2d: Sum(rhs),rhsMax = 1.15463194561016E-14 2.53674886388737E+00 + cg2d: Sum(rhs),rhsMax = -6.10622663543836E-16 5.04325900480939E+00 + cg2d: Sum(rhs),rhsMax = -1.25455201782643E-14 6.29008403763954E+00 + cg2d: Sum(rhs),rhsMax = 2.79776202205539E-14 6.70003306073569E+00 (PID.TID 0000.0001) Did not write pickup because writePickupAtEnd = FALSE (PID.TID 0000.0001) early fc = 0.000000000000000D+00 - --> objf_test(bi,bj) = 0.804687819418588D+06 + --> objf_test(bi,bj) = 0.221431048007422D+06 + --> objf_test(bi,bj) = 0.241096917459820D+06 + --> objf_test(bi,bj) = 0.137155804089993D+06 + --> objf_test(bi,bj) = 0.205004049861352D+06 (PID.TID 0000.0001) local fc = 0.804687819418588D+06 (PID.TID 0000.0001) global fc = 0.804687819418588D+06 (PID.TID 0000.0001) grdchk perturb(+)fc: fcpertplus = 8.04687819418588E+05 @@ -2866,28 +2928,31 @@ grad-res ------------------------------- (PID.TID 0000.0001) EXTERNAL_FIELDS_LOAD, it= 0 : Reading new data, i0,i1= 12 1 (prev= 12 0 ) (PID.TID 0000.0001) SOLVE_FOR_PRESSURE: putPmEinXvector = F - cg2d: Sum(rhs),rhsMax = 1.05956909912663E-14 2.53674886388737E+00 - cg2d: Sum(rhs),rhsMax = -1.10328413072125E-15 5.04325900480939E+00 - cg2d: Sum(rhs),rhsMax = -2.40571451648464E-14 6.29008403763954E+00 - cg2d: Sum(rhs),rhsMax = 4.52068937839556E-14 6.70003306073569E+00 + cg2d: Sum(rhs),rhsMax = 1.15463194561016E-14 2.53674886388737E+00 + cg2d: Sum(rhs),rhsMax = 1.05471187339390E-15 5.04325900480939E+00 + cg2d: Sum(rhs),rhsMax = -8.88178419700125E-16 6.29008403763954E+00 + cg2d: Sum(rhs),rhsMax = 1.24344978758018E-14 6.70003306073569E+00 (PID.TID 0000.0001) Did not write pickup because writePickupAtEnd = FALSE (PID.TID 0000.0001) early fc = 0.000000000000000D+00 - --> objf_test(bi,bj) = 0.804687670283909D+06 + --> objf_test(bi,bj) = 0.221431048007422D+06 + --> objf_test(bi,bj) = 0.241096917459820D+06 + --> objf_test(bi,bj) = 0.137155804089993D+06 + --> objf_test(bi,bj) = 0.205003900726674D+06 (PID.TID 0000.0001) local fc = 0.804687670283909D+06 (PID.TID 0000.0001) global fc = 0.804687670283909D+06 (PID.TID 0000.0001) grdchk perturb(-)fc: fcpertminus = 8.04687670283909E+05 grad-res ------------------------------- - grad-res 0 5 81 37 1 1 1 1 8.04687744759E+05 8.04687819419E+05 8.04687670284E+05 - grad-res 0 5 5 2233 0 1 1 1 7.45673438915E+00 7.45673395577E+00 5.81195356286E-08 -(PID.TID 0000.0001) ADM ref_cost_function = 8.04687744759401E+05 + grad-res 0 5 36 17 1 2 2 1 8.04687744759E+05 8.04687819419E+05 8.04687670284E+05 + grad-res 0 5 5 530 0 2 2 1 7.45673438915E+00 7.45673393249E+00 6.12419567281E-08 +(PID.TID 0000.0001) ADM ref_cost_function = 8.04687744759400E+05 (PID.TID 0000.0001) ADM adjoint_gradient = 7.45673438915081E+00 -(PID.TID 0000.0001) ADM finite-diff_grad = 7.45673395576887E+00 +(PID.TID 0000.0001) ADM finite-diff_grad = 7.45673393248580E+00 (PID.TID 0000.0001) ====== End of gradient-check number 5 (ierr= 0) ======= (PID.TID 0000.0001) ====== Starts gradient-check number 6 (=ichknum) ======= - ph-test icomp, ncvarcomp, ichknum 2234 29309 6 - ph-grd _loc: bi, bj, icomptest, ichknum 1 1 2233 6 - ph-grd -->hit<-- 82 37 1 1 -(PID.TID 0000.0001) grdchk pos: i,j,k= 82 37 1 ; bi,bj= 1 1 ; iobc= 1 ; rec= 1 + ph-test icomp, ncvarcomp, ichknum 531 29309 6 + ph-grd _loc: bi, bj, icomptest, ichknum 2 2 530 6 + ph-grd -->hit<-- 37 17 1 1 +(PID.TID 0000.0001) grdchk pos: i,j,k= 37 17 1 ; bi,bj= 2 2 ; iobc= 1 ; rec= 1 (PID.TID 0000.0001) Start initial hydrostatic pressure computation (PID.TID 0000.0001) Pressure is predetermined for buoyancyRelation OCEANIC (PID.TID 0000.0001) @@ -2897,16 +2962,19 @@ grad-res ------------------------------- (PID.TID 0000.0001) EXTERNAL_FIELDS_LOAD, it= 0 : Reading new data, i0,i1= 12 1 (prev= 12 0 ) (PID.TID 0000.0001) SOLVE_FOR_PRESSURE: putPmEinXvector = F - cg2d: Sum(rhs),rhsMax = 1.06512021424976E-14 2.53674886388737E+00 - cg2d: Sum(rhs),rhsMax = 3.10862446895044E-15 5.04325900480939E+00 - cg2d: Sum(rhs),rhsMax = -2.71449529520851E-14 6.29008403763954E+00 - cg2d: Sum(rhs),rhsMax = 2.27977359212872E-14 6.70003306073569E+00 + cg2d: Sum(rhs),rhsMax = 1.17683640610267E-14 2.53674886388737E+00 + cg2d: Sum(rhs),rhsMax = 2.60902410786912E-15 5.04325900480939E+00 + cg2d: Sum(rhs),rhsMax = -1.27675647831893E-14 6.29008403763954E+00 + cg2d: Sum(rhs),rhsMax = 1.33226762955019E-14 6.70003306073569E+00 (PID.TID 0000.0001) Did not write pickup because writePickupAtEnd = FALSE (PID.TID 0000.0001) early fc = 0.000000000000000D+00 - --> objf_test(bi,bj) = 0.804687808327178D+06 -(PID.TID 0000.0001) local fc = 0.804687808327178D+06 -(PID.TID 0000.0001) global fc = 0.804687808327178D+06 -(PID.TID 0000.0001) grdchk perturb(+)fc: fcpertplus = 8.04687808327178E+05 + --> objf_test(bi,bj) = 0.221431048007422D+06 + --> objf_test(bi,bj) = 0.241096917459820D+06 + --> objf_test(bi,bj) = 0.137155804089995D+06 + --> objf_test(bi,bj) = 0.205004038769940D+06 +(PID.TID 0000.0001) local fc = 0.804687808327177D+06 +(PID.TID 0000.0001) global fc = 0.804687808327177D+06 +(PID.TID 0000.0001) grdchk perturb(+)fc: fcpertplus = 8.04687808327177E+05 (PID.TID 0000.0001) Start initial hydrostatic pressure computation (PID.TID 0000.0001) Pressure is predetermined for buoyancyRelation OCEANIC (PID.TID 0000.0001) @@ -2916,28 +2984,31 @@ grad-res ------------------------------- (PID.TID 0000.0001) EXTERNAL_FIELDS_LOAD, it= 0 : Reading new data, i0,i1= 12 1 (prev= 12 0 ) (PID.TID 0000.0001) SOLVE_FOR_PRESSURE: putPmEinXvector = F - cg2d: Sum(rhs),rhsMax = 1.06512021424976E-14 2.53674886388737E+00 - cg2d: Sum(rhs),rhsMax = -5.27355936696949E-15 5.04325900480939E+00 - cg2d: Sum(rhs),rhsMax = -2.15764905941995E-14 6.29008403763954E+00 - cg2d: Sum(rhs),rhsMax = -2.80331313717852E-15 6.70003306073569E+00 + cg2d: Sum(rhs),rhsMax = 1.15463194561016E-14 2.53674886388737E+00 + cg2d: Sum(rhs),rhsMax = 6.66133814775094E-16 5.04325900480939E+00 + cg2d: Sum(rhs),rhsMax = -1.22124532708767E-14 6.29008403763954E+00 + cg2d: Sum(rhs),rhsMax = 2.57571741713036E-14 6.70003306073569E+00 (PID.TID 0000.0001) Did not write pickup because writePickupAtEnd = FALSE (PID.TID 0000.0001) early fc = 0.000000000000000D+00 - --> objf_test(bi,bj) = 0.804687681374115D+06 -(PID.TID 0000.0001) local fc = 0.804687681374115D+06 -(PID.TID 0000.0001) global fc = 0.804687681374115D+06 -(PID.TID 0000.0001) grdchk perturb(-)fc: fcpertminus = 8.04687681374115E+05 + --> objf_test(bi,bj) = 0.221431048007422D+06 + --> objf_test(bi,bj) = 0.241096917459820D+06 + --> objf_test(bi,bj) = 0.137155804089991D+06 + --> objf_test(bi,bj) = 0.205003911816880D+06 +(PID.TID 0000.0001) local fc = 0.804687681374114D+06 +(PID.TID 0000.0001) global fc = 0.804687681374114D+06 +(PID.TID 0000.0001) grdchk perturb(-)fc: fcpertminus = 8.04687681374114E+05 grad-res ------------------------------- - grad-res 0 6 82 37 1 1 1 1 8.04687744759E+05 8.04687808327E+05 8.04687681374E+05 - grad-res 0 6 6 2234 0 1 1 1 6.34765354129E+00 6.34765314171E+00 6.29484852022E-08 -(PID.TID 0000.0001) ADM ref_cost_function = 8.04687744759401E+05 + grad-res 0 6 37 17 1 2 2 1 8.04687744759E+05 8.04687808327E+05 8.04687681374E+05 + grad-res 0 6 6 531 0 2 2 1 6.34765354129E+00 6.34765317664E+00 5.74465155445E-08 +(PID.TID 0000.0001) ADM ref_cost_function = 8.04687744759400E+05 (PID.TID 0000.0001) ADM adjoint_gradient = 6.34765354128608E+00 -(PID.TID 0000.0001) ADM finite-diff_grad = 6.34765314171091E+00 +(PID.TID 0000.0001) ADM finite-diff_grad = 6.34765317663550E+00 (PID.TID 0000.0001) ====== End of gradient-check number 6 (ierr= 0) ======= (PID.TID 0000.0001) ====== Starts gradient-check number 7 (=ichknum) ======= - ph-test icomp, ncvarcomp, ichknum 2235 29309 7 - ph-grd _loc: bi, bj, icomptest, ichknum 1 1 2234 7 - ph-grd -->hit<-- 83 37 1 1 -(PID.TID 0000.0001) grdchk pos: i,j,k= 83 37 1 ; bi,bj= 1 1 ; iobc= 1 ; rec= 1 + ph-test icomp, ncvarcomp, ichknum 532 29309 7 + ph-grd _loc: bi, bj, icomptest, ichknum 2 2 531 7 + ph-grd -->hit<-- 38 17 1 1 +(PID.TID 0000.0001) grdchk pos: i,j,k= 38 17 1 ; bi,bj= 2 2 ; iobc= 1 ; rec= 1 (PID.TID 0000.0001) Start initial hydrostatic pressure computation (PID.TID 0000.0001) Pressure is predetermined for buoyancyRelation OCEANIC (PID.TID 0000.0001) @@ -2947,16 +3018,19 @@ grad-res ------------------------------- (PID.TID 0000.0001) EXTERNAL_FIELDS_LOAD, it= 0 : Reading new data, i0,i1= 12 1 (prev= 12 0 ) (PID.TID 0000.0001) SOLVE_FOR_PRESSURE: putPmEinXvector = F - cg2d: Sum(rhs),rhsMax = 1.05401798400351E-14 2.53674886388737E+00 - cg2d: Sum(rhs),rhsMax = 5.52335954751015E-15 5.04325900480939E+00 - cg2d: Sum(rhs),rhsMax = -6.39419073245051E-15 6.29008403763954E+00 - cg2d: Sum(rhs),rhsMax = 3.42087469462626E-14 6.70003306073569E+00 + cg2d: Sum(rhs),rhsMax = 1.16573417585641E-14 2.53674886388737E+00 + cg2d: Sum(rhs),rhsMax = 4.27435864480685E-15 5.04325900480939E+00 + cg2d: Sum(rhs),rhsMax = -8.65973959207622E-15 6.29008403763954E+00 + cg2d: Sum(rhs),rhsMax = 1.86517468137026E-14 6.70003306073569E+00 (PID.TID 0000.0001) Did not write pickup because writePickupAtEnd = FALSE (PID.TID 0000.0001) early fc = 0.000000000000000D+00 - --> objf_test(bi,bj) = 0.804687809227797D+06 -(PID.TID 0000.0001) local fc = 0.804687809227797D+06 -(PID.TID 0000.0001) global fc = 0.804687809227797D+06 -(PID.TID 0000.0001) grdchk perturb(+)fc: fcpertplus = 8.04687809227797E+05 + --> objf_test(bi,bj) = 0.221431048007422D+06 + --> objf_test(bi,bj) = 0.241096917459820D+06 + --> objf_test(bi,bj) = 0.137155804089996D+06 + --> objf_test(bi,bj) = 0.205004039670558D+06 +(PID.TID 0000.0001) local fc = 0.804687809227796D+06 +(PID.TID 0000.0001) global fc = 0.804687809227796D+06 +(PID.TID 0000.0001) grdchk perturb(+)fc: fcpertplus = 8.04687809227796E+05 (PID.TID 0000.0001) Start initial hydrostatic pressure computation (PID.TID 0000.0001) Pressure is predetermined for buoyancyRelation OCEANIC (PID.TID 0000.0001) @@ -2966,28 +3040,31 @@ grad-res ------------------------------- (PID.TID 0000.0001) EXTERNAL_FIELDS_LOAD, it= 0 : Reading new data, i0,i1= 12 1 (prev= 12 0 ) (PID.TID 0000.0001) SOLVE_FOR_PRESSURE: putPmEinXvector = F - cg2d: Sum(rhs),rhsMax = 1.05956909912663E-14 2.53674886388737E+00 - cg2d: Sum(rhs),rhsMax = -5.12784259498744E-15 5.04325900480939E+00 - cg2d: Sum(rhs),rhsMax = -1.84158244209698E-14 6.29008403763954E+00 - cg2d: Sum(rhs),rhsMax = 3.86739251734269E-14 6.70003306073569E+00 + cg2d: Sum(rhs),rhsMax = 1.15463194561016E-14 2.53674886388737E+00 + cg2d: Sum(rhs),rhsMax = 5.55111512312578E-16 5.04325900480939E+00 + cg2d: Sum(rhs),rhsMax = -2.10942374678780E-15 6.29008403763954E+00 + cg2d: Sum(rhs),rhsMax = 5.77315972805081E-15 6.70003306073569E+00 (PID.TID 0000.0001) Did not write pickup because writePickupAtEnd = FALSE (PID.TID 0000.0001) early fc = 0.000000000000000D+00 - --> objf_test(bi,bj) = 0.804687680473776D+06 -(PID.TID 0000.0001) local fc = 0.804687680473776D+06 -(PID.TID 0000.0001) global fc = 0.804687680473776D+06 -(PID.TID 0000.0001) grdchk perturb(-)fc: fcpertminus = 8.04687680473776E+05 + --> objf_test(bi,bj) = 0.221431048007422D+06 + --> objf_test(bi,bj) = 0.241096917459820D+06 + --> objf_test(bi,bj) = 0.137155804089990D+06 + --> objf_test(bi,bj) = 0.205003910916544D+06 +(PID.TID 0000.0001) local fc = 0.804687680473777D+06 +(PID.TID 0000.0001) global fc = 0.804687680473777D+06 +(PID.TID 0000.0001) grdchk perturb(-)fc: fcpertminus = 8.04687680473777E+05 grad-res ------------------------------- - grad-res 0 7 83 37 1 1 1 1 8.04687744759E+05 8.04687809228E+05 8.04687680474E+05 - grad-res 0 7 7 2235 0 1 1 1 6.43770134172E+00 6.43770104507E+00 4.60808404767E-08 -(PID.TID 0000.0001) ADM ref_cost_function = 8.04687744759401E+05 + grad-res 0 7 38 17 1 2 2 1 8.04687744759E+05 8.04687809228E+05 8.04687680474E+05 + grad-res 0 7 7 532 0 2 2 1 6.43770134172E+00 6.43770095776E+00 5.96433663569E-08 +(PID.TID 0000.0001) ADM ref_cost_function = 8.04687744759400E+05 (PID.TID 0000.0001) ADM adjoint_gradient = 6.43770134172453E+00 -(PID.TID 0000.0001) ADM finite-diff_grad = 6.43770104506984E+00 +(PID.TID 0000.0001) ADM finite-diff_grad = 6.43770095775835E+00 (PID.TID 0000.0001) ====== End of gradient-check number 7 (ierr= 0) ======= (PID.TID 0000.0001) ====== Starts gradient-check number 8 (=ichknum) ======= - ph-test icomp, ncvarcomp, ichknum 2236 29309 8 - ph-grd _loc: bi, bj, icomptest, ichknum 1 1 2235 8 - ph-grd -->hit<-- 84 37 1 1 -(PID.TID 0000.0001) grdchk pos: i,j,k= 84 37 1 ; bi,bj= 1 1 ; iobc= 1 ; rec= 1 + ph-test icomp, ncvarcomp, ichknum 533 29309 8 + ph-grd _loc: bi, bj, icomptest, ichknum 2 2 532 8 + ph-grd -->hit<-- 39 17 1 1 +(PID.TID 0000.0001) grdchk pos: i,j,k= 39 17 1 ; bi,bj= 2 2 ; iobc= 1 ; rec= 1 (PID.TID 0000.0001) Start initial hydrostatic pressure computation (PID.TID 0000.0001) Pressure is predetermined for buoyancyRelation OCEANIC (PID.TID 0000.0001) @@ -2997,16 +3074,19 @@ grad-res ------------------------------- (PID.TID 0000.0001) EXTERNAL_FIELDS_LOAD, it= 0 : Reading new data, i0,i1= 12 1 (prev= 12 0 ) (PID.TID 0000.0001) SOLVE_FOR_PRESSURE: putPmEinXvector = F - cg2d: Sum(rhs),rhsMax = 1.05956909912663E-14 2.53674886388737E+00 - cg2d: Sum(rhs),rhsMax = -6.99440505513849E-15 5.04325900480939E+00 - cg2d: Sum(rhs),rhsMax = -2.16007767228632E-14 6.29008403763954E+00 - cg2d: Sum(rhs),rhsMax = 4.40966707593304E-14 6.70003306073569E+00 + cg2d: Sum(rhs),rhsMax = 1.16573417585641E-14 2.53674886388737E+00 + cg2d: Sum(rhs),rhsMax = 3.55271367880050E-15 5.04325900480939E+00 + cg2d: Sum(rhs),rhsMax = -7.32747196252603E-15 6.29008403763954E+00 + cg2d: Sum(rhs),rhsMax = 2.08721928629529E-14 6.70003306073569E+00 (PID.TID 0000.0001) Did not write pickup because writePickupAtEnd = FALSE (PID.TID 0000.0001) early fc = 0.000000000000000D+00 - --> objf_test(bi,bj) = 0.804687811772716D+06 -(PID.TID 0000.0001) local fc = 0.804687811772716D+06 -(PID.TID 0000.0001) global fc = 0.804687811772716D+06 -(PID.TID 0000.0001) grdchk perturb(+)fc: fcpertplus = 8.04687811772716E+05 + --> objf_test(bi,bj) = 0.221431048007422D+06 + --> objf_test(bi,bj) = 0.241096917459820D+06 + --> objf_test(bi,bj) = 0.137155804090017D+06 + --> objf_test(bi,bj) = 0.205004042215454D+06 +(PID.TID 0000.0001) local fc = 0.804687811772713D+06 +(PID.TID 0000.0001) global fc = 0.804687811772713D+06 +(PID.TID 0000.0001) grdchk perturb(+)fc: fcpertplus = 8.04687811772713E+05 (PID.TID 0000.0001) Start initial hydrostatic pressure computation (PID.TID 0000.0001) Pressure is predetermined for buoyancyRelation OCEANIC (PID.TID 0000.0001) @@ -3016,22 +3096,25 @@ grad-res ------------------------------- (PID.TID 0000.0001) EXTERNAL_FIELDS_LOAD, it= 0 : Reading new data, i0,i1= 12 1 (prev= 12 0 ) (PID.TID 0000.0001) SOLVE_FOR_PRESSURE: putPmEinXvector = F - cg2d: Sum(rhs),rhsMax = 1.05401798400351E-14 2.53674886388737E+00 - cg2d: Sum(rhs),rhsMax = 6.86950496486816E-16 5.04325900480939E+00 - cg2d: Sum(rhs),rhsMax = -3.76157438530811E-14 6.29008403763954E+00 - cg2d: Sum(rhs),rhsMax = 9.44730405016969E-15 6.70003306073569E+00 + cg2d: Sum(rhs),rhsMax = 1.14352971536391E-14 2.53674886388737E+00 + cg2d: Sum(rhs),rhsMax = -1.88737914186277E-15 5.04325900480939E+00 + cg2d: Sum(rhs),rhsMax = -2.20934381900406E-14 6.29008403763954E+00 + cg2d: Sum(rhs),rhsMax = 2.62012633811537E-14 6.70003306073569E+00 (PID.TID 0000.0001) Did not write pickup because writePickupAtEnd = FALSE (PID.TID 0000.0001) early fc = 0.000000000000000D+00 - --> objf_test(bi,bj) = 0.804687677939074D+06 + --> objf_test(bi,bj) = 0.221431048007422D+06 + --> objf_test(bi,bj) = 0.241096917459820D+06 + --> objf_test(bi,bj) = 0.137155804089968D+06 + --> objf_test(bi,bj) = 0.205003908381863D+06 (PID.TID 0000.0001) local fc = 0.804687677939074D+06 (PID.TID 0000.0001) global fc = 0.804687677939074D+06 (PID.TID 0000.0001) grdchk perturb(-)fc: fcpertminus = 8.04687677939074E+05 grad-res ------------------------------- - grad-res 0 8 84 37 1 1 1 1 8.04687744759E+05 8.04687811773E+05 8.04687677939E+05 - grad-res 0 8 8 2236 0 1 1 1 6.69168724574E+00 6.69168205350E+00 7.75923695406E-07 -(PID.TID 0000.0001) ADM ref_cost_function = 8.04687744759401E+05 + grad-res 0 8 39 17 1 2 2 1 8.04687744759E+05 8.04687811773E+05 8.04687677939E+05 + grad-res 0 8 8 533 0 2 2 1 6.69168724574E+00 6.69168197201E+00 7.88101599425E-07 +(PID.TID 0000.0001) ADM ref_cost_function = 8.04687744759400E+05 (PID.TID 0000.0001) ADM adjoint_gradient = 6.69168724573576E+00 -(PID.TID 0000.0001) ADM finite-diff_grad = 6.69168205349706E+00 +(PID.TID 0000.0001) ADM finite-diff_grad = 6.69168197200634E+00 (PID.TID 0000.0001) ====== End of gradient-check number 8 (ierr= 0) ======= (PID.TID 0000.0001) (PID.TID 0000.0001) // ======================================================= @@ -3044,210 +3127,210 @@ grad-res ------------------------------- (PID.TID 0000.0001) grdchk output h.c: Id FC FC1 FC2 (PID.TID 0000.0001) grdchk output h.g: Id FC1-FC2/(2*EPS) ADJ GRAD(FC) 1-FDGRD/ADGRD (PID.TID 0000.0001) -(PID.TID 0000.0001) grdchk output (p): 1 71 37 1 1 1 0.000000000E+00 -1.000000000E-02 +(PID.TID 0000.0001) grdchk output (p): 1 26 17 1 2 2 0.000000000E+00 -1.000000000E-02 (PID.TID 0000.0001) grdchk output (c): 1 8.0468774475940E+05 8.0468776675048E+05 8.0468772295205E+05 -(PID.TID 0000.0001) grdchk output (g): 1 2.1899214305449E+00 2.1899215003448E+00 3.1873208294897E-08 +(PID.TID 0000.0001) grdchk output (g): 1 2.1899214363657E+00 2.1899215003448E+00 2.9215229013779E-08 (PID.TID 0000.0001) -(PID.TID 0000.0001) grdchk output (p): 2 75 37 1 1 1 0.000000000E+00 -1.000000000E-02 -(PID.TID 0000.0001) grdchk output (c): 2 8.0468774475940E+05 8.0468775424979E+05 8.0468773545147E+05 -(PID.TID 0000.0001) grdchk output (g): 2 9.3991560861468E-01 9.3991572287013E-01 1.2155924467017E-07 +(PID.TID 0000.0001) grdchk output (p): 2 30 17 1 2 2 0.000000000E+00 -1.000000000E-02 +(PID.TID 0000.0001) grdchk output (c): 2 8.0468774475940E+05 8.0468775424978E+05 8.0468773545147E+05 +(PID.TID 0000.0001) grdchk output (g): 2 9.3991559697315E-01 9.3991572287013E-01 1.3394496378716E-07 (PID.TID 0000.0001) -(PID.TID 0000.0001) grdchk output (p): 3 76 37 1 1 1 0.000000000E+00 -1.000000000E-02 +(PID.TID 0000.0001) grdchk output (p): 3 31 17 1 2 2 0.000000000E+00 -1.000000000E-02 (PID.TID 0000.0001) grdchk output (c): 3 8.0468774475940E+05 8.0468775022033E+05 8.0468773947854E+05 -(PID.TID 0000.0001) grdchk output (g): 3 5.3708950290456E-01 5.3708939704722E-01 -1.9709445009397E-07 +(PID.TID 0000.0001) grdchk output (g): 3 5.3708943887614E-01 5.3708939704722E-01 -7.7880726312429E-08 (PID.TID 0000.0001) -(PID.TID 0000.0001) grdchk output (p): 4 77 37 1 1 1 0.000000000E+00 -1.000000000E-02 +(PID.TID 0000.0001) grdchk output (p): 4 32 17 1 2 2 0.000000000E+00 -1.000000000E-02 (PID.TID 0000.0001) grdchk output (c): 4 8.0468774475940E+05 8.0468776687862E+05 8.0468772282786E+05 (PID.TID 0000.0001) grdchk output (g): 4 2.2025377198588E+00 2.2025390000849E+00 5.8125015467425E-07 (PID.TID 0000.0001) -(PID.TID 0000.0001) grdchk output (p): 5 81 37 1 1 1 0.000000000E+00 -1.000000000E-02 +(PID.TID 0000.0001) grdchk output (p): 5 36 17 1 2 2 0.000000000E+00 -1.000000000E-02 (PID.TID 0000.0001) grdchk output (c): 5 8.0468774475940E+05 8.0468781941859E+05 8.0468767028391E+05 -(PID.TID 0000.0001) grdchk output (g): 5 7.4567339557689E+00 7.4567343891508E+00 5.8119535628620E-08 +(PID.TID 0000.0001) grdchk output (g): 5 7.4567339324858E+00 7.4567343891508E+00 6.1241956728075E-08 (PID.TID 0000.0001) -(PID.TID 0000.0001) grdchk output (p): 6 82 37 1 1 1 0.000000000E+00 -1.000000000E-02 +(PID.TID 0000.0001) grdchk output (p): 6 37 17 1 2 2 0.000000000E+00 -1.000000000E-02 (PID.TID 0000.0001) grdchk output (c): 6 8.0468774475940E+05 8.0468780832718E+05 8.0468768137411E+05 -(PID.TID 0000.0001) grdchk output (g): 6 6.3476531417109E+00 6.3476535412861E+00 6.2948485202163E-08 +(PID.TID 0000.0001) grdchk output (g): 6 6.3476531766355E+00 6.3476535412861E+00 5.7446515544513E-08 (PID.TID 0000.0001) -(PID.TID 0000.0001) grdchk output (p): 7 83 37 1 1 1 0.000000000E+00 -1.000000000E-02 +(PID.TID 0000.0001) grdchk output (p): 7 38 17 1 2 2 0.000000000E+00 -1.000000000E-02 (PID.TID 0000.0001) grdchk output (c): 7 8.0468774475940E+05 8.0468780922780E+05 8.0468768047378E+05 -(PID.TID 0000.0001) grdchk output (g): 7 6.4377010450698E+00 6.4377013417245E+00 4.6080840476748E-08 +(PID.TID 0000.0001) grdchk output (g): 7 6.4377009577584E+00 6.4377013417245E+00 5.9643366356887E-08 (PID.TID 0000.0001) -(PID.TID 0000.0001) grdchk output (p): 8 84 37 1 1 1 0.000000000E+00 -1.000000000E-02 -(PID.TID 0000.0001) grdchk output (c): 8 8.0468774475940E+05 8.0468781177272E+05 8.0468767793907E+05 -(PID.TID 0000.0001) grdchk output (g): 8 6.6916820534971E+00 6.6916872457358E+00 7.7592369540636E-07 +(PID.TID 0000.0001) grdchk output (p): 8 39 17 1 2 2 0.000000000E+00 -1.000000000E-02 +(PID.TID 0000.0001) grdchk output (c): 8 8.0468774475940E+05 8.0468781177271E+05 8.0468767793907E+05 +(PID.TID 0000.0001) grdchk output (g): 8 6.6916819720063E+00 6.6916872457358E+00 7.8810159942488E-07 (PID.TID 0000.0001) -(PID.TID 0000.0001) grdchk summary : RMS of 8 ratios = 3.5426189695999E-07 +(PID.TID 0000.0001) grdchk summary : RMS of 8 ratios = 3.5256631900052E-07 (PID.TID 0000.0001) (PID.TID 0000.0001) // ======================================================= (PID.TID 0000.0001) // Gradient check results >>> END <<< (PID.TID 0000.0001) // ======================================================= (PID.TID 0000.0001) (PID.TID 0000.0001) Seconds in section "ALL [THE_MODEL_MAIN]": -(PID.TID 0000.0001) User time: 37.003911091946065 -(PID.TID 0000.0001) System time: 0.53127397503703833 -(PID.TID 0000.0001) Wall clock time: 38.041616916656494 +(PID.TID 0000.0001) User time: 43.911945343017578 +(PID.TID 0000.0001) System time: 0.69348901137709618 +(PID.TID 0000.0001) Wall clock time: 44.835633993148804 (PID.TID 0000.0001) No. starts: 1 (PID.TID 0000.0001) No. stops: 1 (PID.TID 0000.0001) Seconds in section "INITIALISE_FIXED [THE_MODEL_MAIN]": -(PID.TID 0000.0001) User time: 0.15002499800175428 -(PID.TID 0000.0001) System time: 1.2151000089943409E-002 -(PID.TID 0000.0001) Wall clock time: 0.17394995689392090 +(PID.TID 0000.0001) User time: 0.14376899600028992 +(PID.TID 0000.0001) System time: 2.9564999043941498E-002 +(PID.TID 0000.0001) Wall clock time: 0.18894100189208984 (PID.TID 0000.0001) No. starts: 1 (PID.TID 0000.0001) No. stops: 1 (PID.TID 0000.0001) Seconds in section "ADTHE_MAIN_LOOP [ADJOINT RUN]": -(PID.TID 0000.0001) User time: 10.561107322573662 -(PID.TID 0000.0001) System time: 0.36326000280678272 -(PID.TID 0000.0001) Wall clock time: 10.958024024963379 +(PID.TID 0000.0001) User time: 12.407413959503174 +(PID.TID 0000.0001) System time: 0.52767901495099068 +(PID.TID 0000.0001) Wall clock time: 12.993571043014526 (PID.TID 0000.0001) No. starts: 1 (PID.TID 0000.0001) No. stops: 1 (PID.TID 0000.0001) Seconds in section "FORWARD_STEP [MAIN_DO_LOOP]": -(PID.TID 0000.0001) User time: 28.378291726112366 -(PID.TID 0000.0001) System time: 0.11179803311824799 -(PID.TID 0000.0001) Wall clock time: 28.502158880233765 +(PID.TID 0000.0001) User time: 33.661907792091370 +(PID.TID 0000.0001) System time: 4.1002124547958374E-002 +(PID.TID 0000.0001) Wall clock time: 33.712129354476929 (PID.TID 0000.0001) No. starts: 72 (PID.TID 0000.0001) No. stops: 72 (PID.TID 0000.0001) Seconds in section "LOAD_FIELDS_DRIVER [FORWARD_STEP]": -(PID.TID 0000.0001) User time: 5.9135347604751587E-002 -(PID.TID 0000.0001) System time: 9.0201944112777710E-004 -(PID.TID 0000.0001) Wall clock time: 6.0041189193725586E-002 +(PID.TID 0000.0001) User time: 7.2740435600280762E-002 +(PID.TID 0000.0001) System time: 4.2580440640449524E-003 +(PID.TID 0000.0001) Wall clock time: 7.9813718795776367E-002 (PID.TID 0000.0001) No. starts: 72 (PID.TID 0000.0001) No. stops: 72 (PID.TID 0000.0001) Seconds in section "EXTERNAL_FLDS_LOAD [LOAD_FLDS_DRIVER]": -(PID.TID 0000.0001) User time: 6.1519294977188110E-002 -(PID.TID 0000.0001) System time: 9.0811401605606079E-004 -(PID.TID 0000.0001) Wall clock time: 6.2479734420776367E-002 +(PID.TID 0000.0001) User time: 7.6053559780120850E-002 +(PID.TID 0000.0001) System time: 4.3099820613861084E-003 +(PID.TID 0000.0001) Wall clock time: 8.3224534988403320E-002 (PID.TID 0000.0001) No. starts: 76 (PID.TID 0000.0001) No. stops: 76 (PID.TID 0000.0001) Seconds in section "CTRL_MAP_FORCING [FORWARD_STEP]": -(PID.TID 0000.0001) User time: 5.0428509712219238E-004 -(PID.TID 0000.0001) System time: 4.0158629417419434E-006 -(PID.TID 0000.0001) Wall clock time: 5.1116943359375000E-004 +(PID.TID 0000.0001) User time: 5.2776932716369629E-004 +(PID.TID 0000.0001) System time: 4.0233135223388672E-006 +(PID.TID 0000.0001) Wall clock time: 5.2881240844726562E-004 (PID.TID 0000.0001) No. starts: 72 (PID.TID 0000.0001) No. stops: 72 (PID.TID 0000.0001) Seconds in section "DO_ATMOSPHERIC_PHYS [FORWARD_STEP]": -(PID.TID 0000.0001) User time: 3.1183063983917236E-002 -(PID.TID 0000.0001) System time: 1.9704550504684448E-004 -(PID.TID 0000.0001) Wall clock time: 3.1437873840332031E-002 +(PID.TID 0000.0001) User time: 3.9596438407897949E-002 +(PID.TID 0000.0001) System time: 1.4790892601013184E-004 +(PID.TID 0000.0001) Wall clock time: 3.9784193038940430E-002 (PID.TID 0000.0001) No. starts: 72 (PID.TID 0000.0001) No. stops: 72 (PID.TID 0000.0001) Seconds in section "DO_OCEANIC_PHYS [FORWARD_STEP]": -(PID.TID 0000.0001) User time: 5.1130907237529755 -(PID.TID 0000.0001) System time: 2.3365952074527740E-002 -(PID.TID 0000.0001) Wall clock time: 5.1386158466339111 +(PID.TID 0000.0001) User time: 6.0355853438377380 +(PID.TID 0000.0001) System time: 7.8079178929328918E-003 +(PID.TID 0000.0001) Wall clock time: 6.0451853275299072 (PID.TID 0000.0001) No. starts: 72 (PID.TID 0000.0001) No. stops: 72 (PID.TID 0000.0001) Seconds in section "THERMODYNAMICS [FORWARD_STEP]": -(PID.TID 0000.0001) User time: 8.5578539669513702 -(PID.TID 0000.0001) System time: 2.7958966791629791E-002 -(PID.TID 0000.0001) Wall clock time: 8.5875375270843506 +(PID.TID 0000.0001) User time: 10.284612298011780 +(PID.TID 0000.0001) System time: 4.4980496168136597E-003 +(PID.TID 0000.0001) Wall clock time: 10.292185783386230 (PID.TID 0000.0001) No. starts: 72 (PID.TID 0000.0001) No. stops: 72 (PID.TID 0000.0001) Seconds in section "DYNAMICS [FORWARD_STEP]": -(PID.TID 0000.0001) User time: 10.338772237300873 -(PID.TID 0000.0001) System time: 3.5572022199630737E-002 -(PID.TID 0000.0001) Wall clock time: 10.381636857986450 +(PID.TID 0000.0001) User time: 12.503175795078278 +(PID.TID 0000.0001) System time: 2.0806491374969482E-004 +(PID.TID 0000.0001) Wall clock time: 12.505329847335815 (PID.TID 0000.0001) No. starts: 72 (PID.TID 0000.0001) No. stops: 72 (PID.TID 0000.0001) Seconds in section "SOLVE_FOR_PRESSURE [FORWARD_STEP]": -(PID.TID 0000.0001) User time: 2.4528727531433105 -(PID.TID 0000.0001) System time: 3.8501620292663574E-004 -(PID.TID 0000.0001) Wall clock time: 2.4546322822570801 +(PID.TID 0000.0001) User time: 2.6708123683929443 +(PID.TID 0000.0001) System time: 7.8229904174804688E-003 +(PID.TID 0000.0001) Wall clock time: 2.6787655353546143 (PID.TID 0000.0001) No. starts: 72 (PID.TID 0000.0001) No. stops: 72 (PID.TID 0000.0001) Seconds in section "MOM_CORRECTION_STEP [FORWARD_STEP]": -(PID.TID 0000.0001) User time: 0.31667226552963257 -(PID.TID 0000.0001) System time: 7.9929828643798828E-005 -(PID.TID 0000.0001) Wall clock time: 0.31683230400085449 +(PID.TID 0000.0001) User time: 0.37783670425415039 +(PID.TID 0000.0001) System time: 1.0398030281066895E-004 +(PID.TID 0000.0001) Wall clock time: 0.37804865837097168 (PID.TID 0000.0001) No. starts: 72 (PID.TID 0000.0001) No. stops: 72 (PID.TID 0000.0001) Seconds in section "INTEGR_CONTINUITY [FORWARD_STEP]": -(PID.TID 0000.0001) User time: 0.39952027797698975 -(PID.TID 0000.0001) System time: 1.7702579498291016E-004 -(PID.TID 0000.0001) Wall clock time: 0.39982724189758301 +(PID.TID 0000.0001) User time: 0.41253995895385742 +(PID.TID 0000.0001) System time: 1.0296702384948730E-004 +(PID.TID 0000.0001) Wall clock time: 0.41279411315917969 (PID.TID 0000.0001) No. starts: 72 (PID.TID 0000.0001) No. stops: 72 (PID.TID 0000.0001) Seconds in section "TRC_CORRECTION_STEP [FORWARD_STEP]": -(PID.TID 0000.0001) User time: 5.6976079940795898E-004 -(PID.TID 0000.0001) System time: 0.0000000000000000 -(PID.TID 0000.0001) Wall clock time: 5.7291984558105469E-004 +(PID.TID 0000.0001) User time: 5.4609775543212891E-004 +(PID.TID 0000.0001) System time: 1.0132789611816406E-006 +(PID.TID 0000.0001) Wall clock time: 5.4860115051269531E-004 (PID.TID 0000.0001) No. starts: 72 (PID.TID 0000.0001) No. stops: 72 (PID.TID 0000.0001) Seconds in section "BLOCKING_EXCHANGES [FORWARD_STEP]": -(PID.TID 0000.0001) User time: 0.16732597351074219 -(PID.TID 0000.0001) System time: 1.6987323760986328E-005 -(PID.TID 0000.0001) Wall clock time: 0.16744565963745117 +(PID.TID 0000.0001) User time: 0.31902301311492920 +(PID.TID 0000.0001) System time: 4.0024518966674805E-005 +(PID.TID 0000.0001) Wall clock time: 0.31918597221374512 (PID.TID 0000.0001) No. starts: 72 (PID.TID 0000.0001) No. stops: 72 (PID.TID 0000.0001) Seconds in section "MONITOR [FORWARD_STEP]": -(PID.TID 0000.0001) User time: 0.13143581151962280 +(PID.TID 0000.0001) User time: 9.7669839859008789E-002 (PID.TID 0000.0001) System time: 1.0132789611816406E-006 -(PID.TID 0000.0001) Wall clock time: 0.13145732879638672 +(PID.TID 0000.0001) Wall clock time: 9.7682237625122070E-002 (PID.TID 0000.0001) No. starts: 72 (PID.TID 0000.0001) No. stops: 72 (PID.TID 0000.0001) Seconds in section "COST_TILE [FORWARD_STEP]": -(PID.TID 0000.0001) User time: 0.77115815877914429 -(PID.TID 0000.0001) System time: 6.8992376327514648E-005 -(PID.TID 0000.0001) Wall clock time: 0.77130651473999023 +(PID.TID 0000.0001) User time: 0.80476701259613037 +(PID.TID 0000.0001) System time: 4.6074390411376953E-005 +(PID.TID 0000.0001) Wall clock time: 0.80495548248291016 (PID.TID 0000.0001) No. starts: 72 (PID.TID 0000.0001) No. stops: 72 (PID.TID 0000.0001) Seconds in section "DO_THE_MODEL_IO [FORWARD_STEP]": -(PID.TID 0000.0001) User time: 6.9725513458251953E-003 -(PID.TID 0000.0001) System time: 1.0994002223014832E-002 -(PID.TID 0000.0001) Wall clock time: 1.7975568771362305E-002 +(PID.TID 0000.0001) User time: 5.8510303497314453E-003 +(PID.TID 0000.0001) System time: 1.1805906891822815E-002 +(PID.TID 0000.0001) Wall clock time: 1.7639398574829102E-002 (PID.TID 0000.0001) No. starts: 72 (PID.TID 0000.0001) No. stops: 72 (PID.TID 0000.0001) Seconds in section "DO_WRITE_PICKUP [FORWARD_STEP]": -(PID.TID 0000.0001) User time: 2.0850598812103271E-002 -(PID.TID 0000.0001) System time: 1.2024007737636566E-002 -(PID.TID 0000.0001) Wall clock time: 3.2999038696289062E-002 +(PID.TID 0000.0001) User time: 2.6735544204711914E-002 +(PID.TID 0000.0001) System time: 4.0990114212036133E-003 +(PID.TID 0000.0001) Wall clock time: 3.0821561813354492E-002 (PID.TID 0000.0001) No. starts: 72 (PID.TID 0000.0001) No. stops: 72 (PID.TID 0000.0001) Seconds in section "I/O (WRITE) [ADJOINT LOOP]": -(PID.TID 0000.0001) User time: 2.1405220031738281E-002 -(PID.TID 0000.0001) System time: 1.5914976596832275E-002 -(PID.TID 0000.0001) Wall clock time: 3.7319183349609375E-002 +(PID.TID 0000.0001) User time: 2.7746200561523438E-002 +(PID.TID 0000.0001) System time: 1.9976019859313965E-002 +(PID.TID 0000.0001) Wall clock time: 4.7719240188598633E-002 (PID.TID 0000.0001) No. starts: 2 (PID.TID 0000.0001) No. stops: 2 (PID.TID 0000.0001) Seconds in section "CTRL_PACK [THE_MODEL_MAIN]": -(PID.TID 0000.0001) User time: 2.3563385009765625E-002 -(PID.TID 0000.0001) System time: 7.9860091209411621E-003 -(PID.TID 0000.0001) Wall clock time: 3.1551837921142578E-002 +(PID.TID 0000.0001) User time: 1.8358230590820312E-002 +(PID.TID 0000.0001) System time: 1.5913963317871094E-002 +(PID.TID 0000.0001) Wall clock time: 3.4286022186279297E-002 (PID.TID 0000.0001) No. starts: 1 (PID.TID 0000.0001) No. stops: 1 (PID.TID 0000.0001) Seconds in section "CTRL_PACK [THE_MODEL_MAIN]": -(PID.TID 0000.0001) User time: 2.7911186218261719E-002 -(PID.TID 0000.0001) System time: 0.0000000000000000 -(PID.TID 0000.0001) Wall clock time: 2.7950048446655273E-002 +(PID.TID 0000.0001) User time: 3.0762672424316406E-002 +(PID.TID 0000.0001) System time: 1.2999773025512695E-004 +(PID.TID 0000.0001) Wall clock time: 3.0894041061401367E-002 (PID.TID 0000.0001) No. starts: 1 (PID.TID 0000.0001) No. stops: 1 (PID.TID 0000.0001) Seconds in section "GRDCHK_MAIN [THE_MODEL_MAIN]": -(PID.TID 0000.0001) User time: 26.241214752197266 -(PID.TID 0000.0001) System time: 0.14785596728324890 -(PID.TID 0000.0001) Wall clock time: 26.850054979324341 +(PID.TID 0000.0001) User time: 31.311577796936035 +(PID.TID 0000.0001) System time: 0.12015402317047119 +(PID.TID 0000.0001) Wall clock time: 31.587852954864502 (PID.TID 0000.0001) No. starts: 1 (PID.TID 0000.0001) No. stops: 1 (PID.TID 0000.0001) Seconds in section "INITIALISE_VARIA [THE_MAIN_LOOP]": -(PID.TID 0000.0001) User time: 1.2023811340332031 -(PID.TID 0000.0001) System time: 6.3477963209152222E-002 -(PID.TID 0000.0001) Wall clock time: 1.2658860683441162 +(PID.TID 0000.0001) User time: 1.4056911468505859 +(PID.TID 0000.0001) System time: 7.5878918170928955E-002 +(PID.TID 0000.0001) Wall clock time: 1.5172121524810791 (PID.TID 0000.0001) No. starts: 16 (PID.TID 0000.0001) No. stops: 16 (PID.TID 0000.0001) Seconds in section "MAIN LOOP [THE_MAIN_LOOP]": -(PID.TID 0000.0001) User time: 24.878674507141113 -(PID.TID 0000.0001) System time: 7.2399020195007324E-002 -(PID.TID 0000.0001) Wall clock time: 24.961496829986572 +(PID.TID 0000.0001) User time: 29.749326705932617 +(PID.TID 0000.0001) System time: 1.2549102306365967E-002 +(PID.TID 0000.0001) Wall clock time: 29.766363859176636 (PID.TID 0000.0001) No. starts: 16 (PID.TID 0000.0001) No. stops: 16 (PID.TID 0000.0001) Seconds in section "MAIN_DO_LOOP [THE_MAIN_LOOP]": -(PID.TID 0000.0001) User time: 24.875835418701172 -(PID.TID 0000.0001) System time: 7.2388023138046265E-002 -(PID.TID 0000.0001) Wall clock time: 24.958631038665771 +(PID.TID 0000.0001) User time: 29.746103286743164 +(PID.TID 0000.0001) System time: 1.2538194656372070E-002 +(PID.TID 0000.0001) Wall clock time: 29.763121843338013 (PID.TID 0000.0001) No. starts: 64 (PID.TID 0000.0001) No. stops: 64 (PID.TID 0000.0001) Seconds in section "COST_FINAL [ADJOINT SPIN-DOWN]": -(PID.TID 0000.0001) User time: 1.3265609741210938E-003 -(PID.TID 0000.0001) System time: 1.9967555999755859E-006 -(PID.TID 0000.0001) Wall clock time: 1.3377666473388672E-003 +(PID.TID 0000.0001) User time: 1.7242431640625000E-003 +(PID.TID 0000.0001) System time: 3.9935111999511719E-006 +(PID.TID 0000.0001) Wall clock time: 1.7278194427490234E-003 (PID.TID 0000.0001) No. starts: 16 (PID.TID 0000.0001) No. stops: 16 (PID.TID 0000.0001) // ====================================================== @@ -3264,6 +3347,39 @@ grad-res ------------------------------- (PID.TID 0000.0001) // Min. Y spins = 1000000000 (PID.TID 0000.0001) // Total. Y spins = 0 (PID.TID 0000.0001) // Avg. Y spins = 0.00E+00 +(PID.TID 0000.0001) // o Tile number: 000002 +(PID.TID 0000.0001) // No. X exchanges = 0 +(PID.TID 0000.0001) // Max. X spins = 0 +(PID.TID 0000.0001) // Min. X spins = 1000000000 +(PID.TID 0000.0001) // Total. X spins = 0 +(PID.TID 0000.0001) // Avg. X spins = 0.00E+00 +(PID.TID 0000.0001) // No. Y exchanges = 0 +(PID.TID 0000.0001) // Max. Y spins = 0 +(PID.TID 0000.0001) // Min. Y spins = 1000000000 +(PID.TID 0000.0001) // Total. Y spins = 0 +(PID.TID 0000.0001) // Avg. Y spins = 0.00E+00 +(PID.TID 0000.0001) // o Tile number: 000003 +(PID.TID 0000.0001) // No. X exchanges = 0 +(PID.TID 0000.0001) // Max. X spins = 0 +(PID.TID 0000.0001) // Min. X spins = 1000000000 +(PID.TID 0000.0001) // Total. X spins = 0 +(PID.TID 0000.0001) // Avg. X spins = 0.00E+00 +(PID.TID 0000.0001) // No. Y exchanges = 0 +(PID.TID 0000.0001) // Max. Y spins = 0 +(PID.TID 0000.0001) // Min. Y spins = 1000000000 +(PID.TID 0000.0001) // Total. Y spins = 0 +(PID.TID 0000.0001) // Avg. Y spins = 0.00E+00 +(PID.TID 0000.0001) // o Tile number: 000004 +(PID.TID 0000.0001) // No. X exchanges = 0 +(PID.TID 0000.0001) // Max. X spins = 0 +(PID.TID 0000.0001) // Min. X spins = 1000000000 +(PID.TID 0000.0001) // Total. X spins = 0 +(PID.TID 0000.0001) // Avg. X spins = 0.00E+00 +(PID.TID 0000.0001) // No. Y exchanges = 0 +(PID.TID 0000.0001) // Max. Y spins = 0 +(PID.TID 0000.0001) // Min. Y spins = 1000000000 +(PID.TID 0000.0001) // Total. Y spins = 0 +(PID.TID 0000.0001) // Avg. Y spins = 0.00E+00 (PID.TID 0000.0001) // o Thread number: 000001 (PID.TID 0000.0001) // No. barriers = 20022 (PID.TID 0000.0001) // Max. barrier spins = 1 diff --git a/verification/global_oce_latlon/results/output_tlm.txt.gz b/verification/global_oce_latlon/results/output_tlm.txt.gz index c621fe9f34..f2bbd97f83 100644 Binary files a/verification/global_oce_latlon/results/output_tlm.txt.gz and b/verification/global_oce_latlon/results/output_tlm.txt.gz differ diff --git a/verification/global_ocean.90x40x15/code_ad/COST_OPTIONS.h b/verification/global_ocean.90x40x15/code_ad/COST_OPTIONS.h index 23cecef1a8..98d324a8fe 100644 --- a/verification/global_ocean.90x40x15/code_ad/COST_OPTIONS.h +++ b/verification/global_ocean.90x40x15/code_ad/COST_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef COST_OPTIONS_H +#define COST_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: COST_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef COST_OPTIONS_H -#define COST_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_COST #ifdef ECCO_CPPOPTIONS_H @@ -26,50 +26,24 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -C >>> Use the EGM-96 geoid error covariance. -#undef ALLOW_EGM96_ERROR_COV -#undef ALLOW_READ_EGM_DATA +#undef ALLOW_COST_STATE_FINAL +#undef ALLOW_COST_VECTOR + C >>> Cost function contributions -#undef ALLOW_HFLUX_COST_CONTRIBUTION -#undef ALLOW_SFLUX_COST_CONTRIBUTION -#undef ALLOW_USTRESS_COST_CONTRIBUTION -#undef ALLOW_VSTRESS_COST_CONTRIBUTION -#undef ALLOW_THETA_COST_CONTRIBUTION -#undef ALLOW_SALT_COST_CONTRIBUTION -#undef ALLOW_SST_COST_CONTRIBUTION -#undef ALLOW_SSS_COST_CONTRIBUTION -#undef ALLOW_SSH_COST_CONTRIBUTION -#undef ALLOW_CTDT_COST_CONTRIBUTION -#undef ALLOW_CTDS_COST_CONTRIBUTION -#undef ALLOW_COST_ATLANTIC #define ALLOW_COST_ATLANTIC_HEAT +#undef ALLOW_COST_ATLANTIC_HEAT_DOMASS #undef ALLOW_COST_TEST #undef ALLOW_COST_TSQUARED +#undef ALLOW_COST_DEPTH #undef ALLOW_COST_TRACER -C >>> ALLOW_GENCOST_CONTRIBUTION: interactive way to add basic 2D cost -C function terms. -C > In data.ecco, this requires the specification of data file (name, -C frequency, etc.), bar file name for corresp. model average, standard -C error file name, etc. -C > In addition, adding such cost terms requires editing ecco_cost.h to -C increase NGENCOST, and editing cost_gencost_customize.F to implement -C the actual model average (i.e. the bar file content). -#undef ALLOW_GENCOST_CONTRIBUTION -C >>> free form version of GENCOST: allows one to use otherwise defined -C elements (e.g. psbar and and topex data) while taking advantage of the -C cost function/namelist slots that can be made available using -C ALLOW_GENCOST_CONTRIBUTION. To this end ALLOW_GENCOST_CONTRIBUTION -C simply switches off tests that check whether all of the gencost -C elements (e.g. gencost_barfile and gencost_datafile) are specified -C in data.ecco. -C > While this option increases flexibility within the gencost framework, -C it implies more room for error, so it should be used cautiously, and -C with good knowledge of the rest of pkg/ecco. -C > It requires providing a specific cost function routine, and editing -C cost_gencost_all.F accordingly. -#undef ALLOW_GENCOST_FREEFORM +C List these options here: +#undef ALLOW_COST_TEMP +#undef ALLOW_COST_HFLUXM +#undef ALLOW_DIC_COST +#undef ALLOW_THSICE_COST_TEST +#undef ALLOW_COST_SHELFICE C ================================================================== #endif /* ndef ECCO_CPPOPTIONS_H */ diff --git a/verification/global_ocean.90x40x15/code_ad/CTRL_OPTIONS.h b/verification/global_ocean.90x40x15/code_ad/CTRL_OPTIONS.h index 2af96238d2..3a13713eb8 100644 --- a/verification/global_ocean.90x40x15/code_ad/CTRL_OPTIONS.h +++ b/verification/global_ocean.90x40x15/code_ad/CTRL_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef CTRL_OPTIONS_H +#define CTRL_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: CTRL_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef CTRL_OPTIONS_H -#define CTRL_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_CTRL #ifdef ECCO_CPPOPTIONS_H @@ -26,37 +26,89 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -#undef EXCLUDE_CTRL_PACK +C o I/O and pack settings +#undef CTRL_SET_PREC_32 +C This option is only relevant (for pack/unpack) with OBCS_CONTROL: #undef ALLOW_NONDIMENSIONAL_CONTROL_IO +#undef EXCLUDE_CTRL_PACK +#undef ALLOW_PACKUNPACK_METHOD2 +#undef CTRL_DO_PACK_UNPACK_ONLY +#undef CTRL_PACK_PRECISE +#undef CTRL_UNPACK_PRECISE +#undef CTRL_DELZNORM +#undef ALLOW_CTRL_WETV C >>> Other Control. -#define ALLOW_DIFFKR_CONTROL +C Allows for GMREDI controls #define ALLOW_KAPGM_CONTROL #define ALLOW_KAPREDI_CONTROL +C Allows for Vertical Diffusivity controls +#define ALLOW_DIFFKR_CONTROL #define ALLOW_BOTTOMDRAG_CONTROL +#undef ALLOW_DIC_CONTROL + +C Allows bathymetry as a control vector +C Note: keep this Option separated from generic control since this control +C involves many new dependencies that we would like to avoid in general. +#undef ALLOW_DEPTH_CONTROL +#ifdef ALLOW_DEPTH_CONTROL +C Only relevant within DEPTH_CONTROL code: +# define USE_SMOOTH_MIN +# undef ALLOW_HFACC_CONTROL +# undef ALLOW_HFACC3D_CONTROL +#endif /* ALLOW_DEPTH_CONTROL */ C >>> Generic Control. #define ALLOW_GENARR2D_CONTROL #define ALLOW_GENARR3D_CONTROL #define ALLOW_GENTIM2D_CONTROL +# undef ALLOW_UVEL0_CONTROL +# undef ALLOW_VVEL0_CONTROL +# undef CTRL_SET_OLD_MAXCVARS_30 +# undef CTRL_SET_OLD_MAXCVARS_40 + +C >>> Open boundaries +#ifdef ALLOW_OBCS +C Control of Open-Boundaries is meaningless without compiling pkg/obcs +C Note: Make sure that corresponding OBCS N/S/W/E Option is defined +# define ALLOW_OBCSN_CONTROL +# define ALLOW_OBCSS_CONTROL +# define ALLOW_OBCSW_CONTROL +# define ALLOW_OBCSE_CONTROL +# undef ALLOW_OBCS_CONTROL_MODES +#endif /* ALLOW_OBCS */ + +C o Set ALLOW_OBCS_CONTROL (Do not edit/modify): +#if (defined (ALLOW_OBCSN_CONTROL) || \ + defined (ALLOW_OBCSS_CONTROL) || \ + defined (ALLOW_OBCSW_CONTROL) || \ + defined (ALLOW_OBCSE_CONTROL)) +# define ALLOW_OBCS_CONTROL +#endif + +C o Impose bounds on controls +#undef ALLOW_ADCTRLBOUND C o Rotation of wind/stress controls adjustments C from Eastward/Northward to model grid directions #undef ALLOW_ROTATE_UV_CONTROLS -C o use pkg/smooth correlation operator (incl. smoother) for 2D controls (Weaver, Courtier 01) -C This CPP option just sets the default for ctrlSmoothCorrel2D to .TRUE. -#undef ALLOW_SMOOTH_CORREL2D -C o use pkg/smooth correlation operator (incl. smoother) for 3D controls (Weaver, Courtier 01) -C This CPP option just sets the default for ctrlSmoothCorrel3D to .TRUE. -#undef ALLOW_SMOOTH_CORREL3D +C o Originally the first two time-reccords of control +C variable tau u and tau v were skipped. +C The CTRL_SKIP_FIRST_TWO_ATM_REC_ALL option extends this +C to the other the time variable atmospheric controls. +#undef CTRL_SKIP_FIRST_TWO_ATM_REC_ALL -C o apply pkg/ctrl/ctrl_smooth.F to 2D controls (outside of ctrlSmoothCorrel2D) -#undef ALLOW_CTRL_SMOOTH -C o apply pkg/smooth/smooth_diff2d.F to 2D controls (outside of ctrlSmoothCorrel2D) +C Note: this flag turns on extra smoothing code in ctrl_get_gen.F which +C is inconsistent with the Weaver and Courtier, 2001 algorithm, and +C should probably not be used. The corresponding 3D flag applied only +C to deprecated code that is now removed. At some point we will remove +C this flag and associated code as well. +C o apply pkg/smooth/smooth_diff2d.F to 2D controls (outside of Smooth_Correl2D) #undef ALLOW_SMOOTH_CTRL2D -C o apply pkg/smooth/smooth_diff3d.F to 3D controls (outside of ctrlSmoothCorrel3D) -#undef ALLOW_SMOOTH_CTRL3D + +C o Print more debug info to STDOUT +#undef ALLOW_CTRL_DEBUG C ================================================================== #endif /* ndef ECCO_CPPOPTIONS_H */ diff --git a/verification/global_ocean.90x40x15/code_oad/AUTODIFF_OPTIONS.h b/verification/global_ocean.90x40x15/code_oad/AUTODIFF_OPTIONS.h index b69f4d1f96..320d430d84 100644 --- a/verification/global_ocean.90x40x15/code_oad/AUTODIFF_OPTIONS.h +++ b/verification/global_ocean.90x40x15/code_oad/AUTODIFF_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef AUTODIFF_OPTIONS_H +#define AUTODIFF_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: AUTODIFF_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef AUTODIFF_OPTIONS_H -#define AUTODIFF_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_AUTODIFF #ifdef ECCO_CPPOPTIONS_H @@ -26,10 +26,11 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -C o Include/exclude code in order to be able to automatically -C differentiate the MITgcmUV by using the Tangent Linear and -C Adjoint Model Compiler (TAMC). +C o Include/exclude code in order to automatically differentiate MITgcm code +C using TAF (Transformation of Algorithms in Fortran, http://www.FastOpt.de) +C or using TAMC (Tangent Linear & Adjoint Model Compiler, needs both defined): #undef ALLOW_AUTODIFF_TAMC +#undef AUTODIFF_TAMC_COMPATIBILITY C >>> Checkpointing as handled by TAMC #define ALLOW_TAMC_CHECKPOINTING @@ -40,19 +41,19 @@ C >>> and DYNVARS_DIAG adjoint state #undef ALLOW_AUTODIFF_MONITOR_DIAG C >>> DO 2-level checkpointing instead of 3-level -c#undef AUTODIFF_2_LEVEL_CHECKPOINT +#undef AUTODIFF_2_LEVEL_CHECKPOINT C extend to 4-level checkpointing -c#undef AUTODIFF_4_LEVEL_CHECKPOINT +#undef AUTODIFF_4_LEVEL_CHECKPOINT C o use divided adjoint to split adjoint computations #undef ALLOW_DIVIDED_ADJOINT -#undef ALLOW_PACKUNPACK_METHOD2 - C o This flag is incredibly useful as it reduces the number of C tape-files on the disc. Maybe it should even be the default. #undef ALLOW_AUTODIFF_WHTAPEIO +C and related to above: +#undef ALLOW_INIT_WHTAPEIO C o use standard MDSFINDUINTS instead of local pkg/autodiff version for C WHTAPEIO code I/O. @@ -67,12 +68,13 @@ C Might still be used for OBCS since WHTAPEIO does not support OBCS fields. #undef AUTODIFF_USE_STORE_RESTORE #undef AUTODIFF_USE_STORE_RESTORE_OBCS -C o write separate tape files for each ptracer (has no effect, to be removed) -#undef AUTODIFF_PTRACERS_SPLIT_FILES - C o allow using viscFacInAd to recompute viscosities in AD #undef AUTODIFF_ALLOW_VISCFACADJ +C o To remove part of MOM_CALC_VISC (better name would be: MOM_DISABLE_*) +#undef AUTODIFF_DISABLE_LEITH +#undef AUTODIFF_DISABLE_REYNOLDS_SCALE + C o for output of AD-variables (ALLOW_AUTODIFF_MONITOR), specific code (e.g., C in addummy_in_stepping.F) relies on adexch_uv_xy_rs and adexch_xy_rs S/R C which might not always be generated by TAF (e.g., when controls do not diff --git a/verification/global_ocean.90x40x15/code_oad/COST_OPTIONS.h b/verification/global_ocean.90x40x15/code_oad/COST_OPTIONS.h index 23cecef1a8..98d324a8fe 100644 --- a/verification/global_ocean.90x40x15/code_oad/COST_OPTIONS.h +++ b/verification/global_ocean.90x40x15/code_oad/COST_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef COST_OPTIONS_H +#define COST_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: COST_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef COST_OPTIONS_H -#define COST_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_COST #ifdef ECCO_CPPOPTIONS_H @@ -26,50 +26,24 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -C >>> Use the EGM-96 geoid error covariance. -#undef ALLOW_EGM96_ERROR_COV -#undef ALLOW_READ_EGM_DATA +#undef ALLOW_COST_STATE_FINAL +#undef ALLOW_COST_VECTOR + C >>> Cost function contributions -#undef ALLOW_HFLUX_COST_CONTRIBUTION -#undef ALLOW_SFLUX_COST_CONTRIBUTION -#undef ALLOW_USTRESS_COST_CONTRIBUTION -#undef ALLOW_VSTRESS_COST_CONTRIBUTION -#undef ALLOW_THETA_COST_CONTRIBUTION -#undef ALLOW_SALT_COST_CONTRIBUTION -#undef ALLOW_SST_COST_CONTRIBUTION -#undef ALLOW_SSS_COST_CONTRIBUTION -#undef ALLOW_SSH_COST_CONTRIBUTION -#undef ALLOW_CTDT_COST_CONTRIBUTION -#undef ALLOW_CTDS_COST_CONTRIBUTION -#undef ALLOW_COST_ATLANTIC #define ALLOW_COST_ATLANTIC_HEAT +#undef ALLOW_COST_ATLANTIC_HEAT_DOMASS #undef ALLOW_COST_TEST #undef ALLOW_COST_TSQUARED +#undef ALLOW_COST_DEPTH #undef ALLOW_COST_TRACER -C >>> ALLOW_GENCOST_CONTRIBUTION: interactive way to add basic 2D cost -C function terms. -C > In data.ecco, this requires the specification of data file (name, -C frequency, etc.), bar file name for corresp. model average, standard -C error file name, etc. -C > In addition, adding such cost terms requires editing ecco_cost.h to -C increase NGENCOST, and editing cost_gencost_customize.F to implement -C the actual model average (i.e. the bar file content). -#undef ALLOW_GENCOST_CONTRIBUTION -C >>> free form version of GENCOST: allows one to use otherwise defined -C elements (e.g. psbar and and topex data) while taking advantage of the -C cost function/namelist slots that can be made available using -C ALLOW_GENCOST_CONTRIBUTION. To this end ALLOW_GENCOST_CONTRIBUTION -C simply switches off tests that check whether all of the gencost -C elements (e.g. gencost_barfile and gencost_datafile) are specified -C in data.ecco. -C > While this option increases flexibility within the gencost framework, -C it implies more room for error, so it should be used cautiously, and -C with good knowledge of the rest of pkg/ecco. -C > It requires providing a specific cost function routine, and editing -C cost_gencost_all.F accordingly. -#undef ALLOW_GENCOST_FREEFORM +C List these options here: +#undef ALLOW_COST_TEMP +#undef ALLOW_COST_HFLUXM +#undef ALLOW_DIC_COST +#undef ALLOW_THSICE_COST_TEST +#undef ALLOW_COST_SHELFICE C ================================================================== #endif /* ndef ECCO_CPPOPTIONS_H */ diff --git a/verification/global_ocean.90x40x15/code_oad/CTRL_OPTIONS.h b/verification/global_ocean.90x40x15/code_oad/CTRL_OPTIONS.h index 3947784fd8..ef978d6407 100644 --- a/verification/global_ocean.90x40x15/code_oad/CTRL_OPTIONS.h +++ b/verification/global_ocean.90x40x15/code_oad/CTRL_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef CTRL_OPTIONS_H +#define CTRL_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: CTRL_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef CTRL_OPTIONS_H -#define CTRL_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_CTRL #ifdef ECCO_CPPOPTIONS_H @@ -26,37 +26,89 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -#undef EXCLUDE_CTRL_PACK +C o I/O and pack settings +#undef CTRL_SET_PREC_32 +C This option is only relevant (for pack/unpack) with OBCS_CONTROL: #undef ALLOW_NONDIMENSIONAL_CONTROL_IO +#undef EXCLUDE_CTRL_PACK +#undef ALLOW_PACKUNPACK_METHOD2 +#undef CTRL_DO_PACK_UNPACK_ONLY +#undef CTRL_PACK_PRECISE +#undef CTRL_UNPACK_PRECISE +#undef CTRL_DELZNORM +#undef ALLOW_CTRL_WETV C >>> Other Control. -#undef ALLOW_DIFFKR_CONTROL +C Allows for GMREDI controls #undef ALLOW_KAPGM_CONTROL #undef ALLOW_KAPREDI_CONTROL +C Allows for Vertical Diffusivity controls +#undef ALLOW_DIFFKR_CONTROL #undef ALLOW_BOTTOMDRAG_CONTROL +#undef ALLOW_DIC_CONTROL + +C Allows bathymetry as a control vector +C Note: keep this Option separated from generic control since this control +C involves many new dependencies that we would like to avoid in general. +#undef ALLOW_DEPTH_CONTROL +#ifdef ALLOW_DEPTH_CONTROL +C Only relevant within DEPTH_CONTROL code: +# define USE_SMOOTH_MIN +# undef ALLOW_HFACC_CONTROL +# undef ALLOW_HFACC3D_CONTROL +#endif /* ALLOW_DEPTH_CONTROL */ C >>> Generic Control. #define ALLOW_GENARR2D_CONTROL #define ALLOW_GENARR3D_CONTROL #undef ALLOW_GENTIM2D_CONTROL +# undef ALLOW_UVEL0_CONTROL +# undef ALLOW_VVEL0_CONTROL +# undef CTRL_SET_OLD_MAXCVARS_30 +# undef CTRL_SET_OLD_MAXCVARS_40 + +C >>> Open boundaries +#ifdef ALLOW_OBCS +C Control of Open-Boundaries is meaningless without compiling pkg/obcs +C Note: Make sure that corresponding OBCS N/S/W/E Option is defined +# define ALLOW_OBCSN_CONTROL +# define ALLOW_OBCSS_CONTROL +# define ALLOW_OBCSW_CONTROL +# define ALLOW_OBCSE_CONTROL +# undef ALLOW_OBCS_CONTROL_MODES +#endif /* ALLOW_OBCS */ + +C o Set ALLOW_OBCS_CONTROL (Do not edit/modify): +#if (defined (ALLOW_OBCSN_CONTROL) || \ + defined (ALLOW_OBCSS_CONTROL) || \ + defined (ALLOW_OBCSW_CONTROL) || \ + defined (ALLOW_OBCSE_CONTROL)) +# define ALLOW_OBCS_CONTROL +#endif + +C o Impose bounds on controls +#undef ALLOW_ADCTRLBOUND C o Rotation of wind/stress controls adjustments C from Eastward/Northward to model grid directions #undef ALLOW_ROTATE_UV_CONTROLS -C o use pkg/smooth correlation operator (incl. smoother) for 2D controls (Weaver, Courtier 01) -C This CPP option just sets the default for ctrlSmoothCorrel2D to .TRUE. -#undef ALLOW_SMOOTH_CORREL2D -C o use pkg/smooth correlation operator (incl. smoother) for 3D controls (Weaver, Courtier 01) -C This CPP option just sets the default for ctrlSmoothCorrel3D to .TRUE. -#undef ALLOW_SMOOTH_CORREL3D +C o Originally the first two time-reccords of control +C variable tau u and tau v were skipped. +C The CTRL_SKIP_FIRST_TWO_ATM_REC_ALL option extends this +C to the other the time variable atmospheric controls. +#undef CTRL_SKIP_FIRST_TWO_ATM_REC_ALL -C o apply pkg/ctrl/ctrl_smooth.F to 2D controls (outside of ctrlSmoothCorrel2D) -#undef ALLOW_CTRL_SMOOTH -C o apply pkg/smooth/smooth_diff2d.F to 2D controls (outside of ctrlSmoothCorrel2D) +C Note: this flag turns on extra smoothing code in ctrl_get_gen.F which +C is inconsistent with the Weaver and Courtier, 2001 algorithm, and +C should probably not be used. The corresponding 3D flag applied only +C to deprecated code that is now removed. At some point we will remove +C this flag and associated code as well. +C o apply pkg/smooth/smooth_diff2d.F to 2D controls (outside of Smooth_Correl2D) #undef ALLOW_SMOOTH_CTRL2D -C o apply pkg/smooth/smooth_diff3d.F to 3D controls (outside of ctrlSmoothCorrel3D) -#undef ALLOW_SMOOTH_CTRL3D + +C o Print more debug info to STDOUT +#undef ALLOW_CTRL_DEBUG C ================================================================== #endif /* ndef ECCO_CPPOPTIONS_H */ diff --git a/verification/global_ocean.cs32x15/code/SEAICE_OPTIONS.h b/verification/global_ocean.cs32x15/code/SEAICE_OPTIONS.h index 25d7cc5b31..6e9eed5559 100644 --- a/verification/global_ocean.cs32x15/code/SEAICE_OPTIONS.h +++ b/verification/global_ocean.cs32x15/code/SEAICE_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef SEAICE_OPTIONS_H +#define SEAICE_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + C *==========================================================* C | SEAICE_OPTIONS.h C | o CPP options file for sea ice package. @@ -6,24 +11,12 @@ C | Use this file for selecting options within the sea ice C | package. C *==========================================================* -#ifndef SEAICE_OPTIONS_H -#define SEAICE_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_SEAICE -C Package-specific Options & Macros go here +C--- Package-specific Options & Macros go here C-- Write "text-plots" of certain fields in STDOUT for debugging. #undef SEAICE_DEBUG -C-- Allow sea-ice dynamic code. -C This option is provided to allow use of TAMC -C on the thermodynamics component of the code only. -C Sea-ice dynamics can also be turned off at runtime -C using variable SEAICEuseDYNAMICS. -#define SEAICE_ALLOW_DYNAMICS - C-- By default, the sea-ice package uses its own integrated bulk C formulae to compute fluxes (fu, fv, EmPmR, Qnet, and Qsw) over C open-ocean. When this flag is set, these variables are computed @@ -55,66 +48,116 @@ C seaice with a fraction (=SEAICE_saltFrac) of freezing seawater salinity. C- Note: SItracer also offers an alternative way to handle variable salinity. #undef SEAICE_VARIABLE_SALINITY -C-- Tracers of ice and/or ice cover. -#undef ALLOW_SITRACER -#ifdef ALLOW_SITRACER -C-- To try avoid 'spontaneous generation' of tracer maxima by advdiff. -# define ALLOW_SITRACER_ADVCAP -#endif - -C-- Enable grease ice parameterization -C The grease ice parameterization delays formation of solid -C sea ice from frazil ice by a time constant and provides a -C dynamic calculation of the initial solid sea ice thickness -C HO as a function of winds, currents and available grease ice -C volume. Grease ice does not significantly reduce heat loss -C from the ocean in winter and area covered by grease is thus -C handled like open water. -C (For details see Smedsrud and Martin, 2014, Ann.Glac.) +C-- Enable grease ice parameterization (requires to define ALLOW_SITRACER): +C The grease ice parameterization delays formation of solid sea ice from +C frazil ice by a time constant and provides a dynamic calculation of the +C initial solid sea ice thickness HO as a function of winds, currents and +C available grease ice volume. Grease ice does not significantly reduce heat +C loss from the ocean in winter and area covered by grease is thus handled +C like open water (For details see Smedsrud and Martin, 2014, Ann.Glac.). C Set SItrName(1) = 'grease' in namelist SEAICE_PARM03 in data.seaice C then output SItr01 is SItrNameLong(1) = 'grease ice volume fraction', -C with SItrUnit(1) = '[0-1]', which needs to be multiplied by SIheff -C to yield grease ice volume. Additionally, the actual grease ice -C layer thickness (diagnostic SIgrsLT) can be saved. +C with SItrUnit(1) = '[0-1]', which needs to be multiplied by SIheff to +C yield grease ice volume. Additionally, the actual grease ice layer +C thickness (diagnostic SIgrsLT) can be saved. #undef SEAICE_GREASE -C-- grease ice uses SItracer: + +C-- Tracers of ice and/or ice cover. #ifdef SEAICE_GREASE +C SEAICE_GREASE code requires to define ALLOW_SITRACER # define ALLOW_SITRACER -# define ALLOW_SITRACER_ADVCAP +#else +# undef ALLOW_SITRACER #endif +#ifdef ALLOW_SITRACER +C- To try avoid 'spontaneous generation' of tracer maxima by advdiff. +# define ALLOW_SITRACER_ADVCAP + +C- Include code to diagnose sea ice tracer budgets in +C seaice_advdiff.F and seaice_tracer_phys.F. Diagnostics are +C computed the "call diagnostics_fill" statement is commented out. +# undef ALLOW_SITRACER_DEBUG_DIAG +#endif /* ALLOW_SITRACER */ + +C-- Allow sea-ice dynamic code. These options are provided so that, +C if turned off (#undef), to compile (and process with TAF) only the +C the thermodynamics component of the code. Note that, if needed, +C sea-ice dynamics can be turned off at runtime (SEAICEuseDYNAMICS=F). C-- Historically, the seaice model was discretized on a B-Grid. This -C discretization should still work but it is not longer actively tested -C and supported. The following flag should always be set in order to use -C the operational C-grid discretization. +C discretization should still work but it is not longer actively +C tested and supported. Define this flag to compile it. It cannot be +C defined together with SEAICE_CGRID +#undef SEAICE_BGRID_DYNAMICS + +C-- The following flag should always be set in order to use C the +C-- operational C-grid discretization. #define SEAICE_CGRID -C-- Only for the C-grid version it is possible to #ifdef SEAICE_CGRID +C-- Options for the C-grid version only: + C enable advection of sea ice momentum # undef SEAICE_ALLOW_MOM_ADVECTION + C enable JFNK code by defining the following flag # define SEAICE_ALLOW_JFNK + C enable Krylov code by defining the following flag # define SEAICE_ALLOW_KRYLOV + +C-- Use a different order when mapping 2D velocity arrays to 1D vector +C before passing it to FGMRES. +# undef SEAICE_JFNK_MAP_REORDER + +C to reproduce old verification results for JFNK +# undef SEAICE_PRECOND_EXTRA_EXCHANGE + C enable LSR to use global (multi-tile) tri-diagonal solver # undef SEAICE_GLOBAL_3DIAG_SOLVER + C enable EVP code by defining the following flag # undef SEAICE_ALLOW_EVP # ifdef SEAICE_ALLOW_EVP -C-- When set use SEAICE_zetaMin and SEAICE_evpDampC to limit viscosities +C- When set use SEAICE_zetaMin and SEAICE_evpDampC to limit viscosities C from below and above in seaice_evp: not necessary, and not recommended # undef SEAICE_ALLOW_CLIPZETA + +C Include code to avoid underflows in EVP-code (copied from CICE). +C Many compilers can handle this more efficiently with the help of a flag. +# undef SEAICE_EVP_ELIMINATE_UNDERFLOWS + +C Include code to print residual of EVP iteration for debugging/diagnostics +# undef ALLOW_SEAICE_EVP_RESIDUAL # endif /* SEAICE_ALLOW_EVP */ + C smooth regularization (without max-function) of delta for C better differentiability # undef SEAICE_DELTA_SMOOTHREG + C regularize zeta to zmax with a smooth tanh-function instead C of a min(zeta,zmax). This improves convergence of iterative C solvers (Lemieux and Tremblay 2009, JGR). No effect on EVP # undef SEAICE_ZETA_SMOOTHREG + +C-- Different yield curves within the VP rheology framework C allow the truncated ellipse rheology (runtime flag SEAICEuseTEM) # undef SEAICE_ALLOW_TEM + +C allow the use of the Mohr Coulomb rheology (runtime flag SEAICEuseMCS) +C as defined in (Ip 1991) /!\ This is known to give unstable results, +C use with caution +# undef SEAICE_ALLOW_MCS + +C allow the use of Mohr Coulomb with elliptical plastic potential +C (runtime flag SEAICEuseMCE) +# undef SEAICE_ALLOW_MCE + +C allow the teardrop and parabolic lens rheology +C (runtime flag SEAICEuseTD and SEAICEusePL) +# undef SEAICE_ALLOW_TEARDROP + +C-- LSR solver settings C Use LSR vector code; not useful on non-vector machines, because it C slows down convergence considerably, but the extra iterations are C more than made up by the much faster code on vector machines. For @@ -122,54 +165,108 @@ C the only regularly test vector machine these flags a specified C in the build options file SUPER-UX_SX-8_sxf90_awi, so that we comment C them out here. # undef SEAICE_VECTORIZE_LSR + C Use zebra-method (alternate lines) for line-successive-relaxation C This modification improves the convergence of the vector code C dramatically, so that is may actually be useful in general, but C that needs to be tested. Can be used without vectorization options. # undef SEAICE_LSR_ZEBRA + +C Include code to print residual of nonlinear outer loop of LSR +# undef SEAICE_ALLOW_CHECK_LSR_CONVERGENCE + +C This flag is also required for an actual adjoint of seaice_lsr; +C increases memory requirements a lot. +# undef SEAICE_LSR_ADJOINT_ITER + C Use parameterisation of grounding ice for a better representation C of fastice in shallow seas # undef SEAICE_ALLOW_BOTTOMDRAG -#else /* not SEAICE_CGRID, but old B-grid */ -C-- By default for B-grid dynamics solver wind stress under sea-ice is + +#endif /* SEAICE_CGRID */ + +#ifdef SEAICE_BGRID_DYNAMICS +C-- Options for the B-grid version only: + +C- By default for B-grid dynamics solver wind stress under sea-ice is C set to the same value as it would be if there was no sea-ice. C Define following CPP flag for B-grid ice-ocean stress coupling. # define SEAICE_BICE_STRESS -C-- By default for B-grid dynamics solver surface tilt is obtained +C- By default for B-grid dynamics solver surface tilt is obtained C indirectly via geostrophic velocities. Define following CPP C in order to use ETAN instead. # define EXPLICIT_SSH_SLOPE -C-- Defining this flag turns on FV-discretization of the B-grid LSOR solver. + +C- Defining this flag turns on FV-discretization of the B-grid LSOR solver. C It is smoother and includes all metric terms, similar to C-grid solvers. C It is here for completeness, but its usefulness is unclear. # undef SEAICE_LSRBNEW -#endif /* SEAICE_CGRID */ -C-- When set limit the Ice-Loading to mass of 1/5 of Surface ocean grid-box +#endif /* SEAICE_BGRID_DYNAMICS */ + +C-- Some regularisations +C- When set limit the Ice-Loading to mass of 1/5 of Surface ocean grid-box #undef SEAICE_CAP_ICELOAD -C-- When set use SEAICE_clipVelocties = .true., to clip U/VICE at 40cm/s, + +C- When set use SEAICE_clipVelocties = .true., to clip U/VICE at 40cm/s, C not recommended #define SEAICE_ALLOW_CLIPVELS -C-- When set cap the sublimation latent heat flux in solve4temp according + +C- When set cap the sublimation latent heat flux in solve4temp according C to the available amount of ice+snow. Otherwise this term is treated C like all of the others -- residuals heat and fw stocks are passed to C the ocean at the end of seaice_growth in a conservative manner. C SEAICE_CAP_SUBLIM is not needed as of now, but kept just in case. #undef SEAICE_CAP_SUBLIM +C-- AD flags +C- TAF related flag, currently only used in seaice_ad_check_lev[1-4]_dir.h; +C it is unclear if this is ever needed. +#undef AUTODIFF_SOMETIMES_NEEDED + +C- Reset fields to zero to stabilise AD code of dynamics solver +C (resulting in wrong gradients) +#undef SEAICE_DYN_STABLE_ADJOINT + +C- Another flag to simplify dependencies for TAF-generated AD-code +C the thermodynamic part, mostly by resetting variables to zero +#undef SEAICE_MODIFY_GROWTH_ADJ + +C- Special seaice flag for AD testing +#undef SEAICE_EXCLUDE_FOR_EXACT_AD_TESTING + +C-- Use the adjointable sea-ice thermodynamic model +C in seaice_growth_adx.F instead of seaice_growth.F +C This options excludes more complex physics such +C as sublimation, ITD, and frazil. +#undef SEAICE_USE_GROWTH_ADX + +C-- These flags are not strictly AD-related but may help obtaining +C simpler AD-code: +C- Do not compile code that resets AREA (or AREAITD) to a mininum value +C of SEAICE_area_floor (=SIeps with default of 1e-5) if there is +C some finite sea ice thickness +#undef DISABLE_AREA_FLOOR + +C- Do not compile growth/thermodynamics code (avoiding this code can +C also be done by setting runtime parameter usePWthermodynamics=F) +#undef DISABLE_SEAICE_GROWTH + +C- Do not compile/use seaice-related obcs code when using obcs. +#undef DISABLE_SEAICE_OBCS + C-- Enable free drift code #undef SEAICE_ALLOW_FREEDRIFT C-- pkg/seaice cost functions compile flags -c >>> Sea-ice volume (requires pkg/cost) +C- Sea-ice volume (requires pkg/cost) #undef ALLOW_COST_ICE -c >>> Sea-ice misfit to obs (requires pkg/cost and ecco) -#undef ALLOW_SEAICE_COST_SMR_AREA +#ifdef ALLOW_COST_ICE +C- Enable template for sea-ice volume export in seaice_cost_export.F +C (requires pkg/cost & ALLOW_COST_ICE defined) +# undef ALLOW_SEAICE_COST_EXPORT +#endif /* ALLOW_COST_ICE */ #endif /* ALLOW_SEAICE */ #endif /* SEAICE_OPTIONS_H */ - -CEH3 ;;; Local Variables: *** -CEH3 ;;; mode:fortran *** -CEH3 ;;; End: *** diff --git a/verification/global_ocean.cs32x15/code_ad/AUTODIFF_OPTIONS.h b/verification/global_ocean.cs32x15/code_ad/AUTODIFF_OPTIONS.h index 6df90eadad..da6daa64b4 100644 --- a/verification/global_ocean.cs32x15/code_ad/AUTODIFF_OPTIONS.h +++ b/verification/global_ocean.cs32x15/code_ad/AUTODIFF_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef AUTODIFF_OPTIONS_H +#define AUTODIFF_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: AUTODIFF_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef AUTODIFF_OPTIONS_H -#define AUTODIFF_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_AUTODIFF #ifdef ECCO_CPPOPTIONS_H @@ -26,13 +26,11 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -C let autodiff_init_varia reset variables to 0 to reproduce old bug -#undef ALLOW_AUTODIFF_INIT_OLD - -C o Include/exclude code in order to be able to automatically -C differentiate the MITgcmUV by using the Tangent Linear and -C Adjoint Model Compiler (TAMC). +C o Include/exclude code in order to automatically differentiate MITgcm code +C using TAF (Transformation of Algorithms in Fortran, http://www.FastOpt.de) +C or using TAMC (Tangent Linear & Adjoint Model Compiler, needs both defined): #define ALLOW_AUTODIFF_TAMC +#undef AUTODIFF_TAMC_COMPATIBILITY C >>> Checkpointing as handled by TAMC #define ALLOW_TAMC_CHECKPOINTING @@ -43,19 +41,19 @@ C >>> and DYNVARS_DIAG adjoint state #undef ALLOW_AUTODIFF_MONITOR_DIAG C >>> DO 2-level checkpointing instead of 3-level -c#undef AUTODIFF_2_LEVEL_CHECKPOINT +#undef AUTODIFF_2_LEVEL_CHECKPOINT C extend to 4-level checkpointing -c#undef AUTODIFF_4_LEVEL_CHECKPOINT +#undef AUTODIFF_4_LEVEL_CHECKPOINT C o use divided adjoint to split adjoint computations #undef ALLOW_DIVIDED_ADJOINT -#define ALLOW_PACKUNPACK_METHOD2 - C o This flag is incredibly useful as it reduces the number of C tape-files on the disc. Maybe it should even be the default. #define ALLOW_AUTODIFF_WHTAPEIO +C and related to above: +#undef ALLOW_INIT_WHTAPEIO C o use standard MDSFINDUINTS instead of local pkg/autodiff version for C WHTAPEIO code I/O. @@ -73,6 +71,10 @@ C Might still be used for OBCS since WHTAPEIO does not support OBCS fields. C o allow using viscFacInAd to recompute viscosities in AD #undef AUTODIFF_ALLOW_VISCFACADJ +C o To remove part of MOM_CALC_VISC (better name would be: MOM_DISABLE_*) +#undef AUTODIFF_DISABLE_LEITH +#undef AUTODIFF_DISABLE_REYNOLDS_SCALE + C o for output of AD-variables (ALLOW_AUTODIFF_MONITOR), specific code (e.g., C in addummy_in_stepping.F) relies on adexch_uv_xy_rs and adexch_xy_rs S/R C which might not always be generated by TAF (e.g., when controls do not diff --git a/verification/global_ocean.cs32x15/code_ad/COST_OPTIONS.h b/verification/global_ocean.cs32x15/code_ad/COST_OPTIONS.h index 41c6475da2..64a1943d48 100644 --- a/verification/global_ocean.cs32x15/code_ad/COST_OPTIONS.h +++ b/verification/global_ocean.cs32x15/code_ad/COST_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef COST_OPTIONS_H +#define COST_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: COST_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef COST_OPTIONS_H -#define COST_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_COST #ifdef ECCO_CPPOPTIONS_H @@ -26,50 +26,24 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -C >>> Use the EGM-96 geoid error covariance. -#undef ALLOW_EGM96_ERROR_COV -#undef ALLOW_READ_EGM_DATA +#undef ALLOW_COST_STATE_FINAL +#undef ALLOW_COST_VECTOR + C >>> Cost function contributions -#undef ALLOW_HFLUX_COST_CONTRIBUTION -#undef ALLOW_SFLUX_COST_CONTRIBUTION -#undef ALLOW_USTRESS_COST_CONTRIBUTION -#undef ALLOW_VSTRESS_COST_CONTRIBUTION -#undef ALLOW_THETA_COST_CONTRIBUTION -#undef ALLOW_SALT_COST_CONTRIBUTION -#undef ALLOW_SST_COST_CONTRIBUTION -#undef ALLOW_SSS_COST_CONTRIBUTION -#undef ALLOW_SSH_COST_CONTRIBUTION -#undef ALLOW_CTDT_COST_CONTRIBUTION -#undef ALLOW_CTDS_COST_CONTRIBUTION -#undef ALLOW_COST_ATLANTIC #undef ALLOW_COST_ATLANTIC_HEAT +#undef ALLOW_COST_ATLANTIC_HEAT_DOMASS #define ALLOW_COST_TEST #define ALLOW_COST_TSQUARED +#undef ALLOW_COST_DEPTH #undef ALLOW_COST_TRACER -C >>> ALLOW_GENCOST_CONTRIBUTION: interactive way to add basic 2D cost -C function terms. -C > In data.ecco, this requires the specification of data file (name, -C frequency, etc.), bar file name for corresp. model average, standard -C error file name, etc. -C > In addition, adding such cost terms requires editing ecco_cost.h to -C increase NGENCOST, and editing cost_gencost_customize.F to implement -C the actual model average (i.e. the bar file content). -#undef ALLOW_GENCOST_CONTRIBUTION -C >>> free form version of GENCOST: allows one to use otherwise defined -C elements (e.g. psbar and and topex data) while taking advantage of the -C cost function/namelist slots that can be made available using -C ALLOW_GENCOST_CONTRIBUTION. To this end ALLOW_GENCOST_CONTRIBUTION -C simply switches off tests that check whether all of the gencost -C elements (e.g. gencost_barfile and gencost_datafile) are specified -C in data.ecco. -C > While this option increases flexibility within the gencost framework, -C it implies more room for error, so it should be used cautiously, and -C with good knowledge of the rest of pkg/ecco. -C > It requires providing a specific cost function routine, and editing -C cost_gencost_all.F accordingly. -#undef ALLOW_GENCOST_FREEFORM +C List these options here: +#undef ALLOW_COST_TEMP +#undef ALLOW_COST_HFLUXM +#undef ALLOW_DIC_COST +#undef ALLOW_THSICE_COST_TEST +#undef ALLOW_COST_SHELFICE C ================================================================== #endif /* ndef ECCO_CPPOPTIONS_H */ diff --git a/verification/global_ocean.cs32x15/code_ad/CTRL_OPTIONS.h b/verification/global_ocean.cs32x15/code_ad/CTRL_OPTIONS.h index 25037dcf8f..f962f36402 100644 --- a/verification/global_ocean.cs32x15/code_ad/CTRL_OPTIONS.h +++ b/verification/global_ocean.cs32x15/code_ad/CTRL_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef CTRL_OPTIONS_H +#define CTRL_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: CTRL_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef CTRL_OPTIONS_H -#define CTRL_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_CTRL #ifdef ECCO_CPPOPTIONS_H @@ -26,23 +26,68 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -#undef EXCLUDE_CTRL_PACK +C o I/O and pack settings +#undef CTRL_SET_PREC_32 +C This option is only relevant (for pack/unpack) with OBCS_CONTROL: #undef ALLOW_NONDIMENSIONAL_CONTROL_IO +#undef EXCLUDE_CTRL_PACK +#undef ALLOW_PACKUNPACK_METHOD2 +#undef CTRL_DO_PACK_UNPACK_ONLY +#undef CTRL_PACK_PRECISE +#undef CTRL_UNPACK_PRECISE +#undef CTRL_DELZNORM +#undef ALLOW_CTRL_WETV C >>> Other Control. -#define ALLOW_DIFFKR_CONTROL +C Allows for GMREDI controls #undef ALLOW_KAPGM_CONTROL #undef ALLOW_KAPREDI_CONTROL +C Allows for Vertical Diffusivity controls +#define ALLOW_DIFFKR_CONTROL #undef ALLOW_BOTTOMDRAG_CONTROL +#undef ALLOW_DIC_CONTROL -C >>> Backward compatibility option (before checkpoint 65p) -#undef ALLOW_KAPGM_CONTROL_OLD -#undef ALLOW_KAPREDI_CONTROL_OLD +C Allows bathymetry as a control vector +C Note: keep this Option separated from generic control since this control +C involves many new dependencies that we would like to avoid in general. +#undef ALLOW_DEPTH_CONTROL +#ifdef ALLOW_DEPTH_CONTROL +C Only relevant within DEPTH_CONTROL code: +# define USE_SMOOTH_MIN +# undef ALLOW_HFACC_CONTROL +# undef ALLOW_HFACC3D_CONTROL +#endif /* ALLOW_DEPTH_CONTROL */ C >>> Generic Control. #define ALLOW_GENARR2D_CONTROL #define ALLOW_GENARR3D_CONTROL #define ALLOW_GENTIM2D_CONTROL +# undef ALLOW_UVEL0_CONTROL +# undef ALLOW_VVEL0_CONTROL +# undef CTRL_SET_OLD_MAXCVARS_30 +# undef CTRL_SET_OLD_MAXCVARS_40 + +C >>> Open boundaries +#ifdef ALLOW_OBCS +C Control of Open-Boundaries is meaningless without compiling pkg/obcs +C Note: Make sure that corresponding OBCS N/S/W/E Option is defined +# define ALLOW_OBCSN_CONTROL +# define ALLOW_OBCSS_CONTROL +# define ALLOW_OBCSW_CONTROL +# define ALLOW_OBCSE_CONTROL +# undef ALLOW_OBCS_CONTROL_MODES +#endif /* ALLOW_OBCS */ + +C o Set ALLOW_OBCS_CONTROL (Do not edit/modify): +#if (defined (ALLOW_OBCSN_CONTROL) || \ + defined (ALLOW_OBCSS_CONTROL) || \ + defined (ALLOW_OBCSW_CONTROL) || \ + defined (ALLOW_OBCSE_CONTROL)) +# define ALLOW_OBCS_CONTROL +#endif + +C o Impose bounds on controls +#undef ALLOW_ADCTRLBOUND C o Rotation of wind/stress controls adjustments C from Eastward/Northward to model grid directions @@ -54,19 +99,16 @@ C The CTRL_SKIP_FIRST_TWO_ATM_REC_ALL option extends this C to the other the time variable atmospheric controls. #undef CTRL_SKIP_FIRST_TWO_ATM_REC_ALL -C o use pkg/smooth correlation operator (incl. smoother) for 2D controls (Weaver, Courtier 01) -C This CPP option just sets the default for ctrlSmoothCorrel2D to .TRUE. -#undef ALLOW_SMOOTH_CORREL2D -C o use pkg/smooth correlation operator (incl. smoother) for 3D controls (Weaver, Courtier 01) -C This CPP option just sets the default for ctrlSmoothCorrel3D to .TRUE. -#undef ALLOW_SMOOTH_CORREL3D - -C o apply pkg/ctrl/ctrl_smooth.F to 2D controls (outside of ctrlSmoothCorrel2D) -#undef ALLOW_CTRL_SMOOTH -C o apply pkg/smooth/smooth_diff2d.F to 2D controls (outside of ctrlSmoothCorrel2D) +C Note: this flag turns on extra smoothing code in ctrl_get_gen.F which +C is inconsistent with the Weaver and Courtier, 2001 algorithm, and +C should probably not be used. The corresponding 3D flag applied only +C to deprecated code that is now removed. At some point we will remove +C this flag and associated code as well. +C o apply pkg/smooth/smooth_diff2d.F to 2D controls (outside of Smooth_Correl2D) #undef ALLOW_SMOOTH_CTRL2D -C o apply pkg/smooth/smooth_diff3d.F to 3D controls (outside of ctrlSmoothCorrel3D) -#undef ALLOW_SMOOTH_CTRL3D + +C o Print more debug info to STDOUT +#undef ALLOW_CTRL_DEBUG C ================================================================== #endif /* ndef ECCO_CPPOPTIONS_H */ diff --git a/verification/global_ocean.cs32x15/code_ad/SEAICE_OPTIONS.h b/verification/global_ocean.cs32x15/code_ad/SEAICE_OPTIONS.h index e6ded4d6e7..8a3b7defc3 100644 --- a/verification/global_ocean.cs32x15/code_ad/SEAICE_OPTIONS.h +++ b/verification/global_ocean.cs32x15/code_ad/SEAICE_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef SEAICE_OPTIONS_H +#define SEAICE_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + C *==========================================================* C | SEAICE_OPTIONS.h C | o CPP options file for sea ice package. @@ -6,24 +11,12 @@ C | Use this file for selecting options within the sea ice C | package. C *==========================================================* -#ifndef SEAICE_OPTIONS_H -#define SEAICE_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_SEAICE -C Package-specific Options & Macros go here +C--- Package-specific Options & Macros go here C-- Write "text-plots" of certain fields in STDOUT for debugging. #undef SEAICE_DEBUG -C-- Allow sea-ice dynamic code. -C This option is provided to allow use of TAMC -C on the thermodynamics component of the code only. -C Sea-ice dynamics can also be turned off at runtime -C using variable SEAICEuseDYNAMICS. -#define SEAICE_ALLOW_DYNAMICS - C-- By default, the sea-ice package uses its own integrated bulk C formulae to compute fluxes (fu, fv, EmPmR, Qnet, and Qsw) over C open-ocean. When this flag is set, these variables are computed @@ -55,66 +48,116 @@ C seaice with a fraction (=SEAICE_saltFrac) of freezing seawater salinity. C- Note: SItracer also offers an alternative way to handle variable salinity. #undef SEAICE_VARIABLE_SALINITY -C-- Tracers of ice and/or ice cover. -#undef ALLOW_SITRACER -#ifdef ALLOW_SITRACER -C-- To try avoid 'spontaneous generation' of tracer maxima by advdiff. -# define ALLOW_SITRACER_ADVCAP -#endif - -C-- Enable grease ice parameterization -C The grease ice parameterization delays formation of solid -C sea ice from frazil ice by a time constant and provides a -C dynamic calculation of the initial solid sea ice thickness -C HO as a function of winds, currents and available grease ice -C volume. Grease ice does not significantly reduce heat loss -C from the ocean in winter and area covered by grease is thus -C handled like open water. -C (For details see Smedsrud and Martin, 2014, Ann.Glac.) +C-- Enable grease ice parameterization (requires to define ALLOW_SITRACER): +C The grease ice parameterization delays formation of solid sea ice from +C frazil ice by a time constant and provides a dynamic calculation of the +C initial solid sea ice thickness HO as a function of winds, currents and +C available grease ice volume. Grease ice does not significantly reduce heat +C loss from the ocean in winter and area covered by grease is thus handled +C like open water (For details see Smedsrud and Martin, 2014, Ann.Glac.). C Set SItrName(1) = 'grease' in namelist SEAICE_PARM03 in data.seaice C then output SItr01 is SItrNameLong(1) = 'grease ice volume fraction', -C with SItrUnit(1) = '[0-1]', which needs to be multiplied by SIheff -C to yield grease ice volume. Additionally, the actual grease ice -C layer thickness (diagnostic SIgrsLT) can be saved. +C with SItrUnit(1) = '[0-1]', which needs to be multiplied by SIheff to +C yield grease ice volume. Additionally, the actual grease ice layer +C thickness (diagnostic SIgrsLT) can be saved. #undef SEAICE_GREASE -C-- grease ice uses SItracer: + +C-- Tracers of ice and/or ice cover. #ifdef SEAICE_GREASE +C SEAICE_GREASE code requires to define ALLOW_SITRACER # define ALLOW_SITRACER -# define ALLOW_SITRACER_ADVCAP +#else +# undef ALLOW_SITRACER #endif +#ifdef ALLOW_SITRACER +C- To try avoid 'spontaneous generation' of tracer maxima by advdiff. +# define ALLOW_SITRACER_ADVCAP + +C- Include code to diagnose sea ice tracer budgets in +C seaice_advdiff.F and seaice_tracer_phys.F. Diagnostics are +C computed the "call diagnostics_fill" statement is commented out. +# undef ALLOW_SITRACER_DEBUG_DIAG +#endif /* ALLOW_SITRACER */ + +C-- Allow sea-ice dynamic code. These options are provided so that, +C if turned off (#undef), to compile (and process with TAF) only the +C the thermodynamics component of the code. Note that, if needed, +C sea-ice dynamics can be turned off at runtime (SEAICEuseDYNAMICS=F). C-- Historically, the seaice model was discretized on a B-Grid. This -C discretization should still work but it is not longer actively tested -C and supported. The following flag should always be set in order to use -C the operational C-grid discretization. +C discretization should still work but it is not longer actively +C tested and supported. Define this flag to compile it. It cannot be +C defined together with SEAICE_CGRID +#undef SEAICE_BGRID_DYNAMICS + +C-- The following flag should always be set in order to use C the +C-- operational C-grid discretization. #define SEAICE_CGRID -C-- Only for the C-grid version it is possible to #ifdef SEAICE_CGRID +C-- Options for the C-grid version only: + C enable advection of sea ice momentum # undef SEAICE_ALLOW_MOM_ADVECTION + C enable JFNK code by defining the following flag # undef SEAICE_ALLOW_JFNK + C enable Krylov code by defining the following flag # undef SEAICE_ALLOW_KRYLOV + +C-- Use a different order when mapping 2D velocity arrays to 1D vector +C before passing it to FGMRES. +# undef SEAICE_JFNK_MAP_REORDER + +C to reproduce old verification results for JFNK +# undef SEAICE_PRECOND_EXTRA_EXCHANGE + C enable LSR to use global (multi-tile) tri-diagonal solver # undef SEAICE_GLOBAL_3DIAG_SOLVER + C enable EVP code by defining the following flag # define SEAICE_ALLOW_EVP # ifdef SEAICE_ALLOW_EVP -C-- When set use SEAICE_zetaMin and SEAICE_evpDampC to limit viscosities +C- When set use SEAICE_zetaMin and SEAICE_evpDampC to limit viscosities C from below and above in seaice_evp: not necessary, and not recommended # undef SEAICE_ALLOW_CLIPZETA + +C Include code to avoid underflows in EVP-code (copied from CICE). +C Many compilers can handle this more efficiently with the help of a flag. +# undef SEAICE_EVP_ELIMINATE_UNDERFLOWS + +C Include code to print residual of EVP iteration for debugging/diagnostics +# undef ALLOW_SEAICE_EVP_RESIDUAL # endif /* SEAICE_ALLOW_EVP */ + C smooth regularization (without max-function) of delta for C better differentiability # undef SEAICE_DELTA_SMOOTHREG + C regularize zeta to zmax with a smooth tanh-function instead C of a min(zeta,zmax). This improves convergence of iterative C solvers (Lemieux and Tremblay 2009, JGR). No effect on EVP # undef SEAICE_ZETA_SMOOTHREG + +C-- Different yield curves within the VP rheology framework C allow the truncated ellipse rheology (runtime flag SEAICEuseTEM) # undef SEAICE_ALLOW_TEM + +C allow the use of the Mohr Coulomb rheology (runtime flag SEAICEuseMCS) +C as defined in (Ip 1991) /!\ This is known to give unstable results, +C use with caution +# undef SEAICE_ALLOW_MCS + +C allow the use of Mohr Coulomb with elliptical plastic potential +C (runtime flag SEAICEuseMCE) +# undef SEAICE_ALLOW_MCE + +C allow the teardrop and parabolic lens rheology +C (runtime flag SEAICEuseTD and SEAICEusePL) +# undef SEAICE_ALLOW_TEARDROP + +C-- LSR solver settings C Use LSR vector code; not useful on non-vector machines, because it C slows down convergence considerably, but the extra iterations are C more than made up by the much faster code on vector machines. For @@ -122,52 +165,108 @@ C the only regularly test vector machine these flags a specified C in the build options file SUPER-UX_SX-8_sxf90_awi, so that we comment C them out here. # undef SEAICE_VECTORIZE_LSR + C Use zebra-method (alternate lines) for line-successive-relaxation C This modification improves the convergence of the vector code C dramatically, so that is may actually be useful in general, but C that needs to be tested. Can be used without vectorization options. # undef SEAICE_LSR_ZEBRA + +C Include code to print residual of nonlinear outer loop of LSR +# undef SEAICE_ALLOW_CHECK_LSR_CONVERGENCE + +C This flag is also required for an actual adjoint of seaice_lsr; +C increases memory requirements a lot. +# undef SEAICE_LSR_ADJOINT_ITER + C Use parameterisation of grounding ice for a better representation C of fastice in shallow seas # define SEAICE_ALLOW_BOTTOMDRAG -#else /* not SEAICE_CGRID, but old B-grid */ -C-- By default for B-grid dynamics solver wind stress under sea-ice is + +#endif /* SEAICE_CGRID */ + +#ifdef SEAICE_BGRID_DYNAMICS +C-- Options for the B-grid version only: + +C- By default for B-grid dynamics solver wind stress under sea-ice is C set to the same value as it would be if there was no sea-ice. C Define following CPP flag for B-grid ice-ocean stress coupling. # define SEAICE_BICE_STRESS -C-- By default for B-grid dynamics solver surface tilt is obtained +C- By default for B-grid dynamics solver surface tilt is obtained C indirectly via geostrophic velocities. Define following CPP C in order to use ETAN instead. # define EXPLICIT_SSH_SLOPE -C-- Defining this flag turns on FV-discretization of the B-grid LSOR solver. + +C- Defining this flag turns on FV-discretization of the B-grid LSOR solver. C It is smoother and includes all metric terms, similar to C-grid solvers. C It is here for completeness, but its usefulness is unclear. # undef SEAICE_LSRBNEW -#endif /* SEAICE_CGRID */ -C-- When set limit the Ice-Loading to mass of 1/5 of Surface ocean grid-box +#endif /* SEAICE_BGRID_DYNAMICS */ + +C-- Some regularisations +C- When set limit the Ice-Loading to mass of 1/5 of Surface ocean grid-box #undef SEAICE_CAP_ICELOAD -C-- When set use SEAICE_clipVelocties = .true., to clip U/VICE at 40cm/s, -C-- not recommended + +C- When set use SEAICE_clipVelocties = .true., to clip U/VICE at 40cm/s, +C not recommended #define SEAICE_ALLOW_CLIPVELS -C-- When set cap the sublimation latent heat flux in solve4temp according + +C- When set cap the sublimation latent heat flux in solve4temp according C to the available amount of ice+snow. Otherwise this term is treated C like all of the others -- residuals heat and fw stocks are passed to C the ocean at the end of seaice_growth in a conservative manner. C SEAICE_CAP_SUBLIM is not needed as of now, but kept just in case. #undef SEAICE_CAP_SUBLIM +C-- AD flags +C- TAF related flag, currently only used in seaice_ad_check_lev[1-4]_dir.h; +C it is unclear if this is ever needed. +#undef AUTODIFF_SOMETIMES_NEEDED + +C- Reset fields to zero to stabilise AD code of dynamics solver +C (resulting in wrong gradients) +#undef SEAICE_DYN_STABLE_ADJOINT + +C- Another flag to simplify dependencies for TAF-generated AD-code +C the thermodynamic part, mostly by resetting variables to zero +#undef SEAICE_MODIFY_GROWTH_ADJ + +C- Special seaice flag for AD testing +#undef SEAICE_EXCLUDE_FOR_EXACT_AD_TESTING + +C-- Use the adjointable sea-ice thermodynamic model +C in seaice_growth_adx.F instead of seaice_growth.F +C This options excludes more complex physics such +C as sublimation, ITD, and frazil. +#undef SEAICE_USE_GROWTH_ADX + +C-- These flags are not strictly AD-related but may help obtaining +C simpler AD-code: +C- Do not compile code that resets AREA (or AREAITD) to a mininum value +C of SEAICE_area_floor (=SIeps with default of 1e-5) if there is +C some finite sea ice thickness +#undef DISABLE_AREA_FLOOR + +C- Do not compile growth/thermodynamics code (avoiding this code can +C also be done by setting runtime parameter usePWthermodynamics=F) +#undef DISABLE_SEAICE_GROWTH + +C- Do not compile/use seaice-related obcs code when using obcs. +#undef DISABLE_SEAICE_OBCS + C-- Enable free drift code #define SEAICE_ALLOW_FREEDRIFT C-- pkg/seaice cost functions compile flags -c >>> Sea-ice volume (requires pkg/cost) +C- Sea-ice volume (requires pkg/cost) #undef ALLOW_COST_ICE +#ifdef ALLOW_COST_ICE +C- Enable template for sea-ice volume export in seaice_cost_export.F +C (requires pkg/cost & ALLOW_COST_ICE defined) +# undef ALLOW_SEAICE_COST_EXPORT +#endif /* ALLOW_COST_ICE */ #endif /* ALLOW_SEAICE */ #endif /* SEAICE_OPTIONS_H */ - -CEH3 ;;; Local Variables: *** -CEH3 ;;; mode:fortran *** -CEH3 ;;; End: *** diff --git a/verification/global_ocean.cs32x15/code_tap/AUTODIFF_OPTIONS.h b/verification/global_ocean.cs32x15/code_tap/AUTODIFF_OPTIONS.h index 97d74f5c9a..b9b62682c6 100644 --- a/verification/global_ocean.cs32x15/code_tap/AUTODIFF_OPTIONS.h +++ b/verification/global_ocean.cs32x15/code_tap/AUTODIFF_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef AUTODIFF_OPTIONS_H +#define AUTODIFF_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: AUTODIFF_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef AUTODIFF_OPTIONS_H -#define AUTODIFF_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_AUTODIFF #ifdef ECCO_CPPOPTIONS_H @@ -26,13 +26,11 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -C let autodiff_init_varia reset variables to 0 to reproduce old bug -#undef ALLOW_AUTODIFF_INIT_OLD - -C o Include/exclude code in order to be able to automatically -C differentiate the MITgcmUV by using the Tangent Linear and -C Adjoint Model Compiler (TAMC). +C o Include/exclude code in order to automatically differentiate MITgcm code +C using TAF (Transformation of Algorithms in Fortran, http://www.FastOpt.de) +C or using TAMC (Tangent Linear & Adjoint Model Compiler, needs both defined): #undef ALLOW_AUTODIFF_TAMC +#undef AUTODIFF_TAMC_COMPATIBILITY C >>> Checkpointing as handled by TAMC #undef ALLOW_TAMC_CHECKPOINTING @@ -43,25 +41,25 @@ C >>> and DYNVARS_DIAG adjoint state #undef ALLOW_AUTODIFF_MONITOR_DIAG C >>> DO 2-level checkpointing instead of 3-level -c#undef AUTODIFF_2_LEVEL_CHECKPOINT +#undef AUTODIFF_2_LEVEL_CHECKPOINT C extend to 4-level checkpointing -c#undef AUTODIFF_4_LEVEL_CHECKPOINT +#undef AUTODIFF_4_LEVEL_CHECKPOINT C o use divided adjoint to split adjoint computations #undef ALLOW_DIVIDED_ADJOINT -#undef ALLOW_PACKUNPACK_METHOD2 - C o This flag is incredibly useful as it reduces the number of C tape-files on the disc. Maybe it should even be the default. #undef ALLOW_AUTODIFF_WHTAPEIO +C and related to above: +#undef ALLOW_INIT_WHTAPEIO C o use standard MDSFINDUINTS instead of local pkg/autodiff version for C WHTAPEIO code I/O. C Note: comment out the #define below (instead of having an #undef) to C enable to set this Option in CPP command line (from the optfile) -#undef AUTODIFF_USE_MDSFINDUNITS +c#define AUTODIFF_USE_MDSFINDUNITS C o use the deprecated autodiff_store/restore method where multiple fields C are collected in a single buffer field array before storing to tape. @@ -73,6 +71,10 @@ C Might still be used for OBCS since WHTAPEIO does not support OBCS fields. C o allow using viscFacInAd to recompute viscosities in AD #undef AUTODIFF_ALLOW_VISCFACADJ +C o To remove part of MOM_CALC_VISC (better name would be: MOM_DISABLE_*) +#undef AUTODIFF_DISABLE_LEITH +#undef AUTODIFF_DISABLE_REYNOLDS_SCALE + C o for output of AD-variables (ALLOW_AUTODIFF_MONITOR), specific code (e.g., C in addummy_in_stepping.F) relies on adexch_uv_xy_rs and adexch_xy_rs S/R C which might not always be generated by TAF (e.g., when controls do not diff --git a/verification/global_ocean.cs32x15/code_tap/COST_OPTIONS.h b/verification/global_ocean.cs32x15/code_tap/COST_OPTIONS.h index 41c6475da2..64a1943d48 100644 --- a/verification/global_ocean.cs32x15/code_tap/COST_OPTIONS.h +++ b/verification/global_ocean.cs32x15/code_tap/COST_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef COST_OPTIONS_H +#define COST_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: COST_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef COST_OPTIONS_H -#define COST_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_COST #ifdef ECCO_CPPOPTIONS_H @@ -26,50 +26,24 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -C >>> Use the EGM-96 geoid error covariance. -#undef ALLOW_EGM96_ERROR_COV -#undef ALLOW_READ_EGM_DATA +#undef ALLOW_COST_STATE_FINAL +#undef ALLOW_COST_VECTOR + C >>> Cost function contributions -#undef ALLOW_HFLUX_COST_CONTRIBUTION -#undef ALLOW_SFLUX_COST_CONTRIBUTION -#undef ALLOW_USTRESS_COST_CONTRIBUTION -#undef ALLOW_VSTRESS_COST_CONTRIBUTION -#undef ALLOW_THETA_COST_CONTRIBUTION -#undef ALLOW_SALT_COST_CONTRIBUTION -#undef ALLOW_SST_COST_CONTRIBUTION -#undef ALLOW_SSS_COST_CONTRIBUTION -#undef ALLOW_SSH_COST_CONTRIBUTION -#undef ALLOW_CTDT_COST_CONTRIBUTION -#undef ALLOW_CTDS_COST_CONTRIBUTION -#undef ALLOW_COST_ATLANTIC #undef ALLOW_COST_ATLANTIC_HEAT +#undef ALLOW_COST_ATLANTIC_HEAT_DOMASS #define ALLOW_COST_TEST #define ALLOW_COST_TSQUARED +#undef ALLOW_COST_DEPTH #undef ALLOW_COST_TRACER -C >>> ALLOW_GENCOST_CONTRIBUTION: interactive way to add basic 2D cost -C function terms. -C > In data.ecco, this requires the specification of data file (name, -C frequency, etc.), bar file name for corresp. model average, standard -C error file name, etc. -C > In addition, adding such cost terms requires editing ecco_cost.h to -C increase NGENCOST, and editing cost_gencost_customize.F to implement -C the actual model average (i.e. the bar file content). -#undef ALLOW_GENCOST_CONTRIBUTION -C >>> free form version of GENCOST: allows one to use otherwise defined -C elements (e.g. psbar and and topex data) while taking advantage of the -C cost function/namelist slots that can be made available using -C ALLOW_GENCOST_CONTRIBUTION. To this end ALLOW_GENCOST_CONTRIBUTION -C simply switches off tests that check whether all of the gencost -C elements (e.g. gencost_barfile and gencost_datafile) are specified -C in data.ecco. -C > While this option increases flexibility within the gencost framework, -C it implies more room for error, so it should be used cautiously, and -C with good knowledge of the rest of pkg/ecco. -C > It requires providing a specific cost function routine, and editing -C cost_gencost_all.F accordingly. -#undef ALLOW_GENCOST_FREEFORM +C List these options here: +#undef ALLOW_COST_TEMP +#undef ALLOW_COST_HFLUXM +#undef ALLOW_DIC_COST +#undef ALLOW_THSICE_COST_TEST +#undef ALLOW_COST_SHELFICE C ================================================================== #endif /* ndef ECCO_CPPOPTIONS_H */ diff --git a/verification/global_ocean.cs32x15/code_tap/CTRL_OPTIONS.h b/verification/global_ocean.cs32x15/code_tap/CTRL_OPTIONS.h index 25037dcf8f..f962f36402 100644 --- a/verification/global_ocean.cs32x15/code_tap/CTRL_OPTIONS.h +++ b/verification/global_ocean.cs32x15/code_tap/CTRL_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef CTRL_OPTIONS_H +#define CTRL_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: CTRL_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef CTRL_OPTIONS_H -#define CTRL_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_CTRL #ifdef ECCO_CPPOPTIONS_H @@ -26,23 +26,68 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -#undef EXCLUDE_CTRL_PACK +C o I/O and pack settings +#undef CTRL_SET_PREC_32 +C This option is only relevant (for pack/unpack) with OBCS_CONTROL: #undef ALLOW_NONDIMENSIONAL_CONTROL_IO +#undef EXCLUDE_CTRL_PACK +#undef ALLOW_PACKUNPACK_METHOD2 +#undef CTRL_DO_PACK_UNPACK_ONLY +#undef CTRL_PACK_PRECISE +#undef CTRL_UNPACK_PRECISE +#undef CTRL_DELZNORM +#undef ALLOW_CTRL_WETV C >>> Other Control. -#define ALLOW_DIFFKR_CONTROL +C Allows for GMREDI controls #undef ALLOW_KAPGM_CONTROL #undef ALLOW_KAPREDI_CONTROL +C Allows for Vertical Diffusivity controls +#define ALLOW_DIFFKR_CONTROL #undef ALLOW_BOTTOMDRAG_CONTROL +#undef ALLOW_DIC_CONTROL -C >>> Backward compatibility option (before checkpoint 65p) -#undef ALLOW_KAPGM_CONTROL_OLD -#undef ALLOW_KAPREDI_CONTROL_OLD +C Allows bathymetry as a control vector +C Note: keep this Option separated from generic control since this control +C involves many new dependencies that we would like to avoid in general. +#undef ALLOW_DEPTH_CONTROL +#ifdef ALLOW_DEPTH_CONTROL +C Only relevant within DEPTH_CONTROL code: +# define USE_SMOOTH_MIN +# undef ALLOW_HFACC_CONTROL +# undef ALLOW_HFACC3D_CONTROL +#endif /* ALLOW_DEPTH_CONTROL */ C >>> Generic Control. #define ALLOW_GENARR2D_CONTROL #define ALLOW_GENARR3D_CONTROL #define ALLOW_GENTIM2D_CONTROL +# undef ALLOW_UVEL0_CONTROL +# undef ALLOW_VVEL0_CONTROL +# undef CTRL_SET_OLD_MAXCVARS_30 +# undef CTRL_SET_OLD_MAXCVARS_40 + +C >>> Open boundaries +#ifdef ALLOW_OBCS +C Control of Open-Boundaries is meaningless without compiling pkg/obcs +C Note: Make sure that corresponding OBCS N/S/W/E Option is defined +# define ALLOW_OBCSN_CONTROL +# define ALLOW_OBCSS_CONTROL +# define ALLOW_OBCSW_CONTROL +# define ALLOW_OBCSE_CONTROL +# undef ALLOW_OBCS_CONTROL_MODES +#endif /* ALLOW_OBCS */ + +C o Set ALLOW_OBCS_CONTROL (Do not edit/modify): +#if (defined (ALLOW_OBCSN_CONTROL) || \ + defined (ALLOW_OBCSS_CONTROL) || \ + defined (ALLOW_OBCSW_CONTROL) || \ + defined (ALLOW_OBCSE_CONTROL)) +# define ALLOW_OBCS_CONTROL +#endif + +C o Impose bounds on controls +#undef ALLOW_ADCTRLBOUND C o Rotation of wind/stress controls adjustments C from Eastward/Northward to model grid directions @@ -54,19 +99,16 @@ C The CTRL_SKIP_FIRST_TWO_ATM_REC_ALL option extends this C to the other the time variable atmospheric controls. #undef CTRL_SKIP_FIRST_TWO_ATM_REC_ALL -C o use pkg/smooth correlation operator (incl. smoother) for 2D controls (Weaver, Courtier 01) -C This CPP option just sets the default for ctrlSmoothCorrel2D to .TRUE. -#undef ALLOW_SMOOTH_CORREL2D -C o use pkg/smooth correlation operator (incl. smoother) for 3D controls (Weaver, Courtier 01) -C This CPP option just sets the default for ctrlSmoothCorrel3D to .TRUE. -#undef ALLOW_SMOOTH_CORREL3D - -C o apply pkg/ctrl/ctrl_smooth.F to 2D controls (outside of ctrlSmoothCorrel2D) -#undef ALLOW_CTRL_SMOOTH -C o apply pkg/smooth/smooth_diff2d.F to 2D controls (outside of ctrlSmoothCorrel2D) +C Note: this flag turns on extra smoothing code in ctrl_get_gen.F which +C is inconsistent with the Weaver and Courtier, 2001 algorithm, and +C should probably not be used. The corresponding 3D flag applied only +C to deprecated code that is now removed. At some point we will remove +C this flag and associated code as well. +C o apply pkg/smooth/smooth_diff2d.F to 2D controls (outside of Smooth_Correl2D) #undef ALLOW_SMOOTH_CTRL2D -C o apply pkg/smooth/smooth_diff3d.F to 3D controls (outside of ctrlSmoothCorrel3D) -#undef ALLOW_SMOOTH_CTRL3D + +C o Print more debug info to STDOUT +#undef ALLOW_CTRL_DEBUG C ================================================================== #endif /* ndef ECCO_CPPOPTIONS_H */ diff --git a/verification/global_ocean.cs32x15/code_tap/SEAICE_OPTIONS.h b/verification/global_ocean.cs32x15/code_tap/SEAICE_OPTIONS.h index 88dcc7134d..8a3b7defc3 100644 --- a/verification/global_ocean.cs32x15/code_tap/SEAICE_OPTIONS.h +++ b/verification/global_ocean.cs32x15/code_tap/SEAICE_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef SEAICE_OPTIONS_H +#define SEAICE_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + C *==========================================================* C | SEAICE_OPTIONS.h C | o CPP options file for sea ice package. @@ -6,24 +11,12 @@ C | Use this file for selecting options within the sea ice C | package. C *==========================================================* -#ifndef SEAICE_OPTIONS_H -#define SEAICE_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_SEAICE -C Package-specific Options & Macros go here +C--- Package-specific Options & Macros go here C-- Write "text-plots" of certain fields in STDOUT for debugging. #undef SEAICE_DEBUG -C-- Allow sea-ice dynamic code. -C This option is provided to allow use of TAMC -C on the thermodynamics component of the code only. -C Sea-ice dynamics can also be turned off at runtime -C using variable SEAICEuseDYNAMICS. -#define SEAICE_ALLOW_DYNAMICS - C-- By default, the sea-ice package uses its own integrated bulk C formulae to compute fluxes (fu, fv, EmPmR, Qnet, and Qsw) over C open-ocean. When this flag is set, these variables are computed @@ -55,66 +48,116 @@ C seaice with a fraction (=SEAICE_saltFrac) of freezing seawater salinity. C- Note: SItracer also offers an alternative way to handle variable salinity. #undef SEAICE_VARIABLE_SALINITY -C-- Tracers of ice and/or ice cover. -#undef ALLOW_SITRACER -#ifdef ALLOW_SITRACER -C-- To try avoid 'spontaneous generation' of tracer maxima by advdiff. -# define ALLOW_SITRACER_ADVCAP -#endif - -C-- Enable grease ice parameterization -C The grease ice parameterization delays formation of solid -C sea ice from frazil ice by a time constant and provides a -C dynamic calculation of the initial solid sea ice thickness -C HO as a function of winds, currents and available grease ice -C volume. Grease ice does not significantly reduce heat loss -C from the ocean in winter and area covered by grease is thus -C handled like open water. -C (For details see Smedsrud and Martin, 2014, Ann.Glac.) +C-- Enable grease ice parameterization (requires to define ALLOW_SITRACER): +C The grease ice parameterization delays formation of solid sea ice from +C frazil ice by a time constant and provides a dynamic calculation of the +C initial solid sea ice thickness HO as a function of winds, currents and +C available grease ice volume. Grease ice does not significantly reduce heat +C loss from the ocean in winter and area covered by grease is thus handled +C like open water (For details see Smedsrud and Martin, 2014, Ann.Glac.). C Set SItrName(1) = 'grease' in namelist SEAICE_PARM03 in data.seaice C then output SItr01 is SItrNameLong(1) = 'grease ice volume fraction', -C with SItrUnit(1) = '[0-1]', which needs to be multiplied by SIheff -C to yield grease ice volume. Additionally, the actual grease ice -C layer thickness (diagnostic SIgrsLT) can be saved. +C with SItrUnit(1) = '[0-1]', which needs to be multiplied by SIheff to +C yield grease ice volume. Additionally, the actual grease ice layer +C thickness (diagnostic SIgrsLT) can be saved. #undef SEAICE_GREASE -C-- grease ice uses SItracer: + +C-- Tracers of ice and/or ice cover. #ifdef SEAICE_GREASE +C SEAICE_GREASE code requires to define ALLOW_SITRACER # define ALLOW_SITRACER -# define ALLOW_SITRACER_ADVCAP +#else +# undef ALLOW_SITRACER #endif +#ifdef ALLOW_SITRACER +C- To try avoid 'spontaneous generation' of tracer maxima by advdiff. +# define ALLOW_SITRACER_ADVCAP + +C- Include code to diagnose sea ice tracer budgets in +C seaice_advdiff.F and seaice_tracer_phys.F. Diagnostics are +C computed the "call diagnostics_fill" statement is commented out. +# undef ALLOW_SITRACER_DEBUG_DIAG +#endif /* ALLOW_SITRACER */ + +C-- Allow sea-ice dynamic code. These options are provided so that, +C if turned off (#undef), to compile (and process with TAF) only the +C the thermodynamics component of the code. Note that, if needed, +C sea-ice dynamics can be turned off at runtime (SEAICEuseDYNAMICS=F). C-- Historically, the seaice model was discretized on a B-Grid. This -C discretization should still work but it is not longer actively tested -C and supported. The following flag should always be set in order to use -C the operational C-grid discretization. +C discretization should still work but it is not longer actively +C tested and supported. Define this flag to compile it. It cannot be +C defined together with SEAICE_CGRID +#undef SEAICE_BGRID_DYNAMICS + +C-- The following flag should always be set in order to use C the +C-- operational C-grid discretization. #define SEAICE_CGRID -C-- Only for the C-grid version it is possible to #ifdef SEAICE_CGRID +C-- Options for the C-grid version only: + C enable advection of sea ice momentum # undef SEAICE_ALLOW_MOM_ADVECTION + C enable JFNK code by defining the following flag # undef SEAICE_ALLOW_JFNK + C enable Krylov code by defining the following flag # undef SEAICE_ALLOW_KRYLOV + +C-- Use a different order when mapping 2D velocity arrays to 1D vector +C before passing it to FGMRES. +# undef SEAICE_JFNK_MAP_REORDER + +C to reproduce old verification results for JFNK +# undef SEAICE_PRECOND_EXTRA_EXCHANGE + C enable LSR to use global (multi-tile) tri-diagonal solver # undef SEAICE_GLOBAL_3DIAG_SOLVER + C enable EVP code by defining the following flag # define SEAICE_ALLOW_EVP # ifdef SEAICE_ALLOW_EVP -C-- When set use SEAICE_zetaMin and SEAICE_evpDampC to limit viscosities +C- When set use SEAICE_zetaMin and SEAICE_evpDampC to limit viscosities C from below and above in seaice_evp: not necessary, and not recommended # undef SEAICE_ALLOW_CLIPZETA + +C Include code to avoid underflows in EVP-code (copied from CICE). +C Many compilers can handle this more efficiently with the help of a flag. +# undef SEAICE_EVP_ELIMINATE_UNDERFLOWS + +C Include code to print residual of EVP iteration for debugging/diagnostics +# undef ALLOW_SEAICE_EVP_RESIDUAL # endif /* SEAICE_ALLOW_EVP */ + C smooth regularization (without max-function) of delta for C better differentiability # undef SEAICE_DELTA_SMOOTHREG + C regularize zeta to zmax with a smooth tanh-function instead C of a min(zeta,zmax). This improves convergence of iterative C solvers (Lemieux and Tremblay 2009, JGR). No effect on EVP # undef SEAICE_ZETA_SMOOTHREG + +C-- Different yield curves within the VP rheology framework C allow the truncated ellipse rheology (runtime flag SEAICEuseTEM) # undef SEAICE_ALLOW_TEM + +C allow the use of the Mohr Coulomb rheology (runtime flag SEAICEuseMCS) +C as defined in (Ip 1991) /!\ This is known to give unstable results, +C use with caution +# undef SEAICE_ALLOW_MCS + +C allow the use of Mohr Coulomb with elliptical plastic potential +C (runtime flag SEAICEuseMCE) +# undef SEAICE_ALLOW_MCE + +C allow the teardrop and parabolic lens rheology +C (runtime flag SEAICEuseTD and SEAICEusePL) +# undef SEAICE_ALLOW_TEARDROP + +C-- LSR solver settings C Use LSR vector code; not useful on non-vector machines, because it C slows down convergence considerably, but the extra iterations are C more than made up by the much faster code on vector machines. For @@ -122,54 +165,108 @@ C the only regularly test vector machine these flags a specified C in the build options file SUPER-UX_SX-8_sxf90_awi, so that we comment C them out here. # undef SEAICE_VECTORIZE_LSR + C Use zebra-method (alternate lines) for line-successive-relaxation C This modification improves the convergence of the vector code C dramatically, so that is may actually be useful in general, but C that needs to be tested. Can be used without vectorization options. # undef SEAICE_LSR_ZEBRA + +C Include code to print residual of nonlinear outer loop of LSR +# undef SEAICE_ALLOW_CHECK_LSR_CONVERGENCE + +C This flag is also required for an actual adjoint of seaice_lsr; +C increases memory requirements a lot. +# undef SEAICE_LSR_ADJOINT_ITER + C Use parameterisation of grounding ice for a better representation C of fastice in shallow seas # define SEAICE_ALLOW_BOTTOMDRAG -#else /* not SEAICE_CGRID, but old B-grid */ -C-- By default for B-grid dynamics solver wind stress under sea-ice is + +#endif /* SEAICE_CGRID */ + +#ifdef SEAICE_BGRID_DYNAMICS +C-- Options for the B-grid version only: + +C- By default for B-grid dynamics solver wind stress under sea-ice is C set to the same value as it would be if there was no sea-ice. C Define following CPP flag for B-grid ice-ocean stress coupling. # define SEAICE_BICE_STRESS -C-- By default for B-grid dynamics solver surface tilt is obtained +C- By default for B-grid dynamics solver surface tilt is obtained C indirectly via geostrophic velocities. Define following CPP C in order to use ETAN instead. # define EXPLICIT_SSH_SLOPE -C-- Defining this flag turns on FV-discretization of the B-grid LSOR solver. + +C- Defining this flag turns on FV-discretization of the B-grid LSOR solver. C It is smoother and includes all metric terms, similar to C-grid solvers. C It is here for completeness, but its usefulness is unclear. # undef SEAICE_LSRBNEW -#endif /* SEAICE_CGRID */ -C-- When set limit the Ice-Loading to mass of 1/5 of Surface ocean grid-box +#endif /* SEAICE_BGRID_DYNAMICS */ + +C-- Some regularisations +C- When set limit the Ice-Loading to mass of 1/5 of Surface ocean grid-box #undef SEAICE_CAP_ICELOAD -C-- When set use SEAICE_clipVelocties = .true., to clip U/VICE at 40cm/s, -C-- not recommended + +C- When set use SEAICE_clipVelocties = .true., to clip U/VICE at 40cm/s, +C not recommended #define SEAICE_ALLOW_CLIPVELS -C-- When set cap the sublimation latent heat flux in solve4temp according + +C- When set cap the sublimation latent heat flux in solve4temp according C to the available amount of ice+snow. Otherwise this term is treated C like all of the others -- residuals heat and fw stocks are passed to C the ocean at the end of seaice_growth in a conservative manner. C SEAICE_CAP_SUBLIM is not needed as of now, but kept just in case. #undef SEAICE_CAP_SUBLIM +C-- AD flags +C- TAF related flag, currently only used in seaice_ad_check_lev[1-4]_dir.h; +C it is unclear if this is ever needed. +#undef AUTODIFF_SOMETIMES_NEEDED + +C- Reset fields to zero to stabilise AD code of dynamics solver +C (resulting in wrong gradients) +#undef SEAICE_DYN_STABLE_ADJOINT + +C- Another flag to simplify dependencies for TAF-generated AD-code +C the thermodynamic part, mostly by resetting variables to zero +#undef SEAICE_MODIFY_GROWTH_ADJ + +C- Special seaice flag for AD testing +#undef SEAICE_EXCLUDE_FOR_EXACT_AD_TESTING + +C-- Use the adjointable sea-ice thermodynamic model +C in seaice_growth_adx.F instead of seaice_growth.F +C This options excludes more complex physics such +C as sublimation, ITD, and frazil. +#undef SEAICE_USE_GROWTH_ADX + +C-- These flags are not strictly AD-related but may help obtaining +C simpler AD-code: +C- Do not compile code that resets AREA (or AREAITD) to a mininum value +C of SEAICE_area_floor (=SIeps with default of 1e-5) if there is +C some finite sea ice thickness +#undef DISABLE_AREA_FLOOR + +C- Do not compile growth/thermodynamics code (avoiding this code can +C also be done by setting runtime parameter usePWthermodynamics=F) +#undef DISABLE_SEAICE_GROWTH + +C- Do not compile/use seaice-related obcs code when using obcs. +#undef DISABLE_SEAICE_OBCS + C-- Enable free drift code #define SEAICE_ALLOW_FREEDRIFT C-- pkg/seaice cost functions compile flags -c >>> Sea-ice volume (requires pkg/cost) +C- Sea-ice volume (requires pkg/cost) #undef ALLOW_COST_ICE -c >>> Sea-ice misfit to obs (requires pkg/cost and ecco) -#undef ALLOW_SEAICE_COST_SMR_AREA +#ifdef ALLOW_COST_ICE +C- Enable template for sea-ice volume export in seaice_cost_export.F +C (requires pkg/cost & ALLOW_COST_ICE defined) +# undef ALLOW_SEAICE_COST_EXPORT +#endif /* ALLOW_COST_ICE */ #endif /* ALLOW_SEAICE */ #endif /* SEAICE_OPTIONS_H */ - -CEH3 ;;; Local Variables: *** -CEH3 ;;; mode:fortran *** -CEH3 ;;; End: *** diff --git a/verification/global_ocean_ebm/code_ad/AUTODIFF_OPTIONS.h b/verification/global_ocean_ebm/code_ad/AUTODIFF_OPTIONS.h index 4b6f1f5cc0..c439cfd340 100644 --- a/verification/global_ocean_ebm/code_ad/AUTODIFF_OPTIONS.h +++ b/verification/global_ocean_ebm/code_ad/AUTODIFF_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef AUTODIFF_OPTIONS_H +#define AUTODIFF_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: AUTODIFF_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef AUTODIFF_OPTIONS_H -#define AUTODIFF_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_AUTODIFF #ifdef ECCO_CPPOPTIONS_H @@ -26,10 +26,11 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -C o Include/exclude code in order to be able to automatically -C differentiate the MITgcmUV by using the Tangent Linear and -C Adjoint Model Compiler (TAMC). +C o Include/exclude code in order to automatically differentiate MITgcm code +C using TAF (Transformation of Algorithms in Fortran, http://www.FastOpt.de) +C or using TAMC (Tangent Linear & Adjoint Model Compiler, needs both defined): #define ALLOW_AUTODIFF_TAMC +#undef AUTODIFF_TAMC_COMPATIBILITY C >>> Checkpointing as handled by TAMC #define ALLOW_TAMC_CHECKPOINTING @@ -40,19 +41,19 @@ C >>> and DYNVARS_DIAG adjoint state #undef ALLOW_AUTODIFF_MONITOR_DIAG C >>> DO 2-level checkpointing instead of 3-level -c#undef AUTODIFF_2_LEVEL_CHECKPOINT +#undef AUTODIFF_2_LEVEL_CHECKPOINT C extend to 4-level checkpointing -c#undef AUTODIFF_4_LEVEL_CHECKPOINT +#undef AUTODIFF_4_LEVEL_CHECKPOINT C o use divided adjoint to split adjoint computations #undef ALLOW_DIVIDED_ADJOINT -#undef ALLOW_PACKUNPACK_METHOD2 - C o This flag is incredibly useful as it reduces the number of C tape-files on the disc. Maybe it should even be the default. #define ALLOW_AUTODIFF_WHTAPEIO +C and related to above: +#undef ALLOW_INIT_WHTAPEIO C o use standard MDSFINDUINTS instead of local pkg/autodiff version for C WHTAPEIO code I/O. @@ -70,6 +71,10 @@ C Might still be used for OBCS since WHTAPEIO does not support OBCS fields. C o allow using viscFacInAd to recompute viscosities in AD #define AUTODIFF_ALLOW_VISCFACADJ +C o To remove part of MOM_CALC_VISC (better name would be: MOM_DISABLE_*) +#undef AUTODIFF_DISABLE_LEITH +#undef AUTODIFF_DISABLE_REYNOLDS_SCALE + C o for output of AD-variables (ALLOW_AUTODIFF_MONITOR), specific code (e.g., C in addummy_in_stepping.F) relies on adexch_uv_xy_rs and adexch_xy_rs S/R C which might not always be generated by TAF (e.g., when controls do not diff --git a/verification/global_ocean_ebm/code_ad/COST_OPTIONS.h b/verification/global_ocean_ebm/code_ad/COST_OPTIONS.h index 23cecef1a8..98d324a8fe 100644 --- a/verification/global_ocean_ebm/code_ad/COST_OPTIONS.h +++ b/verification/global_ocean_ebm/code_ad/COST_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef COST_OPTIONS_H +#define COST_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: COST_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef COST_OPTIONS_H -#define COST_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_COST #ifdef ECCO_CPPOPTIONS_H @@ -26,50 +26,24 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -C >>> Use the EGM-96 geoid error covariance. -#undef ALLOW_EGM96_ERROR_COV -#undef ALLOW_READ_EGM_DATA +#undef ALLOW_COST_STATE_FINAL +#undef ALLOW_COST_VECTOR + C >>> Cost function contributions -#undef ALLOW_HFLUX_COST_CONTRIBUTION -#undef ALLOW_SFLUX_COST_CONTRIBUTION -#undef ALLOW_USTRESS_COST_CONTRIBUTION -#undef ALLOW_VSTRESS_COST_CONTRIBUTION -#undef ALLOW_THETA_COST_CONTRIBUTION -#undef ALLOW_SALT_COST_CONTRIBUTION -#undef ALLOW_SST_COST_CONTRIBUTION -#undef ALLOW_SSS_COST_CONTRIBUTION -#undef ALLOW_SSH_COST_CONTRIBUTION -#undef ALLOW_CTDT_COST_CONTRIBUTION -#undef ALLOW_CTDS_COST_CONTRIBUTION -#undef ALLOW_COST_ATLANTIC #define ALLOW_COST_ATLANTIC_HEAT +#undef ALLOW_COST_ATLANTIC_HEAT_DOMASS #undef ALLOW_COST_TEST #undef ALLOW_COST_TSQUARED +#undef ALLOW_COST_DEPTH #undef ALLOW_COST_TRACER -C >>> ALLOW_GENCOST_CONTRIBUTION: interactive way to add basic 2D cost -C function terms. -C > In data.ecco, this requires the specification of data file (name, -C frequency, etc.), bar file name for corresp. model average, standard -C error file name, etc. -C > In addition, adding such cost terms requires editing ecco_cost.h to -C increase NGENCOST, and editing cost_gencost_customize.F to implement -C the actual model average (i.e. the bar file content). -#undef ALLOW_GENCOST_CONTRIBUTION -C >>> free form version of GENCOST: allows one to use otherwise defined -C elements (e.g. psbar and and topex data) while taking advantage of the -C cost function/namelist slots that can be made available using -C ALLOW_GENCOST_CONTRIBUTION. To this end ALLOW_GENCOST_CONTRIBUTION -C simply switches off tests that check whether all of the gencost -C elements (e.g. gencost_barfile and gencost_datafile) are specified -C in data.ecco. -C > While this option increases flexibility within the gencost framework, -C it implies more room for error, so it should be used cautiously, and -C with good knowledge of the rest of pkg/ecco. -C > It requires providing a specific cost function routine, and editing -C cost_gencost_all.F accordingly. -#undef ALLOW_GENCOST_FREEFORM +C List these options here: +#undef ALLOW_COST_TEMP +#undef ALLOW_COST_HFLUXM +#undef ALLOW_DIC_COST +#undef ALLOW_THSICE_COST_TEST +#undef ALLOW_COST_SHELFICE C ================================================================== #endif /* ndef ECCO_CPPOPTIONS_H */ diff --git a/verification/global_ocean_ebm/code_ad/CTRL_OPTIONS.h b/verification/global_ocean_ebm/code_ad/CTRL_OPTIONS.h index 09c6405623..ef978d6407 100644 --- a/verification/global_ocean_ebm/code_ad/CTRL_OPTIONS.h +++ b/verification/global_ocean_ebm/code_ad/CTRL_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef CTRL_OPTIONS_H +#define CTRL_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: CTRL_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef CTRL_OPTIONS_H -#define CTRL_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_CTRL #ifdef ECCO_CPPOPTIONS_H @@ -26,55 +26,68 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -C o Re-activate deprecated codes in pkg/ecco & pkg/ctrl (but not recommended) -C and since pkg/ctrl can be used without pkg/ecco, better to have it here -#undef ECCO_CTRL_DEPRECATED - -#undef EXCLUDE_CTRL_PACK +C o I/O and pack settings +#undef CTRL_SET_PREC_32 +C This option is only relevant (for pack/unpack) with OBCS_CONTROL: #undef ALLOW_NONDIMENSIONAL_CONTROL_IO - -C >>> Initial values. -#undef ALLOW_THETA0_CONTROL -#undef ALLOW_SALT0_CONTROL -#undef ALLOW_UVEL0_CONTROL -#undef ALLOW_VVEL0_CONTROL -#undef ALLOW_TR10_CONTROL -#undef ALLOW_TAUU0_CONTROL -#undef ALLOW_TAUV0_CONTROL -#undef ALLOW_SFLUX0_CONTROL -#undef ALLOW_HFLUX0_CONTROL -#undef ALLOW_SSS0_CONTROL -#undef ALLOW_SST0_CONTROL - -C >>> Surface fluxes. -#undef ALLOW_HFLUX_CONTROL -#undef ALLOW_SFLUX_CONTROL -#undef ALLOW_USTRESS_CONTROL -#undef ALLOW_VSTRESS_CONTROL -#undef ALLOW_SWFLUX_CONTROL -#undef ALLOW_LWFLUX_CONTROL - -C >>> Atmospheric state. -#undef ALLOW_ATEMP_CONTROL -#undef ALLOW_AQH_CONTROL -#undef ALLOW_UWIND_CONTROL -#undef ALLOW_VWIND_CONTROL -#undef ALLOW_PRECIP_CONTROL +#undef EXCLUDE_CTRL_PACK +#undef ALLOW_PACKUNPACK_METHOD2 +#undef CTRL_DO_PACK_UNPACK_ONLY +#undef CTRL_PACK_PRECISE +#undef CTRL_UNPACK_PRECISE +#undef CTRL_DELZNORM +#undef ALLOW_CTRL_WETV C >>> Other Control. -#undef ALLOW_DIFFKR_CONTROL +C Allows for GMREDI controls #undef ALLOW_KAPGM_CONTROL #undef ALLOW_KAPREDI_CONTROL +C Allows for Vertical Diffusivity controls +#undef ALLOW_DIFFKR_CONTROL #undef ALLOW_BOTTOMDRAG_CONTROL - -C >>> Backward compatibility option (before checkpoint 65p) -#undef ALLOW_KAPGM_CONTROL_OLD -#undef ALLOW_KAPREDI_CONTROL_OLD +#undef ALLOW_DIC_CONTROL + +C Allows bathymetry as a control vector +C Note: keep this Option separated from generic control since this control +C involves many new dependencies that we would like to avoid in general. +#undef ALLOW_DEPTH_CONTROL +#ifdef ALLOW_DEPTH_CONTROL +C Only relevant within DEPTH_CONTROL code: +# define USE_SMOOTH_MIN +# undef ALLOW_HFACC_CONTROL +# undef ALLOW_HFACC3D_CONTROL +#endif /* ALLOW_DEPTH_CONTROL */ C >>> Generic Control. #define ALLOW_GENARR2D_CONTROL #define ALLOW_GENARR3D_CONTROL #undef ALLOW_GENTIM2D_CONTROL +# undef ALLOW_UVEL0_CONTROL +# undef ALLOW_VVEL0_CONTROL +# undef CTRL_SET_OLD_MAXCVARS_30 +# undef CTRL_SET_OLD_MAXCVARS_40 + +C >>> Open boundaries +#ifdef ALLOW_OBCS +C Control of Open-Boundaries is meaningless without compiling pkg/obcs +C Note: Make sure that corresponding OBCS N/S/W/E Option is defined +# define ALLOW_OBCSN_CONTROL +# define ALLOW_OBCSS_CONTROL +# define ALLOW_OBCSW_CONTROL +# define ALLOW_OBCSE_CONTROL +# undef ALLOW_OBCS_CONTROL_MODES +#endif /* ALLOW_OBCS */ + +C o Set ALLOW_OBCS_CONTROL (Do not edit/modify): +#if (defined (ALLOW_OBCSN_CONTROL) || \ + defined (ALLOW_OBCSS_CONTROL) || \ + defined (ALLOW_OBCSW_CONTROL) || \ + defined (ALLOW_OBCSE_CONTROL)) +# define ALLOW_OBCS_CONTROL +#endif + +C o Impose bounds on controls +#undef ALLOW_ADCTRLBOUND C o Rotation of wind/stress controls adjustments C from Eastward/Northward to model grid directions @@ -86,19 +99,16 @@ C The CTRL_SKIP_FIRST_TWO_ATM_REC_ALL option extends this C to the other the time variable atmospheric controls. #undef CTRL_SKIP_FIRST_TWO_ATM_REC_ALL -C o use pkg/smooth correlation operator (incl. smoother) for 2D controls (Weaver, Courtier 01) -C This CPP option just sets the default for ctrlSmoothCorrel2D to .TRUE. -#undef ALLOW_SMOOTH_CORREL2D -C o use pkg/smooth correlation operator (incl. smoother) for 3D controls (Weaver, Courtier 01) -C This CPP option just sets the default for ctrlSmoothCorrel3D to .TRUE. -#undef ALLOW_SMOOTH_CORREL3D - -C o apply pkg/ctrl/ctrl_smooth.F to 2D controls (outside of ctrlSmoothCorrel2D) -#undef ALLOW_CTRL_SMOOTH -C o apply pkg/smooth/smooth_diff2d.F to 2D controls (outside of ctrlSmoothCorrel2D) +C Note: this flag turns on extra smoothing code in ctrl_get_gen.F which +C is inconsistent with the Weaver and Courtier, 2001 algorithm, and +C should probably not be used. The corresponding 3D flag applied only +C to deprecated code that is now removed. At some point we will remove +C this flag and associated code as well. +C o apply pkg/smooth/smooth_diff2d.F to 2D controls (outside of Smooth_Correl2D) #undef ALLOW_SMOOTH_CTRL2D -C o apply pkg/smooth/smooth_diff3d.F to 3D controls (outside of ctrlSmoothCorrel3D) -#undef ALLOW_SMOOTH_CTRL3D + +C o Print more debug info to STDOUT +#undef ALLOW_CTRL_DEBUG C ================================================================== #endif /* ndef ECCO_CPPOPTIONS_H */ diff --git a/verification/global_with_exf/code_ad/COST_OPTIONS.h b/verification/global_with_exf/code_ad/COST_OPTIONS.h index 41c6475da2..64a1943d48 100644 --- a/verification/global_with_exf/code_ad/COST_OPTIONS.h +++ b/verification/global_with_exf/code_ad/COST_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef COST_OPTIONS_H +#define COST_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: COST_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef COST_OPTIONS_H -#define COST_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_COST #ifdef ECCO_CPPOPTIONS_H @@ -26,50 +26,24 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -C >>> Use the EGM-96 geoid error covariance. -#undef ALLOW_EGM96_ERROR_COV -#undef ALLOW_READ_EGM_DATA +#undef ALLOW_COST_STATE_FINAL +#undef ALLOW_COST_VECTOR + C >>> Cost function contributions -#undef ALLOW_HFLUX_COST_CONTRIBUTION -#undef ALLOW_SFLUX_COST_CONTRIBUTION -#undef ALLOW_USTRESS_COST_CONTRIBUTION -#undef ALLOW_VSTRESS_COST_CONTRIBUTION -#undef ALLOW_THETA_COST_CONTRIBUTION -#undef ALLOW_SALT_COST_CONTRIBUTION -#undef ALLOW_SST_COST_CONTRIBUTION -#undef ALLOW_SSS_COST_CONTRIBUTION -#undef ALLOW_SSH_COST_CONTRIBUTION -#undef ALLOW_CTDT_COST_CONTRIBUTION -#undef ALLOW_CTDS_COST_CONTRIBUTION -#undef ALLOW_COST_ATLANTIC #undef ALLOW_COST_ATLANTIC_HEAT +#undef ALLOW_COST_ATLANTIC_HEAT_DOMASS #define ALLOW_COST_TEST #define ALLOW_COST_TSQUARED +#undef ALLOW_COST_DEPTH #undef ALLOW_COST_TRACER -C >>> ALLOW_GENCOST_CONTRIBUTION: interactive way to add basic 2D cost -C function terms. -C > In data.ecco, this requires the specification of data file (name, -C frequency, etc.), bar file name for corresp. model average, standard -C error file name, etc. -C > In addition, adding such cost terms requires editing ecco_cost.h to -C increase NGENCOST, and editing cost_gencost_customize.F to implement -C the actual model average (i.e. the bar file content). -#undef ALLOW_GENCOST_CONTRIBUTION -C >>> free form version of GENCOST: allows one to use otherwise defined -C elements (e.g. psbar and and topex data) while taking advantage of the -C cost function/namelist slots that can be made available using -C ALLOW_GENCOST_CONTRIBUTION. To this end ALLOW_GENCOST_CONTRIBUTION -C simply switches off tests that check whether all of the gencost -C elements (e.g. gencost_barfile and gencost_datafile) are specified -C in data.ecco. -C > While this option increases flexibility within the gencost framework, -C it implies more room for error, so it should be used cautiously, and -C with good knowledge of the rest of pkg/ecco. -C > It requires providing a specific cost function routine, and editing -C cost_gencost_all.F accordingly. -#undef ALLOW_GENCOST_FREEFORM +C List these options here: +#undef ALLOW_COST_TEMP +#undef ALLOW_COST_HFLUXM +#undef ALLOW_DIC_COST +#undef ALLOW_THSICE_COST_TEST +#undef ALLOW_COST_SHELFICE C ================================================================== #endif /* ndef ECCO_CPPOPTIONS_H */ diff --git a/verification/global_with_exf/code_ad/CTRL_OPTIONS.h b/verification/global_with_exf/code_ad/CTRL_OPTIONS.h index e9e017ada9..59864ca500 100644 --- a/verification/global_with_exf/code_ad/CTRL_OPTIONS.h +++ b/verification/global_with_exf/code_ad/CTRL_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef CTRL_OPTIONS_H +#define CTRL_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: CTRL_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef CTRL_OPTIONS_H -#define CTRL_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_CTRL #ifdef ECCO_CPPOPTIONS_H @@ -26,55 +26,68 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -C o Re-activate deprecated codes in pkg/ecco & pkg/ctrl (but not recommended) -C and since pkg/ctrl can be used without pkg/ecco, better to have it here -#undef ECCO_CTRL_DEPRECATED - -#undef EXCLUDE_CTRL_PACK +C o I/O and pack settings +#undef CTRL_SET_PREC_32 +C This option is only relevant (for pack/unpack) with OBCS_CONTROL: #undef ALLOW_NONDIMENSIONAL_CONTROL_IO - -C >>> Initial values. -#undef ALLOW_THETA0_CONTROL -#undef ALLOW_SALT0_CONTROL -#undef ALLOW_UVEL0_CONTROL -#undef ALLOW_VVEL0_CONTROL -#undef ALLOW_TR10_CONTROL -#undef ALLOW_TAUU0_CONTROL -#undef ALLOW_TAUV0_CONTROL -#undef ALLOW_SFLUX0_CONTROL -#undef ALLOW_HFLUX0_CONTROL -#undef ALLOW_SSS0_CONTROL -#undef ALLOW_SST0_CONTROL - -C >>> Surface fluxes. -#undef ALLOW_HFLUX_CONTROL -#undef ALLOW_SFLUX_CONTROL -#undef ALLOW_USTRESS_CONTROL -#undef ALLOW_VSTRESS_CONTROL -#undef ALLOW_SWFLUX_CONTROL -#undef ALLOW_LWFLUX_CONTROL - -C >>> Atmospheric state. -#undef ALLOW_ATEMP_CONTROL -#undef ALLOW_AQH_CONTROL -#undef ALLOW_UWIND_CONTROL -#undef ALLOW_VWIND_CONTROL -#undef ALLOW_PRECIP_CONTROL +#undef EXCLUDE_CTRL_PACK +#undef ALLOW_PACKUNPACK_METHOD2 +#undef CTRL_DO_PACK_UNPACK_ONLY +#undef CTRL_PACK_PRECISE +#undef CTRL_UNPACK_PRECISE +#undef CTRL_DELZNORM +#undef ALLOW_CTRL_WETV C >>> Other Control. -#undef ALLOW_DIFFKR_CONTROL +C Allows for GMREDI controls #undef ALLOW_KAPGM_CONTROL #undef ALLOW_KAPREDI_CONTROL +C Allows for Vertical Diffusivity controls +#undef ALLOW_DIFFKR_CONTROL #undef ALLOW_BOTTOMDRAG_CONTROL - -C >>> Backward compatibility option (before checkpoint 65p) -#undef ALLOW_KAPGM_CONTROL_OLD -#undef ALLOW_KAPREDI_CONTROL_OLD +#undef ALLOW_DIC_CONTROL + +C Allows bathymetry as a control vector +C Note: keep this Option separated from generic control since this control +C involves many new dependencies that we would like to avoid in general. +#undef ALLOW_DEPTH_CONTROL +#ifdef ALLOW_DEPTH_CONTROL +C Only relevant within DEPTH_CONTROL code: +# define USE_SMOOTH_MIN +# undef ALLOW_HFACC_CONTROL +# undef ALLOW_HFACC3D_CONTROL +#endif /* ALLOW_DEPTH_CONTROL */ C >>> Generic Control. #undef ALLOW_GENARR2D_CONTROL #define ALLOW_GENARR3D_CONTROL #define ALLOW_GENTIM2D_CONTROL +# undef ALLOW_UVEL0_CONTROL +# undef ALLOW_VVEL0_CONTROL +# undef CTRL_SET_OLD_MAXCVARS_30 +# undef CTRL_SET_OLD_MAXCVARS_40 + +C >>> Open boundaries +#ifdef ALLOW_OBCS +C Control of Open-Boundaries is meaningless without compiling pkg/obcs +C Note: Make sure that corresponding OBCS N/S/W/E Option is defined +# define ALLOW_OBCSN_CONTROL +# define ALLOW_OBCSS_CONTROL +# define ALLOW_OBCSW_CONTROL +# define ALLOW_OBCSE_CONTROL +# undef ALLOW_OBCS_CONTROL_MODES +#endif /* ALLOW_OBCS */ + +C o Set ALLOW_OBCS_CONTROL (Do not edit/modify): +#if (defined (ALLOW_OBCSN_CONTROL) || \ + defined (ALLOW_OBCSS_CONTROL) || \ + defined (ALLOW_OBCSW_CONTROL) || \ + defined (ALLOW_OBCSE_CONTROL)) +# define ALLOW_OBCS_CONTROL +#endif + +C o Impose bounds on controls +#undef ALLOW_ADCTRLBOUND C o Rotation of wind/stress controls adjustments C from Eastward/Northward to model grid directions @@ -86,19 +99,16 @@ C The CTRL_SKIP_FIRST_TWO_ATM_REC_ALL option extends this C to the other the time variable atmospheric controls. #undef CTRL_SKIP_FIRST_TWO_ATM_REC_ALL -C o use pkg/smooth correlation operator (incl. smoother) for 2D controls (Weaver, Courtier 01) -C This CPP option just sets the default for ctrlSmoothCorrel2D to .TRUE. -#undef ALLOW_SMOOTH_CORREL2D -C o use pkg/smooth correlation operator (incl. smoother) for 3D controls (Weaver, Courtier 01) -C This CPP option just sets the default for ctrlSmoothCorrel3D to .TRUE. -#undef ALLOW_SMOOTH_CORREL3D - -C o apply pkg/ctrl/ctrl_smooth.F to 2D controls (outside of ctrlSmoothCorrel2D) -#undef ALLOW_CTRL_SMOOTH -C o apply pkg/smooth/smooth_diff2d.F to 2D controls (outside of ctrlSmoothCorrel2D) +C Note: this flag turns on extra smoothing code in ctrl_get_gen.F which +C is inconsistent with the Weaver and Courtier, 2001 algorithm, and +C should probably not be used. The corresponding 3D flag applied only +C to deprecated code that is now removed. At some point we will remove +C this flag and associated code as well. +C o apply pkg/smooth/smooth_diff2d.F to 2D controls (outside of Smooth_Correl2D) #undef ALLOW_SMOOTH_CTRL2D -C o apply pkg/smooth/smooth_diff3d.F to 3D controls (outside of ctrlSmoothCorrel3D) -#undef ALLOW_SMOOTH_CTRL3D + +C o Print more debug info to STDOUT +#undef ALLOW_CTRL_DEBUG C ================================================================== #endif /* ndef ECCO_CPPOPTIONS_H */ diff --git a/verification/global_with_exf/code_tap/AUTODIFF_OPTIONS.h b/verification/global_with_exf/code_tap/AUTODIFF_OPTIONS.h index 8c00872f93..b9b62682c6 100644 --- a/verification/global_with_exf/code_tap/AUTODIFF_OPTIONS.h +++ b/verification/global_with_exf/code_tap/AUTODIFF_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef AUTODIFF_OPTIONS_H +#define AUTODIFF_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: AUTODIFF_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef AUTODIFF_OPTIONS_H -#define AUTODIFF_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_AUTODIFF #ifdef ECCO_CPPOPTIONS_H @@ -26,10 +26,11 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -C o Include/exclude code in order to be able to automatically -C differentiate the MITgcmUV by using the Tangent Linear and -C Adjoint Model Compiler (TAMC). +C o Include/exclude code in order to automatically differentiate MITgcm code +C using TAF (Transformation of Algorithms in Fortran, http://www.FastOpt.de) +C or using TAMC (Tangent Linear & Adjoint Model Compiler, needs both defined): #undef ALLOW_AUTODIFF_TAMC +#undef AUTODIFF_TAMC_COMPATIBILITY C >>> Checkpointing as handled by TAMC #undef ALLOW_TAMC_CHECKPOINTING @@ -43,16 +44,16 @@ C >>> DO 2-level checkpointing instead of 3-level #undef AUTODIFF_2_LEVEL_CHECKPOINT C extend to 4-level checkpointing -c#undef AUTODIFF_4_LEVEL_CHECKPOINT +#undef AUTODIFF_4_LEVEL_CHECKPOINT C o use divided adjoint to split adjoint computations #undef ALLOW_DIVIDED_ADJOINT -#undef ALLOW_PACKUNPACK_METHOD2 - C o This flag is incredibly useful as it reduces the number of C tape-files on the disc. Maybe it should even be the default. #undef ALLOW_AUTODIFF_WHTAPEIO +C and related to above: +#undef ALLOW_INIT_WHTAPEIO C o use standard MDSFINDUINTS instead of local pkg/autodiff version for C WHTAPEIO code I/O. @@ -70,6 +71,10 @@ C Might still be used for OBCS since WHTAPEIO does not support OBCS fields. C o allow using viscFacInAd to recompute viscosities in AD #undef AUTODIFF_ALLOW_VISCFACADJ +C o To remove part of MOM_CALC_VISC (better name would be: MOM_DISABLE_*) +#undef AUTODIFF_DISABLE_LEITH +#undef AUTODIFF_DISABLE_REYNOLDS_SCALE + C o for output of AD-variables (ALLOW_AUTODIFF_MONITOR), specific code (e.g., C in addummy_in_stepping.F) relies on adexch_uv_xy_rs and adexch_xy_rs S/R C which might not always be generated by TAF (e.g., when controls do not diff --git a/verification/global_with_exf/code_tap/COST_OPTIONS.h b/verification/global_with_exf/code_tap/COST_OPTIONS.h index 41c6475da2..64a1943d48 100644 --- a/verification/global_with_exf/code_tap/COST_OPTIONS.h +++ b/verification/global_with_exf/code_tap/COST_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef COST_OPTIONS_H +#define COST_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: COST_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef COST_OPTIONS_H -#define COST_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_COST #ifdef ECCO_CPPOPTIONS_H @@ -26,50 +26,24 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -C >>> Use the EGM-96 geoid error covariance. -#undef ALLOW_EGM96_ERROR_COV -#undef ALLOW_READ_EGM_DATA +#undef ALLOW_COST_STATE_FINAL +#undef ALLOW_COST_VECTOR + C >>> Cost function contributions -#undef ALLOW_HFLUX_COST_CONTRIBUTION -#undef ALLOW_SFLUX_COST_CONTRIBUTION -#undef ALLOW_USTRESS_COST_CONTRIBUTION -#undef ALLOW_VSTRESS_COST_CONTRIBUTION -#undef ALLOW_THETA_COST_CONTRIBUTION -#undef ALLOW_SALT_COST_CONTRIBUTION -#undef ALLOW_SST_COST_CONTRIBUTION -#undef ALLOW_SSS_COST_CONTRIBUTION -#undef ALLOW_SSH_COST_CONTRIBUTION -#undef ALLOW_CTDT_COST_CONTRIBUTION -#undef ALLOW_CTDS_COST_CONTRIBUTION -#undef ALLOW_COST_ATLANTIC #undef ALLOW_COST_ATLANTIC_HEAT +#undef ALLOW_COST_ATLANTIC_HEAT_DOMASS #define ALLOW_COST_TEST #define ALLOW_COST_TSQUARED +#undef ALLOW_COST_DEPTH #undef ALLOW_COST_TRACER -C >>> ALLOW_GENCOST_CONTRIBUTION: interactive way to add basic 2D cost -C function terms. -C > In data.ecco, this requires the specification of data file (name, -C frequency, etc.), bar file name for corresp. model average, standard -C error file name, etc. -C > In addition, adding such cost terms requires editing ecco_cost.h to -C increase NGENCOST, and editing cost_gencost_customize.F to implement -C the actual model average (i.e. the bar file content). -#undef ALLOW_GENCOST_CONTRIBUTION -C >>> free form version of GENCOST: allows one to use otherwise defined -C elements (e.g. psbar and and topex data) while taking advantage of the -C cost function/namelist slots that can be made available using -C ALLOW_GENCOST_CONTRIBUTION. To this end ALLOW_GENCOST_CONTRIBUTION -C simply switches off tests that check whether all of the gencost -C elements (e.g. gencost_barfile and gencost_datafile) are specified -C in data.ecco. -C > While this option increases flexibility within the gencost framework, -C it implies more room for error, so it should be used cautiously, and -C with good knowledge of the rest of pkg/ecco. -C > It requires providing a specific cost function routine, and editing -C cost_gencost_all.F accordingly. -#undef ALLOW_GENCOST_FREEFORM +C List these options here: +#undef ALLOW_COST_TEMP +#undef ALLOW_COST_HFLUXM +#undef ALLOW_DIC_COST +#undef ALLOW_THSICE_COST_TEST +#undef ALLOW_COST_SHELFICE C ================================================================== #endif /* ndef ECCO_CPPOPTIONS_H */ diff --git a/verification/global_with_exf/code_tap/CTRL_OPTIONS.h b/verification/global_with_exf/code_tap/CTRL_OPTIONS.h index e9e017ada9..59864ca500 100644 --- a/verification/global_with_exf/code_tap/CTRL_OPTIONS.h +++ b/verification/global_with_exf/code_tap/CTRL_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef CTRL_OPTIONS_H +#define CTRL_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: CTRL_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef CTRL_OPTIONS_H -#define CTRL_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_CTRL #ifdef ECCO_CPPOPTIONS_H @@ -26,55 +26,68 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -C o Re-activate deprecated codes in pkg/ecco & pkg/ctrl (but not recommended) -C and since pkg/ctrl can be used without pkg/ecco, better to have it here -#undef ECCO_CTRL_DEPRECATED - -#undef EXCLUDE_CTRL_PACK +C o I/O and pack settings +#undef CTRL_SET_PREC_32 +C This option is only relevant (for pack/unpack) with OBCS_CONTROL: #undef ALLOW_NONDIMENSIONAL_CONTROL_IO - -C >>> Initial values. -#undef ALLOW_THETA0_CONTROL -#undef ALLOW_SALT0_CONTROL -#undef ALLOW_UVEL0_CONTROL -#undef ALLOW_VVEL0_CONTROL -#undef ALLOW_TR10_CONTROL -#undef ALLOW_TAUU0_CONTROL -#undef ALLOW_TAUV0_CONTROL -#undef ALLOW_SFLUX0_CONTROL -#undef ALLOW_HFLUX0_CONTROL -#undef ALLOW_SSS0_CONTROL -#undef ALLOW_SST0_CONTROL - -C >>> Surface fluxes. -#undef ALLOW_HFLUX_CONTROL -#undef ALLOW_SFLUX_CONTROL -#undef ALLOW_USTRESS_CONTROL -#undef ALLOW_VSTRESS_CONTROL -#undef ALLOW_SWFLUX_CONTROL -#undef ALLOW_LWFLUX_CONTROL - -C >>> Atmospheric state. -#undef ALLOW_ATEMP_CONTROL -#undef ALLOW_AQH_CONTROL -#undef ALLOW_UWIND_CONTROL -#undef ALLOW_VWIND_CONTROL -#undef ALLOW_PRECIP_CONTROL +#undef EXCLUDE_CTRL_PACK +#undef ALLOW_PACKUNPACK_METHOD2 +#undef CTRL_DO_PACK_UNPACK_ONLY +#undef CTRL_PACK_PRECISE +#undef CTRL_UNPACK_PRECISE +#undef CTRL_DELZNORM +#undef ALLOW_CTRL_WETV C >>> Other Control. -#undef ALLOW_DIFFKR_CONTROL +C Allows for GMREDI controls #undef ALLOW_KAPGM_CONTROL #undef ALLOW_KAPREDI_CONTROL +C Allows for Vertical Diffusivity controls +#undef ALLOW_DIFFKR_CONTROL #undef ALLOW_BOTTOMDRAG_CONTROL - -C >>> Backward compatibility option (before checkpoint 65p) -#undef ALLOW_KAPGM_CONTROL_OLD -#undef ALLOW_KAPREDI_CONTROL_OLD +#undef ALLOW_DIC_CONTROL + +C Allows bathymetry as a control vector +C Note: keep this Option separated from generic control since this control +C involves many new dependencies that we would like to avoid in general. +#undef ALLOW_DEPTH_CONTROL +#ifdef ALLOW_DEPTH_CONTROL +C Only relevant within DEPTH_CONTROL code: +# define USE_SMOOTH_MIN +# undef ALLOW_HFACC_CONTROL +# undef ALLOW_HFACC3D_CONTROL +#endif /* ALLOW_DEPTH_CONTROL */ C >>> Generic Control. #undef ALLOW_GENARR2D_CONTROL #define ALLOW_GENARR3D_CONTROL #define ALLOW_GENTIM2D_CONTROL +# undef ALLOW_UVEL0_CONTROL +# undef ALLOW_VVEL0_CONTROL +# undef CTRL_SET_OLD_MAXCVARS_30 +# undef CTRL_SET_OLD_MAXCVARS_40 + +C >>> Open boundaries +#ifdef ALLOW_OBCS +C Control of Open-Boundaries is meaningless without compiling pkg/obcs +C Note: Make sure that corresponding OBCS N/S/W/E Option is defined +# define ALLOW_OBCSN_CONTROL +# define ALLOW_OBCSS_CONTROL +# define ALLOW_OBCSW_CONTROL +# define ALLOW_OBCSE_CONTROL +# undef ALLOW_OBCS_CONTROL_MODES +#endif /* ALLOW_OBCS */ + +C o Set ALLOW_OBCS_CONTROL (Do not edit/modify): +#if (defined (ALLOW_OBCSN_CONTROL) || \ + defined (ALLOW_OBCSS_CONTROL) || \ + defined (ALLOW_OBCSW_CONTROL) || \ + defined (ALLOW_OBCSE_CONTROL)) +# define ALLOW_OBCS_CONTROL +#endif + +C o Impose bounds on controls +#undef ALLOW_ADCTRLBOUND C o Rotation of wind/stress controls adjustments C from Eastward/Northward to model grid directions @@ -86,19 +99,16 @@ C The CTRL_SKIP_FIRST_TWO_ATM_REC_ALL option extends this C to the other the time variable atmospheric controls. #undef CTRL_SKIP_FIRST_TWO_ATM_REC_ALL -C o use pkg/smooth correlation operator (incl. smoother) for 2D controls (Weaver, Courtier 01) -C This CPP option just sets the default for ctrlSmoothCorrel2D to .TRUE. -#undef ALLOW_SMOOTH_CORREL2D -C o use pkg/smooth correlation operator (incl. smoother) for 3D controls (Weaver, Courtier 01) -C This CPP option just sets the default for ctrlSmoothCorrel3D to .TRUE. -#undef ALLOW_SMOOTH_CORREL3D - -C o apply pkg/ctrl/ctrl_smooth.F to 2D controls (outside of ctrlSmoothCorrel2D) -#undef ALLOW_CTRL_SMOOTH -C o apply pkg/smooth/smooth_diff2d.F to 2D controls (outside of ctrlSmoothCorrel2D) +C Note: this flag turns on extra smoothing code in ctrl_get_gen.F which +C is inconsistent with the Weaver and Courtier, 2001 algorithm, and +C should probably not be used. The corresponding 3D flag applied only +C to deprecated code that is now removed. At some point we will remove +C this flag and associated code as well. +C o apply pkg/smooth/smooth_diff2d.F to 2D controls (outside of Smooth_Correl2D) #undef ALLOW_SMOOTH_CTRL2D -C o apply pkg/smooth/smooth_diff3d.F to 3D controls (outside of ctrlSmoothCorrel3D) -#undef ALLOW_SMOOTH_CTRL3D + +C o Print more debug info to STDOUT +#undef ALLOW_CTRL_DEBUG C ================================================================== #endif /* ndef ECCO_CPPOPTIONS_H */ diff --git a/verification/halfpipe_streamice/code_ad/AUTODIFF_OPTIONS.h b/verification/halfpipe_streamice/code_ad/AUTODIFF_OPTIONS.h index 40ee010b2a..26fc19cee1 100644 --- a/verification/halfpipe_streamice/code_ad/AUTODIFF_OPTIONS.h +++ b/verification/halfpipe_streamice/code_ad/AUTODIFF_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef AUTODIFF_OPTIONS_H +#define AUTODIFF_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: AUTODIFF_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef AUTODIFF_OPTIONS_H -#define AUTODIFF_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_AUTODIFF #ifdef ECCO_CPPOPTIONS_H @@ -26,10 +26,11 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -C o Include/exclude code in order to be able to automatically -C differentiate the MITgcmUV by using the Tangent Linear and -C Adjoint Model Compiler (TAMC). +C o Include/exclude code in order to automatically differentiate MITgcm code +C using TAF (Transformation of Algorithms in Fortran, http://www.FastOpt.de) +C or using TAMC (Tangent Linear & Adjoint Model Compiler, needs both defined): #define ALLOW_AUTODIFF_TAMC +#undef AUTODIFF_TAMC_COMPATIBILITY C >>> Checkpointing as handled by TAMC #define ALLOW_TAMC_CHECKPOINTING @@ -40,19 +41,19 @@ C >>> and DYNVARS_DIAG adjoint state #undef ALLOW_AUTODIFF_MONITOR_DIAG C >>> DO 2-level checkpointing instead of 3-level -c#undef AUTODIFF_2_LEVEL_CHECKPOINT +#undef AUTODIFF_2_LEVEL_CHECKPOINT C extend to 4-level checkpointing -c#undef AUTODIFF_4_LEVEL_CHECKPOINT +#undef AUTODIFF_4_LEVEL_CHECKPOINT C o use divided adjoint to split adjoint computations #undef ALLOW_DIVIDED_ADJOINT -#undef ALLOW_PACKUNPACK_METHOD2 - C o This flag is incredibly useful as it reduces the number of C tape-files on the disc. Maybe it should even be the default. #define ALLOW_AUTODIFF_WHTAPEIO +C and related to above: +#undef ALLOW_INIT_WHTAPEIO C o use standard MDSFINDUINTS instead of local pkg/autodiff version for C WHTAPEIO code I/O. @@ -70,6 +71,10 @@ C Might still be used for OBCS since WHTAPEIO does not support OBCS fields. C o allow using viscFacInAd to recompute viscosities in AD #undef AUTODIFF_ALLOW_VISCFACADJ +C o To remove part of MOM_CALC_VISC (better name would be: MOM_DISABLE_*) +#undef AUTODIFF_DISABLE_LEITH +#undef AUTODIFF_DISABLE_REYNOLDS_SCALE + C o for output of AD-variables (ALLOW_AUTODIFF_MONITOR), specific code (e.g., C in addummy_in_stepping.F) relies on adexch_uv_xy_rs and adexch_xy_rs S/R C which might not always be generated by TAF (e.g., when controls do not diff --git a/verification/halfpipe_streamice/code_ad/COST_OPTIONS.h b/verification/halfpipe_streamice/code_ad/COST_OPTIONS.h index 05e9db3b40..46d60cbb84 100644 --- a/verification/halfpipe_streamice/code_ad/COST_OPTIONS.h +++ b/verification/halfpipe_streamice/code_ad/COST_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef COST_OPTIONS_H +#define COST_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: COST_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef COST_OPTIONS_H -#define COST_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_COST #ifdef ECCO_CPPOPTIONS_H @@ -26,50 +26,24 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -C >>> Use the EGM-96 geoid error covariance. -#undef ALLOW_EGM96_ERROR_COV -#undef ALLOW_READ_EGM_DATA +#undef ALLOW_COST_STATE_FINAL +#undef ALLOW_COST_VECTOR + C >>> Cost function contributions -#undef ALLOW_HFLUX_COST_CONTRIBUTION -#undef ALLOW_SFLUX_COST_CONTRIBUTION -#undef ALLOW_USTRESS_COST_CONTRIBUTION -#undef ALLOW_VSTRESS_COST_CONTRIBUTION -#undef ALLOW_THETA_COST_CONTRIBUTION -#undef ALLOW_SALT_COST_CONTRIBUTION -#undef ALLOW_SST_COST_CONTRIBUTION -#undef ALLOW_SSS_COST_CONTRIBUTION -#undef ALLOW_SSH_COST_CONTRIBUTION -#undef ALLOW_CTDT_COST_CONTRIBUTION -#undef ALLOW_CTDS_COST_CONTRIBUTION -#undef ALLOW_COST_ATLANTIC #undef ALLOW_COST_ATLANTIC_HEAT +#undef ALLOW_COST_ATLANTIC_HEAT_DOMASS #define ALLOW_COST_TEST #undef ALLOW_COST_TSQUARED +#undef ALLOW_COST_DEPTH #undef ALLOW_COST_TRACER -C >>> ALLOW_GENCOST_CONTRIBUTION: interactive way to add basic 2D cost -C function terms. -C > In data.ecco, this requires the specification of data file (name, -C frequency, etc.), bar file name for corresp. model average, standard -C error file name, etc. -C > In addition, adding such cost terms requires editing ecco_cost.h to -C increase NGENCOST, and editing cost_gencost_customize.F to implement -C the actual model average (i.e. the bar file content). -#undef ALLOW_GENCOST_CONTRIBUTION -C >>> free form version of GENCOST: allows one to use otherwise defined -C elements (e.g. psbar and and topex data) while taking advantage of the -C cost function/namelist slots that can be made available using -C ALLOW_GENCOST_CONTRIBUTION. To this end ALLOW_GENCOST_CONTRIBUTION -C simply switches off tests that check whether all of the gencost -C elements (e.g. gencost_barfile and gencost_datafile) are specified -C in data.ecco. -C > While this option increases flexibility within the gencost framework, -C it implies more room for error, so it should be used cautiously, and -C with good knowledge of the rest of pkg/ecco. -C > It requires providing a specific cost function routine, and editing -C cost_gencost_all.F accordingly. -#undef ALLOW_GENCOST_FREEFORM +C List these options here: +#undef ALLOW_COST_TEMP +#undef ALLOW_COST_HFLUXM +#undef ALLOW_DIC_COST +#undef ALLOW_THSICE_COST_TEST +#undef ALLOW_COST_SHELFICE C ================================================================== #endif /* ndef ECCO_CPPOPTIONS_H */ diff --git a/verification/halfpipe_streamice/code_ad/CTRL_OPTIONS.h b/verification/halfpipe_streamice/code_ad/CTRL_OPTIONS.h index ca82a962bf..65a2bf34c7 100644 --- a/verification/halfpipe_streamice/code_ad/CTRL_OPTIONS.h +++ b/verification/halfpipe_streamice/code_ad/CTRL_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef CTRL_OPTIONS_H +#define CTRL_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: CTRL_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef CTRL_OPTIONS_H -#define CTRL_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_CTRL #ifdef ECCO_CPPOPTIONS_H @@ -26,55 +26,68 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -C o Re-activate deprecated codes in pkg/ecco & pkg/ctrl (but not recommended) -C and since pkg/ctrl can be used without pkg/ecco, better to have it here -#undef ECCO_CTRL_DEPRECATED - -#undef EXCLUDE_CTRL_PACK +C o I/O and pack settings +#undef CTRL_SET_PREC_32 +C This option is only relevant (for pack/unpack) with OBCS_CONTROL: #undef ALLOW_NONDIMENSIONAL_CONTROL_IO - -C >>> Initial values. -#undef ALLOW_THETA0_CONTROL -#undef ALLOW_SALT0_CONTROL -#undef ALLOW_UVEL0_CONTROL -#undef ALLOW_VVEL0_CONTROL -#undef ALLOW_TR10_CONTROL -#undef ALLOW_TAUU0_CONTROL -#undef ALLOW_TAUV0_CONTROL -#undef ALLOW_SFLUX0_CONTROL -#undef ALLOW_HFLUX0_CONTROL -#undef ALLOW_SSS0_CONTROL -#undef ALLOW_SST0_CONTROL - -C >>> Surface fluxes. -#undef ALLOW_HFLUX_CONTROL -#undef ALLOW_SFLUX_CONTROL -#undef ALLOW_USTRESS_CONTROL -#undef ALLOW_VSTRESS_CONTROL -#undef ALLOW_SWFLUX_CONTROL -#undef ALLOW_LWFLUX_CONTROL - -C >>> Atmospheric state. -#undef ALLOW_ATEMP_CONTROL -#undef ALLOW_AQH_CONTROL -#undef ALLOW_UWIND_CONTROL -#undef ALLOW_VWIND_CONTROL -#undef ALLOW_PRECIP_CONTROL +#undef EXCLUDE_CTRL_PACK +#undef ALLOW_PACKUNPACK_METHOD2 +#undef CTRL_DO_PACK_UNPACK_ONLY +#undef CTRL_PACK_PRECISE +#undef CTRL_UNPACK_PRECISE +#undef CTRL_DELZNORM +#undef ALLOW_CTRL_WETV C >>> Other Control. -#undef ALLOW_DIFFKR_CONTROL +C Allows for GMREDI controls #undef ALLOW_KAPGM_CONTROL #undef ALLOW_KAPREDI_CONTROL +C Allows for Vertical Diffusivity controls +#undef ALLOW_DIFFKR_CONTROL #undef ALLOW_BOTTOMDRAG_CONTROL - -C >>> Backward compatibility option (before checkpoint 65p) -#undef ALLOW_KAPGM_CONTROL_OLD -#undef ALLOW_KAPREDI_CONTROL_OLD +#undef ALLOW_DIC_CONTROL + +C Allows bathymetry as a control vector +C Note: keep this Option separated from generic control since this control +C involves many new dependencies that we would like to avoid in general. +#undef ALLOW_DEPTH_CONTROL +#ifdef ALLOW_DEPTH_CONTROL +C Only relevant within DEPTH_CONTROL code: +# define USE_SMOOTH_MIN +# undef ALLOW_HFACC_CONTROL +# undef ALLOW_HFACC3D_CONTROL +#endif /* ALLOW_DEPTH_CONTROL */ C >>> Generic Control. #define ALLOW_GENARR2D_CONTROL #undef ALLOW_GENARR3D_CONTROL #define ALLOW_GENTIM2D_CONTROL +# undef ALLOW_UVEL0_CONTROL +# undef ALLOW_VVEL0_CONTROL +# undef CTRL_SET_OLD_MAXCVARS_30 +# undef CTRL_SET_OLD_MAXCVARS_40 + +C >>> Open boundaries +#ifdef ALLOW_OBCS +C Control of Open-Boundaries is meaningless without compiling pkg/obcs +C Note: Make sure that corresponding OBCS N/S/W/E Option is defined +# define ALLOW_OBCSN_CONTROL +# define ALLOW_OBCSS_CONTROL +# define ALLOW_OBCSW_CONTROL +# define ALLOW_OBCSE_CONTROL +# undef ALLOW_OBCS_CONTROL_MODES +#endif /* ALLOW_OBCS */ + +C o Set ALLOW_OBCS_CONTROL (Do not edit/modify): +#if (defined (ALLOW_OBCSN_CONTROL) || \ + defined (ALLOW_OBCSS_CONTROL) || \ + defined (ALLOW_OBCSW_CONTROL) || \ + defined (ALLOW_OBCSE_CONTROL)) +# define ALLOW_OBCS_CONTROL +#endif + +C o Impose bounds on controls +#undef ALLOW_ADCTRLBOUND C o Rotation of wind/stress controls adjustments C from Eastward/Northward to model grid directions @@ -86,19 +99,16 @@ C The CTRL_SKIP_FIRST_TWO_ATM_REC_ALL option extends this C to the other the time variable atmospheric controls. #undef CTRL_SKIP_FIRST_TWO_ATM_REC_ALL -C o use pkg/smooth correlation operator (incl. smoother) for 2D controls (Weaver, Courtier 01) -C This CPP option just sets the default for ctrlSmoothCorrel2D to .TRUE. -#undef ALLOW_SMOOTH_CORREL2D -C o use pkg/smooth correlation operator (incl. smoother) for 3D controls (Weaver, Courtier 01) -C This CPP option just sets the default for ctrlSmoothCorrel3D to .TRUE. -#undef ALLOW_SMOOTH_CORREL3D - -C o apply pkg/ctrl/ctrl_smooth.F to 2D controls (outside of ctrlSmoothCorrel2D) -#undef ALLOW_CTRL_SMOOTH -C o apply pkg/smooth/smooth_diff2d.F to 2D controls (outside of ctrlSmoothCorrel2D) +C Note: this flag turns on extra smoothing code in ctrl_get_gen.F which +C is inconsistent with the Weaver and Courtier, 2001 algorithm, and +C should probably not be used. The corresponding 3D flag applied only +C to deprecated code that is now removed. At some point we will remove +C this flag and associated code as well. +C o apply pkg/smooth/smooth_diff2d.F to 2D controls (outside of Smooth_Correl2D) #undef ALLOW_SMOOTH_CTRL2D -C o apply pkg/smooth/smooth_diff3d.F to 3D controls (outside of ctrlSmoothCorrel3D) -#undef ALLOW_SMOOTH_CTRL3D + +C o Print more debug info to STDOUT +#undef ALLOW_CTRL_DEBUG C ================================================================== #endif /* ndef ECCO_CPPOPTIONS_H */ diff --git a/verification/halfpipe_streamice/code_oad/AUTODIFF_OPTIONS.h b/verification/halfpipe_streamice/code_oad/AUTODIFF_OPTIONS.h index bf4b66e349..9ec7703152 100644 --- a/verification/halfpipe_streamice/code_oad/AUTODIFF_OPTIONS.h +++ b/verification/halfpipe_streamice/code_oad/AUTODIFF_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef AUTODIFF_OPTIONS_H +#define AUTODIFF_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: AUTODIFF_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef AUTODIFF_OPTIONS_H -#define AUTODIFF_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_AUTODIFF #ifdef ECCO_CPPOPTIONS_H @@ -26,10 +26,11 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -C o Include/exclude code in order to be able to automatically -C differentiate the MITgcmUV by using the Tangent Linear and -C Adjoint Model Compiler (TAMC). +C o Include/exclude code in order to automatically differentiate MITgcm code +C using TAF (Transformation of Algorithms in Fortran, http://www.FastOpt.de) +C or using TAMC (Tangent Linear & Adjoint Model Compiler, needs both defined): #undef ALLOW_AUTODIFF_TAMC +#undef AUTODIFF_TAMC_COMPATIBILITY C >>> Checkpointing as handled by TAMC #undef ALLOW_TAMC_CHECKPOINTING @@ -40,19 +41,19 @@ C >>> and DYNVARS_DIAG adjoint state #undef ALLOW_AUTODIFF_MONITOR_DIAG C >>> DO 2-level checkpointing instead of 3-level -c#undef AUTODIFF_2_LEVEL_CHECKPOINT +#undef AUTODIFF_2_LEVEL_CHECKPOINT C extend to 4-level checkpointing -c#undef AUTODIFF_4_LEVEL_CHECKPOINT +#undef AUTODIFF_4_LEVEL_CHECKPOINT C o use divided adjoint to split adjoint computations #undef ALLOW_DIVIDED_ADJOINT -#undef ALLOW_PACKUNPACK_METHOD2 - C o This flag is incredibly useful as it reduces the number of C tape-files on the disc. Maybe it should even be the default. #undef ALLOW_AUTODIFF_WHTAPEIO +C and related to above: +#undef ALLOW_INIT_WHTAPEIO C o use standard MDSFINDUINTS instead of local pkg/autodiff version for C WHTAPEIO code I/O. @@ -70,6 +71,10 @@ C Might still be used for OBCS since WHTAPEIO does not support OBCS fields. C o allow using viscFacInAd to recompute viscosities in AD #undef AUTODIFF_ALLOW_VISCFACADJ +C o To remove part of MOM_CALC_VISC (better name would be: MOM_DISABLE_*) +#undef AUTODIFF_DISABLE_LEITH +#undef AUTODIFF_DISABLE_REYNOLDS_SCALE + C o for output of AD-variables (ALLOW_AUTODIFF_MONITOR), specific code (e.g., C in addummy_in_stepping.F) relies on adexch_uv_xy_rs and adexch_xy_rs S/R C which might not always be generated by TAF (e.g., when controls do not diff --git a/verification/halfpipe_streamice/code_oad/COST_OPTIONS.h b/verification/halfpipe_streamice/code_oad/COST_OPTIONS.h index 05e9db3b40..46d60cbb84 100644 --- a/verification/halfpipe_streamice/code_oad/COST_OPTIONS.h +++ b/verification/halfpipe_streamice/code_oad/COST_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef COST_OPTIONS_H +#define COST_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: COST_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef COST_OPTIONS_H -#define COST_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_COST #ifdef ECCO_CPPOPTIONS_H @@ -26,50 +26,24 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -C >>> Use the EGM-96 geoid error covariance. -#undef ALLOW_EGM96_ERROR_COV -#undef ALLOW_READ_EGM_DATA +#undef ALLOW_COST_STATE_FINAL +#undef ALLOW_COST_VECTOR + C >>> Cost function contributions -#undef ALLOW_HFLUX_COST_CONTRIBUTION -#undef ALLOW_SFLUX_COST_CONTRIBUTION -#undef ALLOW_USTRESS_COST_CONTRIBUTION -#undef ALLOW_VSTRESS_COST_CONTRIBUTION -#undef ALLOW_THETA_COST_CONTRIBUTION -#undef ALLOW_SALT_COST_CONTRIBUTION -#undef ALLOW_SST_COST_CONTRIBUTION -#undef ALLOW_SSS_COST_CONTRIBUTION -#undef ALLOW_SSH_COST_CONTRIBUTION -#undef ALLOW_CTDT_COST_CONTRIBUTION -#undef ALLOW_CTDS_COST_CONTRIBUTION -#undef ALLOW_COST_ATLANTIC #undef ALLOW_COST_ATLANTIC_HEAT +#undef ALLOW_COST_ATLANTIC_HEAT_DOMASS #define ALLOW_COST_TEST #undef ALLOW_COST_TSQUARED +#undef ALLOW_COST_DEPTH #undef ALLOW_COST_TRACER -C >>> ALLOW_GENCOST_CONTRIBUTION: interactive way to add basic 2D cost -C function terms. -C > In data.ecco, this requires the specification of data file (name, -C frequency, etc.), bar file name for corresp. model average, standard -C error file name, etc. -C > In addition, adding such cost terms requires editing ecco_cost.h to -C increase NGENCOST, and editing cost_gencost_customize.F to implement -C the actual model average (i.e. the bar file content). -#undef ALLOW_GENCOST_CONTRIBUTION -C >>> free form version of GENCOST: allows one to use otherwise defined -C elements (e.g. psbar and and topex data) while taking advantage of the -C cost function/namelist slots that can be made available using -C ALLOW_GENCOST_CONTRIBUTION. To this end ALLOW_GENCOST_CONTRIBUTION -C simply switches off tests that check whether all of the gencost -C elements (e.g. gencost_barfile and gencost_datafile) are specified -C in data.ecco. -C > While this option increases flexibility within the gencost framework, -C it implies more room for error, so it should be used cautiously, and -C with good knowledge of the rest of pkg/ecco. -C > It requires providing a specific cost function routine, and editing -C cost_gencost_all.F accordingly. -#undef ALLOW_GENCOST_FREEFORM +C List these options here: +#undef ALLOW_COST_TEMP +#undef ALLOW_COST_HFLUXM +#undef ALLOW_DIC_COST +#undef ALLOW_THSICE_COST_TEST +#undef ALLOW_COST_SHELFICE C ================================================================== #endif /* ndef ECCO_CPPOPTIONS_H */ diff --git a/verification/halfpipe_streamice/code_oad/CTRL_OPTIONS.h b/verification/halfpipe_streamice/code_oad/CTRL_OPTIONS.h index ca82a962bf..65a2bf34c7 100644 --- a/verification/halfpipe_streamice/code_oad/CTRL_OPTIONS.h +++ b/verification/halfpipe_streamice/code_oad/CTRL_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef CTRL_OPTIONS_H +#define CTRL_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: CTRL_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef CTRL_OPTIONS_H -#define CTRL_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_CTRL #ifdef ECCO_CPPOPTIONS_H @@ -26,55 +26,68 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -C o Re-activate deprecated codes in pkg/ecco & pkg/ctrl (but not recommended) -C and since pkg/ctrl can be used without pkg/ecco, better to have it here -#undef ECCO_CTRL_DEPRECATED - -#undef EXCLUDE_CTRL_PACK +C o I/O and pack settings +#undef CTRL_SET_PREC_32 +C This option is only relevant (for pack/unpack) with OBCS_CONTROL: #undef ALLOW_NONDIMENSIONAL_CONTROL_IO - -C >>> Initial values. -#undef ALLOW_THETA0_CONTROL -#undef ALLOW_SALT0_CONTROL -#undef ALLOW_UVEL0_CONTROL -#undef ALLOW_VVEL0_CONTROL -#undef ALLOW_TR10_CONTROL -#undef ALLOW_TAUU0_CONTROL -#undef ALLOW_TAUV0_CONTROL -#undef ALLOW_SFLUX0_CONTROL -#undef ALLOW_HFLUX0_CONTROL -#undef ALLOW_SSS0_CONTROL -#undef ALLOW_SST0_CONTROL - -C >>> Surface fluxes. -#undef ALLOW_HFLUX_CONTROL -#undef ALLOW_SFLUX_CONTROL -#undef ALLOW_USTRESS_CONTROL -#undef ALLOW_VSTRESS_CONTROL -#undef ALLOW_SWFLUX_CONTROL -#undef ALLOW_LWFLUX_CONTROL - -C >>> Atmospheric state. -#undef ALLOW_ATEMP_CONTROL -#undef ALLOW_AQH_CONTROL -#undef ALLOW_UWIND_CONTROL -#undef ALLOW_VWIND_CONTROL -#undef ALLOW_PRECIP_CONTROL +#undef EXCLUDE_CTRL_PACK +#undef ALLOW_PACKUNPACK_METHOD2 +#undef CTRL_DO_PACK_UNPACK_ONLY +#undef CTRL_PACK_PRECISE +#undef CTRL_UNPACK_PRECISE +#undef CTRL_DELZNORM +#undef ALLOW_CTRL_WETV C >>> Other Control. -#undef ALLOW_DIFFKR_CONTROL +C Allows for GMREDI controls #undef ALLOW_KAPGM_CONTROL #undef ALLOW_KAPREDI_CONTROL +C Allows for Vertical Diffusivity controls +#undef ALLOW_DIFFKR_CONTROL #undef ALLOW_BOTTOMDRAG_CONTROL - -C >>> Backward compatibility option (before checkpoint 65p) -#undef ALLOW_KAPGM_CONTROL_OLD -#undef ALLOW_KAPREDI_CONTROL_OLD +#undef ALLOW_DIC_CONTROL + +C Allows bathymetry as a control vector +C Note: keep this Option separated from generic control since this control +C involves many new dependencies that we would like to avoid in general. +#undef ALLOW_DEPTH_CONTROL +#ifdef ALLOW_DEPTH_CONTROL +C Only relevant within DEPTH_CONTROL code: +# define USE_SMOOTH_MIN +# undef ALLOW_HFACC_CONTROL +# undef ALLOW_HFACC3D_CONTROL +#endif /* ALLOW_DEPTH_CONTROL */ C >>> Generic Control. #define ALLOW_GENARR2D_CONTROL #undef ALLOW_GENARR3D_CONTROL #define ALLOW_GENTIM2D_CONTROL +# undef ALLOW_UVEL0_CONTROL +# undef ALLOW_VVEL0_CONTROL +# undef CTRL_SET_OLD_MAXCVARS_30 +# undef CTRL_SET_OLD_MAXCVARS_40 + +C >>> Open boundaries +#ifdef ALLOW_OBCS +C Control of Open-Boundaries is meaningless without compiling pkg/obcs +C Note: Make sure that corresponding OBCS N/S/W/E Option is defined +# define ALLOW_OBCSN_CONTROL +# define ALLOW_OBCSS_CONTROL +# define ALLOW_OBCSW_CONTROL +# define ALLOW_OBCSE_CONTROL +# undef ALLOW_OBCS_CONTROL_MODES +#endif /* ALLOW_OBCS */ + +C o Set ALLOW_OBCS_CONTROL (Do not edit/modify): +#if (defined (ALLOW_OBCSN_CONTROL) || \ + defined (ALLOW_OBCSS_CONTROL) || \ + defined (ALLOW_OBCSW_CONTROL) || \ + defined (ALLOW_OBCSE_CONTROL)) +# define ALLOW_OBCS_CONTROL +#endif + +C o Impose bounds on controls +#undef ALLOW_ADCTRLBOUND C o Rotation of wind/stress controls adjustments C from Eastward/Northward to model grid directions @@ -86,19 +99,16 @@ C The CTRL_SKIP_FIRST_TWO_ATM_REC_ALL option extends this C to the other the time variable atmospheric controls. #undef CTRL_SKIP_FIRST_TWO_ATM_REC_ALL -C o use pkg/smooth correlation operator (incl. smoother) for 2D controls (Weaver, Courtier 01) -C This CPP option just sets the default for ctrlSmoothCorrel2D to .TRUE. -#undef ALLOW_SMOOTH_CORREL2D -C o use pkg/smooth correlation operator (incl. smoother) for 3D controls (Weaver, Courtier 01) -C This CPP option just sets the default for ctrlSmoothCorrel3D to .TRUE. -#undef ALLOW_SMOOTH_CORREL3D - -C o apply pkg/ctrl/ctrl_smooth.F to 2D controls (outside of ctrlSmoothCorrel2D) -#undef ALLOW_CTRL_SMOOTH -C o apply pkg/smooth/smooth_diff2d.F to 2D controls (outside of ctrlSmoothCorrel2D) +C Note: this flag turns on extra smoothing code in ctrl_get_gen.F which +C is inconsistent with the Weaver and Courtier, 2001 algorithm, and +C should probably not be used. The corresponding 3D flag applied only +C to deprecated code that is now removed. At some point we will remove +C this flag and associated code as well. +C o apply pkg/smooth/smooth_diff2d.F to 2D controls (outside of Smooth_Correl2D) #undef ALLOW_SMOOTH_CTRL2D -C o apply pkg/smooth/smooth_diff3d.F to 3D controls (outside of ctrlSmoothCorrel3D) -#undef ALLOW_SMOOTH_CTRL3D + +C o Print more debug info to STDOUT +#undef ALLOW_CTRL_DEBUG C ================================================================== #endif /* ndef ECCO_CPPOPTIONS_H */ diff --git a/verification/halfpipe_streamice/code_tap/AUTODIFF_OPTIONS.h b/verification/halfpipe_streamice/code_tap/AUTODIFF_OPTIONS.h index 25929397b4..b9b62682c6 100644 --- a/verification/halfpipe_streamice/code_tap/AUTODIFF_OPTIONS.h +++ b/verification/halfpipe_streamice/code_tap/AUTODIFF_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef AUTODIFF_OPTIONS_H +#define AUTODIFF_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: AUTODIFF_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef AUTODIFF_OPTIONS_H -#define AUTODIFF_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_AUTODIFF #ifdef ECCO_CPPOPTIONS_H @@ -26,10 +26,11 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -C o Include/exclude code in order to be able to automatically -C differentiate the MITgcmUV by using the Tangent Linear and -C Adjoint Model Compiler (TAMC). +C o Include/exclude code in order to automatically differentiate MITgcm code +C using TAF (Transformation of Algorithms in Fortran, http://www.FastOpt.de) +C or using TAMC (Tangent Linear & Adjoint Model Compiler, needs both defined): #undef ALLOW_AUTODIFF_TAMC +#undef AUTODIFF_TAMC_COMPATIBILITY C >>> Checkpointing as handled by TAMC #undef ALLOW_TAMC_CHECKPOINTING @@ -40,19 +41,19 @@ C >>> and DYNVARS_DIAG adjoint state #undef ALLOW_AUTODIFF_MONITOR_DIAG C >>> DO 2-level checkpointing instead of 3-level -c#undef AUTODIFF_2_LEVEL_CHECKPOINT +#undef AUTODIFF_2_LEVEL_CHECKPOINT C extend to 4-level checkpointing -c#undef AUTODIFF_4_LEVEL_CHECKPOINT +#undef AUTODIFF_4_LEVEL_CHECKPOINT C o use divided adjoint to split adjoint computations #undef ALLOW_DIVIDED_ADJOINT -#undef ALLOW_PACKUNPACK_METHOD2 - C o This flag is incredibly useful as it reduces the number of C tape-files on the disc. Maybe it should even be the default. #undef ALLOW_AUTODIFF_WHTAPEIO +C and related to above: +#undef ALLOW_INIT_WHTAPEIO C o use standard MDSFINDUINTS instead of local pkg/autodiff version for C WHTAPEIO code I/O. @@ -70,6 +71,10 @@ C Might still be used for OBCS since WHTAPEIO does not support OBCS fields. C o allow using viscFacInAd to recompute viscosities in AD #undef AUTODIFF_ALLOW_VISCFACADJ +C o To remove part of MOM_CALC_VISC (better name would be: MOM_DISABLE_*) +#undef AUTODIFF_DISABLE_LEITH +#undef AUTODIFF_DISABLE_REYNOLDS_SCALE + C o for output of AD-variables (ALLOW_AUTODIFF_MONITOR), specific code (e.g., C in addummy_in_stepping.F) relies on adexch_uv_xy_rs and adexch_xy_rs S/R C which might not always be generated by TAF (e.g., when controls do not diff --git a/verification/halfpipe_streamice/code_tap/COST_OPTIONS.h b/verification/halfpipe_streamice/code_tap/COST_OPTIONS.h index 05e9db3b40..46d60cbb84 100644 --- a/verification/halfpipe_streamice/code_tap/COST_OPTIONS.h +++ b/verification/halfpipe_streamice/code_tap/COST_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef COST_OPTIONS_H +#define COST_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: COST_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef COST_OPTIONS_H -#define COST_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_COST #ifdef ECCO_CPPOPTIONS_H @@ -26,50 +26,24 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -C >>> Use the EGM-96 geoid error covariance. -#undef ALLOW_EGM96_ERROR_COV -#undef ALLOW_READ_EGM_DATA +#undef ALLOW_COST_STATE_FINAL +#undef ALLOW_COST_VECTOR + C >>> Cost function contributions -#undef ALLOW_HFLUX_COST_CONTRIBUTION -#undef ALLOW_SFLUX_COST_CONTRIBUTION -#undef ALLOW_USTRESS_COST_CONTRIBUTION -#undef ALLOW_VSTRESS_COST_CONTRIBUTION -#undef ALLOW_THETA_COST_CONTRIBUTION -#undef ALLOW_SALT_COST_CONTRIBUTION -#undef ALLOW_SST_COST_CONTRIBUTION -#undef ALLOW_SSS_COST_CONTRIBUTION -#undef ALLOW_SSH_COST_CONTRIBUTION -#undef ALLOW_CTDT_COST_CONTRIBUTION -#undef ALLOW_CTDS_COST_CONTRIBUTION -#undef ALLOW_COST_ATLANTIC #undef ALLOW_COST_ATLANTIC_HEAT +#undef ALLOW_COST_ATLANTIC_HEAT_DOMASS #define ALLOW_COST_TEST #undef ALLOW_COST_TSQUARED +#undef ALLOW_COST_DEPTH #undef ALLOW_COST_TRACER -C >>> ALLOW_GENCOST_CONTRIBUTION: interactive way to add basic 2D cost -C function terms. -C > In data.ecco, this requires the specification of data file (name, -C frequency, etc.), bar file name for corresp. model average, standard -C error file name, etc. -C > In addition, adding such cost terms requires editing ecco_cost.h to -C increase NGENCOST, and editing cost_gencost_customize.F to implement -C the actual model average (i.e. the bar file content). -#undef ALLOW_GENCOST_CONTRIBUTION -C >>> free form version of GENCOST: allows one to use otherwise defined -C elements (e.g. psbar and and topex data) while taking advantage of the -C cost function/namelist slots that can be made available using -C ALLOW_GENCOST_CONTRIBUTION. To this end ALLOW_GENCOST_CONTRIBUTION -C simply switches off tests that check whether all of the gencost -C elements (e.g. gencost_barfile and gencost_datafile) are specified -C in data.ecco. -C > While this option increases flexibility within the gencost framework, -C it implies more room for error, so it should be used cautiously, and -C with good knowledge of the rest of pkg/ecco. -C > It requires providing a specific cost function routine, and editing -C cost_gencost_all.F accordingly. -#undef ALLOW_GENCOST_FREEFORM +C List these options here: +#undef ALLOW_COST_TEMP +#undef ALLOW_COST_HFLUXM +#undef ALLOW_DIC_COST +#undef ALLOW_THSICE_COST_TEST +#undef ALLOW_COST_SHELFICE C ================================================================== #endif /* ndef ECCO_CPPOPTIONS_H */ diff --git a/verification/halfpipe_streamice/code_tap/CTRL_OPTIONS.h b/verification/halfpipe_streamice/code_tap/CTRL_OPTIONS.h index ca82a962bf..65a2bf34c7 100644 --- a/verification/halfpipe_streamice/code_tap/CTRL_OPTIONS.h +++ b/verification/halfpipe_streamice/code_tap/CTRL_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef CTRL_OPTIONS_H +#define CTRL_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: CTRL_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef CTRL_OPTIONS_H -#define CTRL_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_CTRL #ifdef ECCO_CPPOPTIONS_H @@ -26,55 +26,68 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -C o Re-activate deprecated codes in pkg/ecco & pkg/ctrl (but not recommended) -C and since pkg/ctrl can be used without pkg/ecco, better to have it here -#undef ECCO_CTRL_DEPRECATED - -#undef EXCLUDE_CTRL_PACK +C o I/O and pack settings +#undef CTRL_SET_PREC_32 +C This option is only relevant (for pack/unpack) with OBCS_CONTROL: #undef ALLOW_NONDIMENSIONAL_CONTROL_IO - -C >>> Initial values. -#undef ALLOW_THETA0_CONTROL -#undef ALLOW_SALT0_CONTROL -#undef ALLOW_UVEL0_CONTROL -#undef ALLOW_VVEL0_CONTROL -#undef ALLOW_TR10_CONTROL -#undef ALLOW_TAUU0_CONTROL -#undef ALLOW_TAUV0_CONTROL -#undef ALLOW_SFLUX0_CONTROL -#undef ALLOW_HFLUX0_CONTROL -#undef ALLOW_SSS0_CONTROL -#undef ALLOW_SST0_CONTROL - -C >>> Surface fluxes. -#undef ALLOW_HFLUX_CONTROL -#undef ALLOW_SFLUX_CONTROL -#undef ALLOW_USTRESS_CONTROL -#undef ALLOW_VSTRESS_CONTROL -#undef ALLOW_SWFLUX_CONTROL -#undef ALLOW_LWFLUX_CONTROL - -C >>> Atmospheric state. -#undef ALLOW_ATEMP_CONTROL -#undef ALLOW_AQH_CONTROL -#undef ALLOW_UWIND_CONTROL -#undef ALLOW_VWIND_CONTROL -#undef ALLOW_PRECIP_CONTROL +#undef EXCLUDE_CTRL_PACK +#undef ALLOW_PACKUNPACK_METHOD2 +#undef CTRL_DO_PACK_UNPACK_ONLY +#undef CTRL_PACK_PRECISE +#undef CTRL_UNPACK_PRECISE +#undef CTRL_DELZNORM +#undef ALLOW_CTRL_WETV C >>> Other Control. -#undef ALLOW_DIFFKR_CONTROL +C Allows for GMREDI controls #undef ALLOW_KAPGM_CONTROL #undef ALLOW_KAPREDI_CONTROL +C Allows for Vertical Diffusivity controls +#undef ALLOW_DIFFKR_CONTROL #undef ALLOW_BOTTOMDRAG_CONTROL - -C >>> Backward compatibility option (before checkpoint 65p) -#undef ALLOW_KAPGM_CONTROL_OLD -#undef ALLOW_KAPREDI_CONTROL_OLD +#undef ALLOW_DIC_CONTROL + +C Allows bathymetry as a control vector +C Note: keep this Option separated from generic control since this control +C involves many new dependencies that we would like to avoid in general. +#undef ALLOW_DEPTH_CONTROL +#ifdef ALLOW_DEPTH_CONTROL +C Only relevant within DEPTH_CONTROL code: +# define USE_SMOOTH_MIN +# undef ALLOW_HFACC_CONTROL +# undef ALLOW_HFACC3D_CONTROL +#endif /* ALLOW_DEPTH_CONTROL */ C >>> Generic Control. #define ALLOW_GENARR2D_CONTROL #undef ALLOW_GENARR3D_CONTROL #define ALLOW_GENTIM2D_CONTROL +# undef ALLOW_UVEL0_CONTROL +# undef ALLOW_VVEL0_CONTROL +# undef CTRL_SET_OLD_MAXCVARS_30 +# undef CTRL_SET_OLD_MAXCVARS_40 + +C >>> Open boundaries +#ifdef ALLOW_OBCS +C Control of Open-Boundaries is meaningless without compiling pkg/obcs +C Note: Make sure that corresponding OBCS N/S/W/E Option is defined +# define ALLOW_OBCSN_CONTROL +# define ALLOW_OBCSS_CONTROL +# define ALLOW_OBCSW_CONTROL +# define ALLOW_OBCSE_CONTROL +# undef ALLOW_OBCS_CONTROL_MODES +#endif /* ALLOW_OBCS */ + +C o Set ALLOW_OBCS_CONTROL (Do not edit/modify): +#if (defined (ALLOW_OBCSN_CONTROL) || \ + defined (ALLOW_OBCSS_CONTROL) || \ + defined (ALLOW_OBCSW_CONTROL) || \ + defined (ALLOW_OBCSE_CONTROL)) +# define ALLOW_OBCS_CONTROL +#endif + +C o Impose bounds on controls +#undef ALLOW_ADCTRLBOUND C o Rotation of wind/stress controls adjustments C from Eastward/Northward to model grid directions @@ -86,19 +99,16 @@ C The CTRL_SKIP_FIRST_TWO_ATM_REC_ALL option extends this C to the other the time variable atmospheric controls. #undef CTRL_SKIP_FIRST_TWO_ATM_REC_ALL -C o use pkg/smooth correlation operator (incl. smoother) for 2D controls (Weaver, Courtier 01) -C This CPP option just sets the default for ctrlSmoothCorrel2D to .TRUE. -#undef ALLOW_SMOOTH_CORREL2D -C o use pkg/smooth correlation operator (incl. smoother) for 3D controls (Weaver, Courtier 01) -C This CPP option just sets the default for ctrlSmoothCorrel3D to .TRUE. -#undef ALLOW_SMOOTH_CORREL3D - -C o apply pkg/ctrl/ctrl_smooth.F to 2D controls (outside of ctrlSmoothCorrel2D) -#undef ALLOW_CTRL_SMOOTH -C o apply pkg/smooth/smooth_diff2d.F to 2D controls (outside of ctrlSmoothCorrel2D) +C Note: this flag turns on extra smoothing code in ctrl_get_gen.F which +C is inconsistent with the Weaver and Courtier, 2001 algorithm, and +C should probably not be used. The corresponding 3D flag applied only +C to deprecated code that is now removed. At some point we will remove +C this flag and associated code as well. +C o apply pkg/smooth/smooth_diff2d.F to 2D controls (outside of Smooth_Correl2D) #undef ALLOW_SMOOTH_CTRL2D -C o apply pkg/smooth/smooth_diff3d.F to 3D controls (outside of ctrlSmoothCorrel3D) -#undef ALLOW_SMOOTH_CTRL3D + +C o Print more debug info to STDOUT +#undef ALLOW_CTRL_DEBUG C ================================================================== #endif /* ndef ECCO_CPPOPTIONS_H */ diff --git a/verification/hs94.1x64x5/code_ad/AUTODIFF_OPTIONS.h b/verification/hs94.1x64x5/code_ad/AUTODIFF_OPTIONS.h index 1c27b66694..7f663ec9c3 100644 --- a/verification/hs94.1x64x5/code_ad/AUTODIFF_OPTIONS.h +++ b/verification/hs94.1x64x5/code_ad/AUTODIFF_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef AUTODIFF_OPTIONS_H +#define AUTODIFF_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: AUTODIFF_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef AUTODIFF_OPTIONS_H -#define AUTODIFF_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_AUTODIFF #ifdef ECCO_CPPOPTIONS_H @@ -26,10 +26,11 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -C o Include/exclude code in order to be able to automatically -C differentiate the MITgcmUV by using the Tangent Linear and -C Adjoint Model Compiler (TAMC). +C o Include/exclude code in order to automatically differentiate MITgcm code +C using TAF (Transformation of Algorithms in Fortran, http://www.FastOpt.de) +C or using TAMC (Tangent Linear & Adjoint Model Compiler, needs both defined): #define ALLOW_AUTODIFF_TAMC +#undef AUTODIFF_TAMC_COMPATIBILITY C >>> Checkpointing as handled by TAMC #undef ALLOW_TAMC_CHECKPOINTING @@ -40,19 +41,19 @@ C >>> and DYNVARS_DIAG adjoint state #undef ALLOW_AUTODIFF_MONITOR_DIAG C >>> DO 2-level checkpointing instead of 3-level -c#undef AUTODIFF_2_LEVEL_CHECKPOINT +#undef AUTODIFF_2_LEVEL_CHECKPOINT C extend to 4-level checkpointing -c#undef AUTODIFF_4_LEVEL_CHECKPOINT +#undef AUTODIFF_4_LEVEL_CHECKPOINT C o use divided adjoint to split adjoint computations #undef ALLOW_DIVIDED_ADJOINT -#undef ALLOW_PACKUNPACK_METHOD2 - C o This flag is incredibly useful as it reduces the number of C tape-files on the disc. Maybe it should even be the default. #define ALLOW_AUTODIFF_WHTAPEIO +C and related to above: +#undef ALLOW_INIT_WHTAPEIO C o use standard MDSFINDUINTS instead of local pkg/autodiff version for C WHTAPEIO code I/O. @@ -70,6 +71,10 @@ C Might still be used for OBCS since WHTAPEIO does not support OBCS fields. C o allow using viscFacInAd to recompute viscosities in AD #define AUTODIFF_ALLOW_VISCFACADJ +C o To remove part of MOM_CALC_VISC (better name would be: MOM_DISABLE_*) +#undef AUTODIFF_DISABLE_LEITH +#undef AUTODIFF_DISABLE_REYNOLDS_SCALE + C o for output of AD-variables (ALLOW_AUTODIFF_MONITOR), specific code (e.g., C in addummy_in_stepping.F) relies on adexch_uv_xy_rs and adexch_xy_rs S/R C which might not always be generated by TAF (e.g., when controls do not diff --git a/verification/hs94.1x64x5/code_ad/COST_OPTIONS.h b/verification/hs94.1x64x5/code_ad/COST_OPTIONS.h index 5fae17fbc1..46d60cbb84 100644 --- a/verification/hs94.1x64x5/code_ad/COST_OPTIONS.h +++ b/verification/hs94.1x64x5/code_ad/COST_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef COST_OPTIONS_H +#define COST_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: COST_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef COST_OPTIONS_H -#define COST_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_COST #ifdef ECCO_CPPOPTIONS_H @@ -26,49 +26,24 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -C >>> Use the EGM-96 geoid error covariance. -#undef ALLOW_EGM96_ERROR_COV -#undef ALLOW_READ_EGM_DATA +#undef ALLOW_COST_STATE_FINAL +#undef ALLOW_COST_VECTOR + C >>> Cost function contributions -#undef ALLOW_HFLUX_COST_CONTRIBUTION -#undef ALLOW_SFLUX_COST_CONTRIBUTION -#undef ALLOW_USTRESS_COST_CONTRIBUTION -#undef ALLOW_VSTRESS_COST_CONTRIBUTION -#undef ALLOW_THETA_COST_CONTRIBUTION -#undef ALLOW_SALT_COST_CONTRIBUTION -#undef ALLOW_SST_COST_CONTRIBUTION -#undef ALLOW_SSS_COST_CONTRIBUTION -#undef ALLOW_SSH_COST_CONTRIBUTION -#undef ALLOW_CTDT_COST_CONTRIBUTION -#undef ALLOW_CTDS_COST_CONTRIBUTION -#undef ALLOW_COST_ATLANTIC +#undef ALLOW_COST_ATLANTIC_HEAT +#undef ALLOW_COST_ATLANTIC_HEAT_DOMASS #define ALLOW_COST_TEST #undef ALLOW_COST_TSQUARED +#undef ALLOW_COST_DEPTH #undef ALLOW_COST_TRACER -C >>> ALLOW_GENCOST_CONTRIBUTION: interactive way to add basic 2D cost -C function terms. -C > In data.ecco, this requires the specification of data file (name, -C frequency, etc.), bar file name for corresp. model average, standard -C error file name, etc. -C > In addition, adding such cost terms requires editing ecco_cost.h to -C increase NGENCOST, and editing cost_gencost_customize.F to implement -C the actual model average (i.e. the bar file content). -#undef ALLOW_GENCOST_CONTRIBUTION -C >>> free form version of GENCOST: allows one to use otherwise defined -C elements (e.g. psbar and and topex data) while taking advantage of the -C cost function/namelist slots that can be made available using -C ALLOW_GENCOST_CONTRIBUTION. To this end ALLOW_GENCOST_CONTRIBUTION -C simply switches off tests that check whether all of the gencost -C elements (e.g. gencost_barfile and gencost_datafile) are specified -C in data.ecco. -C > While this option increases flexibility within the gencost framework, -C it implies more room for error, so it should be used cautiously, and -C with good knowledge of the rest of pkg/ecco. -C > It requires providing a specific cost function routine, and editing -C cost_gencost_all.F accordingly. -#undef ALLOW_GENCOST_FREEFORM +C List these options here: +#undef ALLOW_COST_TEMP +#undef ALLOW_COST_HFLUXM +#undef ALLOW_DIC_COST +#undef ALLOW_THSICE_COST_TEST +#undef ALLOW_COST_SHELFICE C ================================================================== #endif /* ndef ECCO_CPPOPTIONS_H */ diff --git a/verification/hs94.1x64x5/code_oad/AUTODIFF_OPTIONS.h b/verification/hs94.1x64x5/code_oad/AUTODIFF_OPTIONS.h index 9f494e7955..85e0653c72 100644 --- a/verification/hs94.1x64x5/code_oad/AUTODIFF_OPTIONS.h +++ b/verification/hs94.1x64x5/code_oad/AUTODIFF_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef AUTODIFF_OPTIONS_H +#define AUTODIFF_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: AUTODIFF_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef AUTODIFF_OPTIONS_H -#define AUTODIFF_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_AUTODIFF #ifdef ECCO_CPPOPTIONS_H @@ -26,10 +26,11 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -C o Include/exclude code in order to be able to automatically -C differentiate the MITgcmUV by using the Tangent Linear and -C Adjoint Model Compiler (TAMC). +C o Include/exclude code in order to automatically differentiate MITgcm code +C using TAF (Transformation of Algorithms in Fortran, http://www.FastOpt.de) +C or using TAMC (Tangent Linear & Adjoint Model Compiler, needs both defined): #undef ALLOW_AUTODIFF_TAMC +#undef AUTODIFF_TAMC_COMPATIBILITY C >>> Checkpointing as handled by TAMC #define ALLOW_TAMC_CHECKPOINTING @@ -40,19 +41,19 @@ C >>> and DYNVARS_DIAG adjoint state #undef ALLOW_AUTODIFF_MONITOR_DIAG C >>> DO 2-level checkpointing instead of 3-level -c#undef AUTODIFF_2_LEVEL_CHECKPOINT +#undef AUTODIFF_2_LEVEL_CHECKPOINT C extend to 4-level checkpointing -c#undef AUTODIFF_4_LEVEL_CHECKPOINT +#undef AUTODIFF_4_LEVEL_CHECKPOINT C o use divided adjoint to split adjoint computations #undef ALLOW_DIVIDED_ADJOINT -#undef ALLOW_PACKUNPACK_METHOD2 - C o This flag is incredibly useful as it reduces the number of C tape-files on the disc. Maybe it should even be the default. #undef ALLOW_AUTODIFF_WHTAPEIO +C and related to above: +#undef ALLOW_INIT_WHTAPEIO C o use standard MDSFINDUINTS instead of local pkg/autodiff version for C WHTAPEIO code I/O. @@ -67,12 +68,13 @@ C Might still be used for OBCS since WHTAPEIO does not support OBCS fields. #undef AUTODIFF_USE_STORE_RESTORE #undef AUTODIFF_USE_STORE_RESTORE_OBCS -C o write separate tape files for each ptracer (has no effect, to be removed) -#undef AUTODIFF_PTRACERS_SPLIT_FILES - C o allow using viscFacInAd to recompute viscosities in AD #undef AUTODIFF_ALLOW_VISCFACADJ +C o To remove part of MOM_CALC_VISC (better name would be: MOM_DISABLE_*) +#undef AUTODIFF_DISABLE_LEITH +#undef AUTODIFF_DISABLE_REYNOLDS_SCALE + C o for output of AD-variables (ALLOW_AUTODIFF_MONITOR), specific code (e.g., C in addummy_in_stepping.F) relies on adexch_uv_xy_rs and adexch_xy_rs S/R C which might not always be generated by TAF (e.g., when controls do not diff --git a/verification/hs94.1x64x5/code_oad/COST_OPTIONS.h b/verification/hs94.1x64x5/code_oad/COST_OPTIONS.h index 5fae17fbc1..46d60cbb84 100644 --- a/verification/hs94.1x64x5/code_oad/COST_OPTIONS.h +++ b/verification/hs94.1x64x5/code_oad/COST_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef COST_OPTIONS_H +#define COST_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: COST_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef COST_OPTIONS_H -#define COST_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_COST #ifdef ECCO_CPPOPTIONS_H @@ -26,49 +26,24 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -C >>> Use the EGM-96 geoid error covariance. -#undef ALLOW_EGM96_ERROR_COV -#undef ALLOW_READ_EGM_DATA +#undef ALLOW_COST_STATE_FINAL +#undef ALLOW_COST_VECTOR + C >>> Cost function contributions -#undef ALLOW_HFLUX_COST_CONTRIBUTION -#undef ALLOW_SFLUX_COST_CONTRIBUTION -#undef ALLOW_USTRESS_COST_CONTRIBUTION -#undef ALLOW_VSTRESS_COST_CONTRIBUTION -#undef ALLOW_THETA_COST_CONTRIBUTION -#undef ALLOW_SALT_COST_CONTRIBUTION -#undef ALLOW_SST_COST_CONTRIBUTION -#undef ALLOW_SSS_COST_CONTRIBUTION -#undef ALLOW_SSH_COST_CONTRIBUTION -#undef ALLOW_CTDT_COST_CONTRIBUTION -#undef ALLOW_CTDS_COST_CONTRIBUTION -#undef ALLOW_COST_ATLANTIC +#undef ALLOW_COST_ATLANTIC_HEAT +#undef ALLOW_COST_ATLANTIC_HEAT_DOMASS #define ALLOW_COST_TEST #undef ALLOW_COST_TSQUARED +#undef ALLOW_COST_DEPTH #undef ALLOW_COST_TRACER -C >>> ALLOW_GENCOST_CONTRIBUTION: interactive way to add basic 2D cost -C function terms. -C > In data.ecco, this requires the specification of data file (name, -C frequency, etc.), bar file name for corresp. model average, standard -C error file name, etc. -C > In addition, adding such cost terms requires editing ecco_cost.h to -C increase NGENCOST, and editing cost_gencost_customize.F to implement -C the actual model average (i.e. the bar file content). -#undef ALLOW_GENCOST_CONTRIBUTION -C >>> free form version of GENCOST: allows one to use otherwise defined -C elements (e.g. psbar and and topex data) while taking advantage of the -C cost function/namelist slots that can be made available using -C ALLOW_GENCOST_CONTRIBUTION. To this end ALLOW_GENCOST_CONTRIBUTION -C simply switches off tests that check whether all of the gencost -C elements (e.g. gencost_barfile and gencost_datafile) are specified -C in data.ecco. -C > While this option increases flexibility within the gencost framework, -C it implies more room for error, so it should be used cautiously, and -C with good knowledge of the rest of pkg/ecco. -C > It requires providing a specific cost function routine, and editing -C cost_gencost_all.F accordingly. -#undef ALLOW_GENCOST_FREEFORM +C List these options here: +#undef ALLOW_COST_TEMP +#undef ALLOW_COST_HFLUXM +#undef ALLOW_DIC_COST +#undef ALLOW_THSICE_COST_TEST +#undef ALLOW_COST_SHELFICE C ================================================================== #endif /* ndef ECCO_CPPOPTIONS_H */ diff --git a/verification/isomip/code_ad/COST_OPTIONS.h b/verification/isomip/code_ad/COST_OPTIONS.h index 41c6475da2..64a1943d48 100644 --- a/verification/isomip/code_ad/COST_OPTIONS.h +++ b/verification/isomip/code_ad/COST_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef COST_OPTIONS_H +#define COST_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: COST_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef COST_OPTIONS_H -#define COST_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_COST #ifdef ECCO_CPPOPTIONS_H @@ -26,50 +26,24 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -C >>> Use the EGM-96 geoid error covariance. -#undef ALLOW_EGM96_ERROR_COV -#undef ALLOW_READ_EGM_DATA +#undef ALLOW_COST_STATE_FINAL +#undef ALLOW_COST_VECTOR + C >>> Cost function contributions -#undef ALLOW_HFLUX_COST_CONTRIBUTION -#undef ALLOW_SFLUX_COST_CONTRIBUTION -#undef ALLOW_USTRESS_COST_CONTRIBUTION -#undef ALLOW_VSTRESS_COST_CONTRIBUTION -#undef ALLOW_THETA_COST_CONTRIBUTION -#undef ALLOW_SALT_COST_CONTRIBUTION -#undef ALLOW_SST_COST_CONTRIBUTION -#undef ALLOW_SSS_COST_CONTRIBUTION -#undef ALLOW_SSH_COST_CONTRIBUTION -#undef ALLOW_CTDT_COST_CONTRIBUTION -#undef ALLOW_CTDS_COST_CONTRIBUTION -#undef ALLOW_COST_ATLANTIC #undef ALLOW_COST_ATLANTIC_HEAT +#undef ALLOW_COST_ATLANTIC_HEAT_DOMASS #define ALLOW_COST_TEST #define ALLOW_COST_TSQUARED +#undef ALLOW_COST_DEPTH #undef ALLOW_COST_TRACER -C >>> ALLOW_GENCOST_CONTRIBUTION: interactive way to add basic 2D cost -C function terms. -C > In data.ecco, this requires the specification of data file (name, -C frequency, etc.), bar file name for corresp. model average, standard -C error file name, etc. -C > In addition, adding such cost terms requires editing ecco_cost.h to -C increase NGENCOST, and editing cost_gencost_customize.F to implement -C the actual model average (i.e. the bar file content). -#undef ALLOW_GENCOST_CONTRIBUTION -C >>> free form version of GENCOST: allows one to use otherwise defined -C elements (e.g. psbar and and topex data) while taking advantage of the -C cost function/namelist slots that can be made available using -C ALLOW_GENCOST_CONTRIBUTION. To this end ALLOW_GENCOST_CONTRIBUTION -C simply switches off tests that check whether all of the gencost -C elements (e.g. gencost_barfile and gencost_datafile) are specified -C in data.ecco. -C > While this option increases flexibility within the gencost framework, -C it implies more room for error, so it should be used cautiously, and -C with good knowledge of the rest of pkg/ecco. -C > It requires providing a specific cost function routine, and editing -C cost_gencost_all.F accordingly. -#undef ALLOW_GENCOST_FREEFORM +C List these options here: +#undef ALLOW_COST_TEMP +#undef ALLOW_COST_HFLUXM +#undef ALLOW_DIC_COST +#undef ALLOW_THSICE_COST_TEST +#undef ALLOW_COST_SHELFICE C ================================================================== #endif /* ndef ECCO_CPPOPTIONS_H */ diff --git a/verification/isomip/code_ad/CPP_OPTIONS.h b/verification/isomip/code_ad/CPP_OPTIONS.h index c6fc3011e4..7eeeae9bea 100644 --- a/verification/isomip/code_ad/CPP_OPTIONS.h +++ b/verification/isomip/code_ad/CPP_OPTIONS.h @@ -71,7 +71,7 @@ C o Exclude/allow partial-cell effect (physical or enhanced) in vertical mixing C this allows to account for partial-cell in vertical viscosity and diffusion, C either from grid-spacing reduction effect or as artificially enhanced mixing C near surface & bottom for too thin grid-cell -#define EXCLUDE_PCELL_MIX_CODE +#undef EXCLUDE_PCELL_MIX_CODE C-- Time-stepping code options: diff --git a/verification/isomip/code_ad/CTRL_OPTIONS.h b/verification/isomip/code_ad/CTRL_OPTIONS.h index 245662d54a..069f6f9581 100644 --- a/verification/isomip/code_ad/CTRL_OPTIONS.h +++ b/verification/isomip/code_ad/CTRL_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef CTRL_OPTIONS_H +#define CTRL_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: CTRL_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef CTRL_OPTIONS_H -#define CTRL_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_CTRL #ifdef ECCO_CPPOPTIONS_H @@ -26,60 +26,68 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -C o Re-activate deprecated codes in pkg/ecco & pkg/ctrl (but not recommended) -C and since pkg/ctrl can be used without pkg/ecco, better to have it here -C o In this experiment, this option and the corresponding necessary flags -C to reproduce this experiment are commented by CTRL -CTRL#define ECCO_CTRL_DEPRECATED - -#define EXCLUDE_CTRL_PACK +C o I/O and pack settings +#undef CTRL_SET_PREC_32 +C This option is only relevant (for pack/unpack) with OBCS_CONTROL: #undef ALLOW_NONDIMENSIONAL_CONTROL_IO +#define EXCLUDE_CTRL_PACK +#undef ALLOW_PACKUNPACK_METHOD2 +#undef CTRL_DO_PACK_UNPACK_ONLY +#undef CTRL_PACK_PRECISE +#undef CTRL_UNPACK_PRECISE +#undef CTRL_DELZNORM +#undef ALLOW_CTRL_WETV -CTRLC >>> Initial values. -CTRL#define ALLOW_THETA0_CONTROL -CTRL#define ALLOW_SALT0_CONTROL -CTRL#undef ALLOW_UVEL0_CONTROL -CTRL#undef ALLOW_VVEL0_CONTROL -CTRL#undef ALLOW_TR10_CONTROL -CTRL#undef ALLOW_TAUU0_CONTROL -CTRL#undef ALLOW_TAUV0_CONTROL -CTRL#undef ALLOW_SFLUX0_CONTROL -CTRL#undef ALLOW_HFLUX0_CONTROL -CTRL#undef ALLOW_SSS0_CONTROL -CTRL#undef ALLOW_SST0_CONTROL -CTRL -CTRLC >>> Surface fluxes. -CTRL#undef ALLOW_HFLUX_CONTROL -CTRL#undef ALLOW_SFLUX_CONTROL -CTRL#undef ALLOW_USTRESS_CONTROL -CTRL#undef ALLOW_VSTRESS_CONTROL -CTRL#undef ALLOW_SWFLUX_CONTROL -CTRL#undef ALLOW_LWFLUX_CONTROL -CTRL -CTRLC >>> Atmospheric state. -CTRL#undef ALLOW_ATEMP_CONTROL -CTRL#undef ALLOW_AQH_CONTROL -CTRL#undef ALLOW_UWIND_CONTROL -CTRL#undef ALLOW_VWIND_CONTROL -CTRL#undef ALLOW_PRECIP_CONTROL -CTRL -CTRLC >>> Other Control. -CTRL#define ALLOW_DIFFKR_CONTROL -CTRL#undef ALLOW_KAPGM_CONTROL -CTRL#undef ALLOW_KAPREDI_CONTROL -CTRL#undef ALLOW_BOTTOMDRAG_CONTROL -CTRL -CTRLC >>> Backward compatibility option (before checkpoint 65p) -CTRL#undef ALLOW_KAPGM_CONTROL_OLD -CTRL#undef ALLOW_KAPREDI_CONTROL_OLD -CTRL -CTRLC >>> pkg/shelfice fluxes. -CTRL#define ALLOW_SHIFWFLX_CONTROL +C >>> Other Control. +C Allows for GMREDI controls +#undef ALLOW_KAPGM_CONTROL +#undef ALLOW_KAPREDI_CONTROL +C Allows for Vertical Diffusivity controls +#undef ALLOW_DIFFKR_CONTROL +#undef ALLOW_BOTTOMDRAG_CONTROL +#undef ALLOW_DIC_CONTROL + +C Allows bathymetry as a control vector +C Note: keep this Option separated from generic control since this control +C involves many new dependencies that we would like to avoid in general. +#undef ALLOW_DEPTH_CONTROL +#ifdef ALLOW_DEPTH_CONTROL +C Only relevant within DEPTH_CONTROL code: +# define USE_SMOOTH_MIN +# undef ALLOW_HFACC_CONTROL +# undef ALLOW_HFACC3D_CONTROL +#endif /* ALLOW_DEPTH_CONTROL */ C >>> Generic Control. #define ALLOW_GENARR2D_CONTROL #define ALLOW_GENARR3D_CONTROL #define ALLOW_GENTIM2D_CONTROL +# undef ALLOW_UVEL0_CONTROL +# undef ALLOW_VVEL0_CONTROL +# undef CTRL_SET_OLD_MAXCVARS_30 +# undef CTRL_SET_OLD_MAXCVARS_40 + +C >>> Open boundaries +#ifdef ALLOW_OBCS +C Control of Open-Boundaries is meaningless without compiling pkg/obcs +C Note: Make sure that corresponding OBCS N/S/W/E Option is defined +# define ALLOW_OBCSN_CONTROL +# define ALLOW_OBCSS_CONTROL +# define ALLOW_OBCSW_CONTROL +# define ALLOW_OBCSE_CONTROL +# undef ALLOW_OBCS_CONTROL_MODES +#endif /* ALLOW_OBCS */ + +C o Set ALLOW_OBCS_CONTROL (Do not edit/modify): +#if (defined (ALLOW_OBCSN_CONTROL) || \ + defined (ALLOW_OBCSS_CONTROL) || \ + defined (ALLOW_OBCSW_CONTROL) || \ + defined (ALLOW_OBCSE_CONTROL)) +# define ALLOW_OBCS_CONTROL +#endif + +C o Impose bounds on controls +#undef ALLOW_ADCTRLBOUND C o Rotation of wind/stress controls adjustments C from Eastward/Northward to model grid directions @@ -91,19 +99,16 @@ C The CTRL_SKIP_FIRST_TWO_ATM_REC_ALL option extends this C to the other the time variable atmospheric controls. #undef CTRL_SKIP_FIRST_TWO_ATM_REC_ALL -C o use pkg/smooth correlation operator (incl. smoother) for 2D controls (Weaver, Courtier 01) -C This CPP option just sets the default for ctrlSmoothCorrel2D to .TRUE. -#undef ALLOW_SMOOTH_CORREL2D -C o use pkg/smooth correlation operator (incl. smoother) for 3D controls (Weaver, Courtier 01) -C This CPP option just sets the default for ctrlSmoothCorrel3D to .TRUE. -#undef ALLOW_SMOOTH_CORREL3D - -C o apply pkg/ctrl/ctrl_smooth.F to 2D controls (outside of ctrlSmoothCorrel2D) -#undef ALLOW_CTRL_SMOOTH -C o apply pkg/smooth/smooth_diff2d.F to 2D controls (outside of ctrlSmoothCorrel2D) +C Note: this flag turns on extra smoothing code in ctrl_get_gen.F which +C is inconsistent with the Weaver and Courtier, 2001 algorithm, and +C should probably not be used. The corresponding 3D flag applied only +C to deprecated code that is now removed. At some point we will remove +C this flag and associated code as well. +C o apply pkg/smooth/smooth_diff2d.F to 2D controls (outside of Smooth_Correl2D) #undef ALLOW_SMOOTH_CTRL2D -C o apply pkg/smooth/smooth_diff3d.F to 3D controls (outside of ctrlSmoothCorrel3D) -#undef ALLOW_SMOOTH_CTRL3D + +C o Print more debug info to STDOUT +#undef ALLOW_CTRL_DEBUG C ================================================================== #endif /* ndef ECCO_CPPOPTIONS_H */ diff --git a/verification/isomip/code_oad/AUTODIFF_OPTIONS.h b/verification/isomip/code_oad/AUTODIFF_OPTIONS.h index 9f494e7955..85e0653c72 100644 --- a/verification/isomip/code_oad/AUTODIFF_OPTIONS.h +++ b/verification/isomip/code_oad/AUTODIFF_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef AUTODIFF_OPTIONS_H +#define AUTODIFF_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: AUTODIFF_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef AUTODIFF_OPTIONS_H -#define AUTODIFF_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_AUTODIFF #ifdef ECCO_CPPOPTIONS_H @@ -26,10 +26,11 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -C o Include/exclude code in order to be able to automatically -C differentiate the MITgcmUV by using the Tangent Linear and -C Adjoint Model Compiler (TAMC). +C o Include/exclude code in order to automatically differentiate MITgcm code +C using TAF (Transformation of Algorithms in Fortran, http://www.FastOpt.de) +C or using TAMC (Tangent Linear & Adjoint Model Compiler, needs both defined): #undef ALLOW_AUTODIFF_TAMC +#undef AUTODIFF_TAMC_COMPATIBILITY C >>> Checkpointing as handled by TAMC #define ALLOW_TAMC_CHECKPOINTING @@ -40,19 +41,19 @@ C >>> and DYNVARS_DIAG adjoint state #undef ALLOW_AUTODIFF_MONITOR_DIAG C >>> DO 2-level checkpointing instead of 3-level -c#undef AUTODIFF_2_LEVEL_CHECKPOINT +#undef AUTODIFF_2_LEVEL_CHECKPOINT C extend to 4-level checkpointing -c#undef AUTODIFF_4_LEVEL_CHECKPOINT +#undef AUTODIFF_4_LEVEL_CHECKPOINT C o use divided adjoint to split adjoint computations #undef ALLOW_DIVIDED_ADJOINT -#undef ALLOW_PACKUNPACK_METHOD2 - C o This flag is incredibly useful as it reduces the number of C tape-files on the disc. Maybe it should even be the default. #undef ALLOW_AUTODIFF_WHTAPEIO +C and related to above: +#undef ALLOW_INIT_WHTAPEIO C o use standard MDSFINDUINTS instead of local pkg/autodiff version for C WHTAPEIO code I/O. @@ -67,12 +68,13 @@ C Might still be used for OBCS since WHTAPEIO does not support OBCS fields. #undef AUTODIFF_USE_STORE_RESTORE #undef AUTODIFF_USE_STORE_RESTORE_OBCS -C o write separate tape files for each ptracer (has no effect, to be removed) -#undef AUTODIFF_PTRACERS_SPLIT_FILES - C o allow using viscFacInAd to recompute viscosities in AD #undef AUTODIFF_ALLOW_VISCFACADJ +C o To remove part of MOM_CALC_VISC (better name would be: MOM_DISABLE_*) +#undef AUTODIFF_DISABLE_LEITH +#undef AUTODIFF_DISABLE_REYNOLDS_SCALE + C o for output of AD-variables (ALLOW_AUTODIFF_MONITOR), specific code (e.g., C in addummy_in_stepping.F) relies on adexch_uv_xy_rs and adexch_xy_rs S/R C which might not always be generated by TAF (e.g., when controls do not diff --git a/verification/isomip/code_oad/COST_OPTIONS.h b/verification/isomip/code_oad/COST_OPTIONS.h index 41c6475da2..64a1943d48 100644 --- a/verification/isomip/code_oad/COST_OPTIONS.h +++ b/verification/isomip/code_oad/COST_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef COST_OPTIONS_H +#define COST_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: COST_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef COST_OPTIONS_H -#define COST_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_COST #ifdef ECCO_CPPOPTIONS_H @@ -26,50 +26,24 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -C >>> Use the EGM-96 geoid error covariance. -#undef ALLOW_EGM96_ERROR_COV -#undef ALLOW_READ_EGM_DATA +#undef ALLOW_COST_STATE_FINAL +#undef ALLOW_COST_VECTOR + C >>> Cost function contributions -#undef ALLOW_HFLUX_COST_CONTRIBUTION -#undef ALLOW_SFLUX_COST_CONTRIBUTION -#undef ALLOW_USTRESS_COST_CONTRIBUTION -#undef ALLOW_VSTRESS_COST_CONTRIBUTION -#undef ALLOW_THETA_COST_CONTRIBUTION -#undef ALLOW_SALT_COST_CONTRIBUTION -#undef ALLOW_SST_COST_CONTRIBUTION -#undef ALLOW_SSS_COST_CONTRIBUTION -#undef ALLOW_SSH_COST_CONTRIBUTION -#undef ALLOW_CTDT_COST_CONTRIBUTION -#undef ALLOW_CTDS_COST_CONTRIBUTION -#undef ALLOW_COST_ATLANTIC #undef ALLOW_COST_ATLANTIC_HEAT +#undef ALLOW_COST_ATLANTIC_HEAT_DOMASS #define ALLOW_COST_TEST #define ALLOW_COST_TSQUARED +#undef ALLOW_COST_DEPTH #undef ALLOW_COST_TRACER -C >>> ALLOW_GENCOST_CONTRIBUTION: interactive way to add basic 2D cost -C function terms. -C > In data.ecco, this requires the specification of data file (name, -C frequency, etc.), bar file name for corresp. model average, standard -C error file name, etc. -C > In addition, adding such cost terms requires editing ecco_cost.h to -C increase NGENCOST, and editing cost_gencost_customize.F to implement -C the actual model average (i.e. the bar file content). -#undef ALLOW_GENCOST_CONTRIBUTION -C >>> free form version of GENCOST: allows one to use otherwise defined -C elements (e.g. psbar and and topex data) while taking advantage of the -C cost function/namelist slots that can be made available using -C ALLOW_GENCOST_CONTRIBUTION. To this end ALLOW_GENCOST_CONTRIBUTION -C simply switches off tests that check whether all of the gencost -C elements (e.g. gencost_barfile and gencost_datafile) are specified -C in data.ecco. -C > While this option increases flexibility within the gencost framework, -C it implies more room for error, so it should be used cautiously, and -C with good knowledge of the rest of pkg/ecco. -C > It requires providing a specific cost function routine, and editing -C cost_gencost_all.F accordingly. -#undef ALLOW_GENCOST_FREEFORM +C List these options here: +#undef ALLOW_COST_TEMP +#undef ALLOW_COST_HFLUXM +#undef ALLOW_DIC_COST +#undef ALLOW_THSICE_COST_TEST +#undef ALLOW_COST_SHELFICE C ================================================================== #endif /* ndef ECCO_CPPOPTIONS_H */ diff --git a/verification/isomip/code_oad/CTRL_OPTIONS.h b/verification/isomip/code_oad/CTRL_OPTIONS.h index cd101b6ba9..94652675e5 100644 --- a/verification/isomip/code_oad/CTRL_OPTIONS.h +++ b/verification/isomip/code_oad/CTRL_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef CTRL_OPTIONS_H +#define CTRL_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: CTRL_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef CTRL_OPTIONS_H -#define CTRL_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_CTRL #ifdef ECCO_CPPOPTIONS_H @@ -26,60 +26,68 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -C o Re-activate deprecated codes in pkg/ecco & pkg/ctrl (but not recommended) -C and since pkg/ctrl can be used without pkg/ecco, better to have it here -C o In this experiment, this option and the corresponding necessary flags -C to reproduce this experiment are commented by CTRL -CTRL#define ECCO_CTRL_DEPRECATED - -#define EXCLUDE_CTRL_PACK +C o I/O and pack settings +#undef CTRL_SET_PREC_32 +C This option is only relevant (for pack/unpack) with OBCS_CONTROL: #undef ALLOW_NONDIMENSIONAL_CONTROL_IO +#define EXCLUDE_CTRL_PACK +#undef ALLOW_PACKUNPACK_METHOD2 +#undef CTRL_DO_PACK_UNPACK_ONLY +#undef CTRL_PACK_PRECISE +#undef CTRL_UNPACK_PRECISE +#undef CTRL_DELZNORM +#undef ALLOW_CTRL_WETV -CTRLC >>> Initial values. -CTRL#define ALLOW_THETA0_CONTROL -CTRL#define ALLOW_SALT0_CONTROL -CTRL#undef ALLOW_UVEL0_CONTROL -CTRL#undef ALLOW_VVEL0_CONTROL -CTRL#undef ALLOW_TR10_CONTROL -CTRL#undef ALLOW_TAUU0_CONTROL -CTRL#undef ALLOW_TAUV0_CONTROL -CTRL#undef ALLOW_SFLUX0_CONTROL -CTRL#undef ALLOW_HFLUX0_CONTROL -CTRL#undef ALLOW_SSS0_CONTROL -CTRL#undef ALLOW_SST0_CONTROL -CTRL -CTRLC >>> Surface fluxes. -CTRL#undef ALLOW_HFLUX_CONTROL -CTRL#undef ALLOW_SFLUX_CONTROL -CTRL#undef ALLOW_USTRESS_CONTROL -CTRL#undef ALLOW_VSTRESS_CONTROL -CTRL#undef ALLOW_SWFLUX_CONTROL -CTRL#undef ALLOW_LWFLUX_CONTROL -CTRL -CTRLC >>> Atmospheric state. -CTRL#undef ALLOW_ATEMP_CONTROL -CTRL#undef ALLOW_AQH_CONTROL -CTRL#undef ALLOW_UWIND_CONTROL -CTRL#undef ALLOW_VWIND_CONTROL -CTRL#undef ALLOW_PRECIP_CONTROL -CTRL -CTRLC >>> Other Control. -CTRL#define ALLOW_DIFFKR_CONTROL -CTRL#undef ALLOW_KAPGM_CONTROL -CTRL#undef ALLOW_KAPREDI_CONTROL -CTRL#undef ALLOW_BOTTOMDRAG_CONTROL -CTRL -CTRLC >>> Backward compatibility option (before checkpoint 65p) -CTRL#undef ALLOW_KAPGM_CONTROL_OLD -CTRL#undef ALLOW_KAPREDI_CONTROL_OLD -CTRL -CTRLC >>> pkg/shelfice fluxes. -CTRL#define ALLOW_SHIFWFLX_CONTROL +C >>> Other Control. +C Allows for GMREDI controls +#undef ALLOW_KAPGM_CONTROL +#undef ALLOW_KAPREDI_CONTROL +C Allows for Vertical Diffusivity controls +#undef ALLOW_DIFFKR_CONTROL +#undef ALLOW_BOTTOMDRAG_CONTROL +#undef ALLOW_DIC_CONTROL + +C Allows bathymetry as a control vector +C Note: keep this Option separated from generic control since this control +C involves many new dependencies that we would like to avoid in general. +#undef ALLOW_DEPTH_CONTROL +#ifdef ALLOW_DEPTH_CONTROL +C Only relevant within DEPTH_CONTROL code: +# define USE_SMOOTH_MIN +# undef ALLOW_HFACC_CONTROL +# undef ALLOW_HFACC3D_CONTROL +#endif /* ALLOW_DEPTH_CONTROL */ C >>> Generic Control. #undef ALLOW_GENARR2D_CONTROL #define ALLOW_GENARR3D_CONTROL #undef ALLOW_GENTIM2D_CONTROL +# undef ALLOW_UVEL0_CONTROL +# undef ALLOW_VVEL0_CONTROL +# undef CTRL_SET_OLD_MAXCVARS_30 +# undef CTRL_SET_OLD_MAXCVARS_40 + +C >>> Open boundaries +#ifdef ALLOW_OBCS +C Control of Open-Boundaries is meaningless without compiling pkg/obcs +C Note: Make sure that corresponding OBCS N/S/W/E Option is defined +# define ALLOW_OBCSN_CONTROL +# define ALLOW_OBCSS_CONTROL +# define ALLOW_OBCSW_CONTROL +# define ALLOW_OBCSE_CONTROL +# undef ALLOW_OBCS_CONTROL_MODES +#endif /* ALLOW_OBCS */ + +C o Set ALLOW_OBCS_CONTROL (Do not edit/modify): +#if (defined (ALLOW_OBCSN_CONTROL) || \ + defined (ALLOW_OBCSS_CONTROL) || \ + defined (ALLOW_OBCSW_CONTROL) || \ + defined (ALLOW_OBCSE_CONTROL)) +# define ALLOW_OBCS_CONTROL +#endif + +C o Impose bounds on controls +#undef ALLOW_ADCTRLBOUND C o Rotation of wind/stress controls adjustments C from Eastward/Northward to model grid directions @@ -91,19 +99,16 @@ C The CTRL_SKIP_FIRST_TWO_ATM_REC_ALL option extends this C to the other the time variable atmospheric controls. #undef CTRL_SKIP_FIRST_TWO_ATM_REC_ALL -C o use pkg/smooth correlation operator (incl. smoother) for 2D controls (Weaver, Courtier 01) -C This CPP option just sets the default for ctrlSmoothCorrel2D to .TRUE. -#undef ALLOW_SMOOTH_CORREL2D -C o use pkg/smooth correlation operator (incl. smoother) for 3D controls (Weaver, Courtier 01) -C This CPP option just sets the default for ctrlSmoothCorrel3D to .TRUE. -#undef ALLOW_SMOOTH_CORREL3D - -C o apply pkg/ctrl/ctrl_smooth.F to 2D controls (outside of ctrlSmoothCorrel2D) -#undef ALLOW_CTRL_SMOOTH -C o apply pkg/smooth/smooth_diff2d.F to 2D controls (outside of ctrlSmoothCorrel2D) +C Note: this flag turns on extra smoothing code in ctrl_get_gen.F which +C is inconsistent with the Weaver and Courtier, 2001 algorithm, and +C should probably not be used. The corresponding 3D flag applied only +C to deprecated code that is now removed. At some point we will remove +C this flag and associated code as well. +C o apply pkg/smooth/smooth_diff2d.F to 2D controls (outside of Smooth_Correl2D) #undef ALLOW_SMOOTH_CTRL2D -C o apply pkg/smooth/smooth_diff3d.F to 3D controls (outside of ctrlSmoothCorrel3D) -#undef ALLOW_SMOOTH_CTRL3D + +C o Print more debug info to STDOUT +#undef ALLOW_CTRL_DEBUG C ================================================================== #endif /* ndef ECCO_CPPOPTIONS_H */ diff --git a/verification/isomip/code_tap/AUTODIFF_OPTIONS.h b/verification/isomip/code_tap/AUTODIFF_OPTIONS.h index 7339a3b301..b9b62682c6 100644 --- a/verification/isomip/code_tap/AUTODIFF_OPTIONS.h +++ b/verification/isomip/code_tap/AUTODIFF_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef AUTODIFF_OPTIONS_H +#define AUTODIFF_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: AUTODIFF_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef AUTODIFF_OPTIONS_H -#define AUTODIFF_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_AUTODIFF #ifdef ECCO_CPPOPTIONS_H @@ -26,10 +26,11 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -C o Include/exclude code in order to be able to automatically -C differentiate the MITgcmUV by using the Tangent Linear and -C Adjoint Model Compiler (TAMC). +C o Include/exclude code in order to automatically differentiate MITgcm code +C using TAF (Transformation of Algorithms in Fortran, http://www.FastOpt.de) +C or using TAMC (Tangent Linear & Adjoint Model Compiler, needs both defined): #undef ALLOW_AUTODIFF_TAMC +#undef AUTODIFF_TAMC_COMPATIBILITY C >>> Checkpointing as handled by TAMC #undef ALLOW_TAMC_CHECKPOINTING @@ -40,19 +41,19 @@ C >>> and DYNVARS_DIAG adjoint state #undef ALLOW_AUTODIFF_MONITOR_DIAG C >>> DO 2-level checkpointing instead of 3-level -c#undef AUTODIFF_2_LEVEL_CHECKPOINT +#undef AUTODIFF_2_LEVEL_CHECKPOINT C extend to 4-level checkpointing -c#undef AUTODIFF_4_LEVEL_CHECKPOINT +#undef AUTODIFF_4_LEVEL_CHECKPOINT C o use divided adjoint to split adjoint computations #undef ALLOW_DIVIDED_ADJOINT -#undef ALLOW_PACKUNPACK_METHOD2 - C o This flag is incredibly useful as it reduces the number of C tape-files on the disc. Maybe it should even be the default. #undef ALLOW_AUTODIFF_WHTAPEIO +C and related to above: +#undef ALLOW_INIT_WHTAPEIO C o use standard MDSFINDUINTS instead of local pkg/autodiff version for C WHTAPEIO code I/O. @@ -67,12 +68,13 @@ C Might still be used for OBCS since WHTAPEIO does not support OBCS fields. #undef AUTODIFF_USE_STORE_RESTORE #undef AUTODIFF_USE_STORE_RESTORE_OBCS -C o write separate tape files for each ptracer (has no effect, to be removed) -#undef AUTODIFF_PTRACERS_SPLIT_FILES - C o allow using viscFacInAd to recompute viscosities in AD #undef AUTODIFF_ALLOW_VISCFACADJ +C o To remove part of MOM_CALC_VISC (better name would be: MOM_DISABLE_*) +#undef AUTODIFF_DISABLE_LEITH +#undef AUTODIFF_DISABLE_REYNOLDS_SCALE + C o for output of AD-variables (ALLOW_AUTODIFF_MONITOR), specific code (e.g., C in addummy_in_stepping.F) relies on adexch_uv_xy_rs and adexch_xy_rs S/R C which might not always be generated by TAF (e.g., when controls do not diff --git a/verification/isomip/code_tap/COST_OPTIONS.h b/verification/isomip/code_tap/COST_OPTIONS.h index 41c6475da2..64a1943d48 100644 --- a/verification/isomip/code_tap/COST_OPTIONS.h +++ b/verification/isomip/code_tap/COST_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef COST_OPTIONS_H +#define COST_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: COST_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef COST_OPTIONS_H -#define COST_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_COST #ifdef ECCO_CPPOPTIONS_H @@ -26,50 +26,24 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -C >>> Use the EGM-96 geoid error covariance. -#undef ALLOW_EGM96_ERROR_COV -#undef ALLOW_READ_EGM_DATA +#undef ALLOW_COST_STATE_FINAL +#undef ALLOW_COST_VECTOR + C >>> Cost function contributions -#undef ALLOW_HFLUX_COST_CONTRIBUTION -#undef ALLOW_SFLUX_COST_CONTRIBUTION -#undef ALLOW_USTRESS_COST_CONTRIBUTION -#undef ALLOW_VSTRESS_COST_CONTRIBUTION -#undef ALLOW_THETA_COST_CONTRIBUTION -#undef ALLOW_SALT_COST_CONTRIBUTION -#undef ALLOW_SST_COST_CONTRIBUTION -#undef ALLOW_SSS_COST_CONTRIBUTION -#undef ALLOW_SSH_COST_CONTRIBUTION -#undef ALLOW_CTDT_COST_CONTRIBUTION -#undef ALLOW_CTDS_COST_CONTRIBUTION -#undef ALLOW_COST_ATLANTIC #undef ALLOW_COST_ATLANTIC_HEAT +#undef ALLOW_COST_ATLANTIC_HEAT_DOMASS #define ALLOW_COST_TEST #define ALLOW_COST_TSQUARED +#undef ALLOW_COST_DEPTH #undef ALLOW_COST_TRACER -C >>> ALLOW_GENCOST_CONTRIBUTION: interactive way to add basic 2D cost -C function terms. -C > In data.ecco, this requires the specification of data file (name, -C frequency, etc.), bar file name for corresp. model average, standard -C error file name, etc. -C > In addition, adding such cost terms requires editing ecco_cost.h to -C increase NGENCOST, and editing cost_gencost_customize.F to implement -C the actual model average (i.e. the bar file content). -#undef ALLOW_GENCOST_CONTRIBUTION -C >>> free form version of GENCOST: allows one to use otherwise defined -C elements (e.g. psbar and and topex data) while taking advantage of the -C cost function/namelist slots that can be made available using -C ALLOW_GENCOST_CONTRIBUTION. To this end ALLOW_GENCOST_CONTRIBUTION -C simply switches off tests that check whether all of the gencost -C elements (e.g. gencost_barfile and gencost_datafile) are specified -C in data.ecco. -C > While this option increases flexibility within the gencost framework, -C it implies more room for error, so it should be used cautiously, and -C with good knowledge of the rest of pkg/ecco. -C > It requires providing a specific cost function routine, and editing -C cost_gencost_all.F accordingly. -#undef ALLOW_GENCOST_FREEFORM +C List these options here: +#undef ALLOW_COST_TEMP +#undef ALLOW_COST_HFLUXM +#undef ALLOW_DIC_COST +#undef ALLOW_THSICE_COST_TEST +#undef ALLOW_COST_SHELFICE C ================================================================== #endif /* ndef ECCO_CPPOPTIONS_H */ diff --git a/verification/isomip/code_tap/CTRL_OPTIONS.h b/verification/isomip/code_tap/CTRL_OPTIONS.h index 245662d54a..069f6f9581 100644 --- a/verification/isomip/code_tap/CTRL_OPTIONS.h +++ b/verification/isomip/code_tap/CTRL_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef CTRL_OPTIONS_H +#define CTRL_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: CTRL_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef CTRL_OPTIONS_H -#define CTRL_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_CTRL #ifdef ECCO_CPPOPTIONS_H @@ -26,60 +26,68 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -C o Re-activate deprecated codes in pkg/ecco & pkg/ctrl (but not recommended) -C and since pkg/ctrl can be used without pkg/ecco, better to have it here -C o In this experiment, this option and the corresponding necessary flags -C to reproduce this experiment are commented by CTRL -CTRL#define ECCO_CTRL_DEPRECATED - -#define EXCLUDE_CTRL_PACK +C o I/O and pack settings +#undef CTRL_SET_PREC_32 +C This option is only relevant (for pack/unpack) with OBCS_CONTROL: #undef ALLOW_NONDIMENSIONAL_CONTROL_IO +#define EXCLUDE_CTRL_PACK +#undef ALLOW_PACKUNPACK_METHOD2 +#undef CTRL_DO_PACK_UNPACK_ONLY +#undef CTRL_PACK_PRECISE +#undef CTRL_UNPACK_PRECISE +#undef CTRL_DELZNORM +#undef ALLOW_CTRL_WETV -CTRLC >>> Initial values. -CTRL#define ALLOW_THETA0_CONTROL -CTRL#define ALLOW_SALT0_CONTROL -CTRL#undef ALLOW_UVEL0_CONTROL -CTRL#undef ALLOW_VVEL0_CONTROL -CTRL#undef ALLOW_TR10_CONTROL -CTRL#undef ALLOW_TAUU0_CONTROL -CTRL#undef ALLOW_TAUV0_CONTROL -CTRL#undef ALLOW_SFLUX0_CONTROL -CTRL#undef ALLOW_HFLUX0_CONTROL -CTRL#undef ALLOW_SSS0_CONTROL -CTRL#undef ALLOW_SST0_CONTROL -CTRL -CTRLC >>> Surface fluxes. -CTRL#undef ALLOW_HFLUX_CONTROL -CTRL#undef ALLOW_SFLUX_CONTROL -CTRL#undef ALLOW_USTRESS_CONTROL -CTRL#undef ALLOW_VSTRESS_CONTROL -CTRL#undef ALLOW_SWFLUX_CONTROL -CTRL#undef ALLOW_LWFLUX_CONTROL -CTRL -CTRLC >>> Atmospheric state. -CTRL#undef ALLOW_ATEMP_CONTROL -CTRL#undef ALLOW_AQH_CONTROL -CTRL#undef ALLOW_UWIND_CONTROL -CTRL#undef ALLOW_VWIND_CONTROL -CTRL#undef ALLOW_PRECIP_CONTROL -CTRL -CTRLC >>> Other Control. -CTRL#define ALLOW_DIFFKR_CONTROL -CTRL#undef ALLOW_KAPGM_CONTROL -CTRL#undef ALLOW_KAPREDI_CONTROL -CTRL#undef ALLOW_BOTTOMDRAG_CONTROL -CTRL -CTRLC >>> Backward compatibility option (before checkpoint 65p) -CTRL#undef ALLOW_KAPGM_CONTROL_OLD -CTRL#undef ALLOW_KAPREDI_CONTROL_OLD -CTRL -CTRLC >>> pkg/shelfice fluxes. -CTRL#define ALLOW_SHIFWFLX_CONTROL +C >>> Other Control. +C Allows for GMREDI controls +#undef ALLOW_KAPGM_CONTROL +#undef ALLOW_KAPREDI_CONTROL +C Allows for Vertical Diffusivity controls +#undef ALLOW_DIFFKR_CONTROL +#undef ALLOW_BOTTOMDRAG_CONTROL +#undef ALLOW_DIC_CONTROL + +C Allows bathymetry as a control vector +C Note: keep this Option separated from generic control since this control +C involves many new dependencies that we would like to avoid in general. +#undef ALLOW_DEPTH_CONTROL +#ifdef ALLOW_DEPTH_CONTROL +C Only relevant within DEPTH_CONTROL code: +# define USE_SMOOTH_MIN +# undef ALLOW_HFACC_CONTROL +# undef ALLOW_HFACC3D_CONTROL +#endif /* ALLOW_DEPTH_CONTROL */ C >>> Generic Control. #define ALLOW_GENARR2D_CONTROL #define ALLOW_GENARR3D_CONTROL #define ALLOW_GENTIM2D_CONTROL +# undef ALLOW_UVEL0_CONTROL +# undef ALLOW_VVEL0_CONTROL +# undef CTRL_SET_OLD_MAXCVARS_30 +# undef CTRL_SET_OLD_MAXCVARS_40 + +C >>> Open boundaries +#ifdef ALLOW_OBCS +C Control of Open-Boundaries is meaningless without compiling pkg/obcs +C Note: Make sure that corresponding OBCS N/S/W/E Option is defined +# define ALLOW_OBCSN_CONTROL +# define ALLOW_OBCSS_CONTROL +# define ALLOW_OBCSW_CONTROL +# define ALLOW_OBCSE_CONTROL +# undef ALLOW_OBCS_CONTROL_MODES +#endif /* ALLOW_OBCS */ + +C o Set ALLOW_OBCS_CONTROL (Do not edit/modify): +#if (defined (ALLOW_OBCSN_CONTROL) || \ + defined (ALLOW_OBCSS_CONTROL) || \ + defined (ALLOW_OBCSW_CONTROL) || \ + defined (ALLOW_OBCSE_CONTROL)) +# define ALLOW_OBCS_CONTROL +#endif + +C o Impose bounds on controls +#undef ALLOW_ADCTRLBOUND C o Rotation of wind/stress controls adjustments C from Eastward/Northward to model grid directions @@ -91,19 +99,16 @@ C The CTRL_SKIP_FIRST_TWO_ATM_REC_ALL option extends this C to the other the time variable atmospheric controls. #undef CTRL_SKIP_FIRST_TWO_ATM_REC_ALL -C o use pkg/smooth correlation operator (incl. smoother) for 2D controls (Weaver, Courtier 01) -C This CPP option just sets the default for ctrlSmoothCorrel2D to .TRUE. -#undef ALLOW_SMOOTH_CORREL2D -C o use pkg/smooth correlation operator (incl. smoother) for 3D controls (Weaver, Courtier 01) -C This CPP option just sets the default for ctrlSmoothCorrel3D to .TRUE. -#undef ALLOW_SMOOTH_CORREL3D - -C o apply pkg/ctrl/ctrl_smooth.F to 2D controls (outside of ctrlSmoothCorrel2D) -#undef ALLOW_CTRL_SMOOTH -C o apply pkg/smooth/smooth_diff2d.F to 2D controls (outside of ctrlSmoothCorrel2D) +C Note: this flag turns on extra smoothing code in ctrl_get_gen.F which +C is inconsistent with the Weaver and Courtier, 2001 algorithm, and +C should probably not be used. The corresponding 3D flag applied only +C to deprecated code that is now removed. At some point we will remove +C this flag and associated code as well. +C o apply pkg/smooth/smooth_diff2d.F to 2D controls (outside of Smooth_Correl2D) #undef ALLOW_SMOOTH_CTRL2D -C o apply pkg/smooth/smooth_diff3d.F to 3D controls (outside of ctrlSmoothCorrel3D) -#undef ALLOW_SMOOTH_CTRL3D + +C o Print more debug info to STDOUT +#undef ALLOW_CTRL_DEBUG C ================================================================== #endif /* ndef ECCO_CPPOPTIONS_H */ diff --git a/verification/lab_sea/code/SEAICE_OPTIONS.h b/verification/lab_sea/code/SEAICE_OPTIONS.h index 1cb62dd9c9..447a1eef6e 100644 --- a/verification/lab_sea/code/SEAICE_OPTIONS.h +++ b/verification/lab_sea/code/SEAICE_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef SEAICE_OPTIONS_H +#define SEAICE_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + C *==========================================================* C | SEAICE_OPTIONS.h C | o CPP options file for sea ice package. @@ -6,24 +11,12 @@ C | Use this file for selecting options within the sea ice C | package. C *==========================================================* -#ifndef SEAICE_OPTIONS_H -#define SEAICE_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_SEAICE -C Package-specific Options & Macros go here +C--- Package-specific Options & Macros go here C-- Write "text-plots" of certain fields in STDOUT for debugging. #undef SEAICE_DEBUG -C-- Allow sea-ice dynamic code. -C This option is provided to allow use of TAMC -C on the thermodynamics component of the code only. -C Sea-ice dynamics can also be turned off at runtime -C using variable SEAICEuseDYNAMICS. -#define SEAICE_ALLOW_DYNAMICS - C-- By default, the sea-ice package uses its own integrated bulk C formulae to compute fluxes (fu, fv, EmPmR, Qnet, and Qsw) over C open-ocean. When this flag is set, these variables are computed @@ -55,66 +48,116 @@ C seaice with a fraction (=SEAICE_saltFrac) of freezing seawater salinity. C- Note: SItracer also offers an alternative way to handle variable salinity. #undef SEAICE_VARIABLE_SALINITY -C-- Tracers of ice and/or ice cover. -#define ALLOW_SITRACER -#ifdef ALLOW_SITRACER -C-- To try avoid 'spontaneous generation' of tracer maxima by advdiff. -# define ALLOW_SITRACER_ADVCAP -#endif - -C-- Enable grease ice parameterization -C The grease ice parameterization delays formation of solid -C sea ice from frazil ice by a time constant and provides a -C dynamic calculation of the initial solid sea ice thickness -C HO as a function of winds, currents and available grease ice -C volume. Grease ice does not significantly reduce heat loss -C from the ocean in winter and area covered by grease is thus -C handled like open water. -C (For details see Smedsrud and Martin, 2014, Ann.Glac.) +C-- Enable grease ice parameterization (requires to define ALLOW_SITRACER): +C The grease ice parameterization delays formation of solid sea ice from +C frazil ice by a time constant and provides a dynamic calculation of the +C initial solid sea ice thickness HO as a function of winds, currents and +C available grease ice volume. Grease ice does not significantly reduce heat +C loss from the ocean in winter and area covered by grease is thus handled +C like open water (For details see Smedsrud and Martin, 2014, Ann.Glac.). C Set SItrName(1) = 'grease' in namelist SEAICE_PARM03 in data.seaice C then output SItr01 is SItrNameLong(1) = 'grease ice volume fraction', -C with SItrUnit(1) = '[0-1]', which needs to be multiplied by SIheff -C to yield grease ice volume. Additionally, the actual grease ice -C layer thickness (diagnostic SIgrsLT) can be saved. +C with SItrUnit(1) = '[0-1]', which needs to be multiplied by SIheff to +C yield grease ice volume. Additionally, the actual grease ice layer +C thickness (diagnostic SIgrsLT) can be saved. #undef SEAICE_GREASE -C-- grease ice uses SItracer: + +C-- Tracers of ice and/or ice cover. #ifdef SEAICE_GREASE +C SEAICE_GREASE code requires to define ALLOW_SITRACER +# define ALLOW_SITRACER +#else # define ALLOW_SITRACER -# define ALLOW_SITRACER_ADVCAP #endif +#ifdef ALLOW_SITRACER +C- To try avoid 'spontaneous generation' of tracer maxima by advdiff. +# define ALLOW_SITRACER_ADVCAP + +C- Include code to diagnose sea ice tracer budgets in +C seaice_advdiff.F and seaice_tracer_phys.F. Diagnostics are +C computed the "call diagnostics_fill" statement is commented out. +# undef ALLOW_SITRACER_DEBUG_DIAG +#endif /* ALLOW_SITRACER */ + +C-- Allow sea-ice dynamic code. These options are provided so that, +C if turned off (#undef), to compile (and process with TAF) only the +C the thermodynamics component of the code. Note that, if needed, +C sea-ice dynamics can be turned off at runtime (SEAICEuseDYNAMICS=F). C-- Historically, the seaice model was discretized on a B-Grid. This -C discretization should still work but it is not longer actively tested -C and supported. The following flag should always be set in order to use -C the operational C-grid discretization. +C discretization should still work but it is not longer actively +C tested and supported. Define this flag to compile it. It cannot be +C defined together with SEAICE_CGRID +#undef SEAICE_BGRID_DYNAMICS + +C-- The following flag should always be set in order to use C the +C-- operational C-grid discretization. #define SEAICE_CGRID -C-- Only for the C-grid version it is possible to #ifdef SEAICE_CGRID +C-- Options for the C-grid version only: + C enable advection of sea ice momentum # undef SEAICE_ALLOW_MOM_ADVECTION + C enable JFNK code by defining the following flag # undef SEAICE_ALLOW_JFNK + C enable Krylov code by defining the following flag # undef SEAICE_ALLOW_KRYLOV + +C-- Use a different order when mapping 2D velocity arrays to 1D vector +C before passing it to FGMRES. +# undef SEAICE_JFNK_MAP_REORDER + +C to reproduce old verification results for JFNK +# undef SEAICE_PRECOND_EXTRA_EXCHANGE + C enable LSR to use global (multi-tile) tri-diagonal solver # undef SEAICE_GLOBAL_3DIAG_SOLVER + C enable EVP code by defining the following flag # define SEAICE_ALLOW_EVP # ifdef SEAICE_ALLOW_EVP -C-- When set use SEAICE_zetaMin and SEAICE_evpDampC to limit viscosities +C- When set use SEAICE_zetaMin and SEAICE_evpDampC to limit viscosities C from below and above in seaice_evp: not necessary, and not recommended # undef SEAICE_ALLOW_CLIPZETA + +C Include code to avoid underflows in EVP-code (copied from CICE). +C Many compilers can handle this more efficiently with the help of a flag. +# undef SEAICE_EVP_ELIMINATE_UNDERFLOWS + +C Include code to print residual of EVP iteration for debugging/diagnostics +# undef ALLOW_SEAICE_EVP_RESIDUAL # endif /* SEAICE_ALLOW_EVP */ + C smooth regularization (without max-function) of delta for C better differentiability # undef SEAICE_DELTA_SMOOTHREG + C regularize zeta to zmax with a smooth tanh-function instead C of a min(zeta,zmax). This improves convergence of iterative C solvers (Lemieux and Tremblay 2009, JGR). No effect on EVP # undef SEAICE_ZETA_SMOOTHREG + +C-- Different yield curves within the VP rheology framework C allow the truncated ellipse rheology (runtime flag SEAICEuseTEM) # undef SEAICE_ALLOW_TEM + +C allow the use of the Mohr Coulomb rheology (runtime flag SEAICEuseMCS) +C as defined in (Ip 1991) /!\ This is known to give unstable results, +C use with caution +# undef SEAICE_ALLOW_MCS + +C allow the use of Mohr Coulomb with elliptical plastic potential +C (runtime flag SEAICEuseMCE) +# undef SEAICE_ALLOW_MCE + +C allow the teardrop and parabolic lens rheology +C (runtime flag SEAICEuseTD and SEAICEusePL) +# undef SEAICE_ALLOW_TEARDROP + +C-- LSR solver settings C Use LSR vector code; not useful on non-vector machines, because it C slows down convergence considerably, but the extra iterations are C more than made up by the much faster code on vector machines. For @@ -122,54 +165,108 @@ C the only regularly test vector machine these flags a specified C in the build options file SUPER-UX_SX-8_sxf90_awi, so that we comment C them out here. # undef SEAICE_VECTORIZE_LSR + C Use zebra-method (alternate lines) for line-successive-relaxation C This modification improves the convergence of the vector code C dramatically, so that is may actually be useful in general, but C that needs to be tested. Can be used without vectorization options. # define SEAICE_LSR_ZEBRA + +C Include code to print residual of nonlinear outer loop of LSR +# undef SEAICE_ALLOW_CHECK_LSR_CONVERGENCE + +C This flag is also required for an actual adjoint of seaice_lsr; +C increases memory requirements a lot. +# undef SEAICE_LSR_ADJOINT_ITER + C Use parameterisation of grounding ice for a better representation C of fastice in shallow seas # define SEAICE_ALLOW_BOTTOMDRAG -#else /* not SEAICE_CGRID, but old B-grid */ -C-- By default for B-grid dynamics solver wind stress under sea-ice is + +#endif /* SEAICE_CGRID */ + +#ifdef SEAICE_BGRID_DYNAMICS +C-- Options for the B-grid version only: + +C- By default for B-grid dynamics solver wind stress under sea-ice is C set to the same value as it would be if there was no sea-ice. C Define following CPP flag for B-grid ice-ocean stress coupling. # define SEAICE_BICE_STRESS -C-- By default for B-grid dynamics solver surface tilt is obtained +C- By default for B-grid dynamics solver surface tilt is obtained C indirectly via geostrophic velocities. Define following CPP C in order to use ETAN instead. # define EXPLICIT_SSH_SLOPE -C-- Defining this flag turns on FV-discretization of the B-grid LSOR solver. + +C- Defining this flag turns on FV-discretization of the B-grid LSOR solver. C It is smoother and includes all metric terms, similar to C-grid solvers. C It is here for completeness, but its usefulness is unclear. # undef SEAICE_LSRBNEW -#endif /* SEAICE_CGRID */ -C-- When set limit the Ice-Loading to mass of 1/5 of Surface ocean grid-box +#endif /* SEAICE_BGRID_DYNAMICS */ + +C-- Some regularisations +C- When set limit the Ice-Loading to mass of 1/5 of Surface ocean grid-box #undef SEAICE_CAP_ICELOAD -C-- When set use SEAICE_clipVelocties = .true., to clip U/VICE at 40cm/s, + +C- When set use SEAICE_clipVelocties = .true., to clip U/VICE at 40cm/s, C not recommended #undef SEAICE_ALLOW_CLIPVELS -C-- When set cap the sublimation latent heat flux in solve4temp according + +C- When set cap the sublimation latent heat flux in solve4temp according C to the available amount of ice+snow. Otherwise this term is treated C like all of the others -- residuals heat and fw stocks are passed to C the ocean at the end of seaice_growth in a conservative manner. C SEAICE_CAP_SUBLIM is not needed as of now, but kept just in case. #undef SEAICE_CAP_SUBLIM +C-- AD flags +C- TAF related flag, currently only used in seaice_ad_check_lev[1-4]_dir.h; +C it is unclear if this is ever needed. +#undef AUTODIFF_SOMETIMES_NEEDED + +C- Reset fields to zero to stabilise AD code of dynamics solver +C (resulting in wrong gradients) +#undef SEAICE_DYN_STABLE_ADJOINT + +C- Another flag to simplify dependencies for TAF-generated AD-code +C the thermodynamic part, mostly by resetting variables to zero +#undef SEAICE_MODIFY_GROWTH_ADJ + +C- Special seaice flag for AD testing +#undef SEAICE_EXCLUDE_FOR_EXACT_AD_TESTING + +C-- Use the adjointable sea-ice thermodynamic model +C in seaice_growth_adx.F instead of seaice_growth.F +C This options excludes more complex physics such +C as sublimation, ITD, and frazil. +#undef SEAICE_USE_GROWTH_ADX + +C-- These flags are not strictly AD-related but may help obtaining +C simpler AD-code: +C- Do not compile code that resets AREA (or AREAITD) to a mininum value +C of SEAICE_area_floor (=SIeps with default of 1e-5) if there is +C some finite sea ice thickness +#undef DISABLE_AREA_FLOOR + +C- Do not compile growth/thermodynamics code (avoiding this code can +C also be done by setting runtime parameter usePWthermodynamics=F) +#undef DISABLE_SEAICE_GROWTH + +C- Do not compile/use seaice-related obcs code when using obcs. +#undef DISABLE_SEAICE_OBCS + C-- Enable free drift code #define SEAICE_ALLOW_FREEDRIFT C-- pkg/seaice cost functions compile flags -c >>> Sea-ice volume (requires pkg/cost) +C- Sea-ice volume (requires pkg/cost) #undef ALLOW_COST_ICE -c >>> Sea-ice misfit to obs (requires pkg/cost and ecco) -#undef ALLOW_SEAICE_COST_SMR_AREA +#ifdef ALLOW_COST_ICE +C- Enable template for sea-ice volume export in seaice_cost_export.F +C (requires pkg/cost & ALLOW_COST_ICE defined) +# undef ALLOW_SEAICE_COST_EXPORT +#endif /* ALLOW_COST_ICE */ #endif /* ALLOW_SEAICE */ #endif /* SEAICE_OPTIONS_H */ - -CEH3 ;;; Local Variables: *** -CEH3 ;;; mode:fortran *** -CEH3 ;;; End: *** diff --git a/verification/lab_sea/code_ad/AUTODIFF_OPTIONS.h b/verification/lab_sea/code_ad/AUTODIFF_OPTIONS.h index f0da120d11..818fdb6b47 100644 --- a/verification/lab_sea/code_ad/AUTODIFF_OPTIONS.h +++ b/verification/lab_sea/code_ad/AUTODIFF_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef AUTODIFF_OPTIONS_H +#define AUTODIFF_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: AUTODIFF_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef AUTODIFF_OPTIONS_H -#define AUTODIFF_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_AUTODIFF #ifdef ECCO_CPPOPTIONS_H @@ -26,10 +26,11 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -C o Include/exclude code in order to be able to automatically -C differentiate the MITgcmUV by using the Tangent Linear and -C Adjoint Model Compiler (TAMC). +C o Include/exclude code in order to automatically differentiate MITgcm code +C using TAF (Transformation of Algorithms in Fortran, http://www.FastOpt.de) +C or using TAMC (Tangent Linear & Adjoint Model Compiler, needs both defined): #define ALLOW_AUTODIFF_TAMC +#undef AUTODIFF_TAMC_COMPATIBILITY C >>> Checkpointing as handled by TAMC #define ALLOW_TAMC_CHECKPOINTING @@ -40,19 +41,19 @@ C >>> and DYNVARS_DIAG adjoint state #undef ALLOW_AUTODIFF_MONITOR_DIAG C >>> DO 2-level checkpointing instead of 3-level -c#undef AUTODIFF_2_LEVEL_CHECKPOINT +#undef AUTODIFF_2_LEVEL_CHECKPOINT C extend to 4-level checkpointing -c#undef AUTODIFF_4_LEVEL_CHECKPOINT +#undef AUTODIFF_4_LEVEL_CHECKPOINT C o use divided adjoint to split adjoint computations #define ALLOW_DIVIDED_ADJOINT -#undef ALLOW_PACKUNPACK_METHOD2 - C o This flag is incredibly useful as it reduces the number of C tape-files on the disc. Maybe it should even be the default. #define ALLOW_AUTODIFF_WHTAPEIO +C and related to above: +#undef ALLOW_INIT_WHTAPEIO C o use standard MDSFINDUINTS instead of local pkg/autodiff version for C WHTAPEIO code I/O. @@ -70,6 +71,10 @@ C Might still be used for OBCS since WHTAPEIO does not support OBCS fields. C o allow using viscFacInAd to recompute viscosities in AD #define AUTODIFF_ALLOW_VISCFACADJ +C o To remove part of MOM_CALC_VISC (better name would be: MOM_DISABLE_*) +#undef AUTODIFF_DISABLE_LEITH +#undef AUTODIFF_DISABLE_REYNOLDS_SCALE + C o for output of AD-variables (ALLOW_AUTODIFF_MONITOR), specific code (e.g., C in addummy_in_stepping.F) relies on adexch_uv_xy_rs and adexch_xy_rs S/R C which might not always be generated by TAF (e.g., when controls do not diff --git a/verification/lab_sea/code_ad/CTRL_OPTIONS.h b/verification/lab_sea/code_ad/CTRL_OPTIONS.h index 3afca9c197..7d7794ff65 100644 --- a/verification/lab_sea/code_ad/CTRL_OPTIONS.h +++ b/verification/lab_sea/code_ad/CTRL_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef CTRL_OPTIONS_H +#define CTRL_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: CTRL_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef CTRL_OPTIONS_H -#define CTRL_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_CTRL #ifdef ECCO_CPPOPTIONS_H @@ -26,71 +26,68 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -C o Re-activate deprecated codes in pkg/ecco & pkg/ctrl (but not recommended) -C and since pkg/ctrl can be used without pkg/ecco, better to have it here -#undef ECCO_CTRL_DEPRECATED - +C o I/O and pack settings +#undef CTRL_SET_PREC_32 +C This option is only relevant (for pack/unpack) with OBCS_CONTROL: +#undef ALLOW_NONDIMENSIONAL_CONTROL_IO #undef EXCLUDE_CTRL_PACK -#define ALLOW_NONDIMENSIONAL_CONTROL_IO #define ALLOW_PACKUNPACK_METHOD2 - -C >>> Initial values. -#define ALLOW_THETA0_CONTROL -#define ALLOW_SALT0_CONTROL -#undef ALLOW_UVEL0_CONTROL -#undef ALLOW_VVEL0_CONTROL -#undef ALLOW_TR10_CONTROL -#undef ALLOW_TAUU0_CONTROL -#undef ALLOW_TAUV0_CONTROL -#undef ALLOW_SFLUX0_CONTROL -#undef ALLOW_HFLUX0_CONTROL -#undef ALLOW_SSS0_CONTROL -#undef ALLOW_SST0_CONTROL - -C >>> Surface fluxes. -#undef ALLOW_HFLUX_CONTROL -#undef ALLOW_SFLUX_CONTROL -#undef ALLOW_USTRESS_CONTROL -#undef ALLOW_VSTRESS_CONTROL -#undef ALLOW_SWFLUX_CONTROL -#undef ALLOW_LWFLUX_CONTROL - -C >>> Atmospheric state. -#define ALLOW_ATEMP_CONTROL -#define ALLOW_AQH_CONTROL -#define ALLOW_PRECIP_CONTROL -#define ALLOW_SNOWPRECIP_CONTROL -#define ALLOW_SWDOWN_CONTROL -#define ALLOW_LWDOWN_CONTROL -#define ALLOW_UWIND_CONTROL -#define ALLOW_VWIND_CONTROL -#undef ALLOW_EVAP_CONTROL -#define ALLOW_APRESSURE_CONTROL -#undef ALLOW_RUNOFF_CONTROL - -C >>> Radiation -#undef ALLOW_SWFLUX_CONTROL -#undef ALLOW_LWFLUX_CONTROL - -C >>> seaice init. conditions -CML#define ALLOW_SIAREA_CONTROL -CML#define ALLOW_SIHEFF_CONTROL -#undef ALLOW_SIHSNOW_CONTROL +#undef CTRL_DO_PACK_UNPACK_ONLY +#undef CTRL_PACK_PRECISE +#undef CTRL_UNPACK_PRECISE +#undef CTRL_DELZNORM +#undef ALLOW_CTRL_WETV C >>> Other Control. -#undef ALLOW_DIFFKR_CONTROL +C Allows for GMREDI controls #undef ALLOW_KAPGM_CONTROL #undef ALLOW_KAPREDI_CONTROL +C Allows for Vertical Diffusivity controls +#undef ALLOW_DIFFKR_CONTROL #undef ALLOW_BOTTOMDRAG_CONTROL - -C >>> Backward compatibility option (before checkpoint 65p) -#undef ALLOW_KAPGM_CONTROL_OLD -#undef ALLOW_KAPREDI_CONTROL_OLD +#undef ALLOW_DIC_CONTROL + +C Allows bathymetry as a control vector +C Note: keep this Option separated from generic control since this control +C involves many new dependencies that we would like to avoid in general. +#undef ALLOW_DEPTH_CONTROL +#ifdef ALLOW_DEPTH_CONTROL +C Only relevant within DEPTH_CONTROL code: +# define USE_SMOOTH_MIN +# undef ALLOW_HFACC_CONTROL +# undef ALLOW_HFACC3D_CONTROL +#endif /* ALLOW_DEPTH_CONTROL */ C >>> Generic Control. #define ALLOW_GENARR2D_CONTROL #define ALLOW_GENARR3D_CONTROL #define ALLOW_GENTIM2D_CONTROL +# undef ALLOW_UVEL0_CONTROL +# undef ALLOW_VVEL0_CONTROL +# undef CTRL_SET_OLD_MAXCVARS_30 +# undef CTRL_SET_OLD_MAXCVARS_40 + +C >>> Open boundaries +#ifdef ALLOW_OBCS +C Control of Open-Boundaries is meaningless without compiling pkg/obcs +C Note: Make sure that corresponding OBCS N/S/W/E Option is defined +# define ALLOW_OBCSN_CONTROL +# define ALLOW_OBCSS_CONTROL +# define ALLOW_OBCSW_CONTROL +# define ALLOW_OBCSE_CONTROL +# undef ALLOW_OBCS_CONTROL_MODES +#endif /* ALLOW_OBCS */ + +C o Set ALLOW_OBCS_CONTROL (Do not edit/modify): +#if (defined (ALLOW_OBCSN_CONTROL) || \ + defined (ALLOW_OBCSS_CONTROL) || \ + defined (ALLOW_OBCSW_CONTROL) || \ + defined (ALLOW_OBCSE_CONTROL)) +# define ALLOW_OBCS_CONTROL +#endif + +C o Impose bounds on controls +#undef ALLOW_ADCTRLBOUND C o Rotation of wind/stress controls adjustments C from Eastward/Northward to model grid directions @@ -102,19 +99,16 @@ C The CTRL_SKIP_FIRST_TWO_ATM_REC_ALL option extends this C to the other the time variable atmospheric controls. #undef CTRL_SKIP_FIRST_TWO_ATM_REC_ALL -C o use pkg/smooth correlation operator (incl. smoother) for 2D controls (Weaver, Courtier 01) -C This CPP option just sets the default for ctrlSmoothCorrel2D to .TRUE. -#undef ALLOW_SMOOTH_CORREL2D -C o use pkg/smooth correlation operator (incl. smoother) for 3D controls (Weaver, Courtier 01) -C This CPP option just sets the default for ctrlSmoothCorrel3D to .TRUE. -#undef ALLOW_SMOOTH_CORREL3D - -C o apply pkg/ctrl/ctrl_smooth.F to 2D controls (outside of ctrlSmoothCorrel2D) -#undef ALLOW_CTRL_SMOOTH -C o apply pkg/smooth/smooth_diff2d.F to 2D controls (outside of ctrlSmoothCorrel2D) +C Note: this flag turns on extra smoothing code in ctrl_get_gen.F which +C is inconsistent with the Weaver and Courtier, 2001 algorithm, and +C should probably not be used. The corresponding 3D flag applied only +C to deprecated code that is now removed. At some point we will remove +C this flag and associated code as well. +C o apply pkg/smooth/smooth_diff2d.F to 2D controls (outside of Smooth_Correl2D) #undef ALLOW_SMOOTH_CTRL2D -C o apply pkg/smooth/smooth_diff3d.F to 3D controls (outside of ctrlSmoothCorrel3D) -#undef ALLOW_SMOOTH_CTRL3D + +C o Print more debug info to STDOUT +#undef ALLOW_CTRL_DEBUG C ================================================================== #endif /* ndef ECCO_CPPOPTIONS_H */ diff --git a/verification/lab_sea/code_ad/ECCO_OPTIONS.h b/verification/lab_sea/code_ad/ECCO_OPTIONS.h index 8aa6a90c47..91f70593cd 100644 --- a/verification/lab_sea/code_ad/ECCO_OPTIONS.h +++ b/verification/lab_sea/code_ad/ECCO_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef ECCO_OPTIONS_H +#define ECCO_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: ECCO_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef ECCO_OPTIONS_H -#define ECCO_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_ECCO #ifdef ECCO_CPPOPTIONS_H @@ -26,80 +26,65 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C-- Package-specific Options & Macros go here -# define ALLOW_ATEMP_COST_CONTRIBUTION -# define ALLOW_AQH_COST_CONTRIBUTION -# define ALLOW_UWIND_COST_CONTRIBUTION -# define ALLOW_VWIND_COST_CONTRIBUTION -# define ALLOW_PRECIP_COST_CONTRIBUTION -# define ALLOW_SNOWPRECIP_COST_CONTRIBUTION -# define ALLOW_SWDOWN_COST_CONTRIBUTION -# define ALLOW_LWDOWN_COST_CONTRIBUTION -# undef ALLOW_EVAP_COST_CONTRIBUTION -# define ALLOW_APRESSURE_COST_CONTRIBUTION -# undef ALLOW_RUNOFF_COST_CONTRIBUTION - -# define ALLOW_THETA0_COST_CONTRIBUTION -# define ALLOW_SALT0_COST_CONTRIBUTION -# define ALLOW_THETA_COST_CONTRIBUTION -# define ALLOW_SALT_COST_CONTRIBUTION -# define ALLOW_SST_COST_CONTRIBUTION -# define ALLOW_SSS_COST_CONTRIBUTION - -CML# define ALLOW_SSH_MEAN_COST_CONTRIBUTION -CML# define ALLOW_SSH_TPANOM_COST_CONTRIBUTION -CML# define ALLOW_SSH_ERSANOM_COST_CONTRIBUTION -CML# undef ALLOW_SPH_PROJECTION -CML# if (defined (ALLOW_SSH_MEAN_COST_CONTRIBUTION) || \ -CML defined (ALLOW_SSH_TPANOM_COST_CONTRIBUTION) || \ -CML defined (ALLOW_SSH_ERSANOM_COST_CONTRIBUTION)) -CML# define ALLOW_SSH_COST_CONTRIBUTION -CML# endif - -C allow for generic cost function and integral terms +C o Allow for generic cost function and integral terms with pkg/ecco: #define ALLOW_GENCOST_CONTRIBUTION -C allow for 3 dimensional generic terms +C o Allow for 3 dimensional generic cost terms with pkg/ecco: #define ALLOW_GENCOST3D - -C include global mean steric sea level correction +C Note regarding GENCOST usage: +C > In data.ecco, this requires the specification of data file (name, +C frequency, etc.), bar file name for corresp. model average, standard +C error file name, etc. +C > In addition, adding such cost terms requires editing ECCO_SIZE.h to +C increase NGENCOST/NGENCOST3D, and editing cost_gencost_customize.F to +C implement the actual model average (i.e. the bar file content). +# undef ALLOW_GENCOST_1D +# undef ALLOW_GENCOST_SSTV4_OUTPUT + +C o Allow Open-Boundary cost contributions +#ifdef ALLOW_OBCS +C Open-Boundary cost is meaningless without compiling pkg/obcs +C Note: Make sure that coresponding OBCS N/S/W/E Option is defined +# define ALLOW_OBCSN_COST_CONTRIBUTION +# define ALLOW_OBCSS_COST_CONTRIBUTION +# define ALLOW_OBCSW_COST_CONTRIBUTION +# define ALLOW_OBCSE_COST_CONTRIBUTION +# undef OBCS_AGEOS_COST_CONTRIBUTION +# undef OBCS_VOLFLUX_COST_CONTRIBUTION +# undef BAROTROPIC_OBVEL_CONTROL +#endif /* ALLOW_OBCS */ + +C o Set ALLOW_OBCS_COST_CONTRIBUTION (Do not edit/modify): +#if (defined (ALLOW_OBCSN_COST_CONTRIBUTION) || \ + defined (ALLOW_OBCSS_COST_CONTRIBUTION) || \ + defined (ALLOW_OBCSW_COST_CONTRIBUTION) || \ + defined (ALLOW_OBCSE_COST_CONTRIBUTION)) +# define ALLOW_OBCS_COST_CONTRIBUTION +#endif + +C o Include global mean steric sea level correction #undef ALLOW_PSBAR_STERIC -C allow for near-shore and high-latitude altimetry +#ifdef ATMOSPHERIC_LOADING +C Apply inverse barometer correction (coded within ATMOSPHERIC_LOADING) +# undef ALLOW_IB_CORR +#endif +C o Allow for near-shore and high-latitude altimetry #undef ALLOW_SHALLOW_ALTIMETRY #undef ALLOW_HIGHLAT_ALTIMETRY -C allow for In-Situ Profiles cost function contribution +C o Allow for In-Situ Profiles cost function contribution #undef ALLOW_PROFILES_CONTRIBUTION -C cost function output format +C o Cost function output format #undef ALLOW_ECCO_OLD_FC_PRINT -C-- real options? - -C include dump of snap shots for checks -#undef ALLOW_SNAPSHOTS - -cph >>>>>> !!!!!! SPECIAL SEAICE FLAG FOR TESTING !!!!!! <<<<<< -c#define SEAICE_EXCLUDE_FOR_EXACT_AD_TESTING -cph >>>>>> !!!!!! SPECIAL SEAICE FLAG FOR TESTING !!!!!! <<<<<< - -C generate more text in STDOUT.0000 +C o Generate more text in STDOUT #undef ECCO_VERBOSE +#undef ALLOW_ECCO_DEBUG -C allow cost function term for sigmaR -#undef ALLOW_SIGMAR_COST_CONTRIBUTION - -C-- fake options (only used to be printed in S/R ECCO_SUMMARY): - -C allow ??? -#define ALLOW_ECCO_FORWARD_RUN -#undef ALLOW_ECCO_DIAGNOSTIC_RUN -C Just do a "dry" run ( useful for testing ). -#undef ALLOW_NO_DYNAMICS -C Use the Yearly-Monthly-Daily-Stepping call tree. -#undef ALLOW_YMDS_TREE -C Do not call stepping -#define ALLOW_STEPPING_CALL -C Projection onto Spherical Harmonics -#undef ALLOW_SPH_PROJECTION +C-- partially retired options (i.e., only used to set default switch): +# undef ALLOW_SSH_COST_CONTRIBUTION +#define ALLOW_SST_COST_CONTRIBUTION +# undef ALLOW_SEAICE_COST_CONTRIBUTION C ================================================================== #endif /* ndef ECCO_CPPOPTIONS_H */ diff --git a/verification/lab_sea/code_ad/SEAICE_OPTIONS.h b/verification/lab_sea/code_ad/SEAICE_OPTIONS.h index 6e972776fe..d27c394be0 100644 --- a/verification/lab_sea/code_ad/SEAICE_OPTIONS.h +++ b/verification/lab_sea/code_ad/SEAICE_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef SEAICE_OPTIONS_H +#define SEAICE_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + C *==========================================================* C | SEAICE_OPTIONS.h C | o CPP options file for sea ice package. @@ -6,24 +11,12 @@ C | Use this file for selecting options within the sea ice C | package. C *==========================================================* -#ifndef SEAICE_OPTIONS_H -#define SEAICE_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_SEAICE -C Package-specific Options & Macros go here +C--- Package-specific Options & Macros go here C-- Write "text-plots" of certain fields in STDOUT for debugging. #undef SEAICE_DEBUG -C-- Allow sea-ice dynamic code. -C This option is provided to allow use of TAMC -C on the thermodynamics component of the code only. -C Sea-ice dynamics can also be turned off at runtime -C using variable SEAICEuseDYNAMICS. -#define SEAICE_ALLOW_DYNAMICS - C-- By default, the sea-ice package uses its own integrated bulk C formulae to compute fluxes (fu, fv, EmPmR, Qnet, and Qsw) over C open-ocean. When this flag is set, these variables are computed @@ -55,66 +48,116 @@ C seaice with a fraction (=SEAICE_saltFrac) of freezing seawater salinity. C- Note: SItracer also offers an alternative way to handle variable salinity. #define SEAICE_VARIABLE_SALINITY -C-- Tracers of ice and/or ice cover. -#undef ALLOW_SITRACER -#ifdef ALLOW_SITRACER -C-- To try avoid 'spontaneous generation' of tracer maxima by advdiff. -# define ALLOW_SITRACER_ADVCAP -#endif - -C-- Enable grease ice parameterization -C The grease ice parameterization delays formation of solid -C sea ice from frazil ice by a time constant and provides a -C dynamic calculation of the initial solid sea ice thickness -C HO as a function of winds, currents and available grease ice -C volume. Grease ice does not significantly reduce heat loss -C from the ocean in winter and area covered by grease is thus -C handled like open water. -C (For details see Smedsrud and Martin, 2014, Ann.Glac.) +C-- Enable grease ice parameterization (requires to define ALLOW_SITRACER): +C The grease ice parameterization delays formation of solid sea ice from +C frazil ice by a time constant and provides a dynamic calculation of the +C initial solid sea ice thickness HO as a function of winds, currents and +C available grease ice volume. Grease ice does not significantly reduce heat +C loss from the ocean in winter and area covered by grease is thus handled +C like open water (For details see Smedsrud and Martin, 2014, Ann.Glac.). C Set SItrName(1) = 'grease' in namelist SEAICE_PARM03 in data.seaice C then output SItr01 is SItrNameLong(1) = 'grease ice volume fraction', -C with SItrUnit(1) = '[0-1]', which needs to be multiplied by SIheff -C to yield grease ice volume. Additionally, the actual grease ice -C layer thickness (diagnostic SIgrsLT) can be saved. +C with SItrUnit(1) = '[0-1]', which needs to be multiplied by SIheff to +C yield grease ice volume. Additionally, the actual grease ice layer +C thickness (diagnostic SIgrsLT) can be saved. #undef SEAICE_GREASE -C-- grease ice uses SItracer: + +C-- Tracers of ice and/or ice cover. #ifdef SEAICE_GREASE +C SEAICE_GREASE code requires to define ALLOW_SITRACER # define ALLOW_SITRACER -# define ALLOW_SITRACER_ADVCAP +#else +# undef ALLOW_SITRACER #endif +#ifdef ALLOW_SITRACER +C- To try avoid 'spontaneous generation' of tracer maxima by advdiff. +# define ALLOW_SITRACER_ADVCAP + +C- Include code to diagnose sea ice tracer budgets in +C seaice_advdiff.F and seaice_tracer_phys.F. Diagnostics are +C computed the "call diagnostics_fill" statement is commented out. +# undef ALLOW_SITRACER_DEBUG_DIAG +#endif /* ALLOW_SITRACER */ + +C-- Allow sea-ice dynamic code. These options are provided so that, +C if turned off (#undef), to compile (and process with TAF) only the +C the thermodynamics component of the code. Note that, if needed, +C sea-ice dynamics can be turned off at runtime (SEAICEuseDYNAMICS=F). C-- Historically, the seaice model was discretized on a B-Grid. This -C discretization should still work but it is not longer actively tested -C and supported. The following flag should always be set in order to use -C the operational C-grid discretization. +C discretization should still work but it is not longer actively +C tested and supported. Define this flag to compile it. It cannot be +C defined together with SEAICE_CGRID +#undef SEAICE_BGRID_DYNAMICS + +C-- The following flag should always be set in order to use C the +C-- operational C-grid discretization. #define SEAICE_CGRID -C-- Only for the C-grid version it is possible to #ifdef SEAICE_CGRID +C-- Options for the C-grid version only: + C enable advection of sea ice momentum # undef SEAICE_ALLOW_MOM_ADVECTION + C enable JFNK code by defining the following flag # undef SEAICE_ALLOW_JFNK + C enable Krylov code by defining the following flag # undef SEAICE_ALLOW_KRYLOV + +C-- Use a different order when mapping 2D velocity arrays to 1D vector +C before passing it to FGMRES. +# undef SEAICE_JFNK_MAP_REORDER + +C to reproduce old verification results for JFNK +# undef SEAICE_PRECOND_EXTRA_EXCHANGE + C enable LSR to use global (multi-tile) tri-diagonal solver # undef SEAICE_GLOBAL_3DIAG_SOLVER + C enable EVP code by defining the following flag # define SEAICE_ALLOW_EVP # ifdef SEAICE_ALLOW_EVP -C-- When set use SEAICE_zetaMin and SEAICE_evpDampC to limit viscosities +C- When set use SEAICE_zetaMin and SEAICE_evpDampC to limit viscosities C from below and above in seaice_evp: not necessary, and not recommended # undef SEAICE_ALLOW_CLIPZETA + +C Include code to avoid underflows in EVP-code (copied from CICE). +C Many compilers can handle this more efficiently with the help of a flag. +# undef SEAICE_EVP_ELIMINATE_UNDERFLOWS + +C Include code to print residual of EVP iteration for debugging/diagnostics +# undef ALLOW_SEAICE_EVP_RESIDUAL # endif /* SEAICE_ALLOW_EVP */ + C smooth regularization (without max-function) of delta for C better differentiability # undef SEAICE_DELTA_SMOOTHREG + C regularize zeta to zmax with a smooth tanh-function instead C of a min(zeta,zmax). This improves convergence of iterative C solvers (Lemieux and Tremblay 2009, JGR). No effect on EVP # undef SEAICE_ZETA_SMOOTHREG + +C-- Different yield curves within the VP rheology framework C allow the truncated ellipse rheology (runtime flag SEAICEuseTEM) # undef SEAICE_ALLOW_TEM + +C allow the use of the Mohr Coulomb rheology (runtime flag SEAICEuseMCS) +C as defined in (Ip 1991) /!\ This is known to give unstable results, +C use with caution +# undef SEAICE_ALLOW_MCS + +C allow the use of Mohr Coulomb with elliptical plastic potential +C (runtime flag SEAICEuseMCE) +# undef SEAICE_ALLOW_MCE + +C allow the teardrop and parabolic lens rheology +C (runtime flag SEAICEuseTD and SEAICEusePL) +# undef SEAICE_ALLOW_TEARDROP + +C-- LSR solver settings C Use LSR vector code; not useful on non-vector machines, because it C slows down convergence considerably, but the extra iterations are C more than made up by the much faster code on vector machines. For @@ -122,55 +165,108 @@ C the only regularly test vector machine these flags a specified C in the build options file SUPER-UX_SX-8_sxf90_awi, so that we comment C them out here. # undef SEAICE_VECTORIZE_LSR + C Use zebra-method (alternate lines) for line-successive-relaxation C This modification improves the convergence of the vector code C dramatically, so that is may actually be useful in general, but C that needs to be tested. Can be used without vectorization options. # define SEAICE_LSR_ZEBRA + +C Include code to print residual of nonlinear outer loop of LSR +# undef SEAICE_ALLOW_CHECK_LSR_CONVERGENCE + C This flag is also required for an actual adjoint of seaice_lsr; C increases memory requirements a lot. # define SEAICE_LSR_ADJOINT_ITER + C Use parameterisation of grounding ice for a better representation C of fastice in shallow seas # undef SEAICE_ALLOW_BOTTOMDRAG -#else /* not SEAICE_CGRID, but old B-grid */ -C-- By default for B-grid dynamics solver wind stress under sea-ice is + +#endif /* SEAICE_CGRID */ + +#ifdef SEAICE_BGRID_DYNAMICS +C-- Options for the B-grid version only: + +C- By default for B-grid dynamics solver wind stress under sea-ice is C set to the same value as it would be if there was no sea-ice. C Define following CPP flag for B-grid ice-ocean stress coupling. # define SEAICE_BICE_STRESS -C-- By default for B-grid dynamics solver surface tilt is obtained +C- By default for B-grid dynamics solver surface tilt is obtained C indirectly via geostrophic velocities. Define following CPP C in order to use ETAN instead. # define EXPLICIT_SSH_SLOPE -C-- Defining this flag turns on FV-discretization of the B-grid LSOR solver. + +C- Defining this flag turns on FV-discretization of the B-grid LSOR solver. C It is smoother and includes all metric terms, similar to C-grid solvers. C It is here for completeness, but its usefulness is unclear. # undef SEAICE_LSRBNEW -#endif /* SEAICE_CGRID */ -C-- When set limit the Ice-Loading to mass of 1/5 of Surface ocean grid-box +#endif /* SEAICE_BGRID_DYNAMICS */ + +C-- Some regularisations +C- When set limit the Ice-Loading to mass of 1/5 of Surface ocean grid-box #undef SEAICE_CAP_ICELOAD -C-- When set use SEAICE_clipVelocties = .true., to clip U/VICE at 40cm/s, + +C- When set use SEAICE_clipVelocties = .true., to clip U/VICE at 40cm/s, C not recommended #undef SEAICE_ALLOW_CLIPVELS -C-- When set cap the sublimation latent heat flux in solve4temp according + +C- When set cap the sublimation latent heat flux in solve4temp according C to the available amount of ice+snow. Otherwise this term is treated C like all of the others -- residuals heat and fw stocks are passed to C the ocean at the end of seaice_growth in a conservative manner. C SEAICE_CAP_SUBLIM is not needed as of now, but kept just in case. #undef SEAICE_CAP_SUBLIM +C-- AD flags +C- TAF related flag, currently only used in seaice_ad_check_lev[1-4]_dir.h; +C it is unclear if this is ever needed. +#undef AUTODIFF_SOMETIMES_NEEDED + +C- Reset fields to zero to stabilise AD code of dynamics solver +C (resulting in wrong gradients) +#undef SEAICE_DYN_STABLE_ADJOINT + +C- Another flag to simplify dependencies for TAF-generated AD-code +C the thermodynamic part, mostly by resetting variables to zero +#undef SEAICE_MODIFY_GROWTH_ADJ + +C- Special seaice flag for AD testing +#undef SEAICE_EXCLUDE_FOR_EXACT_AD_TESTING + +C-- Use the adjointable sea-ice thermodynamic model +C in seaice_growth_adx.F instead of seaice_growth.F +C This options excludes more complex physics such +C as sublimation, ITD, and frazil. +#undef SEAICE_USE_GROWTH_ADX + +C-- These flags are not strictly AD-related but may help obtaining +C simpler AD-code: +C- Do not compile code that resets AREA (or AREAITD) to a mininum value +C of SEAICE_area_floor (=SIeps with default of 1e-5) if there is +C some finite sea ice thickness +#undef DISABLE_AREA_FLOOR + +C- Do not compile growth/thermodynamics code (avoiding this code can +C also be done by setting runtime parameter usePWthermodynamics=F) +#undef DISABLE_SEAICE_GROWTH + +C- Do not compile/use seaice-related obcs code when using obcs. +#undef DISABLE_SEAICE_OBCS + C-- Enable free drift code #define SEAICE_ALLOW_FREEDRIFT C-- pkg/seaice cost functions compile flags -c >>> Sea-ice volume (requires pkg/cost) +C- Sea-ice volume (requires pkg/cost) #undef ALLOW_COST_ICE +#ifdef ALLOW_COST_ICE +C- Enable template for sea-ice volume export in seaice_cost_export.F +C (requires pkg/cost & ALLOW_COST_ICE defined) +# undef ALLOW_SEAICE_COST_EXPORT +#endif /* ALLOW_COST_ICE */ #endif /* ALLOW_SEAICE */ #endif /* SEAICE_OPTIONS_H */ - -CEH3 ;;; Local Variables: *** -CEH3 ;;; mode:fortran *** -CEH3 ;;; End: *** diff --git a/verification/lab_sea/code_tap/AUTODIFF_OPTIONS.h b/verification/lab_sea/code_tap/AUTODIFF_OPTIONS.h index b92794d8d2..7bcb6fdc8a 100644 --- a/verification/lab_sea/code_tap/AUTODIFF_OPTIONS.h +++ b/verification/lab_sea/code_tap/AUTODIFF_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef AUTODIFF_OPTIONS_H +#define AUTODIFF_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: AUTODIFF_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef AUTODIFF_OPTIONS_H -#define AUTODIFF_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_AUTODIFF #ifdef ECCO_CPPOPTIONS_H @@ -26,10 +26,11 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -C o Include/exclude code in order to be able to automatically -C differentiate the MITgcmUV by using the Tangent Linear and -C Adjoint Model Compiler (TAMC). +C o Include/exclude code in order to automatically differentiate MITgcm code +C using TAF (Transformation of Algorithms in Fortran, http://www.FastOpt.de) +C or using TAMC (Tangent Linear & Adjoint Model Compiler, needs both defined): #undef ALLOW_AUTODIFF_TAMC +#undef AUTODIFF_TAMC_COMPATIBILITY C >>> Checkpointing as handled by TAMC #undef ALLOW_TAMC_CHECKPOINTING @@ -40,19 +41,19 @@ C >>> and DYNVARS_DIAG adjoint state #undef ALLOW_AUTODIFF_MONITOR_DIAG C >>> DO 2-level checkpointing instead of 3-level -c#undef AUTODIFF_2_LEVEL_CHECKPOINT +#undef AUTODIFF_2_LEVEL_CHECKPOINT C extend to 4-level checkpointing -c#undef AUTODIFF_4_LEVEL_CHECKPOINT +#undef AUTODIFF_4_LEVEL_CHECKPOINT C o use divided adjoint to split adjoint computations #undef ALLOW_DIVIDED_ADJOINT -#undef ALLOW_PACKUNPACK_METHOD2 - C o This flag is incredibly useful as it reduces the number of C tape-files on the disc. Maybe it should even be the default. #undef ALLOW_AUTODIFF_WHTAPEIO +C and related to above: +#undef ALLOW_INIT_WHTAPEIO C o use standard MDSFINDUINTS instead of local pkg/autodiff version for C WHTAPEIO code I/O. @@ -70,6 +71,10 @@ C Might still be used for OBCS since WHTAPEIO does not support OBCS fields. C o allow using viscFacInAd to recompute viscosities in AD #define AUTODIFF_ALLOW_VISCFACADJ +C o To remove part of MOM_CALC_VISC (better name would be: MOM_DISABLE_*) +#undef AUTODIFF_DISABLE_LEITH +#undef AUTODIFF_DISABLE_REYNOLDS_SCALE + C o for output of AD-variables (ALLOW_AUTODIFF_MONITOR), specific code (e.g., C in addummy_in_stepping.F) relies on adexch_uv_xy_rs and adexch_xy_rs S/R C which might not always be generated by TAF (e.g., when controls do not diff --git a/verification/lab_sea/code_tap/CTRL_OPTIONS.h b/verification/lab_sea/code_tap/CTRL_OPTIONS.h index 3afca9c197..7d7794ff65 100644 --- a/verification/lab_sea/code_tap/CTRL_OPTIONS.h +++ b/verification/lab_sea/code_tap/CTRL_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef CTRL_OPTIONS_H +#define CTRL_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: CTRL_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef CTRL_OPTIONS_H -#define CTRL_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_CTRL #ifdef ECCO_CPPOPTIONS_H @@ -26,71 +26,68 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -C o Re-activate deprecated codes in pkg/ecco & pkg/ctrl (but not recommended) -C and since pkg/ctrl can be used without pkg/ecco, better to have it here -#undef ECCO_CTRL_DEPRECATED - +C o I/O and pack settings +#undef CTRL_SET_PREC_32 +C This option is only relevant (for pack/unpack) with OBCS_CONTROL: +#undef ALLOW_NONDIMENSIONAL_CONTROL_IO #undef EXCLUDE_CTRL_PACK -#define ALLOW_NONDIMENSIONAL_CONTROL_IO #define ALLOW_PACKUNPACK_METHOD2 - -C >>> Initial values. -#define ALLOW_THETA0_CONTROL -#define ALLOW_SALT0_CONTROL -#undef ALLOW_UVEL0_CONTROL -#undef ALLOW_VVEL0_CONTROL -#undef ALLOW_TR10_CONTROL -#undef ALLOW_TAUU0_CONTROL -#undef ALLOW_TAUV0_CONTROL -#undef ALLOW_SFLUX0_CONTROL -#undef ALLOW_HFLUX0_CONTROL -#undef ALLOW_SSS0_CONTROL -#undef ALLOW_SST0_CONTROL - -C >>> Surface fluxes. -#undef ALLOW_HFLUX_CONTROL -#undef ALLOW_SFLUX_CONTROL -#undef ALLOW_USTRESS_CONTROL -#undef ALLOW_VSTRESS_CONTROL -#undef ALLOW_SWFLUX_CONTROL -#undef ALLOW_LWFLUX_CONTROL - -C >>> Atmospheric state. -#define ALLOW_ATEMP_CONTROL -#define ALLOW_AQH_CONTROL -#define ALLOW_PRECIP_CONTROL -#define ALLOW_SNOWPRECIP_CONTROL -#define ALLOW_SWDOWN_CONTROL -#define ALLOW_LWDOWN_CONTROL -#define ALLOW_UWIND_CONTROL -#define ALLOW_VWIND_CONTROL -#undef ALLOW_EVAP_CONTROL -#define ALLOW_APRESSURE_CONTROL -#undef ALLOW_RUNOFF_CONTROL - -C >>> Radiation -#undef ALLOW_SWFLUX_CONTROL -#undef ALLOW_LWFLUX_CONTROL - -C >>> seaice init. conditions -CML#define ALLOW_SIAREA_CONTROL -CML#define ALLOW_SIHEFF_CONTROL -#undef ALLOW_SIHSNOW_CONTROL +#undef CTRL_DO_PACK_UNPACK_ONLY +#undef CTRL_PACK_PRECISE +#undef CTRL_UNPACK_PRECISE +#undef CTRL_DELZNORM +#undef ALLOW_CTRL_WETV C >>> Other Control. -#undef ALLOW_DIFFKR_CONTROL +C Allows for GMREDI controls #undef ALLOW_KAPGM_CONTROL #undef ALLOW_KAPREDI_CONTROL +C Allows for Vertical Diffusivity controls +#undef ALLOW_DIFFKR_CONTROL #undef ALLOW_BOTTOMDRAG_CONTROL - -C >>> Backward compatibility option (before checkpoint 65p) -#undef ALLOW_KAPGM_CONTROL_OLD -#undef ALLOW_KAPREDI_CONTROL_OLD +#undef ALLOW_DIC_CONTROL + +C Allows bathymetry as a control vector +C Note: keep this Option separated from generic control since this control +C involves many new dependencies that we would like to avoid in general. +#undef ALLOW_DEPTH_CONTROL +#ifdef ALLOW_DEPTH_CONTROL +C Only relevant within DEPTH_CONTROL code: +# define USE_SMOOTH_MIN +# undef ALLOW_HFACC_CONTROL +# undef ALLOW_HFACC3D_CONTROL +#endif /* ALLOW_DEPTH_CONTROL */ C >>> Generic Control. #define ALLOW_GENARR2D_CONTROL #define ALLOW_GENARR3D_CONTROL #define ALLOW_GENTIM2D_CONTROL +# undef ALLOW_UVEL0_CONTROL +# undef ALLOW_VVEL0_CONTROL +# undef CTRL_SET_OLD_MAXCVARS_30 +# undef CTRL_SET_OLD_MAXCVARS_40 + +C >>> Open boundaries +#ifdef ALLOW_OBCS +C Control of Open-Boundaries is meaningless without compiling pkg/obcs +C Note: Make sure that corresponding OBCS N/S/W/E Option is defined +# define ALLOW_OBCSN_CONTROL +# define ALLOW_OBCSS_CONTROL +# define ALLOW_OBCSW_CONTROL +# define ALLOW_OBCSE_CONTROL +# undef ALLOW_OBCS_CONTROL_MODES +#endif /* ALLOW_OBCS */ + +C o Set ALLOW_OBCS_CONTROL (Do not edit/modify): +#if (defined (ALLOW_OBCSN_CONTROL) || \ + defined (ALLOW_OBCSS_CONTROL) || \ + defined (ALLOW_OBCSW_CONTROL) || \ + defined (ALLOW_OBCSE_CONTROL)) +# define ALLOW_OBCS_CONTROL +#endif + +C o Impose bounds on controls +#undef ALLOW_ADCTRLBOUND C o Rotation of wind/stress controls adjustments C from Eastward/Northward to model grid directions @@ -102,19 +99,16 @@ C The CTRL_SKIP_FIRST_TWO_ATM_REC_ALL option extends this C to the other the time variable atmospheric controls. #undef CTRL_SKIP_FIRST_TWO_ATM_REC_ALL -C o use pkg/smooth correlation operator (incl. smoother) for 2D controls (Weaver, Courtier 01) -C This CPP option just sets the default for ctrlSmoothCorrel2D to .TRUE. -#undef ALLOW_SMOOTH_CORREL2D -C o use pkg/smooth correlation operator (incl. smoother) for 3D controls (Weaver, Courtier 01) -C This CPP option just sets the default for ctrlSmoothCorrel3D to .TRUE. -#undef ALLOW_SMOOTH_CORREL3D - -C o apply pkg/ctrl/ctrl_smooth.F to 2D controls (outside of ctrlSmoothCorrel2D) -#undef ALLOW_CTRL_SMOOTH -C o apply pkg/smooth/smooth_diff2d.F to 2D controls (outside of ctrlSmoothCorrel2D) +C Note: this flag turns on extra smoothing code in ctrl_get_gen.F which +C is inconsistent with the Weaver and Courtier, 2001 algorithm, and +C should probably not be used. The corresponding 3D flag applied only +C to deprecated code that is now removed. At some point we will remove +C this flag and associated code as well. +C o apply pkg/smooth/smooth_diff2d.F to 2D controls (outside of Smooth_Correl2D) #undef ALLOW_SMOOTH_CTRL2D -C o apply pkg/smooth/smooth_diff3d.F to 3D controls (outside of ctrlSmoothCorrel3D) -#undef ALLOW_SMOOTH_CTRL3D + +C o Print more debug info to STDOUT +#undef ALLOW_CTRL_DEBUG C ================================================================== #endif /* ndef ECCO_CPPOPTIONS_H */ diff --git a/verification/lab_sea/code_tap/ECCO_OPTIONS.h b/verification/lab_sea/code_tap/ECCO_OPTIONS.h index 8aa6a90c47..91f70593cd 100644 --- a/verification/lab_sea/code_tap/ECCO_OPTIONS.h +++ b/verification/lab_sea/code_tap/ECCO_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef ECCO_OPTIONS_H +#define ECCO_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: ECCO_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef ECCO_OPTIONS_H -#define ECCO_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_ECCO #ifdef ECCO_CPPOPTIONS_H @@ -26,80 +26,65 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C-- Package-specific Options & Macros go here -# define ALLOW_ATEMP_COST_CONTRIBUTION -# define ALLOW_AQH_COST_CONTRIBUTION -# define ALLOW_UWIND_COST_CONTRIBUTION -# define ALLOW_VWIND_COST_CONTRIBUTION -# define ALLOW_PRECIP_COST_CONTRIBUTION -# define ALLOW_SNOWPRECIP_COST_CONTRIBUTION -# define ALLOW_SWDOWN_COST_CONTRIBUTION -# define ALLOW_LWDOWN_COST_CONTRIBUTION -# undef ALLOW_EVAP_COST_CONTRIBUTION -# define ALLOW_APRESSURE_COST_CONTRIBUTION -# undef ALLOW_RUNOFF_COST_CONTRIBUTION - -# define ALLOW_THETA0_COST_CONTRIBUTION -# define ALLOW_SALT0_COST_CONTRIBUTION -# define ALLOW_THETA_COST_CONTRIBUTION -# define ALLOW_SALT_COST_CONTRIBUTION -# define ALLOW_SST_COST_CONTRIBUTION -# define ALLOW_SSS_COST_CONTRIBUTION - -CML# define ALLOW_SSH_MEAN_COST_CONTRIBUTION -CML# define ALLOW_SSH_TPANOM_COST_CONTRIBUTION -CML# define ALLOW_SSH_ERSANOM_COST_CONTRIBUTION -CML# undef ALLOW_SPH_PROJECTION -CML# if (defined (ALLOW_SSH_MEAN_COST_CONTRIBUTION) || \ -CML defined (ALLOW_SSH_TPANOM_COST_CONTRIBUTION) || \ -CML defined (ALLOW_SSH_ERSANOM_COST_CONTRIBUTION)) -CML# define ALLOW_SSH_COST_CONTRIBUTION -CML# endif - -C allow for generic cost function and integral terms +C o Allow for generic cost function and integral terms with pkg/ecco: #define ALLOW_GENCOST_CONTRIBUTION -C allow for 3 dimensional generic terms +C o Allow for 3 dimensional generic cost terms with pkg/ecco: #define ALLOW_GENCOST3D - -C include global mean steric sea level correction +C Note regarding GENCOST usage: +C > In data.ecco, this requires the specification of data file (name, +C frequency, etc.), bar file name for corresp. model average, standard +C error file name, etc. +C > In addition, adding such cost terms requires editing ECCO_SIZE.h to +C increase NGENCOST/NGENCOST3D, and editing cost_gencost_customize.F to +C implement the actual model average (i.e. the bar file content). +# undef ALLOW_GENCOST_1D +# undef ALLOW_GENCOST_SSTV4_OUTPUT + +C o Allow Open-Boundary cost contributions +#ifdef ALLOW_OBCS +C Open-Boundary cost is meaningless without compiling pkg/obcs +C Note: Make sure that coresponding OBCS N/S/W/E Option is defined +# define ALLOW_OBCSN_COST_CONTRIBUTION +# define ALLOW_OBCSS_COST_CONTRIBUTION +# define ALLOW_OBCSW_COST_CONTRIBUTION +# define ALLOW_OBCSE_COST_CONTRIBUTION +# undef OBCS_AGEOS_COST_CONTRIBUTION +# undef OBCS_VOLFLUX_COST_CONTRIBUTION +# undef BAROTROPIC_OBVEL_CONTROL +#endif /* ALLOW_OBCS */ + +C o Set ALLOW_OBCS_COST_CONTRIBUTION (Do not edit/modify): +#if (defined (ALLOW_OBCSN_COST_CONTRIBUTION) || \ + defined (ALLOW_OBCSS_COST_CONTRIBUTION) || \ + defined (ALLOW_OBCSW_COST_CONTRIBUTION) || \ + defined (ALLOW_OBCSE_COST_CONTRIBUTION)) +# define ALLOW_OBCS_COST_CONTRIBUTION +#endif + +C o Include global mean steric sea level correction #undef ALLOW_PSBAR_STERIC -C allow for near-shore and high-latitude altimetry +#ifdef ATMOSPHERIC_LOADING +C Apply inverse barometer correction (coded within ATMOSPHERIC_LOADING) +# undef ALLOW_IB_CORR +#endif +C o Allow for near-shore and high-latitude altimetry #undef ALLOW_SHALLOW_ALTIMETRY #undef ALLOW_HIGHLAT_ALTIMETRY -C allow for In-Situ Profiles cost function contribution +C o Allow for In-Situ Profiles cost function contribution #undef ALLOW_PROFILES_CONTRIBUTION -C cost function output format +C o Cost function output format #undef ALLOW_ECCO_OLD_FC_PRINT -C-- real options? - -C include dump of snap shots for checks -#undef ALLOW_SNAPSHOTS - -cph >>>>>> !!!!!! SPECIAL SEAICE FLAG FOR TESTING !!!!!! <<<<<< -c#define SEAICE_EXCLUDE_FOR_EXACT_AD_TESTING -cph >>>>>> !!!!!! SPECIAL SEAICE FLAG FOR TESTING !!!!!! <<<<<< - -C generate more text in STDOUT.0000 +C o Generate more text in STDOUT #undef ECCO_VERBOSE +#undef ALLOW_ECCO_DEBUG -C allow cost function term for sigmaR -#undef ALLOW_SIGMAR_COST_CONTRIBUTION - -C-- fake options (only used to be printed in S/R ECCO_SUMMARY): - -C allow ??? -#define ALLOW_ECCO_FORWARD_RUN -#undef ALLOW_ECCO_DIAGNOSTIC_RUN -C Just do a "dry" run ( useful for testing ). -#undef ALLOW_NO_DYNAMICS -C Use the Yearly-Monthly-Daily-Stepping call tree. -#undef ALLOW_YMDS_TREE -C Do not call stepping -#define ALLOW_STEPPING_CALL -C Projection onto Spherical Harmonics -#undef ALLOW_SPH_PROJECTION +C-- partially retired options (i.e., only used to set default switch): +# undef ALLOW_SSH_COST_CONTRIBUTION +#define ALLOW_SST_COST_CONTRIBUTION +# undef ALLOW_SEAICE_COST_CONTRIBUTION C ================================================================== #endif /* ndef ECCO_CPPOPTIONS_H */ diff --git a/verification/lab_sea/code_tap/SEAICE_OPTIONS.h b/verification/lab_sea/code_tap/SEAICE_OPTIONS.h index 8e1df30deb..d27c394be0 100644 --- a/verification/lab_sea/code_tap/SEAICE_OPTIONS.h +++ b/verification/lab_sea/code_tap/SEAICE_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef SEAICE_OPTIONS_H +#define SEAICE_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + C *==========================================================* C | SEAICE_OPTIONS.h C | o CPP options file for sea ice package. @@ -6,24 +11,12 @@ C | Use this file for selecting options within the sea ice C | package. C *==========================================================* -#ifndef SEAICE_OPTIONS_H -#define SEAICE_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_SEAICE -C Package-specific Options & Macros go here +C--- Package-specific Options & Macros go here C-- Write "text-plots" of certain fields in STDOUT for debugging. #undef SEAICE_DEBUG -C-- Allow sea-ice dynamic code. -C This option is provided to allow use of TAMC -C on the thermodynamics component of the code only. -C Sea-ice dynamics can also be turned off at runtime -C using variable SEAICEuseDYNAMICS. -#define SEAICE_ALLOW_DYNAMICS - C-- By default, the sea-ice package uses its own integrated bulk C formulae to compute fluxes (fu, fv, EmPmR, Qnet, and Qsw) over C open-ocean. When this flag is set, these variables are computed @@ -55,66 +48,116 @@ C seaice with a fraction (=SEAICE_saltFrac) of freezing seawater salinity. C- Note: SItracer also offers an alternative way to handle variable salinity. #define SEAICE_VARIABLE_SALINITY -C-- Tracers of ice and/or ice cover. -#undef ALLOW_SITRACER -#ifdef ALLOW_SITRACER -C-- To try avoid 'spontaneous generation' of tracer maxima by advdiff. -# define ALLOW_SITRACER_ADVCAP -#endif - -C-- Enable grease ice parameterization -C The grease ice parameterization delays formation of solid -C sea ice from frazil ice by a time constant and provides a -C dynamic calculation of the initial solid sea ice thickness -C HO as a function of winds, currents and available grease ice -C volume. Grease ice does not significantly reduce heat loss -C from the ocean in winter and area covered by grease is thus -C handled like open water. -C (For details see Smedsrud and Martin, 2014, Ann.Glac.) +C-- Enable grease ice parameterization (requires to define ALLOW_SITRACER): +C The grease ice parameterization delays formation of solid sea ice from +C frazil ice by a time constant and provides a dynamic calculation of the +C initial solid sea ice thickness HO as a function of winds, currents and +C available grease ice volume. Grease ice does not significantly reduce heat +C loss from the ocean in winter and area covered by grease is thus handled +C like open water (For details see Smedsrud and Martin, 2014, Ann.Glac.). C Set SItrName(1) = 'grease' in namelist SEAICE_PARM03 in data.seaice C then output SItr01 is SItrNameLong(1) = 'grease ice volume fraction', -C with SItrUnit(1) = '[0-1]', which needs to be multiplied by SIheff -C to yield grease ice volume. Additionally, the actual grease ice -C layer thickness (diagnostic SIgrsLT) can be saved. +C with SItrUnit(1) = '[0-1]', which needs to be multiplied by SIheff to +C yield grease ice volume. Additionally, the actual grease ice layer +C thickness (diagnostic SIgrsLT) can be saved. #undef SEAICE_GREASE -C-- grease ice uses SItracer: + +C-- Tracers of ice and/or ice cover. #ifdef SEAICE_GREASE +C SEAICE_GREASE code requires to define ALLOW_SITRACER # define ALLOW_SITRACER -# define ALLOW_SITRACER_ADVCAP +#else +# undef ALLOW_SITRACER #endif +#ifdef ALLOW_SITRACER +C- To try avoid 'spontaneous generation' of tracer maxima by advdiff. +# define ALLOW_SITRACER_ADVCAP + +C- Include code to diagnose sea ice tracer budgets in +C seaice_advdiff.F and seaice_tracer_phys.F. Diagnostics are +C computed the "call diagnostics_fill" statement is commented out. +# undef ALLOW_SITRACER_DEBUG_DIAG +#endif /* ALLOW_SITRACER */ + +C-- Allow sea-ice dynamic code. These options are provided so that, +C if turned off (#undef), to compile (and process with TAF) only the +C the thermodynamics component of the code. Note that, if needed, +C sea-ice dynamics can be turned off at runtime (SEAICEuseDYNAMICS=F). C-- Historically, the seaice model was discretized on a B-Grid. This -C discretization should still work but it is not longer actively tested -C and supported. The following flag should always be set in order to use -C the operational C-grid discretization. +C discretization should still work but it is not longer actively +C tested and supported. Define this flag to compile it. It cannot be +C defined together with SEAICE_CGRID +#undef SEAICE_BGRID_DYNAMICS + +C-- The following flag should always be set in order to use C the +C-- operational C-grid discretization. #define SEAICE_CGRID -C-- Only for the C-grid version it is possible to #ifdef SEAICE_CGRID +C-- Options for the C-grid version only: + C enable advection of sea ice momentum # undef SEAICE_ALLOW_MOM_ADVECTION + C enable JFNK code by defining the following flag # undef SEAICE_ALLOW_JFNK + C enable Krylov code by defining the following flag # undef SEAICE_ALLOW_KRYLOV + +C-- Use a different order when mapping 2D velocity arrays to 1D vector +C before passing it to FGMRES. +# undef SEAICE_JFNK_MAP_REORDER + +C to reproduce old verification results for JFNK +# undef SEAICE_PRECOND_EXTRA_EXCHANGE + C enable LSR to use global (multi-tile) tri-diagonal solver # undef SEAICE_GLOBAL_3DIAG_SOLVER + C enable EVP code by defining the following flag # define SEAICE_ALLOW_EVP # ifdef SEAICE_ALLOW_EVP -C-- When set use SEAICE_zetaMin and SEAICE_evpDampC to limit viscosities +C- When set use SEAICE_zetaMin and SEAICE_evpDampC to limit viscosities C from below and above in seaice_evp: not necessary, and not recommended # undef SEAICE_ALLOW_CLIPZETA + +C Include code to avoid underflows in EVP-code (copied from CICE). +C Many compilers can handle this more efficiently with the help of a flag. +# undef SEAICE_EVP_ELIMINATE_UNDERFLOWS + +C Include code to print residual of EVP iteration for debugging/diagnostics +# undef ALLOW_SEAICE_EVP_RESIDUAL # endif /* SEAICE_ALLOW_EVP */ + C smooth regularization (without max-function) of delta for C better differentiability # undef SEAICE_DELTA_SMOOTHREG + C regularize zeta to zmax with a smooth tanh-function instead C of a min(zeta,zmax). This improves convergence of iterative C solvers (Lemieux and Tremblay 2009, JGR). No effect on EVP # undef SEAICE_ZETA_SMOOTHREG + +C-- Different yield curves within the VP rheology framework C allow the truncated ellipse rheology (runtime flag SEAICEuseTEM) # undef SEAICE_ALLOW_TEM + +C allow the use of the Mohr Coulomb rheology (runtime flag SEAICEuseMCS) +C as defined in (Ip 1991) /!\ This is known to give unstable results, +C use with caution +# undef SEAICE_ALLOW_MCS + +C allow the use of Mohr Coulomb with elliptical plastic potential +C (runtime flag SEAICEuseMCE) +# undef SEAICE_ALLOW_MCE + +C allow the teardrop and parabolic lens rheology +C (runtime flag SEAICEuseTD and SEAICEusePL) +# undef SEAICE_ALLOW_TEARDROP + +C-- LSR solver settings C Use LSR vector code; not useful on non-vector machines, because it C slows down convergence considerably, but the extra iterations are C more than made up by the much faster code on vector machines. For @@ -122,62 +165,108 @@ C the only regularly test vector machine these flags a specified C in the build options file SUPER-UX_SX-8_sxf90_awi, so that we comment C them out here. # undef SEAICE_VECTORIZE_LSR + C Use zebra-method (alternate lines) for line-successive-relaxation C This modification improves the convergence of the vector code C dramatically, so that is may actually be useful in general, but C that needs to be tested. Can be used without vectorization options. # define SEAICE_LSR_ZEBRA -C This flag is also required for an actual adjoint of seaice_lsr; + +C Include code to print residual of nonlinear outer loop of LSR +# undef SEAICE_ALLOW_CHECK_LSR_CONVERGENCE + +C This flag is also required for an actual adjoint of seaice_lsr; C increases memory requirements a lot. # define SEAICE_LSR_ADJOINT_ITER + C Use parameterisation of grounding ice for a better representation C of fastice in shallow seas # undef SEAICE_ALLOW_BOTTOMDRAG -#else /* not SEAICE_CGRID, but old B-grid */ -C-- By default for B-grid dynamics solver wind stress under sea-ice is + +#endif /* SEAICE_CGRID */ + +#ifdef SEAICE_BGRID_DYNAMICS +C-- Options for the B-grid version only: + +C- By default for B-grid dynamics solver wind stress under sea-ice is C set to the same value as it would be if there was no sea-ice. C Define following CPP flag for B-grid ice-ocean stress coupling. # define SEAICE_BICE_STRESS -C-- By default for B-grid dynamics solver surface tilt is obtained +C- By default for B-grid dynamics solver surface tilt is obtained C indirectly via geostrophic velocities. Define following CPP C in order to use ETAN instead. # define EXPLICIT_SSH_SLOPE -C-- Defining this flag turns on FV-discretization of the B-grid LSOR solver. + +C- Defining this flag turns on FV-discretization of the B-grid LSOR solver. C It is smoother and includes all metric terms, similar to C-grid solvers. C It is here for completeness, but its usefulness is unclear. # undef SEAICE_LSRBNEW -#endif /* SEAICE_CGRID */ -C-- When set limit the Ice-Loading to mass of 1/5 of Surface ocean grid-box +#endif /* SEAICE_BGRID_DYNAMICS */ + +C-- Some regularisations +C- When set limit the Ice-Loading to mass of 1/5 of Surface ocean grid-box #undef SEAICE_CAP_ICELOAD -C-- When set use SEAICE_clipVelocties = .true., to clip U/VICE at 40cm/s, + +C- When set use SEAICE_clipVelocties = .true., to clip U/VICE at 40cm/s, C not recommended #undef SEAICE_ALLOW_CLIPVELS -C-- When set cap the sublimation latent heat flux in solve4temp according + +C- When set cap the sublimation latent heat flux in solve4temp according C to the available amount of ice+snow. Otherwise this term is treated C like all of the others -- residuals heat and fw stocks are passed to C the ocean at the end of seaice_growth in a conservative manner. C SEAICE_CAP_SUBLIM is not needed as of now, but kept just in case. #undef SEAICE_CAP_SUBLIM +C-- AD flags +C- TAF related flag, currently only used in seaice_ad_check_lev[1-4]_dir.h; +C it is unclear if this is ever needed. +#undef AUTODIFF_SOMETIMES_NEEDED + +C- Reset fields to zero to stabilise AD code of dynamics solver +C (resulting in wrong gradients) +#undef SEAICE_DYN_STABLE_ADJOINT + +C- Another flag to simplify dependencies for TAF-generated AD-code +C the thermodynamic part, mostly by resetting variables to zero +#undef SEAICE_MODIFY_GROWTH_ADJ + +C- Special seaice flag for AD testing +#undef SEAICE_EXCLUDE_FOR_EXACT_AD_TESTING + +C-- Use the adjointable sea-ice thermodynamic model +C in seaice_growth_adx.F instead of seaice_growth.F +C This options excludes more complex physics such +C as sublimation, ITD, and frazil. +#undef SEAICE_USE_GROWTH_ADX + +C-- These flags are not strictly AD-related but may help obtaining +C simpler AD-code: +C- Do not compile code that resets AREA (or AREAITD) to a mininum value +C of SEAICE_area_floor (=SIeps with default of 1e-5) if there is +C some finite sea ice thickness +#undef DISABLE_AREA_FLOOR + +C- Do not compile growth/thermodynamics code (avoiding this code can +C also be done by setting runtime parameter usePWthermodynamics=F) +#undef DISABLE_SEAICE_GROWTH + +C- Do not compile/use seaice-related obcs code when using obcs. +#undef DISABLE_SEAICE_OBCS + C-- Enable free drift code #define SEAICE_ALLOW_FREEDRIFT C-- pkg/seaice cost functions compile flags -c >>> Sea-ice volume (requires pkg/cost) +C- Sea-ice volume (requires pkg/cost) #undef ALLOW_COST_ICE -c >>> Sea-ice misfit to obs (requires pkg/cost and ecco) -c#define ALLOW_SEAICE_COST_SMR_AREA +#ifdef ALLOW_COST_ICE +C- Enable template for sea-ice volume export in seaice_cost_export.F +C (requires pkg/cost & ALLOW_COST_ICE defined) +# undef ALLOW_SEAICE_COST_EXPORT +#endif /* ALLOW_COST_ICE */ -C-- ssg - This flag turns on the more "correct" seaice themodynamics -C by Arash Bigdeli. -C-- Use the adjointable sea-ice thermodynamic model -C in seaice_growth_adx.F instead of seaice_growth.F -#undef SEAICE_USE_GROWTH_ADX #endif /* ALLOW_SEAICE */ #endif /* SEAICE_OPTIONS_H */ - -CEH3 ;;; Local Variables: *** -CEH3 ;;; mode:fortran *** -CEH3 ;;; End: *** diff --git a/verification/obcs_ctrl/code_ad/AUTODIFF_OPTIONS.h b/verification/obcs_ctrl/code_ad/AUTODIFF_OPTIONS.h index 2604c81b9a..578310ceb3 100644 --- a/verification/obcs_ctrl/code_ad/AUTODIFF_OPTIONS.h +++ b/verification/obcs_ctrl/code_ad/AUTODIFF_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef AUTODIFF_OPTIONS_H +#define AUTODIFF_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: AUTODIFF_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef AUTODIFF_OPTIONS_H -#define AUTODIFF_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_AUTODIFF #ifdef ECCO_CPPOPTIONS_H @@ -26,10 +26,11 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -C o Include/exclude code in order to be able to automatically -C differentiate the MITgcmUV by using the Tangent Linear and -C Adjoint Model Compiler (TAMC). +C o Include/exclude code in order to automatically differentiate MITgcm code +C using TAF (Transformation of Algorithms in Fortran, http://www.FastOpt.de) +C or using TAMC (Tangent Linear & Adjoint Model Compiler, needs both defined): #define ALLOW_AUTODIFF_TAMC +#undef AUTODIFF_TAMC_COMPATIBILITY C >>> Checkpointing as handled by TAMC #define ALLOW_TAMC_CHECKPOINTING @@ -40,19 +41,19 @@ C >>> and DYNVARS_DIAG adjoint state #undef ALLOW_AUTODIFF_MONITOR_DIAG C >>> DO 2-level checkpointing instead of 3-level -c#undef AUTODIFF_2_LEVEL_CHECKPOINT +#undef AUTODIFF_2_LEVEL_CHECKPOINT C extend to 4-level checkpointing -c#undef AUTODIFF_4_LEVEL_CHECKPOINT +#undef AUTODIFF_4_LEVEL_CHECKPOINT C o use divided adjoint to split adjoint computations #undef ALLOW_DIVIDED_ADJOINT -#undef ALLOW_PACKUNPACK_METHOD2 - C o This flag is incredibly useful as it reduces the number of C tape-files on the disc. Maybe it should even be the default. #define ALLOW_AUTODIFF_WHTAPEIO +C and related to above: +#undef ALLOW_INIT_WHTAPEIO C o use standard MDSFINDUINTS instead of local pkg/autodiff version for C WHTAPEIO code I/O. @@ -70,6 +71,10 @@ C Might still be used for OBCS since WHTAPEIO does not support OBCS fields. C o allow using viscFacInAd to recompute viscosities in AD #define AUTODIFF_ALLOW_VISCFACADJ +C o To remove part of MOM_CALC_VISC (better name would be: MOM_DISABLE_*) +#undef AUTODIFF_DISABLE_LEITH +#undef AUTODIFF_DISABLE_REYNOLDS_SCALE + C o for output of AD-variables (ALLOW_AUTODIFF_MONITOR), specific code (e.g., C in addummy_in_stepping.F) relies on adexch_uv_xy_rs and adexch_xy_rs S/R C which might not always be generated by TAF (e.g., when controls do not diff --git a/verification/obcs_ctrl/code_ad/CTRL_OPTIONS.h b/verification/obcs_ctrl/code_ad/CTRL_OPTIONS.h index e55f50e63a..b33dd0eed1 100644 --- a/verification/obcs_ctrl/code_ad/CTRL_OPTIONS.h +++ b/verification/obcs_ctrl/code_ad/CTRL_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef CTRL_OPTIONS_H +#define CTRL_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: CTRL_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef CTRL_OPTIONS_H -#define CTRL_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_CTRL #ifdef ECCO_CPPOPTIONS_H @@ -26,71 +26,68 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -C o Re-activate deprecated codes in pkg/ecco & pkg/ctrl (but not recommended) -C and since pkg/ctrl can be used without pkg/ecco, better to have it here -C o In this experiment, this option and the corresponding necessary flags -C to reproduce this experiment are commented by CTRL -CTRL#define ECCO_CTRL_DEPRECATED - -#undef EXCLUDE_CTRL_PACK +C o I/O and pack settings +#undef CTRL_SET_PREC_32 +C This option is only relevant (for pack/unpack) with OBCS_CONTROL: #define ALLOW_NONDIMENSIONAL_CONTROL_IO +#undef EXCLUDE_CTRL_PACK +#undef ALLOW_PACKUNPACK_METHOD2 +#undef CTRL_DO_PACK_UNPACK_ONLY +#undef CTRL_PACK_PRECISE +#undef CTRL_UNPACK_PRECISE +#undef CTRL_DELZNORM +#undef ALLOW_CTRL_WETV + +C >>> Other Control. +C Allows for GMREDI controls +#undef ALLOW_KAPGM_CONTROL +#undef ALLOW_KAPREDI_CONTROL +C Allows for Vertical Diffusivity controls +#undef ALLOW_DIFFKR_CONTROL +#undef ALLOW_BOTTOMDRAG_CONTROL +#undef ALLOW_DIC_CONTROL -CTRLC >>> Initial values. -CTRL#define ALLOW_THETA0_CONTROL -CTRL#undef ALLOW_SALT0_CONTROL -CTRL#undef ALLOW_UVEL0_CONTROL -CTRL#undef ALLOW_VVEL0_CONTROL -CTRL#undef ALLOW_TR10_CONTROL -CTRL#undef ALLOW_TAUU0_CONTROL -CTRL#undef ALLOW_TAUV0_CONTROL -CTRL#undef ALLOW_SFLUX0_CONTROL -CTRL#undef ALLOW_HFLUX0_CONTROL -CTRL#undef ALLOW_SSS0_CONTROL -CTRL#undef ALLOW_SST0_CONTROL -CTRL -CTRLC >>> Surface fluxes. -CTRL#undef ALLOW_HFLUX_CONTROL -CTRL#undef ALLOW_SFLUX_CONTROL -CTRL#undef ALLOW_USTRESS_CONTROL -CTRL#undef ALLOW_VSTRESS_CONTROL -CTRL#undef ALLOW_SWFLUX_CONTROL -CTRL#undef ALLOW_LWFLUX_CONTROL -CTRL -CTRLC >>> Atmospheric state. -CTRL#undef ALLOW_ATEMP_CONTROL -CTRL#undef ALLOW_AQH_CONTROL -CTRL#undef ALLOW_UWIND_CONTROL -CTRL#undef ALLOW_VWIND_CONTROL -CTRL#undef ALLOW_PRECIP_CONTROL -CTRL -CTRLC >>> Other Control. -CTRL#undef ALLOW_DIFFKR_CONTROL -CTRL#undef ALLOW_KAPGM_CONTROL -CTRL#undef ALLOW_KAPREDI_CONTROL -CTRL#undef ALLOW_BOTTOMDRAG_CONTROL -CTRL -CTRLC >>> Backward compatibility option (before checkpoint 65p) -CTRL#undef ALLOW_KAPGM_CONTROL_OLD -CTRL#undef ALLOW_KAPREDI_CONTROL_OLD +C Allows bathymetry as a control vector +C Note: keep this Option separated from generic control since this control +C involves many new dependencies that we would like to avoid in general. +#undef ALLOW_DEPTH_CONTROL +#ifdef ALLOW_DEPTH_CONTROL +C Only relevant within DEPTH_CONTROL code: +# define USE_SMOOTH_MIN +# undef ALLOW_HFACC_CONTROL +# undef ALLOW_HFACC3D_CONTROL +#endif /* ALLOW_DEPTH_CONTROL */ C >>> Generic Control. #undef ALLOW_GENARR2D_CONTROL #define ALLOW_GENARR3D_CONTROL #undef ALLOW_GENTIM2D_CONTROL +# undef ALLOW_UVEL0_CONTROL +# undef ALLOW_VVEL0_CONTROL +# undef CTRL_SET_OLD_MAXCVARS_30 +# undef CTRL_SET_OLD_MAXCVARS_40 C >>> Open boundaries -c >>> Make sure that ALLOW_OBCS is defined -#define ALLOW_OBCSN_CONTROL -#define ALLOW_OBCSS_CONTROL -#define ALLOW_OBCSW_CONTROL -#define ALLOW_OBCSE_CONTROL +#ifdef ALLOW_OBCS +C Control of Open-Boundaries is meaningless without compiling pkg/obcs +C Note: Make sure that corresponding OBCS N/S/W/E Option is defined +# define ALLOW_OBCSN_CONTROL +# define ALLOW_OBCSS_CONTROL +# define ALLOW_OBCSW_CONTROL +# define ALLOW_OBCSE_CONTROL +# define ALLOW_OBCS_CONTROL_MODES +#endif /* ALLOW_OBCS */ + +C o Set ALLOW_OBCS_CONTROL (Do not edit/modify): #if (defined (ALLOW_OBCSN_CONTROL) || \ defined (ALLOW_OBCSS_CONTROL) || \ defined (ALLOW_OBCSW_CONTROL) || \ defined (ALLOW_OBCSE_CONTROL)) # define ALLOW_OBCS_CONTROL #endif -#define ALLOW_OBCS_CONTROL_MODES + +C o Impose bounds on controls +#undef ALLOW_ADCTRLBOUND C o Rotation of wind/stress controls adjustments C from Eastward/Northward to model grid directions @@ -102,19 +99,16 @@ C The CTRL_SKIP_FIRST_TWO_ATM_REC_ALL option extends this C to the other the time variable atmospheric controls. #undef CTRL_SKIP_FIRST_TWO_ATM_REC_ALL -C o use pkg/smooth correlation operator (incl. smoother) for 2D controls (Weaver, Courtier 01) -C This CPP option just sets the default for ctrlSmoothCorrel2D to .TRUE. -#undef ALLOW_SMOOTH_CORREL2D -C o use pkg/smooth correlation operator (incl. smoother) for 3D controls (Weaver, Courtier 01) -C This CPP option just sets the default for ctrlSmoothCorrel3D to .TRUE. -#undef ALLOW_SMOOTH_CORREL3D - -C o apply pkg/ctrl/ctrl_smooth.F to 2D controls (outside of ctrlSmoothCorrel2D) -#undef ALLOW_CTRL_SMOOTH -C o apply pkg/smooth/smooth_diff2d.F to 2D controls (outside of ctrlSmoothCorrel2D) +C Note: this flag turns on extra smoothing code in ctrl_get_gen.F which +C is inconsistent with the Weaver and Courtier, 2001 algorithm, and +C should probably not be used. The corresponding 3D flag applied only +C to deprecated code that is now removed. At some point we will remove +C this flag and associated code as well. +C o apply pkg/smooth/smooth_diff2d.F to 2D controls (outside of Smooth_Correl2D) #undef ALLOW_SMOOTH_CTRL2D -C o apply pkg/smooth/smooth_diff3d.F to 3D controls (outside of ctrlSmoothCorrel3D) -#undef ALLOW_SMOOTH_CTRL3D + +C o Print more debug info to STDOUT +#undef ALLOW_CTRL_DEBUG C ================================================================== #endif /* ndef ECCO_CPPOPTIONS_H */ diff --git a/verification/obcs_ctrl/code_ad/ECCO_OPTIONS.h b/verification/obcs_ctrl/code_ad/ECCO_OPTIONS.h deleted file mode 100644 index f2e5205906..0000000000 --- a/verification/obcs_ctrl/code_ad/ECCO_OPTIONS.h +++ /dev/null @@ -1,95 +0,0 @@ -CBOP -C !ROUTINE: ECCO_OPTIONS.h -C !INTERFACE: -C #include "ECCO_OPTIONS.h" - -C !DESCRIPTION: -C *==================================================================* -C | CPP options file for ECCO (ecco) package: -C | Control which optional features to compile in this package code. -C *==================================================================* -CEOP - -#ifndef ECCO_OPTIONS_H -#define ECCO_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - -#ifdef ALLOW_ECCO -#ifdef ECCO_CPPOPTIONS_H - -C-- When multi-package option-file ECCO_CPPOPTIONS.h is used (directly included -C in CPP_OPTIONS.h), this option file is left empty since all options that -C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h - -#else /* ndef ECCO_CPPOPTIONS_H */ - -C-- Package-specific Options & Macros go here - -c >>> Open boundaries -c >>> Make sure that ALLOW_OBCS is defined -#define ALLOW_OBCSN_COST_CONTRIBUTION -#define ALLOW_OBCSS_COST_CONTRIBUTION -#define ALLOW_OBCSW_COST_CONTRIBUTION -#define ALLOW_OBCSE_COST_CONTRIBUTION -#if (defined (ALLOW_OBCSN_COST_CONTRIBUTION) || \ - defined (ALLOW_OBCSS_COST_CONTRIBUTION) || \ - defined (ALLOW_OBCSW_COST_CONTRIBUTION) || \ - defined (ALLOW_OBCSE_COST_CONTRIBUTION)) -# define ALLOW_OBCS_COST_CONTRIBUTION -#endif - -C re-activate deprecated codes (just in case ... but not recommended) -C#define ALLOW_THETA0_COST_CONTRIBUTION -C#define ALLOW_THETA_COST_CONTRIBUTION - -C allow for generic cost function and integral terms -#define ALLOW_GENCOST_CONTRIBUTION -C allow for 3 dimensional generic terms -#define ALLOW_GENCOST3D - -C include global mean steric sea level correction -#undef ALLOW_PSBAR_STERIC -C allow for near-shore and high-latitude altimetry -#undef ALLOW_SHALLOW_ALTIMETRY -#undef ALLOW_HIGHLAT_ALTIMETRY - -C allow for In-Situ Profiles cost function contribution -#undef ALLOW_PROFILES_CONTRIBUTION - -C cost function output format -#undef ALLOW_ECCO_OLD_FC_PRINT - -C-- real options? - -C include dump of snap shots for checks -#undef ALLOW_SNAPSHOTS - -cph >>>>>> !!!!!! SPECIAL SEAICE FLAG FOR TESTING !!!!!! <<<<<< -c#define SEAICE_EXCLUDE_FOR_EXACT_AD_TESTING -cph >>>>>> !!!!!! SPECIAL SEAICE FLAG FOR TESTING !!!!!! <<<<<< - -C generate more text in STDOUT.0000 -#undef ECCO_VERBOSE - -C allow cost function term for sigmaR -#undef ALLOW_SIGMAR_COST_CONTRIBUTION - -C-- fake options (only used to be printed in S/R ECCO_SUMMARY): - -C allow ??? -#define ALLOW_ECCO_FORWARD_RUN -#undef ALLOW_ECCO_DIAGNOSTIC_RUN -C Just do a "dry" run ( useful for testing ). -#undef ALLOW_NO_DYNAMICS -C Use the Yearly-Monthly-Daily-Stepping call tree. -#undef ALLOW_YMDS_TREE -C Do not call stepping -#define ALLOW_STEPPING_CALL -C Projection onto Spherical Harmonics -#undef ALLOW_SPH_PROJECTION - -C ================================================================== -#endif /* ndef ECCO_CPPOPTIONS_H */ -#endif /* ALLOW_ECCO */ -#endif /* ECCO_OPTIONS_H */ diff --git a/verification/offline_exf_seaice/code/SEAICE_OPTIONS.h b/verification/offline_exf_seaice/code/SEAICE_OPTIONS.h index 852c4ab3cc..8967c1329a 100644 --- a/verification/offline_exf_seaice/code/SEAICE_OPTIONS.h +++ b/verification/offline_exf_seaice/code/SEAICE_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef SEAICE_OPTIONS_H +#define SEAICE_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + C *==========================================================* C | SEAICE_OPTIONS.h C | o CPP options file for sea ice package. @@ -6,24 +11,12 @@ C | Use this file for selecting options within the sea ice C | package. C *==========================================================* -#ifndef SEAICE_OPTIONS_H -#define SEAICE_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_SEAICE -C Package-specific Options & Macros go here +C--- Package-specific Options & Macros go here C-- Write "text-plots" of certain fields in STDOUT for debugging. #undef SEAICE_DEBUG -C-- Allow sea-ice dynamic code. -C This option is provided to allow use of TAMC -C on the thermodynamics component of the code only. -C Sea-ice dynamics can also be turned off at runtime -C using variable SEAICEuseDYNAMICS. -#define SEAICE_ALLOW_DYNAMICS - C-- By default, the sea-ice package uses its own integrated bulk C formulae to compute fluxes (fu, fv, EmPmR, Qnet, and Qsw) over C open-ocean. When this flag is set, these variables are computed @@ -55,79 +48,122 @@ C seaice with a fraction (=SEAICE_saltFrac) of freezing seawater salinity. C- Note: SItracer also offers an alternative way to handle variable salinity. #undef SEAICE_VARIABLE_SALINITY -C-- Tracers of ice and/or ice cover. -#undef ALLOW_SITRACER -#ifdef ALLOW_SITRACER -C-- To try avoid 'spontaneous generation' of tracer maxima by advdiff. -# define ALLOW_SITRACER_ADVCAP -#endif - -C-- Enable grease ice parameterization -C The grease ice parameterization delays formation of solid -C sea ice from frazil ice by a time constant and provides a -C dynamic calculation of the initial solid sea ice thickness -C HO as a function of winds, currents and available grease ice -C volume. Grease ice does not significantly reduce heat loss -C from the ocean in winter and area covered by grease is thus -C handled like open water. -C (For details see Smedsrud and Martin, 2014, Ann.Glac.) +C-- Enable grease ice parameterization (requires to define ALLOW_SITRACER): +C The grease ice parameterization delays formation of solid sea ice from +C frazil ice by a time constant and provides a dynamic calculation of the +C initial solid sea ice thickness HO as a function of winds, currents and +C available grease ice volume. Grease ice does not significantly reduce heat +C loss from the ocean in winter and area covered by grease is thus handled +C like open water (For details see Smedsrud and Martin, 2014, Ann.Glac.). C Set SItrName(1) = 'grease' in namelist SEAICE_PARM03 in data.seaice C then output SItr01 is SItrNameLong(1) = 'grease ice volume fraction', -C with SItrUnit(1) = '[0-1]', which needs to be multiplied by SIheff -C to yield grease ice volume. Additionally, the actual grease ice -C layer thickness (diagnostic SIgrsLT) can be saved. +C with SItrUnit(1) = '[0-1]', which needs to be multiplied by SIheff to +C yield grease ice volume. Additionally, the actual grease ice layer +C thickness (diagnostic SIgrsLT) can be saved. #undef SEAICE_GREASE -C-- grease ice uses SItracer: + +C-- Tracers of ice and/or ice cover. #ifdef SEAICE_GREASE +C SEAICE_GREASE code requires to define ALLOW_SITRACER # define ALLOW_SITRACER -# define ALLOW_SITRACER_ADVCAP +#else +# undef ALLOW_SITRACER #endif +#ifdef ALLOW_SITRACER +C- To try avoid 'spontaneous generation' of tracer maxima by advdiff. +# define ALLOW_SITRACER_ADVCAP + +C- Include code to diagnose sea ice tracer budgets in +C seaice_advdiff.F and seaice_tracer_phys.F. Diagnostics are +C computed the "call diagnostics_fill" statement is commented out. +# undef ALLOW_SITRACER_DEBUG_DIAG +#endif /* ALLOW_SITRACER */ + +C-- Allow sea-ice dynamic code. These options are provided so that, +C if turned off (#undef), to compile (and process with TAF) only the +C the thermodynamics component of the code. Note that, if needed, +C sea-ice dynamics can be turned off at runtime (SEAICEuseDYNAMICS=F). C-- Historically, the seaice model was discretized on a B-Grid. This -C discretization should still work but it is not longer actively tested -C and supported. The following flag should always be set in order to use -C the operational C-grid discretization. +C discretization should still work but it is not longer actively +C tested and supported. Define this flag to compile it. It cannot be +C defined together with SEAICE_CGRID +#undef SEAICE_BGRID_DYNAMICS + +C-- The following flag should always be set in order to use C the +C-- operational C-grid discretization. #define SEAICE_CGRID -C-- Only for the C-grid version it is possible to #ifdef SEAICE_CGRID +C-- Options for the C-grid version only: + C enable advection of sea ice momentum # undef SEAICE_ALLOW_MOM_ADVECTION + C enable JFNK code by defining the following flag # define SEAICE_ALLOW_JFNK + C enable Krylov code by defining the following flag # define SEAICE_ALLOW_KRYLOV -C enable this flag to reproduce old verification results for JFNK + +C-- Use a different order when mapping 2D velocity arrays to 1D vector +C before passing it to FGMRES. +# undef SEAICE_JFNK_MAP_REORDER + +C to reproduce old verification results for JFNK # define SEAICE_PRECOND_EXTRA_EXCHANGE + C enable LSR to use global (multi-tile) tri-diagonal solver # define SEAICE_GLOBAL_3DIAG_SOLVER + C enable EVP code by defining the following flag # define SEAICE_ALLOW_EVP # ifdef SEAICE_ALLOW_EVP -C-- When set use SEAICE_zetaMin and SEAICE_evpDampC to limit viscosities +C- When set use SEAICE_zetaMin and SEAICE_evpDampC to limit viscosities C from below and above in seaice_evp: not necessary, and not recommended # undef SEAICE_ALLOW_CLIPZETA + +C Include code to avoid underflows in EVP-code (copied from CICE). +C Many compilers can handle this more efficiently with the help of a flag. +# undef SEAICE_EVP_ELIMINATE_UNDERFLOWS + +C Include code to print residual of EVP iteration for debugging/diagnostics +# undef ALLOW_SEAICE_EVP_RESIDUAL # endif /* SEAICE_ALLOW_EVP */ + C smooth regularization (without max-function) of delta for C better differentiability # undef SEAICE_DELTA_SMOOTHREG + C regularize zeta to zmax with a smooth tanh-function instead C of a min(zeta,zmax). This improves convergence of iterative C solvers (Lemieux and Tremblay 2009, JGR). No effect on EVP # define SEAICE_ZETA_SMOOTHREG + +C-- Different yield curves within the VP rheology framework C allow the truncated ellipse rheology (runtime flag SEAICEuseTEM) -C or the modified coulombic rheology # define SEAICE_ALLOW_TEM -C allow the use of the Mohr Coulomb rheology (runtime flag -C SEAICEuseFULLMC) as defined in (Ip 1991) /!\ This is known -C to give unstable results, use with caution -# define SEAICE_ALLOW_FULLMC + +C allow the use of the Mohr Coulomb rheology (runtime flag SEAICEuseMCS) +C as defined in (Ip 1991) /!\ This is known to give unstable results, +C use with caution +# define SEAICE_ALLOW_MCS + +CMLC or the modified coulombic rheology +CMLC allow the use of the Mohr Coulomb rheology (runtime flag +CMLC SEAICEuseFULLMC) as defined in (Ip 1991) /!\ This is known +CMLC to give unstable results, use with caution +CML# define SEAICE_ALLOW_FULLMC + C allow the use of Mohr Coulomb with elliptical plastic potential C (runtime flag SEAICEuseMCE) # define SEAICE_ALLOW_MCE -C allow the teardrop and parabolic lens rheology (runtime flag -C SEAICEuseTD and SEAICEusePL) + +C allow the teardrop and parabolic lens rheology +C (runtime flag SEAICEuseTD and SEAICEusePL) # define SEAICE_ALLOW_TEARDROP + +C-- LSR solver settings C Use LSR vector code; not useful on non-vector machines, because it C slows down convergence considerably, but the extra iterations are C more than made up by the much faster code on vector machines. For @@ -135,58 +171,108 @@ C the only regularly test vector machine these flags a specified C in the build options file SUPER-UX_SX-8_sxf90_awi, so that we comment C them out here. # undef SEAICE_VECTORIZE_LSR + C Use zebra-method (alternate lines) for line-successive-relaxation C This modification improves the convergence of the vector code C dramatically, so that is may actually be useful in general, but C that needs to be tested. Can be used without vectorization options. # undef SEAICE_LSR_ZEBRA + +C Include code to print residual of nonlinear outer loop of LSR +# undef SEAICE_ALLOW_CHECK_LSR_CONVERGENCE + +C This flag is also required for an actual adjoint of seaice_lsr; +C increases memory requirements a lot. +# undef SEAICE_LSR_ADJOINT_ITER + C Use parameterisation of grounding ice for a better representation C of fastice in shallow seas # undef SEAICE_ALLOW_BOTTOMDRAG -#else /* not SEAICE_CGRID, but old B-grid */ -C-- By default for B-grid dynamics solver wind stress under sea-ice is + +#endif /* SEAICE_CGRID */ + +#ifdef SEAICE_BGRID_DYNAMICS +C-- Options for the B-grid version only: + +C- By default for B-grid dynamics solver wind stress under sea-ice is C set to the same value as it would be if there was no sea-ice. C Define following CPP flag for B-grid ice-ocean stress coupling. # define SEAICE_BICE_STRESS -C-- By default for B-grid dynamics solver surface tilt is obtained +C- By default for B-grid dynamics solver surface tilt is obtained C indirectly via geostrophic velocities. Define following CPP C in order to use ETAN instead. # define EXPLICIT_SSH_SLOPE -C-- Defining this flag turns on FV-discretization of the B-grid LSOR solver. + +C- Defining this flag turns on FV-discretization of the B-grid LSOR solver. C It is smoother and includes all metric terms, similar to C-grid solvers. C It is here for completeness, but its usefulness is unclear. # undef SEAICE_LSRBNEW -#endif /* SEAICE_CGRID */ -C-- When set limit the Ice-Loading to mass of 1/5 of Surface ocean grid-box +#endif /* SEAICE_BGRID_DYNAMICS */ + +C-- Some regularisations +C- When set limit the Ice-Loading to mass of 1/5 of Surface ocean grid-box #undef SEAICE_CAP_ICELOAD -C-- When set use SEAICE_clipVelocties = .true., to clip U/VICE at 40cm/s, + +C- When set use SEAICE_clipVelocties = .true., to clip U/VICE at 40cm/s, C not recommended #undef SEAICE_ALLOW_CLIPVELS -C-- When set cap the sublimation latent heat flux in solve4temp according + +C- When set cap the sublimation latent heat flux in solve4temp according C to the available amount of ice+snow. Otherwise this term is treated C like all of the others -- residuals heat and fw stocks are passed to C the ocean at the end of seaice_growth in a conservative manner. C SEAICE_CAP_SUBLIM is not needed as of now, but kept just in case. #undef SEAICE_CAP_SUBLIM +C-- AD flags +C- TAF related flag, currently only used in seaice_ad_check_lev[1-4]_dir.h; +C it is unclear if this is ever needed. +#undef AUTODIFF_SOMETIMES_NEEDED + +C- Reset fields to zero to stabilise AD code of dynamics solver +C (resulting in wrong gradients) +#undef SEAICE_DYN_STABLE_ADJOINT + +C- Another flag to simplify dependencies for TAF-generated AD-code +C the thermodynamic part, mostly by resetting variables to zero +#undef SEAICE_MODIFY_GROWTH_ADJ + +C- Special seaice flag for AD testing +#undef SEAICE_EXCLUDE_FOR_EXACT_AD_TESTING + C-- Use the adjointable sea-ice thermodynamic model C in seaice_growth_adx.F instead of seaice_growth.F +C This options excludes more complex physics such +C as sublimation, ITD, and frazil. #undef SEAICE_USE_GROWTH_ADX +C-- These flags are not strictly AD-related but may help obtaining +C simpler AD-code: +C- Do not compile code that resets AREA (or AREAITD) to a mininum value +C of SEAICE_area_floor (=SIeps with default of 1e-5) if there is +C some finite sea ice thickness +#undef DISABLE_AREA_FLOOR + +C- Do not compile growth/thermodynamics code (avoiding this code can +C also be done by setting runtime parameter usePWthermodynamics=F) +#undef DISABLE_SEAICE_GROWTH + +C- Do not compile/use seaice-related obcs code when using obcs. +#undef DISABLE_SEAICE_OBCS + C-- Enable free drift code #define SEAICE_ALLOW_FREEDRIFT C-- pkg/seaice cost functions compile flags -c >>> Sea-ice volume (requires pkg/cost) +C- Sea-ice volume (requires pkg/cost) #undef ALLOW_COST_ICE -c >>> Sea-ice misfit to obs (requires pkg/cost and ecco) -#undef ALLOW_SEAICE_COST_SMR_AREA +#ifdef ALLOW_COST_ICE +C- Enable template for sea-ice volume export in seaice_cost_export.F +C (requires pkg/cost & ALLOW_COST_ICE defined) +# undef ALLOW_SEAICE_COST_EXPORT +#endif /* ALLOW_COST_ICE */ #endif /* ALLOW_SEAICE */ #endif /* SEAICE_OPTIONS_H */ - -CEH3 ;;; Local Variables: *** -CEH3 ;;; mode:fortran *** -CEH3 ;;; End: *** diff --git a/verification/offline_exf_seaice/code_ad/COST_OPTIONS.h b/verification/offline_exf_seaice/code_ad/COST_OPTIONS.h index 4af5282456..9549a04d07 100644 --- a/verification/offline_exf_seaice/code_ad/COST_OPTIONS.h +++ b/verification/offline_exf_seaice/code_ad/COST_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef COST_OPTIONS_H +#define COST_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: COST_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef COST_OPTIONS_H -#define COST_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_COST #ifdef ECCO_CPPOPTIONS_H @@ -26,30 +26,24 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -#define ALLOW_THSICE_COST_TEST +#undef ALLOW_COST_STATE_FINAL +#undef ALLOW_COST_VECTOR -C >>> ALLOW_GENCOST_CONTRIBUTION: interactive way to add basic 2D cost -C function terms. -C > In data.ecco, this requires the specification of data file (name, -C frequency, etc.), bar file name for corresp. model average, standard -C error file name, etc. -C > In addition, adding such cost terms requires editing ecco_cost.h to -C increase NGENCOST, and editing cost_gencost_customize.F to implement -C the actual model average (i.e. the bar file content). -#undef ALLOW_GENCOST_CONTRIBUTION -C >>> free form version of GENCOST: allows one to use otherwise defined -C elements (e.g. psbar and and topex data) while taking advantage of the -C cost function/namelist slots that can be made available using -C ALLOW_GENCOST_CONTRIBUTION. To this end ALLOW_GENCOST_CONTRIBUTION -C simply switches off tests that check whether all of the gencost -C elements (e.g. gencost_barfile and gencost_datafile) are specified -C in data.ecco. -C > While this option increases flexibility within the gencost framework, -C it implies more room for error, so it should be used cautiously, and -C with good knowledge of the rest of pkg/ecco. -C > It requires providing a specific cost function routine, and editing -C cost_gencost_all.F accordingly. -#undef ALLOW_GENCOST_FREEFORM +C >>> Cost function contributions +#undef ALLOW_COST_ATLANTIC_HEAT +#undef ALLOW_COST_ATLANTIC_HEAT_DOMASS + +#undef ALLOW_COST_TEST +#undef ALLOW_COST_TSQUARED +#undef ALLOW_COST_DEPTH +#undef ALLOW_COST_TRACER + +C List these options here: +#undef ALLOW_COST_TEMP +#undef ALLOW_COST_HFLUXM +#undef ALLOW_DIC_COST +#define ALLOW_THSICE_COST_TEST +#undef ALLOW_COST_SHELFICE C ================================================================== #endif /* ndef ECCO_CPPOPTIONS_H */ diff --git a/verification/offline_exf_seaice/code_ad/CTRL_OPTIONS.h b/verification/offline_exf_seaice/code_ad/CTRL_OPTIONS.h deleted file mode 100644 index ce69b65726..0000000000 --- a/verification/offline_exf_seaice/code_ad/CTRL_OPTIONS.h +++ /dev/null @@ -1,109 +0,0 @@ -CBOP -C !ROUTINE: CTRL_OPTIONS.h -C !INTERFACE: -C #include "CTRL_OPTIONS.h" - -C !DESCRIPTION: -C *==================================================================* -C | CPP options file for Control (ctrl) package: -C | Control which optional features to compile in this package code. -C *==================================================================* -CEOP - -#ifndef CTRL_OPTIONS_H -#define CTRL_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - -#ifdef ALLOW_CTRL -#ifdef ECCO_CPPOPTIONS_H - -C-- When multi-package option-file ECCO_CPPOPTIONS.h is used (directly included -C in CPP_OPTIONS.h), this option file is left empty since all options that -C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h - -#else /* ndef ECCO_CPPOPTIONS_H */ -C ================================================================== -C-- Package-specific Options & Macros go here - -C o Re-activate deprecated codes in pkg/ecco & pkg/ctrl (but not recommended) -C and since pkg/ctrl can be used without pkg/ecco, better to have it here -C o In this experiment, this option and the corresponding necessary flags -C to reproduce this experiment are commented by CTRL -CTRL#define ECCO_CTRL_DEPRECATED - -#undef EXCLUDE_CTRL_PACK -#define ALLOW_NONDIMENSIONAL_CONTROL_IO - -CTRLC >>> Initial values. -CTRL#define ALLOW_THETA0_CONTROL -CTRL#undef ALLOW_SALT0_CONTROL -CTRL#undef ALLOW_UVEL0_CONTROL -CTRL#undef ALLOW_VVEL0_CONTROL -CTRL#undef ALLOW_TR10_CONTROL -CTRL#undef ALLOW_TAUU0_CONTROL -CTRL#undef ALLOW_TAUV0_CONTROL -CTRL#undef ALLOW_SFLUX0_CONTROL -CTRL#undef ALLOW_HFLUX0_CONTROL -CTRL#undef ALLOW_SSS0_CONTROL -CTRL#undef ALLOW_SST0_CONTROL -CTRL -CTRLC >>> Surface fluxes. -CTRL#undef ALLOW_HFLUX_CONTROL -CTRL#undef ALLOW_SFLUX_CONTROL -CTRL#undef ALLOW_USTRESS_CONTROL -CTRL#undef ALLOW_VSTRESS_CONTROL -CTRL#undef ALLOW_SWFLUX_CONTROL -CTRL#undef ALLOW_LWFLUX_CONTROL -CTRL -CTRLC >>> Atmospheric state. -CTRL#define ALLOW_ATEMP_CONTROL -CTRL#define ALLOW_SWDOWN_CONTROL -CTRL#undef ALLOW_AQH_CONTROL -CTRL#undef ALLOW_UWIND_CONTROL -CTRL#undef ALLOW_VWIND_CONTROL -CTRL#undef ALLOW_PRECIP_CONTROL -CTRL -CTRLC >>> Other Control. -CTRL#undef ALLOW_DIFFKR_CONTROL -CTRL#undef ALLOW_KAPGM_CONTROL -CTRL#undef ALLOW_KAPREDI_CONTROL -CTRL#undef ALLOW_BOTTOMDRAG_CONTROL -CTRL -CTRLC >>> Backward compatibility option (before checkpoint 65p) -CTRL#undef ALLOW_KAPGM_CONTROL_OLD -CTRL#undef ALLOW_KAPREDI_CONTROL_OLD - -C >>> Generic Control. -#define ALLOW_GENARR2D_CONTROL -#define ALLOW_GENARR3D_CONTROL -#define ALLOW_GENTIM2D_CONTROL - -C o Rotation of wind/stress controls adjustments -C from Eastward/Northward to model grid directions -#undef ALLOW_ROTATE_UV_CONTROLS - -C o Originally the first two time-reccords of control -C variable tau u and tau v were skipped. -C The CTRL_SKIP_FIRST_TWO_ATM_REC_ALL option extends this -C to the other the time variable atmospheric controls. -#undef CTRL_SKIP_FIRST_TWO_ATM_REC_ALL - -C o use pkg/smooth correlation operator (incl. smoother) for 2D controls (Weaver, Courtier 01) -C This CPP option just sets the default for ctrlSmoothCorrel2D to .TRUE. -#undef ALLOW_SMOOTH_CORREL2D -C o use pkg/smooth correlation operator (incl. smoother) for 3D controls (Weaver, Courtier 01) -C This CPP option just sets the default for ctrlSmoothCorrel3D to .TRUE. -#undef ALLOW_SMOOTH_CORREL3D - -C o apply pkg/ctrl/ctrl_smooth.F to 2D controls (outside of ctrlSmoothCorrel2D) -#undef ALLOW_CTRL_SMOOTH -C o apply pkg/smooth/smooth_diff2d.F to 2D controls (outside of ctrlSmoothCorrel2D) -#undef ALLOW_SMOOTH_CTRL2D -C o apply pkg/smooth/smooth_diff3d.F to 3D controls (outside of ctrlSmoothCorrel3D) -#undef ALLOW_SMOOTH_CTRL3D - -C ================================================================== -#endif /* ndef ECCO_CPPOPTIONS_H */ -#endif /* ALLOW_CTRL */ -#endif /* CTRL_OPTIONS_H */ diff --git a/verification/offline_exf_seaice/code_ad/SEAICE_OPTIONS.h b/verification/offline_exf_seaice/code_ad/SEAICE_OPTIONS.h index d031682d4e..be18d11b1d 100644 --- a/verification/offline_exf_seaice/code_ad/SEAICE_OPTIONS.h +++ b/verification/offline_exf_seaice/code_ad/SEAICE_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef SEAICE_OPTIONS_H +#define SEAICE_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + C *==========================================================* C | SEAICE_OPTIONS.h C | o CPP options file for sea ice package. @@ -6,24 +11,12 @@ C | Use this file for selecting options within the sea ice C | package. C *==========================================================* -#ifndef SEAICE_OPTIONS_H -#define SEAICE_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_SEAICE -C Package-specific Options & Macros go here +C--- Package-specific Options & Macros go here C-- Write "text-plots" of certain fields in STDOUT for debugging. #undef SEAICE_DEBUG -C-- Allow sea-ice dynamic code. -C This option is provided to allow use of TAMC -C on the thermodynamics component of the code only. -C Sea-ice dynamics can also be turned off at runtime -C using variable SEAICEuseDYNAMICS. -#define SEAICE_ALLOW_DYNAMICS - C-- By default, the sea-ice package uses its own integrated bulk C formulae to compute fluxes (fu, fv, EmPmR, Qnet, and Qsw) over C open-ocean. When this flag is set, these variables are computed @@ -55,66 +48,122 @@ C seaice with a fraction (=SEAICE_saltFrac) of freezing seawater salinity. C- Note: SItracer also offers an alternative way to handle variable salinity. #undef SEAICE_VARIABLE_SALINITY -C-- Tracers of ice and/or ice cover. -#undef ALLOW_SITRACER -#ifdef ALLOW_SITRACER -C-- To try avoid 'spontaneous generation' of tracer maxima by advdiff. -# define ALLOW_SITRACER_ADVCAP -#endif - -C-- Enable grease ice parameterization -C The grease ice parameterization delays formation of solid -C sea ice from frazil ice by a time constant and provides a -C dynamic calculation of the initial solid sea ice thickness -C HO as a function of winds, currents and available grease ice -C volume. Grease ice does not significantly reduce heat loss -C from the ocean in winter and area covered by grease is thus -C handled like open water. -C (For details see Smedsrud and Martin, 2014, Ann.Glac.) +C-- Enable grease ice parameterization (requires to define ALLOW_SITRACER): +C The grease ice parameterization delays formation of solid sea ice from +C frazil ice by a time constant and provides a dynamic calculation of the +C initial solid sea ice thickness HO as a function of winds, currents and +C available grease ice volume. Grease ice does not significantly reduce heat +C loss from the ocean in winter and area covered by grease is thus handled +C like open water (For details see Smedsrud and Martin, 2014, Ann.Glac.). C Set SItrName(1) = 'grease' in namelist SEAICE_PARM03 in data.seaice C then output SItr01 is SItrNameLong(1) = 'grease ice volume fraction', -C with SItrUnit(1) = '[0-1]', which needs to be multiplied by SIheff -C to yield grease ice volume. Additionally, the actual grease ice -C layer thickness (diagnostic SIgrsLT) can be saved. +C with SItrUnit(1) = '[0-1]', which needs to be multiplied by SIheff to +C yield grease ice volume. Additionally, the actual grease ice layer +C thickness (diagnostic SIgrsLT) can be saved. #undef SEAICE_GREASE -C-- grease ice uses SItracer: + +C-- Tracers of ice and/or ice cover. #ifdef SEAICE_GREASE +C SEAICE_GREASE code requires to define ALLOW_SITRACER # define ALLOW_SITRACER -# define ALLOW_SITRACER_ADVCAP +#else +# undef ALLOW_SITRACER #endif +#ifdef ALLOW_SITRACER +C- To try avoid 'spontaneous generation' of tracer maxima by advdiff. +# define ALLOW_SITRACER_ADVCAP + +C- Include code to diagnose sea ice tracer budgets in +C seaice_advdiff.F and seaice_tracer_phys.F. Diagnostics are +C computed the "call diagnostics_fill" statement is commented out. +# undef ALLOW_SITRACER_DEBUG_DIAG +#endif /* ALLOW_SITRACER */ + +C-- Allow sea-ice dynamic code. These options are provided so that, +C if turned off (#undef), to compile (and process with TAF) only the +C the thermodynamics component of the code. Note that, if needed, +C sea-ice dynamics can be turned off at runtime (SEAICEuseDYNAMICS=F). C-- Historically, the seaice model was discretized on a B-Grid. This -C discretization should still work but it is not longer actively tested -C and supported. The following flag should always be set in order to use -C the operational C-grid discretization. +C discretization should still work but it is not longer actively +C tested and supported. Define this flag to compile it. It cannot be +C defined together with SEAICE_CGRID +#undef SEAICE_BGRID_DYNAMICS + +C-- The following flag should always be set in order to use C the +C-- operational C-grid discretization. #define SEAICE_CGRID -C-- Only for the C-grid version it is possible to #ifdef SEAICE_CGRID +C-- Options for the C-grid version only: + C enable advection of sea ice momentum # undef SEAICE_ALLOW_MOM_ADVECTION + C enable JFNK code by defining the following flag # undef SEAICE_ALLOW_JFNK + C enable Krylov code by defining the following flag # undef SEAICE_ALLOW_KRYLOV + +C-- Use a different order when mapping 2D velocity arrays to 1D vector +C before passing it to FGMRES. +# undef SEAICE_JFNK_MAP_REORDER + +C to reproduce old verification results for JFNK +# define SEAICE_PRECOND_EXTRA_EXCHANGE + C enable LSR to use global (multi-tile) tri-diagonal solver # undef SEAICE_GLOBAL_3DIAG_SOLVER + C enable EVP code by defining the following flag # define SEAICE_ALLOW_EVP # ifdef SEAICE_ALLOW_EVP -C-- When set use SEAICE_zetaMin and SEAICE_evpDampC to limit viscosities +C- When set use SEAICE_zetaMin and SEAICE_evpDampC to limit viscosities C from below and above in seaice_evp: not necessary, and not recommended # undef SEAICE_ALLOW_CLIPZETA + +C Include code to avoid underflows in EVP-code (copied from CICE). +C Many compilers can handle this more efficiently with the help of a flag. +# undef SEAICE_EVP_ELIMINATE_UNDERFLOWS + +C Include code to print residual of EVP iteration for debugging/diagnostics +# undef ALLOW_SEAICE_EVP_RESIDUAL # endif /* SEAICE_ALLOW_EVP */ + C smooth regularization (without max-function) of delta for C better differentiability # undef SEAICE_DELTA_SMOOTHREG + C regularize zeta to zmax with a smooth tanh-function instead C of a min(zeta,zmax). This improves convergence of iterative C solvers (Lemieux and Tremblay 2009, JGR). No effect on EVP # undef SEAICE_ZETA_SMOOTHREG + +C-- Different yield curves within the VP rheology framework C allow the truncated ellipse rheology (runtime flag SEAICEuseTEM) # undef SEAICE_ALLOW_TEM + +C allow the use of the Mohr Coulomb rheology (runtime flag SEAICEuseMCS) +C as defined in (Ip 1991) /!\ This is known to give unstable results, +C use with caution +# undef SEAICE_ALLOW_MCS + +CMLC or the modified coulombic rheology +CMLC allow the use of the Mohr Coulomb rheology (runtime flag +CMLC SEAICEuseFULLMC) as defined in (Ip 1991) /!\ This is known +CMLC to give unstable results, use with caution +CML# define SEAICE_ALLOW_FULLMC + +C allow the use of Mohr Coulomb with elliptical plastic potential +C (runtime flag SEAICEuseMCE) +# undef SEAICE_ALLOW_MCE + +C allow the teardrop and parabolic lens rheology +C (runtime flag SEAICEuseTD and SEAICEusePL) +# undef SEAICE_ALLOW_TEARDROP + +C-- LSR solver settings C Use LSR vector code; not useful on non-vector machines, because it C slows down convergence considerably, but the extra iterations are C more than made up by the much faster code on vector machines. For @@ -122,56 +171,108 @@ C the only regularly test vector machine these flags a specified C in the build options file SUPER-UX_SX-8_sxf90_awi, so that we comment C them out here. # define SEAICE_VECTORIZE_LSR + C Use zebra-method (alternate lines) for line-successive-relaxation C This modification improves the convergence of the vector code C dramatically, so that is may actually be useful in general, but C that needs to be tested. Can be used without vectorization options. # undef SEAICE_LSR_ZEBRA + +C Include code to print residual of nonlinear outer loop of LSR +# undef SEAICE_ALLOW_CHECK_LSR_CONVERGENCE + +C This flag is also required for an actual adjoint of seaice_lsr; +C increases memory requirements a lot. +# undef SEAICE_LSR_ADJOINT_ITER + C Use parameterisation of grounding ice for a better representation C of fastice in shallow seas # undef SEAICE_ALLOW_BOTTOMDRAG -#else /* not SEAICE_CGRID, but old B-grid */ -C-- By default for B-grid dynamics solver wind stress under sea-ice is + +#endif /* SEAICE_CGRID */ + +#ifdef SEAICE_BGRID_DYNAMICS +C-- Options for the B-grid version only: + +C- By default for B-grid dynamics solver wind stress under sea-ice is C set to the same value as it would be if there was no sea-ice. C Define following CPP flag for B-grid ice-ocean stress coupling. # define SEAICE_BICE_STRESS -C-- By default for B-grid dynamics solver surface tilt is obtained +C- By default for B-grid dynamics solver surface tilt is obtained C indirectly via geostrophic velocities. Define following CPP C in order to use ETAN instead. # define EXPLICIT_SSH_SLOPE -C-- Defining this flag turns on FV-discretization of the B-grid LSOR solver. + +C- Defining this flag turns on FV-discretization of the B-grid LSOR solver. C It is smoother and includes all metric terms, similar to C-grid solvers. C It is here for completeness, but its usefulness is unclear. # undef SEAICE_LSRBNEW -#endif /* SEAICE_CGRID */ -C-- When set limit the Ice-Loading to mass of 1/5 of Surface ocean grid-box +#endif /* SEAICE_BGRID_DYNAMICS */ + +C-- Some regularisations +C- When set limit the Ice-Loading to mass of 1/5 of Surface ocean grid-box #undef SEAICE_CAP_ICELOAD -C-- When set use SEAICE_clipVelocties = .true., to clip U/VICE at 40cm/s, + +C- When set use SEAICE_clipVelocties = .true., to clip U/VICE at 40cm/s, C not recommended #undef SEAICE_ALLOW_CLIPVELS -C-- When set cap the sublimation latent heat flux in solve4temp according + +C- When set cap the sublimation latent heat flux in solve4temp according C to the available amount of ice+snow. Otherwise this term is treated C like all of the others -- residuals heat and fw stocks are passed to C the ocean at the end of seaice_growth in a conservative manner. C SEAICE_CAP_SUBLIM is not needed as of now, but kept just in case. #undef SEAICE_CAP_SUBLIM +C-- AD flags +C- TAF related flag, currently only used in seaice_ad_check_lev[1-4]_dir.h; +C it is unclear if this is ever needed. +#undef AUTODIFF_SOMETIMES_NEEDED + +C- Reset fields to zero to stabilise AD code of dynamics solver +C (resulting in wrong gradients) +#undef SEAICE_DYN_STABLE_ADJOINT + +C- Another flag to simplify dependencies for TAF-generated AD-code +C the thermodynamic part, mostly by resetting variables to zero +#undef SEAICE_MODIFY_GROWTH_ADJ + +C- Special seaice flag for AD testing +#undef SEAICE_EXCLUDE_FOR_EXACT_AD_TESTING + C-- Use the adjointable sea-ice thermodynamic model C in seaice_growth_adx.F instead of seaice_growth.F +C This options excludes more complex physics such +C as sublimation, ITD, and frazil. #define SEAICE_USE_GROWTH_ADX +C-- These flags are not strictly AD-related but may help obtaining +C simpler AD-code: +C- Do not compile code that resets AREA (or AREAITD) to a mininum value +C of SEAICE_area_floor (=SIeps with default of 1e-5) if there is +C some finite sea ice thickness +#undef DISABLE_AREA_FLOOR + +C- Do not compile growth/thermodynamics code (avoiding this code can +C also be done by setting runtime parameter usePWthermodynamics=F) +#undef DISABLE_SEAICE_GROWTH + +C- Do not compile/use seaice-related obcs code when using obcs. +#undef DISABLE_SEAICE_OBCS + C-- Enable free drift code #define SEAICE_ALLOW_FREEDRIFT C-- pkg/seaice cost functions compile flags -c >>> Sea-ice volume (requires pkg/cost) +C- Sea-ice volume (requires pkg/cost) #define ALLOW_COST_ICE +#ifdef ALLOW_COST_ICE +C- Enable template for sea-ice volume export in seaice_cost_export.F +C (requires pkg/cost & ALLOW_COST_ICE defined) +# undef ALLOW_SEAICE_COST_EXPORT +#endif /* ALLOW_COST_ICE */ #endif /* ALLOW_SEAICE */ #endif /* SEAICE_OPTIONS_H */ - -CEH3 ;;; Local Variables: *** -CEH3 ;;; mode:fortran *** -CEH3 ;;; End: *** diff --git a/verification/seaice_itd/code/SEAICE_OPTIONS.h b/verification/seaice_itd/code/SEAICE_OPTIONS.h index f9697ddec7..dd6c75f73e 100644 --- a/verification/seaice_itd/code/SEAICE_OPTIONS.h +++ b/verification/seaice_itd/code/SEAICE_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef SEAICE_OPTIONS_H +#define SEAICE_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + C *==========================================================* C | SEAICE_OPTIONS.h C | o CPP options file for sea ice package. @@ -6,24 +11,12 @@ C | Use this file for selecting options within the sea ice C | package. C *==========================================================* -#ifndef SEAICE_OPTIONS_H -#define SEAICE_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_SEAICE -C Package-specific Options & Macros go here +C--- Package-specific Options & Macros go here C-- Write "text-plots" of certain fields in STDOUT for debugging. #undef SEAICE_DEBUG -C-- Allow sea-ice dynamic code. -C This option is provided to allow use of TAMC -C on the thermodynamics component of the code only. -C Sea-ice dynamics can also be turned off at runtime -C using variable SEAICEuseDYNAMICS. -#define SEAICE_ALLOW_DYNAMICS - C-- By default, the sea-ice package uses its own integrated bulk C formulae to compute fluxes (fu, fv, EmPmR, Qnet, and Qsw) over C open-ocean. When this flag is set, these variables are computed @@ -55,68 +48,116 @@ C seaice with a fraction (=SEAICE_saltFrac) of freezing seawater salinity. C- Note: SItracer also offers an alternative way to handle variable salinity. #undef SEAICE_VARIABLE_SALINITY -C-- Tracers of ice and/or ice cover. -#undef ALLOW_SITRACER -#ifdef ALLOW_SITRACER -C-- To try avoid 'spontaneous generation' of tracer maxima by advdiff. -# define ALLOW_SITRACER_ADVCAP -#endif - -C-- Enable grease ice parameterization -C The grease ice parameterization delays formation of solid -C sea ice from frazil ice by a time constant and provides a -C dynamic calculation of the initial solid sea ice thickness -C HO as a function of winds, currents and available grease ice -C volume. Grease ice does not significantly reduce heat loss -C from the ocean in winter and area covered by grease is thus -C handled like open water. -C (For details see Smedsrud and Martin, 2014, Ann.Glac.) +C-- Enable grease ice parameterization (requires to define ALLOW_SITRACER): +C The grease ice parameterization delays formation of solid sea ice from +C frazil ice by a time constant and provides a dynamic calculation of the +C initial solid sea ice thickness HO as a function of winds, currents and +C available grease ice volume. Grease ice does not significantly reduce heat +C loss from the ocean in winter and area covered by grease is thus handled +C like open water (For details see Smedsrud and Martin, 2014, Ann.Glac.). C Set SItrName(1) = 'grease' in namelist SEAICE_PARM03 in data.seaice C then output SItr01 is SItrNameLong(1) = 'grease ice volume fraction', -C with SItrUnit(1) = '[0-1]', which needs to be multiplied by SIheff -C to yield grease ice volume. Additionally, the actual grease ice -C layer thickness (diagnostic SIgrsLT) can be saved. +C with SItrUnit(1) = '[0-1]', which needs to be multiplied by SIheff to +C yield grease ice volume. Additionally, the actual grease ice layer +C thickness (diagnostic SIgrsLT) can be saved. #undef SEAICE_GREASE -C-- grease ice uses SItracer: + +C-- Tracers of ice and/or ice cover. #ifdef SEAICE_GREASE +C SEAICE_GREASE code requires to define ALLOW_SITRACER # define ALLOW_SITRACER -# define ALLOW_SITRACER_ADVCAP +#else +# undef ALLOW_SITRACER #endif +#ifdef ALLOW_SITRACER +C- To try avoid 'spontaneous generation' of tracer maxima by advdiff. +# define ALLOW_SITRACER_ADVCAP + +C- Include code to diagnose sea ice tracer budgets in +C seaice_advdiff.F and seaice_tracer_phys.F. Diagnostics are +C computed the "call diagnostics_fill" statement is commented out. +# undef ALLOW_SITRACER_DEBUG_DIAG +#endif /* ALLOW_SITRACER */ + +C-- Allow sea-ice dynamic code. These options are provided so that, +C if turned off (#undef), to compile (and process with TAF) only the +C the thermodynamics component of the code. Note that, if needed, +C sea-ice dynamics can be turned off at runtime (SEAICEuseDYNAMICS=F). C-- Historically, the seaice model was discretized on a B-Grid. This -C discretization should still work but it is not longer actively tested -C and supported. The following flag should always be set in order to use -C the operational C-grid discretization. +C discretization should still work but it is not longer actively +C tested and supported. Define this flag to compile it. It cannot be +C defined together with SEAICE_CGRID +#undef SEAICE_BGRID_DYNAMICS + +C-- The following flag should always be set in order to use C the +C-- operational C-grid discretization. #define SEAICE_CGRID -C-- Only for the C-grid version it is possible to #ifdef SEAICE_CGRID +C-- Options for the C-grid version only: + C enable advection of sea ice momentum # undef SEAICE_ALLOW_MOM_ADVECTION + C enable JFNK code by defining the following flag # define SEAICE_ALLOW_JFNK + C enable Krylov code by defining the following flag # define SEAICE_ALLOW_KRYLOV -C enable this flag to reproduce old verification results for JFNK + +C-- Use a different order when mapping 2D velocity arrays to 1D vector +C before passing it to FGMRES. +# undef SEAICE_JFNK_MAP_REORDER + +C to reproduce old verification results for JFNK # define SEAICE_PRECOND_EXTRA_EXCHANGE + C enable LSR to use global (multi-tile) tri-diagonal solver # define SEAICE_GLOBAL_3DIAG_SOLVER + C enable EVP code by defining the following flag # define SEAICE_ALLOW_EVP # ifdef SEAICE_ALLOW_EVP -C-- When set use SEAICE_zetaMin and SEAICE_evpDampC to limit viscosities +C- When set use SEAICE_zetaMin and SEAICE_evpDampC to limit viscosities C from below and above in seaice_evp: not necessary, and not recommended # undef SEAICE_ALLOW_CLIPZETA + +C Include code to avoid underflows in EVP-code (copied from CICE). +C Many compilers can handle this more efficiently with the help of a flag. +# undef SEAICE_EVP_ELIMINATE_UNDERFLOWS + +C Include code to print residual of EVP iteration for debugging/diagnostics +# undef ALLOW_SEAICE_EVP_RESIDUAL # endif /* SEAICE_ALLOW_EVP */ + C smooth regularization (without max-function) of delta for C better differentiability # undef SEAICE_DELTA_SMOOTHREG + C regularize zeta to zmax with a smooth tanh-function instead C of a min(zeta,zmax). This improves convergence of iterative C solvers (Lemieux and Tremblay 2009, JGR). No effect on EVP # define SEAICE_ZETA_SMOOTHREG + +C-- Different yield curves within the VP rheology framework C allow the truncated ellipse rheology (runtime flag SEAICEuseTEM) # undef SEAICE_ALLOW_TEM + +C allow the use of the Mohr Coulomb rheology (runtime flag SEAICEuseMCS) +C as defined in (Ip 1991) /!\ This is known to give unstable results, +C use with caution +# undef SEAICE_ALLOW_MCS + +C allow the use of Mohr Coulomb with elliptical plastic potential +C (runtime flag SEAICEuseMCE) +# undef SEAICE_ALLOW_MCE + +C allow the teardrop and parabolic lens rheology +C (runtime flag SEAICEuseTD and SEAICEusePL) +# undef SEAICE_ALLOW_TEARDROP + +C-- LSR solver settings C Use LSR vector code; not useful on non-vector machines, because it C slows down convergence considerably, but the extra iterations are C more than made up by the much faster code on vector machines. For @@ -124,54 +165,108 @@ C the only regularly test vector machine these flags a specified C in the build options file SUPER-UX_SX-8_sxf90_awi, so that we comment C them out here. # undef SEAICE_VECTORIZE_LSR + C Use zebra-method (alternate lines) for line-successive-relaxation C This modification improves the convergence of the vector code C dramatically, so that is may actually be useful in general, but C that needs to be tested. Can be used without vectorization options. # undef SEAICE_LSR_ZEBRA + +C Include code to print residual of nonlinear outer loop of LSR +# undef SEAICE_ALLOW_CHECK_LSR_CONVERGENCE + +C This flag is also required for an actual adjoint of seaice_lsr; +C increases memory requirements a lot. +# undef SEAICE_LSR_ADJOINT_ITER + C Use parameterisation of grounding ice for a better representation C of fastice in shallow seas # undef SEAICE_ALLOW_BOTTOMDRAG -#else /* not SEAICE_CGRID, but old B-grid */ -C-- By default for B-grid dynamics solver wind stress under sea-ice is + +#endif /* SEAICE_CGRID */ + +#ifdef SEAICE_BGRID_DYNAMICS +C-- Options for the B-grid version only: + +C- By default for B-grid dynamics solver wind stress under sea-ice is C set to the same value as it would be if there was no sea-ice. C Define following CPP flag for B-grid ice-ocean stress coupling. # define SEAICE_BICE_STRESS -C-- By default for B-grid dynamics solver surface tilt is obtained +C- By default for B-grid dynamics solver surface tilt is obtained C indirectly via geostrophic velocities. Define following CPP C in order to use ETAN instead. # define EXPLICIT_SSH_SLOPE -C-- Defining this flag turns on FV-discretization of the B-grid LSOR solver. + +C- Defining this flag turns on FV-discretization of the B-grid LSOR solver. C It is smoother and includes all metric terms, similar to C-grid solvers. C It is here for completeness, but its usefulness is unclear. # undef SEAICE_LSRBNEW -#endif /* SEAICE_CGRID */ -C-- When set limit the Ice-Loading to mass of 1/5 of Surface ocean grid-box +#endif /* SEAICE_BGRID_DYNAMICS */ + +C-- Some regularisations +C- When set limit the Ice-Loading to mass of 1/5 of Surface ocean grid-box #undef SEAICE_CAP_ICELOAD -C-- When set use SEAICE_clipVelocties = .true., to clip U/VICE at 40cm/s, + +C- When set use SEAICE_clipVelocties = .true., to clip U/VICE at 40cm/s, C not recommended #undef SEAICE_ALLOW_CLIPVELS -C-- When set cap the sublimation latent heat flux in solve4temp according + +C- When set cap the sublimation latent heat flux in solve4temp according C to the available amount of ice+snow. Otherwise this term is treated C like all of the others -- residuals heat and fw stocks are passed to C the ocean at the end of seaice_growth in a conservative manner. C SEAICE_CAP_SUBLIM is not needed as of now, but kept just in case. #undef SEAICE_CAP_SUBLIM +C-- AD flags +C- TAF related flag, currently only used in seaice_ad_check_lev[1-4]_dir.h; +C it is unclear if this is ever needed. +#undef AUTODIFF_SOMETIMES_NEEDED + +C- Reset fields to zero to stabilise AD code of dynamics solver +C (resulting in wrong gradients) +#undef SEAICE_DYN_STABLE_ADJOINT + +C- Another flag to simplify dependencies for TAF-generated AD-code +C the thermodynamic part, mostly by resetting variables to zero +#undef SEAICE_MODIFY_GROWTH_ADJ + +C- Special seaice flag for AD testing +#undef SEAICE_EXCLUDE_FOR_EXACT_AD_TESTING + +C-- Use the adjointable sea-ice thermodynamic model +C in seaice_growth_adx.F instead of seaice_growth.F +C This options excludes more complex physics such +C as sublimation, ITD, and frazil. +#undef SEAICE_USE_GROWTH_ADX + +C-- These flags are not strictly AD-related but may help obtaining +C simpler AD-code: +C- Do not compile code that resets AREA (or AREAITD) to a mininum value +C of SEAICE_area_floor (=SIeps with default of 1e-5) if there is +C some finite sea ice thickness +#undef DISABLE_AREA_FLOOR + +C- Do not compile growth/thermodynamics code (avoiding this code can +C also be done by setting runtime parameter usePWthermodynamics=F) +#undef DISABLE_SEAICE_GROWTH + +C- Do not compile/use seaice-related obcs code when using obcs. +#undef DISABLE_SEAICE_OBCS + C-- Enable free drift code #define SEAICE_ALLOW_FREEDRIFT C-- pkg/seaice cost functions compile flags -c >>> Sea-ice volume (requires pkg/cost) +C- Sea-ice volume (requires pkg/cost) #undef ALLOW_COST_ICE -c >>> Sea-ice misfit to obs (requires pkg/cost and ecco) -#undef ALLOW_SEAICE_COST_SMR_AREA +#ifdef ALLOW_COST_ICE +C- Enable template for sea-ice volume export in seaice_cost_export.F +C (requires pkg/cost & ALLOW_COST_ICE defined) +# undef ALLOW_SEAICE_COST_EXPORT +#endif /* ALLOW_COST_ICE */ #endif /* ALLOW_SEAICE */ #endif /* SEAICE_OPTIONS_H */ - -CEH3 ;;; Local Variables: *** -CEH3 ;;; mode:fortran *** -CEH3 ;;; End: *** diff --git a/verification/seaice_obcs/code/SEAICE_OPTIONS.h b/verification/seaice_obcs/code/SEAICE_OPTIONS.h index 2ca9e5012e..3d2ae1779d 100644 --- a/verification/seaice_obcs/code/SEAICE_OPTIONS.h +++ b/verification/seaice_obcs/code/SEAICE_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef SEAICE_OPTIONS_H +#define SEAICE_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + C *==========================================================* C | SEAICE_OPTIONS.h C | o CPP options file for sea ice package. @@ -6,24 +11,12 @@ C | Use this file for selecting options within the sea ice C | package. C *==========================================================* -#ifndef SEAICE_OPTIONS_H -#define SEAICE_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_SEAICE -C Package-specific Options & Macros go here +C--- Package-specific Options & Macros go here C-- Write "text-plots" of certain fields in STDOUT for debugging. #undef SEAICE_DEBUG -C-- Allow sea-ice dynamic code. -C This option is provided to allow use of TAMC -C on the thermodynamics component of the code only. -C Sea-ice dynamics can also be turned off at runtime -C using variable SEAICEuseDYNAMICS. -#define SEAICE_ALLOW_DYNAMICS - C-- By default, the sea-ice package uses its own integrated bulk C formulae to compute fluxes (fu, fv, EmPmR, Qnet, and Qsw) over C open-ocean. When this flag is set, these variables are computed @@ -55,66 +48,116 @@ C seaice with a fraction (=SEAICE_saltFrac) of freezing seawater salinity. C- Note: SItracer also offers an alternative way to handle variable salinity. #define SEAICE_VARIABLE_SALINITY -C-- Tracers of ice and/or ice cover. -#undef ALLOW_SITRACER -#ifdef ALLOW_SITRACER -C-- To try avoid 'spontaneous generation' of tracer maxima by advdiff. -# define ALLOW_SITRACER_ADVCAP -#endif - -C-- Enable grease ice parameterization -C The grease ice parameterization delays formation of solid -C sea ice from frazil ice by a time constant and provides a -C dynamic calculation of the initial solid sea ice thickness -C HO as a function of winds, currents and available grease ice -C volume. Grease ice does not significantly reduce heat loss -C from the ocean in winter and area covered by grease is thus -C handled like open water. -C (For details see Smedsrud and Martin, 2014, Ann.Glac.) +C-- Enable grease ice parameterization (requires to define ALLOW_SITRACER): +C The grease ice parameterization delays formation of solid sea ice from +C frazil ice by a time constant and provides a dynamic calculation of the +C initial solid sea ice thickness HO as a function of winds, currents and +C available grease ice volume. Grease ice does not significantly reduce heat +C loss from the ocean in winter and area covered by grease is thus handled +C like open water (For details see Smedsrud and Martin, 2014, Ann.Glac.). C Set SItrName(1) = 'grease' in namelist SEAICE_PARM03 in data.seaice C then output SItr01 is SItrNameLong(1) = 'grease ice volume fraction', -C with SItrUnit(1) = '[0-1]', which needs to be multiplied by SIheff -C to yield grease ice volume. Additionally, the actual grease ice -C layer thickness (diagnostic SIgrsLT) can be saved. +C with SItrUnit(1) = '[0-1]', which needs to be multiplied by SIheff to +C yield grease ice volume. Additionally, the actual grease ice layer +C thickness (diagnostic SIgrsLT) can be saved. #undef SEAICE_GREASE -C-- grease ice uses SItracer: + +C-- Tracers of ice and/or ice cover. #ifdef SEAICE_GREASE +C SEAICE_GREASE code requires to define ALLOW_SITRACER # define ALLOW_SITRACER -# define ALLOW_SITRACER_ADVCAP +#else +# undef ALLOW_SITRACER #endif +#ifdef ALLOW_SITRACER +C- To try avoid 'spontaneous generation' of tracer maxima by advdiff. +# define ALLOW_SITRACER_ADVCAP + +C- Include code to diagnose sea ice tracer budgets in +C seaice_advdiff.F and seaice_tracer_phys.F. Diagnostics are +C computed the "call diagnostics_fill" statement is commented out. +# undef ALLOW_SITRACER_DEBUG_DIAG +#endif /* ALLOW_SITRACER */ + +C-- Allow sea-ice dynamic code. These options are provided so that, +C if turned off (#undef), to compile (and process with TAF) only the +C the thermodynamics component of the code. Note that, if needed, +C sea-ice dynamics can be turned off at runtime (SEAICEuseDYNAMICS=F). C-- Historically, the seaice model was discretized on a B-Grid. This -C discretization should still work but it is not longer actively tested -C and supported. The following flag should always be set in order to use -C the operational C-grid discretization. +C discretization should still work but it is not longer actively +C tested and supported. Define this flag to compile it. It cannot be +C defined together with SEAICE_CGRID +#undef SEAICE_BGRID_DYNAMICS + +C-- The following flag should always be set in order to use C the +C-- operational C-grid discretization. #define SEAICE_CGRID -C-- Only for the C-grid version it is possible to #ifdef SEAICE_CGRID +C-- Options for the C-grid version only: + C enable advection of sea ice momentum # undef SEAICE_ALLOW_MOM_ADVECTION + C enable JFNK code by defining the following flag # define SEAICE_ALLOW_JFNK + C enable Krylov code by defining the following flag # define SEAICE_ALLOW_KRYLOV + +C-- Use a different order when mapping 2D velocity arrays to 1D vector +C before passing it to FGMRES. +# undef SEAICE_JFNK_MAP_REORDER + +C to reproduce old verification results for JFNK +# undef SEAICE_PRECOND_EXTRA_EXCHANGE + C enable LSR to use global (multi-tile) tri-diagonal solver # undef SEAICE_GLOBAL_3DIAG_SOLVER + C enable EVP code by defining the following flag # define SEAICE_ALLOW_EVP # ifdef SEAICE_ALLOW_EVP -C-- When set use SEAICE_zetaMin and SEAICE_evpDampC to limit viscosities +C- When set use SEAICE_zetaMin and SEAICE_evpDampC to limit viscosities C from below and above in seaice_evp: not necessary, and not recommended # undef SEAICE_ALLOW_CLIPZETA + +C Include code to avoid underflows in EVP-code (copied from CICE). +C Many compilers can handle this more efficiently with the help of a flag. +# undef SEAICE_EVP_ELIMINATE_UNDERFLOWS + +C Include code to print residual of EVP iteration for debugging/diagnostics +# undef ALLOW_SEAICE_EVP_RESIDUAL # endif /* SEAICE_ALLOW_EVP */ + C smooth regularization (without max-function) of delta for C better differentiability # undef SEAICE_DELTA_SMOOTHREG + C regularize zeta to zmax with a smooth tanh-function instead C of a min(zeta,zmax). This improves convergence of iterative C solvers (Lemieux and Tremblay 2009, JGR). No effect on EVP # undef SEAICE_ZETA_SMOOTHREG + +C-- Different yield curves within the VP rheology framework C allow the truncated ellipse rheology (runtime flag SEAICEuseTEM) # undef SEAICE_ALLOW_TEM + +C allow the use of the Mohr Coulomb rheology (runtime flag SEAICEuseMCS) +C as defined in (Ip 1991) /!\ This is known to give unstable results, +C use with caution +# undef SEAICE_ALLOW_MCS + +C allow the use of Mohr Coulomb with elliptical plastic potential +C (runtime flag SEAICEuseMCE) +# undef SEAICE_ALLOW_MCE + +C allow the teardrop and parabolic lens rheology +C (runtime flag SEAICEuseTD and SEAICEusePL) +# undef SEAICE_ALLOW_TEARDROP + +C-- LSR solver settings C Use LSR vector code; not useful on non-vector machines, because it C slows down convergence considerably, but the extra iterations are C more than made up by the much faster code on vector machines. For @@ -122,54 +165,108 @@ C the only regularly test vector machine these flags a specified C in the build options file SUPER-UX_SX-8_sxf90_awi, so that we comment C them out here. # undef SEAICE_VECTORIZE_LSR + C Use zebra-method (alternate lines) for line-successive-relaxation C This modification improves the convergence of the vector code C dramatically, so that is may actually be useful in general, but C that needs to be tested. Can be used without vectorization options. # undef SEAICE_LSR_ZEBRA + +C Include code to print residual of nonlinear outer loop of LSR +# undef SEAICE_ALLOW_CHECK_LSR_CONVERGENCE + +C This flag is also required for an actual adjoint of seaice_lsr; +C increases memory requirements a lot. +# undef SEAICE_LSR_ADJOINT_ITER + C Use parameterisation of grounding ice for a better representation C of fastice in shallow seas # undef SEAICE_ALLOW_BOTTOMDRAG -#else /* not SEAICE_CGRID, but old B-grid */ -C-- By default for B-grid dynamics solver wind stress under sea-ice is + +#endif /* SEAICE_CGRID */ + +#ifdef SEAICE_BGRID_DYNAMICS +C-- Options for the B-grid version only: + +C- By default for B-grid dynamics solver wind stress under sea-ice is C set to the same value as it would be if there was no sea-ice. C Define following CPP flag for B-grid ice-ocean stress coupling. # define SEAICE_BICE_STRESS -C-- By default for B-grid dynamics solver surface tilt is obtained +C- By default for B-grid dynamics solver surface tilt is obtained C indirectly via geostrophic velocities. Define following CPP C in order to use ETAN instead. # define EXPLICIT_SSH_SLOPE -C-- Defining this flag turns on FV-discretization of the B-grid LSOR solver. + +C- Defining this flag turns on FV-discretization of the B-grid LSOR solver. C It is smoother and includes all metric terms, similar to C-grid solvers. C It is here for completeness, but its usefulness is unclear. # undef SEAICE_LSRBNEW -#endif /* SEAICE_CGRID */ -C-- When set limit the Ice-Loading to mass of 1/5 of Surface ocean grid-box +#endif /* SEAICE_BGRID_DYNAMICS */ + +C-- Some regularisations +C- When set limit the Ice-Loading to mass of 1/5 of Surface ocean grid-box #undef SEAICE_CAP_ICELOAD -C-- When set use SEAICE_clipVelocties = .true., to clip U/VICE at 40cm/s, + +C- When set use SEAICE_clipVelocties = .true., to clip U/VICE at 40cm/s, C not recommended #undef SEAICE_ALLOW_CLIPVELS -C-- When set cap the sublimation latent heat flux in solve4temp according + +C- When set cap the sublimation latent heat flux in solve4temp according C to the available amount of ice+snow. Otherwise this term is treated C like all of the others -- residuals heat and fw stocks are passed to C the ocean at the end of seaice_growth in a conservative manner. C SEAICE_CAP_SUBLIM is not needed as of now, but kept just in case. #undef SEAICE_CAP_SUBLIM +C-- AD flags +C- TAF related flag, currently only used in seaice_ad_check_lev[1-4]_dir.h; +C it is unclear if this is ever needed. +#undef AUTODIFF_SOMETIMES_NEEDED + +C- Reset fields to zero to stabilise AD code of dynamics solver +C (resulting in wrong gradients) +#undef SEAICE_DYN_STABLE_ADJOINT + +C- Another flag to simplify dependencies for TAF-generated AD-code +C the thermodynamic part, mostly by resetting variables to zero +#undef SEAICE_MODIFY_GROWTH_ADJ + +C- Special seaice flag for AD testing +#undef SEAICE_EXCLUDE_FOR_EXACT_AD_TESTING + +C-- Use the adjointable sea-ice thermodynamic model +C in seaice_growth_adx.F instead of seaice_growth.F +C This options excludes more complex physics such +C as sublimation, ITD, and frazil. +#undef SEAICE_USE_GROWTH_ADX + +C-- These flags are not strictly AD-related but may help obtaining +C simpler AD-code: +C- Do not compile code that resets AREA (or AREAITD) to a mininum value +C of SEAICE_area_floor (=SIeps with default of 1e-5) if there is +C some finite sea ice thickness +#undef DISABLE_AREA_FLOOR + +C- Do not compile growth/thermodynamics code (avoiding this code can +C also be done by setting runtime parameter usePWthermodynamics=F) +#undef DISABLE_SEAICE_GROWTH + +C- Do not compile/use seaice-related obcs code when using obcs. +#undef DISABLE_SEAICE_OBCS + C-- Enable free drift code #define SEAICE_ALLOW_FREEDRIFT C-- pkg/seaice cost functions compile flags -c >>> Sea-ice volume (requires pkg/cost) +C- Sea-ice volume (requires pkg/cost) #undef ALLOW_COST_ICE -c >>> Sea-ice misfit to obs (requires pkg/cost and ecco) -#undef ALLOW_SEAICE_COST_SMR_AREA +#ifdef ALLOW_COST_ICE +C- Enable template for sea-ice volume export in seaice_cost_export.F +C (requires pkg/cost & ALLOW_COST_ICE defined) +# undef ALLOW_SEAICE_COST_EXPORT +#endif /* ALLOW_COST_ICE */ #endif /* ALLOW_SEAICE */ #endif /* SEAICE_OPTIONS_H */ - -CEH3 ;;; Local Variables: *** -CEH3 ;;; mode:fortran *** -CEH3 ;;; End: *** diff --git a/verification/tutorial_dic_adjoffline/code_ad/AUTODIFF_OPTIONS.h b/verification/tutorial_dic_adjoffline/code_ad/AUTODIFF_OPTIONS.h index 4b6f1f5cc0..c439cfd340 100644 --- a/verification/tutorial_dic_adjoffline/code_ad/AUTODIFF_OPTIONS.h +++ b/verification/tutorial_dic_adjoffline/code_ad/AUTODIFF_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef AUTODIFF_OPTIONS_H +#define AUTODIFF_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: AUTODIFF_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef AUTODIFF_OPTIONS_H -#define AUTODIFF_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_AUTODIFF #ifdef ECCO_CPPOPTIONS_H @@ -26,10 +26,11 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -C o Include/exclude code in order to be able to automatically -C differentiate the MITgcmUV by using the Tangent Linear and -C Adjoint Model Compiler (TAMC). +C o Include/exclude code in order to automatically differentiate MITgcm code +C using TAF (Transformation of Algorithms in Fortran, http://www.FastOpt.de) +C or using TAMC (Tangent Linear & Adjoint Model Compiler, needs both defined): #define ALLOW_AUTODIFF_TAMC +#undef AUTODIFF_TAMC_COMPATIBILITY C >>> Checkpointing as handled by TAMC #define ALLOW_TAMC_CHECKPOINTING @@ -40,19 +41,19 @@ C >>> and DYNVARS_DIAG adjoint state #undef ALLOW_AUTODIFF_MONITOR_DIAG C >>> DO 2-level checkpointing instead of 3-level -c#undef AUTODIFF_2_LEVEL_CHECKPOINT +#undef AUTODIFF_2_LEVEL_CHECKPOINT C extend to 4-level checkpointing -c#undef AUTODIFF_4_LEVEL_CHECKPOINT +#undef AUTODIFF_4_LEVEL_CHECKPOINT C o use divided adjoint to split adjoint computations #undef ALLOW_DIVIDED_ADJOINT -#undef ALLOW_PACKUNPACK_METHOD2 - C o This flag is incredibly useful as it reduces the number of C tape-files on the disc. Maybe it should even be the default. #define ALLOW_AUTODIFF_WHTAPEIO +C and related to above: +#undef ALLOW_INIT_WHTAPEIO C o use standard MDSFINDUINTS instead of local pkg/autodiff version for C WHTAPEIO code I/O. @@ -70,6 +71,10 @@ C Might still be used for OBCS since WHTAPEIO does not support OBCS fields. C o allow using viscFacInAd to recompute viscosities in AD #define AUTODIFF_ALLOW_VISCFACADJ +C o To remove part of MOM_CALC_VISC (better name would be: MOM_DISABLE_*) +#undef AUTODIFF_DISABLE_LEITH +#undef AUTODIFF_DISABLE_REYNOLDS_SCALE + C o for output of AD-variables (ALLOW_AUTODIFF_MONITOR), specific code (e.g., C in addummy_in_stepping.F) relies on adexch_uv_xy_rs and adexch_xy_rs S/R C which might not always be generated by TAF (e.g., when controls do not diff --git a/verification/tutorial_dic_adjoffline/code_ad/COST_OPTIONS.h b/verification/tutorial_dic_adjoffline/code_ad/COST_OPTIONS.h index 8293629113..0f8353bb43 100644 --- a/verification/tutorial_dic_adjoffline/code_ad/COST_OPTIONS.h +++ b/verification/tutorial_dic_adjoffline/code_ad/COST_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef COST_OPTIONS_H +#define COST_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: COST_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef COST_OPTIONS_H -#define COST_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_COST #ifdef ECCO_CPPOPTIONS_H @@ -26,52 +26,24 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -C >>> Use the EGM-96 geoid error covariance. -#undef ALLOW_EGM96_ERROR_COV -#undef ALLOW_READ_EGM_DATA +#undef ALLOW_COST_STATE_FINAL +#undef ALLOW_COST_VECTOR + C >>> Cost function contributions -#undef ALLOW_HFLUX_COST_CONTRIBUTION -#undef ALLOW_SFLUX_COST_CONTRIBUTION -#undef ALLOW_USTRESS_COST_CONTRIBUTION -#undef ALLOW_VSTRESS_COST_CONTRIBUTION -#undef ALLOW_THETA_COST_CONTRIBUTION -#undef ALLOW_SALT_COST_CONTRIBUTION -#undef ALLOW_SST_COST_CONTRIBUTION -#undef ALLOW_SSS_COST_CONTRIBUTION -#undef ALLOW_SSH_COST_CONTRIBUTION -#undef ALLOW_CTDT_COST_CONTRIBUTION -#undef ALLOW_CTDS_COST_CONTRIBUTION -#undef ALLOW_COST_ATLANTIC #undef ALLOW_COST_ATLANTIC_HEAT +#undef ALLOW_COST_ATLANTIC_HEAT_DOMASS #undef ALLOW_COST_TEST #undef ALLOW_COST_TSQUARED +#undef ALLOW_COST_DEPTH #undef ALLOW_COST_TRACER +C List these options here: +#undef ALLOW_COST_TEMP +#undef ALLOW_COST_HFLUXM #define ALLOW_DIC_COST - -C >>> ALLOW_GENCOST_CONTRIBUTION: interactive way to add basic 2D cost -C function terms. -C > In data.ecco, this requires the specification of data file (name, -C frequency, etc.), bar file name for corresp. model average, standard -C error file name, etc. -C > In addition, adding such cost terms requires editing ecco_cost.h to -C increase NGENCOST, and editing cost_gencost_customize.F to implement -C the actual model average (i.e. the bar file content). -#undef ALLOW_GENCOST_CONTRIBUTION -C >>> free form version of GENCOST: allows one to use otherwise defined -C elements (e.g. psbar and and topex data) while taking advantage of the -C cost function/namelist slots that can be made available using -C ALLOW_GENCOST_CONTRIBUTION. To this end ALLOW_GENCOST_CONTRIBUTION -C simply switches off tests that check whether all of the gencost -C elements (e.g. gencost_barfile and gencost_datafile) are specified -C in data.ecco. -C > While this option increases flexibility within the gencost framework, -C it implies more room for error, so it should be used cautiously, and -C with good knowledge of the rest of pkg/ecco. -C > It requires providing a specific cost function routine, and editing -C cost_gencost_all.F accordingly. -#undef ALLOW_GENCOST_FREEFORM +#undef ALLOW_THSICE_COST_TEST +#undef ALLOW_COST_SHELFICE C ================================================================== #endif /* ndef ECCO_CPPOPTIONS_H */ diff --git a/verification/tutorial_dic_adjoffline/code_ad/CTRL_OPTIONS.h b/verification/tutorial_dic_adjoffline/code_ad/CTRL_OPTIONS.h index 6164dfa894..36350764c7 100644 --- a/verification/tutorial_dic_adjoffline/code_ad/CTRL_OPTIONS.h +++ b/verification/tutorial_dic_adjoffline/code_ad/CTRL_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef CTRL_OPTIONS_H +#define CTRL_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: CTRL_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef CTRL_OPTIONS_H -#define CTRL_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_CTRL #ifdef ECCO_CPPOPTIONS_H @@ -26,55 +26,68 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -C o Re-activate deprecated codes in pkg/ecco & pkg/ctrl (but not recommended) -C and since pkg/ctrl can be used without pkg/ecco, better to have it here -#undef ECCO_CTRL_DEPRECATED - -#define EXCLUDE_CTRL_PACK +C o I/O and pack settings +#undef CTRL_SET_PREC_32 +C This option is only relevant (for pack/unpack) with OBCS_CONTROL: #undef ALLOW_NONDIMENSIONAL_CONTROL_IO - -C >>> Initial values. -#undef ALLOW_THETA0_CONTROL -#undef ALLOW_SALT0_CONTROL -#undef ALLOW_UVEL0_CONTROL -#undef ALLOW_VVEL0_CONTROL -#undef ALLOW_TR10_CONTROL -#undef ALLOW_TAUU0_CONTROL -#undef ALLOW_TAUV0_CONTROL -#undef ALLOW_SFLUX0_CONTROL -#undef ALLOW_HFLUX0_CONTROL -#undef ALLOW_SSS0_CONTROL -#undef ALLOW_SST0_CONTROL - -C >>> Surface fluxes. -#undef ALLOW_HFLUX_CONTROL -#undef ALLOW_SFLUX_CONTROL -#undef ALLOW_USTRESS_CONTROL -#undef ALLOW_VSTRESS_CONTROL -#undef ALLOW_SWFLUX_CONTROL -#undef ALLOW_LWFLUX_CONTROL - -C >>> Atmospheric state. -#undef ALLOW_ATEMP_CONTROL -#undef ALLOW_AQH_CONTROL -#undef ALLOW_UWIND_CONTROL -#undef ALLOW_VWIND_CONTROL -#undef ALLOW_PRECIP_CONTROL +#define EXCLUDE_CTRL_PACK +#undef ALLOW_PACKUNPACK_METHOD2 +#undef CTRL_DO_PACK_UNPACK_ONLY +#undef CTRL_PACK_PRECISE +#undef CTRL_UNPACK_PRECISE +#undef CTRL_DELZNORM +#undef ALLOW_CTRL_WETV C >>> Other Control. -#undef ALLOW_DIFFKR_CONTROL +C Allows for GMREDI controls #undef ALLOW_KAPGM_CONTROL #undef ALLOW_KAPREDI_CONTROL +C Allows for Vertical Diffusivity controls +#undef ALLOW_DIFFKR_CONTROL #undef ALLOW_BOTTOMDRAG_CONTROL - -C >>> Backward compatibility option (before checkpoint 65p) -#undef ALLOW_KAPGM_CONTROL_OLD -#undef ALLOW_KAPREDI_CONTROL_OLD +#undef ALLOW_DIC_CONTROL + +C Allows bathymetry as a control vector +C Note: keep this Option separated from generic control since this control +C involves many new dependencies that we would like to avoid in general. +#undef ALLOW_DEPTH_CONTROL +#ifdef ALLOW_DEPTH_CONTROL +C Only relevant within DEPTH_CONTROL code: +# define USE_SMOOTH_MIN +# undef ALLOW_HFACC_CONTROL +# undef ALLOW_HFACC3D_CONTROL +#endif /* ALLOW_DEPTH_CONTROL */ C >>> Generic Control. #define ALLOW_GENARR2D_CONTROL #undef ALLOW_GENARR3D_CONTROL #undef ALLOW_GENTIM2D_CONTROL +# undef ALLOW_UVEL0_CONTROL +# undef ALLOW_VVEL0_CONTROL +# undef CTRL_SET_OLD_MAXCVARS_30 +# undef CTRL_SET_OLD_MAXCVARS_40 + +C >>> Open boundaries +#ifdef ALLOW_OBCS +C Control of Open-Boundaries is meaningless without compiling pkg/obcs +C Note: Make sure that corresponding OBCS N/S/W/E Option is defined +# define ALLOW_OBCSN_CONTROL +# define ALLOW_OBCSS_CONTROL +# define ALLOW_OBCSW_CONTROL +# define ALLOW_OBCSE_CONTROL +# undef ALLOW_OBCS_CONTROL_MODES +#endif /* ALLOW_OBCS */ + +C o Set ALLOW_OBCS_CONTROL (Do not edit/modify): +#if (defined (ALLOW_OBCSN_CONTROL) || \ + defined (ALLOW_OBCSS_CONTROL) || \ + defined (ALLOW_OBCSW_CONTROL) || \ + defined (ALLOW_OBCSE_CONTROL)) +# define ALLOW_OBCS_CONTROL +#endif + +C o Impose bounds on controls +#undef ALLOW_ADCTRLBOUND C o Rotation of wind/stress controls adjustments C from Eastward/Northward to model grid directions @@ -86,19 +99,16 @@ C The CTRL_SKIP_FIRST_TWO_ATM_REC_ALL option extends this C to the other the time variable atmospheric controls. #undef CTRL_SKIP_FIRST_TWO_ATM_REC_ALL -C o use pkg/smooth correlation operator (incl. smoother) for 2D controls (Weaver, Courtier 01) -C This CPP option just sets the default for ctrlSmoothCorrel2D to .TRUE. -#undef ALLOW_SMOOTH_CORREL2D -C o use pkg/smooth correlation operator (incl. smoother) for 3D controls (Weaver, Courtier 01) -C This CPP option just sets the default for ctrlSmoothCorrel3D to .TRUE. -#undef ALLOW_SMOOTH_CORREL3D - -C o apply pkg/ctrl/ctrl_smooth.F to 2D controls (outside of ctrlSmoothCorrel2D) -#undef ALLOW_CTRL_SMOOTH -C o apply pkg/smooth/smooth_diff2d.F to 2D controls (outside of ctrlSmoothCorrel2D) +C Note: this flag turns on extra smoothing code in ctrl_get_gen.F which +C is inconsistent with the Weaver and Courtier, 2001 algorithm, and +C should probably not be used. The corresponding 3D flag applied only +C to deprecated code that is now removed. At some point we will remove +C this flag and associated code as well. +C o apply pkg/smooth/smooth_diff2d.F to 2D controls (outside of Smooth_Correl2D) #undef ALLOW_SMOOTH_CTRL2D -C o apply pkg/smooth/smooth_diff3d.F to 3D controls (outside of ctrlSmoothCorrel3D) -#undef ALLOW_SMOOTH_CTRL3D + +C o Print more debug info to STDOUT +#undef ALLOW_CTRL_DEBUG C ================================================================== #endif /* ndef ECCO_CPPOPTIONS_H */ diff --git a/verification/tutorial_global_oce_biogeo/code_ad/COST_OPTIONS.h b/verification/tutorial_global_oce_biogeo/code_ad/COST_OPTIONS.h index f3c9b0072b..0f8353bb43 100644 --- a/verification/tutorial_global_oce_biogeo/code_ad/COST_OPTIONS.h +++ b/verification/tutorial_global_oce_biogeo/code_ad/COST_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef COST_OPTIONS_H +#define COST_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: COST_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef COST_OPTIONS_H -#define COST_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_COST #ifdef ECCO_CPPOPTIONS_H @@ -26,51 +26,24 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -C >>> Use the EGM-96 geoid error covariance. -#undef ALLOW_EGM96_ERROR_COV -#undef ALLOW_READ_EGM_DATA +#undef ALLOW_COST_STATE_FINAL +#undef ALLOW_COST_VECTOR + C >>> Cost function contributions -#undef ALLOW_HFLUX_COST_CONTRIBUTION -#undef ALLOW_SFLUX_COST_CONTRIBUTION -#undef ALLOW_USTRESS_COST_CONTRIBUTION -#undef ALLOW_VSTRESS_COST_CONTRIBUTION -#undef ALLOW_THETA_COST_CONTRIBUTION -#undef ALLOW_SALT_COST_CONTRIBUTION -#undef ALLOW_SST_COST_CONTRIBUTION -#undef ALLOW_SSS_COST_CONTRIBUTION -#undef ALLOW_SSH_COST_CONTRIBUTION -#undef ALLOW_CTDT_COST_CONTRIBUTION -#undef ALLOW_CTDS_COST_CONTRIBUTION -#undef ALLOW_COST_ATLANTIC #undef ALLOW_COST_ATLANTIC_HEAT +#undef ALLOW_COST_ATLANTIC_HEAT_DOMASS #undef ALLOW_COST_TEST #undef ALLOW_COST_TSQUARED +#undef ALLOW_COST_DEPTH #undef ALLOW_COST_TRACER -#define ALLOW_DIC_COST -C >>> ALLOW_GENCOST_CONTRIBUTION: interactive way to add basic 2D cost -C function terms. -C > In data.ecco, this requires the specification of data file (name, -C frequency, etc.), bar file name for corresp. model average, standard -C error file name, etc. -C > In addition, adding such cost terms requires editing ecco_cost.h to -C increase NGENCOST, and editing cost_gencost_customize.F to implement -C the actual model average (i.e. the bar file content). -#undef ALLOW_GENCOST_CONTRIBUTION -C >>> free form version of GENCOST: allows one to use otherwise defined -C elements (e.g. psbar and and topex data) while taking advantage of the -C cost function/namelist slots that can be made available using -C ALLOW_GENCOST_CONTRIBUTION. To this end ALLOW_GENCOST_CONTRIBUTION -C simply switches off tests that check whether all of the gencost -C elements (e.g. gencost_barfile and gencost_datafile) are specified -C in data.ecco. -C > While this option increases flexibility within the gencost framework, -C it implies more room for error, so it should be used cautiously, and -C with good knowledge of the rest of pkg/ecco. -C > It requires providing a specific cost function routine, and editing -C cost_gencost_all.F accordingly. -#undef ALLOW_GENCOST_FREEFORM +C List these options here: +#undef ALLOW_COST_TEMP +#undef ALLOW_COST_HFLUXM +#define ALLOW_DIC_COST +#undef ALLOW_THSICE_COST_TEST +#undef ALLOW_COST_SHELFICE C ================================================================== #endif /* ndef ECCO_CPPOPTIONS_H */ diff --git a/verification/tutorial_global_oce_biogeo/code_ad/CTRL_OPTIONS.h b/verification/tutorial_global_oce_biogeo/code_ad/CTRL_OPTIONS.h index dca455b82d..86b909f8e2 100644 --- a/verification/tutorial_global_oce_biogeo/code_ad/CTRL_OPTIONS.h +++ b/verification/tutorial_global_oce_biogeo/code_ad/CTRL_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef CTRL_OPTIONS_H +#define CTRL_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: CTRL_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef CTRL_OPTIONS_H -#define CTRL_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_CTRL #ifdef ECCO_CPPOPTIONS_H @@ -26,55 +26,68 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -C o Re-activate deprecated codes in pkg/ecco & pkg/ctrl (but not recommended) -C and since pkg/ctrl can be used without pkg/ecco, better to have it here -#undef ECCO_CTRL_DEPRECATED - -#define EXCLUDE_CTRL_PACK +C o I/O and pack settings +#undef CTRL_SET_PREC_32 +C This option is only relevant (for pack/unpack) with OBCS_CONTROL: #undef ALLOW_NONDIMENSIONAL_CONTROL_IO - -C >>> Initial values. -#undef ALLOW_THETA0_CONTROL -#undef ALLOW_SALT0_CONTROL -#undef ALLOW_UVEL0_CONTROL -#undef ALLOW_VVEL0_CONTROL -#undef ALLOW_TR10_CONTROL -#undef ALLOW_TAUU0_CONTROL -#undef ALLOW_TAUV0_CONTROL -#undef ALLOW_SFLUX0_CONTROL -#undef ALLOW_HFLUX0_CONTROL -#undef ALLOW_SSS0_CONTROL -#undef ALLOW_SST0_CONTROL - -C >>> Surface fluxes. -#undef ALLOW_HFLUX_CONTROL -#undef ALLOW_SFLUX_CONTROL -#undef ALLOW_USTRESS_CONTROL -#undef ALLOW_VSTRESS_CONTROL -#undef ALLOW_SWFLUX_CONTROL -#undef ALLOW_LWFLUX_CONTROL - -C >>> Atmospheric state. -#undef ALLOW_ATEMP_CONTROL -#undef ALLOW_AQH_CONTROL -#undef ALLOW_UWIND_CONTROL -#undef ALLOW_VWIND_CONTROL -#undef ALLOW_PRECIP_CONTROL +#define EXCLUDE_CTRL_PACK +#undef ALLOW_PACKUNPACK_METHOD2 +#undef CTRL_DO_PACK_UNPACK_ONLY +#undef CTRL_PACK_PRECISE +#undef CTRL_UNPACK_PRECISE +#undef CTRL_DELZNORM +#undef ALLOW_CTRL_WETV C >>> Other Control. -#define ALLOW_DIFFKR_CONTROL +C Allows for GMREDI controls #undef ALLOW_KAPGM_CONTROL #undef ALLOW_KAPREDI_CONTROL +C Allows for Vertical Diffusivity controls +#define ALLOW_DIFFKR_CONTROL #undef ALLOW_BOTTOMDRAG_CONTROL - -C >>> Backward compatibility option (before checkpoint 65p) -#undef ALLOW_KAPGM_CONTROL_OLD -#undef ALLOW_KAPREDI_CONTROL_OLD +#undef ALLOW_DIC_CONTROL + +C Allows bathymetry as a control vector +C Note: keep this Option separated from generic control since this control +C involves many new dependencies that we would like to avoid in general. +#undef ALLOW_DEPTH_CONTROL +#ifdef ALLOW_DEPTH_CONTROL +C Only relevant within DEPTH_CONTROL code: +# define USE_SMOOTH_MIN +# undef ALLOW_HFACC_CONTROL +# undef ALLOW_HFACC3D_CONTROL +#endif /* ALLOW_DEPTH_CONTROL */ C >>> Generic Control. #undef ALLOW_GENARR2D_CONTROL #define ALLOW_GENARR3D_CONTROL #define ALLOW_GENTIM2D_CONTROL +# undef ALLOW_UVEL0_CONTROL +# undef ALLOW_VVEL0_CONTROL +# undef CTRL_SET_OLD_MAXCVARS_30 +# undef CTRL_SET_OLD_MAXCVARS_40 + +C >>> Open boundaries +#ifdef ALLOW_OBCS +C Control of Open-Boundaries is meaningless without compiling pkg/obcs +C Note: Make sure that corresponding OBCS N/S/W/E Option is defined +# define ALLOW_OBCSN_CONTROL +# define ALLOW_OBCSS_CONTROL +# define ALLOW_OBCSW_CONTROL +# define ALLOW_OBCSE_CONTROL +# undef ALLOW_OBCS_CONTROL_MODES +#endif /* ALLOW_OBCS */ + +C o Set ALLOW_OBCS_CONTROL (Do not edit/modify): +#if (defined (ALLOW_OBCSN_CONTROL) || \ + defined (ALLOW_OBCSS_CONTROL) || \ + defined (ALLOW_OBCSW_CONTROL) || \ + defined (ALLOW_OBCSE_CONTROL)) +# define ALLOW_OBCS_CONTROL +#endif + +C o Impose bounds on controls +#undef ALLOW_ADCTRLBOUND C o Rotation of wind/stress controls adjustments C from Eastward/Northward to model grid directions @@ -86,19 +99,16 @@ C The CTRL_SKIP_FIRST_TWO_ATM_REC_ALL option extends this C to the other the time variable atmospheric controls. #undef CTRL_SKIP_FIRST_TWO_ATM_REC_ALL -C o use pkg/smooth correlation operator (incl. smoother) for 2D controls (Weaver, Courtier 01) -C This CPP option just sets the default for ctrlSmoothCorrel2D to .TRUE. -#undef ALLOW_SMOOTH_CORREL2D -C o use pkg/smooth correlation operator (incl. smoother) for 3D controls (Weaver, Courtier 01) -C This CPP option just sets the default for ctrlSmoothCorrel3D to .TRUE. -#undef ALLOW_SMOOTH_CORREL3D - -C o apply pkg/ctrl/ctrl_smooth.F to 2D controls (outside of ctrlSmoothCorrel2D) -#undef ALLOW_CTRL_SMOOTH -C o apply pkg/smooth/smooth_diff2d.F to 2D controls (outside of ctrlSmoothCorrel2D) +C Note: this flag turns on extra smoothing code in ctrl_get_gen.F which +C is inconsistent with the Weaver and Courtier, 2001 algorithm, and +C should probably not be used. The corresponding 3D flag applied only +C to deprecated code that is now removed. At some point we will remove +C this flag and associated code as well. +C o apply pkg/smooth/smooth_diff2d.F to 2D controls (outside of Smooth_Correl2D) #undef ALLOW_SMOOTH_CTRL2D -C o apply pkg/smooth/smooth_diff3d.F to 3D controls (outside of ctrlSmoothCorrel3D) -#undef ALLOW_SMOOTH_CTRL3D + +C o Print more debug info to STDOUT +#undef ALLOW_CTRL_DEBUG C ================================================================== #endif /* ndef ECCO_CPPOPTIONS_H */ diff --git a/verification/tutorial_global_oce_biogeo/code_oad/AUTODIFF_OPTIONS.h b/verification/tutorial_global_oce_biogeo/code_oad/AUTODIFF_OPTIONS.h index 9f494e7955..85e0653c72 100644 --- a/verification/tutorial_global_oce_biogeo/code_oad/AUTODIFF_OPTIONS.h +++ b/verification/tutorial_global_oce_biogeo/code_oad/AUTODIFF_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef AUTODIFF_OPTIONS_H +#define AUTODIFF_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: AUTODIFF_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef AUTODIFF_OPTIONS_H -#define AUTODIFF_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_AUTODIFF #ifdef ECCO_CPPOPTIONS_H @@ -26,10 +26,11 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -C o Include/exclude code in order to be able to automatically -C differentiate the MITgcmUV by using the Tangent Linear and -C Adjoint Model Compiler (TAMC). +C o Include/exclude code in order to automatically differentiate MITgcm code +C using TAF (Transformation of Algorithms in Fortran, http://www.FastOpt.de) +C or using TAMC (Tangent Linear & Adjoint Model Compiler, needs both defined): #undef ALLOW_AUTODIFF_TAMC +#undef AUTODIFF_TAMC_COMPATIBILITY C >>> Checkpointing as handled by TAMC #define ALLOW_TAMC_CHECKPOINTING @@ -40,19 +41,19 @@ C >>> and DYNVARS_DIAG adjoint state #undef ALLOW_AUTODIFF_MONITOR_DIAG C >>> DO 2-level checkpointing instead of 3-level -c#undef AUTODIFF_2_LEVEL_CHECKPOINT +#undef AUTODIFF_2_LEVEL_CHECKPOINT C extend to 4-level checkpointing -c#undef AUTODIFF_4_LEVEL_CHECKPOINT +#undef AUTODIFF_4_LEVEL_CHECKPOINT C o use divided adjoint to split adjoint computations #undef ALLOW_DIVIDED_ADJOINT -#undef ALLOW_PACKUNPACK_METHOD2 - C o This flag is incredibly useful as it reduces the number of C tape-files on the disc. Maybe it should even be the default. #undef ALLOW_AUTODIFF_WHTAPEIO +C and related to above: +#undef ALLOW_INIT_WHTAPEIO C o use standard MDSFINDUINTS instead of local pkg/autodiff version for C WHTAPEIO code I/O. @@ -67,12 +68,13 @@ C Might still be used for OBCS since WHTAPEIO does not support OBCS fields. #undef AUTODIFF_USE_STORE_RESTORE #undef AUTODIFF_USE_STORE_RESTORE_OBCS -C o write separate tape files for each ptracer (has no effect, to be removed) -#undef AUTODIFF_PTRACERS_SPLIT_FILES - C o allow using viscFacInAd to recompute viscosities in AD #undef AUTODIFF_ALLOW_VISCFACADJ +C o To remove part of MOM_CALC_VISC (better name would be: MOM_DISABLE_*) +#undef AUTODIFF_DISABLE_LEITH +#undef AUTODIFF_DISABLE_REYNOLDS_SCALE + C o for output of AD-variables (ALLOW_AUTODIFF_MONITOR), specific code (e.g., C in addummy_in_stepping.F) relies on adexch_uv_xy_rs and adexch_xy_rs S/R C which might not always be generated by TAF (e.g., when controls do not diff --git a/verification/tutorial_global_oce_biogeo/code_oad/COST_OPTIONS.h b/verification/tutorial_global_oce_biogeo/code_oad/COST_OPTIONS.h index f3c9b0072b..0f8353bb43 100644 --- a/verification/tutorial_global_oce_biogeo/code_oad/COST_OPTIONS.h +++ b/verification/tutorial_global_oce_biogeo/code_oad/COST_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef COST_OPTIONS_H +#define COST_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: COST_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef COST_OPTIONS_H -#define COST_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_COST #ifdef ECCO_CPPOPTIONS_H @@ -26,51 +26,24 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -C >>> Use the EGM-96 geoid error covariance. -#undef ALLOW_EGM96_ERROR_COV -#undef ALLOW_READ_EGM_DATA +#undef ALLOW_COST_STATE_FINAL +#undef ALLOW_COST_VECTOR + C >>> Cost function contributions -#undef ALLOW_HFLUX_COST_CONTRIBUTION -#undef ALLOW_SFLUX_COST_CONTRIBUTION -#undef ALLOW_USTRESS_COST_CONTRIBUTION -#undef ALLOW_VSTRESS_COST_CONTRIBUTION -#undef ALLOW_THETA_COST_CONTRIBUTION -#undef ALLOW_SALT_COST_CONTRIBUTION -#undef ALLOW_SST_COST_CONTRIBUTION -#undef ALLOW_SSS_COST_CONTRIBUTION -#undef ALLOW_SSH_COST_CONTRIBUTION -#undef ALLOW_CTDT_COST_CONTRIBUTION -#undef ALLOW_CTDS_COST_CONTRIBUTION -#undef ALLOW_COST_ATLANTIC #undef ALLOW_COST_ATLANTIC_HEAT +#undef ALLOW_COST_ATLANTIC_HEAT_DOMASS #undef ALLOW_COST_TEST #undef ALLOW_COST_TSQUARED +#undef ALLOW_COST_DEPTH #undef ALLOW_COST_TRACER -#define ALLOW_DIC_COST -C >>> ALLOW_GENCOST_CONTRIBUTION: interactive way to add basic 2D cost -C function terms. -C > In data.ecco, this requires the specification of data file (name, -C frequency, etc.), bar file name for corresp. model average, standard -C error file name, etc. -C > In addition, adding such cost terms requires editing ecco_cost.h to -C increase NGENCOST, and editing cost_gencost_customize.F to implement -C the actual model average (i.e. the bar file content). -#undef ALLOW_GENCOST_CONTRIBUTION -C >>> free form version of GENCOST: allows one to use otherwise defined -C elements (e.g. psbar and and topex data) while taking advantage of the -C cost function/namelist slots that can be made available using -C ALLOW_GENCOST_CONTRIBUTION. To this end ALLOW_GENCOST_CONTRIBUTION -C simply switches off tests that check whether all of the gencost -C elements (e.g. gencost_barfile and gencost_datafile) are specified -C in data.ecco. -C > While this option increases flexibility within the gencost framework, -C it implies more room for error, so it should be used cautiously, and -C with good knowledge of the rest of pkg/ecco. -C > It requires providing a specific cost function routine, and editing -C cost_gencost_all.F accordingly. -#undef ALLOW_GENCOST_FREEFORM +C List these options here: +#undef ALLOW_COST_TEMP +#undef ALLOW_COST_HFLUXM +#define ALLOW_DIC_COST +#undef ALLOW_THSICE_COST_TEST +#undef ALLOW_COST_SHELFICE C ================================================================== #endif /* ndef ECCO_CPPOPTIONS_H */ diff --git a/verification/tutorial_global_oce_biogeo/code_oad/CTRL_OPTIONS.h b/verification/tutorial_global_oce_biogeo/code_oad/CTRL_OPTIONS.h index 2611c519da..5dd413126e 100644 --- a/verification/tutorial_global_oce_biogeo/code_oad/CTRL_OPTIONS.h +++ b/verification/tutorial_global_oce_biogeo/code_oad/CTRL_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef CTRL_OPTIONS_H +#define CTRL_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: CTRL_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef CTRL_OPTIONS_H -#define CTRL_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_CTRL #ifdef ECCO_CPPOPTIONS_H @@ -26,55 +26,68 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -C o Re-activate deprecated codes in pkg/ecco & pkg/ctrl (but not recommended) -C and since pkg/ctrl can be used without pkg/ecco, better to have it here -#undef ECCO_CTRL_DEPRECATED - -#define EXCLUDE_CTRL_PACK +C o I/O and pack settings +#undef CTRL_SET_PREC_32 +C This option is only relevant (for pack/unpack) with OBCS_CONTROL: #undef ALLOW_NONDIMENSIONAL_CONTROL_IO - -C >>> Initial values. -#undef ALLOW_THETA0_CONTROL -#undef ALLOW_SALT0_CONTROL -#undef ALLOW_UVEL0_CONTROL -#undef ALLOW_VVEL0_CONTROL -#undef ALLOW_TR10_CONTROL -#undef ALLOW_TAUU0_CONTROL -#undef ALLOW_TAUV0_CONTROL -#undef ALLOW_SFLUX0_CONTROL -#undef ALLOW_HFLUX0_CONTROL -#undef ALLOW_SSS0_CONTROL -#undef ALLOW_SST0_CONTROL - -C >>> Surface fluxes. -#undef ALLOW_HFLUX_CONTROL -#undef ALLOW_SFLUX_CONTROL -#undef ALLOW_USTRESS_CONTROL -#undef ALLOW_VSTRESS_CONTROL -#undef ALLOW_SWFLUX_CONTROL -#undef ALLOW_LWFLUX_CONTROL - -C >>> Atmospheric state. -#undef ALLOW_ATEMP_CONTROL -#undef ALLOW_AQH_CONTROL -#undef ALLOW_UWIND_CONTROL -#undef ALLOW_VWIND_CONTROL -#undef ALLOW_PRECIP_CONTROL +#define EXCLUDE_CTRL_PACK +#undef ALLOW_PACKUNPACK_METHOD2 +#undef CTRL_DO_PACK_UNPACK_ONLY +#undef CTRL_PACK_PRECISE +#undef CTRL_UNPACK_PRECISE +#undef CTRL_DELZNORM +#undef ALLOW_CTRL_WETV C >>> Other Control. -#undef ALLOW_DIFFKR_CONTROL +C Allows for GMREDI controls #undef ALLOW_KAPGM_CONTROL #undef ALLOW_KAPREDI_CONTROL +C Allows for Vertical Diffusivity controls +#undef ALLOW_DIFFKR_CONTROL #undef ALLOW_BOTTOMDRAG_CONTROL - -C >>> Backward compatibility option (before checkpoint 65p) -#undef ALLOW_KAPGM_CONTROL_OLD -#undef ALLOW_KAPREDI_CONTROL_OLD +#undef ALLOW_DIC_CONTROL + +C Allows bathymetry as a control vector +C Note: keep this Option separated from generic control since this control +C involves many new dependencies that we would like to avoid in general. +#undef ALLOW_DEPTH_CONTROL +#ifdef ALLOW_DEPTH_CONTROL +C Only relevant within DEPTH_CONTROL code: +# define USE_SMOOTH_MIN +# undef ALLOW_HFACC_CONTROL +# undef ALLOW_HFACC3D_CONTROL +#endif /* ALLOW_DEPTH_CONTROL */ C >>> Generic Control. #define ALLOW_GENARR2D_CONTROL #define ALLOW_GENARR3D_CONTROL #undef ALLOW_GENTIM2D_CONTROL +# undef ALLOW_UVEL0_CONTROL +# undef ALLOW_VVEL0_CONTROL +# undef CTRL_SET_OLD_MAXCVARS_30 +# undef CTRL_SET_OLD_MAXCVARS_40 + +C >>> Open boundaries +#ifdef ALLOW_OBCS +C Control of Open-Boundaries is meaningless without compiling pkg/obcs +C Note: Make sure that corresponding OBCS N/S/W/E Option is defined +# define ALLOW_OBCSN_CONTROL +# define ALLOW_OBCSS_CONTROL +# define ALLOW_OBCSW_CONTROL +# define ALLOW_OBCSE_CONTROL +# undef ALLOW_OBCS_CONTROL_MODES +#endif /* ALLOW_OBCS */ + +C o Set ALLOW_OBCS_CONTROL (Do not edit/modify): +#if (defined (ALLOW_OBCSN_CONTROL) || \ + defined (ALLOW_OBCSS_CONTROL) || \ + defined (ALLOW_OBCSW_CONTROL) || \ + defined (ALLOW_OBCSE_CONTROL)) +# define ALLOW_OBCS_CONTROL +#endif + +C o Impose bounds on controls +#undef ALLOW_ADCTRLBOUND C o Rotation of wind/stress controls adjustments C from Eastward/Northward to model grid directions @@ -86,19 +99,16 @@ C The CTRL_SKIP_FIRST_TWO_ATM_REC_ALL option extends this C to the other the time variable atmospheric controls. #undef CTRL_SKIP_FIRST_TWO_ATM_REC_ALL -C o use pkg/smooth correlation operator (incl. smoother) for 2D controls (Weaver, Courtier 01) -C This CPP option just sets the default for ctrlSmoothCorrel2D to .TRUE. -#undef ALLOW_SMOOTH_CORREL2D -C o use pkg/smooth correlation operator (incl. smoother) for 3D controls (Weaver, Courtier 01) -C This CPP option just sets the default for ctrlSmoothCorrel3D to .TRUE. -#undef ALLOW_SMOOTH_CORREL3D - -C o apply pkg/ctrl/ctrl_smooth.F to 2D controls (outside of ctrlSmoothCorrel2D) -#undef ALLOW_CTRL_SMOOTH -C o apply pkg/smooth/smooth_diff2d.F to 2D controls (outside of ctrlSmoothCorrel2D) +C Note: this flag turns on extra smoothing code in ctrl_get_gen.F which +C is inconsistent with the Weaver and Courtier, 2001 algorithm, and +C should probably not be used. The corresponding 3D flag applied only +C to deprecated code that is now removed. At some point we will remove +C this flag and associated code as well. +C o apply pkg/smooth/smooth_diff2d.F to 2D controls (outside of Smooth_Correl2D) #undef ALLOW_SMOOTH_CTRL2D -C o apply pkg/smooth/smooth_diff3d.F to 3D controls (outside of ctrlSmoothCorrel3D) -#undef ALLOW_SMOOTH_CTRL3D + +C o Print more debug info to STDOUT +#undef ALLOW_CTRL_DEBUG C ================================================================== #endif /* ndef ECCO_CPPOPTIONS_H */ diff --git a/verification/tutorial_global_oce_biogeo/code_tap/AUTODIFF_OPTIONS.h b/verification/tutorial_global_oce_biogeo/code_tap/AUTODIFF_OPTIONS.h index 7339a3b301..b9b62682c6 100644 --- a/verification/tutorial_global_oce_biogeo/code_tap/AUTODIFF_OPTIONS.h +++ b/verification/tutorial_global_oce_biogeo/code_tap/AUTODIFF_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef AUTODIFF_OPTIONS_H +#define AUTODIFF_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: AUTODIFF_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef AUTODIFF_OPTIONS_H -#define AUTODIFF_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_AUTODIFF #ifdef ECCO_CPPOPTIONS_H @@ -26,10 +26,11 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -C o Include/exclude code in order to be able to automatically -C differentiate the MITgcmUV by using the Tangent Linear and -C Adjoint Model Compiler (TAMC). +C o Include/exclude code in order to automatically differentiate MITgcm code +C using TAF (Transformation of Algorithms in Fortran, http://www.FastOpt.de) +C or using TAMC (Tangent Linear & Adjoint Model Compiler, needs both defined): #undef ALLOW_AUTODIFF_TAMC +#undef AUTODIFF_TAMC_COMPATIBILITY C >>> Checkpointing as handled by TAMC #undef ALLOW_TAMC_CHECKPOINTING @@ -40,19 +41,19 @@ C >>> and DYNVARS_DIAG adjoint state #undef ALLOW_AUTODIFF_MONITOR_DIAG C >>> DO 2-level checkpointing instead of 3-level -c#undef AUTODIFF_2_LEVEL_CHECKPOINT +#undef AUTODIFF_2_LEVEL_CHECKPOINT C extend to 4-level checkpointing -c#undef AUTODIFF_4_LEVEL_CHECKPOINT +#undef AUTODIFF_4_LEVEL_CHECKPOINT C o use divided adjoint to split adjoint computations #undef ALLOW_DIVIDED_ADJOINT -#undef ALLOW_PACKUNPACK_METHOD2 - C o This flag is incredibly useful as it reduces the number of C tape-files on the disc. Maybe it should even be the default. #undef ALLOW_AUTODIFF_WHTAPEIO +C and related to above: +#undef ALLOW_INIT_WHTAPEIO C o use standard MDSFINDUINTS instead of local pkg/autodiff version for C WHTAPEIO code I/O. @@ -67,12 +68,13 @@ C Might still be used for OBCS since WHTAPEIO does not support OBCS fields. #undef AUTODIFF_USE_STORE_RESTORE #undef AUTODIFF_USE_STORE_RESTORE_OBCS -C o write separate tape files for each ptracer (has no effect, to be removed) -#undef AUTODIFF_PTRACERS_SPLIT_FILES - C o allow using viscFacInAd to recompute viscosities in AD #undef AUTODIFF_ALLOW_VISCFACADJ +C o To remove part of MOM_CALC_VISC (better name would be: MOM_DISABLE_*) +#undef AUTODIFF_DISABLE_LEITH +#undef AUTODIFF_DISABLE_REYNOLDS_SCALE + C o for output of AD-variables (ALLOW_AUTODIFF_MONITOR), specific code (e.g., C in addummy_in_stepping.F) relies on adexch_uv_xy_rs and adexch_xy_rs S/R C which might not always be generated by TAF (e.g., when controls do not diff --git a/verification/tutorial_global_oce_biogeo/code_tap/COST_OPTIONS.h b/verification/tutorial_global_oce_biogeo/code_tap/COST_OPTIONS.h index f3c9b0072b..0f8353bb43 100644 --- a/verification/tutorial_global_oce_biogeo/code_tap/COST_OPTIONS.h +++ b/verification/tutorial_global_oce_biogeo/code_tap/COST_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef COST_OPTIONS_H +#define COST_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: COST_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef COST_OPTIONS_H -#define COST_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_COST #ifdef ECCO_CPPOPTIONS_H @@ -26,51 +26,24 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -C >>> Use the EGM-96 geoid error covariance. -#undef ALLOW_EGM96_ERROR_COV -#undef ALLOW_READ_EGM_DATA +#undef ALLOW_COST_STATE_FINAL +#undef ALLOW_COST_VECTOR + C >>> Cost function contributions -#undef ALLOW_HFLUX_COST_CONTRIBUTION -#undef ALLOW_SFLUX_COST_CONTRIBUTION -#undef ALLOW_USTRESS_COST_CONTRIBUTION -#undef ALLOW_VSTRESS_COST_CONTRIBUTION -#undef ALLOW_THETA_COST_CONTRIBUTION -#undef ALLOW_SALT_COST_CONTRIBUTION -#undef ALLOW_SST_COST_CONTRIBUTION -#undef ALLOW_SSS_COST_CONTRIBUTION -#undef ALLOW_SSH_COST_CONTRIBUTION -#undef ALLOW_CTDT_COST_CONTRIBUTION -#undef ALLOW_CTDS_COST_CONTRIBUTION -#undef ALLOW_COST_ATLANTIC #undef ALLOW_COST_ATLANTIC_HEAT +#undef ALLOW_COST_ATLANTIC_HEAT_DOMASS #undef ALLOW_COST_TEST #undef ALLOW_COST_TSQUARED +#undef ALLOW_COST_DEPTH #undef ALLOW_COST_TRACER -#define ALLOW_DIC_COST -C >>> ALLOW_GENCOST_CONTRIBUTION: interactive way to add basic 2D cost -C function terms. -C > In data.ecco, this requires the specification of data file (name, -C frequency, etc.), bar file name for corresp. model average, standard -C error file name, etc. -C > In addition, adding such cost terms requires editing ecco_cost.h to -C increase NGENCOST, and editing cost_gencost_customize.F to implement -C the actual model average (i.e. the bar file content). -#undef ALLOW_GENCOST_CONTRIBUTION -C >>> free form version of GENCOST: allows one to use otherwise defined -C elements (e.g. psbar and and topex data) while taking advantage of the -C cost function/namelist slots that can be made available using -C ALLOW_GENCOST_CONTRIBUTION. To this end ALLOW_GENCOST_CONTRIBUTION -C simply switches off tests that check whether all of the gencost -C elements (e.g. gencost_barfile and gencost_datafile) are specified -C in data.ecco. -C > While this option increases flexibility within the gencost framework, -C it implies more room for error, so it should be used cautiously, and -C with good knowledge of the rest of pkg/ecco. -C > It requires providing a specific cost function routine, and editing -C cost_gencost_all.F accordingly. -#undef ALLOW_GENCOST_FREEFORM +C List these options here: +#undef ALLOW_COST_TEMP +#undef ALLOW_COST_HFLUXM +#define ALLOW_DIC_COST +#undef ALLOW_THSICE_COST_TEST +#undef ALLOW_COST_SHELFICE C ================================================================== #endif /* ndef ECCO_CPPOPTIONS_H */ diff --git a/verification/tutorial_global_oce_biogeo/code_tap/CTRL_OPTIONS.h b/verification/tutorial_global_oce_biogeo/code_tap/CTRL_OPTIONS.h index dca455b82d..86b909f8e2 100644 --- a/verification/tutorial_global_oce_biogeo/code_tap/CTRL_OPTIONS.h +++ b/verification/tutorial_global_oce_biogeo/code_tap/CTRL_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef CTRL_OPTIONS_H +#define CTRL_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: CTRL_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef CTRL_OPTIONS_H -#define CTRL_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_CTRL #ifdef ECCO_CPPOPTIONS_H @@ -26,55 +26,68 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -C o Re-activate deprecated codes in pkg/ecco & pkg/ctrl (but not recommended) -C and since pkg/ctrl can be used without pkg/ecco, better to have it here -#undef ECCO_CTRL_DEPRECATED - -#define EXCLUDE_CTRL_PACK +C o I/O and pack settings +#undef CTRL_SET_PREC_32 +C This option is only relevant (for pack/unpack) with OBCS_CONTROL: #undef ALLOW_NONDIMENSIONAL_CONTROL_IO - -C >>> Initial values. -#undef ALLOW_THETA0_CONTROL -#undef ALLOW_SALT0_CONTROL -#undef ALLOW_UVEL0_CONTROL -#undef ALLOW_VVEL0_CONTROL -#undef ALLOW_TR10_CONTROL -#undef ALLOW_TAUU0_CONTROL -#undef ALLOW_TAUV0_CONTROL -#undef ALLOW_SFLUX0_CONTROL -#undef ALLOW_HFLUX0_CONTROL -#undef ALLOW_SSS0_CONTROL -#undef ALLOW_SST0_CONTROL - -C >>> Surface fluxes. -#undef ALLOW_HFLUX_CONTROL -#undef ALLOW_SFLUX_CONTROL -#undef ALLOW_USTRESS_CONTROL -#undef ALLOW_VSTRESS_CONTROL -#undef ALLOW_SWFLUX_CONTROL -#undef ALLOW_LWFLUX_CONTROL - -C >>> Atmospheric state. -#undef ALLOW_ATEMP_CONTROL -#undef ALLOW_AQH_CONTROL -#undef ALLOW_UWIND_CONTROL -#undef ALLOW_VWIND_CONTROL -#undef ALLOW_PRECIP_CONTROL +#define EXCLUDE_CTRL_PACK +#undef ALLOW_PACKUNPACK_METHOD2 +#undef CTRL_DO_PACK_UNPACK_ONLY +#undef CTRL_PACK_PRECISE +#undef CTRL_UNPACK_PRECISE +#undef CTRL_DELZNORM +#undef ALLOW_CTRL_WETV C >>> Other Control. -#define ALLOW_DIFFKR_CONTROL +C Allows for GMREDI controls #undef ALLOW_KAPGM_CONTROL #undef ALLOW_KAPREDI_CONTROL +C Allows for Vertical Diffusivity controls +#define ALLOW_DIFFKR_CONTROL #undef ALLOW_BOTTOMDRAG_CONTROL - -C >>> Backward compatibility option (before checkpoint 65p) -#undef ALLOW_KAPGM_CONTROL_OLD -#undef ALLOW_KAPREDI_CONTROL_OLD +#undef ALLOW_DIC_CONTROL + +C Allows bathymetry as a control vector +C Note: keep this Option separated from generic control since this control +C involves many new dependencies that we would like to avoid in general. +#undef ALLOW_DEPTH_CONTROL +#ifdef ALLOW_DEPTH_CONTROL +C Only relevant within DEPTH_CONTROL code: +# define USE_SMOOTH_MIN +# undef ALLOW_HFACC_CONTROL +# undef ALLOW_HFACC3D_CONTROL +#endif /* ALLOW_DEPTH_CONTROL */ C >>> Generic Control. #undef ALLOW_GENARR2D_CONTROL #define ALLOW_GENARR3D_CONTROL #define ALLOW_GENTIM2D_CONTROL +# undef ALLOW_UVEL0_CONTROL +# undef ALLOW_VVEL0_CONTROL +# undef CTRL_SET_OLD_MAXCVARS_30 +# undef CTRL_SET_OLD_MAXCVARS_40 + +C >>> Open boundaries +#ifdef ALLOW_OBCS +C Control of Open-Boundaries is meaningless without compiling pkg/obcs +C Note: Make sure that corresponding OBCS N/S/W/E Option is defined +# define ALLOW_OBCSN_CONTROL +# define ALLOW_OBCSS_CONTROL +# define ALLOW_OBCSW_CONTROL +# define ALLOW_OBCSE_CONTROL +# undef ALLOW_OBCS_CONTROL_MODES +#endif /* ALLOW_OBCS */ + +C o Set ALLOW_OBCS_CONTROL (Do not edit/modify): +#if (defined (ALLOW_OBCSN_CONTROL) || \ + defined (ALLOW_OBCSS_CONTROL) || \ + defined (ALLOW_OBCSW_CONTROL) || \ + defined (ALLOW_OBCSE_CONTROL)) +# define ALLOW_OBCS_CONTROL +#endif + +C o Impose bounds on controls +#undef ALLOW_ADCTRLBOUND C o Rotation of wind/stress controls adjustments C from Eastward/Northward to model grid directions @@ -86,19 +99,16 @@ C The CTRL_SKIP_FIRST_TWO_ATM_REC_ALL option extends this C to the other the time variable atmospheric controls. #undef CTRL_SKIP_FIRST_TWO_ATM_REC_ALL -C o use pkg/smooth correlation operator (incl. smoother) for 2D controls (Weaver, Courtier 01) -C This CPP option just sets the default for ctrlSmoothCorrel2D to .TRUE. -#undef ALLOW_SMOOTH_CORREL2D -C o use pkg/smooth correlation operator (incl. smoother) for 3D controls (Weaver, Courtier 01) -C This CPP option just sets the default for ctrlSmoothCorrel3D to .TRUE. -#undef ALLOW_SMOOTH_CORREL3D - -C o apply pkg/ctrl/ctrl_smooth.F to 2D controls (outside of ctrlSmoothCorrel2D) -#undef ALLOW_CTRL_SMOOTH -C o apply pkg/smooth/smooth_diff2d.F to 2D controls (outside of ctrlSmoothCorrel2D) +C Note: this flag turns on extra smoothing code in ctrl_get_gen.F which +C is inconsistent with the Weaver and Courtier, 2001 algorithm, and +C should probably not be used. The corresponding 3D flag applied only +C to deprecated code that is now removed. At some point we will remove +C this flag and associated code as well. +C o apply pkg/smooth/smooth_diff2d.F to 2D controls (outside of Smooth_Correl2D) #undef ALLOW_SMOOTH_CTRL2D -C o apply pkg/smooth/smooth_diff3d.F to 3D controls (outside of ctrlSmoothCorrel3D) -#undef ALLOW_SMOOTH_CTRL3D + +C o Print more debug info to STDOUT +#undef ALLOW_CTRL_DEBUG C ================================================================== #endif /* ndef ECCO_CPPOPTIONS_H */ diff --git a/verification/tutorial_global_oce_optim/code_ad/AUTODIFF_OPTIONS.h b/verification/tutorial_global_oce_optim/code_ad/AUTODIFF_OPTIONS.h index 4b6f1f5cc0..c439cfd340 100644 --- a/verification/tutorial_global_oce_optim/code_ad/AUTODIFF_OPTIONS.h +++ b/verification/tutorial_global_oce_optim/code_ad/AUTODIFF_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef AUTODIFF_OPTIONS_H +#define AUTODIFF_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: AUTODIFF_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef AUTODIFF_OPTIONS_H -#define AUTODIFF_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_AUTODIFF #ifdef ECCO_CPPOPTIONS_H @@ -26,10 +26,11 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -C o Include/exclude code in order to be able to automatically -C differentiate the MITgcmUV by using the Tangent Linear and -C Adjoint Model Compiler (TAMC). +C o Include/exclude code in order to automatically differentiate MITgcm code +C using TAF (Transformation of Algorithms in Fortran, http://www.FastOpt.de) +C or using TAMC (Tangent Linear & Adjoint Model Compiler, needs both defined): #define ALLOW_AUTODIFF_TAMC +#undef AUTODIFF_TAMC_COMPATIBILITY C >>> Checkpointing as handled by TAMC #define ALLOW_TAMC_CHECKPOINTING @@ -40,19 +41,19 @@ C >>> and DYNVARS_DIAG adjoint state #undef ALLOW_AUTODIFF_MONITOR_DIAG C >>> DO 2-level checkpointing instead of 3-level -c#undef AUTODIFF_2_LEVEL_CHECKPOINT +#undef AUTODIFF_2_LEVEL_CHECKPOINT C extend to 4-level checkpointing -c#undef AUTODIFF_4_LEVEL_CHECKPOINT +#undef AUTODIFF_4_LEVEL_CHECKPOINT C o use divided adjoint to split adjoint computations #undef ALLOW_DIVIDED_ADJOINT -#undef ALLOW_PACKUNPACK_METHOD2 - C o This flag is incredibly useful as it reduces the number of C tape-files on the disc. Maybe it should even be the default. #define ALLOW_AUTODIFF_WHTAPEIO +C and related to above: +#undef ALLOW_INIT_WHTAPEIO C o use standard MDSFINDUINTS instead of local pkg/autodiff version for C WHTAPEIO code I/O. @@ -70,6 +71,10 @@ C Might still be used for OBCS since WHTAPEIO does not support OBCS fields. C o allow using viscFacInAd to recompute viscosities in AD #define AUTODIFF_ALLOW_VISCFACADJ +C o To remove part of MOM_CALC_VISC (better name would be: MOM_DISABLE_*) +#undef AUTODIFF_DISABLE_LEITH +#undef AUTODIFF_DISABLE_REYNOLDS_SCALE + C o for output of AD-variables (ALLOW_AUTODIFF_MONITOR), specific code (e.g., C in addummy_in_stepping.F) relies on adexch_uv_xy_rs and adexch_xy_rs S/R C which might not always be generated by TAF (e.g., when controls do not diff --git a/verification/tutorial_global_oce_optim/code_ad/COST_OPTIONS.h b/verification/tutorial_global_oce_optim/code_ad/COST_OPTIONS.h index 71e4a3769c..0fcea3b802 100644 --- a/verification/tutorial_global_oce_optim/code_ad/COST_OPTIONS.h +++ b/verification/tutorial_global_oce_optim/code_ad/COST_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef COST_OPTIONS_H +#define COST_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: COST_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef COST_OPTIONS_H -#define COST_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_COST #ifdef ECCO_CPPOPTIONS_H @@ -26,53 +26,24 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -C >>> Use the EGM-96 geoid error covariance. -#undef ALLOW_EGM96_ERROR_COV -#undef ALLOW_READ_EGM_DATA +#undef ALLOW_COST_STATE_FINAL +#undef ALLOW_COST_VECTOR + C >>> Cost function contributions -#undef ALLOW_HFLUX_COST_CONTRIBUTION -#undef ALLOW_SFLUX_COST_CONTRIBUTION -#undef ALLOW_USTRESS_COST_CONTRIBUTION -#undef ALLOW_VSTRESS_COST_CONTRIBUTION -#undef ALLOW_THETA_COST_CONTRIBUTION -#undef ALLOW_SALT_COST_CONTRIBUTION -#undef ALLOW_SST_COST_CONTRIBUTION -#undef ALLOW_SSS_COST_CONTRIBUTION -#undef ALLOW_SSH_COST_CONTRIBUTION -#undef ALLOW_CTDT_COST_CONTRIBUTION -#undef ALLOW_CTDS_COST_CONTRIBUTION -#undef ALLOW_COST_ATLANTIC #undef ALLOW_COST_ATLANTIC_HEAT +#undef ALLOW_COST_ATLANTIC_HEAT_DOMASS #undef ALLOW_COST_TEST #undef ALLOW_COST_TSQUARED +#undef ALLOW_COST_DEPTH #undef ALLOW_COST_TRACER +C List these options here: #define ALLOW_COST_TEMP #define ALLOW_COST_HFLUXM - -C >>> ALLOW_GENCOST_CONTRIBUTION: interactive way to add basic 2D cost -C function terms. -C > In data.ecco, this requires the specification of data file (name, -C frequency, etc.), bar file name for corresp. model average, standard -C error file name, etc. -C > In addition, adding such cost terms requires editing ecco_cost.h to -C increase NGENCOST, and editing cost_gencost_customize.F to implement -C the actual model average (i.e. the bar file content). -#undef ALLOW_GENCOST_CONTRIBUTION -C >>> free form version of GENCOST: allows one to use otherwise defined -C elements (e.g. psbar and and topex data) while taking advantage of the -C cost function/namelist slots that can be made available using -C ALLOW_GENCOST_CONTRIBUTION. To this end ALLOW_GENCOST_CONTRIBUTION -C simply switches off tests that check whether all of the gencost -C elements (e.g. gencost_barfile and gencost_datafile) are specified -C in data.ecco. -C > While this option increases flexibility within the gencost framework, -C it implies more room for error, so it should be used cautiously, and -C with good knowledge of the rest of pkg/ecco. -C > It requires providing a specific cost function routine, and editing -C cost_gencost_all.F accordingly. -#undef ALLOW_GENCOST_FREEFORM +#undef ALLOW_DIC_COST +#undef ALLOW_THSICE_COST_TEST +#undef ALLOW_COST_SHELFICE C ================================================================== #endif /* ndef ECCO_CPPOPTIONS_H */ diff --git a/verification/tutorial_global_oce_optim/code_ad/CTRL_OPTIONS.h b/verification/tutorial_global_oce_optim/code_ad/CTRL_OPTIONS.h index 0d3058f7c6..d6ddebdb43 100644 --- a/verification/tutorial_global_oce_optim/code_ad/CTRL_OPTIONS.h +++ b/verification/tutorial_global_oce_optim/code_ad/CTRL_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef CTRL_OPTIONS_H +#define CTRL_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: CTRL_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef CTRL_OPTIONS_H -#define CTRL_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_CTRL #ifdef ECCO_CPPOPTIONS_H @@ -26,56 +26,68 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -C o Re-activate deprecated codes in pkg/ecco & pkg/ctrl (but not recommended) -C and since pkg/ctrl can be used without pkg/ecco, better to have it here -#undef ECCO_CTRL_DEPRECATED - -#undef EXCLUDE_CTRL_PACK +C o I/O and pack settings +#undef CTRL_SET_PREC_32 +C This option is only relevant (for pack/unpack) with OBCS_CONTROL: #undef ALLOW_NONDIMENSIONAL_CONTROL_IO +#undef EXCLUDE_CTRL_PACK #undef ALLOW_PACKUNPACK_METHOD2 - -C >>> Initial values. -#undef ALLOW_THETA0_CONTROL -#undef ALLOW_SALT0_CONTROL -#undef ALLOW_UVEL0_CONTROL -#undef ALLOW_VVEL0_CONTROL -#undef ALLOW_TR10_CONTROL -#undef ALLOW_TAUU0_CONTROL -#undef ALLOW_TAUV0_CONTROL -#undef ALLOW_SFLUX0_CONTROL -#undef ALLOW_HFLUX0_CONTROL -#undef ALLOW_SSS0_CONTROL -#undef ALLOW_SST0_CONTROL - -C >>> Surface fluxes. -#undef ALLOW_HFLUX_CONTROL -#undef ALLOW_SFLUX_CONTROL -#undef ALLOW_USTRESS_CONTROL -#undef ALLOW_VSTRESS_CONTROL -#undef ALLOW_SWFLUX_CONTROL -#undef ALLOW_LWFLUX_CONTROL - -C >>> Atmospheric state. -#undef ALLOW_ATEMP_CONTROL -#undef ALLOW_AQH_CONTROL -#undef ALLOW_UWIND_CONTROL -#undef ALLOW_VWIND_CONTROL -#undef ALLOW_PRECIP_CONTROL +#undef CTRL_DO_PACK_UNPACK_ONLY +#undef CTRL_PACK_PRECISE +#undef CTRL_UNPACK_PRECISE +#undef CTRL_DELZNORM +#undef ALLOW_CTRL_WETV C >>> Other Control. -#undef ALLOW_DIFFKR_CONTROL +C Allows for GMREDI controls #undef ALLOW_KAPGM_CONTROL #undef ALLOW_KAPREDI_CONTROL +C Allows for Vertical Diffusivity controls +#undef ALLOW_DIFFKR_CONTROL #undef ALLOW_BOTTOMDRAG_CONTROL - -C >>> Backward compatibility option (before checkpoint 65p) -#undef ALLOW_KAPGM_CONTROL_OLD -#undef ALLOW_KAPREDI_CONTROL_OLD +#undef ALLOW_DIC_CONTROL + +C Allows bathymetry as a control vector +C Note: keep this Option separated from generic control since this control +C involves many new dependencies that we would like to avoid in general. +#undef ALLOW_DEPTH_CONTROL +#ifdef ALLOW_DEPTH_CONTROL +C Only relevant within DEPTH_CONTROL code: +# define USE_SMOOTH_MIN +# undef ALLOW_HFACC_CONTROL +# undef ALLOW_HFACC3D_CONTROL +#endif /* ALLOW_DEPTH_CONTROL */ C >>> Generic Control. #undef ALLOW_GENARR2D_CONTROL #undef ALLOW_GENARR3D_CONTROL #define ALLOW_GENTIM2D_CONTROL +# undef ALLOW_UVEL0_CONTROL +# undef ALLOW_VVEL0_CONTROL +# undef CTRL_SET_OLD_MAXCVARS_30 +# undef CTRL_SET_OLD_MAXCVARS_40 + +C >>> Open boundaries +#ifdef ALLOW_OBCS +C Control of Open-Boundaries is meaningless without compiling pkg/obcs +C Note: Make sure that corresponding OBCS N/S/W/E Option is defined +# define ALLOW_OBCSN_CONTROL +# define ALLOW_OBCSS_CONTROL +# define ALLOW_OBCSW_CONTROL +# define ALLOW_OBCSE_CONTROL +# undef ALLOW_OBCS_CONTROL_MODES +#endif /* ALLOW_OBCS */ + +C o Set ALLOW_OBCS_CONTROL (Do not edit/modify): +#if (defined (ALLOW_OBCSN_CONTROL) || \ + defined (ALLOW_OBCSS_CONTROL) || \ + defined (ALLOW_OBCSW_CONTROL) || \ + defined (ALLOW_OBCSE_CONTROL)) +# define ALLOW_OBCS_CONTROL +#endif + +C o Impose bounds on controls +#undef ALLOW_ADCTRLBOUND C o Rotation of wind/stress controls adjustments C from Eastward/Northward to model grid directions @@ -87,19 +99,16 @@ C The CTRL_SKIP_FIRST_TWO_ATM_REC_ALL option extends this C to the other the time variable atmospheric controls. #undef CTRL_SKIP_FIRST_TWO_ATM_REC_ALL -C o use pkg/smooth correlation operator (incl. smoother) for 2D controls (Weaver, Courtier 01) -C This CPP option just sets the default for ctrlSmoothCorrel2D to .TRUE. -#undef ALLOW_SMOOTH_CORREL2D -C o use pkg/smooth correlation operator (incl. smoother) for 3D controls (Weaver, Courtier 01) -C This CPP option just sets the default for ctrlSmoothCorrel3D to .TRUE. -#undef ALLOW_SMOOTH_CORREL3D - -C o apply pkg/ctrl/ctrl_smooth.F to 2D controls (outside of ctrlSmoothCorrel2D) -#undef ALLOW_CTRL_SMOOTH -C o apply pkg/smooth/smooth_diff2d.F to 2D controls (outside of ctrlSmoothCorrel2D) +C Note: this flag turns on extra smoothing code in ctrl_get_gen.F which +C is inconsistent with the Weaver and Courtier, 2001 algorithm, and +C should probably not be used. The corresponding 3D flag applied only +C to deprecated code that is now removed. At some point we will remove +C this flag and associated code as well. +C o apply pkg/smooth/smooth_diff2d.F to 2D controls (outside of Smooth_Correl2D) #undef ALLOW_SMOOTH_CTRL2D -C o apply pkg/smooth/smooth_diff3d.F to 3D controls (outside of ctrlSmoothCorrel3D) -#undef ALLOW_SMOOTH_CTRL3D + +C o Print more debug info to STDOUT +#undef ALLOW_CTRL_DEBUG C ================================================================== #endif /* ndef ECCO_CPPOPTIONS_H */ diff --git a/verification/tutorial_global_oce_optim/code_oad/AUTODIFF_OPTIONS.h b/verification/tutorial_global_oce_optim/code_oad/AUTODIFF_OPTIONS.h index af5b15ecf7..85e0653c72 100644 --- a/verification/tutorial_global_oce_optim/code_oad/AUTODIFF_OPTIONS.h +++ b/verification/tutorial_global_oce_optim/code_oad/AUTODIFF_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef AUTODIFF_OPTIONS_H +#define AUTODIFF_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: AUTODIFF_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef AUTODIFF_OPTIONS_H -#define AUTODIFF_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_AUTODIFF #ifdef ECCO_CPPOPTIONS_H @@ -26,10 +26,11 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -C o Include/exclude code in order to be able to automatically -C differentiate the MITgcmUV by using the Tangent Linear and -C Adjoint Model Compiler (TAMC). +C o Include/exclude code in order to automatically differentiate MITgcm code +C using TAF (Transformation of Algorithms in Fortran, http://www.FastOpt.de) +C or using TAMC (Tangent Linear & Adjoint Model Compiler, needs both defined): #undef ALLOW_AUTODIFF_TAMC +#undef AUTODIFF_TAMC_COMPATIBILITY C >>> Checkpointing as handled by TAMC #define ALLOW_TAMC_CHECKPOINTING @@ -40,19 +41,19 @@ C >>> and DYNVARS_DIAG adjoint state #undef ALLOW_AUTODIFF_MONITOR_DIAG C >>> DO 2-level checkpointing instead of 3-level -c#undef AUTODIFF_2_LEVEL_CHECKPOINT +#undef AUTODIFF_2_LEVEL_CHECKPOINT C extend to 4-level checkpointing -c#undef AUTODIFF_4_LEVEL_CHECKPOINT +#undef AUTODIFF_4_LEVEL_CHECKPOINT C o use divided adjoint to split adjoint computations #undef ALLOW_DIVIDED_ADJOINT -#undef ALLOW_PACKUNPACK_METHOD2 - C o This flag is incredibly useful as it reduces the number of C tape-files on the disc. Maybe it should even be the default. #undef ALLOW_AUTODIFF_WHTAPEIO +C and related to above: +#undef ALLOW_INIT_WHTAPEIO C o use standard MDSFINDUINTS instead of local pkg/autodiff version for C WHTAPEIO code I/O. @@ -70,6 +71,10 @@ C Might still be used for OBCS since WHTAPEIO does not support OBCS fields. C o allow using viscFacInAd to recompute viscosities in AD #undef AUTODIFF_ALLOW_VISCFACADJ +C o To remove part of MOM_CALC_VISC (better name would be: MOM_DISABLE_*) +#undef AUTODIFF_DISABLE_LEITH +#undef AUTODIFF_DISABLE_REYNOLDS_SCALE + C o for output of AD-variables (ALLOW_AUTODIFF_MONITOR), specific code (e.g., C in addummy_in_stepping.F) relies on adexch_uv_xy_rs and adexch_xy_rs S/R C which might not always be generated by TAF (e.g., when controls do not diff --git a/verification/tutorial_global_oce_optim/code_oad/COST_OPTIONS.h b/verification/tutorial_global_oce_optim/code_oad/COST_OPTIONS.h index 71e4a3769c..0fcea3b802 100644 --- a/verification/tutorial_global_oce_optim/code_oad/COST_OPTIONS.h +++ b/verification/tutorial_global_oce_optim/code_oad/COST_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef COST_OPTIONS_H +#define COST_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: COST_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef COST_OPTIONS_H -#define COST_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_COST #ifdef ECCO_CPPOPTIONS_H @@ -26,53 +26,24 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -C >>> Use the EGM-96 geoid error covariance. -#undef ALLOW_EGM96_ERROR_COV -#undef ALLOW_READ_EGM_DATA +#undef ALLOW_COST_STATE_FINAL +#undef ALLOW_COST_VECTOR + C >>> Cost function contributions -#undef ALLOW_HFLUX_COST_CONTRIBUTION -#undef ALLOW_SFLUX_COST_CONTRIBUTION -#undef ALLOW_USTRESS_COST_CONTRIBUTION -#undef ALLOW_VSTRESS_COST_CONTRIBUTION -#undef ALLOW_THETA_COST_CONTRIBUTION -#undef ALLOW_SALT_COST_CONTRIBUTION -#undef ALLOW_SST_COST_CONTRIBUTION -#undef ALLOW_SSS_COST_CONTRIBUTION -#undef ALLOW_SSH_COST_CONTRIBUTION -#undef ALLOW_CTDT_COST_CONTRIBUTION -#undef ALLOW_CTDS_COST_CONTRIBUTION -#undef ALLOW_COST_ATLANTIC #undef ALLOW_COST_ATLANTIC_HEAT +#undef ALLOW_COST_ATLANTIC_HEAT_DOMASS #undef ALLOW_COST_TEST #undef ALLOW_COST_TSQUARED +#undef ALLOW_COST_DEPTH #undef ALLOW_COST_TRACER +C List these options here: #define ALLOW_COST_TEMP #define ALLOW_COST_HFLUXM - -C >>> ALLOW_GENCOST_CONTRIBUTION: interactive way to add basic 2D cost -C function terms. -C > In data.ecco, this requires the specification of data file (name, -C frequency, etc.), bar file name for corresp. model average, standard -C error file name, etc. -C > In addition, adding such cost terms requires editing ecco_cost.h to -C increase NGENCOST, and editing cost_gencost_customize.F to implement -C the actual model average (i.e. the bar file content). -#undef ALLOW_GENCOST_CONTRIBUTION -C >>> free form version of GENCOST: allows one to use otherwise defined -C elements (e.g. psbar and and topex data) while taking advantage of the -C cost function/namelist slots that can be made available using -C ALLOW_GENCOST_CONTRIBUTION. To this end ALLOW_GENCOST_CONTRIBUTION -C simply switches off tests that check whether all of the gencost -C elements (e.g. gencost_barfile and gencost_datafile) are specified -C in data.ecco. -C > While this option increases flexibility within the gencost framework, -C it implies more room for error, so it should be used cautiously, and -C with good knowledge of the rest of pkg/ecco. -C > It requires providing a specific cost function routine, and editing -C cost_gencost_all.F accordingly. -#undef ALLOW_GENCOST_FREEFORM +#undef ALLOW_DIC_COST +#undef ALLOW_THSICE_COST_TEST +#undef ALLOW_COST_SHELFICE C ================================================================== #endif /* ndef ECCO_CPPOPTIONS_H */ diff --git a/verification/tutorial_global_oce_optim/code_oad/CTRL_OPTIONS.h b/verification/tutorial_global_oce_optim/code_oad/CTRL_OPTIONS.h index 73527d41bc..a5ac67d5b3 100644 --- a/verification/tutorial_global_oce_optim/code_oad/CTRL_OPTIONS.h +++ b/verification/tutorial_global_oce_optim/code_oad/CTRL_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef CTRL_OPTIONS_H +#define CTRL_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: CTRL_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef CTRL_OPTIONS_H -#define CTRL_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_CTRL #ifdef ECCO_CPPOPTIONS_H @@ -26,56 +26,68 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -C o Re-activate deprecated codes in pkg/ecco & pkg/ctrl (but not recommended) -C and since pkg/ctrl can be used without pkg/ecco, better to have it here -#undef ECCO_CTRL_DEPRECATED - -#undef EXCLUDE_CTRL_PACK +C o I/O and pack settings +#undef CTRL_SET_PREC_32 +C This option is only relevant (for pack/unpack) with OBCS_CONTROL: #undef ALLOW_NONDIMENSIONAL_CONTROL_IO +#undef EXCLUDE_CTRL_PACK #undef ALLOW_PACKUNPACK_METHOD2 - -C >>> Initial values. -#undef ALLOW_THETA0_CONTROL -#undef ALLOW_SALT0_CONTROL -#undef ALLOW_UVEL0_CONTROL -#undef ALLOW_VVEL0_CONTROL -#undef ALLOW_TR10_CONTROL -#undef ALLOW_TAUU0_CONTROL -#undef ALLOW_TAUV0_CONTROL -#undef ALLOW_SFLUX0_CONTROL -#undef ALLOW_HFLUX0_CONTROL -#undef ALLOW_SSS0_CONTROL -#undef ALLOW_SST0_CONTROL - -C >>> Surface fluxes. -#undef ALLOW_HFLUX_CONTROL -#undef ALLOW_SFLUX_CONTROL -#undef ALLOW_USTRESS_CONTROL -#undef ALLOW_VSTRESS_CONTROL -#undef ALLOW_SWFLUX_CONTROL -#undef ALLOW_LWFLUX_CONTROL - -C >>> Atmospheric state. -#undef ALLOW_ATEMP_CONTROL -#undef ALLOW_AQH_CONTROL -#undef ALLOW_UWIND_CONTROL -#undef ALLOW_VWIND_CONTROL -#undef ALLOW_PRECIP_CONTROL +#undef CTRL_DO_PACK_UNPACK_ONLY +#undef CTRL_PACK_PRECISE +#undef CTRL_UNPACK_PRECISE +#undef CTRL_DELZNORM +#undef ALLOW_CTRL_WETV C >>> Other Control. -#undef ALLOW_DIFFKR_CONTROL +C Allows for GMREDI controls #undef ALLOW_KAPGM_CONTROL #undef ALLOW_KAPREDI_CONTROL +C Allows for Vertical Diffusivity controls +#undef ALLOW_DIFFKR_CONTROL #undef ALLOW_BOTTOMDRAG_CONTROL - -C >>> Backward compatibility option (before checkpoint 65p) -#undef ALLOW_KAPGM_CONTROL_OLD -#undef ALLOW_KAPREDI_CONTROL_OLD +#undef ALLOW_DIC_CONTROL + +C Allows bathymetry as a control vector +C Note: keep this Option separated from generic control since this control +C involves many new dependencies that we would like to avoid in general. +#undef ALLOW_DEPTH_CONTROL +#ifdef ALLOW_DEPTH_CONTROL +C Only relevant within DEPTH_CONTROL code: +# define USE_SMOOTH_MIN +# undef ALLOW_HFACC_CONTROL +# undef ALLOW_HFACC3D_CONTROL +#endif /* ALLOW_DEPTH_CONTROL */ C >>> Generic Control. #define ALLOW_GENARR2D_CONTROL #undef ALLOW_GENARR3D_CONTROL #undef ALLOW_GENTIM2D_CONTROL +# undef ALLOW_UVEL0_CONTROL +# undef ALLOW_VVEL0_CONTROL +# undef CTRL_SET_OLD_MAXCVARS_30 +# undef CTRL_SET_OLD_MAXCVARS_40 + +C >>> Open boundaries +#ifdef ALLOW_OBCS +C Control of Open-Boundaries is meaningless without compiling pkg/obcs +C Note: Make sure that corresponding OBCS N/S/W/E Option is defined +# define ALLOW_OBCSN_CONTROL +# define ALLOW_OBCSS_CONTROL +# define ALLOW_OBCSW_CONTROL +# define ALLOW_OBCSE_CONTROL +# undef ALLOW_OBCS_CONTROL_MODES +#endif /* ALLOW_OBCS */ + +C o Set ALLOW_OBCS_CONTROL (Do not edit/modify): +#if (defined (ALLOW_OBCSN_CONTROL) || \ + defined (ALLOW_OBCSS_CONTROL) || \ + defined (ALLOW_OBCSW_CONTROL) || \ + defined (ALLOW_OBCSE_CONTROL)) +# define ALLOW_OBCS_CONTROL +#endif + +C o Impose bounds on controls +#undef ALLOW_ADCTRLBOUND C o Rotation of wind/stress controls adjustments C from Eastward/Northward to model grid directions @@ -87,19 +99,16 @@ C The CTRL_SKIP_FIRST_TWO_ATM_REC_ALL option extends this C to the other the time variable atmospheric controls. #undef CTRL_SKIP_FIRST_TWO_ATM_REC_ALL -C o use pkg/smooth correlation operator (incl. smoother) for 2D controls (Weaver, Courtier 01) -C This CPP option just sets the default for ctrlSmoothCorrel2D to .TRUE. -#undef ALLOW_SMOOTH_CORREL2D -C o use pkg/smooth correlation operator (incl. smoother) for 3D controls (Weaver, Courtier 01) -C This CPP option just sets the default for ctrlSmoothCorrel3D to .TRUE. -#undef ALLOW_SMOOTH_CORREL3D - -C o apply pkg/ctrl/ctrl_smooth.F to 2D controls (outside of ctrlSmoothCorrel2D) -#undef ALLOW_CTRL_SMOOTH -C o apply pkg/smooth/smooth_diff2d.F to 2D controls (outside of ctrlSmoothCorrel2D) +C Note: this flag turns on extra smoothing code in ctrl_get_gen.F which +C is inconsistent with the Weaver and Courtier, 2001 algorithm, and +C should probably not be used. The corresponding 3D flag applied only +C to deprecated code that is now removed. At some point we will remove +C this flag and associated code as well. +C o apply pkg/smooth/smooth_diff2d.F to 2D controls (outside of Smooth_Correl2D) #undef ALLOW_SMOOTH_CTRL2D -C o apply pkg/smooth/smooth_diff3d.F to 3D controls (outside of ctrlSmoothCorrel3D) -#undef ALLOW_SMOOTH_CTRL3D + +C o Print more debug info to STDOUT +#undef ALLOW_CTRL_DEBUG C ================================================================== #endif /* ndef ECCO_CPPOPTIONS_H */ diff --git a/verification/tutorial_tracer_adjsens/code_ad/AUTODIFF_OPTIONS.h b/verification/tutorial_tracer_adjsens/code_ad/AUTODIFF_OPTIONS.h index 50a27202c6..f182285ca4 100644 --- a/verification/tutorial_tracer_adjsens/code_ad/AUTODIFF_OPTIONS.h +++ b/verification/tutorial_tracer_adjsens/code_ad/AUTODIFF_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef AUTODIFF_OPTIONS_H +#define AUTODIFF_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: AUTODIFF_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef AUTODIFF_OPTIONS_H -#define AUTODIFF_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_AUTODIFF #ifdef ECCO_CPPOPTIONS_H @@ -26,10 +26,11 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -C o Include/exclude code in order to be able to automatically -C differentiate the MITgcmUV by using the Tangent Linear and -C Adjoint Model Compiler (TAMC). +C o Include/exclude code in order to automatically differentiate MITgcm code +C using TAF (Transformation of Algorithms in Fortran, http://www.FastOpt.de) +C or using TAMC (Tangent Linear & Adjoint Model Compiler, needs both defined): #define ALLOW_AUTODIFF_TAMC +#undef AUTODIFF_TAMC_COMPATIBILITY C >>> Checkpointing as handled by TAMC #define ALLOW_TAMC_CHECKPOINTING @@ -43,16 +44,16 @@ C >>> DO 2-level checkpointing instead of 3-level #define AUTODIFF_2_LEVEL_CHECKPOINT C extend to 4-level checkpointing -c#undef AUTODIFF_4_LEVEL_CHECKPOINT +#undef AUTODIFF_4_LEVEL_CHECKPOINT C o use divided adjoint to split adjoint computations #undef ALLOW_DIVIDED_ADJOINT -#undef ALLOW_PACKUNPACK_METHOD2 - C o This flag is incredibly useful as it reduces the number of C tape-files on the disc. Maybe it should even be the default. #define ALLOW_AUTODIFF_WHTAPEIO +C and related to above: +#undef ALLOW_INIT_WHTAPEIO C o use standard MDSFINDUINTS instead of local pkg/autodiff version for C WHTAPEIO code I/O. @@ -70,6 +71,10 @@ C Might still be used for OBCS since WHTAPEIO does not support OBCS fields. C o allow using viscFacInAd to recompute viscosities in AD #undef AUTODIFF_ALLOW_VISCFACADJ +C o To remove part of MOM_CALC_VISC (better name would be: MOM_DISABLE_*) +#undef AUTODIFF_DISABLE_LEITH +#undef AUTODIFF_DISABLE_REYNOLDS_SCALE + C o for output of AD-variables (ALLOW_AUTODIFF_MONITOR), specific code (e.g., C in addummy_in_stepping.F) relies on adexch_uv_xy_rs and adexch_xy_rs S/R C which might not always be generated by TAF (e.g., when controls do not diff --git a/verification/tutorial_tracer_adjsens/code_ad/COST_OPTIONS.h b/verification/tutorial_tracer_adjsens/code_ad/COST_OPTIONS.h index 6b6a159873..aeeb0b0efe 100644 --- a/verification/tutorial_tracer_adjsens/code_ad/COST_OPTIONS.h +++ b/verification/tutorial_tracer_adjsens/code_ad/COST_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef COST_OPTIONS_H +#define COST_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: COST_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef COST_OPTIONS_H -#define COST_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_COST #ifdef ECCO_CPPOPTIONS_H @@ -26,50 +26,24 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -C >>> Use the EGM-96 geoid error covariance. -#undef ALLOW_EGM96_ERROR_COV -#undef ALLOW_READ_EGM_DATA +#undef ALLOW_COST_STATE_FINAL +#undef ALLOW_COST_VECTOR + C >>> Cost function contributions -#undef ALLOW_HFLUX_COST_CONTRIBUTION -#undef ALLOW_SFLUX_COST_CONTRIBUTION -#undef ALLOW_USTRESS_COST_CONTRIBUTION -#undef ALLOW_VSTRESS_COST_CONTRIBUTION -#undef ALLOW_THETA_COST_CONTRIBUTION -#undef ALLOW_SALT_COST_CONTRIBUTION -#undef ALLOW_SST_COST_CONTRIBUTION -#undef ALLOW_SSS_COST_CONTRIBUTION -#undef ALLOW_SSH_COST_CONTRIBUTION -#undef ALLOW_CTDT_COST_CONTRIBUTION -#undef ALLOW_CTDS_COST_CONTRIBUTION -#undef ALLOW_COST_ATLANTIC #undef ALLOW_COST_ATLANTIC_HEAT +#undef ALLOW_COST_ATLANTIC_HEAT_DOMASS #undef ALLOW_COST_TEST #undef ALLOW_COST_TSQUARED +#undef ALLOW_COST_DEPTH #define ALLOW_COST_TRACER -C >>> ALLOW_GENCOST_CONTRIBUTION: interactive way to add basic 2D cost -C function terms. -C > In data.ecco, this requires the specification of data file (name, -C frequency, etc.), bar file name for corresp. model average, standard -C error file name, etc. -C > In addition, adding such cost terms requires editing ecco_cost.h to -C increase NGENCOST, and editing cost_gencost_customize.F to implement -C the actual model average (i.e. the bar file content). -#undef ALLOW_GENCOST_CONTRIBUTION -C >>> free form version of GENCOST: allows one to use otherwise defined -C elements (e.g. psbar and and topex data) while taking advantage of the -C cost function/namelist slots that can be made available using -C ALLOW_GENCOST_CONTRIBUTION. To this end ALLOW_GENCOST_CONTRIBUTION -C simply switches off tests that check whether all of the gencost -C elements (e.g. gencost_barfile and gencost_datafile) are specified -C in data.ecco. -C > While this option increases flexibility within the gencost framework, -C it implies more room for error, so it should be used cautiously, and -C with good knowledge of the rest of pkg/ecco. -C > It requires providing a specific cost function routine, and editing -C cost_gencost_all.F accordingly. -#undef ALLOW_GENCOST_FREEFORM +C List these options here: +#undef ALLOW_COST_TEMP +#undef ALLOW_COST_HFLUXM +#undef ALLOW_DIC_COST +#undef ALLOW_THSICE_COST_TEST +#undef ALLOW_COST_SHELFICE C ================================================================== #endif /* ndef ECCO_CPPOPTIONS_H */ diff --git a/verification/tutorial_tracer_adjsens/code_ad/CTRL_OPTIONS.h b/verification/tutorial_tracer_adjsens/code_ad/CTRL_OPTIONS.h index d19f9e3877..94652675e5 100644 --- a/verification/tutorial_tracer_adjsens/code_ad/CTRL_OPTIONS.h +++ b/verification/tutorial_tracer_adjsens/code_ad/CTRL_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef CTRL_OPTIONS_H +#define CTRL_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: CTRL_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef CTRL_OPTIONS_H -#define CTRL_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_CTRL #ifdef ECCO_CPPOPTIONS_H @@ -26,31 +26,89 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -#define EXCLUDE_CTRL_PACK +C o I/O and pack settings +#undef CTRL_SET_PREC_32 +C This option is only relevant (for pack/unpack) with OBCS_CONTROL: #undef ALLOW_NONDIMENSIONAL_CONTROL_IO +#define EXCLUDE_CTRL_PACK +#undef ALLOW_PACKUNPACK_METHOD2 +#undef CTRL_DO_PACK_UNPACK_ONLY +#undef CTRL_PACK_PRECISE +#undef CTRL_UNPACK_PRECISE +#undef CTRL_DELZNORM +#undef ALLOW_CTRL_WETV + +C >>> Other Control. +C Allows for GMREDI controls +#undef ALLOW_KAPGM_CONTROL +#undef ALLOW_KAPREDI_CONTROL +C Allows for Vertical Diffusivity controls +#undef ALLOW_DIFFKR_CONTROL +#undef ALLOW_BOTTOMDRAG_CONTROL +#undef ALLOW_DIC_CONTROL + +C Allows bathymetry as a control vector +C Note: keep this Option separated from generic control since this control +C involves many new dependencies that we would like to avoid in general. +#undef ALLOW_DEPTH_CONTROL +#ifdef ALLOW_DEPTH_CONTROL +C Only relevant within DEPTH_CONTROL code: +# define USE_SMOOTH_MIN +# undef ALLOW_HFACC_CONTROL +# undef ALLOW_HFACC3D_CONTROL +#endif /* ALLOW_DEPTH_CONTROL */ C >>> Generic Control. #undef ALLOW_GENARR2D_CONTROL #define ALLOW_GENARR3D_CONTROL #undef ALLOW_GENTIM2D_CONTROL +# undef ALLOW_UVEL0_CONTROL +# undef ALLOW_VVEL0_CONTROL +# undef CTRL_SET_OLD_MAXCVARS_30 +# undef CTRL_SET_OLD_MAXCVARS_40 + +C >>> Open boundaries +#ifdef ALLOW_OBCS +C Control of Open-Boundaries is meaningless without compiling pkg/obcs +C Note: Make sure that corresponding OBCS N/S/W/E Option is defined +# define ALLOW_OBCSN_CONTROL +# define ALLOW_OBCSS_CONTROL +# define ALLOW_OBCSW_CONTROL +# define ALLOW_OBCSE_CONTROL +# undef ALLOW_OBCS_CONTROL_MODES +#endif /* ALLOW_OBCS */ + +C o Set ALLOW_OBCS_CONTROL (Do not edit/modify): +#if (defined (ALLOW_OBCSN_CONTROL) || \ + defined (ALLOW_OBCSS_CONTROL) || \ + defined (ALLOW_OBCSW_CONTROL) || \ + defined (ALLOW_OBCSE_CONTROL)) +# define ALLOW_OBCS_CONTROL +#endif + +C o Impose bounds on controls +#undef ALLOW_ADCTRLBOUND C o Rotation of wind/stress controls adjustments C from Eastward/Northward to model grid directions #undef ALLOW_ROTATE_UV_CONTROLS -C o use pkg/smooth correlation operator (incl. smoother) for 2D controls (Weaver, Courtier 01) -C This CPP option just sets the default for ctrlSmoothCorrel2D to .TRUE. -#undef ALLOW_SMOOTH_CORREL2D -C o use pkg/smooth correlation operator (incl. smoother) for 3D controls (Weaver, Courtier 01) -C This CPP option just sets the default for ctrlSmoothCorrel3D to .TRUE. -#undef ALLOW_SMOOTH_CORREL3D +C o Originally the first two time-reccords of control +C variable tau u and tau v were skipped. +C The CTRL_SKIP_FIRST_TWO_ATM_REC_ALL option extends this +C to the other the time variable atmospheric controls. +#undef CTRL_SKIP_FIRST_TWO_ATM_REC_ALL -C o apply pkg/ctrl/ctrl_smooth.F to 2D controls (outside of ctrlSmoothCorrel2D) -#undef ALLOW_CTRL_SMOOTH -C o apply pkg/smooth/smooth_diff2d.F to 2D controls (outside of ctrlSmoothCorrel2D) +C Note: this flag turns on extra smoothing code in ctrl_get_gen.F which +C is inconsistent with the Weaver and Courtier, 2001 algorithm, and +C should probably not be used. The corresponding 3D flag applied only +C to deprecated code that is now removed. At some point we will remove +C this flag and associated code as well. +C o apply pkg/smooth/smooth_diff2d.F to 2D controls (outside of Smooth_Correl2D) #undef ALLOW_SMOOTH_CTRL2D -C o apply pkg/smooth/smooth_diff3d.F to 3D controls (outside of ctrlSmoothCorrel3D) -#undef ALLOW_SMOOTH_CTRL3D + +C o Print more debug info to STDOUT +#undef ALLOW_CTRL_DEBUG C ================================================================== #endif /* ndef ECCO_CPPOPTIONS_H */ diff --git a/verification/tutorial_tracer_adjsens/code_oad/AUTODIFF_OPTIONS.h b/verification/tutorial_tracer_adjsens/code_oad/AUTODIFF_OPTIONS.h index 9f494e7955..85e0653c72 100644 --- a/verification/tutorial_tracer_adjsens/code_oad/AUTODIFF_OPTIONS.h +++ b/verification/tutorial_tracer_adjsens/code_oad/AUTODIFF_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef AUTODIFF_OPTIONS_H +#define AUTODIFF_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: AUTODIFF_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef AUTODIFF_OPTIONS_H -#define AUTODIFF_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_AUTODIFF #ifdef ECCO_CPPOPTIONS_H @@ -26,10 +26,11 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -C o Include/exclude code in order to be able to automatically -C differentiate the MITgcmUV by using the Tangent Linear and -C Adjoint Model Compiler (TAMC). +C o Include/exclude code in order to automatically differentiate MITgcm code +C using TAF (Transformation of Algorithms in Fortran, http://www.FastOpt.de) +C or using TAMC (Tangent Linear & Adjoint Model Compiler, needs both defined): #undef ALLOW_AUTODIFF_TAMC +#undef AUTODIFF_TAMC_COMPATIBILITY C >>> Checkpointing as handled by TAMC #define ALLOW_TAMC_CHECKPOINTING @@ -40,19 +41,19 @@ C >>> and DYNVARS_DIAG adjoint state #undef ALLOW_AUTODIFF_MONITOR_DIAG C >>> DO 2-level checkpointing instead of 3-level -c#undef AUTODIFF_2_LEVEL_CHECKPOINT +#undef AUTODIFF_2_LEVEL_CHECKPOINT C extend to 4-level checkpointing -c#undef AUTODIFF_4_LEVEL_CHECKPOINT +#undef AUTODIFF_4_LEVEL_CHECKPOINT C o use divided adjoint to split adjoint computations #undef ALLOW_DIVIDED_ADJOINT -#undef ALLOW_PACKUNPACK_METHOD2 - C o This flag is incredibly useful as it reduces the number of C tape-files on the disc. Maybe it should even be the default. #undef ALLOW_AUTODIFF_WHTAPEIO +C and related to above: +#undef ALLOW_INIT_WHTAPEIO C o use standard MDSFINDUINTS instead of local pkg/autodiff version for C WHTAPEIO code I/O. @@ -67,12 +68,13 @@ C Might still be used for OBCS since WHTAPEIO does not support OBCS fields. #undef AUTODIFF_USE_STORE_RESTORE #undef AUTODIFF_USE_STORE_RESTORE_OBCS -C o write separate tape files for each ptracer (has no effect, to be removed) -#undef AUTODIFF_PTRACERS_SPLIT_FILES - C o allow using viscFacInAd to recompute viscosities in AD #undef AUTODIFF_ALLOW_VISCFACADJ +C o To remove part of MOM_CALC_VISC (better name would be: MOM_DISABLE_*) +#undef AUTODIFF_DISABLE_LEITH +#undef AUTODIFF_DISABLE_REYNOLDS_SCALE + C o for output of AD-variables (ALLOW_AUTODIFF_MONITOR), specific code (e.g., C in addummy_in_stepping.F) relies on adexch_uv_xy_rs and adexch_xy_rs S/R C which might not always be generated by TAF (e.g., when controls do not diff --git a/verification/tutorial_tracer_adjsens/code_oad/COST_OPTIONS.h b/verification/tutorial_tracer_adjsens/code_oad/COST_OPTIONS.h index 6b6a159873..aeeb0b0efe 100644 --- a/verification/tutorial_tracer_adjsens/code_oad/COST_OPTIONS.h +++ b/verification/tutorial_tracer_adjsens/code_oad/COST_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef COST_OPTIONS_H +#define COST_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: COST_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef COST_OPTIONS_H -#define COST_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_COST #ifdef ECCO_CPPOPTIONS_H @@ -26,50 +26,24 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -C >>> Use the EGM-96 geoid error covariance. -#undef ALLOW_EGM96_ERROR_COV -#undef ALLOW_READ_EGM_DATA +#undef ALLOW_COST_STATE_FINAL +#undef ALLOW_COST_VECTOR + C >>> Cost function contributions -#undef ALLOW_HFLUX_COST_CONTRIBUTION -#undef ALLOW_SFLUX_COST_CONTRIBUTION -#undef ALLOW_USTRESS_COST_CONTRIBUTION -#undef ALLOW_VSTRESS_COST_CONTRIBUTION -#undef ALLOW_THETA_COST_CONTRIBUTION -#undef ALLOW_SALT_COST_CONTRIBUTION -#undef ALLOW_SST_COST_CONTRIBUTION -#undef ALLOW_SSS_COST_CONTRIBUTION -#undef ALLOW_SSH_COST_CONTRIBUTION -#undef ALLOW_CTDT_COST_CONTRIBUTION -#undef ALLOW_CTDS_COST_CONTRIBUTION -#undef ALLOW_COST_ATLANTIC #undef ALLOW_COST_ATLANTIC_HEAT +#undef ALLOW_COST_ATLANTIC_HEAT_DOMASS #undef ALLOW_COST_TEST #undef ALLOW_COST_TSQUARED +#undef ALLOW_COST_DEPTH #define ALLOW_COST_TRACER -C >>> ALLOW_GENCOST_CONTRIBUTION: interactive way to add basic 2D cost -C function terms. -C > In data.ecco, this requires the specification of data file (name, -C frequency, etc.), bar file name for corresp. model average, standard -C error file name, etc. -C > In addition, adding such cost terms requires editing ecco_cost.h to -C increase NGENCOST, and editing cost_gencost_customize.F to implement -C the actual model average (i.e. the bar file content). -#undef ALLOW_GENCOST_CONTRIBUTION -C >>> free form version of GENCOST: allows one to use otherwise defined -C elements (e.g. psbar and and topex data) while taking advantage of the -C cost function/namelist slots that can be made available using -C ALLOW_GENCOST_CONTRIBUTION. To this end ALLOW_GENCOST_CONTRIBUTION -C simply switches off tests that check whether all of the gencost -C elements (e.g. gencost_barfile and gencost_datafile) are specified -C in data.ecco. -C > While this option increases flexibility within the gencost framework, -C it implies more room for error, so it should be used cautiously, and -C with good knowledge of the rest of pkg/ecco. -C > It requires providing a specific cost function routine, and editing -C cost_gencost_all.F accordingly. -#undef ALLOW_GENCOST_FREEFORM +C List these options here: +#undef ALLOW_COST_TEMP +#undef ALLOW_COST_HFLUXM +#undef ALLOW_DIC_COST +#undef ALLOW_THSICE_COST_TEST +#undef ALLOW_COST_SHELFICE C ================================================================== #endif /* ndef ECCO_CPPOPTIONS_H */ diff --git a/verification/tutorial_tracer_adjsens/code_oad/CTRL_OPTIONS.h b/verification/tutorial_tracer_adjsens/code_oad/CTRL_OPTIONS.h index 1197de9b97..fadf7c6a86 100644 --- a/verification/tutorial_tracer_adjsens/code_oad/CTRL_OPTIONS.h +++ b/verification/tutorial_tracer_adjsens/code_oad/CTRL_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef CTRL_OPTIONS_H +#define CTRL_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: CTRL_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef CTRL_OPTIONS_H -#define CTRL_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_CTRL #ifdef ECCO_CPPOPTIONS_H @@ -26,37 +26,89 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -#define EXCLUDE_CTRL_PACK +C o I/O and pack settings +#undef CTRL_SET_PREC_32 +C This option is only relevant (for pack/unpack) with OBCS_CONTROL: #undef ALLOW_NONDIMENSIONAL_CONTROL_IO +#define EXCLUDE_CTRL_PACK +#undef ALLOW_PACKUNPACK_METHOD2 +#undef CTRL_DO_PACK_UNPACK_ONLY +#undef CTRL_PACK_PRECISE +#undef CTRL_UNPACK_PRECISE +#undef CTRL_DELZNORM +#undef ALLOW_CTRL_WETV C >>> Other Control. -#define ALLOW_DIFFKR_CONTROL +C Allows for GMREDI controls #undef ALLOW_KAPGM_CONTROL #undef ALLOW_KAPREDI_CONTROL +C Allows for Vertical Diffusivity controls +#define ALLOW_DIFFKR_CONTROL #undef ALLOW_BOTTOMDRAG_CONTROL +#undef ALLOW_DIC_CONTROL + +C Allows bathymetry as a control vector +C Note: keep this Option separated from generic control since this control +C involves many new dependencies that we would like to avoid in general. +#undef ALLOW_DEPTH_CONTROL +#ifdef ALLOW_DEPTH_CONTROL +C Only relevant within DEPTH_CONTROL code: +# define USE_SMOOTH_MIN +# undef ALLOW_HFACC_CONTROL +# undef ALLOW_HFACC3D_CONTROL +#endif /* ALLOW_DEPTH_CONTROL */ C >>> Generic Control. #define ALLOW_GENARR2D_CONTROL #define ALLOW_GENARR3D_CONTROL #undef ALLOW_GENTIM2D_CONTROL +# undef ALLOW_UVEL0_CONTROL +# undef ALLOW_VVEL0_CONTROL +# undef CTRL_SET_OLD_MAXCVARS_30 +# undef CTRL_SET_OLD_MAXCVARS_40 + +C >>> Open boundaries +#ifdef ALLOW_OBCS +C Control of Open-Boundaries is meaningless without compiling pkg/obcs +C Note: Make sure that corresponding OBCS N/S/W/E Option is defined +# define ALLOW_OBCSN_CONTROL +# define ALLOW_OBCSS_CONTROL +# define ALLOW_OBCSW_CONTROL +# define ALLOW_OBCSE_CONTROL +# undef ALLOW_OBCS_CONTROL_MODES +#endif /* ALLOW_OBCS */ + +C o Set ALLOW_OBCS_CONTROL (Do not edit/modify): +#if (defined (ALLOW_OBCSN_CONTROL) || \ + defined (ALLOW_OBCSS_CONTROL) || \ + defined (ALLOW_OBCSW_CONTROL) || \ + defined (ALLOW_OBCSE_CONTROL)) +# define ALLOW_OBCS_CONTROL +#endif + +C o Impose bounds on controls +#undef ALLOW_ADCTRLBOUND C o Rotation of wind/stress controls adjustments C from Eastward/Northward to model grid directions #undef ALLOW_ROTATE_UV_CONTROLS -C o use pkg/smooth correlation operator (incl. smoother) for 2D controls (Weaver, Courtier 01) -C This CPP option just sets the default for ctrlSmoothCorrel2D to .TRUE. -#undef ALLOW_SMOOTH_CORREL2D -C o use pkg/smooth correlation operator (incl. smoother) for 3D controls (Weaver, Courtier 01) -C This CPP option just sets the default for ctrlSmoothCorrel3D to .TRUE. -#undef ALLOW_SMOOTH_CORREL3D +C o Originally the first two time-reccords of control +C variable tau u and tau v were skipped. +C The CTRL_SKIP_FIRST_TWO_ATM_REC_ALL option extends this +C to the other the time variable atmospheric controls. +#undef CTRL_SKIP_FIRST_TWO_ATM_REC_ALL -C o apply pkg/ctrl/ctrl_smooth.F to 2D controls (outside of ctrlSmoothCorrel2D) -#undef ALLOW_CTRL_SMOOTH -C o apply pkg/smooth/smooth_diff2d.F to 2D controls (outside of ctrlSmoothCorrel2D) +C Note: this flag turns on extra smoothing code in ctrl_get_gen.F which +C is inconsistent with the Weaver and Courtier, 2001 algorithm, and +C should probably not be used. The corresponding 3D flag applied only +C to deprecated code that is now removed. At some point we will remove +C this flag and associated code as well. +C o apply pkg/smooth/smooth_diff2d.F to 2D controls (outside of Smooth_Correl2D) #undef ALLOW_SMOOTH_CTRL2D -C o apply pkg/smooth/smooth_diff3d.F to 3D controls (outside of ctrlSmoothCorrel3D) -#undef ALLOW_SMOOTH_CTRL3D + +C o Print more debug info to STDOUT +#undef ALLOW_CTRL_DEBUG C ================================================================== #endif /* ndef ECCO_CPPOPTIONS_H */ diff --git a/verification/tutorial_tracer_adjsens/code_tap/AUTODIFF_OPTIONS.h b/verification/tutorial_tracer_adjsens/code_tap/AUTODIFF_OPTIONS.h index 7339a3b301..b9b62682c6 100644 --- a/verification/tutorial_tracer_adjsens/code_tap/AUTODIFF_OPTIONS.h +++ b/verification/tutorial_tracer_adjsens/code_tap/AUTODIFF_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef AUTODIFF_OPTIONS_H +#define AUTODIFF_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: AUTODIFF_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef AUTODIFF_OPTIONS_H -#define AUTODIFF_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_AUTODIFF #ifdef ECCO_CPPOPTIONS_H @@ -26,10 +26,11 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -C o Include/exclude code in order to be able to automatically -C differentiate the MITgcmUV by using the Tangent Linear and -C Adjoint Model Compiler (TAMC). +C o Include/exclude code in order to automatically differentiate MITgcm code +C using TAF (Transformation of Algorithms in Fortran, http://www.FastOpt.de) +C or using TAMC (Tangent Linear & Adjoint Model Compiler, needs both defined): #undef ALLOW_AUTODIFF_TAMC +#undef AUTODIFF_TAMC_COMPATIBILITY C >>> Checkpointing as handled by TAMC #undef ALLOW_TAMC_CHECKPOINTING @@ -40,19 +41,19 @@ C >>> and DYNVARS_DIAG adjoint state #undef ALLOW_AUTODIFF_MONITOR_DIAG C >>> DO 2-level checkpointing instead of 3-level -c#undef AUTODIFF_2_LEVEL_CHECKPOINT +#undef AUTODIFF_2_LEVEL_CHECKPOINT C extend to 4-level checkpointing -c#undef AUTODIFF_4_LEVEL_CHECKPOINT +#undef AUTODIFF_4_LEVEL_CHECKPOINT C o use divided adjoint to split adjoint computations #undef ALLOW_DIVIDED_ADJOINT -#undef ALLOW_PACKUNPACK_METHOD2 - C o This flag is incredibly useful as it reduces the number of C tape-files on the disc. Maybe it should even be the default. #undef ALLOW_AUTODIFF_WHTAPEIO +C and related to above: +#undef ALLOW_INIT_WHTAPEIO C o use standard MDSFINDUINTS instead of local pkg/autodiff version for C WHTAPEIO code I/O. @@ -67,12 +68,13 @@ C Might still be used for OBCS since WHTAPEIO does not support OBCS fields. #undef AUTODIFF_USE_STORE_RESTORE #undef AUTODIFF_USE_STORE_RESTORE_OBCS -C o write separate tape files for each ptracer (has no effect, to be removed) -#undef AUTODIFF_PTRACERS_SPLIT_FILES - C o allow using viscFacInAd to recompute viscosities in AD #undef AUTODIFF_ALLOW_VISCFACADJ +C o To remove part of MOM_CALC_VISC (better name would be: MOM_DISABLE_*) +#undef AUTODIFF_DISABLE_LEITH +#undef AUTODIFF_DISABLE_REYNOLDS_SCALE + C o for output of AD-variables (ALLOW_AUTODIFF_MONITOR), specific code (e.g., C in addummy_in_stepping.F) relies on adexch_uv_xy_rs and adexch_xy_rs S/R C which might not always be generated by TAF (e.g., when controls do not diff --git a/verification/tutorial_tracer_adjsens/code_tap/COST_OPTIONS.h b/verification/tutorial_tracer_adjsens/code_tap/COST_OPTIONS.h index 6b6a159873..aeeb0b0efe 100644 --- a/verification/tutorial_tracer_adjsens/code_tap/COST_OPTIONS.h +++ b/verification/tutorial_tracer_adjsens/code_tap/COST_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef COST_OPTIONS_H +#define COST_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: COST_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef COST_OPTIONS_H -#define COST_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_COST #ifdef ECCO_CPPOPTIONS_H @@ -26,50 +26,24 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -C >>> Use the EGM-96 geoid error covariance. -#undef ALLOW_EGM96_ERROR_COV -#undef ALLOW_READ_EGM_DATA +#undef ALLOW_COST_STATE_FINAL +#undef ALLOW_COST_VECTOR + C >>> Cost function contributions -#undef ALLOW_HFLUX_COST_CONTRIBUTION -#undef ALLOW_SFLUX_COST_CONTRIBUTION -#undef ALLOW_USTRESS_COST_CONTRIBUTION -#undef ALLOW_VSTRESS_COST_CONTRIBUTION -#undef ALLOW_THETA_COST_CONTRIBUTION -#undef ALLOW_SALT_COST_CONTRIBUTION -#undef ALLOW_SST_COST_CONTRIBUTION -#undef ALLOW_SSS_COST_CONTRIBUTION -#undef ALLOW_SSH_COST_CONTRIBUTION -#undef ALLOW_CTDT_COST_CONTRIBUTION -#undef ALLOW_CTDS_COST_CONTRIBUTION -#undef ALLOW_COST_ATLANTIC #undef ALLOW_COST_ATLANTIC_HEAT +#undef ALLOW_COST_ATLANTIC_HEAT_DOMASS #undef ALLOW_COST_TEST #undef ALLOW_COST_TSQUARED +#undef ALLOW_COST_DEPTH #define ALLOW_COST_TRACER -C >>> ALLOW_GENCOST_CONTRIBUTION: interactive way to add basic 2D cost -C function terms. -C > In data.ecco, this requires the specification of data file (name, -C frequency, etc.), bar file name for corresp. model average, standard -C error file name, etc. -C > In addition, adding such cost terms requires editing ecco_cost.h to -C increase NGENCOST, and editing cost_gencost_customize.F to implement -C the actual model average (i.e. the bar file content). -#undef ALLOW_GENCOST_CONTRIBUTION -C >>> free form version of GENCOST: allows one to use otherwise defined -C elements (e.g. psbar and and topex data) while taking advantage of the -C cost function/namelist slots that can be made available using -C ALLOW_GENCOST_CONTRIBUTION. To this end ALLOW_GENCOST_CONTRIBUTION -C simply switches off tests that check whether all of the gencost -C elements (e.g. gencost_barfile and gencost_datafile) are specified -C in data.ecco. -C > While this option increases flexibility within the gencost framework, -C it implies more room for error, so it should be used cautiously, and -C with good knowledge of the rest of pkg/ecco. -C > It requires providing a specific cost function routine, and editing -C cost_gencost_all.F accordingly. -#undef ALLOW_GENCOST_FREEFORM +C List these options here: +#undef ALLOW_COST_TEMP +#undef ALLOW_COST_HFLUXM +#undef ALLOW_DIC_COST +#undef ALLOW_THSICE_COST_TEST +#undef ALLOW_COST_SHELFICE C ================================================================== #endif /* ndef ECCO_CPPOPTIONS_H */ diff --git a/verification/tutorial_tracer_adjsens/code_tap/CTRL_OPTIONS.h b/verification/tutorial_tracer_adjsens/code_tap/CTRL_OPTIONS.h index 9e8569d4b7..e2bf952640 100644 --- a/verification/tutorial_tracer_adjsens/code_tap/CTRL_OPTIONS.h +++ b/verification/tutorial_tracer_adjsens/code_tap/CTRL_OPTIONS.h @@ -1,3 +1,8 @@ +#ifndef CTRL_OPTIONS_H +#define CTRL_OPTIONS_H +#include "PACKAGES_CONFIG.h" +#include "CPP_OPTIONS.h" + CBOP C !ROUTINE: CTRL_OPTIONS.h C !INTERFACE: @@ -10,11 +15,6 @@ C | Control which optional features to compile in this package code. C *==================================================================* CEOP -#ifndef CTRL_OPTIONS_H -#define CTRL_OPTIONS_H -#include "PACKAGES_CONFIG.h" -#include "CPP_OPTIONS.h" - #ifdef ALLOW_CTRL #ifdef ECCO_CPPOPTIONS_H @@ -26,37 +26,89 @@ C are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h C ================================================================== C-- Package-specific Options & Macros go here -#define EXCLUDE_CTRL_PACK +C o I/O and pack settings +#undef CTRL_SET_PREC_32 +C This option is only relevant (for pack/unpack) with OBCS_CONTROL: #undef ALLOW_NONDIMENSIONAL_CONTROL_IO +#define EXCLUDE_CTRL_PACK +#undef ALLOW_PACKUNPACK_METHOD2 +#undef CTRL_DO_PACK_UNPACK_ONLY +#undef CTRL_PACK_PRECISE +#undef CTRL_UNPACK_PRECISE +#undef CTRL_DELZNORM +#undef ALLOW_CTRL_WETV C >>> Other Control. -#define ALLOW_DIFFKR_CONTROL +C Allows for GMREDI controls #undef ALLOW_KAPGM_CONTROL #undef ALLOW_KAPREDI_CONTROL +C Allows for Vertical Diffusivity controls +#define ALLOW_DIFFKR_CONTROL #undef ALLOW_BOTTOMDRAG_CONTROL +#undef ALLOW_DIC_CONTROL + +C Allows bathymetry as a control vector +C Note: keep this Option separated from generic control since this control +C involves many new dependencies that we would like to avoid in general. +#undef ALLOW_DEPTH_CONTROL +#ifdef ALLOW_DEPTH_CONTROL +C Only relevant within DEPTH_CONTROL code: +# define USE_SMOOTH_MIN +# undef ALLOW_HFACC_CONTROL +# undef ALLOW_HFACC3D_CONTROL +#endif /* ALLOW_DEPTH_CONTROL */ C >>> Generic Control. #undef ALLOW_GENARR2D_CONTROL #define ALLOW_GENARR3D_CONTROL #undef ALLOW_GENTIM2D_CONTROL +# undef ALLOW_UVEL0_CONTROL +# undef ALLOW_VVEL0_CONTROL +# undef CTRL_SET_OLD_MAXCVARS_30 +# undef CTRL_SET_OLD_MAXCVARS_40 + +C >>> Open boundaries +#ifdef ALLOW_OBCS +C Control of Open-Boundaries is meaningless without compiling pkg/obcs +C Note: Make sure that corresponding OBCS N/S/W/E Option is defined +# define ALLOW_OBCSN_CONTROL +# define ALLOW_OBCSS_CONTROL +# define ALLOW_OBCSW_CONTROL +# define ALLOW_OBCSE_CONTROL +# undef ALLOW_OBCS_CONTROL_MODES +#endif /* ALLOW_OBCS */ + +C o Set ALLOW_OBCS_CONTROL (Do not edit/modify): +#if (defined (ALLOW_OBCSN_CONTROL) || \ + defined (ALLOW_OBCSS_CONTROL) || \ + defined (ALLOW_OBCSW_CONTROL) || \ + defined (ALLOW_OBCSE_CONTROL)) +# define ALLOW_OBCS_CONTROL +#endif + +C o Impose bounds on controls +#undef ALLOW_ADCTRLBOUND C o Rotation of wind/stress controls adjustments C from Eastward/Northward to model grid directions #undef ALLOW_ROTATE_UV_CONTROLS -C o use pkg/smooth correlation operator (incl. smoother) for 2D controls (Weaver, Courtier 01) -C This CPP option just sets the default for ctrlSmoothCorrel2D to .TRUE. -#undef ALLOW_SMOOTH_CORREL2D -C o use pkg/smooth correlation operator (incl. smoother) for 3D controls (Weaver, Courtier 01) -C This CPP option just sets the default for ctrlSmoothCorrel3D to .TRUE. -#undef ALLOW_SMOOTH_CORREL3D +C o Originally the first two time-reccords of control +C variable tau u and tau v were skipped. +C The CTRL_SKIP_FIRST_TWO_ATM_REC_ALL option extends this +C to the other the time variable atmospheric controls. +#undef CTRL_SKIP_FIRST_TWO_ATM_REC_ALL -C o apply pkg/ctrl/ctrl_smooth.F to 2D controls (outside of ctrlSmoothCorrel2D) -#undef ALLOW_CTRL_SMOOTH -C o apply pkg/smooth/smooth_diff2d.F to 2D controls (outside of ctrlSmoothCorrel2D) +C Note: this flag turns on extra smoothing code in ctrl_get_gen.F which +C is inconsistent with the Weaver and Courtier, 2001 algorithm, and +C should probably not be used. The corresponding 3D flag applied only +C to deprecated code that is now removed. At some point we will remove +C this flag and associated code as well. +C o apply pkg/smooth/smooth_diff2d.F to 2D controls (outside of Smooth_Correl2D) #undef ALLOW_SMOOTH_CTRL2D -C o apply pkg/smooth/smooth_diff3d.F to 3D controls (outside of ctrlSmoothCorrel3D) -#undef ALLOW_SMOOTH_CTRL3D + +C o Print more debug info to STDOUT +#undef ALLOW_CTRL_DEBUG C ================================================================== #endif /* ndef ECCO_CPPOPTIONS_H */