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.
Changeset 12080 for utils/tools/SIREN/src/create_meshmask.f90 – NEMO

Ignore:
Timestamp:
2019-12-06T10:30:14+01:00 (4 years ago)
Author:
jpaul
Message:

update nemo trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • utils/tools/SIREN/src/create_meshmask.f90

    r9598 r12080  
    33!---------------------------------------------------------------------- 
    44! 
    5 ! PROGRAM: create_meshmask 
    6 ! 
    75! DESCRIPTION: 
    86!> @file 
    9 !> @brief  
     7!> @brief 
    108!>  This program creates the NetCDF file(s) which contain(s) all the 
    119!>  ocean domain informations. 
    12 !>  It allows to create the domain_cfg.nc file needed to run NEMO, or  
    13 !>  the mesh_mask file(s). 
     10!>  it also permits to create the domain_cfg.nc file (needed to run NEMO v4.0 
     11!>  and upper), or the mesh_mask file(s). 
    1412!> 
    1513!> @details 
    1614!> @section sec1 method 
    17 !>  Bathymetry (and optionally ice shelf draft) is read on input file.<br/> 
    18 !>  Horizontal grid-point position and scale factors, and the coriolis factor  
     15!>  bathymetry (and optionally ice shelf draft) is read on input file.<br/> 
     16!>  horizontal grid-point position, scale factors, and the coriolis factor  
    1917!>  are read in coordinates file or computed.<br/>  
    20 !>  Vertical coordinate is defined, and the bathymetry recomputed to fit the 
     18!>  vertical coordinate is defined, and the bathymetry recomputed to fit the 
    2119!>  vertical grid.<br/> 
    22 !>  Finally the masks from the bathymetry are computed. 
    23 !> 
    24 !>  All the arrays generated, are writen in one to three file(s) depending on 
     20!>  finally the masks from the bathymetry are computed. 
     21!> 
     22!>  all the variables read and or computed, are writen in one to three file(s) depending on 
    2523!>  output option. 
    26 !>  @note the file contain depends on 
    27 !>  the vertical coordinate used (z-coord, partial steps, s-coord) 
     24!>  @note  
     25!>    the file contain depends on 
     26!>    the vertical coordinate used (z-coord, partial steps, s-coord) 
    2827!> 
    2928!> @section sec2 how to 
    30 !>    to create domain_cfg or meshmask file:<br/> 
    31 !> @code{.sh} 
    32 !>    ./SIREN/bin/create_meshmask create_meshmask.nam 
    33 !> @endcode 
    34 !> 
    35 !> @note  
    36 !>    you could find a template of the namelist in templates directory. 
    37 !> 
    38 !>    create_meshmask.nam contains 13 namelists:<br/> 
    39 !>       - logger namelist (namlog) 
    40 !>       - config namelist (namcfg) 
    41 !>       - input files namelist (namin) 
    42 !>       - horizontal grid namelist (namhgr) 
    43 !>       - vertical grid namelist (namzgr) 
    44 !>       - minimum depth namelist (namdmin) 
    45 !>       - vertical coordinate namelist (namzco) 
    46 !>       - partial step namelist (namzps) 
    47 !>       - sigma or hybrid namelist (namsco) 
    48 !>       - lateral boundary condition namelist (namlbc) 
    49 !>       - wetting and dryong namelist (namwd) 
    50 !>       - grid namelist (namgrd) 
    51 !>       - output namelist (namout) 
    52 !> 
    53 !>    * _logger namelist (namlog)_:<br/> 
    54 !>       - cn_logfile   : log filename 
    55 !>       - cn_verbosity : verbosity ('trace','debug','info', 
    56 !> 'warning','error','fatal','none') 
    57 !>       - in_maxerror  : maximum number of error allowed 
    58 !> 
    59 !>    * _config namelist (namcfg)_:<br/> 
    60 !>       - cn_varcfg : variable configuration file 
    61 !> (see ./SIREN/cfg/variable.cfg). 
    62 !>       - cn_dimcfg : dimension configuration file. define dimensions allowed 
    63 !> (see ./SIREN/cfg/dimension.cfg). 
    64 !>       - cn_dumcfg : useless (dummy) configuration file, for useless  
    65 !> dimension or variable (see ./SIREN/cfg/dummy.cfg). 
    66 !> 
    67 !>    * _input files namelist (namin)_:<br/> 
    68 !>       - cn_bathy     : Bathymetry file 
    69 !>       - cn_varbathy  : Bathymetry variable name 
    70 !>       - cn_coord     : coordinate file (in_mshhgr=0) 
    71 !>       - cn_isfdep    : Iceshelf draft  (ln_isfcav=true) 
    72 !>       - cn_varisfdep : Iceshelf draft variable name (ln_isfcav=true) 
    73 !>       - in_perio     : NEMO periodicity 
    74 !>       - ln_closea    : 
    75 !> 
    76 !>    * _horizontal grid namelist (namhgr)_:<br/> 
    77 !>       - in_mshhgr   : type of horizontal mesh 
    78 !>         - 0: curvilinear coordinate on the sphere read in coordinate.nc 
    79 !>         - 1: geographical mesh on the sphere with regular grid-spacing 
    80 !>         - 2: f-plane with regular grid-spacing 
    81 !>         - 3: beta-plane with regular grid-spacing 
    82 !>         - 4: Mercator grid with T/U point at the equator 
    83 !>         - 5: beta-plane with regular grid-spacing and rotated domain (GYRE configuration) 
    84 !>       - dn_ppglam0  : longitude of first raw and column T-point (in_mshhgr = 1 or 4) 
    85 !>       - dn_ppgphi0  : latitude  of first raw and column T-point (in_mshhgr = 1 or 4) 
    86 !>       - dn_ppe1_deg : zonal      grid-spacing (degrees)         (in_mshhgr = 1,2,3 or 4) 
    87 !>       - dn_ppe2_deg : meridional grid-spacing (degrees)         (in_mshhgr = 1,2,3 or 4) 
    88 !> 
    89 !>    * _vertical grid namelist (namzgr)_:<br/> 
    90 !>       - ln_zco    : z-coordinate - full steps 
    91 !>       - ln_zps    : z-coordinate - partial steps 
    92 !>       - ln_sco    : s- or hybrid z-s-coordinate 
    93 !>       - ln_isfcav : ice shelf cavities 
    94 !>       - ln_iscpl  : coupling with ice sheet 
    95 !>       - ln_wd     : Wetting/drying activation 
    96 !>       - in_nlevel : number of vertical level 
    97 !> 
    98 !>    * _depth namelist (namdmin)_:<br/> 
    99 !>       - dn_hmin      : minimum ocean depth (>0) or minimum number of ocean levels (<0) 
    100 !>       - dn_isfhmin   : threshold to discriminate grounded ice to floating ice 
    101 !> 
    102 !>    * _vertical coordinate namelist (namzco)_:<br/> 
    103 !>       - dn_ppsur              : coefficient to compute vertical grid 
    104 !>       - dn_ppa0               : coefficient to compute vertical grid 
    105 !>       - dn_ppa1               : coefficient to compute vertical grid 
    106 !>       - dn_ppkth              : coefficient to compute vertical grid 
    107 !>       - dn_ppacr              : coefficient to compute vertical grid 
    108 !>       - ln_dbletanh           : use double tanh function for vertical coordinates 
    109 !>       - dn_ppa2               : double tanh function parameter 
    110 !>       - dn_ppkth2             : double tanh function parameter 
    111 !>       - dn_ppacr2             : double tanh function parameter 
    112 !>       - dn_ppdzmin            : minimum vertical spacing 
    113 !>       - dn_pphmax             : maximum depth 
    114 !> 
    115 !>     @note If *ppa1* and *ppa0* and *ppsur* are undefined 
    116 !>           NEMO will compute them from *ppdzmin* , *pphmax*, *ppkth*, *ppacr* 
    117 !> 
     29!> USAGE: create_meshmask create_meshmask.nam [-v] [-h]<br/> 
     30!>    - positional arguments:<br/> 
     31!>       - create_meshmask.nam<br/> 
     32!>          namelist of create_meshmask 
     33!>          @note 
     34!>             a template of the namelist could be created running (in templates directory): 
     35!>             @code{.sh} 
     36!>                python create_templates.py create_meshmask 
     37!>             @endcode 
     38!> 
     39!>    - optional arguments:<br/> 
     40!>       - -h, --help<br/> 
     41!>          show this help message (and exit)<br/> 
     42!>       - -v, --version<br/> 
     43!>          show Siren's version   (and exit) 
     44!> 
     45!> @section sec_meshmask create_meshmask.nam 
     46!>    create_meshmask.nam contains 13 sub-namelists:<br/> 
     47!>       - **namlog** to set logger parameters 
     48!>       - **namcfg** to set configuration file parameters 
     49!>       - **namsrc** to set source files parameters 
     50!>       - **namhgr** to set horizontal grid parameters 
     51!>       - **namzgr** to set vertical grid parameters 
     52!>       - **namdmin** to set minimum depth parameters 
     53!>       - **namzco** to set vertical coordinate parameters 
     54!>       - **namzps** to set partial step parameters 
     55!>       - **namsco** to set sigma or hybrid parameters 
     56!>       - **namlbc** to set lateral boundary condition parameters 
     57!>       - **namwd** to set wetting and drying parameters 
     58!>       - **namgrd** to set grid parameters 
     59!>       - **namout** to set output parameters 
     60!> 
     61!>    here after, each sub-namelist parameters is detailed. 
     62!>    @note  
     63!>       default values are specified between brackets 
     64!> 
     65!> @subsection sublog namlog 
     66!>    the logger sub-namelist parameters are : 
     67!> 
     68!>    - **cn_logfile** [@a create_meshmask.log]<br/> 
     69!>       logger filename 
     70!> 
     71!>    - **cn_verbosity** [@a warning]<br/> 
     72!>       verbosity level, choose between : 
     73!>          - trace 
     74!>          - debug 
     75!>          - info 
     76!>          - warning 
     77!>          - error 
     78!>          - fatal 
     79!>          - none 
     80!> 
     81!>    - **in_maxerror** [@a 5]<br/>  
     82!>       maximum number of error allowed 
     83!> 
     84!> @subsection subcfg namcfg 
     85!>    the configuration sub-namelist parameters are : 
     86!> 
     87!>    - **cn_varcfg** [@a ./cfg/variable.cfg]<br/> 
     88!>       path to the variable configuration file.<br/> 
     89!>       the variable configuration file defines standard name,  
     90!>       default interpolation method, axis,...  
     91!>       to be used for some known variables.<br/>  
     92!> 
     93!>    - **cn_dimcfg** [@a ./cfg/dimension.cfg]<br/>  
     94!>       path to the dimension configuration file.<br/>  
     95!>       the dimension configuration file defines dimensions allowed.<br/>  
     96!> 
     97!>    - **cn_dumcfg** [@a ./cfg/dummy.cfg]<br/>  
     98!>       path to the useless (dummy) configuration file.<br/> 
     99!>       the dummy configuration file defines useless  
     100!>       dimension or variable. these dimension(s) or variable(s) will not be 
     101!>       processed.<br/> 
     102!> 
     103!> @subsection subsrc namsrc  
     104!>    the source grid sub-namelist parameters are : 
     105!> 
     106!>    - **cn_bathy** [@a ]<br/> 
     107!>       path to the bathymetry file 
     108!>    - **cn_varbathy** [@a ]<br/> 
     109!>       bathymetry variable name 
     110!>    - **cn_coord** [@a ]<br/> 
     111!>       path to the coordinate file (in_mshhgr=0) 
     112!>    - **cn_isfdep** [@a ]<br/> 
     113!>       iceshelf draft  (ln_isfcav=true, see namzgr) 
     114!>    - **cn_varisfdep** [@a isfdraft]<br/> 
     115!>       iceshelf draft variable name (ln_isfcav=true, see namzgr) 
     116!>    - **in_perio** [@a ]<br/> 
     117!>       NEMO periodicity 
     118!>    - **ln_closea**  [@a .TRUE.]<br/> 
     119!>       logical to fill closed sea or not 
     120!> 
     121!> @subsection subhgr namhgr 
     122!>    the grid sub-namelist parameters are : 
     123!> 
     124!>    - **in_mshhgr** [@a 0]<br/> 
     125!>       type of horizontal mesh 
     126!>       - 0: curvilinear coordinate on the sphere read in coordinate.nc 
     127!>       - 1: geographical mesh on the sphere with regular grid-spacing 
     128!>       - 2: f-plane with regular grid-spacing 
     129!>       - 3: beta-plane with regular grid-spacing 
     130!>       - 4: Mercator grid with T/U point at the equator 
     131!>       - 5: beta-plane with regular grid-spacing and rotated domain (GYRE configuration) 
     132!>    - **dn_ppglam0** [@a ]<br/> 
     133!>       longitude of first raw and column T-point (in_mshhgr = 1 or 4) 
     134!>    - **dn_ppgphi0** [@a ]<br/> 
     135!>       latitude  of first raw and column T-point (in_mshhgr = 1 or 4) 
     136!>    - **dn_ppe1_deg** [@a ]<br/> 
     137!>       zonal      grid-spacing (degrees)         (in_mshhgr = 1,2,3 or 4) 
     138!>    - **dn_ppe2_deg** [@a ]<br/> 
     139!>       meridional grid-spacing (degrees)         (in_mshhgr = 1,2,3 or 4) 
     140!> 
     141!> 
     142!> @subsection subzgr namzgr 
     143!>    the vertical grid sub-namelist parameters are : 
     144!> 
     145!>    - **ln_zco** [@a .FALSE.]<br/> 
     146!>       z-coordinate - full steps 
     147!>    - **ln_zps** [@a .FALSE.]<br/> 
     148!>       z-coordinate - partial steps 
     149!>    - **ln_sco** [@a .FALSE.]<br/> 
     150!>       s- or hybrid z-s-coordinate 
     151!>    - **ln_isfcav** [@a .FALSE.]<br/> 
     152!>       ice shelf cavities 
     153!>    - **ln_iscpl** [@a .FALSE.]<br/> 
     154!>       coupling with ice sheet 
     155!>    - **ln_wd** [@a .FALSE.]<br/> 
     156!>       Wetting/drying activation 
     157!>    - **in_nlevel** [@a 75]<br/> 
     158!>       number of vertical level 
     159!> 
     160!> @subsection subdmin namdmin 
     161!>    the minimum depth sub-namelist parameters are : 
     162!> 
     163!>    - **dn_hmin** [@a ]<br/> 
     164!>       minimum ocean depth (>0) or minimum number of ocean levels (<0) 
     165!>    - **dn_isfhmin** [@a ]<br/> 
     166!>       threshold to discriminate grounded ice to floating ice 
     167!> 
     168!> @subsection subzco namzco 
     169!>    the vertical coordinate sub-namelist parameters are : 
     170!> 
     171!>    - **dn_pp_to_be_computed** [@a 0]<br/> 
     172!> 
     173!>    - **dn_ppsur** [@a -3958.951371276829]<br/> 
     174!>       coefficient to compute vertical grid 
     175!> 
     176!>    - **dn_ppa0** [@a 103.953009600000]<br/> 
     177!>       coefficient to compute vertical grid 
     178!> 
     179!>    - **dn_ppa1** [@a 2.415951269000]<br/> 
     180!>       coefficient to compute vertical grid 
     181!> 
     182!>    - **dn_ppkth** [@a 15.351013700000]<br/> 
     183!>       coefficient to compute vertical grid 
     184!> 
     185!>    - **dn_ppacr** [@a 7.000000000000]<br/> 
     186!>       coefficient to compute vertical grid 
     187!> 
     188!>    - **dn_ppdzmin** [@a 6.]<br/> 
     189!>       minimum vertical spacing 
     190!> 
     191!>    - **dn_pphmax** [@a 5750.]<br/> 
     192!>       maximum depth 
     193!> 
     194!>    - @b ln_dbletanh [@a .TRUE.]<br/> 
     195!>       use double tanh to compute vartical grid 
     196!> 
     197!>    - **dn_ppa2** [@a 100.760928500000]<br/> 
     198!>       double tanh function parameter 
     199!> 
     200!>    - **dn_ppkth2** [@a 48.029893720000]<br/> 
     201!>       double tanh function parameter 
     202!> 
     203!>    - **dn_ppacr2** [@a 13.000000000000]<br/> 
     204!>       double tanh function parameter 
     205!> 
     206!>     @note  
     207!>       If *dn_ppa1*, *dn_ppa0* and *dn_ppsur* are undefined, 
     208!>       NEMO will compute them from *dn_ppdzmin, dn_pphmax, dn_ppkth, dn_ppacr* 
     209!> 
     210!>    @warning 
    118211!>       this namelist is also needed to define partial steps, sigma or hybrid coordinate. 
    119212!> 
    120 !>    * _partial step namelist (namzps)_:<br/> 
    121 !>       - dn_e3zps_min          : minimum thickness of partial step level (meters) 
    122 !>       - dn_e3zps_rat          : minimum thickness ratio of partial step level 
    123 !> 
    124 !>    * _sigma or hybrid namelist (namsco)_:<br/> 
    125 !>       - ln_s_sh94    : use hybrid s-sig Song and Haidvogel 1994 stretching function fssig1 
    126 !>       - ln_s_sf12    : use hybrid s-z-sig Siddorn and Furner 2012 stretching function fgamma 
    127 !>       - dn_sbot_min  : minimum depth of s-bottom surface (>0) (m) 
    128 !>       - dn_sbot_max  : maximum depth of s-bottom surface (= ocean depth) (>0) (m) 
    129 !>       - dn_hc        : Critical depth for transition from sigma to stretched coordinates 
    130 !>       Song and Haidvogel 1994 stretching additional parameters 
    131 !>          - dn_rmax      : maximum cut-off r-value allowed (0<dn_rmax<1) 
    132 !>          - dn_theta     : surface control parameter (0<=dn_theta<=20) 
    133 !>          - dn_thetb     : bottom control parameter  (0<=dn_thetb<= 1) 
    134 !>          - dn_bb        : stretching parameter ( dn_bb=0; top only, dn_bb =1; top and bottom) 
    135 !>       Siddorn and Furner stretching additional parameters 
    136 !>          - ln_sigcrit   : switching to sigma (T) or Z (F) at H<Hc 
    137 !>          - dn_alpha     : stretchin parameter ( >1 surface; <1 bottom) 
    138 !>          - dn_efold     : e-fold length scale for transition region 
    139 !>          - dn_zs        : Surface cell depth (Zs) (m) 
    140 !>          Bottom cell (Zb) (m) = H*rn_zb_a + rn_zb_b' 
    141 !>          - dn_zb_a      : Bathymetry multiplier for Zb 
    142 !>          - dn_zb_b      : Offset for Zb 
    143 !> 
    144 !>    * _lateral boundary condition namelist (namlbc)_:<br/> 
    145 !>       - rn_shlat : lateral boundary conditions at the coast (modify fmask) 
    146 !>          -     shlat = 0 : free slip 
    147 !>          - 0 < shlat < 2 : partial slip  
    148 !>          -     shlat = 2 : no slip 
    149 !>          -     shlat > 2 : strong slip 
     213!> @subsection subzps namzps 
     214!>    the partial step sub-namelist parameters are : 
     215!> 
     216!>    - **dn_e3zps_min** [@a 25.]<br/> 
     217!>       minimum thickness of partial step level (meters) 
     218!>    - **dn_e3zps_rat** [@a 0.2]<br/> 
     219!>       minimum thickness ratio of partial step level 
     220!> 
     221!> 
     222!> @subsection subsco namsco 
     223!>    the sigma or hybrid sub-namelist parameters are : 
     224!> 
     225!>    - **ln_s_sh94** [@a .FALSE.]<br/> 
     226!>       use hybrid s-sig Song and Haidvogel 1994 stretching function fssig1 
     227!>    - **ln_s_sf12** [@a .FALSE.]<br/> 
     228!>       use hybrid s-z-sig Siddorn and Furner 2012 stretching function fgamma 
     229!>    - **dn_sbot_min** [@a ]<br/> 
     230!>       minimum depth of s-bottom surface (>0) (m) 
     231!>    - **dn_sbot_max** [@a ]<br/> 
     232!>       maximum depth of s-bottom surface (= ocean depth) (>0) (m) 
     233!>    - **dn_hc** [@a ]<br/> 
     234!>       Critical depth for transition from sigma to stretched coordinates 
     235!>    <br/> <br/> 
     236!>    Song and Haidvogel 1994 stretching additional parameters 
     237!>    - **dn_rmax** [@a ]<br/> 
     238!>       maximum cut-off r-value allowed (0<dn_rmax<1) 
     239!>    - **dn_theta** [@a ]<br/> 
     240!>       surface control parameter (0<=dn_theta<=20) 
     241!>    - **dn_thetb** [@a ]<br/> 
     242!>       bottom control parameter  (0<=dn_thetb<= 1) 
     243!>    - **dn_bb** [@a ]<br/> 
     244!>       stretching parameter ( dn_bb=0; top only, dn_bb =1; top and bottom) 
     245!>    <br/> <br/> 
     246!>    Siddorn and Furner stretching additional parameters 
     247!>    - **ln_sigcrit** [@a .FALSE.]<br/> 
     248!>       switching to sigma (T) or Z (F) at H<Hc 
     249!>    - **dn_alpha** [@a ]<br/> 
     250!>       stretchin parameter ( >1 surface; <1 bottom) 
     251!>    - **dn_efold** [@a ]<br/> 
     252!>       e-fold length scale for transition region 
     253!>    - **dn_zs** [@a ]<br/> 
     254!>       Surface cell depth (Zs) (m) 
     255!>       <br/> 
     256!>       Bottom cell (Zb) (m) = H*rn_zb_a + rn_zb_b' 
     257!>       - **dn_zb_a** [@a ]<br/> 
     258!>          Bathymetry multiplier for Zb 
     259!>       - **dn_zb_b** [@a ]<br/> 
     260!>          Offset for Zb 
     261!> 
     262!> @subsection sublbc namlbc 
     263!>    the lateral boundary condition sub-namelist parameters are : 
     264!> 
     265!>    - **rn_shlat** [@a 2.]<br/> 
     266!>       lateral boundary conditions at the coast (modify fmask) 
     267!>       -     shlat = 0 : free slip 
     268!>       - 0 < shlat < 2 : partial slip  
     269!>       -     shlat = 2 : no slip 
     270!>       -     shlat > 2 : strong slip 
     271!> 
    150272!>    for more information see Boundary Condition at the Coast  
    151 !>    in [NEMO documentation](http://www.nemo-ocean.eu/About-NEMO/Reference-manuals))  
    152 !> 
    153 !>    * _wetting and drying namelist (namwd)_:<br/> 
    154 !>       - dn_wdmin1    : minimum water depth on dried cells 
    155 !>       - dn_wdmin2    : tolerrance of minimum water depth on dried cells 
    156 !>       - dn_wdld      : land elevation below which wetting/drying 
    157 !>     
    158 !>    * _grid namelist (namgrd)_:<br/> 
    159 !>       - in_cfg    : inverse resolution of the configuration (1/4° => 4) 
    160 !>       - ln_bench  : GYRE (in_mshhgr = 5 ) used as Benchmark.<br/> 
    161 !>                     => forced the resolution to be about 100 km 
    162 !>       - ln_c1d    : use configuration 1D 
    163 !>       - ln_e3_dep : vertical scale factors =T: e3.=dk[depth] =F: old definition 
    164 !>    * _output namelist (namout)_:<br/> 
    165 !>       - cn_domcfg    : output file name 
    166 !>       - in_msh       : number of output file and contain (0-9) 
    167 !>       - in_nproc     : number of processor to be used 
    168 !>       - in_niproc    : i-direction number of processor 
    169 !>       - in_njproc    : j-direction numebr of processor 
     273!>    in [NEMO documentation](https://forge.ipsl.jussieu.fr/nemo/chrome/site/doc/NEMO/manual/pdf/NEMO_manual.pdf) 
     274!> 
     275!> @subsection subwd namwd 
     276!>    the wetting and drying sub-namelist parameters are : 
     277!> 
     278!>    - **dn_wdmin1** [@a ]<br/> 
     279!>       minimum water depth on dried cells 
     280!>    - **dn_wdmin2** [@a ]<br/> 
     281!>       tolerrance of minimum water depth on dried cells 
     282!>    - **dn_wdld** [@a ]<br/> 
     283!>       land elevation below which wetting/drying 
     284!> 
     285!> @subsection subgrd namgrd 
     286!>    the grid sub-namelist parameters are : 
     287!> 
     288!>    - **in_cfg** [@a 0]<br/> 
     289!>       inverse resolution of the configuration (1/4° => 4) 
     290!>    - **ln_bench** [@a .FALSE.]<br/> 
     291!>       GYRE (in_mshhgr = 5 ) used as Benchmark.<br/> 
     292!>       => forced the resolution to be about 100 km 
     293!>    - **ln_c1d** [@a .FALSE.]<br/> 
     294!>       use configuration 1D 
     295!>    - **ln_e3_dep** [@a .FALSE.]<br/> 
     296!>       vertical scale factors =T: e3.=dk[depth] =F: old definition 
     297!> 
     298!> @subsection subout namout 
     299!>    the output sub-namelist parameters are : 
     300!> 
     301!>    - **cn_domcfg** [@a domain_cfg.nc]<br/> 
     302!>       output file name 
     303!>    - **in_msh** [@a 0]<br/> 
     304!>       number of output file and contain (0-9) 
     305!>    - **in_nproc** [@a 1]<br/> 
     306!>       number of processor to be used 
     307!>    - **in_niproc** [@a 1]<br/> 
     308!>       i-direction number of processor 
     309!>    - **in_njproc** [@a 1]<br/> 
     310!>       j-direction numebr of processor 
     311!> 
     312!>       - if niproc, and njproc are provided : the program only look for land 
     313!>         processor to be removed 
     314!>       - if nproc is provided : the program compute each possible domain layout,  
     315!>         and save the one with the most land processor to be removed  
     316!>       - with no information about number of processors, the program 
     317!>         assume to use only one processor 
    170318!> 
    171319!>    @note 
     
    174322!>        - if MOD(in_msh, 3) = 2  : write '<b>mesh.nc</b>' and '<b>mask.nc</b>' files. 
    175323!>        - if MOD(in_msh, 3) = 0  : write '<b>mesh_hgr.nc</b>', '<b>mesh_zgr.nc</b>' and '<b>mask.nc</b>' files.<br/> 
    176 !>        For huge size domain, use option 2 or 3 depending on your vertical coordinate. 
    177 !>        - if     in_msh <= 3: write full 3D arrays for e3[tuvw] and gdep[tuvw] 
     324!>       For huge size domain, use option 2 or 3 depending on your vertical coordinate.<br/> 
     325!> 
     326!>    @note 
     327!>        - if 0 < in_msh <= 3: write full 3D arrays for e3[tuvw] and gdep[tuvw] 
    178328!>        - if 3 < in_msh <= 6: write full 3D arrays for e3[tuvw] and 2D arrays  
    179329!>                            corresponding to the depth of the bottom t- and w-points 
     
    181331!>                            thickness (e3[tw]_ps) of the bottom points 
    182332!> 
    183 !> @author 
    184 !> J.Paul 
    185 ! REVISION HISTORY: 
     333!> <hr> 
     334!> @author J.Paul 
     335!> 
    186336!> @date September, 2015 - Initial Version (based on domhgr.F90, domzgr.F90, domwri.F90) 
    187337!> @date October, 2016 
     
    193343!> @date November, 2016 
    194344!> - choose vertical scale factors (e3.=dk[depth] or old definition) 
    195 !> 
    196 !> @note Software governed by the CeCILL licence     (./LICENSE) 
     345!> @date January, 2019 
     346!> - add url path to global attributes of output file(s) 
     347!> @date February, 2019 
     348!> - rename sub namelist namin to namsrc 
     349!> @date Ocober, 2019 
     350!> - add help and version optional arguments 
     351!> 
     352!> @note Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt) 
    197353!---------------------------------------------------------------------- 
    198354PROGRAM create_meshmask 
     
    216372   IMPLICIT NONE 
    217373 
     374   ! parameters 
     375   CHARACTER(LEN=lc), PARAMETER  :: cp_myname = "create_meshmask" 
     376 
    218377   ! local variable 
     378   CHARACTER(LEN=lc)                              :: cl_arg 
    219379   CHARACTER(LEN=lc)                              :: cl_namelist 
    220380   CHARACTER(LEN=lc)                              :: cl_date 
     381   CHARACTER(LEN=lc)                              :: cl_url 
     382   CHARACTER(LEN=lc)                              :: cl_errormsg 
    221383 
    222384   INTEGER(i1), DIMENSION(:)        , ALLOCATABLE :: bl_tmp 
     
    285447   CHARACTER(LEN=lc) :: cn_dumcfg   = './cfg/dummy.cfg' 
    286448 
    287    ! namin 
     449   ! namsrc 
    288450   CHARACTER(LEN=lc) :: cn_bathy    = '' 
    289451   CHARACTER(LEN=lc) :: cn_varbathy = '' 
     
    317479   &  cn_logfile,    &  !< log file 
    318480   &  cn_verbosity,  &  !< log verbosity 
    319    &  in_maxerror 
     481   &  in_maxerror       !< logger maximum error 
    320482 
    321483   NAMELIST /namcfg/ &  !< configuration namelist 
    322    &  cn_varcfg, &       !< variable configuration file 
    323    &  cn_dimcfg, &       !< dimension configuration file 
    324    &  cn_dumcfg          !< dummy configuration file 
    325  
    326    NAMELIST /namin/  &  !< input namelist 
     484   &  cn_varcfg,     &  !< variable configuration file 
     485   &  cn_dimcfg,     &  !< dimension configuration file 
     486   &  cn_dumcfg         !< dummy configuration file 
     487 
     488   NAMELIST /namsrc/ &  !< source namelist 
    327489   &  cn_bathy,      &  !< Bathymetry file 
    328490   &  cn_varbathy,   &  !< Bathymetry variable name 
     
    353515   !-------------------------------------------------------------------    
    354516 
    355    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 
    356    !1- namelist 
    357    !1-1 get namelist 
     517   ! 
     518   ! Initialisation 
     519   ! -------------- 
     520   ! 
    358521   il_narg=COMMAND_ARGUMENT_COUNT() !f03 intrinsec 
    359    IF( il_narg/=1 )THEN 
    360       PRINT *,"ERROR in create_mask: need a namelist" 
    361       STOP 
     522 
     523   ! Traitement des arguments fournis 
     524   ! -------------------------------- 
     525   IF( il_narg /= 1 )THEN 
     526      WRITE(cl_errormsg,*) ' ERROR : one argument is needed ' 
     527      CALL fct_help(cp_myname,cl_errormsg)  
     528      CALL EXIT(1) 
    362529   ELSE 
    363       CALL GET_COMMAND_ARGUMENT(1,cl_namelist) !f03 intrinsec 
     530 
     531      CALL GET_COMMAND_ARGUMENT(1,cl_arg) !f03 intrinsec 
     532      SELECT CASE (cl_arg) 
     533         CASE ('-v', '--version') 
     534 
     535            CALL fct_version(cp_myname) 
     536            CALL EXIT(0) 
     537 
     538         CASE ('-h', '--help') 
     539 
     540            CALL fct_help(cp_myname) 
     541            CALL EXIT(0) 
     542 
     543         CASE DEFAULT 
     544 
     545            cl_namelist=cl_arg 
     546 
     547            ! read namelist 
     548            INQUIRE(FILE=TRIM(cl_namelist), EXIST=ll_exist) 
     549            IF( ll_exist )THEN 
     550 
     551               il_fileid=fct_getunit() 
     552 
     553               OPEN( il_fileid, FILE=TRIM(cl_namelist), & 
     554               &                FORM='FORMATTED',       & 
     555               &                ACCESS='SEQUENTIAL',    & 
     556               &                STATUS='OLD',           & 
     557               &                ACTION='READ',          & 
     558               &                IOSTAT=il_status) 
     559               CALL fct_err(il_status) 
     560               IF( il_status /= 0 )THEN 
     561                  WRITE(cl_errormsg,*) " ERROR : error opening "//TRIM(cl_namelist) 
     562                  CALL fct_help(cp_myname,cl_errormsg)  
     563                  CALL EXIT(1) 
     564               ENDIF 
     565 
     566               READ( il_fileid, NML = namlog ) 
     567  
     568               ! define logger file 
     569               CALL logger_open(TRIM(cn_logfile),TRIM(cn_verbosity),in_maxerror) 
     570               CALL logger_header() 
     571 
     572               READ( il_fileid, NML = namcfg ) 
     573               ! get variable extra information 
     574               CALL var_def_extra(TRIM(cn_varcfg)) 
     575 
     576               ! get dimension allowed 
     577               CALL dim_def_extra(TRIM(cn_dimcfg)) 
     578 
     579               ! get dummy variable 
     580               CALL var_get_dummy(TRIM(cn_dumcfg)) 
     581               ! get dummy dimension 
     582               CALL dim_get_dummy(TRIM(cn_dumcfg)) 
     583               ! get dummy attribute 
     584               CALL att_get_dummy(TRIM(cn_dumcfg)) 
     585 
     586               READ( il_fileid, NML = namsrc ) 
     587               READ( il_fileid, NML = namzgr ) 
     588               READ( il_fileid, NML = namlbc ) 
     589 
     590               READ( il_fileid, NML = namout  ) 
     591 
     592               CLOSE( il_fileid, IOSTAT=il_status ) 
     593               CALL fct_err(il_status) 
     594               IF( il_status /= 0 )THEN 
     595                  CALL logger_error("CREATE MASK: closing "//TRIM(cl_namelist)) 
     596               ENDIF 
     597 
     598            ELSE 
     599 
     600               WRITE(cl_errormsg,*) " ERROR : can't find "//TRIM(cl_namelist) 
     601               CALL fct_help(cp_myname,cl_errormsg)  
     602               CALL EXIT(1) 
     603 
     604            ENDIF 
     605 
     606      END SELECT 
    364607   ENDIF 
    365    !1-2 read namelist 
    366    INQUIRE(FILE=TRIM(cl_namelist), EXIST=ll_exist) 
    367    IF( ll_exist )THEN 
    368        
    369       il_fileid=fct_getunit() 
    370  
    371       OPEN( il_fileid, FILE=TRIM(cl_namelist), & 
    372       &                FORM='FORMATTED',       & 
    373       &                ACCESS='SEQUENTIAL',    & 
    374       &                STATUS='OLD',           & 
    375       &                ACTION='READ',          & 
    376       &                IOSTAT=il_status) 
    377       CALL fct_err(il_status) 
    378       IF( il_status /= 0 )THEN 
    379          PRINT *,"ERROR in create_mask: error opening "//TRIM(cl_namelist) 
    380          STOP 
    381       ENDIF 
    382  
    383       READ( il_fileid, NML = namlog ) 
    384       !1-2-1 define log file 
    385       CALL logger_open(TRIM(cn_logfile),TRIM(cn_verbosity),in_maxerror) 
    386       CALL logger_header() 
    387  
    388       READ( il_fileid, NML = namcfg ) 
    389       !1-2-2 get variable extra information 
    390       CALL var_def_extra(TRIM(cn_varcfg)) 
    391  
    392       ! get dimension allowed 
    393       CALL dim_def_extra(TRIM(cn_dimcfg)) 
    394  
    395       ! get dummy variable 
    396       CALL var_get_dummy(TRIM(cn_dumcfg)) 
    397       ! get dummy dimension 
    398       CALL dim_get_dummy(TRIM(cn_dumcfg)) 
    399       ! get dummy attribute 
    400       CALL att_get_dummy(TRIM(cn_dumcfg)) 
    401  
    402       READ( il_fileid, NML = namin   ) 
    403       READ( il_fileid, NML = namzgr  ) 
    404       READ( il_fileid, NML = namlbc  ) 
    405  
    406       READ( il_fileid, NML = namout  ) 
    407  
    408       CLOSE( il_fileid, IOSTAT=il_status ) 
    409       CALL fct_err(il_status) 
    410       IF( il_status /= 0 )THEN 
    411          CALL logger_error("CREATE MASK: closing "//TRIM(cl_namelist)) 
    412       ENDIF 
    413  
    414    ELSE 
    415  
    416       PRINT *,"ERROR in create_mask: can't find "//TRIM(cl_namelist) 
    417  
    418    ENDIF 
    419  
    420    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 
     608 
    421609   ll_domcfg=.FALSE. 
    422610   IF( in_msh == 0 )THEN 
     
    537725   ! compute masks 
    538726   WRITE(*,*) "COMPUTE MASK" 
    539    CALL create__mask(tl_namh,jpi,jpj,jpk,ll_domcfg) 
     727   CALL create_meshmask__mask(tl_namh,jpi,jpj,jpk,ll_domcfg) 
    540728 
    541729   ! Maximum stiffness ratio/hydrostatic consistency 
     
    573761      CASE ( 1 )                            !  create 'mesh_mask.nc' file 
    574762         !                                  ! ============================ 
    575          tl_mppout0=mpp_init( 'mesh_mask', tg_tmask, & 
     763         tl_mppout0=mpp_init( 'mesh_mask.nc', tg_tmask, & 
    576764         &                    in_niproc, in_njproc, in_nproc, & 
    577765         &                    cd_type=cn_type ) 
     
    585773         !                                  !         'mask.nc' files 
    586774         !                                  ! ============================ 
    587          tl_mppout0=mpp_init( 'mask', tg_tmask, & 
     775         tl_mppout0=mpp_init( 'mask.nc', tg_tmask, & 
    588776         &                    in_niproc, in_njproc, in_nproc, & 
    589777         &                    cd_type=cn_type ) 
    590          tl_mppout1=mpp_init( 'mesh', tg_tmask, & 
     778         tl_mppout1=mpp_init( 'mesh.nc', tg_tmask, & 
    591779         &                    in_niproc, in_njproc, in_nproc, & 
    592780         &                    cd_type=cn_type ) 
     
    601789         !                                  !         'mask.nc'     files 
    602790         !                                  ! ============================ 
    603          tl_mppout0=mpp_init( 'mask', tg_tmask, & 
     791         tl_mppout0=mpp_init( 'mask.nc', tg_tmask, & 
    604792         &                    in_niproc, in_njproc, in_nproc, & 
    605793         &                    cd_type=cn_type ) 
    606          tl_mppout1=mpp_init( 'mesh_hgr', tg_tmask, & 
     794         tl_mppout1=mpp_init( 'mesh_hgr.nc', tg_tmask, & 
    607795         &                    in_niproc, in_njproc, in_nproc, & 
    608796         &                    cd_type=cn_type ) 
    609          tl_mppout2=mpp_init( 'mesh_zgr', tg_tmask, & 
     797         tl_mppout2=mpp_init( 'mesh_zgr.nc', tg_tmask, & 
    610798         &                    in_niproc, in_njproc, in_nproc, & 
    611799         &                    cd_type=cn_type ) 
     
    10361224   ALLOCATE(tl_gatt(ip_maxatt)) 
    10371225 
    1038    tl_gatt(:) = create__gloatt(cn_bathy,cn_coord,cn_isfdep,tl_namh,tl_namz) 
     1226   tl_gatt(:) = create_meshmask__gloatt(cn_bathy,cn_coord,cn_isfdep,tl_namh,tl_namz) 
    10391227 
    10401228 
     
    10461234         CALL mpp_add_att(tl_mppmsk, tl_att) 
    10471235          
     1236         !add source url 
     1237         cl_url=fct_split(fct_split(cp_url,2,'$'),2,'URL:') 
     1238         tl_att=att_init("SIREN_url",cl_url) 
     1239         CALL mpp_add_att(tl_mppmsk, tl_att) 
     1240 
     1241         ! add date of creation 
    10481242         cl_date=date_print(date_now()) 
    10491243         tl_att=att_init("Creation_date",TRIM(cl_date)) 
     
    10921286         CALL mpp_add_att(tl_mpphgr, tl_att) 
    10931287          
     1288         !add source url 
     1289         cl_url=fct_split(fct_split(cp_url,2,'$'),2,'URL:') 
     1290         tl_att=att_init("SIREN_url",cl_url) 
     1291         CALL mpp_add_att(tl_mppmsk, tl_att) 
     1292         CALL mpp_add_att(tl_mpphgr, tl_att) 
     1293 
     1294         ! add date of creation 
    10941295         cl_date=date_print(date_now()) 
    10951296         tl_att=att_init("Creation_date",TRIM(cl_date)) 
     
    11571358         CALL mpp_add_att(tl_mppzgr, tl_att) 
    11581359          
     1360         !add source url 
     1361         cl_url=fct_split(fct_split(cp_url,2,'$'),2,'URL:') 
     1362         tl_att=att_init("SIREN_url",cl_url) 
     1363         CALL mpp_add_att(tl_mppmsk, tl_att) 
     1364         CALL mpp_add_att(tl_mpphgr, tl_att) 
     1365         CALL mpp_add_att(tl_mppzgr, tl_att) 
     1366 
     1367         ! add date of creation 
    11591368         cl_date=date_print(date_now()) 
    11601369         tl_att=att_init("Creation_date",TRIM(cl_date)) 
     
    12591468   CALL logger_close() 
    12601469CONTAINS 
     1470   !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
     1471   SUBROUTINE create_meshmask__mask(td_nam,jpi,jpj,jpk,ld_domcfg)  
    12611472   !------------------------------------------------------------------- 
    12621473   !> @brief This subroutine compute land/ocean mask arrays at tracer points,  
     
    12661477   !> @details 
    12671478   !> 
    1268    !> ** Method  :   The ocean/land mask is computed from the basin bathymetry in level (mbathy) which is defined or read in dommba. 
     1479   !> ** Method  :   The ocean/land mask is computed from the basin bathymetry in level (mbathy)  
     1480   !>      which is defined or read in dommba. 
    12691481   !>      mbathy equals 0 over continental T-point and the number of ocean level over the ocean. 
    12701482   !> 
     
    13241536   !> @param[in] jpk 
    13251537   !------------------------------------------------------------------- 
    1326    SUBROUTINE create__mask(td_nam,jpi,jpj,jpk,ld_domcfg)  
     1538 
    13271539      IMPLICIT NONE 
     1540 
    13281541      ! Argument       
    13291542      TYPE(TNAMH), INTENT(IN) :: td_nam 
     
    16081821!      DEALLOCATE( dl_fpol ) 
    16091822       
    1610    END SUBROUTINE create__mask 
     1823   END SUBROUTINE create_meshmask__mask 
     1824   !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
     1825   FUNCTION create_meshmask__gloatt(cd_bathy,cd_coord,cd_isfdep,td_namh,td_namz) & 
     1826         & RESULT(tf_att) 
    16111827   !------------------------------------------------------------------- 
    16121828   !> @brief  
     
    16221838   !> @param[in] td_namz 
    16231839   !------------------------------------------------------------------- 
    1624    FUNCTION create__gloatt(cd_bathy,cd_coord,cd_isfdep,td_namh,td_namz) RESULT(td_att) 
     1840 
    16251841      IMPLICIT NONE 
     1842 
    16261843      ! Argument       
    1627       CHARACTER(LEN=*), INTENT(IN   ) :: cd_bathy  
    1628       CHARACTER(LEN=*), INTENT(IN   ) :: cd_coord  
    1629       CHARACTER(LEN=*), INTENT(IN   ) :: cd_isfdep  
    1630       TYPE(TNAMH)     , INTENT(IN   ) :: td_namh  
    1631       TYPE(TNAMZ)     , INTENT(IN   ) :: td_namz  
     1844      CHARACTER(LEN=*), INTENT(IN   )  :: cd_bathy  
     1845      CHARACTER(LEN=*), INTENT(IN   )  :: cd_coord  
     1846      CHARACTER(LEN=*), INTENT(IN   )  :: cd_isfdep  
     1847      TYPE(TNAMH)     , INTENT(IN   )  :: td_namh  
     1848      TYPE(TNAMZ)     , INTENT(IN   )  :: td_namz  
    16321849 
    16331850      ! function 
    1634       TYPE(TATT), DIMENSION(ip_maxatt) :: td_att 
     1851      TYPE(TATT), DIMENSION(ip_maxatt) :: tf_att 
    16351852 
    16361853      ! loop indices 
     
    16381855      !---------------------------------------------------------------- 
    16391856 
    1640       ji=1    ; td_att(ji)=att_init("src_bathy",TRIM(cd_bathy)) 
     1857      ji=1    ; tf_att(ji)=att_init("src_bathy",TRIM(cd_bathy)) 
    16411858      ! horizontal grid 
    1642       ji=ji+1 ; td_att(ji)=att_init("in_mshhgr",td_namh%i_mshhgr) 
     1859      ji=ji+1 ; tf_att(ji)=att_init("in_mshhgr",td_namh%i_mshhgr) 
    16431860      SELECT CASE(td_namh%i_mshhgr) 
    16441861         CASE(0) 
    1645             ji=ji+1 ; td_att(ji)=att_init("src_coord",TRIM(cd_coord)) 
     1862            ji=ji+1 ; tf_att(ji)=att_init("src_coord",TRIM(cd_coord)) 
    16461863         CASE(1,4) 
    1647             ji=ji+1 ; td_att(ji)=att_init("ppglam0",td_namh%d_ppglam0) 
    1648             ji=ji+1 ; td_att(ji)=att_init("ppgphi0",td_namh%d_ppgphi0) 
     1864            ji=ji+1 ; tf_att(ji)=att_init("ppglam0",td_namh%d_ppglam0) 
     1865            ji=ji+1 ; tf_att(ji)=att_init("ppgphi0",td_namh%d_ppgphi0) 
    16491866         CASE(2,3) 
    1650             ji=ji+1 ; td_att(ji)=att_init("ppglam0",td_namh%d_ppglam0) 
    1651             ji=ji+1 ; td_att(ji)=att_init("ppgphi0",td_namh%d_ppgphi0) 
    1652             ji=ji+1 ; td_att(ji)=att_init("ppe1_deg",td_namh%d_ppe1_deg) 
    1653             ji=ji+1 ; td_att(ji)=att_init("ppe2_deg",td_namh%d_ppe2_deg) 
     1867            ji=ji+1 ; tf_att(ji)=att_init("ppglam0",td_namh%d_ppglam0) 
     1868            ji=ji+1 ; tf_att(ji)=att_init("ppgphi0",td_namh%d_ppgphi0) 
     1869            ji=ji+1 ; tf_att(ji)=att_init("ppe1_deg",td_namh%d_ppe1_deg) 
     1870            ji=ji+1 ; tf_att(ji)=att_init("ppe2_deg",td_namh%d_ppe2_deg) 
    16541871      END SELECT 
    16551872 
    16561873      IF( td_namz%l_isfcav )THEN 
    1657          ji=ji+1 ; td_att(ji)=att_init("ice_shelf_cavities","activated") 
    1658          ji=ji+1 ; td_att(ji)=att_init("src_isfdep",TRIM(cd_isfdep)) 
     1874         ji=ji+1 ; tf_att(ji)=att_init("ice_shelf_cavities","activated") 
     1875         ji=ji+1 ; tf_att(ji)=att_init("src_isfdep",TRIM(cd_isfdep)) 
    16591876      ENDIF 
    16601877      IF( td_namz%l_iscpl )THEN 
    1661          ji=ji+1 ; td_att(ji)=att_init("ice_sheet_coupling","activated") 
     1878         ji=ji+1 ; tf_att(ji)=att_init("ice_sheet_coupling","activated") 
    16621879      ENDIF 
    16631880 
    16641881      ! vertical grid 
    16651882      IF( td_namz%l_zco )THEN 
    1666          ji=ji+1 ; td_att(ji)=att_init("z_coord","full steps") 
     1883         ji=ji+1 ; tf_att(ji)=att_init("z_coord","full steps") 
    16671884      ENDIF 
    16681885      IF( td_namz%l_zps )THEN 
    1669          ji=ji+1 ; td_att(ji)=att_init("z_coord","partial steps") 
     1886         ji=ji+1 ; tf_att(ji)=att_init("z_coord","partial steps") 
    16701887      ENDIF 
    16711888      IF( td_namz%l_sco )THEN 
    16721889         IF( td_namz%l_s_sh94 )THEN 
    1673             ji=ji+1 ; td_att(ji)=att_init("z_coord","hybrid Song and Haidvogel 1994") 
     1890            ji=ji+1 ; tf_att(ji)=att_init("z_coord","hybrid Song and Haidvogel 1994") 
    16741891         ELSEIF( td_namz%l_s_sf12 )THEN 
    1675             ji=ji+1 ; td_att(ji)=att_init("z_coord","hybrid Siddorn and Furner 2012") 
     1892            ji=ji+1 ; tf_att(ji)=att_init("z_coord","hybrid Siddorn and Furner 2012") 
    16761893         ELSE 
    1677             ji=ji+1 ; td_att(ji)=att_init("z_coord","sigma") 
     1894            ji=ji+1 ; tf_att(ji)=att_init("z_coord","sigma") 
    16781895         ENDIF 
    16791896      ENDIF 
    1680       ji=ji+1 ; td_att(ji)=att_init("hmin",td_namz%d_hmin) 
    1681       IF( td_namz%l_isfcav ) ji=ji+1 ; td_att(ji)=att_init("isfhmin",td_namz%d_isfhmin) 
     1897      ji=ji+1 ; tf_att(ji)=att_init("hmin",td_namz%d_hmin) 
     1898      IF( td_namz%l_isfcav ) ji=ji+1 ; tf_att(ji)=att_init("isfhmin",td_namz%d_isfhmin) 
    16821899 
    16831900      ! zco 
    16841901      IF( td_namz%d_ppsur /= NF90_FILL_DOUBLE )THEN 
    1685          ji=ji+1 ; td_att(ji)=att_init("ppsur",td_namz%d_ppsur) 
     1902         ji=ji+1 ; tf_att(ji)=att_init("ppsur",td_namz%d_ppsur) 
    16861903      ELSE 
    1687          ji=ji+1 ; td_att(ji)=att_init("ppsur","to_be_computed") 
     1904         ji=ji+1 ; tf_att(ji)=att_init("ppsur","to_be_computed") 
    16881905      ENDIF 
    16891906      IF( td_namz%d_ppa0 /= NF90_FILL_DOUBLE )THEN 
    1690          ji=ji+1 ; td_att(ji)=att_init("ppa0",td_namz%d_ppa0) 
     1907         ji=ji+1 ; tf_att(ji)=att_init("ppa0",td_namz%d_ppa0) 
    16911908      ELSE 
    1692          ji=ji+1 ; td_att(ji)=att_init("ppa0","to_be_computed") 
     1909         ji=ji+1 ; tf_att(ji)=att_init("ppa0","to_be_computed") 
    16931910      ENDIF 
    16941911      IF( td_namz%d_ppa1 /= NF90_FILL_DOUBLE )THEN 
    1695          ji=ji+1 ; td_att(ji)=att_init("ppa1",td_namz%d_ppa1) 
     1912         ji=ji+1 ; tf_att(ji)=att_init("ppa1",td_namz%d_ppa1) 
    16961913      ELSE 
    1697          ji=ji+1 ; td_att(ji)=att_init("ppa1","to_be_computed") 
    1698       ENDIF 
    1699  
    1700       ji=ji+1 ; td_att(ji)=att_init("ppkth",td_namz%d_ppkth) 
    1701       ji=ji+1 ; td_att(ji)=att_init("ppacr",td_namz%d_ppacr) 
    1702       ji=ji+1 ; td_att(ji)=att_init("ppdzmin",td_namz%d_ppdzmin) 
    1703       ji=ji+1 ; td_att(ji)=att_init("pphmax",td_namz%d_pphmax) 
     1914         ji=ji+1 ; tf_att(ji)=att_init("ppa1","to_be_computed") 
     1915      ENDIF 
     1916 
     1917      ji=ji+1 ; tf_att(ji)=att_init("ppkth",td_namz%d_ppkth) 
     1918      ji=ji+1 ; tf_att(ji)=att_init("ppacr",td_namz%d_ppacr) 
     1919      ji=ji+1 ; tf_att(ji)=att_init("ppdzmin",td_namz%d_ppdzmin) 
     1920      ji=ji+1 ; tf_att(ji)=att_init("pphmax",td_namz%d_pphmax) 
    17041921 
    17051922      IF( td_namz%l_dbletanh )THEN 
    1706          ji=ji+1 ; td_att(ji)=att_init("ppa2",td_namz%d_ppa2) 
    1707          ji=ji+1 ; td_att(ji)=att_init("ppkth2",td_namz%d_ppkth2) 
    1708          ji=ji+1 ; td_att(ji)=att_init("ppacr2",td_namz%d_ppacr2) 
     1923         ji=ji+1 ; tf_att(ji)=att_init("ppa2",td_namz%d_ppa2) 
     1924         ji=ji+1 ; tf_att(ji)=att_init("ppkth2",td_namz%d_ppkth2) 
     1925         ji=ji+1 ; tf_att(ji)=att_init("ppacr2",td_namz%d_ppacr2) 
    17091926      ENDIF 
    17101927 
    17111928      IF( td_namz%l_zps )THEN 
    1712          ji=ji+1 ; td_att(ji)=att_init("e3zps_min",td_namz%d_e3zps_min) 
    1713          ji=ji+1 ; td_att(ji)=att_init("e3zps_rat",td_namz%d_e3zps_rat) 
     1929         ji=ji+1 ; tf_att(ji)=att_init("e3zps_min",td_namz%d_e3zps_min) 
     1930         ji=ji+1 ; tf_att(ji)=att_init("e3zps_rat",td_namz%d_e3zps_rat) 
    17141931      ENDIF 
    17151932 
    17161933      IF( td_namz%l_sco )THEN 
    1717          ji=ji+1 ; td_att(ji)=att_init("sbot_min",td_namz%d_sbot_min) 
    1718          ji=ji+1 ; td_att(ji)=att_init("sbot_max",td_namz%d_sbot_max) 
    1719          ji=ji+1 ; td_att(ji)=att_init("hc",td_namz%d_hc) 
     1934         ji=ji+1 ; tf_att(ji)=att_init("sbot_min",td_namz%d_sbot_min) 
     1935         ji=ji+1 ; tf_att(ji)=att_init("sbot_max",td_namz%d_sbot_max) 
     1936         ji=ji+1 ; tf_att(ji)=att_init("hc",td_namz%d_hc) 
    17201937         IF( td_namz%l_s_sh94 )THEN 
    1721             ji=ji+1 ; td_att(ji)=att_init("rmax",td_namz%d_rmax) 
    1722             ji=ji+1 ; td_att(ji)=att_init("theta",td_namz%d_theta) 
    1723             ji=ji+1 ; td_att(ji)=att_init("thetb",td_namz%d_thetb) 
    1724             ji=ji+1 ; td_att(ji)=att_init("bb",td_namz%d_bb) 
     1938            ji=ji+1 ; tf_att(ji)=att_init("rmax",td_namz%d_rmax) 
     1939            ji=ji+1 ; tf_att(ji)=att_init("theta",td_namz%d_theta) 
     1940            ji=ji+1 ; tf_att(ji)=att_init("thetb",td_namz%d_thetb) 
     1941            ji=ji+1 ; tf_att(ji)=att_init("bb",td_namz%d_bb) 
    17251942         ELSEIF( td_namz%l_s_sf12 )THEN 
    1726             IF( td_namz%l_sigcrit ) ji=ji+1 ; td_att(ji)=att_init("sigma_below_critical_depth","activated") 
    1727             ji=ji+1 ; td_att(ji)=att_init("alpha",td_namz%d_alpha) 
    1728             ji=ji+1 ; td_att(ji)=att_init("efold",td_namz%d_efold) 
    1729             ji=ji+1 ; td_att(ji)=att_init("zs",td_namz%d_zs) 
    1730             ji=ji+1 ; td_att(ji)=att_init("zb_a",td_namz%d_zb_a) 
    1731             ji=ji+1 ; td_att(ji)=att_init("zb_b",td_namz%d_zb_b) 
     1943            IF( td_namz%l_sigcrit ) ji=ji+1 ; tf_att(ji)=att_init("sigma_below_critical_depth","activated") 
     1944            ji=ji+1 ; tf_att(ji)=att_init("alpha",td_namz%d_alpha) 
     1945            ji=ji+1 ; tf_att(ji)=att_init("efold",td_namz%d_efold) 
     1946            ji=ji+1 ; tf_att(ji)=att_init("zs",td_namz%d_zs) 
     1947            ji=ji+1 ; tf_att(ji)=att_init("zb_a",td_namz%d_zb_a) 
     1948            ji=ji+1 ; tf_att(ji)=att_init("zb_b",td_namz%d_zb_b) 
    17321949         ENDIF 
    17331950      ENDIF 
    17341951 
    17351952      IF( td_namz%l_wd )THEN 
    1736          ji=ji+1 ; td_att(ji)=att_init("wetting_drying","activated") 
     1953         ji=ji+1 ; tf_att(ji)=att_init("wetting_drying","activated") 
    17371954      ENDIF 
    17381955 
    17391956      IF( td_namz%l_wd )THEN 
    1740          ji=ji+1 ; td_att(ji)=att_init("wdmin1",td_namz%d_wdmin1) 
    1741          ji=ji+1 ; td_att(ji)=att_init("wdmin2",td_namz%d_wdmin2) 
    1742          ji=ji+1 ; td_att(ji)=att_init("wdld",td_namz%d_wdld) 
    1743       ENDIF 
    1744        
    1745    END FUNCTION create__gloatt 
    1746  
     1957         ji=ji+1 ; tf_att(ji)=att_init("wdmin1",td_namz%d_wdmin1) 
     1958         ji=ji+1 ; tf_att(ji)=att_init("wdmin2",td_namz%d_wdmin2) 
     1959         ji=ji+1 ; tf_att(ji)=att_init("wdld",td_namz%d_wdld) 
     1960      ENDIF 
     1961  
     1962   END FUNCTION create_meshmask__gloatt 
     1963   !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    17471964END PROGRAM 
Note: See TracChangeset for help on using the changeset viewer.