Skip to content

Commit

Permalink
Correct OptionsType subroutine's this parameter intent; Use `br…
Browse files Browse the repository at this point in the history
…ew --prefix` to resolve the correct platform specific `brew` prefix (#116)

* fix: OptionsType subroutine this intent -> inout

* ci(macOS): brew prefix

On intel macOS, brew installs into /usr/local
On apple silicon, brew installs into /opt/homebrew

Use brew --prefix to resolve the right brew prefix in a platform independent manor
  • Loading branch information
aaraney authored Sep 9, 2024
1 parent 37d8d82 commit 0abb891
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/Build_and_Run_Standalone_Test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ jobs:
elif [ ${{ runner.os }} == 'macOS' ]
then
brew install netcdf netcdf-cxx netcdf-fortran
echo "LIBRARY_PATH=/usr/local/lib/:$LIBRARY_PATH" >> $GITHUB_ENV
echo "LDFLAGS=-L/usr/local/lib" >> $GITHUB_ENV
echo "INCLUDE=/usr/local/include" >> $GITHUB_ENV
echo "NETCDF=/usr/local" >> $GITHUB_ENV
echo "LIBRARY_PATH=$(brew --prefix)/lib/:$LIBRARY_PATH" >> $GITHUB_ENV
echo "LDFLAGS=-L$(brew --prefix)/lib" >> $GITHUB_ENV
echo "INCLUDE=$(brew --prefix)/include" >> $GITHUB_ENV
echo "NETCDF=$(brew --prefix)" >> $GITHUB_ENV
fi
# Build and run noah executable
Expand Down
6 changes: 3 additions & 3 deletions src/OptionsType.f90
Original file line number Diff line number Diff line change
Expand Up @@ -118,15 +118,15 @@ module OptionsType

subroutine Init(this)

class(options_type), intent(out) :: this
class(options_type), intent(inout) :: this

call this%InitDefault()

end subroutine Init

subroutine InitDefault(this)

class(options_type), intent(out) :: this
class(options_type), intent(inout) :: this

this%opt_snf = huge(1)
this%opt_run = huge(1)
Expand All @@ -150,7 +150,7 @@ end subroutine InitDefault

subroutine InitTransfer(this, namelist)

class(options_type), intent(out) :: this
class(options_type), intent(inout) :: this
type(namelist_type), intent(in) :: namelist

this%opt_snf = namelist%precip_phase_option
Expand Down

0 comments on commit 0abb891

Please sign in to comment.