Back to home page

MITgcm

 
 

    


File indexing completed on 2024-06-06 05:10:16 UTC

view on githubraw file Latest commit af61e5eb on 2024-06-06 03:30:35 UTC
6d54cf9ca1 Ed H*0001 #include "PACKAGES_CONFIG.h"
2b6828d138 Alis*0002 #include "CPP_OPTIONS.h"
517dbdc414 Jean*0003 #ifdef ALLOW_AUTODIFF
                0004 # include "AUTODIFF_OPTIONS.h"
                0005 #endif
                0006 #ifdef ALLOW_CTRL
                0007 # include "CTRL_OPTIONS.h"
                0008 #endif
7448700841 Mart*0009 #ifdef ALLOW_ECCO
                0010 # include "ECCO_OPTIONS.h"
                0011 #endif
b4daa24319 Shre*0012 #ifdef ALLOW_TAPENADE
                0013 # ifdef ALLOW_GMREDI
                0014 #  include "GMREDI_OPTIONS.h"
                0015 # endif
                0016 #endif /* ALLOW_TAPENADE */
2b6828d138 Alis*0017 
9366854e02 Chri*0018 CBOP
                0019 C     !ROUTINE: PACKAGES_INIT_VARIABLES
                0020 C     !INTERFACE:
fb481a83c2 Alis*0021       SUBROUTINE PACKAGES_INIT_VARIABLES( myThid )
2b6828d138 Alis*0022 
9366854e02 Chri*0023 C     !DESCRIPTION: \bv
                0024 C     *==========================================================*
e33db7ef40 Jean*0025 C     | SUBROUTINE PACKAGES_INIT_VARIABLES
                0026 C     | o Does initialisation of package-related variable data
9366854e02 Chri*0027 C     *==========================================================*
                0028 C     \ev
                0029 
                0030 C     !CALLING SEQUENCE:
                0031 C     PACKAGES_INIT_VARIABLES
                0032 C       |
bf3fb08440 Jean*0033 C       |-- DIAGNOSTICS_INIT_VARIA
                0034 C       |
4997f8d6b8 Jean*0035 C       |-- OFFLINE_INIT_VARIA
                0036 C       |
5593e3ac8c Jean*0037 C       |-- GAD_INIT_VARIA
9da3c4e8e8 Jean*0038 C       |
e412d1f16c Jean*0039 C       |-- CD_CODE_INI_VARS
                0040 C       |
659f2b2337 Jean*0041 C       |-- PP81_INIT_VARIA
9366854e02 Chri*0042 C       |
d8d1486ca1 Jean*0043 C       |-- KL10_INIT_VARIA
                0044 C       |
659f2b2337 Jean*0045 C       |-- MY82_INIT_VARIA
5b1a890519 Jean*0046 C       |
659f2b2337 Jean*0047 C       |-- GGL90_INIT_VARIA
15338fa568 Dimi*0048 C       |
5a9f83110e Jean*0049 C       |-- KPP_INIT_VARIA
9366854e02 Chri*0050 C       |
659f2b2337 Jean*0051 C       |-- GMREDI_INIT_VARIA
e864122ae8 Mart*0052 C       |
659f2b2337 Jean*0053 C       |-- BBL_INIT_VARIA
e864122ae8 Mart*0054 C       |
659f2b2337 Jean*0055 C       |-- DWNSLP_INIT_VARIA
69a7b27187 Mart*0056 C       |
473f3aa7d4 Jean*0057 C       |-- EXF_INIT_VARIA
e0b3e1bdd8 Dimi*0058 C       |
659f2b2337 Jean*0059 C       |-- BULKF_INIT_VARIA
e33db7ef40 Jean*0060 C       |
659f2b2337 Jean*0061 C       |-- EBM_INI_VARS
2db28c9ae9 Mart*0062 C       |
659f2b2337 Jean*0063 C       |-- CHEAPAML_INIT_VARIA
5da8ce63fa Dimi*0064 C       |
659f2b2337 Jean*0065 C       |-- FLT_INIT_VARIA
5593e3ac8c Jean*0066 C       |
659f2b2337 Jean*0067 C       |-- PTRACERS_INIT_VARIA
                0068 C       |
                0069 C       |-- LONGSTEP_INIT_VARIA
                0070 C       |
bf3fb08440 Jean*0071 C       |-- GCHEM_INIT_VARI
                0072 C       |
659f2b2337 Jean*0073 C       |-- RBCS_INIT_VARIA
d410a4724b Jean*0074 C       |
659f2b2337 Jean*0075 C       |-- MATRIX_INIT_VARIA
5593e3ac8c Jean*0076 C       |
148dd84005 jm-c 0077 C       |-- STREAMICE_INIT_VARIA
9366854e02 Chri*0078 C       |
148dd84005 jm-c 0079 C       |-- SHELFICE_INIT_VARIA
cee16b76ae Dimi*0080 C       |
00f81e6785 Ou W*0081 C       |-- STIC_INIT_VARIA
                0082 C       |
