| 1 |
C $Header: /u/gcmpack/MITgcm_contrib/heimbach/OpenAD/code_common/the_first_level_loop.F,v 1.4 2009/02/24 21:31:19 utke Exp $ |
| 2 |
C $Name: $ |
| 3 |
|
| 4 |
#include "PACKAGES_CONFIG.h" |
| 5 |
#include "CPP_OPTIONS.h" |
| 6 |
#ifdef ALLOW_OBCS |
| 7 |
# include "OBCS_OPTIONS.h" |
| 8 |
#endif |
| 9 |
#ifdef ALLOW_SEAICE |
| 10 |
# include "SEAICE_OPTIONS.h" |
| 11 |
#endif |
| 12 |
#ifdef ALLOW_GMREDI |
| 13 |
# include "GMREDI_OPTIONS.h" |
| 14 |
#endif |
| 15 |
|
| 16 |
C start with a copy of THE_MAIN_LOOP |
| 17 |
C and remove some the obvious extras |
| 18 |
SUBROUTINE THE_FIRST_LEVEL_LOOP(iLoop, |
| 19 |
+myTime, myIter, myThid ) |
| 20 |
IMPLICIT NONE |
| 21 |
|
| 22 |
C == Global variables == |
| 23 |
#include "SIZE.h" |
| 24 |
#include "EEPARAMS.h" |
| 25 |
#include "PARAMS.h" |
| 26 |
|
| 27 |
c************************************** |
| 28 |
#ifdef ALLOW_AUTODIFF_TAMC |
| 29 |
|
| 30 |
c These includes are needed for |
| 31 |
c AD-checkpointing. |
| 32 |
c They provide the fields to be stored. |
| 33 |
|
| 34 |
# include "GRID.h" |
| 35 |
# include "DYNVARS.h" |
| 36 |
# include "FFIELDS.h" |
| 37 |
# include "EOS.h" |
| 38 |
# include "GAD.h" |
| 39 |
# ifdef ALLOW_CAL |
| 40 |
# include "cal.h" |
| 41 |
# endif |
| 42 |
# ifdef ALLOW_CD_CODE |
| 43 |
# include "CD_CODE_VARS.h" |
| 44 |
# endif |
| 45 |
# ifdef ALLOW_PTRACERS |
| 46 |
# include "PTRACERS_SIZE.h" |
| 47 |
# include "PTRACERS.h" |
| 48 |
# endif |
| 49 |
# ifdef EXACT_CONSERV |
| 50 |
# include "SURFACE.h" |
| 51 |
# endif |
| 52 |
# ifdef ALLOW_OBCS |
| 53 |
# include "OBCS.h" |
| 54 |
# endif |
| 55 |
# ifdef ALLOW_EXF |
| 56 |
# include "EXF_FIELDS.h" |
| 57 |
# include "EXF_PARAM.h" |
| 58 |
# ifdef ALLOW_BULKFORMULAE |
| 59 |
# include "EXF_CONSTANTS.h" |
| 60 |
# endif |
| 61 |
# endif /* ALLOW_EXF */ |
| 62 |
# ifdef ALLOW_SEAICE |
| 63 |
# include "SEAICE.h" |
| 64 |
# endif |
| 65 |
# ifdef ALLOW_EBM |
| 66 |
# include "EBM.h" |
| 67 |
# endif |
| 68 |
# ifdef ALLOW_KPP |
| 69 |
# include "KPP.h" |
| 70 |
# include "KPP_DIAGS.h" |
| 71 |
# include "KPP_PARAMS.h" |
| 72 |
# endif |
| 73 |
# ifdef ALLOW_DIVIDED_ADJOINT_MPI |
| 74 |
# include "mpif.h" |
| 75 |
# endif |
| 76 |
|
| 77 |
# include "tamc.h" |
| 78 |
# include "ctrl.h" |
| 79 |
# include "ctrl_dummy.h" |
| 80 |
# include "cost.h" |
| 81 |
|
| 82 |
#endif /* ALLOW_AUTODIFF_TAMC */ |
| 83 |
|
| 84 |
integer iLoop |
| 85 |
INTEGER myThid |
| 86 |
INTEGER myIter |
| 87 |
_RL myTime |
| 88 |
|
| 89 |
C !LOCAL VARIABLES: |
| 90 |
C == Local variables == |
| 91 |
|
| 92 |
#ifdef ALLOW_DEBUG |
| 93 |
IF (debugMode) CALL DEBUG_ENTER('THE_FIRST_LEVEL_LOOP',myThid) |
| 94 |
#endif |
| 95 |
#ifdef OAD_DEBUG |
| 96 |
write(standardmessageunit,'(2(A,I6))') |
| 97 |
+ 'OAD: THE_FIRST_LEVEL_LOOP: iloop=',iLoop,' of ',nTimeSteps |
| 98 |
#endif |
| 99 |
#ifdef ALLOW_DEBUG |
| 100 |
IF (debugMode) CALL DEBUG_CALL('FORWARD_STEP',myThid) |
| 101 |
#endif |
| 102 |
CALL FORWARD_STEP( iLoop, |
| 103 |
+mytime, myiter, mythid ) |
| 104 |
|
| 105 |
#ifdef ALLOW_DEBUG |
| 106 |
IF (debugMode) CALL DEBUG_LEAVE('THE_FIRST_LEVEL_LOOP',myThid) |
| 107 |
#endif |
| 108 |
|
| 109 |
END |
| 110 |
|