New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
2_quickstart.md in branches/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/src/docsrc – NEMO

source: branches/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/src/docsrc/2_quickstart.md @ 6467

Last change on this file since 6467 was 6467, checked in by jpaul, 8 years ago

see ticket #1711

File size: 19.5 KB
Line 
1# How To Use (Quick Start)
2
3@tableofcontents
4
5SIREN is a software to set up regional configuration with
6 [NEMO](http://www.nemo-ocean.eu).<br/>
7Actually SIREN creates all the input files you need to run a NEMO regional configuration.<br/>
8 
9SIREN is composed of a set of 5 Fortran programs :
10<ul>
11 <li>create_coord.f90 to create regional grid coordinates.</li>
12 <li>create_bathy.f90 to create regional grid bathymetry.</li>
13 <li>merge_bathy.f90 to merge regional grid bathymetry with wider grid bathymetry
14 at boundaries.
15 @note the goal of this step is to avoid break in Bathymetry.
16 This break may cause inconsistency between forcing fields  at boundary and regional fields.
17 </li>
18 <li>create_restart.f90 to create initial state file from coarse grid restart
19 or standard outputs.
20 @note this program could also be used to refined other input fields from a wider
21 configuations (as runoff, chlorophyll etc...)
22 </li>
23 <li>create_boundary.F90 to create boundaries conditions from wider configurations
24 output fields.
25 </li>
26</ul>
27
28@warning SIREN can not:
29<ul>
30<li>create global configuration.</li>
31<li>create configuarion around or close to North pole.</li>
32<li>change number of vertical level.</li>
33</ul>
34
35Here after we briefly describe how to use each programs,
36and so how to create your own regional configuration.
37@note As demonstrator for a first start a set of GLORYS files (global reanalysis on *ORCA025* grid), as well as examples of namelists are available [here](https://cloud.mercator-ocean.fr/public.php?service=files&t=877fb1b6e4f589340fc0df1ea6a53228).
38
39<!-- ######################################################################  -->
40# Create coordinates file # {#coord}
41
42To create your own configuration, you first have to create a coordinates file on your domain of study.<br/>
43SIREN allows you to create this coordinates file from a wider coordinates file.<br/>
44The coordinates file created could simply be an extraction, or a refinment of
45the wide grid.<br/>
46
47To create this new cooridnates file, you have to run :
48~~~~~~~~~~~~~~~~~~
49./SIREN/create_coord.exe create_coord.nam
50~~~~~~~~~~~~~~~~~~
51
52Here after is an example of namelist for *create_coord.exe*.<br/>
53In this example, you create a coordinates file named *coord_fine.nc*.<br/>
54This new coordinates file is refined from an extraction of *coordinates_ORCA025.nc*.
55~~~~~~~~~~~
56&namlog
57/
58
59&namcfg
60   cn_varcfg = "PATH/NEMOGCM/TOOLS/SIREN/cfg/variable.cfg"
61/
62
63&namcrs
64   cn_coord0 = "PATH/coordinates_ORCA025.nc"
65   in_perio0 = 4
66/
67
68&namvar
69/
70
71&namnst
72   in_imin0 = 1070
73   in_imax0 = 1072
74   in_jmin0 = 607
75   in_jmax0 = 609
76
77   in_rhoi = 2
78   in_rhoj = 3
79/
80
81&namout
82   cn_fileout = "PATH/coord_fine.nc"
83/
84~~~~~~~~~~~
85
86Let's get describe this namelist.<br/>
87First we have the **namlog** sub-namelist. This sub-namelist set parameters of the log
88file.<br/>
89All the parameters of this sub-namelist have default value, so you could let it
90empty, as done here.<br/> This will create a log file named *create_coord.log*
91
92The **namcfg** sub-namelist defines where found SIREN configuration file.<br/>
93This configuration file defines standard name, default interpolation method,
94axis,... to be used for some known variables.<br/>
95Obviously, you could add other variables to those already list, in this file.
96
97@note You could find the generic version of *variable.cfg* in the directory *NEMOGCM/TOOLS/SIREN/cfg*.
98
99The **namcrs** sub-namelist set parameters of the wide
100coordinates file,<br/> as path to find it, and NEMO periodicity of the wide grid.<br/>
101
102@note the NEMO periodicity could be choose between 0 to 6:
103<dl>
104<dt>in_perio=0</dt>
105<dd>standard regional model</dd>
106<dt>in_perio=1</dt>
107<dd>east-west cyclic model</dd>
108<dt>in_perio=2</dt>
109<dd>model with symmetric boundary condition across the equator</dd>
110<dt>in_perio=3</dt>
111<dd>regional model with North fold boundary and T-point pivot</dd>
112<dt>in_perio=4</dt>
113<dd>global model with a T-point pivot.<br/>
114example: ORCA2, ORCA025, ORCA12</dd>
115<dt>in_perio=5</dt>
116<dd>regional model with North fold boundary and F-point pivot</dd>
117<dt>in_perio=6</dt>
118<dd>global model with a F-point pivot<br/>
119example: ORCA05</dd>
120</dl>
121@sa For more information see @ref md_src_docsrc_6_perio
122</dd>
123</dl>
124
125The **namvar** sub-namelist lists variables to be used.<br/>
126By default all the variables of the wider coordinates file are used to create
127the new coordinates file.<br/>
128The interpolation methods to be used are defined in the configuration variables file (see
129below). So you do not need to fill this sub-namelist too.
130
131The **namnst** sub-namelist defines the subdomain to be used as well as refinment factor.<br/>
132@note Subdomain is defined by indices of the coarse/wide grid.<br/>
133
134<ul>
135<li>you can select area quite every where (excepted too close from the North
136pole), and use the refinment factor you want.</li>
137
138~~~~~~~~~~~
139&namvar
140   in_imin0 = 1070
141   in_imax0 = 1072
142   in_jmin0 = 607
143   in_jmax0 = 609
144
145   in_rhoi = 2
146   in_rhoj = 3
147/
148~~~~~~~~~~~
149@image html grid_zoom_60.png
150@image latex grid_zoom_40.png
151<!-- @note ghost cells all around the grid are not shown here. -->
152
153<li>you can select area crossing the east-west overlap of the global ORCA grid.</li>
154
155~~~~~~~~~~~
156&namvar         
157   in_imin0 = 1402
158   in_imax0 = 62
159   in_jmin0 = 490
160   in_jmax0 = 570
161
162   in_rhoi = 5
163   in_rhoj = 5
164/               
165~~~~~~~~~~~
166@image html grid_glob_over_30.png
167@image latex grid_glob_over_20.png
168<!-- @note in blue, the east-west overlap band of ORCA grid. -->
169
170<li>you can select east-west cyclic area.</li>
171
172~~~~~~~~~~~
173&namvar
174   in_imin0 = 0
175   in_imax0 = 0
176   in_jmin0 = 390
177   in_jmax0 = 450
178
179   in_rhoi = 1
180   in_rhoj = 1
181/
182~~~~~~~~~~~
183@image html grid_glob_band_30.png
184@image latex grid_glob_band_20.png
185
186</ul>
187
188Finally the **namout** sub-namelist defines the output file.<br/>
189
190@note All the output files created by SIREN include information about NEMO
191periodicity, as well as source file, indices and refinment used.
192
193@sa For more information about how to create coordinates, see create_coord.f90
194
195<!-- ######################################################################  -->
196# Create bathymetry file # {#bathy}
197
198Then you need a Bathymetry file.<br/>
199SIREN allows you to create a Bathymetry extracted or refined from a wider
200Bathymetry grid.<br/>
201
202To create this new bathymetry, you have to run :
203~~~~~~~~~~~~~~~~~~
204./SIREN/create_bathy.exe create_bathy.nam
205~~~~~~~~~~~~~~~~~~
206
207Here after is an example of namelist for *create_bathy.exe*.<br/>
208In this example, you create a bathymetry file named *bathy_fine.nc*.<br/>
209This new bathymetry file is refined from an extraction of *bathy_meter_ORCA025.nc*.<br/>
210Moreover a minimum value of 5m is imposed to the output Bathymetry.
211~~~~~~~~~~~~~~~~~~
212&namlog
213/
214
215&namcfg
216   cn_varcfg = "PATH/NEMOGCM/TOOLS/SIREN/cfg/variable.cfg"
217/
218
219&namcrs
220   cn_coord0 = "PATH/coordinates_ORCA025.nc"
221   in_perio0 = 4
222/
223
224&namfin
225   cn_coord1 = "PATH/coord_fine.nc"
226/
227
228&namvar
229   cn_varfile = "Bathymetry:PATH/bathy_meter_ORCA025.nc"
230   cn_varinfo = "Bathymetry: min=5"
231/
232
233&namnst
234   in_rhoi = 2
235   in_rhoj = 3
236/
237
238&namout
239   cn_fileout = "PATH/bathy_fine.nc"     
240/
241~~~~~~~~~~~~~~~~~~
242
243Let's get describe this namelist.<br/>
244
245First as previously, we have the **namlog** and **namcfg** sub-namelist (see above for more
246explanation).<br/>
247
248Then the **namcrs** sub-namelist set parameters of the wide
249coordinates file.<br/>
250@note in all SIREN namelist: <br/>
2510 referred to the coarse/wide grid.<br/>
2521 referred to the fine grid.
253
254In the same way, the **namfin** sub-namelist  set parameters of the fine
255coordinates file.<br/>
256@note in this namelist example, there is no need to set the variable *in_perio1* to define the NEMO
257periodicity of the fine grid.<br/> Indeed, if this variable is not inform, SIREN tries to read it in the attributes of the file.<br/>
258So if you created the fine coordinates with SIREN, you do not have to
259fill it. In other case, you should add it to the namelist.
260
261The **namvar** sub-namelist lists variables to be used:
262<dl>
263   <dt>cn_varfile</dt>
264      <dd> defines the variable name ("Bathymetry" here) and the input file associated with.
265            @warning The domain of the input Bathymetry have to be larger than the output domain.
266         @note
267         <ul>
268            <li>if the input file is at coarse grid resolution (same than *cn_coord0*), the ouptut Bathymetry will be refined on fine grid.</li>
269            <li>if the input file is a wider bathymetry (already at fine grid resolution), the output Bathymetry will be extracted from this one.</li>
270         </ul>
271      </dd>
272   <dt>cn_varinfo</dt>
273      <dd> defines user's requests for a variable.
274         @note Default interpolation method for the Bathymetry, is *cubic* interpolation.<br/>
275         So you may want to specify a minimum value to avoid negative value, or to change interpolation method.<br/>
276         example: <ul><li>cn_varinfo="Bathymetry: min=1"'</li>
277                      <li>cn_varinfo="Bathymetry: int=linear"</li></ul>
278      </dd>
279</dl>
280
281The **namnst** sub-namelist defines the subdomain refinment factor.<br/>
282Of course those refinment factors have to be convenient with refinment
283from coarse grid *cn_coord0* to fine grid *cn_coord1*.
284@note subdomain indices are automatically deduced from fine and coarse grid
285coordinates.
286
287Finally, this **namout** sub-namelist defines the output file.<br/>
288
289@note All the output files create by SIREN include information about
290source file, indices, refinment and interpolation method used.
291
292@sa For more information about how to create bathymetry, see
293create_bathy.f90
294
295<!-- ######################################################################  -->
296# Merge bathymetry file # {#merge}
297
298The Bathymetry you build differs from the wider one.<br/>
299To avoid issue with boundaries forcing fields, you should merge fine and coarse Bathymetry on boundaries.<br/>
300SIREN allows you to do this.<br/>
301
302To create this merged bathymetry, you have to run :
303~~~~~~~~~~~~~~~~~~
304./SIREN/merge_bathy.exe merge_bathy.nam
305~~~~~~~~~~~~~~~~~~
306
307Here after is an example of namelist for *merge_bathy.exe*.<br/>
308~~~~~~~~~~~~~~~~~~
309&namlog
310/
311
312&namcfg
313   cn_varcfg = "PATH/NEMOGCM/TOOLS/SIREN/cfg/variable.cfg"
314/
315
316&namcrs
317   cn_bathy0 = "PATH/bathy_meter_ORCA025.nc"
318   in_perio0 = 4
319/
320
321&namfin
322   cn_bathy1 = "PATH/bathy_fine.nc"
323/
324
325&namnst
326   in_rhoi = 3
327   in_rhoj = 3
328/
329
330&nambdy
331/
332
333&namout
334   cn_fileout = "PATH/bathy_merged.nc"     
335/
336~~~~~~~~~~~~~~~~~~
337In this namelist, you find again the **namlog**, **namcfg** describe above.
338
339Then the **namcrs** sub-namelist sets parameters of the wider grid.
340However this time, this is the coarse/wide grid Bathymetry wich have to be informed.
341
342The **namfin** sub-namelist defines parameters of the fine grid Bathymetry.
343@note here again you could add the *in_perio1* parameter if need be i.e. if your
344fine grid Bathymetry was not created by SIREN.
345
346The **namnst** sub-namelist defines the subdomain refinment factor.
347
348
349The **nambdy** sub-namelist defines the subdomain boundaries.<br/>
350By default SIREN tries to create boundaries for each side. Boundary exist if there is at least one sea point on the second row of each side.<br/>
351So you could let this namelist empty.
352
353@sa For more information about boundaries, see @ref boundary
354
355Finally, this **namout** sub-namelist defines the output file.<br/>
356
357@sa For more information about how to merge bathymetry, see
358merge_bathy.f90
359
360<!-- ######################################################################  -->
361# Create initial state # {#restart}
362
363To run your configuration you need an inital state of the ocean.<br/>
364You could start from a restart file (with all NEMO variables fields at one
365time step). Or you could start from "partial" information about ocean state (Temperature and Salinity for example).
366
367Siren allows you to create both of those initial state.<br/>
368To create the initial state, you have to run:<br/>
369~~~~~~~~~~~~~~~~~~
370./SIREN/create_restart.exe create_restart.nam
371~~~~~~~~~~~~~~~~~~
372
373Here after is an example of namelist for *create_restart.exe*.<br/>
374In this example, you create an initial state split on 81 "processors", and named restar_out.nc.<br/>
375The initial state is composed of temperature and salinity refined from an extraction of GLORYS fields.
376~~~~~~~~~~~~~~~~~~
377&namlog
378/
379
380&namcfg
381   cn_varcfg = "PATH/NEMOGCM/TOOLS/SIREN/cfg/variable.cfg"
382/
383
384&namcrs
385   cn_coord0 = "PATH/coordinates_ORCA025.nc"
386   in_perio0 = 4
387/
388
389&namfin
390   cn_coord1 = "PATH/coord_fine.nc"
391   cn_bathy1 = "PATH/bathy_merged.nc"
392/
393
394&namzgr
395/
396
397&namzps
398/
399
400&namvar
401   cn_varfile = "votemper:GLORYS_gridT.nc",
402                "vosaline:GLORYS_gridS.nc"
403/
404
405&namnst
406   in_rhoi = 3
407   in_rhoj = 3
408/
409
410&namout
411   cn_fileout = "PATH/restart_out.nc"     
412   in_nproc = 81
413/
414~~~~~~~~~~~~~~~~~~
415Let's get describe this namelist more accurately.<br/>
416
417As previously, we have the **namlog** and **namcfg** sub-namelists, as well as
418the **namcrs** sub-namelist to set parameters of the wide coordinates file (see above for more
419explanation).<br/>
420
421Then the **namfin** sub-namelist set parameters of the fine
422grid coordinates and bathymetry.<br/>
423
424The **namzgr** and **namzps** sub-namelists define respectively parameters for vertical grid
425and partial step.<br>
426By default, those parameters are defined the same way than in GLORYS (i.e. 75 vertical levels).<br/>
427So you could let it empty.
428@note If you use forcing fields other than GLORYS, you have to be sure it uses the same vertical grid. In other case, you need to get information about the parametrisation use, and to put it in those sub-namelist (see create_restart.f90).
429
430the **namvar** sub-namelist lists variables to be used.<br/>
431Here we use *votemper* (temperature) get from *GLORYS_gridT.nc* file, and *vosaline*
432(salinity) get from *GLORYS_gridS.nc* file.
433@note To get all variables of a restart file. You have to use:
434~~~~~~~~~~~~~~~~~~
435cn_varfile = "all:PATH/restart.dimg"
436~~~~~~~~~~~~~~~~~~
437
438The **namnst** sub-namelist defines the subdomain refinment factor, as seen previously.<br/>
439
440Finally, this **namout** sub-namelist defines the output files.<br/>
441Here we ask for output on 81 processors, with *restart_out.nc* as file "basename".<br/>
442So SIREN computes the optimal layout for 81 porcessors
443available,<br/>
444and split restart on output files named *restart_out_num.nc*, where *num* is the porc number.
445
446@note SIREN could also create the other fields you may need for
447your configuration.<br/>
448To do so, you just have to run *create_restart.exe* with other variable(s) from other input file(s).<br/>
449For example, to get runoff fields, you could use:
450~~~~~~~~~~~~~~~~~~
451cn_varfile = "sorunoff:PATH/runoff_GLORYS.nc"
452...
453cn_fileout = "PATH/runoff_out.nc"
454~~~~~~~~~~~~~~~~~~
455
456@sa For more information about how to create initial state or other fields, see
457create_restart.f90
458
459<!-- ######################################################################  -->
460# Create boundaries conditions # {#boundary}
461
462Finally to force your configuration, you may need boundaries conditions.<br/>
463NEMO read physical boundaries conditions from temperature, salinity, currents, and sea
464surface height.
465
466To create the boundaries condition with SIREN, you have to run:<br/>
467~~~~~~~~~~~~~~~~~~
468./SIREN/create_boundary.exe create_boundary.nam
469~~~~~~~~~~~~~~~~~~
470
471Here after is an example of namelist for *create_boundary.exe*.<br/>
472In this example, you create boundaries conditions named *boundary_out.nc* on
473each side of the domain.<br/>
474The boundaries contain information about temperature, salinity, currents and sea surface height refined from an extraction of GLORYS fields.
475~~~~~~~~~~~~~~~~~~
476&namlog
477/
478
479&namcfg
480   cn_varcfg = "PATH/NEMOGCM/TOOLS/SIREN/cfg/variable.cfg"
481/
482
483&namcrs
484   cn_coord0 = "PATH/coordinates_ORCA025.nc"
485   in_perio0 = 4
486/
487
488&namfin
489   cn_coord1 = "PATH/coord_fine.nc"
490   cn_bathy1 = "PATH/bathy_fine.nc"
491/
492
493&namzgr
494/
495
496&namzps
497/
498
499&namvar
500   cn_varfile="votemper:GLORYS_gridT.nc",
501              "vosaline:GLORYS_gridS.nc",
502              "vozocrtx:GLORYS_gridU.nc",
503              "vomecrty:GLORYS_gridV.nc",
504              "sossheig:GLORYS_grid2D.nc"
505/
506
507&namnst
508   in_rhoi = 3
509   in_rhoj = 3
510/
511
512&nambdy
513/
514
515&namout
516   cn_fileout = "PATH/boundary_out.nc"     
517/
518~~~~~~~~~~~~~~~~~~
519
520Let's get describe this namelist more accurately.<br/>
521
522As previously, we have the **namlog** and **namcfg** sub-namelists, as well as
523the **namcrs** sub-namelist to set parameters of the wide coordinates file (see above for more
524explanation).<br/>
525
526Then the **namfin** sub-namelist set parameters of the fine
527grid coordinates and bathymetry.<br/>
528
529The **namzgr** and **namzps** sub-namelists define respectively parameters for vertical grid
530and partial step.<br>
531By default, those parameters are defined the same way than in GLORYS (i.e. 75 vertical levels).<br/>
532So you could let it empty.
533@note If you use forcing fields other than GLORYS, you have to be sure it uses the same vertical grid. In other case, you need to get information about the parametrisation use, and to put it in those sub-namelist (see create_boundary.F90).
534
535the **namvar** sub-namelist lists variables to be used.<br/>
536Here we get *votemper* (temperature) from *GLORYS_gridT.nc* file, *vosaline*
537(salinity) from *GLORYS_gridS.nc* file, *vozocrtx* (zonal velocity) from
538*GLORYS_gridU.nc*, *vomecrty* (meridional velocity) from *GLORYS_gridV.nc*, and sossheig (sea surface
539height) from *GLORYS_grid2D.nc*.
540
541The **namnst** sub-namelist defines the subdomain refinment factor.<br/>
542
543The **nambdy** sub-namelist defines the subdomain boundaries.<br/>
544By default SIREN tries to create boundaries for each side (Boundary is created if sea point exist on the second row of each side).<br/>
545So you could let this namelist empty.
546
547@note SIREN allows you to place boundaries away from the side of the domain.
548To do so you have to define your boundary.<br/>
549That means you have to give on fine
550grid the index of the boundary (how far from the border your boundary is),
551the width of your boundary, and finally first and last point of your boundary (the length of your boundary).<br/>
552So to define a north boundary, you have to add in the sub-namelist *nambdy*, the parameter:
553~~~~~~~~~~~~~~~~~~
554cn_north="index,first:last(width)"
555~~~~~~~~~~~~~~~~~~
556
557Finally, this **namout** sub-namelist defines the output files.<br/>
558Here we ask for output with *boundary_out.nc* as file "basename".<br/>
559So SIREN creates output files named *boundary_out_west.nc*,
560*boundary_out_east.nc*, *boundary_out_north.nc*, and *boundary_out_south.nc*
561depending if boundary exist or not.
562
563@sa For more information about how to create boundaries condition, see
564create_boundary.F90
565
566# Create and run NEMO configuration # {#NEMOconf}
567
568So now you created all the input files you need for your physical configuration, you have to create the "NEMO configuration".<br/>
569To do so, go to the directory *NEMOGCM/CONFIG/*, and run:
570~~~~~~~~~~~~~~~~~~
571./makenemo -n MY_CONFIG -d "OPA_SRC"
572~~~~~~~~~~~~~~~~~~
573This creates your configuration "MY_CONFIG" in the directory *NEMOGCM/CONFIG*.<br/>
574you could check the cpp_keys used in file *cpp_MY_CONFIG.fcm*, and re-run *makenemo*
575if need be.
576
577Once *makenemo* has run successfully, the *opa* executable is available in
578directory *NEMOGCM/CONFIG/MY_CONFIG/EXP00*.<br/>
579Then you just have to put all your input files in this directory, fill the namelist *namelist_cfg*, and run:
580~~~~~~~~~~~~~~~~~~
581mpirun ./opa
582~~~~~~~~~~~~~~~~~~
583
584@note no surface forcing here.
585weighted function needed to do interpolation on the fly, could be created by WEIGHT tools already inside NEMO.
586
587@sa For more information about how to create NEMO configuration see [NEMO Quick Start Guide](http://www.nemo-ocean.eu/Using-NEMO/User-Guides/Basics/NEMO-Quick-Start-Guide).
588
589 <HR>
590   <b>
591   - @ref index
592   - @ref md_src_docsrc_1_install
593   - @ref md_src_docsrc_2_quickstart
594   - @ref md_src_docsrc_3_support_bug
595   - @ref md_src_docsrc_4_codingRules
596   - @ref md_src_docsrc_5_changeLog
597   - @ref todo
598   </b>
Note: See TracBrowser for help on using the repository browser.