module fbindstring contains function gstring(chr) character, pointer, dimension(:) :: gstring character(len=*),intent(in) :: chr ! returns the string consisting of the characters char integer :: lc lc=len(chr) allocate(gstring(1:lc)) do i=1,lc gstring(i) = chr(i:i) end do end function gstring end module fbindstring program star use fbindtypes use fbindsubs use fbindstring implicit none ! Variables needed character(len=7) :: err_file integer :: err_ind integer :: wsid character(len=80) :: wsspec type(Gws_type) :: wstype type(Gwsl) :: ent_val type(Gndc_win) :: wswn = Gndc_win(-1.25,-1.25,1.25,1.25) type(Gint_colr_spec) :: col_yellow type(Gchar_colr_spec) :: col_white type(Gint_style_id) :: int_style type(Gtext_align) :: text_align type(Gtext_height) :: text_height type(Gset_fill) :: star_coords type(Gtext) :: star_title ! Open GKS and activate the workstations. wsid = 1 ! Need to specify the implmentation dependent versions ! of wsspec and wstype err_file = 'err.log' call gopen_gks (err_file) call gopen_ws (wsid, wsspec, wstype) call gactivate_ws (wsid) ! Center the window around the origin. call ginq_wsl_entry (wsid, Gwsl_curwsvp, Gset_realized_set, & err_ind, ent_val) call gset_ws_win_vp (wsid, wswn, ent_val%ws_vp) call gset_norm_tran_num (1) ! Fill the star with solid yellow. col_yellow%colr_spec = Gcolr_spec_rgb col_yellow%rgb = Gcolr_rgb(1.0,1.0,0.0) int_style=Gint_style_solid call gset_prim_attr (int_style) call gset_prim_attr (col_yellow) ! Draw the star. allocate (star_coords%seqs(1)) allocate (star_coords%seqs(1)%point(5)) star_coords%seqs(1)%point%x = & (/0.951057,-0.951057,0.587785,0.0,-0.587785/) star_coords%seqs(1)%point%y = & (/0.309017,0.309017,-0.951057,1.0,-0.951057/) call gcreate_out_prim (star_coords) ! Select large chracters centered under the star. text_height%r = 0.15 call gset_prim_attr (text_height) text_align%hor_align = Ghor_align_centre text_align%vert_align = Gvert_align_half call gset_prim_attr(text_align) col_white%colr_spec = Gcolr_spec_rgb col_white%rgb = Gcolr_rgb(1.0,1.0,1.0) call gset_prim_attr (col_white) ! Draw the title. star_title%charstring = gstring('Star') star_title%ref_point%x = 0.0 star_title%ref_point%y = -1.1 call gcreate_out_prim (star_title) ! Close the workstation and shut down GKS. call gdeactivate_ws (wsid) call gclose_ws (wsid) call gclose_gks () end program star