-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathGET_STARTED_2
91 lines (80 loc) · 4.57 KB
/
GET_STARTED_2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
+ JBG. V0.5, 03/05/2013.
+****************************************************************************************************************************************************
+ RUNNING VARIOUS SIMULATIONS WITH PSOM
+----------------------------------------
************
* Important: whether you are a user or a developer, you are strongly invited to leave untouched the files contained in code/model/ .
This directory is designed to contain the latest version of the model, which is common to every user at a given time.
It is henceforth advisable to follow the steps described hereafter to create your own version of the model, according to your needs.
************
-------
It is likely that you will want to run a simulation that is different from the default "wiggle" simulation. To do that, please do not modify code/model/* .
You will have to follow this procedure:
+
|
+-> For every experiment you want to create,
|
+ Create a directory that will contain the source files specific to this experiment. Ex: you want to create and experiment with the name "Z". First, create a directory code/expe_Z , in which you will create two subdirectories /inc and /src . To do that, in code/, you can run
| ****************************
| * cp -r expe_template expe_Z
| ****************************
| (expe_template is a template directory of an "experiment directory").
|
|
|
+-> * For every routine that will be specific to this experiment,
|
|
+ Create new subroutines. Ex: if you want to change the initial conditions, copy code/model/src/ini_st.f90 to code/expe_Z/src/ .
| ****************************
| * cp model/src/routine_I_want_to_change.f90 expe_Z/src/
| ****************************
|
+ Alter the subroutines. Ex: modify code/expe_Z/src/ini_st.f90 to your convenience.
| ****************************
| * edit (vi, textedit,...) expe_Z/src/routine_I_want_to_change.f90
| ****************************
|
| <- +
|
|
| The files in ./expe_Z will overtake those from ./model. The next step details how to create the executable exe/nh_expe_Z, based on a combination of old and new .f90 files.
|
+ In order to compile, you simply have to run
|
| ****************************
| * sh tools/compile.sh expe_Z
| ****************************
|
| This step includes a superseding procedure that will take into account the new version of ini_st.f90 (in code/expe_Z/src/) and
| discard the standard version of ini_st.f90 (in code/model/src).
| More precisely, it will create the makefile based on this new state of the model (in ./mkfile), compile and create the executable code/exe/nh_expe_Z.
|
| More details on compile.sh may be found by running " sh tools/compile.sh -help "
|
|
+ Once you have a customized working version of the model, copy namelist to expe_Z/src/namelist_expe_Z (for instance)
|
| ****************************
| * cp namelist expe_Z/src/namelist_expe_Z
| ****************************
|
+ To change variables of the model (time step, diffusion coefficients) or the output directory, edit the namelist file. Note that the directory you choose must exist.
|
| ****************************
| * edit (vi, textedit, ...) expe_Z/src/namelist_expe_Z
| ****************************
|
+ Finally, to run the model, then simply do
|
| ****************************
| * ./exe/nh_expe_Z < ./expe_Z/src/namelist_expe_Z
| ****************************
|
| <-+
|
+
Some comments:
- This procedure enables to simultaneously work on several configurations of the model. You can have as many code/expe_* you want, and using compile.sh, you can create as many nh_expe_* you need.
- You can develop a part of the model without losing track of the standard version which is still in code/model. If a new version of the model is released, you can update your working core of the model by simply copying ./code/model directory. Minor changes will likely be needed to adapt your versions of the model to the new version.
- If you want to share a model setting with a collaborator, you simply have to copy expe_Z, that only contains the files that are specific to your simulation. He should be able to compile and run seamlessly.