Skip to content

Commit

Permalink
Created and implemented new copy_sxw_variables funciton
Browse files Browse the repository at this point in the history
(issue #277) Created the function. It takes as inputs pointers to the new SXW variables and assigns these pointers to the local variables.

(issue #272) Implemented this new function in the load_cell function.
  • Loading branch information
Chandler Haukap committed Apr 24, 2019
1 parent 804c2e2 commit 873a2f5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ST_grid.c
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,8 @@ void save_sxw_memory(RealD * grid_roots_max, RealD* grid_rootsXphen,
void _deallocate_memory(void);
//void SXW_init( Bool init_SW );

void copy_sxw(SXW_t* newSXW, SXW_resourceType* newSXWResources, transp_t* newTransp_window);


/*********** Locally Used Function Declarations ************/
/***********************************************************/
Expand Down Expand Up @@ -1678,6 +1680,9 @@ static void load_cell(int row, int col){
gridCells[row][col]._Gmort, gridCells[row][col]._Gestab, gridCells[row][col]._Spp,
gridCells[row][col]._Indv, gridCells[row][col]._Smort, gridCells[row][col]._Sestab,
gridCells[row][col]._Sreceived, gridCells[row][col]._Gwf, gridCells[row][col].stats_init);

/* Copy this cell's SXW variables into the loacl variables in sxw.c */

This comment has been minimized.

Copy link
@kpalmqui

kpalmqui May 27, 2019

Member

@chaukap fix typo here

copy_sxw(&gridCells[row][col].mySXW, &gridCells[row][col].mySXWResources, &gridCells[row][col].myTranspWindow);
}

/***********************************************************/
Expand Down
9 changes: 9 additions & 0 deletions sxw.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ void save_sxw_memory( RealD * grid_roots_max, RealD* grid_rootsXphen, RealD* gri
void free_sxw_memory( void );
void _deallocate_memory(void);

void copy_sxw_variables(SXW_t* newSXW, SXW_resourceType* newSXWResources, transp_t* newTransp_window);

/****************** Begin Function Code ********************/
/***********************************************************/
void SXW_Init( Bool init_SW, char *f_roots ) {
Expand Down Expand Up @@ -464,6 +466,13 @@ void _deallocate_memory(void){
Mem_Free(SXWResources);
}

/* Shallow copy variables into the local sxw variables. */
void copy_sxw_variables(SXW_t* newSXW, SXW_resourceType* newSXWResources, transp_t* newTransp_window){
SXW = newSXW;
SXWResources = newSXWResources;
transp_window = newTransp_window;
}

static void _read_files( void ) {
/*======================================================*/
/* read list of input files. */
Expand Down

0 comments on commit 873a2f5

Please sign in to comment.