Skip to content

Commit

Permalink
fix: Merge branch 'master' into featSFHFixedAges
Browse files Browse the repository at this point in the history
  • Loading branch information
abensonca committed Oct 16, 2024
2 parents 8c90b8f + 34d34c5 commit f258240
Show file tree
Hide file tree
Showing 27 changed files with 1,791 additions and 291 deletions.
1 change: 1 addition & 0 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1051,6 +1051,7 @@ jobs:
test-branchSubsampling.pl,
test-CGM-mass-cooled.pl,
test-concentration-Ludlow2016.pl,
test-concentration-Johnson2021.pl,
test-tidallyTruncatedNFWFit.pl,
test-constraint-deterministic-spins.pl,
test-constraint-mass-function.pl,
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/prChecks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,9 @@ jobs:
- name: Comment on the PR if any warnings were found
if: steps.check_files.outputs.files_exists == 'true'
continue-on-error: true
uses: thollander/actions-comment-pull-request@v2
uses: thollander/actions-comment-pull-request@v3
with:
filePath: warnings.md
file-path: warnings.md
# Spell check LaTeX files
Spell-Check-LaTeX:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -286,6 +286,6 @@ jobs:
files: warnings.md
- name: Comment on the PR if any warnings were found
if: steps.check_files.outputs.files_exists == 'true'
uses: thollander/actions-comment-pull-request@v2
uses: thollander/actions-comment-pull-request@v3
with:
filePath: warnings.md
file-path: warnings.md
8 changes: 7 additions & 1 deletion doc/Advanced.tex
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,13 @@ \section{Parameter Files}\label{sec:ParameterFiles}

Parameters can also be defined with an ``{\normalfont \ttfamily id}'' attribute. Such parameters are targets for pointers elsewhere in the file, and as such are inactive (i.e. they will be ignored by \glc\ except as targets for pointers). A pointer to a target is created by specifying an element with the same parameter name and an ``{\normalfont \ttfamily idRef}'' element with a value equal to that of the {\normalfont \ttfamily id} element of the target. The pointer then acts as a regular parameter, adopting the value and subparameters of the target. Targets can be targeted by multiple pointers. This allows for a single object to be shared between multiple other objects.

A parameter value can be given by a math expression\footnote{This functionality requires that {\normalfont \ttfamily libmatheval} is installed.}. In the above example {\normalfont \ttfamily parameter5Name} has a value of ``{\normalfont \ttfamily =10.0*[parameter4Name::subParameter1Name]}''. The initial ``{\normalfont \ttfamily =}'' indicates that this is a math expression which should be evaluated. In this case, the expression is ten times value value of ``{\normalfont \ttfamily [parameter4Name::subParameter1Name]}'', which refers to the value of the sub-parameter {\normalfont \ttfamily subParameter1Name} of parameter {\normalfont \ttfamily parameter4Name}. In this way the values of parameters can be derived from those of other parameters.
It is possible to make a parameter conditional upon the value of another parameter. This can be useful, for example, if you want to include a specific \refClass{nodeOperatorClass} only if merger trees are being read from file, and not if trees are being constructed internally. This is achieved using the {\normalfont \ttfamily active} attribute of a parameter. For example:
\begin{verbatim}
<nodeOperator value="assemblyHistoryHeuristics" active="[mergerTreeConstructor] == read">
\end{verbatim}
which will result in the {\normalfont \ttfamily assemblyHistoryHeuristics} {\normalfont \ttfamily nodeOperator} being active only if the {\normalfont \ttfamily mergerTreeConstructor} is set to {\normalfont \ttfamily new}. The content of the {\normalfont \ttfamily active} element must be a parameter name enclosed in {\normalfont \ttfamily []}, followed by an operator ({\normalfont \ttfamily ==} or {\normalfont \ttfamily !=}), followed by the text to match. The parameter name can include a full path as described below. Note that, while numerical parameters can be used in {\normalfont \ttfamily active} elements, the comparison is always textual, not numerical.

A parameter value can be given by a math expression\footnote{This functionality requires that {\normalfont \ttfamily libmatheval} is installed.}. In the above example {\normalfont \ttfamily parameter5Name} has a value of ``{\normalfont \ttfamily =10.0*[parameter4Name:subParameter1Name]}''. The initial ``{\normalfont \ttfamily =}'' indicates that this is a math expression which should be evaluated. In this case, the expression is ten times value value of ``{\normalfont \ttfamily [parameter4Name:subParameter1Name]}'', which refers to the value of the sub-parameter {\normalfont \ttfamily subParameter1Name} of parameter {\normalfont \ttfamily parameter4Name}. In this way the values of parameters can be derived from those of other parameters.

