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

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

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


Revision 1.9 - (hide annotations) (download)
Thu Sep 8 17:44:52 2005 UTC (18 years, 9 months ago) by heimbach
Branch: MAIN
CVS Tags: checkpoint57s_post, checkpoint58b_post, checkpoint57y_post, checkpoint59, checkpoint58, checkpoint58f_post, checkpoint58d_post, checkpoint58a_post, checkpoint57z_post, checkpoint58y_post, checkpoint58t_post, checkpoint58m_post, checkpoint57t_post, checkpoint57v_post, checkpoint58w_post, checkpoint57y_pre, checkpoint58o_post, checkpoint58p_post, checkpoint58q_post, checkpoint58e_post, checkpoint58r_post, checkpoint58n_post, checkpoint59e, checkpoint59d, checkpoint59g, checkpoint59f, checkpoint59a, checkpoint59c, checkpoint59b, checkpoint59h, checkpint57u_post, checkpoint58k_post, checkpoint58v_post, checkpoint58l_post, checkpoint58g_post, checkpoint58x_post, checkpoint58h_post, checkpoint58j_post, checkpoint57w_post, checkpoint58i_post, checkpoint57x_post, checkpoint58c_post, checkpoint58u_post, checkpoint58s_post
Changes since 1.8: +2 -2 lines
Fix output for adetan, adwvel (spotted by Fiona McLay)

1 heimbach 1.1
2 edhill 1.3 #include "AUTODIFF_OPTIONS.h"
3 heimbach 1.1
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 heimbach 1.2 #ifdef ALLOW_AUTODIFF_MONITOR
31     # include "g_common.h"
32     #endif
33 heimbach 1.1
34 jmc 1.8 LOGICAL DIFFERENT_MULTIPLE
35     EXTERNAL DIFFERENT_MULTIPLE
36 heimbach 1.1 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 heimbach 1.2 _RL mytime
47    
48 heimbach 1.4 #ifdef ALLOW_TANGENTLINEAR_RUN
49 heimbach 1.2 #ifdef ALLOW_AUTODIFF_MONITOR
50 heimbach 1.1
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 jmc 1.8 & DIFFERENT_MULTIPLE(adjDumpFreq,mytime,deltaTClock)
69 heimbach 1.1 & ) THEN
70    
71     write(*,*) 'myIter= ',myiter
72    
73     _BARRIER
74     _BEGIN_MASTER( myThid )
75    
76     C-- Set suffix for this set of data files.
77     WRITE(suff,'(I10.10)') myIter
78     writeBinaryPrec = writeStatePrec
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 heimbach 1.5 CALL WRITE_FLD_XYZ_RL(
97 heimbach 1.9 & 'G_Jwvel.',suff, g_wvel, myIter, myThid)
98 heimbach 1.5 CALL WRITE_FLD_XY_RL(
99 heimbach 1.9 & 'G_Jetan.',suff, g_etan, myIter, myThid)
100 heimbach 1.1
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_Jkagm.',suff, g_kapgm,
107     & myIter, myThid)
108     #endif
109    
110     cph CALL WRITE_FLD_XY_RL( 'G_J_sst.',suff, g_sst, myIter, myThid)
111     cph CALL WRITE_FLD_XY_RL( 'G_J_sss.',suff, g_sss, myIter, myThid)
112    
113     C-- Reread IO error counter
114     endIOErrCount = IO_ERRCOUNT(myThid)
115    
116     C-- Check for IO errors
117     IF ( endIOErrCount .NE. beginIOErrCount ) THEN
118     WRITE(msgBuf,'(A)') 'S/R WRITE_STATE'
119     CALL PRINT_ERROR( msgBuf, 1 )
120     WRITE(msgBuf,'(A)') 'Error writing out model state'
121     CALL PRINT_ERROR( msgBuf, 1 )
122     WRITE(msgBuf,'(A,I10)') 'Timestep ',myIter
123     CALL PRINT_ERROR( msgBuf, 1 )
124     ELSE
125     WRITE(msgBuf,'(A,I10)')
126     & '// Model state written, timestep', myIter
127     CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
128     & SQUEEZE_RIGHT, 1 )
129     WRITE(msgBuf,'(A)') ' '
130     CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
131     & SQUEEZE_RIGHT, 1 )
132     ENDIF
133    
134     _END_MASTER( myThid )
135     _BARRIER
136    
137     ENDIF
138    
139     call TIMER_STOP( 'I/O (WRITE) [ADJOINT LOOP]', myThid )
140 heimbach 1.2
141     #endif /* ALLOW_AUTODIFF_MONITOR */
142 heimbach 1.4 #endif /* ALLOW_TANGENTLINEAR_RUN */
143 heimbach 1.2
144 heimbach 1.1 end
145    
146    
147    
148    
149    
150    
151    
152    
153    

  ViewVC Help
Powered by ViewVC 1.1.22