Back to home page

MITgcm

 
 

    


File indexing completed on 2024-02-01 06:10:19 UTC

view on githubraw file Latest commit 427e24e1 on 2024-01-31 16:50:14 UTC
467a85a3d2 Patr*0001 #include "AUTODIFF_OPTIONS.h"
bead363026 Jean*0002 #ifdef ALLOW_CTRL
                0003 # include "CTRL_OPTIONS.h"
                0004 #endif
57c22ecc45 Jean*0005 #include "AD_CONFIG.h"
467a85a3d2 Patr*0006 
                0007 CBOP
                0008 C     !ROUTINE: g_dummy_in_dynamics
                0009 C     !INTERFACE:
4545c79864 Jean*0010       subroutine g_dummy_in_dynamics( myTime, myIter, myThid )
467a85a3d2 Patr*0011 
                0012 C     !DESCRIPTION: \bv
                0013 C     *==========================================================*
                0014 C     | SUBROUTINE g_dummy_in_dynamics                           |
                0015 C     *==========================================================*
                0016 C     Extract tangent linear variable from TAMC/TAF-generated
                0017 C     tangent linear common blocks, contained in g_common.h
                0018 C     and write fields to file;
                0019 C     Make sure common blocks in g_common.h are up-to-date
                0020 C     w.r.t. current adjoint code.
                0021 C     *==========================================================*
                0022 C     | SUBROUTINE g_dummy_in_dynamics                           |
                0023 C     *==========================================================*
                0024 C     \ev
                0025 
                0026 C     !USES:
                0027       IMPLICIT NONE
                0028 
                0029 C     == Global variables ===
                0030 #include "SIZE.h"
                0031 #include "EEPARAMS.h"
                0032 #include "PARAMS.h"
                0033 #ifdef ALLOW_AUTODIFF_MONITOR
                0034 # include "g_common.h"
                0035 #endif
                0036 
                0037 C     !INPUT/OUTPUT PARAMETERS:
                0038 C     == Routine arguments ==
4545c79864 Jean*0039 C     myTime :: time counter for this thread
                0040 C     myIter :: iteration counter for this thread
                0041 C     myThid :: Thread number for this instance of the routine.
                0042       _RL     myTime
                0043       INTEGER myIter
                0044       INTEGER myThid
467a85a3d2 Patr*0045 
                0046 #ifdef ALLOW_TANGENTLINEAR_RUN
                0047 #ifdef ALLOW_AUTODIFF_MONITOR
                0048 
4545c79864 Jean*0049 C     !FUNCTIONS:
                0050       LOGICAL  DIFFERENT_MULTIPLE
                0051       EXTERNAL DIFFERENT_MULTIPLE
                0052 
467a85a3d2 Patr*0053 C     !LOCAL VARIABLES:
                0054 c     == local variables ==
4545c79864 Jean*0055 C     suff   :: Hold suffix part of a filename
                0056 C     msgBuf :: Error message buffer
df5a9764ba Jean*0057       CHARACTER*(10) suff
4545c79864 Jean*0058 c     CHARACTER*(MAX_LEN_MBUF) msgBuf
467a85a3d2 Patr*0059 CEOP
                0060 
                0061       IF (
4545c79864 Jean*0062      &  DIFFERENT_MULTIPLE(adjDumpFreq,myTime,deltaTClock)
467a85a3d2 Patr*0063      & ) THEN
                0064 
4545c79864 Jean*0065         CALL TIMER_START('I/O (WRITE)        [ADJOINT LOOP]', myThid )
                0066 c       write(*,*) 'myIter= ',myIter
467a85a3d2 Patr*0067 
                0068 C--     Set suffix for this set of data files.
df5a9764ba Jean*0069         IF ( rwSuffixType.EQ.0 ) THEN
                0070           WRITE(suff,'(I10.10)') myIter
                0071         ELSE
                0072           CALL RW_GET_SUFFIX( suff, myTime, myIter, myThid )
                0073         ENDIF
467a85a3d2 Patr*0074 
                0075 #ifdef ALLOW_AUTODIFF_MONITOR_DIAG
                0076         CALL WRITE_FLD_XYZ_RL(
                0077      &       'G_Jrhoinsitu.',suff, g_rhoinsitu, myIter, myThid)
                0078         CALL WRITE_FLD_XYZ_RL(
                0079      &       'G_Jtotphihyd.',suff, g_totphihyd, myIter, myThid)
                0080 #endif
                0081 
4545c79864 Jean*0082         CALL TIMER_STOP( 'I/O (WRITE)        [ADJOINT LOOP]', myThid )
467a85a3d2 Patr*0083 
                0084       ENDIF
                0085 
                0086 #endif /* ALLOW_AUTODIFF_MONITOR */
                0087 #endif /* ALLOW_TANGENTLINEAR_RUN */
                0088 
4545c79864 Jean*0089       RETURN
                0090       END