Lastly, a text parameter can also be evaluated by starting it with an initial ``{\normalfont \ttfamily =}''. For text parameters, other parameters can be referenced and their values are simply inserted. So, for example:
\begin{verbatim}
Expand Down
1 change: 1 addition & 0 deletions parameters/reference/evolutionGalaxyFormation.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
<efficiencyStrippingOutflow value="0.1" />
<trackStrippedGas value="true" />
</componentHotHalo>
<componentPosition value="null" />
<componentSatellite value="orbiting"/>
<componentSpheroid value="standard" >
<ratioAngularMomentumScaleRadius value="0.5" />
Expand Down
7 changes: 4 additions & 3 deletions parameters/reference/evolutionGalaxyFormationNBody.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
<efficiencyStrippingOutflow value="0.1" />
<trackStrippedGas value="true" />
</componentHotHalo>
<componentPosition value="cartesian"/>
<componentPosition value="null" active="[mergerTreeConstructor] == build"/>
<componentPosition value="cartesian" active="[mergerTreeConstructor] == read" />
<componentSatellite value="preset" />
<componentSpheroid value="standard" >
<ratioAngularMomentumScaleRadius value="0.5" />
Expand Down Expand Up @@ -206,12 +207,12 @@
<fractionMassFormation value="0.5"/>
</nodeOperator>
<!-- Position interpolation -->
<nodeOperator value="positionInterpolated">
<nodeOperator value="positionInterpolated" active="[componentPosition] == cartesian">
<wrapPeriodic value="false"/> <!-- Do not wrap interpolated positions back into the box - this is not needed as we replicate the box. -->
<lengthBox value="=[geometryLightcone::lengthReplication]*(([cosmologyParameters::HubbleConstant]/100.0)^[geometryLightcone::lengthHubbleExponent])*([geometryLightcone::lengthUnitsInSI]/3.08567758e+22)"/>
</nodeOperator>
<!-- Heuristic analysis -->
<nodeOperator value="assemblyHistoryHeuristics">
<nodeOperator value="assemblyHistoryHeuristics" active="[mergerTreeConstructor] == read">
<exponentGrowth value="100.0"/>
<sigmaThreshold value="5.0"/>
<nbodyHaloMassError value="trenti2010">
Expand Down
4 changes: 2 additions & 2 deletions perl/Fortran/Utils.pm
Original file line number Diff line number Diff line change
Expand Up @@ -346,8 +346,8 @@ sub Get_Fortran_Line {
if ( $tmpLine !~ m/!/ ) {
## This regex tests for the possible existance of any comment. If no "!" is present there can be no comment, and most lines don't contain comments, so we can quickly ignored them.
$commentPosition = -1;
} elsif ( $tmpLine =~ m/^([^'"\{]+)![^\$]/ ) {
## This regex checks for a "!" prior to any of "'{, and not followed by a "$" (which indicates an OpenMP directive). If found, this must be the start of a comment.
} elsif ( $tmpLine =~ m/^([^'"\{]+?)![^\$]/ ) {
## This regex checks for the first "!" prior to any of "'{, and not followed by a "$" (which indicates an OpenMP directive). If found, this must be the start of a comment.
$commentPosition = length($1);
} else {
# General case. Comments begin with a "!" symbol, but not if it is found inside a string literal, or inside braces, "{}".
Expand Down
2 changes: 1 addition & 1 deletion perl/Galacticus/Build/Components/TreeNodes.pm
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ sub Build_Tree_Node_Class {
{
type => "procedure" ,
name => "isPrimaryProgenitor" ,
function => "Tree_Node_Is_Primary_Progenitor" ,
function => "treeNodeIsPrimaryProgenitor" ,
description => "Return true if this node is the primary progenitor of its descendant, false otherwise." ,
returnType => "\\logicalzero" ,
arguments => ""
Expand Down
8 changes: 4 additions & 4 deletions source/dark_matter_profiles.structure.scale.concentration.F90
Original file line number Diff line number Diff line change
Expand Up @@ -343,12 +343,12 @@ Root function used to find the mass of a halo corresponding to the definition us
call state_(stateCount)%darkMatterProfile%scaleSet(radiusCore)
call Calculations_Reset(state_(stateCount)%nodeWork)
! Find the non-alt density.
densityOuter=+state_(stateCount)%self%cosmologyFunctions_ %matterDensityEpochal( state_(stateCount)%basic%time()) &
& *state_(stateCount)%self%virialDensityContrast_%densityContrast (state_(stateCount)%basic%mass(),state_(stateCount)%basic%time())
densityOuter=+state_(stateCount)%self%cosmologyFunctions_ %matterDensityEpochal ( state_(stateCount)%basic%time()) &
& *state_(stateCount)%self%virialDensityContrast_ %densityContrast (state_(stateCount)%basic%mass(),state_(stateCount)%basic%time())
! Solve for radius which encloses required non-alt density.
radiusOuter=state_(stateCount)%self%darkMatterProfileDMODefinition%radiusEnclosingDensity(state_(stateCount)%nodeWork,densityOuter)
radiusOuter =+state_(stateCount)%self%darkMatterProfileDMODefinition%radiusEnclosingDensity(state_(stateCount)%nodeWork ,densityOuter)
! Get the mass within this radius.
massOuter =state_(stateCount)%self%darkMatterProfileDMODefinition%enclosedMass (state_(stateCount)%nodeWork, radiusOuter)
massOuter =+state_(stateCount)%self%darkMatterProfileDMODefinition%enclosedMass (state_(stateCount)%nodeWork , radiusOuter)
! Return root function.
concentrationMassRoot=massOuter-state_(stateCount)%mass
return
Expand Down
Loading

0 comments on commit f258240

Please sign in to comment.