C $Header: /home/ubuntu/mnt/e9_copy/MITgcm/pkg/autodiff/g_dummy_in_dynamics.F,v 1.1 2011/02/26 00:41:20 heimbach Exp $ C $Name: $ #include "AUTODIFF_OPTIONS.h" CBOP C !ROUTINE: g_dummy_in_dynamics C !INTERFACE: subroutine g_dummy_in_dynamics( mytime, myiter, myThid ) C !DESCRIPTION: \bv C *==========================================================* C | SUBROUTINE g_dummy_in_dynamics | C *==========================================================* C Extract tangent linear variable from TAMC/TAF-generated C tangent linear common blocks, contained in g_common.h C and write fields to file; C Make sure common blocks in g_common.h are up-to-date C w.r.t. current adjoint code. C *==========================================================* C | SUBROUTINE g_dummy_in_dynamics | C *==========================================================* C \ev C !USES: IMPLICIT NONE C == Global variables === #include "SIZE.h" #include "EEPARAMS.h" #include "PARAMS.h" #ifdef ALLOW_AUTODIFF_MONITOR # include "g_common.h" #endif LOGICAL DIFFERENT_MULTIPLE EXTERNAL DIFFERENT_MULTIPLE INTEGER IO_ERRCOUNT EXTERNAL IO_ERRCOUNT C !INPUT/OUTPUT PARAMETERS: C == Routine arguments == C myIter - iteration counter for this thread C myTime - time counter for this thread C myThid - Thread number for this instance of the routine. integer myThid integer myiter _RL mytime #ifdef ALLOW_TANGENTLINEAR_RUN #ifdef ALLOW_AUTODIFF_MONITOR C !LOCAL VARIABLES: c == local variables == C suff - Hold suffix part of a filename C beginIOErrCount - Begin and end IO error counts C endIOErrCount C msgBuf - Error message buffer CHARACTER*(MAX_LEN_FNAM) suff INTEGER beginIOErrCount INTEGER endIOErrCount CHARACTER*(MAX_LEN_MBUF) msgBuf c == end of interface == CEOP call TIMER_START('I/O (WRITE) [ADJOINT LOOP]', myThid ) IF ( & DIFFERENT_MULTIPLE(adjDumpFreq,mytime,deltaTClock) & ) THEN write(*,*) 'myIter= ',myiter _BARRIER _BEGIN_MASTER( myThid ) C-- Set suffix for this set of data files. WRITE(suff,'(I10.10)') myIter writeBinaryPrec = writeStatePrec C-- Read IO error counter beginIOErrCount = IO_ERRCOUNT(myThid) #ifdef ALLOW_AUTODIFF_MONITOR_DIAG CALL WRITE_FLD_XYZ_RL( & 'G_Jrhoinsitu.',suff, g_rhoinsitu, myIter, myThid) CALL WRITE_FLD_XYZ_RL( & 'G_Jtotphihyd.',suff, g_totphihyd, myIter, myThid) #endif _END_MASTER( myThid ) _BARRIER ENDIF call TIMER_STOP( 'I/O (WRITE) [ADJOINT LOOP]', myThid ) #endif /* ALLOW_AUTODIFF_MONITOR */ #endif /* ALLOW_TANGENTLINEAR_RUN */ end