| 1 |
utke |
1.1 |
C $Header: /u/gcmpack/MITgcm_contrib/heimbach/OpenAD/code_heat_transport/the_first_level_loop.F,v 1.1 2007/03/22 20:30:42 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_CD_CODE |
| 40 |
|
|
# include "CD_CODE_VARS.h" |
| 41 |
|
|
# endif |
| 42 |
|
|
# ifdef ALLOW_PTRACERS |
| 43 |
|
|
# include "PTRACERS_SIZE.h" |
| 44 |
|
|
# include "PTRACERS.h" |
| 45 |
|
|
# endif |
| 46 |
|
|
# ifdef EXACT_CONSERV |
| 47 |
|
|
# include "SURFACE.h" |
| 48 |
|
|
# endif |
| 49 |
|
|
# ifdef ALLOW_OBCS |
| 50 |
|
|
# include "OBCS.h" |
| 51 |
|
|
# endif |
| 52 |
|
|
# ifdef ALLOW_EXF |
| 53 |
|
|
# include "exf_fields.h" |
| 54 |
|
|
# include "exf_clim_fields.h" |
| 55 |
|
|
# ifdef ALLOW_BULKFORMULAE |
| 56 |
|
|
# include "exf_constants.h" |
| 57 |
|
|
# endif |
| 58 |
|
|
# endif /* ALLOW_EXF */ |
| 59 |
|
|
# ifdef ALLOW_SEAICE |
| 60 |
|
|
# include "SEAICE.h" |
| 61 |
|
|
# endif |
| 62 |
|
|
# ifdef ALLOW_EBM |
| 63 |
|
|
# include "EBM.h" |
| 64 |
|
|
# endif |
| 65 |
|
|
# ifdef ALLOW_DIVIDED_ADJOINT_MPI |
| 66 |
|
|
# include "mpif.h" |
| 67 |
|
|
# endif |
| 68 |
|
|
|
| 69 |
|
|
# include "tamc.h" |
| 70 |
|
|
# include "ctrl.h" |
| 71 |
|
|
# include "ctrl_dummy.h" |
| 72 |
|
|
# include "cost.h" |
| 73 |
|
|
|
| 74 |
|
|
#endif /* ALLOW_AUTODIFF_TAMC */ |
| 75 |
|
|
|
| 76 |
|
|
integer iLoop |
| 77 |
|
|
INTEGER myThid |
| 78 |
|
|
INTEGER myIter |
| 79 |
|
|
_RL myTime |
| 80 |
|
|
|
| 81 |
|
|
C !LOCAL VARIABLES: |
| 82 |
|
|
C == Local variables == |
| 83 |
|
|
|
| 84 |
|
|
#ifdef ALLOW_DEBUG |
| 85 |
|
|
IF (debugMode) CALL DEBUG_ENTER('THE_FIRST_LEVEL_LOOP',myThid) |
| 86 |
|
|
#endif |
| 87 |
|
|
print *, 'JU: THE_FIRST_LEVEL_LOOP: iloop=',iLoop,' of ',nTimeSteps |
| 88 |
|
|
|
| 89 |
|
|
#ifdef ALLOW_DEBUG |
| 90 |
|
|
IF (debugMode) CALL DEBUG_CALL('FORWARD_STEP',myThid) |
| 91 |
|
|
#endif |
| 92 |
|
|
CALL FORWARD_STEP( iLoop, |
| 93 |
|
|
+mytime, myiter, mythid ) |
| 94 |
|
|
|
| 95 |
|
|
#ifdef ALLOW_DEBUG |
| 96 |
|
|
IF (debugMode) CALL DEBUG_LEAVE('THE_FIRST_LEVEL_LOOP',myThid) |
| 97 |
|
|
#endif |
| 98 |
|
|
|
| 99 |
|
|
END |
| 100 |
|
|
|