Skip to content

Commit

Permalink
Fix check for outputting density file from estar
Browse files Browse the repository at this point in the history
  • Loading branch information
rtownson committed Mar 2, 2023
1 parent 110b848 commit ec0edbb
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
3 changes: 1 addition & 2 deletions HEN_HOUSE/estar/estarMainCalc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,7 @@ int estarCalculation(int isCompound, int NEP, float mediaDensity, string *elemen
fc = getDataFromFormulae(knmat, rho, elementArray, massFraction, numOfAtoms, NEP, mediaNum);
cout << "\n";

if (*ipotval != -1) {
assert(*ipotval>=0 && "Ivalue must be non-negative");
if (*ipotval >= 0) {
fc.pot = *ipotval;
cout << "For medium " << mediaNum << " I-value (eV) given in egsinp file is " << fc.pot << "\n";
}
Expand Down
4 changes: 2 additions & 2 deletions HEN_HOUSE/makefiles/standard_makefile
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ failed_message = "______Operation failed______"
$(EXECUTABLE): $(FORTRAN_FILE).$(FEXT) $(EGS_EXTRA_OBJECTS) $(EXE_DIR) compare
@echo $(empty)
@echo $(empty)
@echo "Fortran compiling $(FORTRAN_FILE).$(FEXT) using flags '$(EGS_EXTRA_FLAGS) $(FCFLAGS) $(OPTLEVEL_F)' and extra objects/libs '$(EGS_EXTRA_OBJECTS) $(ESTAR_DIR)estarPreProcess.cpp -lstdc++ $(EGS_EXTRA_LIBS)'"
@$(F77) $(EGS_EXTRA_FLAGS) $(FCFLAGS) $(OPTLEVEL_F) $(COMPILE_TIME) $(GIT_HASH) $(FOUT)$@ $(FORTRAN_FILE).$(FEXT) $(EGS_EXTRA_OBJECTS) $(ESTAR_DIR)estarPreProcess.cpp -std=c++11 $(F77_CPP_LINKER) $(EGS_EXTRA_LIBS)
@echo "Fortran compiling $(FORTRAN_FILE).$(FEXT) using flags '$(EGS_EXTRA_FLAGS) $(FCFLAGS) $(OPTLEVEL_F)' and extra objects/libs '$(EGS_EXTRA_OBJECTS) $(ESTAR_DIR)estarPreProcess.cpp $(F77_CPP_LINKER) $(EGS_EXTRA_LIBS)'"
@$(F77) $(EGS_EXTRA_FLAGS) $(FCFLAGS) $(OPTLEVEL_F) $(COMPILE_TIME) $(GIT_HASH) $(FOUT)$@ $(FORTRAN_FILE).$(FEXT) $(EGS_EXTRA_OBJECTS) $(ESTAR_DIR)estarPreProcess.cpp $(F77_CPP_LINKER) $(EGS_EXTRA_LIBS)
# The line of code above was originally:
# @$(F77) $(EGS_EXTRA_FLAGS) $(FCFLAGS) $(OPTLEVEL_F) $(FOUT)$@ $(FORTRAN_FILE).$(FEXT) $(EGS_EXTRA_OBJECTS) $(EGS_EXTRA_LIBS) 2>&1
# The '2>&1' gives a compilation error when running in windows and thus this has been removed.
Expand Down
2 changes: 1 addition & 1 deletion HEN_HOUSE/specs/all_common.spec
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ ESTAR_ROUTINE = $(ESTAR_MODULES)routine$(DSEP)
ESTAR_S_HELPERS = $(ESTAR_MODULES)solverHelpers$(DSEP)

# ESTAR linking keyword
F77_CPP_LINKER = -lstdc++
F77_CPP_LINKER = -lstdc++ -std=c++11

# Utilities coming with EGSnrc
#
Expand Down
11 changes: 6 additions & 5 deletions HEN_HOUSE/src/get_media_inputs.mortran
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,7 @@ $INTEGER ival,ival_media,ival_medfile,i,j,k,ival_ae,ival_ue,ival_ap,ival_up,
$REAL ecut_min, pcut_min;

$LOGICAL medfile_specified,densityfile_specified,elements_specified,
outfile_specified($MXMED), densityoutputfile_specified;
outfile_specified($MXMED), densityoutputfile_specified($MXMED);
$LOGICAL iunrst_specified,stern_specified,iaprim_specified,
gasp_specified,rho_specified,start_delim_found,end_delim_found,
spec_by_pz,spec_by_rhoz,df_if_elem_mismatch($MXMED),
Expand Down Expand Up @@ -722,7 +722,7 @@ $TYPE asym_df($MXEL);
data blank/' '/;

save medfile_specified,material_file,df_if_elem_mismatch,df_if_rho_mismatch,
spoutput_file,outfile_specified;
spoutput_file,outfile_specified,densityoutputfile_specified;

REPLACE {$WRITE_MEDERR(#)} WITH {
;
Expand Down Expand Up @@ -904,6 +904,7 @@ DO i=1,NMED[
bulkdensity_specified=.false.;
localdensity_specified=.false.;
ipot_specified=.false.;
densityoutputfile_specified(i)=.false.;
densityfile_specified=.false.;
stern_specified=.false.;
iunrst_specified=.false.;
Expand Down Expand Up @@ -1088,7 +1089,7 @@ DO i=1,NMED[
CALL GET_INPUT;
IF(error_flags(ival_densityoutputfile)=0)[
density_outputfile=char_value(ival_densityoutputfile,1);
densityoutputfile_specified=.true.;
densityoutputfile_specified(i)=.true.;
$WRITE_MEDERR(' Density correction file will be output.');
]

Expand Down Expand Up @@ -1676,7 +1677,7 @@ DO i=1,NMED[
inpdensity_file(i)=density_file;

"Only output the density correction file for the first job if parallel"
IF(densityoutputfile_specified &
IF(densityoutputfile_specified(i) &
(n_parallel=0 | i_parallel=first_parallel)) [
outdensity_file(i)=density_outputfile;
]
Expand Down Expand Up @@ -1737,7 +1738,7 @@ DO i=1,nmed[
write(ounit,'(a,i5)')' iunrst: ',iunrst(i);
write(ounit,'(a,i5)')' iaprim: ',iaprim(i);
write(ounit,'(a,1p,e14.5,a)')' gasp: ',inpgasp(i),' atm.';
IF(epstfl(i)~=1)[
IF(epstfl(i)~=1 & densityoutputfile_specified(i))[
write(ounit,*)' output density correction file: ',
$cstring(outdensity_file(i));
]
Expand Down

0 comments on commit ec0edbb

Please sign in to comment.