-
Notifications
You must be signed in to change notification settings - Fork 0
Run SPBM & BROM_biogeochemisty with gfrotran on Windows Subsystem for Linux
1. Install Windows Subsystem for Linux (Microsoft tutorial)
In this example we use Debian. Open bash (command line), create username and password.
The bash will look like: root@some_adress:~#, ending :~# means you are in your working directory.
You should install everything to that folder.
2. Install libraries:
sudo apt-get install gfortran Gfortran
sudo apt-get install libnetcdf-dev libnetcdff-dev Netcdf Libraries for Fortran
sudo apt-get install gitGit to download source code
sudo apt-get install vim Text editor VIM
sudo apt-get -y install cmake Cmake
sudo apt-get install mc Midnight commander (optionally)
3. Clone codes for the model:
SPBM
git clone https://github.com/BottomRedoxModel/SPBM.git
cd SPBM
git checkout [branch for you case scenario]
BROM_BIOGEOCHEMISTRY
git clone https://github.com/BottomRedoxModel/brom_niva_module.git
cd brom_niva_module/
git checkout [branch for you case scenario]
FABM
git clone https://github.com/BottomRedoxModel/fabm.git
cd fabm
git checkout tags/spbm_v0.2 -b spbm_v0.2
Configuration files (for you case,example one is for Arctic)
git clone https://github.com/BottomRedoxModel/data_spbm_laptev.git #for Arctic Case
4. Manage environment variables:
Add FABMDIR, BROMDIR, and NetCDF_ROOT environment variables. Check that you have .bashrc file
ls -a # Prints all files including hidden
Open ~/.bashrc with vim
vim .bashrc
add to ~/.bashrc current lines (anywhere in the file):
export FABMDIR='~/fabm'
export BROMDIR='~/brom_niva_module'
run it
source ~/.bashrc
5. Build solution
Go to SPBM folder cd SPBM, Run bash script build_release.sh to make build
$ bash build_release.sh
it will make a build directory, copy there all necessary data files, and launch cmake to make a build.
6. Compile the code.
Go to SPBM/build and write:
make
7. Run the compiled code.
Now you have executable file SPBM in the ~SPBM/build, run it:
./SPBM
**8. Get and Plot results
The model output consists of 9 files:
- ice.nc
- ice_day.nc
- ice_year.nc
- water.nc
- water_day.nc
- water_year.nc
- sediments.nc
- sediments_day.nc
- sediments_year.nc