#define TRACEBACK write (gol,'("in ",a," (",a,i6,")")') rname, __FILE__, __LINE__ ; call goErr
#define IF_NOTOK_RETURN(action) if (status/=0) then; TRACEBACK; action; return; end if
#define IF_ERROR_RETURN(action) if (status> 0) then; TRACEBACK; action; return; end if
#define IF_NOTOK_MDF(action) if (status/=0) then; TRACEBACK; action; call MDF_CLose(fid,status); status=1; return; end if
!
#include "tm5.inc"
!-----------------------------------------------------------------------------
!                    TM5                                                     !
!-----------------------------------------------------------------------------
!BOP
!
! !MODULE:      USER_OUTPUT_PDUMP
!
! !DESCRIPTION: 
!
! Module to deal with time-series output. Output are in NetCDF-4 and use CF
! conventions.
!
! ************* DUMMY VERSION FOR USER_OUTPUT.F90 TO COMPILE *****************
!
! See proj/chem/base/trunk/src for non-dummy version.
! 
!
!\\
!\\
! !INTERFACE: 
!
MODULE USER_OUTPUT_PDUMP
  !
  ! !USES:
  !  
  IMPLICIT NONE
  PRIVATE
  !
  ! !PUBLIC MEMBER FUNCTIONS:
  !
  public  ::  Output_PDUMP_Init
  public  ::  Output_PDUMP_Step
  public  ::  Output_PDUMP_Done
  !
  ! !PRIVATE DATA MEMBERS:
  !
  character(len=*), parameter :: mname            = 'user_output_pdump'
  !
  !EOP
  !------------------------------------------------------------------------

CONTAINS

  !--------------------------------------------------------------------------
  !                    TM5                                                  !
  !--------------------------------------------------------------------------
  !BOP
  !
  ! !IROUTINE:    OUTPUT_PDUMP_INIT
  !
  ! !DESCRIPTION: reads rc file keys relevant for pdump
  !\\
  !\\
  ! !INTERFACE:
  !
  SUBROUTINE OUTPUT_PDUMP_INIT( rcF, dhour_min, status )
    !
    ! !USES:
    !
    use GO, only : TrcFile
    !
    ! !INPUT/OUTPUT PARAMETERS:
    !
    type(TrcFile), intent(inout)     ::  rcF
    !
    ! !OUTPUT PARAMETERS:
    !
    integer, intent(out)             ::  dhour_min
    integer, intent(out)             ::  status
    !
    ! !REVISION HISTORY: 
    !    1 Oct 2010 - Achim Strunk - upgrade from RETRO to PDUMP
    !
    !EOP
    !------------------------------------------------------------------------
    !BOC

    character(len=*), parameter ::  rname = mname//'/Output_PDUMP_Init'

    ! ok
    dhour_min = 1
    status = 0

  END SUBROUTINE OUTPUT_PDUMP_INIT
  !EOC

  !--------------------------------------------------------------------------
  !                    TM5                                                  !
  !--------------------------------------------------------------------------
  !BOP
  !
  ! !IROUTINE:    OUTPUT_PDUMP_STEP
  !
  ! !DESCRIPTION: 
  !\\
  !\\
  ! !INTERFACE:
  !
  SUBROUTINE OUTPUT_PDUMP_STEP( region, idate_f, status )
    !
    ! !INPUT PARAMETERS:
    !
    integer, intent(in)              ::  region
    integer, intent(in)              ::  idate_f(6)
    !
    ! !OUTPUT PARAMETERS:
    !
    integer, intent(out)             ::  status
    !
    ! !REVISION HISTORY: 
    !    1 Oct 2010 - Achim Strunk - retro -> pdump
    !
    ! !REMARKS:
    !  (1) called every hour.
    !
    !EOP
    !------------------------------------------------------------------------
    !BOC

    character(len=*), parameter ::  rname = mname//'/Output_PDUMP_Step'


    status = 0

  END SUBROUTINE OUTPUT_PDUMP_STEP
  !EOC

  
  !--------------------------------------------------------------------------
  !                    TM5                                                  !
  !--------------------------------------------------------------------------
  !BOP
  !
  ! !IROUTINE:    OUTPUT_PDUMP_DONE
  !
  ! !DESCRIPTION: 
  !\\
  !\\
  ! !INTERFACE:
  !
  SUBROUTINE OUTPUT_PDUMP_DONE( status )
    !
    ! !OUTPUT PARAMETERS:
    !
    integer, intent(out)             ::  status
    !
    ! !REVISION HISTORY: 
    !    1 Oct 2010 - Achim Strunk - retro -> pdump
    !   31 Aug 2012 - P. Le Sager - reverse order in which regions are dealt with (MDF issue)
    !
    !EOP
    !------------------------------------------------------------------------
    !BOC

    character(len=*), parameter ::  rname = mname//'/Output_PDUMP_Done'

    ! ok
    status = 0

  END SUBROUTINE OUTPUT_PDUMP_DONE
  !EOC

END MODULE USER_OUTPUT_PDUMP
