nxtdat Subroutine

public subroutine nxtdat(un, leof)

The subroutine prepares for reading the next uncommented line of data from file

Arguments

Type IntentOptional Attributes Name
integer, intent(inout) :: un
logical, intent(out) :: leof

Called by

proc~~nxtdat~~CalledByGraph proc~nxtdat nxtdat proc~uemep_read_monthly_and_daily_shipping_asi_data uEMEP_read_monthly_and_daily_shipping_asi_data proc~uemep_read_monthly_and_daily_shipping_asi_data->proc~nxtdat proc~uemep_read_roadlink_data_ascii uEMEP_read_roadlink_data_ascii proc~uemep_read_roadlink_data_ascii->proc~nxtdat proc~uemep_read_roadlink_emission_data uEMEP_read_roadlink_emission_data proc~uemep_read_roadlink_emission_data->proc~nxtdat proc~uemep_read_rwc_heating_data uEMEP_read_RWC_heating_data proc~uemep_read_rwc_heating_data->proc~nxtdat proc~uemep_read_weekly_shipping_asi_data uEMEP_read_weekly_shipping_asi_data proc~uemep_read_weekly_shipping_asi_data->proc~nxtdat proc~uemep_calculate_emissions_for_emep uEMEP_calculate_emissions_for_EMEP proc~uemep_calculate_emissions_for_emep->proc~uemep_read_monthly_and_daily_shipping_asi_data proc~uemep_calculate_emissions_for_emep->proc~uemep_read_roadlink_data_ascii proc~uemep_calculate_emissions_for_emep->proc~uemep_read_roadlink_emission_data proc~uemep_calculate_emissions_for_emep->proc~uemep_read_rwc_heating_data proc~uemep_calculate_emissions_for_emep->proc~uemep_read_weekly_shipping_asi_data program~uemep uEMEP program~uemep->proc~uemep_read_monthly_and_daily_shipping_asi_data program~uemep->proc~uemep_read_roadlink_data_ascii program~uemep->proc~uemep_read_roadlink_emission_data program~uemep->proc~uemep_read_rwc_heating_data program~uemep->proc~uemep_read_weekly_shipping_asi_data program~uemep->proc~uemep_calculate_emissions_for_emep

Source Code

    subroutine nxtdat(un, leof)
        !! The subroutine prepares for reading the next uncommented line of data from file
        integer, intent(inout) :: un
        logical, intent(out) :: leof

        ! Local variables
        character(len=256) :: txtstr
        integer :: io

        ! If file unit is non-positive then just return
        if (un .le. 0) return

        leof = .false.

        ! Read lines from file
        do
            read(un,"(a)", iostat=io) txtstr
            if (io /= 0) then
                leof = .true.
                exit
            else
                if (txtstr(1:1) == "*" .or. txtstr(1:1) == "{" .or. txtstr(1:1) == "#") then
                    cycle
                else
                    backspace(un)
                    exit
                end if
            end if
        end do
    end subroutine nxtdat