Back to home page

MITgcm

 
 

    


File indexing completed on 2023-09-11 05:10:56 UTC

view on githubraw file Latest commit 5a54dbbd on 2023-09-10 14:50:14 UTC
5a54dbbd56 Jean*0001 #ifndef AUTODIFF_OPTIONS_H
                0002 #define AUTODIFF_OPTIONS_H
                0003 #include "PACKAGES_CONFIG.h"
                0004 #include "CPP_OPTIONS.h"
                0005 
bc17e304d3 Jean*0006 CBOP
                0007 C !ROUTINE: AUTODIFF_OPTIONS.h
                0008 C !INTERFACE:
                0009 C #include "AUTODIFF_OPTIONS.h"
                0010 
                0011 C !DESCRIPTION:
                0012 C *==================================================================*
                0013 C | CPP options file for AutoDiff (autodiff) package:
                0014 C | Control which optional features to compile in this package code.
                0015 C *==================================================================*
                0016 CEOP
                0017 
                0018 #ifdef ALLOW_AUTODIFF
                0019 #ifdef ECCO_CPPOPTIONS_H
                0020 
                0021 C-- When multi-package option-file ECCO_CPPOPTIONS.h is used (directly included
                0022 C    in CPP_OPTIONS.h), this option file is left empty since all options that
                0023 C   are specific to this package are assumed to be set in ECCO_CPPOPTIONS.h
                0024 
                0025 #else /* ndef ECCO_CPPOPTIONS_H */
                0026 C   ==================================================================
                0027 C-- Package-specific Options & Macros go here
                0028 
5a54dbbd56 Jean*0029 C o Include/exclude code in order to automatically differentiate MITgcm code
                0030 C   using TAF (Transformation of Algorithms in Fortran, http://www.FastOpt.de)
                0031 C   or using TAMC (Tangent Linear & Adjoint Model Compiler, needs both defined):
bc17e304d3 Jean*0032 #undef ALLOW_AUTODIFF_TAMC
5a54dbbd56 Jean*0033 #undef AUTODIFF_TAMC_COMPATIBILITY
bc17e304d3 Jean*0034 
                0035 C       >>> Checkpointing as handled by TAMC
                0036 #define ALLOW_TAMC_CHECKPOINTING
                0037 
                0038 C       >>> Extract adjoint state
                0039 #undef ALLOW_AUTODIFF_MONITOR
3c775cbf98 Mart*0040 C       >>> and DYNVARS_DIAG adjoint state
                0041 #undef ALLOW_AUTODIFF_MONITOR_DIAG
bc17e304d3 Jean*0042 
                0043 C       >>> DO 2-level checkpointing instead of 3-level
5a54dbbd56 Jean*0044 #undef AUTODIFF_2_LEVEL_CHECKPOINT
bc17e304d3 Jean*0045 
                0046 C extend to 4-level checkpointing
5a54dbbd56 Jean*0047 #undef AUTODIFF_4_LEVEL_CHECKPOINT
bc17e304d3 Jean*0048 
                0049 C o use divided adjoint to split adjoint computations
                0050 #undef ALLOW_DIVIDED_ADJOINT
                0051 
3c775cbf98 Mart*0052 C o This flag is incredibly useful as it reduces the number of
                0053 C   tape-files on the disc. Maybe it should even be the default.
                0054 #undef ALLOW_AUTODIFF_WHTAPEIO
5a54dbbd56 Jean*0055 C   and related to above:
                0056 #undef ALLOW_INIT_WHTAPEIO
3c775cbf98 Mart*0057 
                0058 C o use standard MDSFINDUINTS instead of local pkg/autodiff version for
                0059 C   WHTAPEIO code I/O.
                0060 C   Note: comment out the #define below (instead of having an #undef) to
                0061 C   enable to set this Option in CPP command line (from the optfile)
                0062 c#define AUTODIFF_USE_MDSFINDUNITS
                0063 
                0064 C o use the deprecated autodiff_store/restore method where multiple fields
                0065 C   are collected in a single buffer field array before storing to tape.
                0066 C   This functionality has been replaced by WHTAPEIO method (see above).
                0067 C   Might still be used for OBCS since WHTAPEIO does not support OBCS fields.
                0068 #undef AUTODIFF_USE_STORE_RESTORE
                0069 #undef AUTODIFF_USE_STORE_RESTORE_OBCS
                0070 
                0071 C o allow using viscFacInAd to recompute viscosities in AD
                0072 #undef AUTODIFF_ALLOW_VISCFACADJ
                0073 
5a54dbbd56 Jean*0074 C o To remove part of MOM_CALC_VISC (better name would be: MOM_DISABLE_*)
                0075 #undef AUTODIFF_DISABLE_LEITH
                0076 #undef AUTODIFF_DISABLE_REYNOLDS_SCALE
                0077 
3c775cbf98 Mart*0078 C o for output of AD-variables (ALLOW_AUTODIFF_MONITOR), specific code (e.g.,
                0079 C   in addummy_in_stepping.F) relies on adexch_uv_xy_rs and adexch_xy_rs S/R
                0080 C   which might not always be generated by TAF (e.g., when controls do not
                0081 C   include any 2D forcing field). In those cases, defining this cpp-option
                0082 C   allows to circumvent this missing code issue.
                0083 #undef AUTODIFF_EXCLUDE_ADEXCH_RS
bc17e304d3 Jean*0084 
                0085 C   ==================================================================
                0086 #endif /* ndef ECCO_CPPOPTIONS_H */
                0087 #endif /* ALLOW_AUTODIFF */
                0088 #endif /* AUTODIFF_OPTIONS_H */