148dd84005 jm-c 0083 C       |-- ICEFRONT_INIT_VARIA
bf3fb08440 Jean*0084 C       |
148dd84005 jm-c 0085 C       |-- FRAZIL_INIT_VARIA
bf3fb08440 Jean*0086 C       |
148dd84005 jm-c 0087 C       |-- SEAICE_INIT_VARIA
93f4e26372 Jean*0088 C       |
148dd84005 jm-c 0089 C       |-- SALT_PLUME_INIT_VARIA
cee16b76ae Dimi*0090 C       |
10e4bbdd7f Jean*0091 C       |-- THSICE_INI_VARS
c1b6df074d Jean*0092 C       |
659f2b2337 Jean*0093 C       |-- LAND_INI_VARS
39cebd8084 Ed H*0094 C       |
4e28c912a1 Jeff*0095 C       |-- ATM2D_INIT_VARS
                0096 C       |
5593e3ac8c Jean*0097 C       |-- ATM_PHYS_INIT_VARIA
                0098 C       |
bf3fb08440 Jean*0099 C       |-- FIZHI_INI_VARS
                0100 C       |
                0101 C       |-- REGRID_INIT_VARIA
                0102 C       |
dfc9bc933c Ryan*0103 C       |-- LAYERS_INIT_VARIA
                0104 C       |
659f2b2337 Jean*0105 C       |-- NEST_CHILD_INIT_VARIA
                0106 C       |-- NEST_PARENT_INIT_VARIA
86f14fa6df Jean*0107 C       |
6591b3fcc3 Jean*0108 C       |-- NEST2W_INIT_VARIA
                0109 C       |
659f2b2337 Jean*0110 C       |-- CPL_INI_VARS
5b1a890519 Jean*0111 C       |
                0112 C       |-- MYPACKAGE_INIT_VARIA
793e174778 Jean*0113 C       |
72c872192a Gael*0114 C       |-- SMOOTH_INIT_VARIA
                0115 C       |-- PROFILES_INIT_VARIA
                0116 C       |-- ECCO_INIT_VARIA
659f2b2337 Jean*0117 C       |-- CTRL_INIT_VARIABLES
                0118 C       |
793e174778 Jean*0119 C       |-- OBCS_INIT_VARIABLES
9366854e02 Chri*0120 
                0121 C     !USES:
                0122       IMPLICIT NONE
2b6828d138 Alis*0123 C     === Global variables ===
                0124 #include "SIZE.h"
                0125 #include "EEPARAMS.h"
                0126 #include "PARAMS.h"
517dbdc414 Jean*0127 #ifdef ALLOW_AUTODIFF
af61e5eb16 Mart*0128 # include "FFIELDS.h"
b08554040b Patr*0129 # include "DYNVARS.h"
c69ccc91fb antn*0130 #endif /* ALLOW_AUTODIFF */
2b6828d138 Alis*0131 
b4daa24319 Shre*0132 #ifdef ALLOW_TAPENADE
                0133 # ifdef ALLOW_GMREDI
                0134 #  include "GMREDI.h"
                0135 # endif
                0136 # ifdef ALLOW_CTRL
                0137 #  include "CTRL_SIZE.h"
4d72283393 Mart*0138 #  include "CTRL.h"
b4daa24319 Shre*0139 #  include "CTRL_GENARR.h"
edcd27be69 Mart*0140 #  include "CTRL_DUMMY.h"
b4daa24319 Shre*0141 # endif
                0142 # ifdef ALLOW_PTRACERS
                0143 #  include "PTRACERS_SIZE.h"
                0144 #  include "PTRACERS_FIELDS.h"
                0145 # endif
                0146 # ifdef ALLOW_SHELFICE
                0147 #  include "SHELFICE.h"
                0148 # endif
00f81e6785 Ou W*0149 # ifdef ALLOW_STEEP_ICECAVITY
                0150 #  include "STIC.h"
                0151 # endif
b4daa24319 Shre*0152 # ifdef ALLOW_STREAMICE
                0153 #  include "STREAMICE.h"
                0154 # endif
                0155 # ifdef ALLOW_SEAICE
                0156 #  include "SEAICE_SIZE.h"
                0157 #  include "SEAICE.h"
                0158 # endif
                0159 #endif /* ALLOW_TAPENADE */
                0160 
