forked from altMITgcm/MITgcm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
g_dummy_in_dynamics.F
94 lines (77 loc) · 2.74 KB
/
g_dummy_in_dynamics.F
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
C $Header: /u/gcmpack/MITgcm/pkg/autodiff/g_dummy_in_dynamics.F,v 1.4 2014/04/04 23:03:59 jmc Exp $
C $Name: $
#include "AUTODIFF_OPTIONS.h"
#ifdef ALLOW_CTRL
# include "CTRL_OPTIONS.h"
#endif
#include "AD_CONFIG.h"
CBOP
C !ROUTINE: g_dummy_in_dynamics
C !INTERFACE:
subroutine g_dummy_in_dynamics( myTime, myIter, myThid )
C !DESCRIPTION: \bv
C *==========================================================*
C | SUBROUTINE g_dummy_in_dynamics |
C *==========================================================*
C Extract tangent linear variable from TAMC/TAF-generated
C tangent linear common blocks, contained in g_common.h
C and write fields to file;
C Make sure common blocks in g_common.h are up-to-date
C w.r.t. current adjoint code.
C *==========================================================*
C | SUBROUTINE g_dummy_in_dynamics |
C *==========================================================*
C \ev
C !USES:
IMPLICIT NONE
C == Global variables ===
#include "SIZE.h"
#include "EEPARAMS.h"
#include "PARAMS.h"
#ifdef ALLOW_AUTODIFF_MONITOR
# include "g_common.h"
#endif
C !INPUT/OUTPUT PARAMETERS:
C == Routine arguments ==
C myTime :: time counter for this thread
C myIter :: iteration counter for this thread
C myThid :: Thread number for this instance of the routine.
_RL myTime
INTEGER myIter
INTEGER myThid
#ifdef ALLOW_TANGENTLINEAR_RUN
#ifdef ALLOW_AUTODIFF_MONITOR
C !FUNCTIONS:
LOGICAL DIFFERENT_MULTIPLE
EXTERNAL DIFFERENT_MULTIPLE
C !LOCAL VARIABLES:
c == local variables ==
C suff :: Hold suffix part of a filename
C msgBuf :: Error message buffer
CHARACTER*(MAX_LEN_FNAM) suff
c CHARACTER*(MAX_LEN_MBUF) msgBuf
CEOP
IF (
& DIFFERENT_MULTIPLE(adjDumpFreq,myTime,deltaTClock)
& ) THEN
CALL TIMER_START('I/O (WRITE) [ADJOINT LOOP]', myThid )
c write(*,*) 'myIter= ',myIter
C-- Set suffix for this set of data files.
WRITE(suff,'(I10.10)') myIter
C ==>> Resetting run-time parameter writeBinaryPrec in the middle of a run
C ==>> is very very very nasty !!!
c writeBinaryPrec = writeStatePrec
C <<== If you really want to mess-up with this at your own risk,
C <<== uncomment the line above
#ifdef ALLOW_AUTODIFF_MONITOR_DIAG
CALL WRITE_FLD_XYZ_RL(
& 'G_Jrhoinsitu.',suff, g_rhoinsitu, myIter, myThid)
CALL WRITE_FLD_XYZ_RL(
& 'G_Jtotphihyd.',suff, g_totphihyd, myIter, myThid)
#endif
CALL TIMER_STOP( 'I/O (WRITE) [ADJOINT LOOP]', myThid )
ENDIF
#endif /* ALLOW_AUTODIFF_MONITOR */
#endif /* ALLOW_TANGENTLINEAR_RUN */
RETURN
END