Skip to content
Snippets Groups Projects
README.md 4.38 KiB
Newer Older
Evgeny Mortikov's avatar
Evgeny Mortikov committed
# **INMCM60_sfx**

This project a good one ...


## Usage
Users are encouraged to participate in development, writing [issues](http://tesla.parallel.ru/inmcm60_pbl/inmcm60_sfx/-/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.

1) Download the projects with git (username -- is your login on tesla.parallel.ru):
```bash
git clone http://username@tesla.parallel.ru/inmcm60_pbl/inmcm60_sfx/inmcm60_sfx.git
```

2) Run Makefile.
```bash
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).

3) If everything runs smoothly executable *sfx.exe* will be created.
```bash
## run the executable
./sfx.exe
```

## 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/](http://tesla.parallel.ru/) :
```bash
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/](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:
```vim
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 with `git restore`
- create a commit with `git commit` and a clear message of what you've done following [these simple recommendations](#tips-for-commit-messages)
- push your changes back to the tesla server with `git push`
- browse to [Tesla GitLab Server](http://tesla.parallel.ru/), 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:
```bash
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:

1.  Separate subject from body with a blank line.
2.  Limit the subject line to 50 characters.
3.  _Capitalize_ the subject line.
4.  Do not end the subject line with a period.
5.  Use the _imperative mood_ in the subject line.
6.  Wrap the body at 72 characters.
7.  Use the body to explain _what_ and _why_ vs. _how_.