9366854e02 Chri*0161 C     !INPUT/OUTPUT PARAMETERS:
793e174778 Jean*0162 C     myThid  :: my Thread Id number
2b6828d138 Alis*0163       INTEGER myThid
9366854e02 Chri*0164 CEOP
2b6828d138 Alis*0165 
abb214f17f Alis*0166 #ifdef ALLOW_DEBUG
e33db7ef40 Jean*0167       IF (debugMode)
9e6ee95b0d Ed H*0168      &     CALL DEBUG_ENTER('PACKAGES_INIT_VARIABLES',myThid)
5b1a890519 Jean*0169 #endif /* ALLOW_DEBUG */
abb214f17f Alis*0170 
e28c7077ef Andr*0171 #ifdef ALLOW_DIAGNOSTICS
                0172       IF ( useDiagnostics ) THEN
                0173         CALL DIAGNOSTICS_INIT_VARIA( myThid )
                0174       ENDIF
5b1a890519 Jean*0175 #endif /* ALLOW_DIAGNOSTICS */
e28c7077ef Andr*0176 
4997f8d6b8 Jean*0177 #ifdef ALLOW_OFFLINE
                0178 C--   Here we call OFFLINE_INIT_VARIA (which calls OFFLINE_FIELDS_LOAD)
                0179 C     before other {PKG}_init_varia, closer to where main pickup-file
                0180 C     are usually read-in (but skipped when using pkg/offline)
517dbdc414 Jean*0181 # ifndef ALLOW_AUTODIFF
4997f8d6b8 Jean*0182       IF ( useOFFLINE ) THEN
                0183 # endif
                0184         CALL OFFLINE_INIT_VARIA( myThid )
517dbdc414 Jean*0185 # ifndef ALLOW_AUTODIFF
4997f8d6b8 Jean*0186       ENDIF
                0187 # endif
                0188 #endif /* ALLOW_OFFLINE */
                0189 
9da3c4e8e8 Jean*0190 #ifdef ALLOW_GENERIC_ADVDIFF
5b1a890519 Jean*0191       IF ( useGAD ) THEN
                0192 # ifdef ALLOW_DEBUG
                0193         IF (debugMode) CALL DEBUG_CALL('GAD_INIT_VARIA',myThid)
                0194 # endif
                0195         CALL GAD_INIT_VARIA( myThid )
                0196       ENDIF
9da3c4e8e8 Jean*0197 #endif /* ALLOW_GENERIC_ADVDIFF */
                0198 
e412d1f16c Jean*0199 #ifdef ALLOW_CD_CODE
e33db7ef40 Jean*0200 C--   Initialize CD_CODE variables:
e412d1f16c Jean*0201 C- note(jmc): before packaging CD_CODE, was done within ini_fields (=called before),
                0202 C             therefore call CD-ini-vars before others pkg.
5b1a890519 Jean*0203       IF (useCDscheme) THEN
                0204 # ifdef ALLOW_DEBUG
                0205         IF (debugMode) CALL DEBUG_CALL('CD_CODE_INI_VARS',myThid)
                0206 # endif
                0207         CALL CD_CODE_INI_VARS( myThid )
                0208       ENDIF
                0209 #endif /* ALLOW_CD_CODE */
e412d1f16c Jean*0210 
e864122ae8 Mart*0211 #ifdef ALLOW_PP81
                0212 C--   Initialize PP81 vertical mixing scheme.
                0213       IF (usePP81) THEN
5b1a890519 Jean*0214 # ifdef ALLOW_DEBUG
5a9f83110e Jean*0215        IF (debugMode) CALL DEBUG_CALL('PP81_INIT_VARIA',myThid)
5b1a890519 Jean*0216 # endif
5a9f83110e Jean*0217        CALL PP81_INIT_VARIA( myThid )
e864122ae8 Mart*0218       ENDIF
5b1a890519 Jean*0219 #endif /* ALLOW_PP81 */
e864122ae8 Mart*0220 
d8d1486ca1 Jean*0221 #ifdef ALLOW_KL10
                0222 C--   Initialize KL10 vertical mixing scheme.
                0223       IF (useKL10) THEN
                0224 # ifdef ALLOW_DEBUG
                0225        IF (debugMode) CALL DEBUG_CALL('KL10_INIT_VARIA',myThid)
                0226 # endif
                0227        CALL KL10_INIT_VARIA( myThid )
                0228       ENDIF
                0229 #endif /* ALLOW_KL10 */
                0230 
e864122ae8 Mart*0231 #ifdef ALLOW_MY82
69a7b27187 Mart*0232 C--   Initialize MY82 vertical mixing scheme.
e864122ae8 Mart*0233       IF (useMY82) THEN
60c545bbe1 Mart*0234        CALL MY82_INIT_VARIA( myThid )
e864122ae8 Mart*0235       ENDIF
5b1a890519 Jean*0236 #endif /* ALLOW_MY82 */
e864122ae8 Mart*0237 
69a7b27187 Mart*0238 #ifdef ALLOW_GGL90
                0239 C--   Initialize GGL90 vertical mixing scheme.
                0240       IF (useGGL90) THEN
