SURFEX  V8_0
Surfex V8_0 release
 All Classes Files Functions Variables
modd_glt_param.F90
Go to the documentation of this file.
1 !SFX_LIC Copyright 1994-2014 CNRS, Meteo-France and Universite Paul Sabatier
2 !SFX_LIC This is part of the SURFEX software governed by the CeCILL-C licence
3 !SFX_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt
4 !SFX_LIC for details. version 1.
5 !GLT_LIC The GELATO model is a seaice model used in stand-alone or embedded mode.
6 !GLT_LIC It has been developed by Meteo-France. The holder of GELATO is Meteo-France.
7 !GLT_LIC
8 !GLT_LIC This software is governed by the CeCILL-C license under French law and biding
9 !GLT_LIC by the rules of distribution of free software. See the CeCILL-C_V1-en.txt
10 !GLT_LIC (English) and CeCILL-C_V1-fr.txt (French) for details. The CeCILL is a free
11 !GLT_LIC software license, explicitly compatible with the GNU GPL
12 !GLT_LIC (see http://www.gnu.org/licenses/license-list.en.html#CeCILL)
13 !GLT_LIC
14 !GLT_LIC The CeCILL-C licence agreement grants users the right to modify and re-use the
15 !GLT_LIC software governed by this free software license. The exercising of this right
16 !GLT_LIC is conditional upon the obligation to make available to the community the
17 !GLT_LIC modifications made to the source code of the software so as to contribute to
18 !GLT_LIC its evolution.
19 !GLT_LIC
20 !GLT_LIC In consideration of access to the source code and the rights to copy, modify
21 !GLT_LIC and redistribute granted by the license, users are provided only with a limited
22 !GLT_LIC warranty and the software's author, the holder of the economic rights, and the
23 !GLT_LIC successive licensors only have limited liability. In this respect, the risks
24 !GLT_LIC associated with loading, using, modifying and/or developing or reproducing the
25 !GLT_LIC software by the user are brought to the user's attention, given its Free
26 !GLT_LIC Software status, which may make it complicated to use, with the result that its
27 !GLT_LIC use is reserved for developers and experienced professionals having in-depth
28 !GLT_LIC computer knowledge. Users are therefore encouraged to load and test the
29 !GLT_LIC suitability of the software as regards their requirements in conditions enabling
30 !GLT_LIC the security of their systems and/or data to be ensured and, more generally, to
31 !GLT_LIC use and operate it in the same conditions of security.
32 !GLT_LIC
33 !GLT_LIC The GELATO sofware is cureently distibuted with the SURFEX software, available at
34 !GLT_LIC http://www.cnrm.meteo.fr/surfex. The fact that you download the software deemed that
35 !GLT_LIC you had knowledge of the CeCILL-C license and that you accept its terms.
36 !GLT_LIC Attempts to use this software in a way not complying with CeCILL-C license
37 !GLT_LIC may lead to prosecution.
38 !GLT_LIC
39 ! =======================================================================
40 ! ========================= MODULE modd_glt_param ===========================
41 ! =======================================================================
42 !
43 ! Goal:
44 ! -----
45 ! This module contains the models parameters that are determined from
46 ! the namelist, and derived quantities.
47 !
48 ! Created : ? (D. Salas y Melia)
49 ! Modified: 2012/08 (D. Salas y Melia) parallel model
50 !
51 ! ---------------------- BEGIN MODULE modd_glt_param ------------------------
52 !
54  IMPLICIT NONE
55 !
56 !
57 !
58 ! 1. Model parameters
59 ! ===================
60 !
61 ! .. These parameters can be (theoretically) freely changed by the user
62 !
63 !
64 ! 1.1. Options to run glt_gelato
65 ! --------------------------
66 !
67 ! - nmkinit : create initial conditions file
68 ! nmkinit=0 --> use a restart file instead
69 ! nmkinit=1 --> use sea ice analytical initialization
70 ! nmkinit=2 --> use a sea ice fraction climatology
71 ! - nrstout : create an output restart file
72 ! nrstout=0 --> no output restart
73 ! nrstout=1 --> output restart will be created
74 ! - nrstgl4 : about restart format
75 ! nrstgl4=0 --> use an old format restart (before Gelato 4)
76 ! nrstgl4=1 --> use a new format restart (Gelato 4 and newer)
77 ! - nthermo : disable/enable sea ice thermodynamics
78 ! nthermo=0 --> no thermodynamics
79 ! nthermo=1 --> thermodynamics enabled
80 ! - ndynami : disable/enable sea ice dynamics
81 ! ndynami=0 --> no dynamics
82 ! ndynami=1 --> dynamics enabled
83 ! - nadvect : disable/enable ice glt_transport
84 ! nadvect=0 --> no ice glt_transport
85 ! nadvect=1 --> ice glt_transport enabled
86 ! - ntimers : disable/enable ice gltools_timers
87 ! - ndyncor : correct water and salt non-conservation due to advection
88 ! ndyncor=0 --> no correction
89 ! ndyncor=1 --> correction
90 ! - ncdlssh : take ssh into account when computing concentration/dilution
91 ! ncdlssh=0 --> ssh not taken into account
92 ! ncdlssh=1 --> ssh taken into account
93 ! - niceage : disable/enable ice age computation
94 ! niceage=0 --> no ice age computation
95 ! niceage=1 --> ice age computation enabled
96 ! - nicesal : disable/enable ice salinity computation
97 ! nicesal=0 --> no ice salinity computation
98 ! nicesal=1 --> ice salinity computation enabled
99 ! - nmponds : disable/enable melt pond computation (for ice surface albedo)
100 ! nmponds=0 --> no melt ponds computation
101 ! nmponds=1 --> melt ponds computation enabled
102 ! - nsnwrad : snowfall radiative effect
103 ! nsnwrad=0 --> no radiative effect of snow melting into sea water
104 ! (recommended in case of coupling, if snow fall in
105 ! your atm. model does not cause any heat gain for the
106 ! atmosphere)
107 ! nsnwrad=1 --> generates a negative heat flux sent to the ocean by
108 ! Gelato, due to the melting of snow into the ocean
109 ! - nleviti : sea ice is levitating over the ocean or not
110 ! nleviti=0 --> sea ice is not levitating (a freshwater flux due to the
111 ! melting/freezing of ice is sent to the ocean model)
112 ! --> sea ice is levitating
113 ! - nsalflx : ice-ocean salt flux parameterisation
114 ! (if 2 or 3, check ocean topmost level dz parameter rn_htopoc in
115 ! the namelist !)
116 ! nsalflx=1 --> approximated calculation
117 ! nsalflx=2 --> exact calculation
118 ! nsalflx=3 --> exact calculation, but SSS replaced with standard sal.
119 ! - nextqoc : ocean-ice heat flux
120 ! nextqoc=1 --> the %qoc given as an input is taken into account
121 ! nextqoc=0 --> the %qoc is computed by Gelato
122 ! - nicesub : ice sublimation
123 ! nicesub=1 --> take ice sublimation into account (non heat conservative)
124 ! nicesub=0 --> no ice sublimation
125 ! - cnflxin : input fluxes
126 ! cnflxin --> 'mixed' : only one flux, to share between water/ice
127 ! cnflxin --> 'double': one flux for water, one flux for ice
128 ! cnflxin --> 'multi' : one flux for water, one flux for each ice cat
129 !
130 INTEGER :: &
131  nmkinit, nrstout, nrstgl4, nthermo, ndynami, nadvect, &
132  ntimers, ndyncor, ncdlssh, niceage, nicesal, nmponds, &
133  nsnwrad, nleviti, nsalflx, nextqoc, nicesub
134  CHARACTER(10) :: &
135  cnflxin
136 !
137 !
138 ! 1.2. Damping and restoring
139 ! -------------------------
140 !
141 ! - cfsidmp : sea ice fraction constraint
142 ! cfsidmp='NONE' --> no sea ice fraction constraint
143 ! cfsidmp='DAMP' --> damp
144 ! cfsidmp='PRESCRIBE' --> prescribe
145 ! - xfsidmpeft : sea ice fraction damping e-folding time (in days)
146 ! - chsidmp : sea ice thickness constraint
147 ! chsidmp='NONE' --> no sea ice thickness constraint
148 ! chsidmp='DAMP_ADD' --> damp (thickness of all ice categories is
149 ! modified by the same value: h_i => h_i + add)
150 ! chsidmp='DAMP_FAC' --> damp (thickness of all ice categories is
151 ! modified by the same factor: h_i => h_i * fac)
152 ! chsidmp='PRESCRIBE' --> prescribe
153 ! - xhsidmpeft : sea ice thickness damping e-folding time (in days)
154 !
155  CHARACTER(20) :: &
156  cfsidmp, chsidmp
157 REAL :: &
158  xfsidmpeft, xhsidmpeft
159 !
160 !
161 ! 1.3. Diagnostics glt_output
162 ! -----------------------
163 !
164 ! - cdiafmt : diagnostics format
165 ! cdiafmt='GELATO' --> Gelato Vairmer format
166 ! cdiafmt='VMAR5' --> IPCC AR5 vairmer format
167 ! cdiafmt='NCAR5' --> IPCC AR5 NetCDF format (not active yet)
168 ! cdiafmt='XIOS' --> Use XIOS I/O server (NetCDF format and
169 ! diags namelist shared with Nemo - works only within Nemo yet)
170 ! - cdialev : diagnostics level
171 ! . cdialev can include one, two or all of the letters b, d and t
172 ! . If cdiafmt='GELATO'
173 ! - 1: makes the 2D diag. file (2D fields), called
174 ! '2d.[ave|ins].vairmer'. Contains: ice concentration, thickness,
175 ! velocity components, thin ice+thick ice, snow thickness).
176 ! . - 2: add more detailed 2D diagnostics to the 2D diag file,
177 ! like: solar short wave flux, non solar flux, water flux crossing
178 ! the leads+sea ice ensemble...
179 ! . - 3: makes the 0d.ins.vairmer diag. file (0D fields).
180 ! Contains: sea ice area, extent, volume, for both hemispheres +
181 ! transports at most Arctic Straits
182 ! - Example: cdialev=13 or 31 means that you want only the 2d basic
183 ! diagnostics + 0d diagnostic.
184 ! . If cdiafmt='VMAR5' or 'NCAR5'
185 ! - 1: save only the priority 1 fields
186 ! - 2: save only the priority 2 fields
187 ! - 3: save only the priority 3 fields
188 ! - x: save only my personal fields (additional)
189 ! - note fields e.g. in priority 2 fields can have a space dimension
190 ! equal to grid size nxglo*nyglo or equal to 1
191 ! - VMAR5: glt_output in Vairmer; NCAR5: glt_output in NetCDF.
192 ! - Example: cdialev=123x means you want all AR5 fields + yours
193 ! . If cdiafmt='XIOS' : levels are handled in dedicated diag namelist
194 ! - dttave : period for averaged fields (days, optional, default=365)
195 ! - navedia : average the glt_output over dttave and the whole run (N/A for XIOS)
196 ! - ninsdia : glt_output delivered once per time step (N/A for XIOS)
197 ! - ndiamax : maximum number of diagnostic files
198 ! - nsavinp : allows to save glt_gelato routine input in a file (used in
199 ! coupled mode)
200 ! nsavinp=0 --> glt_gelato routine input is not saved
201 ! nsavinp=1 --> glt_gelato routine input is saved in a file
202 ! - nsavout : allows to save glt_gelato routine glt_output in a file (used in
203 ! coupled mode)
204 ! nsavout=0 --> glt_gelato routine input is not saved
205 ! nsavout=1 --> glt_gelato routine input is saved in a file
206 ! - nupdbud : compute budgets (for model energy conservation tests)
207 ! nupdbud=0 --> no budgets computations (for operational runs)
208 ! nupdbud=1 --> budgets computations (for model validation)
209 ! - nprinto : glt_gelato prints glt_output as follows
210 ! nprinto=0 --> minimum glt_output print
211 ! nprinto=1 --> print fields statistics : mini, maxi, av.
212 ! nprinto=2 --> print fields + field statistics
213 ! - nprlast : glt_gelato prints glt_output as nprinto levels (last time step only)
214 ! - cinsfld : list of fields to be delivered at every time step
215 ! (all -> deliver all fields)
216 ! Note that one line per requested field should be given, e.g.:
217 ! cinsfld = sit
218 ! cinsfld = sic
219 ! ...
220 !
221  CHARACTER(8) :: &
222  cdiafmt,cdialev
223  CHARACTER(80), DIMENSION(:), ALLOCATABLE :: &
224  cinsfld
225 REAL :: &
226  dttave
227 INTEGER :: &
228  navedia, ninsdia, ndiamax, nsavinp, &
229  nsavout, nupdbud, nprinto, nprlast
230 !
231 !
232 ! 1.4. Run date position and time step
233 ! ------------------------------------
234 !
235 ! - nidate : initial date for running glt_gelato (-)
236 ! - niter : number of iterations from reference date (-)
237 ! - dtt : time step for dynamics and thermodynamics (s)
238 !
239 INTEGER :: &
240  nidate, niter
241 REAL :: &
242  dtt
243 !
244 !
245 ! 1.5. Number of ice categories
246 ! -----------------------------
247 !
248 ! - nt : number of ice thicknesses (-)
249 ! - thick : a vector, whose components define ice classes
250 ! thickness boundaries
251 !
252 INTEGER :: &
253  nt
254 REAL, DIMENSION(:), ALLOCATABLE :: &
255  thick
256 !
257 !
258 !
259 ! 1.6. Number of layers in the ice-snow slab
260 ! ------------------------------------------
261 !
262 ! .. Number of layers when solving the problem of vertical heat
263 ! diffusion through the ice and snow slab. Note that if the
264 ! scheme is explicit, nslay=1 is compulsory.
265 !
266 ! - nilay : number of ice layers in vertical discretisation (-)
267 ! - nslay : number of snow layers in vertical discretisation (-)
268 ! - xh* : vertical coordinate parameters
269 !
270 INTEGER :: &
271  nilay, nslay
272 REAL :: &
273  xh0,xh1,xh2,xh3,xh4
274 !
275 !
276 ! 1.7. Elastic Viscous-Plastic sea ice rheology parameters
277 ! ---------------------------------------------------------
278 !
279 ! - ntstp : number of dynamics time steps during one
280 ! thermodynamics time step.
281 ! - ndte : number of subcycles for velocity computations
282 ! during sea ice EVP dynamics.
283 !
284 INTEGER :: &
285  ntstp, ndte
286 !
287 !
288 ! 1.8. Limit Values for sea ice
289 ! ------------------------------
290 !
291 ! - xfsimax : maximum allowable fractional area for sea ice
292 ! - xicethcr : ice thickness that represents the limit between thin
293 ! and thick ice (m)
294 ! - xhsimin : minimum allowable ice thickness
295 
296 REAL :: &
297  xfsimax, xicethcr, xhsimin
298 !
299 !
300 ! 1.9. Parameterizations
301 ! -----------------------
302 !
303 ! .. If you need a standard parameterization of low clouds (not simulated
304 ! by your atmosphere model), a reasonable value for this parameter should
305 ! be 0.25. If you don't need this parameterization, use alblc=0.
306 ! (it is not recommended to use values other than 0...)
307 ! - alblc : albedo of low clouds
308 ! - xlmelt : lateral melting parameterization factor
309 ! - xswhdfr : fraction of the solar radiation absorbed by snow that
310 ! is involved in the vertical heat diffusion (the rest contributes to direct
311 ! warming/melting)
312 ! - albyngi : parameterisation of young ice albedo (exponential formulation)
313 ! albyngi=0. --> albedo of young ice does not depend on thickness
314 ! albyngi=1. --> albedo of young ice depends on thickness
315 ! - albimlt : albedo of melting ice
316 ! - albsmlt : albedo of melting snow
317 ! - albsmlt : albedo of dry snow
318 !
319 REAL :: &
320  alblc, xlmelt, xswhdfr, albyngi, albimlt, albsmlt, albsdry
321 !
322 !
323 ! 1.10. Logical units
324 ! ---------------------
325 !
326 ! - ngrdlu : unit for reading the grid
327 ! - nsavlu : unit for writing input/output fields for Gelato
328 ! - nrstlu : unit for reading/writing Gelato restart
329 ! - n0vilu : unit for writing 0D Glt Instantaneous diags
330 ! - n0valu : unit for writing 0D Glt Instantaneous diags
331 ! - n2vilu : unit for writing 2D Glt or IPCC-AR5 Instantaneous diags
332 ! - n2valu : unit for writing 2D Glt or IPCC-AR5 Averaged diags
333 ! - nxvilu : unit for writing Instantaneous additional diags (AR5 case)
334 ! - nxvalu : unit for writing Averaged additional diags (AR5 case)
335 ! - nibglu : unit for iceberg physics input/output
336 ! - nspalu : spare unit for personal use !
337 ! - noutlu : unit for glt_gelato glt_output
338 ! - ntimlu : unit for glt_gelato gltools_timers
339 !
340 INTEGER :: &
341  ngrdlu, nsavlu, nrstlu, n0vilu, n0valu, n2vilu, n2valu, &
342  nxvilu, nxvalu, nibglu, nspalu, noutlu, ntimlu
343 !
344 !
345 ! 1.11. Path to keep Gelato I/O fields
346 ! -------------------------------------
347 !
348 ! .. You must define this path (complete), but without "/" at the end if
349 ! you want to keep Gelato daily input/output variables (for example to
350 ! "replay" a simulation with input/output data obtained in coupled mode).
351 ! This variable is used only if nsavinp=1 or nsavout=1.
352 !
353 ! - ciopath : path for input/output fields to glt_gelato routine
354 !
355  CHARACTER(80) :: &
356  ciopath
357 !
358 !
359 ! 1.12. Parameters read in the namelist (not gltpar)
360 ! ---------------------------------------------------
361 ! - cn_grdname : grid name
362 ! - nn_readf : are we reading inpfld files as an input
363 ! - nn_fisrt : first iteration number
364 ! - nn_final : last iteration number
365 ! - nn_step : step between two iterations
366 ! - nn_iglo : number of cells along the x-axis
367 ! - nn_jglo : number of cells along the y-axis
368 ! - nn_perio : grid periodicity
369 ! - rn_htopoc : ocean uppermost grid cell thickness
370 !
371  CHARACTER(80) :: &
372  cn_grdname
373 INTEGER :: &
374  nn_readf, nn_first, nn_final, nn_step, nn_iglo, nn_jglo, nn_perio
375 REAL :: &
376  rn_htopoc
377 !
378 !
379 ! 2. Parameters computed from previous set
380 ! ========================================
381 !
382 ! 2.1. Vertical grid
383 ! -------------------
384 !
385 ! .. number of grid points in the ice+snow slab along the vertical
386 !
387 INTEGER :: &
388  nl
389 !
390 ! .. thickness of the different levels (from top to bottom)
391 !
392 REAL, DIMENSION(:), ALLOCATABLE :: &
393  sf3t,e3w
394 !
395 ! .. thickness of the different levels at t points (from bottom to top)
396 !
397 REAL, DIMENSION(:), ALLOCATABLE :: &
398  sf3tinv
399 !
400 ! .. depth of the different inter-levels (from top to bottom)
401 !
402 REAL, DIMENSION(:), ALLOCATABLE :: &
403  depth
404 !
405 ! .. height of the different inter-levels (from bottom to top)
406 !
407 REAL, DIMENSION(:), ALLOCATABLE :: &
408  height
409 !
410 !
411 ! 2.2. Diagnostics options
412 ! -------------------------
413 !
414 INTEGER :: &
415  ndiap1, ndiap2, ndiap3, ndiapx
416 !
417 !
418 ! 2.3. Parameters for EVP sea ice dynamics model
419 ! -----------------------------------------------
420 !
421 ! .. Full horizontal grid size (equivalent to NEMO's jpiglo,jpjglo)
422 !
423 INTEGER :: &
424  nxglo,nyglo
425 !
426 ! .. Subdomain dimensions (for advection)
427 !
428 INTEGER :: &
429  imt_local,jmt_local,ilo,jlo,ihi,jhi
430 !
431 ! .. Number of categories (advection)
432 !
433 INTEGER :: &
434  ncat
435 !
436 ! .. Number of ice layers (advection)
437 !
438 INTEGER :: &
439  nilyr
440 !
441 ! .. Number of categories by number of ice layers (advection)
442 !
443 INTEGER :: &
444  ntilay
445 !
446 ! .. Number of advected tracers
447 !
448 INTEGER :: &
449  na
450 !
451 !
452 !
453 ! 3. Parameters deduced from other initializations
454 ! =================================================
455 !
456 ! .. For use within Surfex
457 !
458 INTEGER :: &
459  nsurfex
460 !
461 ! .. Total size of the reduced grid ( defined at every time step)
462 !
463 INTEGER :: &
464  npt
465 !
466 ! .. Per process size of the reduced grid (defined at every time step)
467 !
468 INTEGER :: &
469  np
470 !
471 ! .. Number of categories considered in observations towards which damping is
472 ! applied
473 !
474 INTEGER :: &
475  ntd
476 ! .. Surface of the ocean sub-domain (never changes, computed in bnddmn)
477 !
478 REAL :: &
479  xdomsrf
480 !
481 ! .. Total surface of the ocean domain (never changes, computed in bnddmn)
482 !
483 REAL :: &
484  xdomsrf_g
485 !
486 ! .. Total surface of the reduced grid ocean domain (redefined at every
487 ! time step in thermo)
488 !
489 REAL :: &
490  xdomsrf_r
491 !
492 ! .. One input non-solar forcing flux per ice category (nt) or one input
493 ! non-solar flux to be shared between all the categories (1)
494 !
495 INTEGER :: &
496  nnflxin
497 !
498 !
499 !
500 ! 4. Parameters related to multi-processing
501 ! ==========================================
502 !
503 ! .. Are we multi-processed (using MPI)
504 LOGICAL :: &
505  lmpp
506 ! .. Do we print output file (gltout)
507 LOGICAL :: &
508  lwg
509 ! .. Print levels in gltout
510 LOGICAL :: &
511  lp1,lp2,lp3,lp4,lp5
512 ! .. What is the mpi multi-processing channel number
513 INTEGER :: &
514  gelato_communicator
515 ! .. Which are the leading process number, the current process number
516 ! the total number of procs for Gelato and OPA
517 INTEGER :: &
518  gelato_leadproc, gelato_myrank, gelato_nprocs
519 ! .. 2D subdomains definition
520 ! X size of current 2D subdomain
521 INTEGER :: &
522  nx
523 ! Y size of current 2D subdomain
524 INTEGER :: &
525  ny
526 ! Array of all X sizes of 2D subdomains (defined only at first time step)
527 ! This is the equivalent of nlcit(:) in NEMO
528 INTEGER, DIMENSION(:), ALLOCATABLE :: &
529  nxtab
530 ! Array of all Y sizes of 2D subdomains (defined only at first time step)
531 ! This is the equivalent of nlcjt(:) in NEMO
532 INTEGER, DIMENSION(:), ALLOCATABLE :: &
533  nytab
534 ! Index number of every grid point in the global grid (i,j)
535 INTEGER, DIMENSION(:,:), ALLOCATABLE :: &
536  nindi,nindj
537 !
538 !
539 !
540 ! 5. Parameters related to time
541 ! ==============================
542 !
543 INTEGER :: &
544  ntimnum
545 REAL :: &
546  xtime
547  CHARACTER(80) :: &
548  clabel
549 !
550 END MODULE modd_glt_param
551 !
552 ! ------------------------ END MODULE modd_glt_param ------------------------
553 ! -----------------------------------------------------------------------