1 |
jmc |
1.2 |
C $Header: /u/gcmpack/MITgcm/pkg/autodiff/g_dummy_in_dynamics.F,v 1.1 2011/02/26 00:41:20 heimbach Exp $ |
2 |
heimbach |
1.1 |
C $Name: $ |
3 |
|
|
|
4 |
|
|
#include "AUTODIFF_OPTIONS.h" |
5 |
jmc |
1.2 |
#include "AD_CONFIG.h" |
6 |
heimbach |
1.1 |
|
7 |
|
|
CBOP |
8 |
|
|
C !ROUTINE: g_dummy_in_dynamics |
9 |
|
|
C !INTERFACE: |
10 |
|
|
subroutine g_dummy_in_dynamics( mytime, myiter, myThid ) |
11 |
|
|
|
12 |
|
|
C !DESCRIPTION: \bv |
13 |
|
|
C *==========================================================* |
14 |
|
|
C | SUBROUTINE g_dummy_in_dynamics | |
15 |
|
|
C *==========================================================* |
16 |
|
|
C Extract tangent linear variable from TAMC/TAF-generated |
17 |
|
|
C tangent linear common blocks, contained in g_common.h |
18 |
|
|
C and write fields to file; |
19 |
|
|
C Make sure common blocks in g_common.h are up-to-date |
20 |
|
|
C w.r.t. current adjoint code. |
21 |
|
|
C *==========================================================* |
22 |
|
|
C | SUBROUTINE g_dummy_in_dynamics | |
23 |
|
|
C *==========================================================* |
24 |
|
|
C \ev |
25 |
|
|
|
26 |
|
|
C !USES: |
27 |
|
|
IMPLICIT NONE |
28 |
|
|
|
29 |
|
|
C == Global variables === |
30 |
|
|
#include "SIZE.h" |
31 |
|
|
#include "EEPARAMS.h" |
32 |
|
|
#include "PARAMS.h" |
33 |
|
|
#ifdef ALLOW_AUTODIFF_MONITOR |
34 |
|
|
# include "g_common.h" |
35 |
|
|
#endif |
36 |
|
|
|
37 |
|
|
LOGICAL DIFFERENT_MULTIPLE |
38 |
|
|
EXTERNAL DIFFERENT_MULTIPLE |
39 |
|
|
INTEGER IO_ERRCOUNT |
40 |
|
|
EXTERNAL IO_ERRCOUNT |
41 |
|
|
|
42 |
|
|
C !INPUT/OUTPUT PARAMETERS: |
43 |
|
|
C == Routine arguments == |
44 |
|
|
C myIter - iteration counter for this thread |
45 |
|
|
C myTime - time counter for this thread |
46 |
|
|
C myThid - Thread number for this instance of the routine. |
47 |
|
|
integer myThid |
48 |
|
|
integer myiter |
49 |
|
|
_RL mytime |
50 |
|
|
|
51 |
|
|
#ifdef ALLOW_TANGENTLINEAR_RUN |
52 |
|
|
#ifdef ALLOW_AUTODIFF_MONITOR |
53 |
|
|
|
54 |
|
|
C !LOCAL VARIABLES: |
55 |
|
|
c == local variables == |
56 |
|
|
C suff - Hold suffix part of a filename |
57 |
|
|
C beginIOErrCount - Begin and end IO error counts |
58 |
|
|
C endIOErrCount |
59 |
|
|
C msgBuf - Error message buffer |
60 |
|
|
CHARACTER*(MAX_LEN_FNAM) suff |
61 |
|
|
INTEGER beginIOErrCount |
62 |
|
|
INTEGER endIOErrCount |
63 |
|
|
CHARACTER*(MAX_LEN_MBUF) msgBuf |
64 |
|
|
|
65 |
|
|
c == end of interface == |
66 |
|
|
CEOP |
67 |
|
|
|
68 |
|
|
call TIMER_START('I/O (WRITE) [ADJOINT LOOP]', myThid ) |
69 |
|
|
|
70 |
|
|
IF ( |
71 |
|
|
& DIFFERENT_MULTIPLE(adjDumpFreq,mytime,deltaTClock) |
72 |
|
|
& ) THEN |
73 |
|
|
|
74 |
|
|
write(*,*) 'myIter= ',myiter |
75 |
|
|
|
76 |
|
|
_BARRIER |
77 |
|
|
_BEGIN_MASTER( myThid ) |
78 |
|
|
|
79 |
|
|
C-- Set suffix for this set of data files. |
80 |
|
|
WRITE(suff,'(I10.10)') myIter |
81 |
|
|
writeBinaryPrec = writeStatePrec |
82 |
|
|
|
83 |
|
|
C-- Read IO error counter |
84 |
|
|
beginIOErrCount = IO_ERRCOUNT(myThid) |
85 |
|
|
|
86 |
|
|
#ifdef ALLOW_AUTODIFF_MONITOR_DIAG |
87 |
|
|
CALL WRITE_FLD_XYZ_RL( |
88 |
|
|
& 'G_Jrhoinsitu.',suff, g_rhoinsitu, myIter, myThid) |
89 |
|
|
CALL WRITE_FLD_XYZ_RL( |
90 |
|
|
& 'G_Jtotphihyd.',suff, g_totphihyd, myIter, myThid) |
91 |
|
|
#endif |
92 |
|
|
|
93 |
|
|
_END_MASTER( myThid ) |
94 |
|
|
_BARRIER |
95 |
|
|
|
96 |
|
|
ENDIF |
97 |
|
|
|
98 |
|
|
call TIMER_STOP( 'I/O (WRITE) [ADJOINT LOOP]', myThid ) |
99 |
|
|
|
100 |
|
|
#endif /* ALLOW_AUTODIFF_MONITOR */ |
101 |
|
|
#endif /* ALLOW_TANGENTLINEAR_RUN */ |
102 |
|
|
|
103 |
|
|
end |
104 |
|
|
|
105 |
|
|
|
106 |
|
|
|
107 |
|
|
|
108 |
|
|
|
109 |
|
|
|
110 |
|
|
|
111 |
|
|
|
112 |
|
|
|