module config_mod

    implicit none

    public

    ! KIND parameter for reals used in exchange with the coupler. This is made
    ! compatible with OASIS double precision
    integer,parameter :: RNP = SELECTED_REAL_KIND(12,307)

    character(len=*),parameter :: NamelistFileName  = "namelist.amip"
    character(len=*),parameter :: LogFileName  = "amip.log"

    ! x and y (i and j) dimensions of the PRIMAVERA AMIP grid
    integer,parameter :: GridNX = 1440
    integer,parameter :: GridNY = 720

    ! Path and filename root to PRIMAVERA AMIP data
    character(len=200) :: AmipFileRoot

    ! Logical IO unit number to read the namelist
    integer,parameter :: NAMLUN = 13
    integer,parameter :: LOGLUN = 14

    ! Switch for debugging output, can be set in namelist
    logical :: LDebug

contains

subroutine ERROR(msg)
    character(len=*),intent(in) :: msg

    write (LOGLUN,'("*EE*",A)') msg
    call flush(LOGLUN)
    stop 'Aborting AMIP forcing.'
end subroutine ERROR

end module config_mod
