      SUBROUTINE checkflags()
      INCLUDE 'general.h'
      INCLUDE 'common.h'

        IF (wtflag .lt. 0 .and. wtflag .gt. 1) THEN
          WRITE(6,*) "wtflag not initialised to a valid value = ",
     &         wtflag
            STOP
        ENDIF
        IF (wtopeflag .lt. 0 .and. wtopeflag .gt. 1) THEN
          WRITE(6,*) "wtopeflag not initialised to a valid value = ",
     &         wtopeflag
            STOP
        ENDIF
        IF (per3_typefg .lt. 0 .and. per3_typefg .gt. 1) THEN
          WRITE(6,*) "per3_typefg not initialised to a valid value = ",
     &         per3_typefg
            STOP
        ENDIF
        IF (prevflag .lt. 0 .and. prevflag .gt. 1) THEN
          WRITE(6,*) "prevflag not initialised to a valid value = ",
     &         prevflag
            STOP
        ENDIF
        IF (high_NOxfg .lt. 0 .and. high_NOxfg .gt. 1) THEN
          WRITE(6,*) "high_NOxfg not initialised to a valid value = ",
     &         high_NOxfg
            STOP
        ENDIF
        IF (zero_NOXfg .lt. 0 .and. zero_NOXfg .gt. 1) THEN
          WRITE(6,*) "zero_NOXfg not initialised to a valid value = ",
     &         zero_NOXfg
            STOP
        ENDIF
        IF (iflag .lt. 0 .and. iflag .gt. 1) THEN
          WRITE(6,*) "iflag not initialised to a valid value = ",
     &         iflag
            STOP
        ENDIF
        IF (aeropart_fg .lt. 0 .and. aeropart_fg .gt. 1) THEN
          WRITE(6,*) "aeropart_fg not initialised to a valid value = ",
     &         aeropart_fg
            STOP
        ENDIF
        IF (wallpart_fg .lt. 0 .and. wallpart_fg .gt. 1) THEN
          WRITE(6,*) "wallpart_fg not initialised to a valid value = ",
     &         wallpart_fg
            STOP
        ENDIF
        IF (pvap_fg .lt. 1 .and. pvap_fg .gt. 3) THEN
          WRITE(6,*) "pvap_fg not initialised to a valid value = ",
     &         pvap_fg
            STOP
        ENDIF
        IF (epoxy_fg .lt. 0 .and. epoxy_fg .gt. 1) THEN
          WRITE(6,*) "epoxy_fg not initialised to a valid value = ",
     &         epoxy_fg
            STOP
        ENDIF
        IF (kdissfg .lt. 1 .and. kdissfg .gt. 2) THEN
          WRITE(6,*) "kdissfg not initialised to a valid value = ",
     &         kdissfg
            STOP
        ENDIF
        IF (kisomfg .lt. 1 .and. kisomfg .gt. 2) THEN
          WRITE(6,*) "kisomfg not initialised to a valid value = ",
     &         kisomfg
            STOP
        ENDIF
        IF (hoadd_c1_fg .lt. 1 .and. hoadd_c1_fg .gt. 3) THEN
          WRITE(6,*) "hoadd_c1_fg not initialised to a valid value = ",
     &         hoadd_c1_fg
            STOP
        ENDIF
        IF (flgdhf .lt. 0 .and. flgdhf .gt. 1) THEN
          WRITE(6,*) "flgdhf not initialised to a valid value = ",
     &         flgdhf
            STOP
        ENDIF
        IF (autoox_fg .lt. 0 .and. autoox_fg .gt. 1) THEN
          WRITE(6,*) "autoox_fg not initialised to a valid value = ",
     &         autoox_fg
            STOP
        ENDIF
        IF (dimer_fg .lt. 0 .and. dimer_fg .gt. 1) THEN
          WRITE(6,*) "dimer_fg not initialised to a valid value = ",
     &         dimer_fg
            STOP
        ENDIF
        IF (masstransfg .lt. 1 .and. masstransfg .gt. 2) THEN
          WRITE(6,*) "masstransfg not initialised to a valid value = ",
     &         masstransfg
            STOP
        ENDIF
        IF (spinup_fg .lt. 0 .and. spinup_fg .gt. 1) THEN
          WRITE(6,*) "spinup_fg not initialised to a valid value = ",
     &         spinup_fg
            STOP
        ENDIF
        IF (criegee_fg .lt. 1 .and. criegee_fg .gt. 2) THEN
          WRITE(6,*) "criegee_fg not initialised to a valid value = ",
     &         criegee_fg
            STOP
        ENDIF
        IF (ro2ho2_fg  .lt. 1 .and. ro2ho2_fg .gt. 2) THEN
          WRITE(6,*) "ro2ho2_fg not initialised to a valid value = ",
     &         ro2ho2_fg
            STOP
        ENDIF
        IF (ro2no2_fg  .lt. 0 .and. ro2no2_fg .gt. 1) THEN
          WRITE(6,*) "ro2no2_fg not initialised to a valid value = ",
     &         ro2no2_fg
            STOP
        ENDIF
        IF (ro2dep_fg  .lt. 0 .and. ro2idep_fg .gt. 1) THEN
          WRITE(6,*) "ro2dep_fg not initialised to a valid value = ",
     &         ro2dep_fg
            STOP
        ENDIF
        IF (ro2cond_fg  .lt. 0 .and. ro2cond_fg .gt. 1) THEN
          WRITE(6,*) "ro2cond_fg not initialised to a valid value = ",
     &         ro2cond_fg
            STOP
        ENDIF
        IF (isopsoa_fg .lt. 0 .and. isopsoa_fg .gt. 1) THEN
          WRITE(6,*) "isopsoa_fg not initialised to a valid value = ",
     &         isopsoa_fg
            STOP
        ENDIF
        IF (aerophot_fg.lt.0 .and. aerophot_fg.gt. 1) THEN
          WRITE(6,*) "aerophot_fg not initialised to a valid value = ",
     &         aerophot_fg
             STOP
        ENDIF
        IF (OFR_fg.lt.0 .and. OFR_fg.gt. 1) THEN
          WRITE(6,*) "OFR_fg not initialised to a valid value = ",
     &         OFR_fg
             STOP
        ENDIF

      END SUBROUTINE
