1 |
|
|
2 |
|
CBOI |
3 |
|
C |
4 |
|
C !TITLE: ADJOINT CODE |
5 |
|
C !AUTHORS: mitgcm developers ( support@mitgcm.org ) |
6 |
|
C !AFFILIATION: Massachussetts Institute of Technology |
7 |
|
C !DATE: |
8 |
|
C !INTRODUCTION: adjoint code collection |
9 |
|
c \bv |
10 |
|
c Top level routine for adjoint code generation is the_main_loop. |
11 |
|
c Adjoint code is generated via the makefile in adjoint/ |
12 |
|
c 0. make restore: |
13 |
|
c Re-instate header or adjoint_model.F from template |
14 |
|
c 1. make: |
15 |
|
c All .f files are concatenated into one file |
16 |
|
c tamc_code_ecco.f |
17 |
|
c 2. make adtaf: |
18 |
|
c This makefiles contains a list of all routines which must be |
19 |
|
c differentiated (i.e. analyzed by TAMC/TAF) and those which |
20 |
|
c must not be differentiated. For the latter, files containing |
21 |
|
c flow directives are given. |
22 |
|
c The code generated by TAMC/TAF is written to |
23 |
|
c tamc_code_ecco_ad.f |
24 |
|
c 3. make adchange: |
25 |
|
c To maintain the multi-threading index mythid, |
26 |
|
c the adjoint code must be post-processed. |
27 |
|
c All parameter lists of active I/O routines |
28 |
|
c (active read/write open/close) are augmented by mythid. |
29 |
|
c The resulting code is copied to |
30 |
|
c tamc_code_ecco_sed_ad.f |
31 |
|
c and concatenated to adjoint_model.F |
32 |
|
c |
33 |
|
c Documentation: |
34 |
|
c ============== |
35 |
|
c For a documentation of TAMC see: |
36 |
|
c http://puddle.mit.edu/~ralf/tamc/tamc.html |
37 |
|
c For more info on TAF see: |
38 |
|
c http://www.fastopt.de |
39 |
|
C \ev |
40 |
|
CBOI |
41 |
|
|
42 |
#include "CPP_OPTIONS.h" |
#include "CPP_OPTIONS.h" |
43 |
|
|
44 |
subroutine adjoint_model( |
CBOP |
45 |
I mythid |
C !ROUTINE: adjoint_model |
46 |
& ) |
C !INTERFACE: |
47 |
|
subroutine adjoint_model(mythid ) |
48 |
|
|
49 |
|
C !DESCRIPTION: \bv |
50 |
c ================================================================== |
c ================================================================== |
51 |
c SUBROUTINE adjoint_model |
c SUBROUTINE adjoint_model |
52 |
c ================================================================== |
c ================================================================== |
|
c |
|
53 |
c o This is just a place holder for the TAMC generated adjoint code |
c o This is just a place holder for the TAMC generated adjoint code |
54 |
c of the MITgcmuv and related routines. Below you find a short |
c of the MITgcmuv and related routines. Below you find a short |
55 |
c description of some topics pertaining to the adjoint model. |
c description of some topics pertaining to the adjoint model. |
|
c |
|
56 |
c This routine will be overwritten as soon as TAMC will have |
c This routine will be overwritten as soon as TAMC will have |
57 |
c generated the adjoint model. If you want to keep it copy it |
c generated the adjoint model. If you want to keep it copy it |
58 |
c to another place. |
c to another place. |
|
c |
|
|
c |
|
|
c Documentation: |
|
|
c ============== |
|
|
c |
|
|
c This is a brief description of the MITgcmuv adjoint model. |
|
|
c |
|
|
c Contents: |
|
|
c |
|
|
c 1.0 Basics |
|
|
c 2.0 The Tangent Linear and Adjoint Model Compiler |
|
|
c 2.1. TAMC Directives |
|
|
c 2.2. Hand-coded MITgcmUV Routines |
|
|
c 2.3. Postprocessing of the TAMC Generated Adjoint Code |
|
|
c |
|
|
c 3.0 Data Management |
|
|
c 3.1. Active Variables on File |
|
|
c 3.2. Storing the Reference Trajectory |
|
|
c |
|
|
c 4.0 Checkpointing |
|
|
c 4.1. Checkpointing the Adjoint Code |
|
|
c 4.2. Checkpointing the Model; Doing Restarts |
|
|
c |
|
|
c |
|
|
c For a documentation of the MITgcmuv see: |
|
|
c |
|
|
c Hydrostatic, quasi-hydrostatic, and nonhydrostatic ocean |
|
|
c modeling. |
|
|
c J. Marshall, Ch. Hill, L. Perelman, and A. Adcroft |
|
|
c JGR, Vol. 102, No. C3, pp. 5733-5752 |
|
|
c |
|
|
c A finite-volume, incompressible Navier Stokes model for |
|
|
c studies of the ocean on parallel computers. |
|
|
c J. Marshall, A. Adcroft, Ch. Hill, L. Perelman, and |
|
|
c C. Heisey |
|
|
c JGR, Vol. 102, No. C3, pp. 5753-5766 |
|
|
c |
|
|
c Representation of Topography by Shaved Cells in a Height |
|
|
c Coordinate Ocean Model. |
|
|
c A. Adcroft, Ch. Hill, and J. Marshall |
|
|
c Mon. Wea. Rev., 1997, Vol. 125, pp. 2293-2315 |
|
|
c |
|
|
c |
|
|
c For a documentation of the Tangent Linear and Adjoint |
|
|
c Model Compiler see: |
|
|
c |
|
|
c http://puddle.mit.edu/~ralf/tamc/tamc.html |
|
|
c and the references therein. |
|
|
c |
|
|
c |
|
|
c 1.0 Basics |
|
|
c |
|
|
c |
|
|
c 2.0 The Tangent Linear and Adjoint Model Compiler |
|
|
c |
|
|
c 2.1. TAMC Directives |
|
|
c |
|
|
c 2.2. Hand-coded MITgcmUV Routines |
|
|
c |
|
|
c |
|
|
c 3.0 Data Management |
|
|
c |
|
|
c 3.1. Active Variables on File |
|
|
c |
|
|
c 3.2. Storing the Reference Trajectory |
|
|
c |
|
|
c |
|
|
c 4.0 Checkpointing |
|
|
c |
|
|
c 4.1. Checkpointing the Adjoint Code |
|
|
c |
|
|
c 4.2. Checkpointing the Model; Doing Restarts |
|
|
c |
|
|
c |
|
59 |
c started: Christian Eckert eckert@mit.edu 21-Jul-1999 |
c started: Christian Eckert eckert@mit.edu 21-Jul-1999 |
|
c |
|
|
c changed: Christian Eckert eckert@mit.edu 11-Feb-2000 |
|
|
c |
|
|
c - Restructured the code in order to create a package |
|
|
c for the MITgcmUV. |
|
|
c |
|
60 |
c ================================================================== |
c ================================================================== |
61 |
c SUBROUTINE adjoint_model |
c SUBROUTINE adjoint_model |
62 |
c ================================================================== |
c ================================================================== |
63 |
|
C \ev |
64 |
|
|
65 |
|
C !USES: |
66 |
implicit none |
implicit none |
67 |
|
|
68 |
c == routine arguments == |
c == routine arguments == |
70 |
integer mythid |
integer mythid |
71 |
|
|
72 |
c == end of interface == |
c == end of interface == |
73 |
|
CEOP |
74 |
|
|
75 |
return |
return |
76 |
end |
end |