Your program has a couple of faults. No matter, we've all done this at one time or another (for me about a week ago).
Your code should read:
WINAPP
program main
use clrwin
implicit none
integer :: iw,control=0
integer :: x = 10
integer :: y = 5
iw = winio@('%nl%gr[white]&',500,500)
iw = winio@('%lw',control)
call draw_filled_rectangle@(0,0,500,500,rgb@(255,255,255))
call draw_characters@('Hello World',x,y,rgb@(1,1,1))
end program main
Note that I declared an integer 'control' that is required for a %lw.
The %lw is required so the window can be 'created' and the program continues to the next lines afterward. Yet, the window remains!!
It is on those remaining lines that you can do what you wish. You cannot draw on a surface until it is created. It is not created until the window is actually built (hence the %lw).
Suggestion: Instead of 'use clrwin', you can 'use mswin'. That will get you additional capabilities later on.
Also WINAPP is a good thing to use at the top of your main program to insure all the appropriate windows setup routines are called.