/[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.1 - (hide annotations) (download)
Fri Jan 11 18:54:08 2002 UTC (22 years, 5 months ago) by heimbach
Branch: MAIN
CVS Tags: checkpoint44e_post, checkpoint44f_post, chkpt44d_post, checkpoint44e_pre, checkpoint45d_post, chkpt44a_post, checkpoint44h_pre, chkpt44c_pre, checkpoint45a_post, checkpoint44g_post, checkpoint45b_post, release1_final_v1, checkpoint44b_post, checkpoint45c_post, checkpoint44h_post, chkpt44a_pre, checkpoint44b_pre, checkpoint44, checkpoint45, chkpt44c_post, checkpoint44f_pre
Branch point for: release1_final, release1, ecco-branch
Preparing TL forward mode write.

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     #include "g_common.h"
31    
32     LOGICAL DIFFERENT_MULTIPLE
33     EXTERNAL DIFFERENT_MULTIPLE
34     INTEGER IO_ERRCOUNT
35     EXTERNAL IO_ERRCOUNT
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     C !LOCAL VARIABLES:
47     c == local variables ==
48     C suff - Hold suffix part of a filename
49     C beginIOErrCount - Begin and end IO error counts
50     C endIOErrCount
51     C msgBuf - Error message buffer
52     CHARACTER*(MAX_LEN_FNAM) suff
53     INTEGER beginIOErrCount
54     INTEGER endIOErrCount
55     CHARACTER*(MAX_LEN_MBUF) msgBuf
56    
57     c == end of interface ==
58     CEOP
59    
60     call TIMER_START('I/O (WRITE) [ADJOINT LOOP]', myThid )
61    
62     IF (
63     & DIFFERENT_MULTIPLE(dumpFreq,mytime,
64     & mytime-deltaTClock)
65     & ) THEN
66    
67     write(*,*) 'myIter= ',myiter
68    
69     _BARRIER
70     _BEGIN_MASTER( myThid )
71    
72     C-- Set suffix for this set of data files.
73     WRITE(suff,'(I10.10)') myIter
74     writeBinaryPrec = writeStatePrec
75    
76     C-- Read IO error counter
77     beginIOErrCount = IO_ERRCOUNT(myThid)
78    
79     CALL WRITE_FLD_XY_RL ( 'G_Jtaux.',suff, g_fu, myIter, myThid)
80     CALL WRITE_FLD_XY_RL ( 'G_Jtauy.',suff, g_fv, myIter, myThid)
81     CALL WRITE_FLD_XY_RL ( 'G_Jqnet.',suff, g_qnet, myIter, myThid)
82     CALL WRITE_FLD_XY_RL ( 'G_Jempr.',suff, g_empmr, myIter, myThid)
83     c
84     CALL WRITE_FLD_XYZ_RL(
85     & 'G_Jgtnm1.',suff, g_gtnm1, myIter, myThid)
86     CALL WRITE_FLD_XYZ_RL(
87     & 'G_Jgsnm1.',suff, g_gsnm1, myIter, myThid)
88     CALL WRITE_FLD_XYZ_RL(
89     & 'G_Jgunm1.',suff, g_gunm1, myIter, myThid)
90     CALL WRITE_FLD_XYZ_RL(
91     & 'G_Jgvnm1.',suff, g_gvnm1, myIter, myThid)
92     #ifdef ALLOW_PASSIVE_TRACER
93     CALL WRITE_FLD_XYZ_RL(
94     & 'G_Jgtr1nm1. ',suff, g_gtr1nm1, myIter, myThid)
95     #endif
96     c
97     CALL WRITE_FLD_XYZ_RL(
98     & 'G_Jtheta.',suff, g_theta, myIter, myThid)
99     CALL WRITE_FLD_XYZ_RL(
100     & 'G_Jsalt.',suff, g_salt, myIter, myThid)
101     CALL WRITE_FLD_XYZ_RL(
102     & 'G_Juvel.',suff, g_uvel, myIter, myThid)
103     CALL WRITE_FLD_XYZ_RL(
104     & 'G_Jvvel.',suff, g_vvel, myIter, myThid)
105    
106     #ifdef ALLOW_PASSIVE_TRACER
107     CALL WRITE_FLD_XYZ_RL(
108     & 'G_Jtr1. ',suff, g_tr1, myIter, myThid)
109     #endif
110     #ifdef ALLOW_DIFFKR_CONTROL
111     CALL WRITE_FLD_XYZ_RL ( 'G_Jdiffkr.',suff, g_diffkr,
112     & myIter, myThid)
113     #endif
114     #ifdef ALLOW_KAPGM_CONTROL
115     CALL WRITE_FLD_XYZ_RL ( 'G_Jkagm.',suff, g_kapgm,
116     & myIter, myThid)
117     #endif
118    
119     cph CALL WRITE_FLD_XY_RL( 'G_J_sst.',suff, g_sst, myIter, myThid)
120     cph CALL WRITE_FLD_XY_RL( 'G_J_sss.',suff, g_sss, myIter, myThid)
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, 1 )
129     WRITE(msgBuf,'(A)') 'Error writing out model state'
130     CALL PRINT_ERROR( msgBuf, 1 )
131     WRITE(msgBuf,'(A,I10)') 'Timestep ',myIter
132     CALL PRINT_ERROR( msgBuf, 1 )
133     ELSE
134     WRITE(msgBuf,'(A,I10)')
135     & '// Model state written, timestep', myIter
136     CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
137     & SQUEEZE_RIGHT, 1 )
138     WRITE(msgBuf,'(A)') ' '
139     CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
140     & SQUEEZE_RIGHT, 1 )
141     ENDIF
142    
143     _END_MASTER( myThid )
144     _BARRIER
145    
146     ENDIF
147    
148     call TIMER_STOP( 'I/O (WRITE) [ADJOINT LOOP]', myThid )
149     end
150    
151    
152    
153    
154    
155    
156    
157    
158    

  ViewVC Help
Powered by ViewVC 1.1.22