Skip to content

Commit

Permalink
get the aux_names from the C++ header (#784)
Browse files Browse the repository at this point in the history
  • Loading branch information
zingale authored Feb 22, 2020
1 parent 45994be commit 72a3545
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 40 deletions.
2 changes: 0 additions & 2 deletions Source/driver/Castro_F.H
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ extern "C"

void ca_extern_init(const int* name, const int* namlen);

void ca_get_aux_names(int* aux_names, const int* iaux, const int* len);

#ifdef REACTIONS
void ca_get_abort_on_failure(int * abort_on_failure);

Expand Down
29 changes: 0 additions & 29 deletions Source/driver/Castro_nd.F90
Original file line number Diff line number Diff line change
Expand Up @@ -72,35 +72,6 @@ end subroutine ca_extern_init
! :::


subroutine ca_get_aux_names(aux_names,iaux,len) &
bind(C, name="ca_get_aux_names")
!
! Binds to C function `ca_get_aux_names`

use network, only: naux, short_aux_names
use amrex_fort_module, only: rt => amrex_real

implicit none

integer, intent(in ) :: iaux
integer, intent(inout) :: len
integer, intent(inout) :: aux_names(len)

! Local variables
integer :: i

len = len_trim(short_aux_names(iaux+1))

do i = 1,len
aux_names(i) = ichar(short_aux_names(iaux+1)(i:i))
end do

end subroutine ca_get_aux_names

! :::
! ::: ----------------------------------------------------------------
! :::


#ifdef REACTIONS
subroutine ca_get_abort_on_failure(abort_on_failure_in) bind(C, name="ca_get_abort_on_failure")
Expand Down
10 changes: 1 addition & 9 deletions Source/driver/Castro_setup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -464,15 +464,7 @@ Castro::variableSetUp ()
// Get the auxiliary names from the network model.
std::vector<std::string> aux_names;
for (int i = 0; i < NumAux; i++) {
const int len = 20;
Vector<int> int_aux_names(len);
// This call return the actual length of each string in "len"
ca_get_aux_names(int_aux_names.dataPtr(),&i,&len);
char char_aux_names[len+1];
for (int j = 0; j < len; j++)
char_aux_names[j] = int_aux_names[j];
char_aux_names[len] = '\0';
aux_names.push_back(std::string(char_aux_names));
aux_names.push_back(short_aux_names_cxx[i]);
}

if ( ParallelDescriptor::IOProcessor())
Expand Down

0 comments on commit 72a3545

Please sign in to comment.