/[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.2 - (hide annotations) (download)
Sat Jul 13 03:30:30 2002 UTC (21 years, 11 months ago) by heimbach
Branch: MAIN
CVS Tags: checkpoint46n_post, checkpoint47e_post, checkpoint46l_post, checkpoint46g_pre, checkpoint47c_post, checkpoint50c_post, checkpoint46f_post, checkpoint48e_post, checkpoint50c_pre, checkpoint46b_post, checkpoint48i_post, checkpoint46l_pre, checkpoint51, checkpoint50, checkpoint50d_post, checkpoint50b_pre, checkpoint51f_post, checkpoint48b_post, checkpoint51d_post, checkpoint48c_pre, checkpoint47d_pre, c49_autodiff, checkpoint47a_post, checkpoint48d_pre, checkpoint51j_post, checkpoint47i_post, checkpoint47d_post, checkpoint46d_pre, checkpoint48d_post, checkpoint48f_post, checkpoint46j_pre, checkpoint48h_post, checkpoint51b_pre, checkpoint46a_post, checkpoint47g_post, checkpoint46j_post, checkpoint51h_pre, checkpoint46k_post, checkpoint48a_post, checkpoint50f_post, checkpoint50a_post, checkpoint50f_pre, checkpoint47j_post, branch-exfmods-tag, branchpoint-genmake2, checkpoint46e_pre, checkpoint48c_post, checkpoint46b_pre, checkpoint51b_post, checkpoint51c_post, checkpoint46c_pre, checkpoint46, checkpoint47b_post, checkpoint46h_pre, checkpoint46m_post, checkpoint46a_pre, checkpoint50g_post, checkpoint46g_post, checkpoint50h_post, checkpoint50e_pre, checkpoint50i_post, checkpoint51i_pre, checkpoint47f_post, checkpoint50e_post, checkpoint46i_post, checkpoint46c_post, checkpoint50d_pre, checkpoint46e_post, checkpoint51e_post, checkpoint47, checkpoint48, checkpoint49, checkpoint46h_post, checkpoint51f_pre, checkpoint48g_post, checkpoint47h_post, checkpoint51g_post, checkpoint46d_post, checkpoint50b_post, checkpoint51a_post
Branch point for: branch-exfmods-curt, branch-genmake2
Changes since 1.1: +9 -2 lines
Merging from release1_p5
o flow directives:
  - new for S/R do_the_model_io
  - enhanced for S/R checkpoint
  - new gmredi.flow
o Introduced CPP option ALLOW_AUTODIFF_MONITOR to
  disable adcommon.h/g_common.h by default.
o fixed problem for adjoint of global_max

1 heimbach 1.1
2     #include "CPP_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 heimbach 1.2 #ifdef ALLOW_AUTODIFF_MONITOR
31     # include "g_common.h"
32     #endif
33 heimbach 1.1
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 heimbach 1.2 _RL mytime
47    
48     #ifdef ALLOW_AUTODIFF_MONITOR
49 heimbach 1.1
50     C !LOCAL VARIABLES:
51     c == local variables ==
52     C suff - Hold suffix part of a filename
53     C beginIOErrCount - Begin and end IO error counts
54     C endIOErrCount
55     C msgBuf - Error message buffer
56     CHARACTER*(MAX_LEN_FNAM) suff
57     INTEGER beginIOErrCount
58     INTEGER endIOErrCount
59     CHARACTER*(MAX_LEN_MBUF) msgBuf
60    
61     c == end of interface ==
62     CEOP
63    
64     call TIMER_START('I/O (WRITE) [ADJOINT LOOP]', myThid )
65    
66     IF (
67     & DIFFERENT_MULTIPLE(dumpFreq,mytime,
68     & mytime-deltaTClock)
69     & ) 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_Jgtnm1.',suff, g_gtnm1, myIter, myThid)
90     CALL WRITE_FLD_XYZ_RL(
91     & 'G_Jgsnm1.',suff, g_gsnm1, myIter, myThid)
92     CALL WRITE_FLD_XYZ_RL(
93     & 'G_Jgunm1.',suff, g_gunm1, myIter, myThid)
94     CALL WRITE_FLD_XYZ_RL(
95     & 'G_Jgvnm1.',suff, g_gvnm1, myIter, myThid)
96     #ifdef ALLOW_PASSIVE_TRACER
97     CALL WRITE_FLD_XYZ_RL(
98     & 'G_Jgtr1nm1. ',suff, g_gtr1nm1, myIter, myThid)
99     #endif
100     c
101     CALL WRITE_FLD_XYZ_RL(
102     & 'G_Jtheta.',suff, g_theta, myIter, myThid)
103     CALL WRITE_FLD_XYZ_RL(
104     & 'G_Jsalt.',suff, g_salt, myIter, myThid)
105     CALL WRITE_FLD_XYZ_RL(
106     & 'G_Juvel.',suff, g_uvel, myIter, myThid)
107     CALL WRITE_FLD_XYZ_RL(
108     & 'G_Jvvel.',suff, g_vvel, myIter, myThid)
109    
110     #ifdef ALLOW_PASSIVE_TRACER
111     CALL WRITE_FLD_XYZ_RL(
112     & 'G_Jtr1. ',suff, g_tr1, myIter, myThid)
113     #endif
114     #ifdef ALLOW_DIFFKR_CONTROL
115     CALL WRITE_FLD_XYZ_RL ( 'G_Jdiffkr.',suff, g_diffkr,
116     & myIter, myThid)
117     #endif
118     #ifdef ALLOW_KAPGM_CONTROL
119     CALL WRITE_FLD_XYZ_RL ( 'G_Jkagm.',suff, g_kapgm,
120     & myIter, myThid)
121     #endif
122    
123     cph CALL WRITE_FLD_XY_RL( 'G_J_sst.',suff, g_sst, myIter, myThid)
124     cph CALL WRITE_FLD_XY_RL( 'G_J_sss.',suff, g_sss, myIter, myThid)
125    
126     C-- Reread IO error counter
127     endIOErrCount = IO_ERRCOUNT(myThid)
128    
129     C-- Check for IO errors
130     IF ( endIOErrCount .NE. beginIOErrCount ) THEN
131     WRITE(msgBuf,'(A)') 'S/R WRITE_STATE'
132     CALL PRINT_ERROR( msgBuf, 1 )
133     WRITE(msgBuf,'(A)') 'Error writing out model state'
134     CALL PRINT_ERROR( msgBuf, 1 )
135     WRITE(msgBuf,'(A,I10)') 'Timestep ',myIter
136     CALL PRINT_ERROR( msgBuf, 1 )
137     ELSE
138     WRITE(msgBuf,'(A,I10)')
139     & '// Model state written, timestep', myIter
140     CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
141     & SQUEEZE_RIGHT, 1 )
142     WRITE(msgBuf,'(A)') ' '
143     CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
144     & SQUEEZE_RIGHT, 1 )
145     ENDIF
146    
147     _END_MASTER( myThid )
148     _BARRIER
149    
150     ENDIF
151    
152     call TIMER_STOP( 'I/O (WRITE) [ADJOINT LOOP]', myThid )
153 heimbach 1.2
154     #endif /* ALLOW_AUTODIFF_MONITOR */
155    
156 heimbach 1.1 end
157    
158    
159    
160    
161    
162    
163    
164    
165    

  ViewVC Help
Powered by ViewVC 1.1.22