
library('s2dverification')
library('ncdf')
library('fpc')
library('NbClust')

source('/home/nevensf/gitrep/s2dverification/R/Load.R')
source('/home/nevensf/gitrep/s2dverification/R/Cluster.R')
source('/home/nevensf/gitrep/s2dverification/R/SeaIceModes.R')
source('/home/nevensf/gitrep/s2dverification/R/AreaWeights.R')

# to be removed later -----------------------------------------------
print(' ')
print('The start of SeaIceModes for i00v (test_i00v_Arcticreg1)')
print(' ')
#--------------------------------------------------------------------

tst1 <- SeaIceModes( var='sit', exp='i00v', obs=NULL, sdates='19790101', seasoninf=4, seasonsup=6, nclusters=3, detrended=FALSE, datagrid='N3.2_O1L42' )

# to be removed later -----------------------------------------------
print(' ')
print('The structure of tst1 (the end of test_i00v_Arcticreg1)')
print(' ')
print(str(tst1))
#--------------------------------------------------------------------

ice0 <- Load(var='tos',exp='i00v',obs=NULL,sdates=c(19790101),nleadtime=420,leadtimemin=1,leadtimemax=420,storefreq="monthly",sampleperiod=1,output='lonlat')

ice1 <- Mean1Dim(ice0$mod,2)
print(dim(ice1))

## something to potentially consider in the future after kmeans approach is fully functional
##pam from library(fpc) will be considered as a first relative of kmeans only after kmeans is full functional
##print(' ')
##print('Like the K-means analysis with K=4. but using medoids instead controids')
##print(' ')
##print(pam.results<-pam(bubi,4))
##the follwoing is also potentially useful funcation related to pam : pmak.results<-pamk(bubi))


