Skip to content

Commit

Permalink
(fix): Update cloud-microphysics fpm.toml and setup script to build
Browse files Browse the repository at this point in the history
using the previous strategy (generating a build/run-fpm.sh script
that is necessary to use) but in this new subdir structure.
  • Loading branch information
ktras committed Jan 8, 2024
1 parent 874d21f commit 2a12de7
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 7 deletions.
3 changes: 2 additions & 1 deletion cloud-microphysics/app/train-cloud-microphysics.f90
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ program train_cloud_microphysics

!! Internal dependencies;
use inference_engine_m, only : &
inference_engine_t, mini_batch_t, input_output_pair_t, tensor_t, trainable_engine_t, rkind, NetCDF_file_t, &
inference_engine_t, mini_batch_t, input_output_pair_t, tensor_t, trainable_engine_t, rkind, &
training_configuration_t, shuffle
use NetCDF_file_m, only: NetCDF_file_t
use ubounds_m, only : ubounds_t
implicit none

Expand Down
1 change: 1 addition & 0 deletions cloud-microphysics/fpm.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ maintainer = "rouson@lbl.gov"
[dependencies]
assert = {git = "https://github.com/sourceryinstitute/assert", tag = "1.5.0"}
sourcery = {git = "https://github.com/sourceryinstitute/sourcery", tag = "4.5.0"}
inference-engine = {path = "../"}
netcdf-interfaces = {git = "https://github.com/LKedward/netcdf-interfaces.git", rev = "d2bbb71ac52b4e346b62572b1ca1620134481096"}
File renamed without changes.
8 changes: 4 additions & 4 deletions cloud-microphysics/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ fi


brew tap fortran-lang/fortran # required for building fpm
brew install fpm netcdf netcdf-fortran pkg-config coreutils # coreutils supports `realpath` below
brew install fortran-lang/fortran/fpm netcdf netcdf-fortran pkg-config coreutils # coreutils supports `realpath` below

PREFIX=`realpath $PREFIX`

Expand Down Expand Up @@ -122,17 +122,17 @@ fi

if command -v fpm > /dev/null 2>&1; then
brew tap fortran-lang/fortran
brew install fpm
brew install fortran-lang/fortran/fpm
fi

echo "$RUN_FPM_SH test"
$RUN_FPM_SH test

echo ""
echo "____________________ Inference-Engine has been set up! _______________________"
echo "____________________ cloud-microphysics has been set up! _______________________"
echo ""
echo "To run one of the programs in the example subdirectory, enter a command of the"
echo "following form at a shell command prompt after replacing <example-base-name>"
echo "with the base name of a file in the example/ subdirectory:"
echo ""
echo "./build/run-fpm.sh run --example <example-base-name>"
echo "./build/run-fpm.sh run train-cloud-microphysics"
File renamed without changes.
4 changes: 2 additions & 2 deletions example/learn-exponentiation.f90
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ pure function e(j,n) result(unit_vector)
function perturbed_identity_network(perturbation_magnitude) result(trainable_engine)
type(trainable_engine_t) trainable_engine
real, intent(in) :: perturbation_magnitude
integer, parameter :: n(*) = [8, 64, 64, 64, 6]
integer, parameter :: n(*) = [8, 64, 64, 64, 6] ! nodes per layer (first layer = input, last layer = output)
integer, parameter :: n_max = maxval(n), layers = size(n)
integer j, k, l
real, allocatable :: identity(:,:,:), w_harvest(:,:,:), b_harvest(:,:)
Expand All @@ -144,4 +144,4 @@ function perturbed_identity_network(perturbation_magnitude) result(trainable_eng
end associate
end function

end program
end program

0 comments on commit 2a12de7

Please sign in to comment.