    *endif
            !!! need additional logic if more than 7 entities !!!
         *endif     
      *enddo
   *endif
*enddo

! loop thru LINE and AREA convections                    --- convections
*do,_alk,1,2
   ! skip if no entities of this type
   *if,_nent(_alk),le,0,cycle
   ! get the number of items with a convection
   *VFILL,_MASK2(1),ramp,0
   *voper,_MASK1(1),%_ACTENV%(1,16,_alk),ne,_MASK2(1)
   *vmask,_MASK1(1)
   *vscfun,_count,num,%_ACTENV%(1,16,_alk)
   *if,_count,ne,0,then
      ! get the entities in the set
      *vmask,_MASK1(1)
      *vfun,_ENVSCR(1,1,1),compress,%_ACTENV%(1,1,_alk)
      ! output each entity separately
      *do,_i,1,_count
         _ent=_ENVSCR(_i,1,1)
         _type=_entlab(_alk)
         _ent1=chrval(_ent)
         _xval=%_ACTENV%(_ent,16,_alk)
         _yval=%_ACTENV%(_ent,17,_alk)
   
         *if,_report,eq,0,then
            *vwrite,_type,_xval,_ent1
            ('Convection          ',a,g12.4,2x,a)
	    *vwrite,_yval
            ('   Bulk Temperature ',8x,g12.4)
         *else
            _label=_HFLMLAB(_CURUNIT)
            *vwrite,_label
            ('<tr><td align=left><b>Convection [ ',a,' ] </b></td>')
            *vwrite,_type
            ('<td align=center>',a,'</td>')
            *vwrite,_xval
            ('<td align=center>',g12.4,'</td>')
            *vwrite,_ent1
            ('<td align=left>',a,'</td>')
            /com,</tr>
            _label=_TEMPLAB(_CURUNIT)
            *vwrite,_label
            ('<tr><td align=left><b>   Bulk Temperature [ ',a,' ] </b></td>')
            /com,<td>&nbsp;</td>
            *vwrite,_yval
            ('<td align=center>',g12.4,'</td>')
            /com,<td>&nbsp;</td>
            /com,</tr>
         *endif
      *enddo
   *endif     
*enddo

! loop thru LINE and AREA heat fluxes                    --- heat fluxes
*do,_alk,1,2
   ! skip if no entities of this type
   *if,_nent(_alk),le,0,cycle
   ! get the number of items with a heat flux
   *VFILL,_MASK2(1),ramp,0
   *voper,_MASK1(1),%_ACTENV%(1,18,_alk),ne,_MASK2(1)
   *vmask,_MASK1(1)
   *vscfun,_count,num,%_ACTENV%(1,18,_alk)
   *if,_count,ne,0,then
      ! get the entities in the set
      *vmask,_MASK1(1)
      *vfun,_ENVSCR(1,1,1),compress,%_ACTENV%(1,1,_alk)
      ! output each entity separately
      *do,_i,1,_count
         _ent=_ENVSCR(_i,1,1)
         _type=_entlab(_alk)
         _ent1=chrval(_ent)
         _xval=%_ACTENV%(_ent,18,_alk)
   
         *if,_report,eq,0,then
            *vwrite,_type,_xval,_ent1
            ('Heat Flux           ',a,g12.4,2x,a)
         *else
            _label=_HFLXLAB(_CURUNIT)
            *vwrite,_label
            ('<tr><td align=left><b>Heat Flux [ ',a,' ] </b></td>')
            *vwrite,_type
            ('<td align=center>',a,'</td>')
            *vwrite,_xval
            ('<td align=center>',g12.4,'</td>')
            *vwrite,_ent1
            ('<td align=left>',a,'</td>')
            /com,</tr>
         *endif
      *enddo
   *endif     
*enddo

! --- process imposed temperatures                       --- temperatures
! loop thru KP, LINE, and AREA constraints
*do,_alk,1,3
   ! skip if no entities of this type
   *if,_nent(_alk),le,0,cycle
   ! get mask of selected and defined entities
   *vfill,_MASK1(1),ramp,0
   *if,_alk,eq,1,then
      *vget,_MASK1(1),area,,asel,,,2
   *elseif,_alk,eq,2,then
      *vget,_MASK1(1),line,,lsel,,,2
   *else
      *vget,_MASK1(1),kp,,ksel,,,2
   *endif
   *vmask,_MASK1(1)
   *vfun,_ENVSCR(1,1,1),compress,%_ACTENV%(1,1,1)
   ! loop through each entity
   *do,_ii,1,_nent(_alk)
      _ent=_ENVSCR(_ii,1,1)
      _xval=%_ACTENV%(_ent,15,_alk)
      *if,_xval,eq,_FREE,cycle
      ! have a specified temperature
      _type=_entlab(_alk)
      _ent1=chrval(_ent)

      *if,_report,eq,0,then
         *vwrite,_type,_xval,_ent1
         ('Temperature         ',a,g12.4,2x,a)
      *else
         _label=_TEMPLAB(_CURUNIT)
         *vwrite,_label
         ('<tr><td align=left><b>Temperature [ ',a,' ] </b></td>')
         *vwrite,_type
         ('<td align=center>',a,'</td>')
         *vwrite,_xval
         ('<td align=center>',g12.4,'</td>')
         *vwrite,_ent1
         ('<td align=left>',a,'</td>')
         /com,</tr>
      *endif
   *enddo
*enddo

*if,_report,eq,0,then
   *cfclos
   *uilist,env,rpt
   /del,env,rpt
*else
   /com,</table>
   /com,</blockquote>
*endif

! delete local variables
*del,_i
*del,_count
*del,_xval
*del,_yval
*del,_set
*del,_report
*del,_envloc
*del,_ent
*del,_entlab
*del,_name1
*del,_name2
*del,_name3
*del,_name4
*del,_alk
*del,_ent1
*del,_ent2
*del,_ent3
*del,_ent4
*del,_ent5
*del,_ent6
*del,_ent7
*del,_label
*del,_nent
*del,_type
*del,_nout
*del,_frstent
*del,_ii
