summ_rpt_write_detail_line Subroutine

public subroutine summ_rpt_write_detail_line(DSpecNo, GSpecNo, srcDist, dstDist, srcGrid, dstGrid, rptLun, localrc)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: DSpecNo
integer, intent(in) :: GSpecNo
type(dist_specification_record), intent(in) :: srcDist
type(dist_specification_record), intent(in) :: dstDist
type(grid_specification_record), intent(in) :: srcGrid
type(grid_specification_record), intent(in) :: dstGrid
integer, intent(in) :: rptLun
integer, intent(out) :: localrc

Source Code

  subroutine summ_rpt_write_detail_line (DSpecNo, GSpecNo, &
      srcDist, dstDist, srcGrid, dstGrid, rptLun, localrc)
    integer,                         intent(in)  :: DSpecNo
    integer,                         intent(in)  :: GSpecNo
    type(dist_specification_record), intent(in)  :: srcDist
    type(dist_specification_record), intent(in)  :: dstDist
    type(grid_specification_record), intent(in)  :: srcGrid
    type(grid_specification_record), intent(in)  :: dstGrid
    integer,                         intent(in)  :: rptLun
    integer,                         intent(out) :: localrc

    integer :: RankNo

    localrc = ESMF_SUCCESS

    write (rptLun, 9001)

    write (rptLun, 9005) DSpecNo
    write (rptLun, 9006) GSpecNo

    ! make sure distribution rank is consistent
    if (srcDist%drank .NE. dstDist%drank) then
      write (rptLun, '("source distribution rank does not match destination rank", I4, 2x, I4)') &
        srcDist%drank, dstDist%drank
    end if

    ! make sure grid rank is consistent
    if (srcGrid%grank .NE. dstGrid%grank) then
      write (rptLun, '("source grid rank does not match destination rank", I4, 2x, I4)') &
        srcGrid%grank, dstGrid%grank
    end if

    ! make sure distribution and grid are consistent
    if (srcDist%drank .NE. srcGrid%grank) then
      write (rptLun, '("distribution rank does not match grid rank", I4, 2x, I4)') &
        srcDist%drank, srcGrid%grank
    end if

    write (rptLun, 9007) srcDist%drank
    write (rptLun, 9008) srcGrid%grank

    ! write source distribution
    do RankNo = 1, srcDist%drank
      write (rptLun, 9012) RankNo, srcDist%dsize(RankNo), RankNo
    end do

    ! write destination distribution
    do RankNo = 1, dstDist%drank
      write (rptLun, 9013) RankNo, dstDist%dsize(RankNo), RankNo
    end do

    ! write source grid
    do RankNo = 1, srcGrid%grank
      write (rptLun, 9020) RankNo, srcGrid%gsize(RankNo), RankNo
      write (rptLun, 9021) RankNo, srcGrid%grange(RankNo, 1), RankNo
      write (rptLun, 9022) RankNo, srcGrid%grange(RankNo, 2), RankNo
      write (rptLun, 9023) RankNo, trim(srcGrid%gtype(RankNo)%string), RankNo
      write (rptLun, 9024) RankNo, trim(srcGrid%gunits(RankNo)%string), RankNo
    end do

    ! write destination grid
    do RankNo = 1, dstGrid%grank
      write (rptLun, 9030) RankNo, dstGrid%gsize(RankNo), RankNo
      write (rptLun, 9031) RankNo, dstGrid%grange(RankNo, 1), RankNo
      write (rptLun, 9032) RankNo, dstGrid%grange(RankNo, 2), RankNo
      write (rptLun, 9033) RankNo, trim(dstGrid%gtype(RankNo)%string), RankNo
      write (rptLun, 9034) RankNo, trim(dstGrid%gunits(RankNo)%string), RankNo
    end do

    write (rptLun, 9002)

    9001 FORMAT ('        <Row>')
    9002 FORMAT ('        </Row>')

    9005 FORMAT ('          <DSpecNo>', I3, '</DSpecNo>')
    9006 FORMAT ('          <GSpecNo>', I3, '</GSpecNo>')
    9007 FORMAT ('          <DistRank>', I1, '</DistRank>')
    9008 FORMAT ('          <GridRank>', I1, '</GridRank>')

    9012 FORMAT ('          <SourceDistSize', I1, '>', I5, '</SourceDistSize', I1, '>')
    9013 FORMAT ('          <DestDistSize', I1, '>', I5, '</DestDistSize', I1, '>')

    ! EN format specifier displays real in engineering format (ISO 1539-1:2004 sect. 10.6.1.2.3)
    9020 FORMAT ('          <SourceGridSize', I1, '>', I5, '</SourceGridSize', I1, '>')
    9021 FORMAT ('          <SourceGridCoordLow', I1, '>', EN17.6, '</SourceGridCoordLow', I1, '>')
    9022 FORMAT ('          <SourceGridCoordHigh', I1, '>', EN17.6, '</SourceGridCoordHigh', I1, '>')
    9023 FORMAT ('          <SourceGridType', I1, '>', A16, '</SourceGridType', I1, '>')
    9024 FORMAT ('          <SourceGridUnits', I1, '>', A16, '</SourceGridUnits', I1, '>')

    9030 FORMAT ('          <DestGridSize', I1, '>', I5, '</DestGridSize', I1, '>')
    9031 FORMAT ('          <DestGridCoordLow', I1, '>', EN17.6, '</DestGridCoordLow', I1, '>')
    9032 FORMAT ('          <DestGridCoordHigh', I1, '>', EN17.6, '</DestGridCoordHigh', I1, '>')
    9033 FORMAT ('          <DestGridType', I1, '>', A16, '</DestGridType', I1, '>')
    9034 FORMAT ('          <DestGridUnits', I1, '>', A16, '</DestGridUnits', I1, '>')

  end subroutine summ_rpt_write_detail_line