e56754156b Davi*0241 #ifdef ALLOW_DEBUG
                0242       IF (debugMode) CALL DEBUG_CALL('GGL90_INIT_VARIA',myThid)
                0243 #endif
                0244        CALL GGL90_INIT_VARIA( myThid )
69a7b27187 Mart*0245       ENDIF
5b1a890519 Jean*0246 #endif /* ALLOW_GGL90 */
69a7b27187 Mart*0247 
659f2b2337 Jean*0248 #ifdef ALLOW_KPP
                0249 C--   Initialize KPP vertical mixing scheme.
                0250       IF (useKPP) THEN
e0b3e1bdd8 Dimi*0251 # ifdef ALLOW_DEBUG
659f2b2337 Jean*0252        IF (debugMode) CALL DEBUG_CALL('KPP_INIT_VARIA',myThid)
e0b3e1bdd8 Dimi*0253 # endif
659f2b2337 Jean*0254        CALL KPP_INIT_VARIA( myThid )
e0b3e1bdd8 Dimi*0255       ENDIF
659f2b2337 Jean*0256 #endif /* ALLOW_KPP */
e0b3e1bdd8 Dimi*0257 
659f2b2337 Jean*0258 #ifdef ALLOW_GMREDI
                0259 C--   Initialize GM/Redi parameterization
94a8024bbe Jean*0260 # ifdef ALLOW_AUTODIFF
                0261 C- Note: To simplify dependency & avoid recomputations, when compiling
                0262 C        pkg/autodiff, we always call GMREDI_INIT_VARIA to initialise control
                0263 C        variables (ALLOW_KAPGM/KAPREDI_CONTROL) without condition on useGMRedi
                0264 C        (in this case the "If useGMRedi" is added inside gmredi_init_varia.F).
                0265 # else
                0266       IF ( useGMRedi ) THEN
                0267 # endif
5b1a890519 Jean*0268 # ifdef ALLOW_DEBUG
659f2b2337 Jean*0269         IF (debugMode) CALL DEBUG_CALL('GMREDI_INIT_VARIA',myThid)
5b1a890519 Jean*0270 # endif
659f2b2337 Jean*0271         CALL GMREDI_INIT_VARIA( myThid )
94a8024bbe Jean*0272 # ifndef ALLOW_AUTODIFF
27020fe029 Patr*0273       ENDIF
94a8024bbe Jean*0274 # endif
659f2b2337 Jean*0275 #endif /* ALLOW_GMREDI */
5ee2971ab8 Patr*0276 
659f2b2337 Jean*0277 #ifdef ALLOW_BBL
                0278       IF ( useBBL ) THEN
                0279         CALL BBL_INIT_VARIA( myThid )
                0280       ENDIF
                0281 #endif /* ALLOW_BBL */
                0282 
                0283 #ifdef ALLOW_DOWN_SLOPE
                0284       IF ( useDOWN_SLOPE ) THEN
                0285         CALL DWNSLP_INIT_VARIA( myThid )
                0286       ENDIF
                0287 #endif /* ALLOW_DOWN_SLOPE */
                0288 
                0289 #ifdef ALLOW_EXF
                0290       IF (useEXF) THEN
2db28c9ae9 Mart*0291 # ifdef ALLOW_DEBUG
473f3aa7d4 Jean*0292        IF (debugMode) CALL DEBUG_CALL('EXF_INIT_VARIA',myThid)
2db28c9ae9 Mart*0293 # endif
473f3aa7d4 Jean*0294        CALL EXF_INIT_VARIA( myThid )
2db28c9ae9 Mart*0295       ENDIF
659f2b2337 Jean*0296 #endif /* ALLOW_EXF */
2db28c9ae9 Mart*0297 
659f2b2337 Jean*0298 #ifdef ALLOW_BULK_FORCE
                0299       IF (useBulkForce) THEN
                0300         CALL BULKF_INIT_VARIA( myThid )
                0301       ENDIF
                0302 #endif /* ALLOW_BULK_FORCE */
                0303 
                0304 #ifdef ALLOW_EBM
517dbdc414 Jean*0305 # ifdef ALLOW_AUTODIFF_TAMC
659f2b2337 Jean*0306 CADJ STORE theta = tapelev_init, key = 1
5da8ce63fa Dimi*0307 # endif
659f2b2337 Jean*0308       IF (useEBM) THEN
                0309         CALL EBM_INI_VARS( myThid )
