Skip to content

Commit

Permalink
fix: Do not output attributes associated with target dataset if no su…
Browse files Browse the repository at this point in the history
…ch dataset exists

In the "meanFunction1D" analysis class we should not set these attributes in the output if no target dataset exists, as setting them causes analysis scripts to expect to find a target dataset.
  • Loading branch information
abensonca committed Jul 28, 2021
1 parent c62cbe5 commit fa11391
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions source/galacticus.output.analyses.mean_function_1d.F90
Original file line number Diff line number Diff line change
Expand Up @@ -747,9 +747,11 @@ subroutine meanFunction1DFinalize(self)
call analysisGroup%writeAttribute( self% yAxisIsLog ,'yAxisIsLog' )
call analysisGroup%writeAttribute( char(self%propertyLabel) ,'xDataset' )
call analysisGroup%writeAttribute( char(self% meanLabel) ,'yDataset' )
call analysisGroup%writeAttribute( char(self% meanLabel)//"Target" ,'yDatasetTarget' )
call analysisGroup%writeAttribute( char(self% meanLabel)//"Covariance" ,'yCovariance' )
call analysisGroup%writeAttribute( char(self% meanLabel)//"CovarianceTarget",'yCovarianceTarget' )
if (allocated(self%meanValueTarget)) then
call analysisGroup%writeAttribute( char(self% meanLabel)//"Target" ,'yDatasetTarget' )
call analysisGroup%writeAttribute( char(self% meanLabel)//"CovarianceTarget",'yCovarianceTarget' )
end if
! Write computed datasets.
call analysisGroup%writeDataset ( self%binCenter ,char(self%propertyLabel) ,char(self%propertyComment) ,datasetReturned=dataset)
call dataset %writeAttribute( char(self%propertyUnits ) ,'units' )
Expand Down

0 comments on commit fa11391

Please sign in to comment.