/[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.16 - (show annotations) (download)
Wed Aug 29 13:12:22 2012 UTC (11 years, 9 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint64, checkpoint63s, checkpoint64q, checkpoint64p, checkpoint64s, checkpoint64r, checkpoint64u, checkpoint64t, checkpoint64i, checkpoint64h, checkpoint64k, checkpoint64j, checkpoint64m, checkpoint64l, checkpoint64o, checkpoint64n, checkpoint64a, checkpoint64c, checkpoint64b, checkpoint64e, checkpoint64d, checkpoint64g, checkpoint64f
Changes since 1.15: +49 -63 lines
comment out the very nasty "writeBinaryPrec = writeStatePrec" line

1 C $Header: /u/gcmpack/MITgcm/pkg/autodiff/g_dummy_in_stepping.F,v 1.15 2012/07/06 23:10:28 jmc Exp $
2 C $Name: $
3
4 #include "AUTODIFF_OPTIONS.h"
5 #include "AD_CONFIG.h"
6
7 CBOP
8 C !ROUTINE: g_dummy_in_stepping
9 C !INTERFACE:
10 subroutine g_dummy_in_stepping( myTime, myIter, myThid )
11
12 C !DESCRIPTION: \bv
13 C *==========================================================*
14 C | SUBROUTINE g_dummy_in_stepping |
15 C *==========================================================*
16 C Extract tangent linear variable from TAMC/TAF-generated
17 C tangent linear common blocks, contained in g_common.h
18 C and write fields to file;
19 C Make sure common blocks in g_common.h are up-to-date
20 C w.r.t. current adjoint code.
21 C *==========================================================*
22 C | SUBROUTINE g_dummy_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 #ifdef ALLOW_AUTODIFF_MONITOR
34 # include "g_common.h"
35 #endif
36
37 C !INPUT/OUTPUT PARAMETERS:
38 C == Routine arguments ==
39 C myIter :: iteration counter for this thread
40 C myTime :: time counter for this thread
41 C myThid :: Thread number for this instance of the routine.
42 INTEGER myThid
43 INTEGER myIter
44 _RL myTime
45
46 #ifdef ALLOW_TANGENTLINEAR_RUN
47 #ifdef ALLOW_AUTODIFF_MONITOR
48
49 C !FUNCTIONS:
50 LOGICAL DIFFERENT_MULTIPLE
51 EXTERNAL DIFFERENT_MULTIPLE
52 INTEGER IO_ERRCOUNT
53 EXTERNAL IO_ERRCOUNT
54
55 C !LOCAL VARIABLES:
56 c == local variables ==
57 C suff :: Hold suffix part of a filename
58 C msgBuf :: Error message buffer
59 CHARACTER*(MAX_LEN_FNAM) suff
60 INTEGER beginIOErrCount
61 INTEGER endIOErrCount
62 CHARACTER*(MAX_LEN_MBUF) msgBuf
63 CEOP
64
65 IF (
66 & DIFFERENT_MULTIPLE(adjDumpFreq,myTime,deltaTClock)
67 & ) THEN
68
69 CALL TIMER_START('I/O (WRITE) [ADJOINT LOOP]', myThid )
70 c write(*,*) 'myIter= ',myIter
71
72 C-- Set suffix for this set of data files.
73 WRITE(suff,'(I10.10)') myIter
74 C ==>> Resetting run-time parameter writeBinaryPrec in the middle of a run
75 C ==>> is very very very nasty !!!
76 c writeBinaryPrec = writeStatePrec
77 C <<== If you really want to mess-up with this at your own risk,
78 C <<== uncomment the line above
79
80 C-- Read IO error counter
81 beginIOErrCount = IO_ERRCOUNT(myThid)
82
83 CALL WRITE_FLD_XY_RL ( 'G_Jtaux.',suff, g_fu, myIter, myThid )
84 CALL WRITE_FLD_XY_RL ( 'G_Jtauy.',suff, g_fv, myIter, myThid )
85 CALL WRITE_FLD_XY_RL ( 'G_Jqnet.',suff, g_qnet, myIter,myThid )
86 CALL WRITE_FLD_XY_RL ( 'G_Jempr.',suff, g_empmr,myIter,myThid )
87 c
88 CALL WRITE_FLD_XYZ_RL(
89 & 'G_Jtheta.',suff, g_theta, myIter, myThid )
90 CALL WRITE_FLD_XYZ_RL(
91 & 'G_Jsalt.',suff, g_salt, myIter, myThid )
92 CALL WRITE_FLD_XYZ_RL(
93 & 'G_Juvel.',suff, g_uvel, myIter, myThid )
94 CALL WRITE_FLD_XYZ_RL(
95 & 'G_Jvvel.',suff, g_vvel, myIter, myThid )
96 CALL WRITE_FLD_XYZ_RL(
97 & 'G_Jwvel.',suff, g_wvel, myIter, myThid )
98 CALL WRITE_FLD_XY_RL(
99 & 'G_Jetan.',suff, g_etan, myIter, myThid )
100
101 #ifdef ALLOW_DIFFKR_CONTROL
102 CALL WRITE_FLD_XYZ_RL ( 'G_Jdiffkr.',suff, g_diffkr,
103 & myIter, myThid )
104 #endif
105 #ifdef ALLOW_KAPGM_CONTROL
106 CALL WRITE_FLD_XYZ_RL ( 'G_Jkapgm.',suff, g_kapgm,
107 & myIter, myThid )
108 #endif
109 #ifdef ALLOW_KAPREDI_CONTROL
110 CALL WRITE_FLD_XYZ_RL ( 'G_Jkapredi.',suff, g_kapredi,
111 & myIter, myThid )
112 #endif
113
114 cph CALL WRITE_FLD_XY_RL( 'G_J_sst.',suff, g_sst, myIter, myThid )
115 cph CALL WRITE_FLD_XY_RL( 'G_J_sss.',suff, g_sss, myIter, myThid )
116
117 #ifdef ALLOW_AUTODIFF_MONITOR_PHIHYD
118 CALL WRITE_FLD_XYZ_RL(
119 & 'G_Jphihyd.',suff, g_totphihyd, myIter, myThid )
120 #endif
121
122 C-- Reread IO error counter
123 endIOErrCount = IO_ERRCOUNT(myThid)
124
125 C-- Check for IO errors
126 IF ( endIOErrCount .NE. beginIOErrCount ) THEN
127 WRITE(msgBuf,'(A)') 'S/R WRITE_STATE'
128 CALL PRINT_ERROR( msgBuf, myThid )
129 WRITE(msgBuf,'(A)') 'Error writing out model state'
130 CALL PRINT_ERROR( msgBuf, myThid )
131 WRITE(msgBuf,'(A,I10)') 'Timestep ',myIter
132 CALL PRINT_ERROR( msgBuf, myThid )
133 ELSE
134 WRITE(msgBuf,'(A,I10)')
135 & '// Model state written, timestep', myIter
136 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
137 & SQUEEZE_RIGHT, myThid )
138 WRITE(msgBuf,'(A)') ' '
139 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
140 & SQUEEZE_RIGHT, myThid )
141 ENDIF
142
143 CALL TIMER_STOP( 'I/O (WRITE) [ADJOINT LOOP]', myThid )
144
145 ENDIF
146
147 #endif /* ALLOW_AUTODIFF_MONITOR */
148 #endif /* ALLOW_TANGENTLINEAR_RUN */
149
150 RETURN
151 END

  ViewVC Help
Powered by ViewVC 1.1.22