C $Header: /u/gcmpack/MITgcm/pkg/openad/openad_dumpAdjoint.F,v 1.9 2017/03/24 23:38:57 jmc Exp $ C $Name: $ #include "PACKAGES_CONFIG.h" #include "CPP_OPTIONS.h" c#ifdef ALLOW_AUTODIFF c# include "AUTODIFF_OPTIONS.h" c#endif #ifdef ALLOW_COST # include "COST_OPTIONS.h" #endif #ifdef ALLOW_CTRL # include "CTRL_OPTIONS.h" #endif #ifdef ALLOW_OBCS # include "OBCS_OPTIONS.h" #endif #ifdef ALLOW_SEAICE # include "SEAICE_OPTIONS.h" #endif #ifdef ALLOW_GMREDI # include "GMREDI_OPTIONS.h" #endif C start with a copy of THE_MAIN_LOOP C and remove some the obvious extras SUBROUTINE OPENAD_DUMPADJOINT( myTime, myIter, myThid ) IMPLICIT NONE C == Global variables == #include "SIZE.h" #include "EEPARAMS.h" #include "PARAMS.h" c************************************** #ifdef ALLOW_AUTODIFF c These includes are needed for c AD-checkpointing. c They provide the fields to be stored. # include "GRID.h" # include "DYNVARS.h" # include "FFIELDS.h" # include "EOS.h" # ifdef ALLOW_GENERIC_ADVDIFF # include "GAD.h" # endif # ifdef ALLOW_CD_CODE # include "CD_CODE_VARS.h" # endif # ifdef ALLOW_PTRACERS # include "PTRACERS_SIZE.h" # include "PTRACERS_FIELDS.h" # endif # ifdef EXACT_CONSERV # include "SURFACE.h" # endif # ifdef ALLOW_OBCS # include "OBCS_PARAMS.h" # include "OBCS_GRID.h" # include "OBCS_FIELDS.h" # include "OBCS_SEAICE.h" # endif # ifdef ALLOW_EXF # include "EXF_FIELDS.h" # include "EXF_PARAM.h" # ifdef ALLOW_BULKFORMULAE # include "EXF_CONSTANTS.h" # endif # endif /* ALLOW_EXF */ # ifdef ALLOW_SEAICE # include "SEAICE.h" # endif # ifdef ALLOW_EBM # include "EBM.h" # endif # ifdef ALLOW_KPP # include "KPP.h" # include "KPP_TAVE.h" # include "KPP_PARAMS.h" # endif # include "tamc.h" # include "ctrl.h" # include "ctrl_dummy.h" # include "cost.h" #endif /* ALLOW_AUTODIFF */ _RL myTime INTEGER myIter INTEGER myThid _RL foo4(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) _RL foo5(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) CHARACTER*(10) suff IF ( MOD(myIter,360).EQ.0 ) THEN IF ( rwSuffixType.EQ.0 ) THEN WRITE(suff,'(I10.10)') myIter ELSE CALL RW_GET_SUFFIX( suff, myTime, myIter, myThid ) ENDIF # ifndef ALLOW_STREAMICE foo5=thetad call WRITE_FLD_XYZ_RL('adjtheta.',suff,foo5,myIter,1) foo5=saltd call WRITE_FLD_XYZ_RL('adjsalt.',suff,foo5,myIter,1) foo5=uveld call WRITE_FLD_XYZ_RL('adjuvel.',suff,foo5,myIter,1) foo5=vveld call WRITE_FLD_XYZ_RL('adjvvel.',suff,foo5,myIter,1) foo5=wveld call WRITE_FLD_XYZ_RL('adjwvel.',suff,foo5,myIter,1) foo4=etand call WRITE_FLD_XY_RL('adjetan.',suff,foo4,myIter,1) # endif # ifdef ALLOW_DIFFKR_CONTROL foo5=diffkrd call WRITE_FLD_XY_RL('adjdiffkr.',suff,foo5,myIter,1) # endif # ifdef ALLOW_HFLUX0_CONTROL foo4=qnetd call WRITE_FLD_XY_RL('adjqnet.',suff,foo4,myIter,1) # endif # ifdef ALLOW_SFLUX0_CONTROL foo4=empmrd call WRITE_FLD_XY_RL('adjempmr.',suff,foo4,myIter,1) # endif # ifdef ALLOW_TAUU0_CONTROL foo4=fud call WRITE_FLD_XY_RL('adjfu.',suff,foo4,myIter,1) # endif # ifdef ALLOW_TAUV0_CONTROL foo4=fvd call WRITE_FLD_XY_RL('adjfv.',suff,foo4,myIter,1) # endif # ifdef ALLOW_HFLUXM_CONTROL foo4=qnetmd call WRITE_FLD_XY_RL('adjhfluxm.',suff,foo4,myIter,1) #endif ENDIF RETURN END