From 9fa5d7fc6d5f33064635fb30473f9ee8a3c6fcc5 Mon Sep 17 00:00:00 2001 From: SarahAlidoost Date: Tue, 18 Jan 2022 18:10:34 +0100 Subject: [PATCH 1/8] define SoilPropertyPath InputPath OutputPath, remove unused variables, refactor save function in filesread --- src/filesread.m | 113 +++++++++++++++++++++++++++--------------------- 1 file changed, 63 insertions(+), 50 deletions(-) diff --git a/src/filesread.m b/src/filesread.m index 226a034e..34f6816f 100644 --- a/src/filesread.m +++ b/src/filesread.m @@ -1,23 +1,36 @@ +%%%%%%% Set paths %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Set soil parameters path +SoilPropertyPath='/home/jovyan/shared/EcoExtreML/STEMMUS_SCOPEv1.0.0/input/SoilProperty/'; +% Set input paths including vegetation parameters and forcing dat files +% Set this path the same as working dir and copy file there +InputPath='/home/jovyan/shared/EcoExtreML/STEMMUS_SCOPEv1.0.0/input/'; +% Set output path +OutputPath='/home/jovyan/shared/EcoExtreML/STEMMUS_SCOPEv1.0.0/output/'; +% Set forcing data path +ForcingPath='/home/jovyan/shared/EcoExtreML/STEMMUS_SCOPEv1.0.0/Plumber2_data/'; +% Set forsing netcdf file name +% here as an example, we pick 'FI-Hyy_1996-2014_FLUXNET2015_Met' +ForcingFileName='FI-Hyy_1996-2014_FLUXNET2015_Met.nc'; + +%%%%%%% Prepare input files. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% global DELT IGBP_veg_long latitude longitude reference_height canopy_height sitename -fileFolder=fullfile('../input/'); %read sitename -dirOutput=dir(fullfile(fileFolder,'*.nc')); + +ForcingFilePath=fullfile(ForcingPath, ForcingFileName); %prepare input files -Path ='../input/'; -%File=dir(fullfile(Path,'filename')); -full_path=strcat(Path,dirOutput.name); -sitefullname=dirOutput.name; +sitefullname=dir(ForcingFilePath).name; %read sitename sitename=sitefullname(1:6); startyear=sitefullname(8:11); endyear=sitefullname(13:16); startyear=str2double(startyear); endyear=str2double(endyear); -%ncFilePath='../input/'; %ncdisp(sitefullname,'/','full'); -time1=ncread(full_path,'time'); +time1=ncread(ForcingFilePath,'time'); t1=datenum(startyear,1,1,0,0,0); DELT=time1(2); -Dur_tot=length(time1); +%Set the end time of the main loop in STEMMUS_SCOPE.m +Dur_tot=10; +%Dur_tot=length(time1); dt=time1(2)/3600/24; t2=datenum(endyear,12,31,23,30,0); T=t1:dt:t2; @@ -39,100 +52,100 @@ time=T8; T10=year(T); -RH=ncread(full_path,'RH'); +RH=ncread(ForcingFilePath,'RH'); RHL=length(RH); RHa=reshape(RH,RHL,1); -Tair=ncread(full_path,'Tair'); +Tair=ncread(ForcingFilePath,'Tair'); TairL=length(Tair); Taira=reshape(Tair,TairL,1)-273.15; es= 6.107*10.^(Taira.*7.5./(237.3+Taira)); ea=es.*RHa./100; -SWdown=ncread(full_path,'SWdown'); +SWdown=ncread(ForcingFilePath,'SWdown'); SWdownL=length(SWdown); SWdowna=reshape(SWdown,SWdownL,1); -LWdown=ncread(full_path,'LWdown'); +LWdown=ncread(ForcingFilePath,'LWdown'); LWdownL=length(LWdown); LWdowna=reshape(LWdown,LWdownL,1); -VPD=ncread(full_path,'VPD'); +VPD=ncread(ForcingFilePath,'VPD'); VPDL=length(VPD); VPDa=reshape(VPD,VPDL,1); -Qair=ncread(full_path,'Qair'); +Qair=ncread(ForcingFilePath,'Qair'); QairL=length(Qair); Qaira=reshape(Qair,QairL,1); -Psurf=ncread(full_path,'Psurf'); +Psurf=ncread(ForcingFilePath,'Psurf'); PsurfL=length(Psurf); Psurfa=reshape(Psurf,PsurfL,1); Psurfa=Psurfa./100; -Precip=ncread(full_path,'Precip'); +Precip=ncread(ForcingFilePath,'Precip'); PrecipL=length(Precip); Precipa=reshape(Precip,PrecipL,1); Precipa=Precipa./10; -Wind=ncread(full_path,'Wind'); +Wind=ncread(ForcingFilePath,'Wind'); WindL=length(Wind); Winda=reshape(Wind,WindL,1); -CO2air=ncread(full_path,'CO2air'); +CO2air=ncread(ForcingFilePath,'CO2air'); CO2airL=length(CO2air); CO2aira=reshape(CO2air,CO2airL,1); CO2aira=CO2aira.*44./22.4; -latitude=ncread(full_path,'latitude'); -longitude=ncread(full_path,'longitude'); -elevation=ncread(full_path,'elevation'); +latitude=ncread(ForcingFilePath,'latitude'); +longitude=ncread(ForcingFilePath,'longitude'); +elevation=ncread(ForcingFilePath,'elevation'); -LAI=ncread(full_path,'LAI'); +LAI=ncread(ForcingFilePath,'LAI'); LAIL=length(LAI); LAIa=reshape(LAI,LAIL,1); -LAI_alternative=ncread(full_path,'LAI_alternative'); +LAI_alternative=ncread(ForcingFilePath,'LAI_alternative'); LAI_alternativeL=length(LAI_alternative); LAI_alternativea=reshape(LAI_alternative,LAI_alternativeL,1); -IGBP_veg_long=ncread(full_path,'IGBP_veg_long'); -reference_height=ncread(full_path,'reference_height'); -canopy_height=ncread(full_path,'canopy_height'); +IGBP_veg_long=ncread(ForcingFilePath,'IGBP_veg_long'); +reference_height=ncread(ForcingFilePath,'reference_height'); +canopy_height=ncread(ForcingFilePath,'canopy_height'); % save .dat files for SCOPE -%save ../input/LAI_alternative.dat -ascii LAI_alternative -save ../input/t_.dat -ascii time -save ../input/Ta_.dat -ascii Taira -save ../input/Rin_.dat -ascii SWdowna -save ../input/Rli_.dat -ascii LWdowna -%save ../input/VPDa.dat -ascii VPDa -%save ../input/Qaira.dat -ascii Qaira -save ../input/p_.dat -ascii Psurfa -%save ../input/Precipa.dat -ascii Precipa -save ../input/u_.dat -ascii Winda -%save ../input/RHa.dat -ascii RHa -save ../input/CO2_.dat -ascii CO2aira -%save ../input/latitude.dat -ascii latitude -%save ../input/longitude.dat -ascii longitude -%save ../input/reference_height.dat -ascii reference_height -%save ../input/canopy_height.dat -ascii canopy_height -%save ../input/elevation.dat -ascii elevation -save ../input/ea_.dat -ascii ea -save ../input/year_.dat -ascii T10 +%save([InputPath, 'LAI_alternative.dat'], '-ascii', LAI_alternative) +save([InputPath, 't_.dat'], '-ascii', 'time') +save([InputPath, 'Ta_.dat'], '-ascii', 'Taira') +save([InputPath, 'Rin_.dat'], '-ascii', 'SWdowna') +save([InputPath, 'Rli_.dat'], '-ascii', 'LWdowna') +%save([InputPath, 'VPDa.dat'], '-ascii', 'VPDa') +%save([InputPath, 'Qaira.dat'], '-ascii', 'Qaira') +save([InputPath, 'p_.dat'], '-ascii', 'Psurfa') +%save([InputPath, 'Precipa.dat'], '-ascii', 'Precipa') +save([InputPath, 'u_.dat'], '-ascii', 'Winda') +%save([InputPath, 'RHa.dat'], '-ascii', 'RHa') +save([InputPath, 'CO2_.dat'], '-ascii', 'CO2aira') +%save([InputPath, 'latitude.dat'], '-ascii', 'latitude') +%save([InputPath, 'longitude.dat'], '-ascii', 'longitude') +%save([InputPath, 'reference_height.dat'], '-ascii', 'reference_height') +%save([InputPath, 'canopy_height.dat'], '-ascii', 'canopy_height') +%save([InputPath, 'elevation.dat'], '-ascii', 'elevation') +save([InputPath, 'ea_.dat'], '-ascii', 'ea') +save([InputPath, 'year_.dat'], '-ascii', 'T10') LAI=[time'; LAIa']'; -save ../input/LAI_.dat -ascii LAI %save meteorological data for STEMMUS +save([InputPath, 'LAI_.dat'], '-ascii', 'LAI') %save meteorological data for STEMMUS Meteodata=[time';Taira';RHa';Winda';Psurfa';Precipa';SWdowna';LWdowna';VPDa';LAIa']'; -save ../input/Mdata.txt -ascii Meteodata %save meteorological data for STEMMUS +save([InputPath, 'Mdata.txt'], '-ascii', 'Meteodata') %save meteorological data for STEMMUS %Lacationdata=[latitude;longitude;reference_height;canopy_height;elevation]'; -%save ../input/Lacationdata.txt -ascii Lacationdata -clearvars -except DELT Dur_tot IGBP_veg_long latitude longitude reference_height canopy_height sitename \ No newline at end of file +%save([InputPath, 'Lacationdata.txt'], '-ascii', 'Lacationdata') +clearvars -except SoilPropertyPath InputPath OutputPath DELT Dur_tot IGBP_veg_long latitude longitude reference_height canopy_height sitename \ No newline at end of file From 9d8da9398ec4912a3ce3df667f0687d067863a7f Mon Sep 17 00:00:00 2001 From: SarahAlidoost Date: Tue, 18 Jan 2022 18:11:49 +0100 Subject: [PATCH 2/8] replace relative path with SoilPropertyPath in soilpropertyread --- src/soilpropertyread.m | 182 ++++++++++++++++++++--------------------- 1 file changed, 91 insertions(+), 91 deletions(-) diff --git a/src/soilpropertyread.m b/src/soilpropertyread.m index 07322397..1ffaba6f 100644 --- a/src/soilpropertyread.m +++ b/src/soilpropertyread.m @@ -1,17 +1,17 @@ global SaturatedK SaturatedMC ResidualMC Coefficient_n Coefficient_Alpha porosity FOC FOS FOSL MSOC Coef_Lamda fieldMC latitude longitude -ncFilePath='../SoilProperty'; -dirOutput=dir('../SoilProperty/Hydraul_Param_SoilGrids_Schaap_sl7.nc'); -%ncdisp('../SoilProperty/Hydraul_Param_SoilGrids_Schaap_sl1.nc','/','full'); -%ncdisp('../SoilProperty/Hydraul_Param_SoilGrids_Schaap_sl2.nc','/','full'); -%ncdisp('../SoilProperty/Hydraul_Param_SoilGrids_Schaap_sl3.nc','/','full'); -%ncdisp('../SoilProperty/Hydraul_Param_SoilGrids_Schaap_sl4.nc','/','full'); -%ncdisp('../SoilProperty/Hydraul_Param_SoilGrids_Schaap_sl5.nc','/','full'); -%ncdisp('../SoilProperty/Hydraul_Param_SoilGrids_Schaap_sl6.nc','/','full'); -%ncdisp('../SoilProperty/Hydraul_Param_SoilGrids_Schaap_sl7.nc','/','full'); -%ncdisp('../SoilProperty/CLAY1.nc','/','full'); +% the path SoilPropertyPath is set in filereads.m +dirOutput=dir([SoilPropertyPath, 'Hydraul_Param_SoilGrids_Schaap_sl7.nc']); +%ncdisp([SoilPropertyPath,'Hydraul_Param_SoilGrids_Schaap_sl1.nc'],'/','full'); +%ncdisp([SoilPropertyPath,'Hydraul_Param_SoilGrids_Schaap_sl2.nc'],'/','full'); +%ncdisp([SoilPropertyPath,'Hydraul_Param_SoilGrids_Schaap_sl3.nc'],'/','full'); +%ncdisp([SoilPropertyPath,'Hydraul_Param_SoilGrids_Schaap_sl4.nc'],'/','full'); +%ncdisp([SoilPropertyPath,'Hydraul_Param_SoilGrids_Schaap_sl5.nc'],'/','full'); +%ncdisp([SoilPropertyPath,'Hydraul_Param_SoilGrids_Schaap_sl6.nc'],'/','full'); +%ncdisp([SoilPropertyPath,'Hydraul_Param_SoilGrids_Schaap_sl7.nc'],'/','full'); +%ncdisp([SoilPropertyPath,'CLAY1.nc','/','full'); %% load soil property -lat=ncread('../SoilProperty/CLAY1.nc','lat'); -lon=ncread('../SoilProperty/CLAY1.nc','lon'); +lat=ncread([SoilPropertyPath,'CLAY1.nc'],'lat'); +lon=ncread([SoilPropertyPath,'CLAY1.nc'],'lon'); for i=1:16800 if abs(lat(i)-latitude)<0.0085 break @@ -22,25 +22,25 @@ break end end -depth1=ncread('../SoilProperty/CLAY1.nc','depth'); -depth2=ncread('../SoilProperty/CLAY2.nc','depth'); -depth3=ncread('../SoilProperty/POR.nc','depth'); -CLAY1=ncread('../SoilProperty/CLAY1.nc','CLAY',[j,i,1],[1,1,4]); -CLAY2=ncread('../SoilProperty/CLAY2.nc','CLAY',[j,i,1],[1,1,4]); -SAND1=ncread('../SoilProperty/SAND1.nc','SAND',[j,i,1],[1,1,4]); -SAND2=ncread('../SoilProperty/SAND2.nc','SAND',[j,i,1],[1,1,4]); -SILT1=ncread('../SoilProperty/SILT1.nc','SILT',[j,i,1],[1,1,4]); -SILT2=ncread('../SoilProperty/SILT2.nc','SILT',[j,i,1],[1,1,4]); -OC1=ncread('../SoilProperty/OC1.nc','OC',[j,i,1],[1,1,4]); -OC2=ncread('../SoilProperty/OC2.nc','OC',[j,i,1],[1,1,4]); +depth1=ncread([SoilPropertyPath,'CLAY1.nc'],'depth'); +depth2=ncread([SoilPropertyPath,'CLAY2.nc'],'depth'); +depth3=ncread([SoilPropertyPath,'POR.nc'],'depth'); +CLAY1=ncread([SoilPropertyPath,'CLAY1.nc'],'CLAY',[j,i,1],[1,1,4]); +CLAY2=ncread([SoilPropertyPath,'CLAY2.nc'],'CLAY',[j,i,1],[1,1,4]); +SAND1=ncread([SoilPropertyPath,'SAND1.nc'],'SAND',[j,i,1],[1,1,4]); +SAND2=ncread([SoilPropertyPath,'SAND2.nc'],'SAND',[j,i,1],[1,1,4]); +SILT1=ncread([SoilPropertyPath,'SILT1.nc'],'SILT',[j,i,1],[1,1,4]); +SILT2=ncread([SoilPropertyPath,'SILT2.nc'],'SILT',[j,i,1],[1,1,4]); +OC1=ncread([SoilPropertyPath,'OC1.nc'],'OC',[j,i,1],[1,1,4]); +OC2=ncread([SoilPropertyPath,'OC2.nc'],'OC',[j,i,1],[1,1,4]); FOC=[CLAY1(1) CLAY1(3) CLAY2(1) CLAY2(2) CLAY2(3) CLAY2(4)]/100; %fraction of clay FOS=[SAND1(1) SAND1(3) SAND2(1) SAND2(2) SAND2(3) SAND2(4)]/100; %fraction of sand %FOSL=1-FOC-FOS; %fraction of silt MSOC=double([OC1(1) OC1(3) OC2(1) OC2(2) OC2(3) OC2(4)])./10000; %mass fraction of soil organic matter %% load lamda -lati=ncread('../SoilProperty/lambda/lambda_l1.nc','lat'); -long=ncread('../SoilProperty/lambda/lambda_l1.nc','lon'); +lati=ncread([SoilPropertyPath,'lambda/lambda_l1.nc'],'lat'); +long=ncread([SoilPropertyPath,'lambda/lambda_l1.nc'],'lon'); for i=1:21600 if abs(lati(i)-latitude)<0.0085 break @@ -51,81 +51,81 @@ break end end -lambda1=ncread('../SoilProperty/lambda/lambda_l1.nc','lambda',[j,i],[1,1]); -lambda2=ncread('../SoilProperty/lambda/lambda_l2.nc','lambda',[j,i],[1,1]); -lambda3=ncread('../SoilProperty/lambda/lambda_l3.nc','lambda',[j,i],[1,1]); -lambda4=ncread('../SoilProperty/lambda/lambda_l4.nc','lambda',[j,i],[1,1]); -lambda5=ncread('../SoilProperty/lambda/lambda_l5.nc','lambda',[j,i],[1,1]); -lambda6=ncread('../SoilProperty/lambda/lambda_l6.nc','lambda',[j,i],[1,1]); -lambda7=ncread('../SoilProperty/lambda/lambda_l7.nc','lambda',[j,i],[1,1]); -lambda8=ncread('../SoilProperty/lambda/lambda_l8.nc','lambda',[j,i],[1,1]); +lambda1=ncread([SoilPropertyPath,'lambda/lambda_l1.nc'],'lambda',[j,i],[1,1]); +lambda2=ncread([SoilPropertyPath,'lambda/lambda_l2.nc'],'lambda',[j,i],[1,1]); +lambda3=ncread([SoilPropertyPath,'lambda/lambda_l3.nc'],'lambda',[j,i],[1,1]); +lambda4=ncread([SoilPropertyPath,'lambda/lambda_l4.nc'],'lambda',[j,i],[1,1]); +lambda5=ncread([SoilPropertyPath,'lambda/lambda_l5.nc'],'lambda',[j,i],[1,1]); +lambda6=ncread([SoilPropertyPath,'lambda/lambda_l6.nc'],'lambda',[j,i],[1,1]); +lambda7=ncread([SoilPropertyPath,'lambda/lambda_l7.nc'],'lambda',[j,i],[1,1]); +lambda8=ncread([SoilPropertyPath,'lambda/lambda_l8.nc'],'lambda',[j,i],[1,1]); Coef_Lamda=[lambda1 lambda3 lambda5 lambda6 lambda7 lambda8]; %% load soil hydrulic parameters -lat=ncread('../SoilProperty/Hydraul_Param_SoilGrids_Schaap_sl7.nc','latitude'); -lon=ncread('../SoilProperty/Hydraul_Param_SoilGrids_Schaap_sl7.nc','longitude'); +lat=ncread([SoilPropertyPath,'Hydraul_Param_SoilGrids_Schaap_sl7.nc'],'latitude'); +lon=ncread([SoilPropertyPath,'Hydraul_Param_SoilGrids_Schaap_sl7.nc'],'longitude'); % 0cm -alpha_fit_0cm=ncread('../SoilProperty/Hydraul_Param_SoilGrids_Schaap_sl1.nc','alpha_fit_0cm'); -n_fit_0cm=ncread('../SoilProperty/Hydraul_Param_SoilGrids_Schaap_sl1.nc','n_fit_0cm'); -mean_theta_s_0cm=ncread('../SoilProperty/Hydraul_Param_SoilGrids_Schaap_sl1.nc','mean_theta_s_0cm'); -mean_theta_r_0cm=ncread('../SoilProperty/Hydraul_Param_SoilGrids_Schaap_sl1.nc','mean_theta_r_0cm'); -mean_L_0cm=ncread('../SoilProperty/Hydraul_Param_SoilGrids_Schaap_sl1.nc','mean_L_0cm'); -mean_Ks_0cm=ncread('../SoilProperty/Hydraul_Param_SoilGrids_Schaap_sl1.nc','mean_Ks_0cm'); -var_scaling_0cm=ncread('../SoilProperty/Hydraul_Param_SoilGrids_Schaap_sl1.nc','var_scaling_0cm'); -valid_subpixels_0cm=ncread('../SoilProperty/Hydraul_Param_SoilGrids_Schaap_sl1.nc','valid_subpixels_0cm'); +alpha_fit_0cm=ncread([SoilPropertyPath,'Hydraul_Param_SoilGrids_Schaap_sl1.nc'],'alpha_fit_0cm'); +n_fit_0cm=ncread([SoilPropertyPath,'Hydraul_Param_SoilGrids_Schaap_sl1.nc'],'n_fit_0cm'); +mean_theta_s_0cm=ncread([SoilPropertyPath,'Hydraul_Param_SoilGrids_Schaap_sl1.nc'],'mean_theta_s_0cm'); +mean_theta_r_0cm=ncread([SoilPropertyPath,'Hydraul_Param_SoilGrids_Schaap_sl1.nc'],'mean_theta_r_0cm'); +mean_L_0cm=ncread([SoilPropertyPath,'Hydraul_Param_SoilGrids_Schaap_sl1.nc'],'mean_L_0cm'); +mean_Ks_0cm=ncread([SoilPropertyPath,'Hydraul_Param_SoilGrids_Schaap_sl1.nc'],'mean_Ks_0cm'); +var_scaling_0cm=ncread([SoilPropertyPath,'Hydraul_Param_SoilGrids_Schaap_sl1.nc'],'var_scaling_0cm'); +valid_subpixels_0cm=ncread([SoilPropertyPath,'Hydraul_Param_SoilGrids_Schaap_sl1.nc'],'valid_subpixels_0cm'); % 5cm -alpha_fit_5cm=ncread('../SoilProperty/Hydraul_Param_SoilGrids_Schaap_sl2.nc','alpha_fit_5cm'); -n_fit_5cm=ncread('../SoilProperty/Hydraul_Param_SoilGrids_Schaap_sl2.nc','n_fit_5cm'); -mean_theta_s_5cm=ncread('../SoilProperty/Hydraul_Param_SoilGrids_Schaap_sl2.nc','mean_theta_s_5cm'); -mean_theta_r_5cm=ncread('../SoilProperty/Hydraul_Param_SoilGrids_Schaap_sl2.nc','mean_theta_r_5cm'); -mean_L_5cm=ncread('../SoilProperty/Hydraul_Param_SoilGrids_Schaap_sl2.nc','mean_L_5cm'); -mean_Ks_5cm=ncread('../SoilProperty/Hydraul_Param_SoilGrids_Schaap_sl2.nc','mean_Ks_5cm'); -var_scaling_5cm=ncread('../SoilProperty/Hydraul_Param_SoilGrids_Schaap_sl2.nc','var_scaling_5cm'); -valid_subpixels_5cm=ncread('../SoilProperty/Hydraul_Param_SoilGrids_Schaap_sl2.nc','valid_subpixels_5cm'); +alpha_fit_5cm=ncread([SoilPropertyPath,'Hydraul_Param_SoilGrids_Schaap_sl2.nc'],'alpha_fit_5cm'); +n_fit_5cm=ncread([SoilPropertyPath,'Hydraul_Param_SoilGrids_Schaap_sl2.nc'],'n_fit_5cm'); +mean_theta_s_5cm=ncread([SoilPropertyPath,'Hydraul_Param_SoilGrids_Schaap_sl2.nc'],'mean_theta_s_5cm'); +mean_theta_r_5cm=ncread([SoilPropertyPath,'Hydraul_Param_SoilGrids_Schaap_sl2.nc'],'mean_theta_r_5cm'); +mean_L_5cm=ncread([SoilPropertyPath,'Hydraul_Param_SoilGrids_Schaap_sl2.nc'],'mean_L_5cm'); +mean_Ks_5cm=ncread([SoilPropertyPath,'Hydraul_Param_SoilGrids_Schaap_sl2.nc'],'mean_Ks_5cm'); +var_scaling_5cm=ncread([SoilPropertyPath,'Hydraul_Param_SoilGrids_Schaap_sl2.nc'],'var_scaling_5cm'); +valid_subpixels_5cm=ncread([SoilPropertyPath,'Hydraul_Param_SoilGrids_Schaap_sl2.nc'],'valid_subpixels_5cm'); % 15cm -alpha_fit_15cm=ncread('../SoilProperty/Hydraul_Param_SoilGrids_Schaap_sl3.nc','alpha_fit_15cm'); -n_fit_15cm=ncread('../SoilProperty/Hydraul_Param_SoilGrids_Schaap_sl3.nc','n_fit_15cm'); -mean_theta_s_15cm=ncread('../SoilProperty/Hydraul_Param_SoilGrids_Schaap_sl3.nc','mean_theta_s_15cm'); -mean_theta_r_15cm=ncread('../SoilProperty/Hydraul_Param_SoilGrids_Schaap_sl3.nc','mean_theta_r_15cm'); -mean_L_15cm=ncread('../SoilProperty/Hydraul_Param_SoilGrids_Schaap_sl3.nc','mean_L_15cm'); -mean_Ks_15cm=ncread('../SoilProperty/Hydraul_Param_SoilGrids_Schaap_sl3.nc','mean_Ks_15cm'); -var_scaling_15cm=ncread('../SoilProperty/Hydraul_Param_SoilGrids_Schaap_sl3.nc','var_scaling_15cm'); -valid_subpixels_15cm=ncread('../SoilProperty/Hydraul_Param_SoilGrids_Schaap_sl3.nc','valid_subpixels_15cm'); +alpha_fit_15cm=ncread([SoilPropertyPath,'Hydraul_Param_SoilGrids_Schaap_sl3.nc'],'alpha_fit_15cm'); +n_fit_15cm=ncread([SoilPropertyPath,'Hydraul_Param_SoilGrids_Schaap_sl3.nc'],'n_fit_15cm'); +mean_theta_s_15cm=ncread([SoilPropertyPath,'Hydraul_Param_SoilGrids_Schaap_sl3.nc'],'mean_theta_s_15cm'); +mean_theta_r_15cm=ncread([SoilPropertyPath,'Hydraul_Param_SoilGrids_Schaap_sl3.nc'],'mean_theta_r_15cm'); +mean_L_15cm=ncread([SoilPropertyPath,'Hydraul_Param_SoilGrids_Schaap_sl3.nc'],'mean_L_15cm'); +mean_Ks_15cm=ncread([SoilPropertyPath,'Hydraul_Param_SoilGrids_Schaap_sl3.nc'],'mean_Ks_15cm'); +var_scaling_15cm=ncread([SoilPropertyPath,'Hydraul_Param_SoilGrids_Schaap_sl3.nc'],'var_scaling_15cm'); +valid_subpixels_15cm=ncread([SoilPropertyPath,'Hydraul_Param_SoilGrids_Schaap_sl3.nc'],'valid_subpixels_15cm'); % 30cm -alpha_fit_30cm=ncread('../SoilProperty/Hydraul_Param_SoilGrids_Schaap_sl4.nc','alpha_fit_30cm'); -n_fit_30cm=ncread('../SoilProperty/Hydraul_Param_SoilGrids_Schaap_sl4.nc','n_fit_30cm'); -mean_theta_s_30cm=ncread('../SoilProperty/Hydraul_Param_SoilGrids_Schaap_sl4.nc','mean_theta_s_30cm'); -mean_theta_r_30cm=ncread('../SoilProperty/Hydraul_Param_SoilGrids_Schaap_sl4.nc','mean_theta_r_30cm'); -mean_L_30cm=ncread('../SoilProperty/Hydraul_Param_SoilGrids_Schaap_sl4.nc','mean_L_30cm'); -mean_Ks_30cm=ncread('../SoilProperty/Hydraul_Param_SoilGrids_Schaap_sl4.nc','mean_Ks_30cm'); -var_scaling_30cm=ncread('../SoilProperty/Hydraul_Param_SoilGrids_Schaap_sl4.nc','var_scaling_30cm'); -valid_subpixels_30cm=ncread('../SoilProperty/Hydraul_Param_SoilGrids_Schaap_sl4.nc','valid_subpixels_30cm'); +alpha_fit_30cm=ncread([SoilPropertyPath,'Hydraul_Param_SoilGrids_Schaap_sl4.nc'],'alpha_fit_30cm'); +n_fit_30cm=ncread([SoilPropertyPath,'Hydraul_Param_SoilGrids_Schaap_sl4.nc'],'n_fit_30cm'); +mean_theta_s_30cm=ncread([SoilPropertyPath,'Hydraul_Param_SoilGrids_Schaap_sl4.nc'],'mean_theta_s_30cm'); +mean_theta_r_30cm=ncread([SoilPropertyPath,'Hydraul_Param_SoilGrids_Schaap_sl4.nc'],'mean_theta_r_30cm'); +mean_L_30cm=ncread([SoilPropertyPath,'Hydraul_Param_SoilGrids_Schaap_sl4.nc'],'mean_L_30cm'); +mean_Ks_30cm=ncread([SoilPropertyPath,'Hydraul_Param_SoilGrids_Schaap_sl4.nc'],'mean_Ks_30cm'); +var_scaling_30cm=ncread([SoilPropertyPath,'Hydraul_Param_SoilGrids_Schaap_sl4.nc'],'var_scaling_30cm'); +valid_subpixels_30cm=ncread([SoilPropertyPath,'Hydraul_Param_SoilGrids_Schaap_sl4.nc'],'valid_subpixels_30cm'); % 60cm -alpha_fit_60cm=ncread('../SoilProperty/Hydraul_Param_SoilGrids_Schaap_sl5.nc','alpha_fit_60cm'); -n_fit_60cm=ncread('../SoilProperty/Hydraul_Param_SoilGrids_Schaap_sl5.nc','n_fit_60cm'); -mean_theta_s_60cm=ncread('../SoilProperty/Hydraul_Param_SoilGrids_Schaap_sl5.nc','mean_theta_s_60cm'); -mean_theta_r_60cm=ncread('../SoilProperty/Hydraul_Param_SoilGrids_Schaap_sl5.nc','mean_theta_r_60cm'); -mean_L_60cm=ncread('../SoilProperty/Hydraul_Param_SoilGrids_Schaap_sl5.nc','mean_L_60cm'); -mean_Ks_60cm=ncread('../SoilProperty/Hydraul_Param_SoilGrids_Schaap_sl5.nc','mean_Ks_60cm'); -var_scaling_60cm=ncread('../SoilProperty/Hydraul_Param_SoilGrids_Schaap_sl5.nc','var_scaling_60cm'); -valid_subpixels_60cm=ncread('../SoilProperty/Hydraul_Param_SoilGrids_Schaap_sl5.nc','valid_subpixels_60cm'); +alpha_fit_60cm=ncread([SoilPropertyPath,'Hydraul_Param_SoilGrids_Schaap_sl5.nc'],'alpha_fit_60cm'); +n_fit_60cm=ncread([SoilPropertyPath,'Hydraul_Param_SoilGrids_Schaap_sl5.nc'],'n_fit_60cm'); +mean_theta_s_60cm=ncread([SoilPropertyPath,'Hydraul_Param_SoilGrids_Schaap_sl5.nc'],'mean_theta_s_60cm'); +mean_theta_r_60cm=ncread([SoilPropertyPath,'Hydraul_Param_SoilGrids_Schaap_sl5.nc'],'mean_theta_r_60cm'); +mean_L_60cm=ncread([SoilPropertyPath,'Hydraul_Param_SoilGrids_Schaap_sl5.nc'],'mean_L_60cm'); +mean_Ks_60cm=ncread([SoilPropertyPath,'Hydraul_Param_SoilGrids_Schaap_sl5.nc'],'mean_Ks_60cm'); +var_scaling_60cm=ncread([SoilPropertyPath,'Hydraul_Param_SoilGrids_Schaap_sl5.nc'],'var_scaling_60cm'); +valid_subpixels_60cm=ncread([SoilPropertyPath,'Hydraul_Param_SoilGrids_Schaap_sl5.nc'],'valid_subpixels_60cm'); % 100cm -alpha_fit_100cm=ncread('../SoilProperty/Hydraul_Param_SoilGrids_Schaap_sl6.nc','alpha_fit_100cm'); -n_fit_100cm=ncread('../SoilProperty/Hydraul_Param_SoilGrids_Schaap_sl6.nc','n_fit_100cm'); -mean_theta_s_100cm=ncread('../SoilProperty/Hydraul_Param_SoilGrids_Schaap_sl6.nc','mean_theta_s_100cm'); -mean_theta_r_100cm=ncread('../SoilProperty/Hydraul_Param_SoilGrids_Schaap_sl6.nc','mean_theta_r_100cm'); -mean_L_100cm=ncread('../SoilProperty/Hydraul_Param_SoilGrids_Schaap_sl6.nc','mean_L_100cm'); -mean_Ks_100cm=ncread('../SoilProperty/Hydraul_Param_SoilGrids_Schaap_sl6.nc','mean_Ks_100cm'); -var_scaling_100cm=ncread('../SoilProperty/Hydraul_Param_SoilGrids_Schaap_sl6.nc','var_scaling_100cm'); -valid_subpixels_100cm=ncread('../SoilProperty/Hydraul_Param_SoilGrids_Schaap_sl6.nc','valid_subpixels_100cm'); +alpha_fit_100cm=ncread([SoilPropertyPath,'Hydraul_Param_SoilGrids_Schaap_sl6.nc'],'alpha_fit_100cm'); +n_fit_100cm=ncread([SoilPropertyPath,'Hydraul_Param_SoilGrids_Schaap_sl6.nc'],'n_fit_100cm'); +mean_theta_s_100cm=ncread([SoilPropertyPath,'Hydraul_Param_SoilGrids_Schaap_sl6.nc'],'mean_theta_s_100cm'); +mean_theta_r_100cm=ncread([SoilPropertyPath,'Hydraul_Param_SoilGrids_Schaap_sl6.nc'],'mean_theta_r_100cm'); +mean_L_100cm=ncread([SoilPropertyPath,'Hydraul_Param_SoilGrids_Schaap_sl6.nc'],'mean_L_100cm'); +mean_Ks_100cm=ncread([SoilPropertyPath,'Hydraul_Param_SoilGrids_Schaap_sl6.nc'],'mean_Ks_100cm'); +var_scaling_100cm=ncread([SoilPropertyPath,'Hydraul_Param_SoilGrids_Schaap_sl6.nc'],'var_scaling_100cm'); +valid_subpixels_100cm=ncread([SoilPropertyPath,'Hydraul_Param_SoilGrids_Schaap_sl6.nc'],'valid_subpixels_100cm'); % 200cm -alpha_fit_200cm=ncread('../SoilProperty/Hydraul_Param_SoilGrids_Schaap_sl7.nc','alpha_fit_200cm'); -n_fit_200cm=ncread('../SoilProperty/Hydraul_Param_SoilGrids_Schaap_sl7.nc','n_fit_200cm'); -mean_theta_s_200cm=ncread('../SoilProperty/Hydraul_Param_SoilGrids_Schaap_sl7.nc','mean_theta_s_200cm'); -mean_theta_r_200cm=ncread('../SoilProperty/Hydraul_Param_SoilGrids_Schaap_sl7.nc','mean_theta_r_200cm'); -mean_L_200cm=ncread('../SoilProperty/Hydraul_Param_SoilGrids_Schaap_sl7.nc','mean_L_200cm'); -mean_Ks_200cm=ncread('../SoilProperty/Hydraul_Param_SoilGrids_Schaap_sl7.nc','mean_Ks_200cm'); -var_scaling_200cm=ncread('../SoilProperty/Hydraul_Param_SoilGrids_Schaap_sl7.nc','var_scaling_200cm'); -valid_subpixels_200cm=ncread('../SoilProperty/Hydraul_Param_SoilGrids_Schaap_sl7.nc','valid_subpixels_200cm'); +alpha_fit_200cm=ncread([SoilPropertyPath,'Hydraul_Param_SoilGrids_Schaap_sl7.nc'],'alpha_fit_200cm'); +n_fit_200cm=ncread([SoilPropertyPath,'Hydraul_Param_SoilGrids_Schaap_sl7.nc'],'n_fit_200cm'); +mean_theta_s_200cm=ncread([SoilPropertyPath,'Hydraul_Param_SoilGrids_Schaap_sl7.nc'],'mean_theta_s_200cm'); +mean_theta_r_200cm=ncread([SoilPropertyPath,'Hydraul_Param_SoilGrids_Schaap_sl7.nc'],'mean_theta_r_200cm'); +mean_L_200cm=ncread([SoilPropertyPath,'Hydraul_Param_SoilGrids_Schaap_sl7.nc'],'mean_L_200cm'); +mean_Ks_200cm=ncread([SoilPropertyPath,'Hydraul_Param_SoilGrids_Schaap_sl7.nc'],'mean_Ks_200cm'); +var_scaling_200cm=ncread([SoilPropertyPath,'Hydraul_Param_SoilGrids_Schaap_sl7.nc'],'var_scaling_200cm'); +valid_subpixels_200cm=ncread([SoilPropertyPath,'Hydraul_Param_SoilGrids_Schaap_sl7.nc'],'valid_subpixels_200cm'); % read data for i=1:600 if abs(lat(i)-latitude)<0.25 From 83aa0608f42f87fcefc6db81ac4f9cda3ae57a1d Mon Sep 17 00:00:00 2001 From: SarahAlidoost Date: Tue, 18 Jan 2022 18:13:31 +0100 Subject: [PATCH 3/8] replace relative path with InputPath in Constants --- src/Constants.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Constants.m b/src/Constants.m index fd39c899..19828c18 100644 --- a/src/Constants.m +++ b/src/Constants.m @@ -29,7 +29,7 @@ uERR=0.02; % Maximum desirable change of total water content; Tot_Depth=500; % Unit is cm. it should be usually bigger than 0.5m. Otherwise, % the DeltZ would be reset in 50cm by hand; -R_depth=300; %¸ùÉî +R_depth=300; %���� Eqlspace=0; % Indicator for deciding is the space step equal or not; NL=100; if ~Eqlspace @@ -434,7 +434,7 @@ % Input for producing initial soil moisture and soil temperature profile %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -Mdata=textread('../input/Mdata.txt'); +Mdata=textread([InputPath, 'Mdata.txt']); Ta_msr=Mdata(:,2)'; RH_msr=Mdata(:,3)'; WS_msr=Mdata(:,4)'; From f12bc34e7c24a2fa7c0d3705db148bec3884fcdc Mon Sep 17 00:00:00 2001 From: SarahAlidoost Date: Tue, 18 Jan 2022 18:15:29 +0100 Subject: [PATCH 4/8] remove relative paths, and add input_path, output_path to create_output_files and create_output_files_binary --- src/+io/create_output_files.m | 20 ++++++++++---------- src/+io/create_output_files_binary.m | 16 ++++++++-------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/+io/create_output_files.m b/src/+io/create_output_files.m index 45d1182d..a389e5f1 100644 --- a/src/+io/create_output_files.m +++ b/src/+io/create_output_files.m @@ -1,4 +1,4 @@ -function Output_dir = create_output_files(parameter_file, F, path_of_code, options, V, vmax, spectral) +function Output_dir = create_output_files(parameter_file, F, path_of_code, input_path, output_path, options, V, vmax, spectral) %% Create DATA files % author J.timmermans % last modified 4 Aug 2008: Added the creation of log file (file with input parameters) @@ -21,7 +21,7 @@ string = clock; Outdir_Name = char(F(1).FileName); -Output_dir = sprintf(['../output/',Outdir_Name,'_%4.0f-%02.0f-%02.0f-%02.0f%02.0f/'],[string(1) string(2) string(3) string(4) string(5)]); +Output_dir = sprintf([output_path,Outdir_Name,'_%4.0f-%02.0f-%02.0f-%02.0f%02.0f/'],[string(1) string(2) string(3) string(4) string(5)]); warning('off','MATLAB:DELETE:FileNotFound') if any(~exist(Output_dir,'dir')) mkdir(Output_dir) @@ -33,11 +33,11 @@ %% Log File for i = 1:length(parameter_file) - copyfile(['../input/' parameter_file{i}],[Output_dir,'Parameters/', parameter_file{i}],'f') + copyfile([input_path parameter_file{i}],[Output_dir,'Parameters/', parameter_file{i}],'f') end fidpath = fopen([Output_dir,'Parameters/SCOPEversion.txt'],'w'); % complete path of the SCOPE code fprintf(fidpath,'%s', path_of_code); -%copyfile(['../' parameter_file],[Output_dir,'Parameters/', parameter_file ],'f') +%copyfile([input_path parameter_file],[Output_dir,'Parameters/', parameter_file ],'f') %% Normal Output fidf = fopen([Output_dir,'fluxes.dat'],'w'); % fluxes @@ -87,12 +87,12 @@ end else - delete([Output_dir,'../output/leaftemp.dat']) - delete([Output_dir,'../output/layer_H.dat']) - delete([Output_dir,'../output/layer_lE.dat']) - delete([Output_dir,'../output/layer_A.dat']) - delete([Output_dir,'../output/layer_aPAR.dat']) - delete([Output_dir,'../output/layer_Rn.dat']) + delete([Output_dir,'leaftemp.dat']) + delete([Output_dir,'layer_H.dat']) + delete([Output_dir,'layer_lE.dat']) + delete([Output_dir,'layer_A.dat']) + delete([Output_dir,'layer_aPAR.dat']) + delete([Output_dir,'layer_Rn.dat']) end if options.calc_fluor diff --git a/src/+io/create_output_files_binary.m b/src/+io/create_output_files_binary.m index afe4a89f..a7936824 100644 --- a/src/+io/create_output_files_binary.m +++ b/src/+io/create_output_files_binary.m @@ -1,9 +1,9 @@ -function [Output_dir, f, fnames] = create_output_files_binary(parameter_file, sitename, path_of_code, input_path, spectral, options) +function [Output_dir, f, fnames] = create_output_files_binary(parameter_file, sitename, path_of_code, input_path, output_path, spectral, options) %% Create Output dir string = clock; simulation_name = char(sitename); outdir_name = sprintf('%s_%4.0f-%02.0f-%02.0f-%02.0f%02.0f', simulation_name, string(1:5)); -Output_dir = [fullfile('../output/', outdir_name) filesep]; +Output_dir = [fullfile(output_path, outdir_name) filesep]; warning('off','MATLAB:DELETE:FileNotFound') if any(~exist(Output_dir,'dir')) @@ -70,12 +70,12 @@ end else - delete([Output_dir,'../output/leaftemp.bin']) - delete([Output_dir,'../output/layer_H.bin']) - delete([Output_dir,'../output/layer_lE.bin']) - delete([Output_dir,'../output/layer_A.bin']) - delete([Output_dir,'../output/layer_aPAR.bin']) - delete([Output_dir,'../output/layer_Rn.bin']) + delete([Output_dir,'leaftemp.bin']) + delete([Output_dir,'layer_H.bin']) + delete([Output_dir,'layer_lE.bin']) + delete([Output_dir,'layer_A.bin']) + delete([Output_dir,'layer_aPAR.bin']) + delete([Output_dir,'layer_Rn.bin']) end if options.calc_fluor From ce3b3eb9e699c040596b4c856cd1687713a881b1 Mon Sep 17 00:00:00 2001 From: SarahAlidoost Date: Tue, 18 Jan 2022 18:25:01 +0100 Subject: [PATCH 5/8] replace relative path with InputPath, comment makeplots in STEMMUS_SCOPE --- src/STEMMUS_SCOPE.m | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/STEMMUS_SCOPE.m b/src/STEMMUS_SCOPE.m index 52b38d77..d4298c15 100644 --- a/src/STEMMUS_SCOPE.m +++ b/src/STEMMUS_SCOPE.m @@ -23,7 +23,7 @@ %% %% 0. globals -run filesread %prepare input files +run filesread %get paths and prepare input files run Constants %input soil parameters global i tS KT Delt_t TEND TIME MN NN NL ML ND hOLD TOLD h hh T TT P_gOLD P_g P_gg Delt_t0 g global KIT NIT TimeStep Processing @@ -60,13 +60,14 @@ [constants] = io.define_constants(); [Rl] = Initial_root_biomass(RTB,DeltZ_R,rroot,ML); %% 2. simulation options +path_input = InputPath; % path of all inputs path_of_code = cd; run set_parameter_filenames; if length(parameter_file)>1, useXLSX = 0; else useXLSX = 1; end if ~useXLSX - run(['../' parameter_file{1}]) + run([path_input parameter_file{1}]) options.calc_ebal = N(1); % calculate the energy balance (default). If 0, then only SAIL is executed! options.calc_vert_profiles = N(2); % calculate vertical profiles of fluxes @@ -90,16 +91,16 @@ % 2: Lookup-Table (specify the values to be included) % 3: Lookup-Table with random input (specify the ranges of values) else - options = io.readStructFromExcel(['../input/' char(parameter_file)], 'options', 3, 1); + options = io.readStructFromExcel([path_input char(parameter_file)], 'options', 3, 1); end if options.simulation>2 || options.simulation<0, fprintf('\n simulation option should be between 0 and 2 \r'); return, end %% 3. file names if ~useXLSX - run(['../input/' parameter_file{2}]) + run([path_input parameter_file{2}]) else - [dummy,X] = xlsread(['../input/' char(parameter_file)],'filenames'); + [dummy,X] = xlsread([path_input char(parameter_file)],'filenames'); j = find(~strcmp(X(:,2),{''})); X = X(j,(1:end)); end @@ -118,10 +119,10 @@ %% 4. input data if ~useXLSX - X = textread(['../input/' parameter_file{3}],'%s'); %#ok + X = textread([path_input parameter_file{3}],'%s'); %#ok N = str2double(X); else - [N,X] = xlsread(['../input/' char(parameter_file)],'inputdata', ''); + [N,X] = xlsread([path_input char(parameter_file)],'inputdata', ''); X = X(9:end,1); end V = io.assignvarnames(); @@ -260,7 +261,7 @@ end end %% 5. Declare paths -path_input = '../input/'; % path of all inputs +path_input = InputPath; % path of all inputs %% 6. Numerical parameters (iteration stops etc) iter.maxit = 400; % maximum number of iterations @@ -352,7 +353,7 @@ atmo.M = helpers.aggreg(atmfile,spectral.SCOPEspec); %% 13. create output files -[Output_dir, f, fnames] = io.create_output_files_binary(parameter_file, sitename, path_of_code, path_input, spectral, options); +[Output_dir, f, fnames] = io.create_output_files_binary(parameter_file, sitename, path_of_code, path_input, path_output, spectral, options); run StartInit; % Initialize Temperature, Matric potential and soil air pressure. @@ -782,7 +783,7 @@ io.output_verification(Output_dir) end io.bin_to_csv(fnames, V, vmax, n_col, k, options,Ztot) -if options.makeplots - plot.plots(Output_dir) -end +%if options.makeplots +% plot.plots(Output_dir) +%end From 41f00ffc8a0e9597f89b7fb98aa992dc6eacde91 Mon Sep 17 00:00:00 2001 From: SarahAlidoost Date: Tue, 18 Jan 2022 18:25:47 +0100 Subject: [PATCH 6/8] bring back Dur_tot in filereads --- src/filesread.m | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/filesread.m b/src/filesread.m index 34f6816f..de933418 100644 --- a/src/filesread.m +++ b/src/filesread.m @@ -29,8 +29,7 @@ t1=datenum(startyear,1,1,0,0,0); DELT=time1(2); %Set the end time of the main loop in STEMMUS_SCOPE.m -Dur_tot=10; -%Dur_tot=length(time1); +Dur_tot=length(time1); dt=time1(2)/3600/24; t2=datenum(endyear,12,31,23,30,0); T=t1:dt:t2; From 41b2fc286dcaaeb44ea305d8e3f3028d0cd54883 Mon Sep 17 00:00:00 2001 From: SarahAlidoost Date: Tue, 18 Jan 2022 18:34:30 +0100 Subject: [PATCH 7/8] revise the readme --- README.md | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 7040a89d..2e0e40f6 100644 --- a/README.md +++ b/README.md @@ -7,25 +7,28 @@ Integrated code of SCOPE and STEMMUS 2. Find the 'Remote Desktop' in the Launcher and click it. 3. Find the 'Applications'and click it, you will find the 'MATLAB' software in the 'Research'. 4. Open the 'MATLAB' using your account. - 5. The STEMMUS_SCOPE v1.0.0 was saved at the folder '/data/shared/EcoExtreML/STEMMUS_SCOPE v1.0.0/src/STEMMUS_SCOPE.m' - 6. Open the 'STEMMUS_SCOPE.m' file and run it. + 5. All the code can be found in the folder 'src' in this repository. + 6. In a terminal, run: + ```bash + matlab -nodisplay -nosplash -nodesktop -r "run('STEMMUS_SCOPE.m');exit;" + ``` (2) The dataflow of the STEMMUS_SCOPE v1.0.0: - 1. The driving data provided by PLUMBER2 were saved at the folder named '../Plumber2 data'. - The soil texture data and soil hydraulic parameters data were saved at the folder named '../SoilProperty'. - The results of the model will be saved at the folder named '../output'. - All the code can be find at the folder named '../src'. + 1. The driving data provided by PLUMBER2 were saved at the folder named 'Plumber2_data'. + The soil texture data and soil hydraulic parameters data were saved at the folder named 'SoilProperty'. + The results of the model will be saved at the folder named 'output'. 2. The main program is 'STEMMUS_SCOPE.m'. Currently, the model can be run at the site scale. - For example, if we put the 'AU-Tum_2002-2017_OzFlux_Met.nc' file in the 'input' folder. The model will be run at the AU-TUM site. + For example, if we put the 'FI-Hyy_1996-2014_FLUXNET2015_Met.nc' file in the 'input' folder. The model will be run at the AU-TUM site. 3. After the model was started, the workflow are as follows: - (1) The model will read the 'AU-Tum_2002-2017_OzFlux_Met.nc' file and transfer it into '.dat' files with 'filesread.m' (you can find the '.dat' files in the 'input' folder). In addition, the site information (including location and vegetation) were also read. + (1) The model will read the 'FI-Hyy_1996-2014_FLUXNET2015_Met.nc' file and transfer it into '.dat' files with 'filesread.m' (you can find the '.dat' files in the 'input' folder). In addition, the site information (including location and vegetation) were also read. (2) Then, the model will read the soil parameters with 'soilpropertyread.m'. - (3) Some constants will be load using 'constant.m'. - (4) The model will run step by step until the whole simulation period completed. + (3) Some constants will be load using 'Constant.m'. + (4) The model will run step by step until the whole simulation period is completed. (5) The results were be saved as 'binary files' temporarily and the 'binary files' will be transfer to '.csv' files at the end. +(3) Run STEMMUS_SCOPE v1.0.0 on a different compute node: - +Open the file "filesread.m" and set all paths at the top of this file. The rest of the workflow is the same as explained above. From a83730684715a090a205a996ee56e6434639d617 Mon Sep 17 00:00:00 2001 From: Yijian Zeng Date: Wed, 19 Jan 2022 15:23:08 +0100 Subject: [PATCH 8/8] Update README.md some minor changes to make it consistent with the input data --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 2e0e40f6..e1bca1d5 100644 --- a/README.md +++ b/README.md @@ -20,14 +20,14 @@ Integrated code of SCOPE and STEMMUS The results of the model will be saved at the folder named 'output'. 2. The main program is 'STEMMUS_SCOPE.m'. Currently, the model can be run at the site scale. - For example, if we put the 'FI-Hyy_1996-2014_FLUXNET2015_Met.nc' file in the 'input' folder. The model will be run at the AU-TUM site. + For example, if we put the 'FI-Hyy_1996-2014_FLUXNET2015_Met.nc' file in the 'input' folder. The model will be run at the FI-Hyy site. 3. After the model was started, the workflow are as follows: (1) The model will read the 'FI-Hyy_1996-2014_FLUXNET2015_Met.nc' file and transfer it into '.dat' files with 'filesread.m' (you can find the '.dat' files in the 'input' folder). In addition, the site information (including location and vegetation) were also read. (2) Then, the model will read the soil parameters with 'soilpropertyread.m'. - (3) Some constants will be load using 'Constant.m'. + (3) Some constants will be loaded using 'Constant.m'. (4) The model will run step by step until the whole simulation period is completed. - (5) The results were be saved as 'binary files' temporarily and the 'binary files' will be transfer to '.csv' files at the end. + (5) The results will be saved as 'binary files' temporarily and the 'binary files' will be transferred to '.csv' files at the end. (3) Run STEMMUS_SCOPE v1.0.0 on a different compute node: