Skip to content
Snippets Groups Projects
Commit 51ec0448 authored by Kyle Klenk's avatar Kyle Klenk
Browse files

removed definedGlobal data from cppwrap_job.f90

parent 3d6b7376
No related branches found
No related tags found
No related merge requests found
...@@ -6,6 +6,8 @@ extern "C" { ...@@ -6,6 +6,8 @@ extern "C" {
void setTimesDirsAndFiles(char const* file_manager, int* err); void setTimesDirsAndFiles(char const* file_manager, int* err);
void defineGlobalData(int* start_gru_index, int* err);
void cleanUpJobActor(int* err); void cleanUpJobActor(int* err);
} }
\ No newline at end of file
...@@ -53,7 +53,7 @@ subroutine initGlobals(file_manager, totalGRUs, totalHRUs, numGRUs, numHRUs, sta ...@@ -53,7 +53,7 @@ subroutine initGlobals(file_manager, totalGRUs, totalHRUs, numGRUs, numHRUs, sta
integer(i4b) :: fileHRU ! [used for filenames] number of HRUs in the input file integer(i4b) :: fileHRU ! [used for filenames] number of HRUs in the input file
character(len=256) :: summaFileManagerFile ! path/name of file defining directories and files character(len=256) :: summaFileManagerFile ! path/name of file defining directories and files
call c_f_string(file_manager, file_manager_path, 256) ! call c_f_string(file_manager, file_manager_path, 256)
! Conver the fileManager path to format needed for summa_SetTimesDirsAndFIles ! Conver the fileManager path to format needed for summa_SetTimesDirsAndFIles
! summaFileManagerFile = trim(file_manager_path) ! summaFileManagerFile = trim(file_manager_path)
...@@ -67,15 +67,15 @@ subroutine initGlobals(file_manager, totalGRUs, totalHRUs, numGRUs, numHRUs, sta ...@@ -67,15 +67,15 @@ subroutine initGlobals(file_manager, totalGRUs, totalHRUs, numGRUs, numHRUs, sta
! endif ! endif
! define global data (parameters, metadata) ! define global data (parameters, metadata)
call summa_defineGlobalData(err, cmessage) ! call summa_defineGlobalData(err, cmessage)
! if(err/=0)then; message=trim(message)//trim(cmessage); return; endif ! ! if(err/=0)then; message=trim(message)//trim(cmessage); return; endif
if(err/=0)then ! if(err/=0)then
message=trim(message)//trim(cmessage) ! message=trim(message)//trim(cmessage)
print*, cmessage ! print*, cmessage
return ! return
endif ! endif
! Set the index of the start GRU ! Set the index of the start GRU
startGRU = startGRUIndex ! startGRU = startGRUIndex
! ***************************************************************************** ! *****************************************************************************
! *** read the number of GRUs and HRUs ! *** read the number of GRUs and HRUs
......
...@@ -61,6 +61,10 @@ behavior job_actor(stateful_actor<job_state>* self, int startGRU, int numGRU, ...@@ -61,6 +61,10 @@ behavior job_actor(stateful_actor<job_state>* self, int startGRU, int numGRU,
if (err != 0) { if (err != 0) {
aout(self) << "ERROR: Job_Actor - setTimesDirsAndFiles\n"; aout(self) << "ERROR: Job_Actor - setTimesDirsAndFiles\n";
} }
defineGlobalData(&self->state.startGRU, &err);
if (err != 0) {
aout(self) << "ERROR: Job_Actor - defineGlobalData\n";
}
initJob(self); initJob(self);
// Spawn the file_access_actor. This will return the number of forcing files we are working with // Spawn the file_access_actor. This will return the number of forcing files we are working with
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
module summa_globalData module summa_globalData
! used to declare and allocate global summa data structures ! used to declare and allocate global summa data structures
USE, intrinsic :: iso_c_binding
! access missing values ! access missing values
USE globalData,only:integerMissing ! missing integer USE globalData,only:integerMissing ! missing integer
...@@ -56,13 +57,14 @@ USE globalData,only:fluxChild_map ! index of the child ...@@ -56,13 +57,14 @@ USE globalData,only:fluxChild_map ! index of the child
USE globalData,only:indxChild_map ! index of the child data structure: stats indx USE globalData,only:indxChild_map ! index of the child data structure: stats indx
USE globalData,only:bvarChild_map ! index of the child data structure: stats bvar USE globalData,only:bvarChild_map ! index of the child data structure: stats bvar
USE globalData,only:startGRU
! safety: set private unless specified otherwise ! safety: set private unless specified otherwise
implicit none implicit none
private private
public::summa_defineGlobalData public::summa_defineGlobalData
contains contains
subroutine summa_defineGlobalData(err, message) subroutine summa_defineGlobalData(start_gru_index, err) bind(C, name="defineGlobalData")
! --------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------
! * desired modules ! * desired modules
! --------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------
...@@ -87,9 +89,10 @@ subroutine summa_defineGlobalData(err, message) ...@@ -87,9 +89,10 @@ subroutine summa_defineGlobalData(err, message)
! --------------------------------------------------------------------------------------- ! ---------------------------------------------------------------------------------------
implicit none implicit none
! dummy variables ! dummy variables
integer(i4b),intent(out) :: err ! error code integer(c_int),intent(in) :: start_gru_index ! Index of the starting GRU (-g option from user)
character(*),intent(out) :: message ! error message integer(c_int),intent(out) :: err ! error code
! local variables ! local variables
character(len=256) :: message ! error message
character(LEN=256) :: cmessage ! error message of downwind routine character(LEN=256) :: cmessage ! error message of downwind routine
logical(lgt), dimension(maxvarFlux) :: flux_mask ! mask defining desired flux variables logical(lgt), dimension(maxvarFlux) :: flux_mask ! mask defining desired flux variables
logical(lgt), dimension(maxvarForc) :: statForc_mask ! mask defining forc stats logical(lgt), dimension(maxvarForc) :: statForc_mask ! mask defining forc stats
...@@ -159,6 +162,9 @@ subroutine summa_defineGlobalData(err, message) ...@@ -159,6 +162,9 @@ subroutine summa_defineGlobalData(err, message)
statIndx_meta(:)%vartype = iLookVarType%outstat statIndx_meta(:)%vartype = iLookVarType%outstat
statBvar_meta(:)%vartype = iLookVarType%outstat statBvar_meta(:)%vartype = iLookVarType%outstat
! Set the startGRU
startGRU = start_gru_index
end subroutine summa_defineGlobalData end subroutine summa_defineGlobalData
end module summa_globalData end module summa_globalData
Run start time on system: ccyy=2022 - mm=08 - dd=18 - hh=18 - mi=17 - ss=46.186 Run start time on system: ccyy=2022 - mm=08 - dd=18 - hh=19 - mi=06 - ss=04.983
Run start time on system: ccyy=2022 - mm=08 - dd=18 - hh=18 - mi=17 - ss=52.696 Run start time on system: ccyy=2022 - mm=08 - dd=18 - hh=19 - mi=06 - ss=14.868
Run start time on system: ccyy=2022 - mm=08 - dd=18 - hh=18 - mi=18 - ss=01.637 Run start time on system: ccyy=2022 - mm=08 - dd=18 - hh=19 - mi=06 - ss=27.048
Run start time on system: ccyy=2022 - mm=08 - dd=18 - hh=18 - mi=18 - ss=11.308 Run start time on system: ccyy=2022 - mm=08 - dd=18 - hh=19 - mi=06 - ss=39.863
...@@ -5,27 +5,32 @@ cd celia1990 ...@@ -5,27 +5,32 @@ cd celia1990
./run_test_summa_actors.sh ./run_test_summa_actors.sh
python3 verify_celia.py python3 verify_celia.py
cd .. cd ..
sleep 3
echo "Starting Colbeck" echo "Starting Colbeck"
cd colbeck1976 cd colbeck1976
./run_test_summa_actors.sh ./run_test_summa_actors.sh
python3 verify_colbeck.py python3 verify_colbeck.py
cd .. cd ..
sleep 3
echo "Starting Miller" echo "Starting Miller"
cd miller1998 cd miller1998
./run_test_summa_actors.sh ./run_test_summa_actors.sh
python3 verify_miller.py python3 verify_miller.py
cd .. cd ..
sleep 3
echo "Starting Mizoguchi" echo "Starting Mizoguchi"
cd mizoguchi1990 cd mizoguchi1990
./run_test_summa_actors.sh ./run_test_summa_actors.sh
python3 verify_mizoguchi.py python3 verify_mizoguchi.py
cd .. cd ..
sleep 3
echo "Starting Vanderborght" echo "Starting Vanderborght"
cd vanderborght2005 cd vanderborght2005
./run_test_summa_actors.sh ./run_test_summa_actors.sh
python3 verify_vanderborght.py python3 verify_vanderborght.py
cd .. cd ..
\ No newline at end of file sleep 3
Run start time on system: ccyy=2022 - mm=08 - dd=18 - hh=18 - mi=18 - ss=43.832 Run start time on system: ccyy=2022 - mm=08 - dd=18 - hh=19 - mi=07 - ss=14.172
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment