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/2016/dev_INGV_UKMO_2016/NEMOGCM/TOOLS/SIREN/src/docsrc – NEMO

source: branches/2016/dev_INGV_UKMO_2016/NEMOGCM/TOOLS/SIREN/src/docsrc/2_quickstart.md @ 7351

Last change on this file since 7351 was 7351, checked in by emanuelaclementi, 7 years ago

ticket #1805 step 3: /2016/dev_INGV_UKMO_2016 aligned to the trunk at revision 7161

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