diff --git a/Aforc_CFSR/make_CFSR.m b/Aforc_CFSR/make_CFSR.m
index 0a9b086cb59b5cbf93119fe1226966641796f4b1..abc6382f302f063f1e97a041037d7434f74d3313 100644
--- a/Aforc_CFSR/make_CFSR.m
+++ b/Aforc_CFSR/make_CFSR.m
@@ -94,7 +94,7 @@ if Download_data==1
     disp('Download CFSR data with OPENDAP')
     disp(['===================='])
     download_CFSR(Ymin,Ymax,Mmin,Mmax,lonmin,lonmax,latmin,latmax,...
-        NCEP_dir,NCEP_version,Yorig)
+                  NCEP_dir,Yorig)
     disp(['====================='])
     disp(['DOWNLOAD STEP FINISH'])
     disp(['====================='])
@@ -373,7 +373,7 @@ if SPIN_Long>0
             if (isoctave == 0)
 		eval(['!cp ',frcname,' ',frcname2])
 	    else
-      		system(['cp ',frcname,' ',frcname2]
+      		system(['cp ',frcname,' ',frcname2])
        	    end          
 	    %
             % Change the time
diff --git a/Aforc_ERA5/ERA5_convert.py b/Aforc_ERA5/ERA5_convert.py
old mode 100644
new mode 100755
index b17c0d13f979a0f6693cdb61741ef3dc233b78d1..76def899b8f5cb0cf1a44506676f0c860e3e70f6
--- a/Aforc_ERA5/ERA5_convert.py
+++ b/Aforc_ERA5/ERA5_convert.py
@@ -67,7 +67,7 @@ for iyear in range(year_start,year_end+1):
 
         fname_in = era5_dir_raw + '/ERA5_ecmwf_' + vname.upper() + '_Y' + str(iyear) + 'M' + str(imonth).zfill(2) + '.nc'
         nc = netcdf(fname_in,'r+',format='NETCDF4')
-        time = nc.variables['time'][:]
+        time = nc.variables['valid_time'][:]
         lat = nc.variables['latitude'][:]
         lon = nc.variables['longitude'][:]
         data = nc.variables[vname][:,:,:]
@@ -95,12 +95,12 @@ for iyear in range(year_start,year_end+1):
         data[np.where(data==mvalue)]=9999.
 
 #
-# Convert time from hours since 1900-1-1 0:0:0 into days since Yorig-1-1 0:0:0
+# Convert time from seconds since 1970-1-1 0:0:0 into days since Yorig-1-1 0:0:0
 #
 
-        time = time / 24.
+        time = time / 86400.
         time = time - date.toordinal(date(Yorig,1,1)) \
-	            + date.toordinal(date(1900,1,1))
+	            + date.toordinal(date(1970,1,1))
 
 #
 # Changes names