INMCM60_sfx
This project a good one ...
Usage
Users are encouraged to participate in development, writing issues
References
Dependencies
The project has no dependencies
How to download and run code
Here we will show how to compile the code on your local PC. You must have git, make, Fortran compiler on your system path. The code allows easy to use compilation on different clusters and supercomputers, as well as installing without the MPI library dependency, see Documentation for details.
- Download the projects with git (username -- is your login on tesla.parallel.ru):
git clone http://username@tesla.parallel.ru/inmcm60_pbl/inmcm60_sfx/inmcm60_sfx.git
- Run Makefile.
make -B COMPILER=gnu
Option COMPILER
enables set of compiler-specific options. Most common are gnu
(GNU C/C++ compiler) and intel
(Intel C/C++ compiler, version above 16.0).
- If everything runs smoothly executable sfx.exe will be created.
## run the executable
./sfx.exe
Building with CMake
Currently there is an implementation of Cmake-based toolchain which allows to build the model quicker and with less hustle (minimum required cmake version is 3.19). Clone the project and load appropriate modules. Create a build directory outside of cloned projects:
mkdir build && cd build
The code supports fluxes computations on both CPU and GPU and the CPU implementation has two versions: Fortran and C++ implementation.
- Building the Fortran CPU version:
cmake ..
- Building the C++ CPU version:
cmake -DUSE_CXX=ON ..
- Building the C++ GPU version:
cmake -DINCLUDE_CUDA=ON -DCMAKE_CUDA_ARCHITECTURES=<N> ..
where N
is the architecture to generate device code for.
Running test cases
We have prepared several dataseta to make the test calculations. Data is prepared on the basis of measurements.
- MOSAiC Shupe M. D. et al. Overview of the MOSAiC expedition: Atmosphere // Elem Sci Anth. – 2022. – Т. 10. – №. 1. – С. 00060.
- Irgason - Measurements on Mt. Elbrus
- Sheba https://data.eol.ucar.edu/project/SHEBA
For MOSAiC put - 1, for Irgason - 2, for Sheba - 3. There are two input files for each test in folder ./data/. For example MOSAiC.txt and MOSAiC_zh. The first file contains data on:
- wind velocity (m/s),
- difference between potential temperature at constant flux layer height and at the surface (deg. K)
- semi-sum of potential temperature at constant flux layer height and at surface (deg. K)
- difference between humidity at constant flux layer height and a surface (kg/kg)
The number of rows corresponds to the number of time intervals. Files with endings _zh.txt contain two values that are time-independent: constant flux layer height (m) and roughness of surface (m)
Then build the executable file using "makefile". If the build is successful, the file will appear sfx.exe. Run the file sfx.exe. The output values will appear in the folder ./output/. The name of the file will correspond to the name of the test. The output file contains data on:
- non-dimensional constant flux layer height (z/L) L-Obukhov length
- Richardson number
- Reynods number
- ln(zu/zt)
- dynamical roughness zu (m)
- thermal roughness zt (m)
- critical Richardson number
- transfer coefficient for momentum
- transfer coefficient for heat
- eddy viscosity coefficient (m**2/s)
- inverse turbulent Prandtl number
Developing and working with issues
Suppose you were assigned to an issue introduce a feature
for one of the projects mentioned above and you need to make some changes in nse-diurnal-les project. Your typical workflow will be like this:
- first make sure you use proper credentials in your git environment that match that on http://tesla.parallel.ru/ :
git config --global user.email alice.roberts@securemail.com
git config --global user.name Alice Roberts
- go to the project's issues tab on http://tesla.parallel.ru/
- open issue assigned to you and click the arrow near create-merge-request button, select create new branch and create it. It will be named something like
10-introduce-a-feature
- go to the folder with the project
cd ./inmcm60_sfx/
- fetch all the new content with
git fetch
- checkout to the new branch
git checkout -b 10-introduce-a-feature
- set an upstream branch on the remote
git branch --set-upstream-to=origin/10-introduce-a-feature
- do all the regular steps:
./cpall.sh ../../code
, work on adding you feature - when you are done run the copy-back script to put code back to tracked folder
./cpall_back.sh ../
- go to your projects folder and check git status:
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: config-ex.txt
modified: my-awesome-feature.cpp
modified: makefile
modified: cpall.sh
no changes added to commit (use "git add" and/or "git commit -a")
- add the necessary files to commit with
git add
and discard unnecessary changes withgit restore
- create a commit with
git commit
and a clear message of what you've done following these simple recommendations - push your changes back to the tesla server with
git push
- browse to Tesla GitLab Server, navigate to the issue you worked on and create merge request, assign one of the maintainers to it and check that the merge will be done from your feature branch to
master
or other branch you intend to merge this into - wait for the merge to be approved, your work is done at this point, you deserve a beer.
It may happen that you have done everything right, but your merge request is impossible to merge. This means someone has committed to master while you were working on your feature. In some cases you will be able to fix this easily. You will need to switch to feature branch locally, make a dump of this branch and rebase it on master. If everything is fine push it to remote with force:
git fetch
git checkout 10-introduce-a-feature
git pull 10-introduce-a-feature
git checkout -b 10-introduce-a-feature-backup
git rebase master
git push -f origin 10-introduce-a-feature
Merge button on your merge request webpage should become active.
Tips for commit messages
Informative commit message would help to keep the project's history clean. Try to follow these tips:
- Separate subject from body with a blank line.
- Limit the subject line to 50 characters.
- Capitalize the subject line.
- Do not end the subject line with a period.
- Use the imperative mood in the subject line.
- Wrap the body at 72 characters.
- Use the body to explain what and why vs. how.