5da8ce63fa Dimi*0310       ENDIF
659f2b2337 Jean*0311 #endif /* ALLOW_EBM */
5da8ce63fa Dimi*0312 
659f2b2337 Jean*0313 #ifdef ALLOW_CHEAPAML
                0314       IF (useCheapAML) THEN
                0315         CALL CHEAPAML_INIT_VARIA( myThid )
                0316       ENDIF
                0317 #endif /* ALLOW_CHEAPAML */
                0318 
                0319 #ifdef ALLOW_FLT
                0320 C--   Initialise float position
                0321       IF ( useFLT ) THEN
                0322         CALL FLT_INIT_VARIA( myThid )
                0323       ENDIF
                0324 #endif /* ALLOW_FLT */
                0325 
5c43c390b6 Alis*0326 #ifdef ALLOW_PTRACERS
517dbdc414 Jean*0327 # ifndef ALLOW_AUTODIFF
cf2549e769 Patr*0328       IF ( usePTRACERS ) THEN
                0329 # endif
5b1a890519 Jean*0330 # ifdef ALLOW_DEBUG
                0331         IF (debugMode) CALL DEBUG_CALL('PTRACERS_INIT_VARIA',myThid)
                0332 # endif
                0333         CALL PTRACERS_INIT_VARIA( myThid )
4e66ab0b67 Oliv*0334 # ifdef ALLOW_LONGSTEP
                0335 #  ifdef ALLOW_DEBUG
                0336         IF (debugMode) CALL DEBUG_CALL('LONGSTEP_INIT_VARIA',myThid)
                0337 #  endif
                0338         CALL LONGSTEP_INIT_VARIA( myThid )
                0339 # endif /* ALLOW_LONGSTEP */
517dbdc414 Jean*0340 # ifndef ALLOW_AUTODIFF
5b1a890519 Jean*0341       ENDIF
0a90236bb2 Mart*0342 # endif
5b1a890519 Jean*0343 #endif /* ALLOW_PTRACERS */
                0344 
                0345 #ifdef ALLOW_GCHEM
                0346       IF (useGCHEM) THEN
                0347         CALL GCHEM_INIT_VARI( myThid )
cf2549e769 Patr*0348       ENDIF
5b1a890519 Jean*0349 #endif /* ALLOW_GCHEM */
5c43c390b6 Alis*0350 
659f2b2337 Jean*0351 #ifdef ALLOW_RBCS
                0352       IF ( useRBCS ) THEN
                0353         CALL RBCS_INIT_VARIA( myThid )
5b1a890519 Jean*0354       ENDIF
659f2b2337 Jean*0355 #endif /* ALLOW_RBCS */
1a5b8b2149 Gael*0356 
659f2b2337 Jean*0357 #ifdef ALLOW_MATRIX
                0358       IF ( useMATRIX ) THEN
                0359 # ifdef ALLOW_DEBUG
                0360         IF (debugMode) CALL DEBUG_CALL('MATRIX_INIT',myThid)
6e4c90fea3 Patr*0361 # endif
659f2b2337 Jean*0362         CALL MATRIX_INIT_VARIA( myThid )
                0363       ENDIF
                0364 #endif /* ALLOW_MATRIX */
2dcaa8b9a5 Patr*0365 
148dd84005 jm-c 0366 #ifdef ALLOW_STREAMICE
                0367       IF (useStreamIce) THEN
                0368 # ifdef ALLOW_DEBUG
                0369        IF (debugMode) CALL DEBUG_CALL('STREAMICE_INIT_VARIA',myThid)
                0370 # endif
                0371        CALL STREAMICE_INIT_VARIA( myThid )
                0372       ENDIF
                0373 #endif /* ALLOW_STREAMICE */
                0374 
                0375 #ifdef ALLOW_SHELFICE
c69ccc91fb antn*0376 # ifdef ALLOW_AUTODIFF
                0377 C- Note: use same trick as for pkg/gmredi (call to GMREDI_INIT_VARIA) when
                0378 C  compiling pkg/autodiff (with "If useShelfIce" inside shelfice_init_varia.F)
                0379 # else
148dd84005 jm-c 0380       IF (useShelfIce) THEN
c69ccc91fb antn*0381 # endif
148dd84005 jm-c 0382 # ifdef ALLOW_DEBUG
                0383        IF (debugMode) CALL DEBUG_CALL('SHELFICE_INIT_VARIA',myThid)
                0384 # endif
                0385        CALL SHELFICE_INIT_VARIA( myThid )
c69ccc91fb antn*0386 # ifndef ALLOW_AUTODIFF
148dd84005 jm-c 0387       ENDIF
c69ccc91fb antn*0388 # endif
148dd84005 jm-c 0389 #endif /* ALLOW_SHELFICE */
                0390 
