/[MITgcm]/MITgcm/pkg/autodiff/g_dummy_in_stepping.F
ViewVC logotype

Contents of /MITgcm/pkg/autodiff/g_dummy_in_stepping.F

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


Revision 1.6 - (show annotations) (download)
Fri Sep 17 22:57:12 2004 UTC (19 years, 8 months ago) by heimbach
Branch: MAIN
CVS Tags: checkpoint57b_post, checkpoint56b_post, checkpoint57d_post, checkpoint55, checkpoint57, checkpoint56, checkpoint55i_post, checkpoint55c_post, checkpoint57a_post, checkpoint55g_post, checkpoint57c_post, checkpoint55d_post, checkpoint55d_pre, checkpoint57c_pre, checkpoint55j_post, checkpoint55h_post, checkpoint57e_post, checkpoint55b_post, checkpoint55f_post, eckpoint57e_pre, checkpoint56a_post, checkpoint57f_pre, checkpoint56c_post, checkpoint57a_pre, checkpoint55a_post, checkpoint55e_post
Changes since 1.5: +0 -17 lines
o remove all tr1-related code (ALLOW_PASSIVE_TRACER)
  (adjoint stuff still has some tr1 names, but all use ptracer arrays)

1
2 #include "AUTODIFF_OPTIONS.h"
3
4 CBOP
5 C !ROUTINE: g_dummy_in_stepping
6 C !INTERFACE:
7 subroutine g_dummy_in_stepping( mytime, myiter, myThid )
8
9 C !DESCRIPTION: \bv
10 C *==========================================================*
11 C | SUBROUTINE g_dummy_in_stepping |
12 C *==========================================================*
13 C Extract tangent linear variable from TAMC/TAF-generated
14 C tangent linear common blocks, contained in g_common.h
15 C and write fields to file;
16 C Make sure common blocks in g_common.h are up-to-date
17 C w.r.t. current adjoint code.
18 C *==========================================================*
19 C | SUBROUTINE g_dummy_in_stepping |
20 C *==========================================================*
21 C \ev
22
23 C !USES:
24 IMPLICIT NONE
25
26 C == Global variables ===
27 #include "SIZE.h"
28 #include "EEPARAMS.h"
29 #include "PARAMS.h"
30 #ifdef ALLOW_AUTODIFF_MONITOR
31 # include "g_common.h"
32 #endif
33
34 LOGICAL DIFFERENT_MULTIPLE
35 EXTERNAL DIFFERENT_MULTIPLE
36 INTEGER IO_ERRCOUNT
37 EXTERNAL IO_ERRCOUNT
38
39 C !INPUT/OUTPUT PARAMETERS:
40 C == Routine arguments ==
41 C myIter - iteration counter for this thread
42 C myTime - time counter for this thread
43 C myThid - Thread number for this instance of the routine.
44 integer myThid
45 integer myiter
46 _RL mytime
47
48 #ifdef ALLOW_TANGENTLINEAR_RUN
49 #ifdef ALLOW_AUTODIFF_MONITOR
50
51 C !LOCAL VARIABLES:
52 c == local variables ==
53 C suff - Hold suffix part of a filename
54 C beginIOErrCount - Begin and end IO error counts
55 C endIOErrCount
56 C msgBuf - Error message buffer
57 CHARACTER*(MAX_LEN_FNAM) suff
58 INTEGER beginIOErrCount
59 INTEGER endIOErrCount
60 CHARACTER*(MAX_LEN_MBUF) msgBuf
61
62 c == end of interface ==
63 CEOP
64
65 call TIMER_START('I/O (WRITE) [ADJOINT LOOP]', myThid )
66
67 IF (
68 & DIFFERENT_MULTIPLE(adjDumpFreq,mytime,
69 & 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 CALL WRITE_FLD_XY_RL ( 'G_Jtaux.',suff, g_fu, myIter, myThid)
85 CALL WRITE_FLD_XY_RL ( 'G_Jtauy.',suff, g_fv, myIter, myThid)
86 CALL WRITE_FLD_XY_RL ( 'G_Jqnet.',suff, g_qnet, myIter, myThid)
87 CALL WRITE_FLD_XY_RL ( 'G_Jempr.',suff, g_empmr, myIter, myThid)
88 c
89 CALL WRITE_FLD_XYZ_RL(
90 & 'G_Jtheta.',suff, g_theta, myIter, myThid)
91 CALL WRITE_FLD_XYZ_RL(
92 & 'G_Jsalt.',suff, g_salt, myIter, myThid)
93 CALL WRITE_FLD_XYZ_RL(
94 & 'G_Juvel.',suff, g_uvel, myIter, myThid)
95 CALL WRITE_FLD_XYZ_RL(
96 & 'G_Jvvel.',suff, g_vvel, myIter, myThid)
97 CALL WRITE_FLD_XYZ_RL(
98 & 'G_Jwvel.',suff, g_vvel, myIter, myThid)
99 CALL WRITE_FLD_XY_RL(
100 & 'G_Jetan.',suff, g_vvel, myIter, myThid)
101
102 #ifdef ALLOW_DIFFKR_CONTROL
103 CALL WRITE_FLD_XYZ_RL ( 'G_Jdiffkr.',suff, g_diffkr,
104 & myIter, myThid)
105 #endif
106 #ifdef ALLOW_KAPGM_CONTROL
107 CALL WRITE_FLD_XYZ_RL ( 'G_Jkagm.',suff, g_kapgm,
108 & myIter, myThid)
109 #endif
110
111 cph CALL WRITE_FLD_XY_RL( 'G_J_sst.',suff, g_sst, myIter, myThid)
112 cph CALL WRITE_FLD_XY_RL( 'G_J_sss.',suff, g_sss, myIter, myThid)
113
114 C-- Reread IO error counter
115 endIOErrCount = IO_ERRCOUNT(myThid)
116
117 C-- Check for IO errors
118 IF ( endIOErrCount .NE. beginIOErrCount ) THEN
119 WRITE(msgBuf,'(A)') 'S/R WRITE_STATE'
120 CALL PRINT_ERROR( msgBuf, 1 )
121 WRITE(msgBuf,'(A)') 'Error writing out model state'
122 CALL PRINT_ERROR( msgBuf, 1 )
123 WRITE(msgBuf,'(A,I10)') 'Timestep ',myIter
124 CALL PRINT_ERROR( msgBuf, 1 )
125 ELSE
126 WRITE(msgBuf,'(A,I10)')
127 & '// Model state written, timestep', myIter
128 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
129 & SQUEEZE_RIGHT, 1 )
130 WRITE(msgBuf,'(A)') ' '
131 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
132 & SQUEEZE_RIGHT, 1 )
133 ENDIF
134
135 _END_MASTER( myThid )
136 _BARRIER
137
138 ENDIF
139
140 call TIMER_STOP( 'I/O (WRITE) [ADJOINT LOOP]', myThid )
141
142 #endif /* ALLOW_AUTODIFF_MONITOR */
143 #endif /* ALLOW_TANGENTLINEAR_RUN */
144
145 end
146
147
148
149
150
151
152
153
154

  ViewVC Help
Powered by ViewVC 1.1.22