/[MITgcm]/MITgcm_contrib/heimbach/OpenAD/code_shallow_openad3/OpenAD_tape.f90
ViewVC logotype

Annotation of /MITgcm_contrib/heimbach/OpenAD/code_shallow_openad3/OpenAD_tape.f90

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.3 - (hide annotations) (download)
Thu Jan 11 16:54:08 2007 UTC (19 years, 10 months ago) by utke
Branch: MAIN
Changes since 1.2: +3 -1 lines
reuse changes made for setup 2 for linear tape increment,
writing checkpoints to file, and printing resulting gradients to
file

1 utke 1.1 module OpenAD_tape
2     implicit none
3    
4     private
5     public :: double_tape, double_tmp_tape, &
6     & double_tape_pointer, double_tape_size, &
7     & integer_tape, integer_tmp_tape, &
8     & integer_tape_pointer, integer_tape_size, &
9 utke 1.2 & logical_tape, logical_tmp_tape, &
10     & logical_tape_pointer, logical_tape_size, &
11     & string_tape, string_tmp_tape, &
12     & string_tape_pointer, string_tape_size, &
13 utke 1.3 & tape_init, tape_increment
14 utke 1.1
15     double precision, dimension(:), allocatable :: double_tape, double_tmp_tape
16     integer, dimension(:), allocatable :: integer_tape, integer_tmp_tape
17 utke 1.2 logical, dimension(:), allocatable :: logical_tape, logical_tmp_tape
18     character(80), dimension(:), allocatable :: string_tape, string_tmp_tape
19 utke 1.1 integer :: double_tape_pointer=0, integer_tape_pointer=0
20     integer :: double_tape_size=0, integer_tape_size=0
21 utke 1.2 integer :: logical_tape_pointer=0, string_tape_pointer=0
22     integer :: logical_tape_size=0, string_tape_size=0
23 utke 1.3 integer :: tape_increment
24 utke 1.1
25     interface tape_init
26     module procedure init
27     end interface tape_init
28    
29     contains
30    
31     subroutine init
32     double_tape_pointer=1
33     if (allocated(double_tape)) then
34     deallocate(double_tape)
35     end if
36     double_tape_size=1048576
37     allocate(double_tape(double_tape_size))
38     integer_tape_pointer=1
39     if (allocated(integer_tape)) then
40     deallocate(integer_tape)
41     end if
42     integer_tape_size=1048576
43     allocate(integer_tape(integer_tape_size))
44 utke 1.2 logical_tape_pointer=1
45     if (allocated(logical_tape)) then
46     deallocate(logical_tape)
47     end if
48     logical_tape_size=1048576
49     allocate(logical_tape(logical_tape_size))
50     string_tape_size=1048576
51     allocate(string_tape(string_tape_size))
52     string_tape_pointer=1
53     if (allocated(string_tape)) then
54     deallocate(string_tape)
55     end if
56     string_tape_size=1048576
57     allocate(string_tape(string_tape_size))
58 utke 1.3 tape_increment=16777216
59 utke 1.1 end subroutine init
60    
61     end module OpenAD_tape

  ViewVC Help
Powered by ViewVC 1.1.22