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

Contents of /MITgcm/verification/bottom_ctrl_5x5/code_ad/dummy_in_hfac.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: +20 -25 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/dummy_in_hfac.F,v 1.3 2010/03/22 01:15:15 jmc Exp $
2 C $Name: $
3
4 #include "AUTODIFF_OPTIONS.h"
5
6 subroutine dummy_in_hfac( myname, myIter, myThid )
7
8 C *==========================================================*
9 C | SUBROUTINE dummy_in_hfac
10 C *==========================================================*
11
12 IMPLICIT NONE
13 C == Global variables ===
14 #include "SIZE.h"
15 #include "EEPARAMS.h"
16 #include "PARAMS.h"
17
18 C == Routine arguments ==
19 C myThid - Thread number for this instance of the routine.
20 CHARACTER*(*) myname
21 INTEGER myIter
22 INTEGER myThid
23
24 RETURN
25 END
26
27 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
28 CBOP
29 C !ROUTINE: addummy_in_hfac
30 C !INTERFACE:
31 subroutine addummy_in_hfac( myname, myIter, myThid )
32
33 C !DESCRIPTION: \bv
34 C *==========================================================*
35 C | SUBROUTINE addummy_in_hfac
36 C *==========================================================*
37 C Extract adjoint variable from TAMC/TAF-generated
38 C adjoint common blocks, contained in adcommon.h
39 C and write fields to file;
40 C Make sure common blocks in adcommon.h are up-to-date
41 C w.r.t. current adjoint code.
42 C *==========================================================*
43 C | SUBROUTINE addummy_in_hfac
44 C *==========================================================*
45 C \ev
46
47 C !USES:
48 IMPLICIT NONE
49
50 C == Global variables ===
51 #include "SIZE.h"
52 #include "EEPARAMS.h"
53 #include "PARAMS.h"
54 #ifdef ALLOW_AUTODIFF_MONITOR
55 #include "adcommon.h"
56 #endif
57
58 LOGICAL DIFFERENT_MULTIPLE
59 EXTERNAL DIFFERENT_MULTIPLE
60 INTEGER IO_ERRCOUNT
61 EXTERNAL IO_ERRCOUNT
62
63 C !INPUT/OUTPUT PARAMETERS:
64 C == Routine arguments ==
65 C myThid - Thread number for this instance of the routine.
66 CHARACTER*(1) myname
67 integer myIter
68 integer myThid
69
70 #ifdef ALLOW_AUTODIFF_MONITOR
71 C !LOCAL VARIABLES:
72 c == local variables ==
73 C suff - Hold suffix part of a filename
74 C beginIOErrCount - Begin and end IO error counts
75 C endIOErrCount
76 C msgBuf - Error message buffer
77 CHARACTER*(MAX_LEN_FNAM) suff
78 INTEGER beginIOErrCount
79 INTEGER endIOErrCount
80 CHARACTER*(MAX_LEN_MBUF) msgBuf
81 _RL mytime
82 CHARACTER*(5) myfullname
83
84 c == end of interface ==
85 CEOP
86
87 #ifdef ALLOW_DEPTH_CONTROL
88
89 mytime = 0.
90
91 IF (
92 & DIFFERENT_MULTIPLE(dumpFreq,mytime,
93 & mytime-deltaTClock)
94 & ) THEN
95
96 CALL TIMER_START('I/O (WRITE) [ADJOINT LOOP]', myThid )
97
98 C-- Set suffix for this set of data files.
99 WRITE(suff,'(I10.10)') myIter
100 writeBinaryPrec = writeStatePrec
101
102 C-- Read IO error counter
103 beginIOErrCount = IO_ERRCOUNT(myThid)
104
105 IF ( myname .eq. 'C' ) THEN
106 myfullname = 'hFacC'
107 CALL WRITE_FLD_XYZ_RL ( 'ADJhFacC.', suff, adhfacc,
108 & myIter, myThid)
109 ELSE IF ( myname .eq. 'W' ) THEN
110 myfullname = 'hFacW'
111 CALL WRITE_FLD_XYZ_RL ( 'ADJhFacW.', suff, adhfacw,
112 & myIter, myThid)
113 ELSE IF ( myname .eq. 'S' ) THEN
114 myfullname = 'hFacS'
115 CALL WRITE_FLD_XYZ_RL ( 'ADJhFacS.', suff, adhfacs,
116 & myIter, myThid)
117 ELSE
118 write(*,*) 'addummy_in_hfac: no valid myname specified'
119 END IF
120 C-- Reread IO error counter
121 endIOErrCount = IO_ERRCOUNT(myThid)
122
123 C-- Check for IO errors
124 IF ( endIOErrCount .NE. beginIOErrCount ) THEN
125 WRITE(msgBuf,'(A)') 'S/R WRITE_STATE'
126 CALL PRINT_ERROR( msgBuf, 1 )
127 WRITE(msgBuf,'(A)') 'Error writing out model state'
128 CALL PRINT_ERROR( msgBuf, 1 )
129 WRITE(msgBuf,'(A,I10)') 'Timestep ',myIter
130 CALL PRINT_ERROR( msgBuf, 1 )
131 ELSE
132 WRITE(msgBuf,'(A,I10)')
133 & '// ad'//myfullname//' written, timestep', myIter
134 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
135 & SQUEEZE_RIGHT, 1 )
136 WRITE(msgBuf,'(A)') ' '
137 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
138 & SQUEEZE_RIGHT, 1 )
139 ENDIF
140
141 CALL TIMER_STOP( 'I/O (WRITE) [ADJOINT LOOP]', myThid )
142
143 ENDIF
144
145 #endif /* ALLOW_DEPTH_CONTROL */
146 #endif /* ALLOW_AUTODIFF_MONITOR */
147
148 RETURN
149 END

  ViewVC Help
Powered by ViewVC 1.1.22