subroutine template() use OAD_tape use OAD_rev use OAD_cp ! original arguments get inserted before version ! and declared here together with all local variables ! generated by xaifBooster !$TEMPLATE_PRAGMA_DECLARATIONS ! checkpointing stacks and offsets integer :: cp_loop_variable_1,cp_loop_variable_2, +cp_loop_variable_3,cp_loop_variable_4 ! floats 'F' double precision, dimension(:), allocatable, save :: +theArgFStack integer, save :: theArgFStackoffset=0, theArgFStackSize=0 double precision, dimension(:), allocatable, save :: +theResFStack integer, save :: theResFStackoffset=0, theResFStackSize=0 ! integers 'I' integer, dimension(:), allocatable, save :: +theArgIStack integer, save :: theArgIStackoffset=0, theArgIStackSize=0 integer, dimension(:), allocatable, save :: +theResIStack integer, save :: theResIStackoffset=0, theResIStackSize=0 ! booleans 'B' logical, dimension(:), allocatable, save :: +theArgBStack integer, save :: theArgBStackoffset=0, theArgBStackSize=0 logical, dimension(:), allocatable, save :: +theResBStack integer, save :: theResBStackoffset=0, theResBStackSize=0 ! strings 'S' character*(80), dimension(:), allocatable, save :: +theArgSStack integer, save :: theArgSStackoffset=0, theArgSStackSize=0 character*(80), dimension(:), allocatable, save :: +theResSStack integer, save :: theResSStackoffset=0, theResSStackSize=0 type(modeType) :: our_orig_mode ! call external C function used in inlined code integer iaddr external iaddr if (our_rev_mode%arg_store) then C print*, " arg_store ", our_rev_mode C store arguments !$PLACEHOLDER_PRAGMA$ id=4 end if if (our_rev_mode%arg_restore) then C print*, " arg_restore", our_rev_mode C restore arguments !$PLACEHOLDER_PRAGMA$ id=6 end if if (our_rev_mode%plain) then C print*, " plain ", our_rev_mode our_orig_mode=our_rev_mode our_rev_mode%arg_store=.FALSE. C original function !$PLACEHOLDER_PRAGMA$ id=1 our_rev_mode=our_orig_mode end if if (our_rev_mode%tape) then C print*, " tape ", our_rev_mode our_rev_mode%arg_store=.TRUE. our_rev_mode%arg_restore=.FALSE. our_rev_mode%res_store=.FALSE. our_rev_mode%res_restore=.FALSE. our_rev_mode%plain=.TRUE. our_rev_mode%tape=.FALSE. our_rev_mode%adjoint=.FALSE. C taping !$PLACEHOLDER_PRAGMA$ id=2 our_rev_mode%arg_store=.FALSE. our_rev_mode%arg_restore=.FALSE. our_rev_mode%res_store=.FALSE. our_rev_mode%res_restore=.FALSE. our_rev_mode%plain=.FALSE. our_rev_mode%tape=.FALSE. our_rev_mode%adjoint=.TRUE. end if if (our_rev_mode%res_restore) then C restore results !$PLACEHOLDER_PRAGMA$ id=7 end if if (our_rev_mode%adjoint) then C print*, " adjoint ", our_rev_mode our_rev_mode%arg_store=.FALSE. our_rev_mode%arg_restore=.TRUE. our_rev_mode%res_store=.FALSE. our_rev_mode%res_restore=.FALSE. our_rev_mode%plain=.FALSE. our_rev_mode%tape=.TRUE. our_rev_mode%adjoint=.FALSE. C adjoint !$PLACEHOLDER_PRAGMA$ id=3 our_rev_mode%arg_store=.FALSE. our_rev_mode%arg_restore=.TRUE. our_rev_mode%res_store=.FALSE. our_rev_mode%res_restore=.FALSE. our_rev_mode%plain=.FALSE. our_rev_mode%tape=.TRUE. our_rev_mode%adjoint=.FALSE. end if if (our_rev_mode%res_store) then C store results C print*, " res_store ", our_rev_mode !$PLACEHOLDER_PRAGMA$ id=5 end if end subroutine template