reservoir_open_output Subroutine

public subroutine reservoir_open_output()

Uses

  • proc~~reservoir_open_output~~UsesGraph proc~reservoir_open_output reservoir_open_output module~output output proc~reservoir_open_output->module~output module~utilities utilities module~output->module~utilities

open and create reservoir output files (one file per reservoir)

Arguments

None

Calls

proc~~reservoir_open_output~~CallsGraph proc~reservoir_open_output reservoir_open_output proc~output_open_file output_open_file proc~reservoir_open_output->proc~output_open_file proc~open_file open_file proc~output_open_file->proc~open_file proc~log_error log_error proc~open_file->proc~log_error proc~log_message log_message proc~log_error->proc~log_message proc~log_write log_write proc~log_message->proc~log_write proc~log_format_message log_format_message proc~log_message->proc~log_format_message proc~to_string to_string proc~log_write->proc~to_string proc~date_time_str date_time_str proc~log_format_message->proc~date_time_str proc~colourise colourise proc~log_format_message->proc~colourise proc~string_index string_index proc~colourise->proc~string_index

Called by

proc~~reservoir_open_output~~CalledByGraph proc~reservoir_open_output reservoir_open_output proc~reservoir_initialise reservoir_initialise proc~reservoir_initialise->proc~reservoir_open_output proc~initialise initialise proc~initialise->proc~reservoir_initialise program~swim swim program~swim->proc~initialise

Contents

Source Code


Source Code

  subroutine reservoir_open_output
    !-----------------------------------------------------------------
    ! open and create reservoir output files (one file per reservoir)
    !-----------------------------------------------------------------
    use output, only: output_open_file

    ! initialise variables and arrays
    integer :: res, funit

    res = 1
    do funit = 1, rsv_nReservoirs
      rsv_funit(res) = output_open_file("reservoir_"//trim(rsv_ResNames(res))//".out")
      ! write header line
      write(rsv_funit(res), fmt="(a8)", advance="NO") "YEAR DAY "
      write(rsv_funit(res), fmt="(a16)", advance="NO") "Precip_m3/s"
      write(rsv_funit(res), fmt="(a16)", advance="NO") "Precip_mm"
      write(rsv_funit(res), fmt="(a16)", advance="NO") "CWB_m3/s"
      write(rsv_funit(res), fmt="(a16)", advance="NO") "CWB_mm"
      write(rsv_funit(res), fmt="(a16)", advance="NO") "Area_dry_km2"
      write(rsv_funit(res), fmt="(a16)", advance="NO") "Area_wet_km2"
      write(rsv_funit(res), fmt="(a18)", advance="NO") "Act_stor_Mio_m3"
      write(rsv_funit(res), fmt="(a18)", advance="NO") "Dead_stor_Mio_m3"
      write(rsv_funit(res), fmt="(a16)", advance="NO") "WaterLevel_masl"
      write(rsv_funit(res), fmt="(a16)", advance="NO") "Inflow_m3/s"
      write(rsv_funit(res), fmt="(a16)", advance="NO") "Outflow_m3/s"
      write(rsv_funit(res), fmt="(a16)", advance="NO") "Withdrawal_m3"
      write(rsv_funit(res), fmt="(a16)", advance="NO") "Seepage_m3/s"
      write(rsv_funit(res), fmt="(a16)", advance="NO") "ETpot_water_mm"
      write(rsv_funit(res), fmt="(a16)", advance="NO") "ETpot_land_mm"
      write(rsv_funit(res), fmt="(a16)", advance="NO") "ETact_mm"
      write(rsv_funit(res), fmt="(a17)", advance="NO") "ETact_m3/s"
      write(rsv_funit(res), fmt="(a17)", advance="YES") "Energy_MW"
      res = res + 1
    end do

  end subroutine reservoir_open_output