Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions build/FUSE_SRC/driver/functn.f90
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ FUNCTION FUNCTN(NOPT,A)
! Wrapper for SCE (used to compute the objective function)
! ---------------------------------------------------------------------------------------
USE nrtype ! variable types, etc.
USE fuse_metric_module ! run model and compute the metric chosen as objective function
USE fuse_evaluate_module, only: fuse_evaluate ! run model and compute the metric chosen as objective function
USE multiforce, only: ncid_forc ! NetCDF forcing file ID
USE fuse_fileManager,only:METRIC, TRANSFO ! metric and transformation requested in the filemanager
USE globaldata, only: nFUSE_eval ! # fuse evaluations
Expand Down Expand Up @@ -41,7 +41,7 @@ FUNCTION FUNCTN(NOPT,A)

OUTPUT_FLAG=.FALSE. ! do not produce *runs.nc files only, param.nc files

CALL FUSE_METRIC(SCE_PAR,.FALSE.,NCID_FORC,METRIC_VAL,OUTPUT_FLAG,1) ! 2nd argument FALSE, always return METRIC value
CALL FUSE_evaluate(SCE_PAR,.FALSE.,NCID_FORC,METRIC_VAL,OUTPUT_FLAG,1) ! 2nd argument FALSE, always return METRIC value

! deallocate parameter set
DEALLOCATE(SCE_PAR, STAT=IERR); IF (IERR.NE.0) STOP ' problem deallocating space '
Expand Down
21 changes: 11 additions & 10 deletions build/FUSE_SRC/driver/fuse_driver.f90
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ PROGRAM DISTRIBUTED_DRIVER
USE multiforce, only: DELTIM
USE multiforce, only: ISTART ! index for start of inference
USE multiforce, ONLY: timeUnits,time_steps,julian_day_input ! time data
USE multiforce, only: numtim_in, itim_in ! length of input time series and associated index
USE multiforce, only: numtim_sim, itim_sim ! length of simulated time series and associated index
USE multiforce, only: numtim_sub, itim_sub ! length of subperiod time series and associated index
USE multiforce, only: numtim_in ! length of input time series
USE multiforce, only: numtim_sim ! length of simulated time series
USE multiforce, only: numtim_sub ! length of subperiod time series
USE multiforce, only: sim_beg,sim_end ! timestep indices
USE multiforce, only: eval_beg,eval_end ! timestep indices
USE multiforce, only: SUB_PERIODS_FLAG ! .true. if subperiods are used to run FUSE
Expand All @@ -61,6 +61,7 @@ PROGRAM DISTRIBUTED_DRIVER
USE getpar_str_module ! extracts parameter metadata
USE par_insert_module ! inserts model parameters
USE force_info_module,only:force_info ! get forcing info for NetCDF files
USE def_output_module,only:def_output ! define NetCDF output file
USE get_gforce_module,only:read_ginfo ! get dimension lengths from the NetCDF file
USE get_gforce_module,only:get_varid ! get netCDF ID for forcing variables
USE get_gforce_module,only:get_gforce_3d ! get forcing
Expand All @@ -73,7 +74,7 @@ PROGRAM DISTRIBUTED_DRIVER
USE model_numerix ! defines decisions on model numerix

! access to model simulation modules
USE fuse_metric_module ! run model and compute the metric chosen as objective function
USE fuse_evaluate_module, only: fuse_evaluate ! run model and compute the metric chosen as objective function

#ifdef __MPI__
use mpi
Expand Down Expand Up @@ -364,9 +365,9 @@ PROGRAM DISTRIBUTED_DRIVER

ENDIF

CALL DEF_PARAMS(NUMPSET) ! define model parameters (initial CREATE)
CALL DEF_SSTATS() ! define summary statistics (REDEF)
CALL DEF_OUTPUT(nSpat1,nSpat2,NUMPSET,numtim_sim) ! define model output time series (REDEF)
CALL DEF_PARAMS(NUMPSET) ! define model parameters (initial CREATE)
CALL DEF_SSTATS() ! define summary statistics (REDEF)
CALL DEF_OUTPUT(nSpat1,nSpat2,N_BANDS,NUMPAR) ! define model output time series (REDEF)

! ---------------------------------------------------------------------------------------
! RUN FUSE IN DESIRED MODE
Expand All @@ -388,7 +389,7 @@ PROGRAM DISTRIBUTED_DRIVER
OUTPUT_FLAG=.TRUE.

print *, 'Running FUSE with default parameter values'
CALL FUSE_METRIC(APAR,GRID_FLAG,NCID_FORC,METRIC_VAL,OUTPUT_FLAG,NUMPSET)
CALL FUSE_evaluate(APAR,GRID_FLAG,NCID_FORC,METRIC_VAL,OUTPUT_FLAG,NUMPSET)
print *, 'Done running FUSE with default parameter values'

ELSE IF(fuse_mode == 'run_pre')THEN ! run FUSE with pre-defined parameter values
Expand All @@ -402,7 +403,7 @@ PROGRAM DISTRIBUTED_DRIVER
CALL GET_PRE_PARAM(FNAME_NETCDF_PARA_PRE,IPSET,ONEMOD,NUMPAR,APAR)

print *, 'Running FUSE with pre-defined parameter set'
CALL FUSE_METRIC(APAR,GRID_FLAG,NCID_FORC,METRIC_VAL,OUTPUT_FLAG,1) ! last argument IPSET=1
CALL FUSE_evaluate(APAR,GRID_FLAG,NCID_FORC,METRIC_VAL,OUTPUT_FLAG,1) ! last argument IPSET=1
print *, 'Done running FUSE with pre-defined parameter set'

ELSE IF(fuse_mode == 'calib_sce')THEN ! calibrate FUSE using SCE
Expand Down Expand Up @@ -458,7 +459,7 @@ PROGRAM DISTRIBUTED_DRIVER
CALL GET_SCE_PARAM(FNAME_NETCDF_PARA_SCE,ONEMOD,NUMPAR,APAR)

print *, 'Running FUSE with best SCE parameter set'
CALL FUSE_METRIC(APAR,GRID_FLAG,NCID_FORC,METRIC_VAL,OUTPUT_FLAG,NUMPSET)
CALL FUSE_evaluate(APAR,GRID_FLAG,NCID_FORC,METRIC_VAL,OUTPUT_FLAG,NUMPSET)
print *, 'Done running FUSE with best SCE parameter set'

ELSE
Expand Down
Loading