00f81e6785 Ou W*0391 #ifdef ALLOW_STEEP_ICECAVITY
                0392 # ifdef ALLOW_AUTODIFF
                0393 C- Note: use same trick as for pkg/gmredi (call to GMREDI_INIT_VARIA) when
                0394 C  compiling pkg/autodiff (with IF-statements inside stic_init_varia.F)
                0395 # else
                0396       IF (useSTIC) THEN
                0397 # endif
                0398 # ifdef ALLOW_DEBUG
                0399        IF (debugMode) CALL DEBUG_CALL('STIC_INIT_VARIA',myThid)
                0400 # endif
                0401        CALL STIC_INIT_VARIA( myThid )
                0402 # ifndef ALLOW_AUTODIFF
                0403       ENDIF
                0404 # endif
                0405 #endif /* ALLOW_STEEP_ICECAVITY */
                0406 
148dd84005 jm-c 0407 #ifdef ALLOW_ICEFRONT
                0408       IF (useICEFRONT) THEN
                0409 # ifdef ALLOW_DEBUG
                0410        IF (debugMode) CALL DEBUG_CALL('ICEFRONT_INIT_VARIA',myThid)
                0411 # endif
                0412        CALL ICEFRONT_INIT_VARIA( myThid )
                0413       ENDIF
                0414 #endif /* ALLOW_ICEFRONT */
                0415 
659f2b2337 Jean*0416 #ifdef ALLOW_FRAZIL
                0417       IF (useFRAZIL) THEN
5b1a890519 Jean*0418 # ifdef ALLOW_DEBUG
659f2b2337 Jean*0419         IF (debugMode) CALL DEBUG_CALL('FRAZIL_INIT_VARIA',myThid)
5b1a890519 Jean*0420 # endif
659f2b2337 Jean*0421         CALL FRAZIL_INIT_VARIA( myThid)
342da43f96 Patr*0422       ENDIF
659f2b2337 Jean*0423 #endif /* ALLOW_FRAZIL */
cee16b76ae Dimi*0424 
659f2b2337 Jean*0425 #ifdef ALLOW_SEAICE
                0426 C--   Initialize SEAICE model.
c69ccc91fb antn*0427 # ifdef ALLOW_AUTODIFF
                0428 C- Note: use same trick as for pkg/gmredi (call to GMREDI_INIT_VARIA) when
                0429 C     compiling pkg/autodiff (with "If useSEAICE" inside seaice_init_varia.F)
                0430 # else
659f2b2337 Jean*0431       IF (useSEAICE) THEN
c69ccc91fb antn*0432 # endif
659f2b2337 Jean*0433 # ifdef ALLOW_DEBUG
                0434        IF (debugMode) CALL DEBUG_CALL('SEAICE_INIT_VARIA',myThid)
b08554040b Patr*0435 # endif
659f2b2337 Jean*0436        CALL SEAICE_INIT_VARIA( myThid )
c69ccc91fb antn*0437 # ifndef ALLOW_AUTODIFF
5b1a890519 Jean*0438       ENDIF
c69ccc91fb antn*0439 # endif
659f2b2337 Jean*0440 #endif /* ALLOW_SEAICE */
d8206d87ee Patr*0441 
659f2b2337 Jean*0442 #ifdef ALLOW_SALT_PLUME
                0443       IF ( useSALT_PLUME ) THEN
                0444         CALL SALT_PLUME_INIT_VARIA( myThid )
e994210c2e Gael*0445       ENDIF
659f2b2337 Jean*0446 #endif /* ALLOW_SALT_PLUME */
24462d2fa8 Patr*0447 
10e4bbdd7f Jean*0448 #ifdef ALLOW_THSICE
5b1a890519 Jean*0449       IF (useThSIce) THEN
                0450 # ifdef ALLOW_DEBUG
                0451         IF (debugMode) CALL DEBUG_CALL('THSICE_INI_VARS',myThid)
                0452 # endif
                0453         CALL THSICE_INI_VARS( myThid)
                0454       ENDIF
                0455 #endif /* ALLOW_THSICE */
6424ee9bc0 Curt*0456 
659f2b2337 Jean*0457 #ifdef ALLOW_LAND
                0458       IF ( useLAND ) THEN
5b1a890519 Jean*0459 # ifdef ALLOW_DEBUG
659f2b2337 Jean*0460         IF (debugMode) CALL DEBUG_CALL('LAND_INI_VARS',myThid)
5b1a890519 Jean*0461 # endif
659f2b2337 Jean*0462         CALL LAND_INI_VARS( myThid )
5b1a890519 Jean*0463       ENDIF
659f2b2337 Jean*0464 #endif /* ALLOW_LAND */
6424ee9bc0 Curt*0465 
4e28c912a1 Jeff*0466 #ifdef ALLOW_ATM2D
5b1a890519 Jean*0467       IF (useAtm2d) THEN
                0468 # ifdef ALLOW_DEBUG
                0469         IF (debugMode) CALL DEBUG_CALL('ATM2D_INIT_VARS',myThid)
                0470 # endif
                0471         CALL ATM2D_INIT_VARS( myThid )
                0472       ENDIF
                0473 #endif /* ALLOW_ATM2D */
