ssh into modeling2.acom.ucar.edu
in two terminal windows.
Preprocessor
In the first window, start a local preprocessor web service with:
npm install express helmet
git clone https://github.com/NCAR/MechanismToCode.git
cd MechanismToCode
node combined.js
You should see: app listening on :::3000
Build and run MusicBox
In the second window, build and run the model.
Get the code
To get the source code, in the second window run:
git clone https://github.com/NCAR/MusicBox.git
cd MusicBox
./manage_externals/checkout_externals
Grab a mechanism and build the model
To build a model for mechanism 272, from the root MusicBox/
folder in window 2, run:
cd Mechanism_collection
python3 get_tag.py -tag_id 272
python3 preprocess_tag.py -mechanism_source_path configured_tags/272 -preprocessor localhost:3000
python3 stage_tag.py -source_dir_kinetics configured_tags/272
cd ../MusicBox_host
mkdir build
cd build
export PATH="/opt/local/bin:$PATH"
export LD_LIBRARY_PATH="/opt/local/lib64:/opt/local/lib"
cmake3 -D CMAKE_CXX_COMPILER="/opt/local/bin/g++" \
-D CMAKE_C_COMPILER="/opt/local/bin/gcc" \
-D CMAKE_Fortran_COMPILER="/opt/local/bin/gfortran" \
-D NETCDF_LIBRARIES_C="/opt/local/lib/libnetcdf.so" \
-D NETCDF_LIBRARIES_F90="/opt/local/lib/libnetcdff.so" \
-D NETCDF_INCLUDES_F90="/opt/local/include" \
-D NETCDF_INCLUDES="/opt/local/include" \
../src
make
Run the model
Run the model from the MusicBox/MusicBox_host/build/
folder with:
./MusicBox
Stop the preprocessor web server
In the first window, stop with web server with ctrl-c