| 1 |
utke |
1.1 |
subroutine template() |
| 2 |
|
|
use OAD_cp |
| 3 |
|
|
use OAD_tape |
| 4 |
|
|
use OAD_rev |
| 5 |
|
|
|
| 6 |
|
|
c we may need these for the checkpointing |
| 7 |
|
|
use SIZE_mod |
| 8 |
|
|
use EEPARAMS_mod |
| 9 |
|
|
use PARAMS_mod |
| 10 |
|
|
use BAR2_mod |
| 11 |
|
|
use BARRIER_mod |
| 12 |
|
|
use CD_CODE_VARS_mod |
| 13 |
|
|
use CG2D_mod |
| 14 |
|
|
use CG3D_mod |
| 15 |
|
|
use DFILE_mod |
| 16 |
|
|
use DYNVARS_mod |
| 17 |
|
|
use EESUPPORT_mod |
| 18 |
|
|
use EOS_mod |
| 19 |
|
|
use EXCH_JAM_mod |
| 20 |
|
|
use EXCH_mod |
| 21 |
|
|
use FC_NAMEMANGLE_mod |
| 22 |
|
|
use FFIELDS_mod |
| 23 |
|
|
use GAD_mod |
| 24 |
|
|
use GLOBAL_MAX_mod |
| 25 |
|
|
use GLOBAL_SUM_mod |
| 26 |
|
|
use GMREDI_mod |
| 27 |
|
|
use GMREDI_TAVE_mod |
| 28 |
|
|
use GRID_mod |
| 29 |
|
|
use MPI_INFO_mod |
| 30 |
|
|
use SOLVE_FOR_PRESSURE3D_mod |
| 31 |
|
|
use SOLVE_FOR_PRESSURE_mod |
| 32 |
|
|
use SURFACE_mod |
| 33 |
|
|
use tamc_mod |
| 34 |
|
|
use tamc_keys_mod |
| 35 |
|
|
use cost_mod |
| 36 |
|
|
use g_cost_mod |
| 37 |
|
|
use ctrl_mod |
| 38 |
|
|
use ctrl_dummy_mod |
| 39 |
|
|
use ctrl_weights_mod |
| 40 |
|
|
use optim_mod |
| 41 |
|
|
use grdchk_mod |
| 42 |
|
|
|
| 43 |
|
|
!$TEMPLATE_PRAGMA_DECLARATIONS |
| 44 |
|
|
|
| 45 |
|
|
integer :: cp_loop_variable_1,cp_loop_variable_2, |
| 46 |
|
|
+ cp_loop_variable_3,cp_loop_variable_4,cp_loop_variable_5 |
| 47 |
|
|
|
| 48 |
|
|
type(modeType) :: our_orig_mode |
| 49 |
|
|
|
| 50 |
|
|
integer iaddr |
| 51 |
|
|
external iaddr |
| 52 |
|
|
|
| 53 |
utke |
1.2 |
#ifdef OAD_DEBUG_JOINT |
| 54 |
utke |
1.1 |
character*(80):: indentation=' |
| 55 |
|
|
+ ' |
| 56 |
|
|
|
| 57 |
|
|
our_indent=our_indent+1 |
| 58 |
|
|
|
| 59 |
utke |
1.3 |
write(standardmessageunit, '(A,A,A)', ADVANCE='NO') |
| 60 |
utke |
1.2 |
+'OAD:',indentation(1:our_indent), 'enter __SRNAME__:' |
| 61 |
utke |
1.1 |
call oad_dump_revmod(); call oad_dump_tapestats() |
| 62 |
utke |
1.3 |
write(standardmessageunit,*) |
| 63 |
utke |
1.2 |
#endif |
| 64 |
utke |
1.1 |
|
| 65 |
|
|
if (our_rev_mode%arg_store |
| 66 |
|
|
+ .OR. |
| 67 |
|
|
+ our_rev_mode%arg_restore) then |
| 68 |
utke |
1.3 |
write(errormessageunit,'(A)') |
| 69 |
|
|
+'OAD: ERROR : arg (re)store here is wrong logic' |
| 70 |
utke |
1.1 |
stop |
| 71 |
|
|
end if |
| 72 |
|
|
if (our_rev_mode%plain) then |
| 73 |
utke |
1.2 |
#ifdef OAD_DEBUG_JOINT |
| 74 |
utke |
1.3 |
write(standardmessageunit,'(A,A,A)') |
| 75 |
utke |
1.2 |
+'OAD:',indentation(1:our_indent), |
| 76 |
utke |
1.1 |
+' __SRNAME__: entering plain' |
| 77 |
utke |
1.2 |
#endif |
| 78 |
utke |
1.1 |
our_orig_mode=our_rev_mode |
| 79 |
|
|
!$PLACEHOLDER_PRAGMA$ id=1 |
| 80 |
|
|
our_rev_mode=our_orig_mode |
| 81 |
|
|
end if |
| 82 |
|
|
if (our_rev_mode%tape) then |
| 83 |
utke |
1.2 |
#ifdef OAD_DEBUG_JOINT |
| 84 |
utke |
1.3 |
write(standardmessageunit,'(A,A,A)') |
| 85 |
utke |
1.2 |
+'OAD:',indentation(1:our_indent), |
| 86 |
utke |
1.1 |
+' __SRNAME__: entering tape' |
| 87 |
utke |
1.2 |
#endif |
| 88 |
utke |
1.1 |
our_orig_mode=our_rev_mode |
| 89 |
|
|
!$PLACEHOLDER_PRAGMA$ id=2 |
| 90 |
|
|
our_rev_mode=our_orig_mode |
| 91 |
|
|
end if |
| 92 |
|
|
if (our_rev_mode%adjoint) then |
| 93 |
utke |
1.2 |
#ifdef OAD_DEBUG_JOINT |
| 94 |
utke |
1.3 |
write(standardmessageunit,'(A,A,A)') |
| 95 |
utke |
1.2 |
+'OAD:',indentation(1:our_indent), |
| 96 |
utke |
1.1 |
+' __SRNAME__: entering adjoint' |
| 97 |
utke |
1.2 |
#endif |
| 98 |
utke |
1.1 |
our_orig_mode=our_rev_mode |
| 99 |
|
|
!$PLACEHOLDER_PRAGMA$ id=3 |
| 100 |
|
|
our_rev_mode=our_orig_mode |
| 101 |
|
|
end if |
| 102 |
|
|
|
| 103 |
utke |
1.2 |
#ifdef OAD_DEBUG_JOINT |
| 104 |
utke |
1.3 |
write(standardmessageunit,'(A,A,A)', ADVANCE='NO') |
| 105 |
utke |
1.2 |
+'OAD:',indentation(1:our_indent), 'leave __SRNAME__:' |
| 106 |
utke |
1.1 |
call oad_dump_revmod(); call oad_dump_tapestats() |
| 107 |
utke |
1.3 |
write(standardmessageunit,*) |
| 108 |
utke |
1.1 |
|
| 109 |
|
|
our_indent=our_indent-1 |
| 110 |
utke |
1.2 |
#endif |
| 111 |
utke |
1.1 |
|
| 112 |
|
|
end subroutine template |