/[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.2 - (show annotations) (download)
Tue Oct 9 02:36:41 2007 UTC (12 years, 9 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint60, checkpoint61, checkpoint62, checkpoint59q, checkpoint59p, checkpoint59r, checkpoint59m, checkpoint59l, checkpoint59o, checkpoint59n, checkpoint59i, checkpoint59k, checkpoint59j, checkpoint62c, checkpoint62b, checkpoint62a, checkpoint61f, checkpoint61g, checkpoint61d, checkpoint61e, checkpoint61b, checkpoint61c, checkpoint61a, checkpoint61n, checkpoint61o, checkpoint61l, checkpoint61m, checkpoint61j, checkpoint61k, checkpoint61h, checkpoint61i, checkpoint61v, checkpoint61w, checkpoint61t, checkpoint61u, checkpoint61r, checkpoint61s, checkpoint61p, checkpoint61q, checkpoint61z, checkpoint61x, checkpoint61y
Changes since 1.1: +9 -6 lines
add missing cvs $Header:$ or $Name:$

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

  ViewVC Help
Powered by ViewVC 1.1.22