### 2015/04/12 Yuta Ando (Mie University)

#Download data
wget http://www.metoffice.gov.uk/hadobs/hadisst/data/HadISST_sst.nc.gz -O ./HadISST_sst.nc.gz
wget http://www.metoffice.gov.uk/hadobs/hadisst/data/HadISST_ice.nc.gz -O ./HadISST_ice.nc.gz

#unzip data
gunzip ./HadISST_sst.nc.gz
gunzip ./HadISST_ice.nc.gz

#convert Netcdf to binary data
lats4d -mxtimes 2000 -i ./HadISST_sst.nc -format stream -o ./HadISST_sst
lats4d -mxtimes 2000 -i ./HadISST_ice.nc -format stream -o ./HadISST_ice

#replace 100% sea-ice-covered gridboxes values to undef
ifort -assume byterecl -mcmodel=large -i-dynamic ./replace_undef.f90 -o ./replace_undef.exe
./replace_undef.exe