4e28c912a1 Jeff*0474 
5593e3ac8c Jean*0475 #ifdef ALLOW_ATM_PHYS
                0476       IF (useAtm_Phys) THEN
                0477 # ifdef ALLOW_DEBUG
                0478         IF (debugMode) CALL DEBUG_CALL('ATM_PHYS_INIT_VARIA',myThid)
                0479 # endif
                0480         CALL ATM_PHYS_INIT_VARIA( myThid )
                0481       ENDIF
                0482 #endif /* ALLOW_ATM_PHYS */
                0483 
468f196fcd Andr*0484 #ifdef ALLOW_FIZHI
                0485 C Initialize FIZHI state variables
5b1a890519 Jean*0486       IF (useFIZHI) THEN
                0487 # ifdef ALLOW_DEBUG
                0488         IF (debugMode) CALL DEBUG_CALL('FIZHI_INIT_VARS',myThid)
                0489 # endif
                0490         CALL FIZHI_INIT_VARS( myThid )
                0491       ENDIF
                0492 #endif /* ALLOW_FIZHI */
48121039da Jean*0493 
bf3fb08440 Jean*0494 #ifdef ALLOW_REGRID
5b1a890519 Jean*0495       IF ( useREGRID ) THEN
                0496         CALL REGRID_INIT_VARIA( myThid )
                0497       ENDIF
                0498 #endif /* ALLOW_REGRID */
0dc94a8572 Patr*0499 
dfc9bc933c Ryan*0500 #ifdef ALLOW_LAYERS
5593e3ac8c Jean*0501       IF ( useLayers ) THEN
                0502         CALL LAYERS_INIT_VARIA( myThid )
                0503       ENDIF
dfc9bc933c Ryan*0504 #endif /* ALLOW_LAYERS */
                0505 
659f2b2337 Jean*0506 #ifdef ALLOW_NEST_CHILD
                0507 C--   Initialize NEST in CHILD configuration
                0508       IF (useNEST_CHILD) THEN
                0509 #ifdef ALLOW_DEBUG
                0510        IF (debugMode)
                0511      &       CALL DEBUG_CALL('NEST_CHILD_INIT_VARIA',myThid)
                0512 #endif
                0513        CALL NEST_CHILD_INIT_VARIA( myThid )
5b1a890519 Jean*0514       ENDIF
659f2b2337 Jean*0515 #endif /* ALLOW_NEST_CHILD */
e4775240e5 Dimi*0516 
659f2b2337 Jean*0517 #ifdef ALLOW_NEST_PARENT
                0518 C--   Initialize NEST in PARENT configuration
                0519       IF (useNEST_PARENT) THEN
                0520 #ifdef ALLOW_DEBUG
                0521        IF (debugMode)
                0522      &       CALL DEBUG_CALL('NEST_PARENT_INIT',myThid)
                0523 #endif
                0524        CALL NEST_PARENT_INIT_VARIA( myThid )
5b1a890519 Jean*0525       ENDIF
659f2b2337 Jean*0526 #endif /* ALLOW_NEST_PARENT */
                0527 
6591b3fcc3 Jean*0528 #ifdef ALLOW_NEST2W_COMMON
                0529 C--   Initialise the 2-Way Nesting packages variables
                0530       IF ( useNest2W_parent .OR. useNest2W_child ) THEN
                0531 # ifdef ALLOW_DEBUG
                0532         IF (debugMode) CALL DEBUG_CALL('NEST2W_INIT_VARIA',myThid)
                0533 # endif
                0534         CALL NEST2W_INIT_VARIA( myThid )
                0535       ENDIF
                0536 #endif /* ALLOW_NEST2W_COMMON */
                0537 
659f2b2337 Jean*0538 #ifdef COMPONENT_MODULE
                0539       IF (useCoupler) THEN
                0540 # ifdef ALLOW_DEBUG
                0541         IF (debugMode) CALL DEBUG_CALL('CPL_INI_VARS',myThid)
                0542 # endif
                0543         CALL CPL_INI_VARS( myThid )
                0544       ENDIF
                0545 #endif /* COMPONENT_MODULE */
5b1a890519 Jean*0546 
                0547 #ifdef ALLOW_MYPACKAGE
                0548       IF ( useMYPACKAGE ) THEN
                0549         CALL MYPACKAGE_INIT_VARIA( myThid )
                0550       ENDIF
                0551 #endif /* ALLOW_MYPACKAGE */
