/[MITgcm]/MITgcm/verification/bottom_ctrl_5x5/code_ad/addummy_in_stepping.F
ViewVC logotype

Contents of /MITgcm/verification/bottom_ctrl_5x5/code_ad/addummy_in_stepping.F

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


Revision 1.4 - (show annotations) (download)
Sun Aug 12 01:34:44 2012 UTC (7 years, 9 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint64y, checkpoint64x, checkpoint64z, checkpoint64q, checkpoint64p, checkpoint64s, checkpoint64r, checkpoint64u, checkpoint64t, checkpoint64w, checkpoint64v, checkpoint64i, checkpoint64h, checkpoint64k, checkpoint64j, checkpoint64m, checkpoint64l, checkpoint64o, checkpoint64n, checkpoint64a, checkpoint64c, checkpoint64b, checkpoint64e, checkpoint64d, checkpoint64g, checkpoint64f, checkpoint63r, checkpoint63s, checkpoint64, checkpoint65, checkpoint66g, checkpoint66f, checkpoint66e, checkpoint66d, checkpoint66c, checkpoint66b, checkpoint66a, checkpoint66o, checkpoint66n, checkpoint66m, checkpoint66l, checkpoint66k, checkpoint66j, checkpoint66i, checkpoint66h, checkpoint65z, checkpoint65x, checkpoint65y, checkpoint65r, checkpoint65s, checkpoint65p, checkpoint65q, checkpoint65v, checkpoint65w, checkpoint65t, checkpoint65u, checkpoint65j, checkpoint65k, checkpoint65h, checkpoint65i, checkpoint65n, checkpoint65o, checkpoint65l, checkpoint65m, checkpoint65b, checkpoint65c, checkpoint65a, checkpoint65f, checkpoint65g, checkpoint65d, checkpoint65e, HEAD
Changes since 1.3: +2 -2 lines
- include AUTODIFF_OPTIONS.h (previously CPP_OPTIONS.h).
- clean-up dummy_in_hfac.F

1 C $Header: /u/gcmpack/MITgcm/verification/bottom_ctrl_5x5/code_ad/addummy_in_stepping.F,v 1.3 2012/07/06 21:40:53 jmc Exp $
2 C $Name: $
3
4 #include "AUTODIFF_OPTIONS.h"
5 #include "AD_CONFIG.h"
6
7 CBOP
8 C !ROUTINE: addummy_in_stepping
9 C !INTERFACE:
10 subroutine addummy_in_stepping( mytime, myiter, myThid )
11
12 C !DESCRIPTION: \bv
13 C *==========================================================*
14 C | SUBROUTINE addummy_in_stepping |
15 C *==========================================================*
16 C Extract adjoint variable from TAMC/TAF-generated
17 C adjoint common blocks, contained in adcommon.h
18 C and write fields to file;
19 C Make sure common blocks in adcommon.h are up-to-date
20 C w.r.t. current adjoint code.
21 C *==========================================================*
22 C | SUBROUTINE addummy_in_stepping |
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 #include "adcommon.h"
34
35 LOGICAL DIFFERENT_MULTIPLE
36 EXTERNAL DIFFERENT_MULTIPLE
37 INTEGER IO_ERRCOUNT
38 EXTERNAL IO_ERRCOUNT
39
40 C !INPUT/OUTPUT PARAMETERS:
41 C == Routine arguments ==
42 C myIter - iteration counter for this thread
43 C myTime - time counter for this thread
44 C myThid - Thread number for this instance of the routine.
45 integer myThid
46 integer myiter
47 _RL mytime
48
49 C !LOCAL VARIABLES:
50 c == local variables ==
51 C suff - Hold suffix part of a filename
52 C beginIOErrCount - Begin and end IO error counts
53 C endIOErrCount
54 C msgBuf - Error message buffer
55 CHARACTER*(MAX_LEN_FNAM) suff
56 INTEGER beginIOErrCount
57 INTEGER endIOErrCount
58 CHARACTER*(MAX_LEN_MBUF) msgBuf
59
60 c == end of interface ==
61 CEOP
62
63 #if (defined (ALLOW_ADJOINT_RUN) || defined (ALLOW_ADMTLM))
64 #ifdef ALLOW_AUTODIFF_MONITOR
65
66 call TIMER_START('I/O (WRITE) [ADJOINT LOOP]', myThid )
67
68 IF (
69 & DIFFERENT_MULTIPLE(ADJdumpFreq,mytime,deltaTClock)
70 & ) THEN
71
72 write(*,*) 'myIter= ',myiter
73
74 _BARRIER
75 _BEGIN_MASTER( myThid )
76
77 C-- Set suffix for this set of data files.
78 WRITE(suff,'(I10.10)') myIter
79 writeBinaryPrec = writeStatePrec
80
81 C-- Read IO error counter
82 beginIOErrCount = IO_ERRCOUNT(myThid)
83
84 Cml CALL WRITE_FLD_XY_RL ( 'ADJtaux.',suff, adfu, myIter, myThid)
85 Cml CALL WRITE_FLD_XY_RL ( 'ADJtauy.',suff, adfv, myIter, myThid)
86 Cml CALL WRITE_FLD_XY_RL ( 'ADJqnet.',suff, adqnet, myIter, myThid)
87 Cml CALL WRITE_FLD_XY_RL ( 'ADJempr.',suff, adempmr, myIter, myThid)
88 c
89 Cml CALL WRITE_FLD_XYZ_RL(
90 Cml & 'ADJgtnm1.',suff, adgtnm1, myIter, myThid)
91 Cml CALL WRITE_FLD_XYZ_RL(
92 Cml & 'ADJgsnm1.',suff, adgsnm1, myIter, myThid)
93 Cml CALL WRITE_FLD_XYZ_RL(
94 Cml & 'ADJgunm1.',suff, adgunm1, myIter, myThid)
95 Cml CALL WRITE_FLD_XYZ_RL(
96 Cml & 'ADJgvnm1.',suff, adgvnm1, myIter, myThid)
97 Cml#ifdef ALLOW_PASSIVE_TRACER
98 Cml CALL WRITE_FLD_XYZ_RL(
99 Cml & 'ADJgtr1nm1. ',suff, adgtr1nm1, myIter, myThid)
100 Cml#endif
101 c
102 CALL WRITE_FLD_XYZ_RL(
103 & 'ADJtheta.',suff, adtheta, myIter, myThid)
104 CALL WRITE_FLD_XYZ_RL(
105 & 'ADJsalt.',suff, adsalt, myIter, myThid)
106 CALL WRITE_FLD_XYZ_RL(
107 & 'ADJuvel.',suff, aduvel, myIter, myThid)
108 CALL WRITE_FLD_XYZ_RL(
109 & 'ADJvvel.',suff, advvel, myIter, myThid)
110 CALL WRITE_FLD_XYZ_RL(
111 & 'ADJwvel.',suff, adwvel, myIter, myThid)
112
113 Cml#ifdef ALLOW_PASSIVE_TRACER
114 Cml CALL WRITE_FLD_XYZ_RL(
115 Cml & 'ADJtr1. ',suff, adtr1, myIter, myThid)
116 Cml#endif
117 Cml#ifdef ALLOW_DIFFKR_CONTROL
118 Cml CALL WRITE_FLD_XYZ_RL ( 'ADJdiffkr.',suff, addiffkr,
119 Cml & myIter, myThid)
120 Cml#endif
121 Cml#ifdef ALLOW_KAPGM_CONTROL
122 Cml CALL WRITE_FLD_XYZ_RL ( 'ADJkagm.',suff, adkapgm,
123 Cml & myIter, myThid)
124 Cml#endif
125 #ifdef ALLOW_DEPTH_CONTROL
126 CML( Does not make sense at this point
127 CML CALL WRITE_FLD_XY_RL ( 'ADJxx_r_low.',suff,
128 CML & adxx_r_low, myIter, myThid)
129 CML)
130 CALL WRITE_FLD_XYZ_RL ( 'ADJhFacC.',suff,
131 & adhfacc, myIter, myThid)
132 CALL WRITE_FLD_XYZ_RL ( 'ADJhFacS.',suff,
133 & adhfacs, myIter, myThid)
134 CALL WRITE_FLD_XYZ_RL ( 'ADJhFacW.',suff,
135 & adhfacw, myIter, myThid)
136 CALL WRITE_FLD_XYZ_RL ( 'ADJrhFacC.',suff,
137 & adrecip_hfacc, myIter, myThid)
138 CALL WRITE_FLD_XYZ_RL ( 'ADJrhFacS.',suff,
139 & adrecip_hfacs, myIter, myThid)
140 CALL WRITE_FLD_XYZ_RL ( 'ADJrhFacW.',suff,
141 & adrecip_hfacw, myIter, myThid)
142 #endif /* ALLOW_DEPTH_CONTROL */
143
144 cph CALL WRITE_FLD_XY_RL( 'ADJ_sst.',suff, adsst, myIter, myThid)
145 cph CALL WRITE_FLD_XY_RL( 'ADJ_sss.',suff, adsss, myIter, myThid)
146
147 C-- Reread IO error counter
148 endIOErrCount = IO_ERRCOUNT(myThid)
149
150 C-- Check for IO errors
151 IF ( endIOErrCount .NE. beginIOErrCount ) THEN
152 WRITE(msgBuf,'(A)') 'S/R ADDUMMY_IN_STEPPING'
153 CALL PRINT_ERROR( msgBuf, 1 )
154 WRITE(msgBuf,'(A)') 'Error writing out model state'
155 CALL PRINT_ERROR( msgBuf, 1 )
156 WRITE(msgBuf,'(A,I10)') 'Timestep ',myIter
157 CALL PRINT_ERROR( msgBuf, 1 )
158 ELSE
159 WRITE(msgBuf,'(A,I10)')
160 & '// Model state written, timestep', myIter
161 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
162 & SQUEEZE_RIGHT, 1 )
163 WRITE(msgBuf,'(A)') ' '
164 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
165 & SQUEEZE_RIGHT, 1 )
166 ENDIF
167
168 _END_MASTER( myThid )
169 _BARRIER
170
171 ENDIF
172
173 call TIMER_STOP( 'I/O (WRITE) [ADJOINT LOOP]', myThid )
174
175 #endif /* ALLOW_AUTODIFF_MONITOR */
176 #endif /* ALLOW_ADJOINT_RUN */
177
178 RETURN
179 END

  ViewVC Help
Powered by ViewVC 1.1.22