'reinit'
'set display color white'
'clear'
'sdfopen LandSeaMaskNavy.nc'
filename='LandSeaMaskNavy'
'set fwrite -be 'LandSeaMaskNavy'.bin'
'set gxout fwrite'
'set y 1 360'
'set x 1 720'
'd '
'disable fwrite'
******************************************************************************************************************************
*    ctl
******************************************************************************************************************************

     'set t 1'
     rc=write(filename'.ctl','dset ^'filename'.bin' )
     rc=write(filename'.ctl','OPTIONS big_endian  '                                                                   ,append )
     rc=write(filename'.ctl','UNDEF -999.0'                                                                           ,append )
     rc=write(filename'.ctl','TITLE IBIS Vegetation Mask'                                                             ,append )
     rc=write(filename'.ctl','XDEF   720 LINEAR    0.75     0.5000000000'                                              ,append )
     rc=write(filename'.ctl','YDEF   360 LINEAR  -89.7500   0.5000000000'                                              ,append )
     rc=write(filename'.ctl','TDEF 1 LINEAR JAN2005 1MO'                                                              ,append )
     rc=write(filename'.ctl','ZDEF 1 LEVELS 1000'                                                                     ,append ) 
     rc=write(filename'.ctl','VARS 1'                                                                                 ,append )
     rc=write(filename'.ctl',' lsmk  0  t,y,x  Land Sea Mask [1-Land 0-Sea]                                   '       ,append )
     rc=write(filename'.ctl','ENDVARS'                                                                                ,append )
******************************************************************************************************************************