86f14fa6df Jean*0552 
517dbdc414 Jean*0553 #ifdef ALLOW_AUTODIFF_TAMC
659f2b2337 Jean*0554 CADJ STORE theta  = tapelev_init, key = 1
                0555 CADJ STORE salt   = tapelev_init, key = 1
af61e5eb16 Mart*0556 CADJ STORE etaN   = tapelev_init, key = 1
                0557 # ifdef ALLOW_GEOTHERMAL_FLUX
                0558 CADJ STORE geothermalFlux = tapelev_init, key = 1
                0559 # endif
659f2b2337 Jean*0560 # ifdef ALLOW_DIFFKR_CONTROL
                0561 CADJ STORE diffkr = tapelev_init, key = 1
                0562 # endif
517dbdc414 Jean*0563 #endif /* ALLOW_AUTODIFF_TAMC */
                0564 
72c872192a Gael*0565 C--   Initialise pkg/smooth
                0566 #ifdef ALLOW_SMOOTH
87c3338883 Gael*0567       IF (useSMOOTH) THEN
                0568         CALL SMOOTH_INIT_VARIA(myThid)
                0569       ENDIF
72c872192a Gael*0570 #endif /* ALLOW_SMOOTH */
                0571 
                0572 C--   Initialise pkg/profiles
                0573 #ifdef ALLOW_PROFILES
                0574       IF (usePROFILES) THEN
                0575         CALL PROFILES_INIT_VARIA( myThid )
                0576       ENDIF
                0577 #endif /* ALLOW_PROFILES */
                0578 
                0579 C--   Initialise pkg/ecco (and related pkgs components)
                0580 #ifdef ALLOW_ECCO
17cee39df2 Timo*0581 # ifdef ALLOW_AUTODIFF_TAMC
                0582 #  if (defined (ALLOW_UVEL0_CONTROL) && defined (ALLOW_VVEL0_CONTROL))
                0583 CADJ STORE uvel = tapelev_init, key = 1
                0584 CADJ STORE vvel = tapelev_init, key = 1
                0585 #  endif
7448700841 Mart*0586 #  ifdef ALLOW_PSBAR_STERIC
                0587 C     In some set-ups (e.g. lab_sea), this is necessary
                0588 CADJ STORE etaN  = tapelev_init, key = 1
                0589 CADJ STORE theta = tapelev_init, key = 1
                0590 CADJ STORE salt  = tapelev_init, key = 1
                0591 #  endif
17cee39df2 Timo*0592 # endif
a424c359ed Gael*0593       IF ( useECCO ) CALL ECCO_INIT_VARIA( myThid )
72c872192a Gael*0594 #endif
                0595 
                0596 C--   Initialise pkg/ctl (and related pkgs components)
                0597 #ifdef ALLOW_CTRL
af61e5eb16 Mart*0598 # ifdef ALLOW_AUTODIFF
                0599 C- Note: use same trick as for pkg/gmredi (call to GMREDI_INIT_VARIA) when
                0600 C     compiling pkg/autodiff (with "If useOBCS" inside ctrl_init_variables.F)
                0601 # else
a424c359ed Gael*0602       IF (useCTRL) THEN
af61e5eb16 Mart*0603 # endif
72c872192a Gael*0604 # ifdef ALLOW_DEBUG
a424c359ed Gael*0605         IF (debugMode) CALL DEBUG_CALL('CTRL_INIT_VARIABLES',myThid)
659f2b2337 Jean*0606 # endif
a424c359ed Gael*0607         CALL CTRL_INIT_VARIABLES ( myThid )
af61e5eb16 Mart*0608 # ifndef ALLOW_AUTODIFF
a424c359ed Gael*0609       ENDIF
af61e5eb16 Mart*0610 # endif
a424c359ed Gael*0611 #endif /* ALLOW_CTRL */
659f2b2337 Jean*0612 
793e174778 Jean*0613 #ifdef ALLOW_OBCS
                0614 C--   put this call in last position (needs to come after few {PKG}_init_varia)
                0615       IF (useOBCS) THEN
                0616 # ifdef ALLOW_DEBUG
                0617         IF (debugMode) CALL DEBUG_CALL('OBCS_INIT_VARIABLES',myThid)
                0618 # endif
                0619         CALL OBCS_INIT_VARIABLES( myThid )
                0620       ENDIF
                0621 #endif /* ALLOW_OBCS */
                0622 
abb214f17f Alis*0623 #ifdef ALLOW_DEBUG
e33db7ef40 Jean*0624       IF (debugMode)
9e6ee95b0d Ed H*0625      &     CALL DEBUG_LEAVE('PACKAGES_INIT_VARIABLES',myThid)
5b1a890519 Jean*0626 #endif /* ALLOW_DEBUG */
39cebd8084 Ed H*0627 
fb481a83c2 Alis*0628       RETURN
                0629       END