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 7390 – NEMO

Changeset 7390


Ignore:
Timestamp:
2016-11-30T14:21:17+01:00 (7 years ago)
Author:
cbricaud
Message:

merge party 2016: merge MERCATOR branch in CNRS_MERCATOR branch

Location:
branches/2016/dev_CNRS_MERCATOR_2016/NEMOGCM/TOOLS/SIREN
Files:
1 deleted
27 edited
8 copied

Legend:

Unmodified
Added
Removed
  • branches/2016/dev_CNRS_MERCATOR_2016/NEMOGCM/TOOLS/SIREN/README

    r5037 r7390  
    1 This is a first release of SIREN. 
    21 
    3 To create SIREN documentation, go to ./src and run doxygen  
     2To create SIREN documentation, run doxygen in TOOLS/SIREN directory  
    43(http://www.stack.nl/~dimitri/doxygen/index.html version 1.8.3.1 or upper) 
    54then 
    6    open ../doc/index.html  
     5   open ./TOOLS/SIREN/doc/html/index.html in your web browser 
    76or  
    8    run ../doc/latex/gmake and open refman.pdf  
    9  
    10  
    11 templates of namelists could be find in templates directory. 
    12 read documentation for more information. 
    13  
    14  1- program to create coordinate file : 
    15  
    16    ./create_coord create_coord.nam 
    17  
    18  
    19  Variables are extracted from the input coordinates coarse grid and 
    20  interpolated to create fine coordinates files. 
    21  
    22  2- program to create bathymetry file: 
    23  
    24  ./create_bathy create_bathy.nam 
    25  
    26  Bathymetry could be extracted from fine grid Bathymetry file, or 
    27  interpolated from coarse grid Bathymetry file. 
    28  
    29  3- program to merge bathymetry file at boundaries : 
    30  
    31  ./merge_bathy merge_bathy.nam 
    32  
    33  Coarse grid Bathymetry is interpolated on fine grid. 
    34  Then fine Bathymetry and refined coarse bathymetry are merged at 
    35  boundaries. 
    36  
    37  4- program to create restart file : 
    38  
    39  ./create_restart create_restart.nam 
    40  
    41  Variables are read from restart file, or standard output. 
    42  Then theses variables are interpolated on fine grid. 
    43  Finally table are split over new decomposition. 
    44  
    45  5- program to create boundary files (OBC) : 
    46  
    47  ./create_boundary create_boundary.nam 
    48  
    49  Variables are read from standard output. 
    50  Then theses variables are interpolated on fine grid boundaries. 
     7   run gmake in ./TOOLS/SIREN/doc/latex directory and open ./TOOLS/SIREN/doc/latex/refman.pdf  
  • branches/2016/dev_CNRS_MERCATOR_2016/NEMOGCM/TOOLS/SIREN/cfg/dummy.cfg

    r6393 r7390  
    11&namdum 
    2    cn_dumvar="" 
     2   cn_dumvar="orca_lon", "orca_lat", "time_instant", "time_centered" 
    33   cn_dumdim="" 
    44   cn_dumatt="history" 
  • branches/2016/dev_CNRS_MERCATOR_2016/NEMOGCM/TOOLS/SIREN/cfg/variable.cfg

    r6393 r7390  
    88nav_lev      | model_levels   | Z    | T | cubic           | Model levels                          |                                   
    99deptht       | m              | Z    | T |                 | Vertical T levels                     | depth                             
     10ncatice      | 1              | Z    | T |                 | Ice category                          | num_icecat_coordinate 
    1011time_counter |                | T    |   |                 | Time axis                             | time                              
    1112Bathymetry   | m              | XY   | T | cubic           | Bathymetry                            | bathymetry                        
     
    108109kz           |                | XYZT | T |                 |                                       |                                   
    109110irondep      |                | XYZT | T |                 |                                       |                                   
     111sivelu       | m/s            | XYT  | T |                 | Ice velocity along i-axis at I-point  | sea_ice_x_velocity 
     112sivelv       | m/s            | XYT  | T |                 | Ice velocity along j-axis at I-point  | sea_ice_y_velocity 
     113siconcat     | %              | XYZT | T |                 | Ice concentration for categories      | sea_ice_cat_concentration 
     114sithicat     | m              | XYZT | T |                 | Ice thickness for categories          | sea_ice_cat_icethickness 
     115snthicat     | m              | XYZT | T |                 | Snow thickness for categories         | sea_ice_cat_snowthickness 
    110116kt_ice       |                |      |   |                 |                                       |                                   
    111117hicif        |                |      |   |                 |                                       |                                   
  • branches/2016/dev_CNRS_MERCATOR_2016/NEMOGCM/TOOLS/SIREN/src/attribute.f90

    r6393 r7390  
    141141   END TYPE TATT 
    142142 
    143    CHARACTER(LEN=lc), DIMENSION(ip_maxdum), SAVE :: cm_dumatt !< dummy attribute 
     143   CHARACTER(LEN=lc), DIMENSION(ip_maxdumcfg), SAVE :: cm_dumatt !< dummy attribute 
    144144 
    145145   INTERFACE att_init 
     
    12821282      ! loop indices 
    12831283      ! namelist 
    1284       CHARACTER(LEN=lc), DIMENSION(ip_maxdum) :: cn_dumvar 
    1285       CHARACTER(LEN=lc), DIMENSION(ip_maxdum) :: cn_dumdim 
    1286       CHARACTER(LEN=lc), DIMENSION(ip_maxdum) :: cn_dumatt 
     1284      CHARACTER(LEN=lc), DIMENSION(ip_maxdumcfg) :: cn_dumvar 
     1285      CHARACTER(LEN=lc), DIMENSION(ip_maxdumcfg) :: cn_dumdim 
     1286      CHARACTER(LEN=lc), DIMENSION(ip_maxdumcfg) :: cn_dumatt 
    12871287 
    12881288      !---------------------------------------------------------------- 
     
    13451345 
    13461346      att_is_dummy=.FALSE. 
    1347       DO ji=1,ip_maxdum 
     1347      DO ji=1,ip_maxdumcfg 
    13481348         IF( fct_lower(td_att%c_name) == fct_lower(cm_dumatt(ji)) )THEN 
    13491349            att_is_dummy=.TRUE. 
  • branches/2016/dev_CNRS_MERCATOR_2016/NEMOGCM/TOOLS/SIREN/src/boundary.f90

    r6393 r7390  
    15291529   !> @author J.Paul  
    15301530   !> @date November, 2013 - Initial Version  
    1531    !  
     1531   !> @date June, 2016 
     1532   !> - Bug fix: take into account that boundaries are compute on T point, 
     1533   !>   but expressed on U,V point 
     1534   !> 
    15321535   !> @param[inout] td_bdy boundary structure  
    15331536   !> @param[in] td_var    variable structure  
     
    15521555      il_max(jp_west )=td_var%t_dim(2)%i_len 
    15531556  
    1554       il_maxindex(jp_north)=td_var%t_dim(2)%i_len-ip_ghost 
     1557      ! index expressed on U,V point, move on T point. 
     1558      il_maxindex(jp_north)=td_var%t_dim(2)%i_len-ip_ghost+1 
    15551559      il_maxindex(jp_south)=td_var%t_dim(2)%i_len-ip_ghost 
    1556       il_maxindex(jp_east )=td_var%t_dim(1)%i_len-ip_ghost 
     1560      il_maxindex(jp_east )=td_var%t_dim(1)%i_len-ip_ghost+1 
    15571561      il_maxindex(jp_west )=td_var%t_dim(1)%i_len-ip_ghost 
    15581562 
  • branches/2016/dev_CNRS_MERCATOR_2016/NEMOGCM/TOOLS/SIREN/src/create_bathy.f90

    r6393 r7390  
    2222!> <br/>     
    2323!> \image html  bathy_40.png  
    24 !> \image latex bathy_30.png 
     24!> <center>\image latex bathy_30.png 
     25!> </center> 
    2526!> 
    2627!> @note  
     
    4546!>       - cn_varcfg : variable configuration file  
    4647!> (see ./SIREN/cfg/variable.cfg) 
     48!>       - cn_dimcfg : dimension configuration file. defines dimension allowed 
     49!> (see ./SIREN/cfg/dimension.cfg). 
    4750!>       - cn_dumcfg : useless (dummy) configuration file, for useless  
    4851!> dimension or variable (see ./SIREN/cfg/dummy.cfg). 
     
    133136!> @date February, 2016 
    134137!> - do not closed sea for east-west cyclic domain 
     138!> @date October, 2016 
     139!> - dimension to be used select from configuration file 
    135140! 
    136141!> @todo 
     
    218223   ! namcfg 
    219224   CHARACTER(LEN=lc)                       :: cn_varcfg = './cfg/variable.cfg'  
     225   CHARACTER(LEN=lc)                       :: cn_dimcfg = './cfg/dimension.cfg'  
    220226   CHARACTER(LEN=lc)                       :: cn_dumcfg = './cfg/dummy.cfg'  
    221227 
     
    248254   NAMELIST /namcfg/ &   !< configuration namelist 
    249255   &  cn_varcfg, &       !< variable configuration file 
     256   &  cn_dimcfg, &       !< dimension configuration file 
    250257   &  cn_dumcfg          !< dummy configuration file 
    251258 
     
    307314      ! get variable extra information 
    308315      CALL var_def_extra(TRIM(cn_varcfg)) 
     316 
     317      ! get dimension allowed 
     318      CALL dim_def_extra(TRIM(cn_dimcfg)) 
    309319 
    310320      ! get dummy variable 
     
    614624   CALL mpp_clean(tl_coord1) 
    615625   CALL mpp_clean(tl_coord0) 
     626   CALL var_clean_extra() 
    616627 
    617628   ! close log file 
  • branches/2016/dev_CNRS_MERCATOR_2016/NEMOGCM/TOOLS/SIREN/src/create_boundary.F90

    r6393 r7390  
    2626!>  <br/>  
    2727!> \image html  boundary_NEATL36_70.png  
    28 !> \image latex boundary_NEATL36_70.png 
     28!> <center>\image latex boundary_NEATL36_70.png 
     29!> </center> 
    2930!> 
    3031!> @note  
     
    5152!>       - cn_varcfg : variable configuration file 
    5253!> (see ./SIREN/cfg/variable.cfg) 
     54!>       - cn_dimcfg : dimension configuration file. define dimensions allowed 
     55!> (see ./SIREN/cfg/dimension.cfg). 
    5356!>       - cn_dumcfg : useless (dummy) configuration file, for useless  
    5457!> dimension or variable (see ./SIREN/cfg/dummy.cfg). 
     
    6568!> 
    6669!>    * _vertical grid namelist (namzgr)_:<br/> 
    67 !>       - dn_pp_to_be_computed  : 
    6870!>       - dn_ppsur              : 
    6971!>       - dn_ppa0               : 
     
    161163!>             - cn_north='index1(width),first1:last1|index2,first2:last2' 
    162164!>             \image html  boundary_50.png  
    163 !>             \image latex boundary_50.png 
     165!>             <center>\image latex boundary_50.png 
     166!>             </center> 
    164167!>       - cn_south  : south boundary indices on fine grid 
    165168!>       - cn_east   : east  boundary indices on fine grid 
     
    198201!> @date January, 2016 
    199202!> - same process use for variable extracted or interpolated from input file. 
     203!> @date October, 2016 
     204!> - dimension to be used select from configuration file 
     205!> 
     206!> @todo 
     207!> - rewitre using meshmask instead of bathymetry and coordinates files. 
    200208!> 
    201209!> @note Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt) 
     
    383391 
    384392   ! namcfg 
    385    CHARACTER(LEN=lc)                       :: cn_varcfg = 'variable.cfg'  
    386    CHARACTER(LEN=lc)                       :: cn_dumcfg = 'dummy.cfg' 
     393   CHARACTER(LEN=lc)                       :: cn_varcfg = './cfg/variable.cfg'  
     394   CHARACTER(LEN=lc)                       :: cn_dimcfg = './cfg/dimension.cfg' 
     395   CHARACTER(LEN=lc)                       :: cn_dumcfg = './cfg/dummy.cfg' 
    387396 
    388397   ! namcrs 
     
    396405 
    397406   !namzgr 
    398    REAL(dp)                                :: dn_pp_to_be_computed = 0._dp 
    399407   REAL(dp)                                :: dn_ppsur   = -3958.951371276829_dp 
    400408   REAL(dp)                                :: dn_ppa0    =   103.953009600000_dp 
     
    445453   NAMELIST /namcfg/ &  !< config namelist 
    446454   &  cn_varcfg, &       !< variable configuration file 
     455   &  cn_dimcfg, &       !< dimension configuration file 
    447456   &  cn_dumcfg          !< dummy configuration file 
    448457 
     
    457466  
    458467   NAMELIST /namzgr/ & 
    459    &  dn_pp_to_be_computed, & 
    460468   &  dn_ppsur,     & 
    461469   &  dn_ppa0,      & 
     
    526534      ! get variable extra information 
    527535      CALL var_def_extra(TRIM(cn_varcfg)) 
     536 
     537      ! get dimension allowed 
     538      CALL dim_def_extra(TRIM(cn_dimcfg)) 
    528539 
    529540      ! get dummy variable 
     
    11511162   CALL mpp_clean(tl_coord1) 
    11521163   CALL mpp_clean(tl_coord0) 
     1164   CALL var_clean_extra() 
    11531165 
    11541166   CALL multi_clean(tl_multi) 
     
    16131625 
    16141626      ENDIF 
     1627 
    16151628   END FUNCTION create_boundary_get_level 
    16161629   !------------------------------------------------------------------- 
  • branches/2016/dev_CNRS_MERCATOR_2016/NEMOGCM/TOOLS/SIREN/src/create_coord.f90

    r6393 r7390  
    4444!>       - cn_varcfg : variable configuration file  
    4545!> (see ./SIREN/cfg/variable.cfg) 
     46!>       - cn_dimcfg : dimension configuration file. define dimensions allowed  
     47!> (see ./SIREN/cfg/dimension.cfg). 
    4648!>       - cn_dumcfg : useless (dummy) configuration file, for useless  
    4749!> dimension or variable (see ./SIREN/cfg/dummy.cfg). 
     
    7678!> 
    7779!>    * _nesting namelist (namnst)_:<br/> 
     80!>       you could define sub domain with coarse grid indices or with coordinates. 
    7881!>       - in_imin0 : i-direction lower left  point indice  
    7982!> of coarse grid subdomain to be used 
     
    8487!>       - in_jmax0 : j-direction upper right point indice 
    8588!> of coarse grid subdomain to be used 
     89!>       - rn_lonmin0 : lower left  longitude of coarse grid subdomain to be used 
     90!>       - rn_lonmax0 : upper right longitude of coarse grid subdomain to be used 
     91!>       - rn_latmin0 : lower left  latitude  of coarse grid subdomain to be used 
     92!>       - rn_latmax0 : upper right latitude  of coarse grid subdomain to be used 
    8693!>       - in_rhoi  : refinement factor in i-direction 
    8794!>       - in_rhoj  : refinement factor in j-direction<br/> 
    8895!> 
    8996!>       \image html  grid_zoom_40.png  
    90 !>       \image latex grid_zoom_40.png 
     97!>       <center> \image latex grid_zoom_40.png  
     98!>       </center> 
    9199!> 
    92100!>    * _output namelist (namout)_: 
     
    102110!> @date September, 2015 
    103111!> - manage useless (dummy) variable, attributes, and dimension 
     112!> @date September, 2016 
     113!> - allow to use coordinate to define subdomain 
     114!> @date October, 2016 
     115!> - dimension to be used select from configuration file 
    104116!> 
    105117!> @note Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt) 
     
    139151   INTEGER(i4)                                          :: il_nvar 
    140152   INTEGER(i4)                                          :: il_ew 
     153   INTEGER(i4)                                          :: il_imin0 
     154   INTEGER(i4)                                          :: il_imax0 
     155   INTEGER(i4)                                          :: il_jmin0 
     156   INTEGER(i4)                                          :: il_jmax0 
     157 
    141158   INTEGER(i4)      , DIMENSION(ip_maxdim)              :: il_rho 
     159   INTEGER(i4)      , DIMENSION(2)                      :: il_index 
    142160   INTEGER(i4)      , DIMENSION(2,2,ip_npoint)          :: il_offset 
    143161 
     
    167185   ! namcfg 
    168186   CHARACTER(LEN=lc) :: cn_varcfg = './cfg/variable.cfg'  
     187   CHARACTER(LEN=lc) :: cn_dimcfg = './cfg/dimension.cfg'  
    169188   CHARACTER(LEN=lc) :: cn_dumcfg = './cfg/dummy.cfg' 
    170189 
     
    177196 
    178197   !namnst 
     198   REAL(sp)          :: rn_lonmin0 = -360. 
     199   REAL(sp)          :: rn_lonmax0 = -360. 
     200   REAL(sp)          :: rn_latmin0 = -360. 
     201   REAL(sp)          :: rn_latmax0 = -360. 
    179202   INTEGER(i4)       :: in_imin0 = 0 
    180203   INTEGER(i4)       :: in_imax0 = 0 
     
    195218   NAMELIST /namcfg/ &  !  config namelist 
    196219   &  cn_varcfg, &       !< variable configuration file 
     220   &  cn_dimcfg, &       !< dimension configuration file 
    197221   &  cn_dumcfg          !< dummy configuration file 
    198222 
     
    207231    
    208232   NAMELIST /namnst/ &  !  nesting namelist 
     233   &  rn_lonmin0, &     !< lower left  coarse grid longitude 
     234   &  rn_lonmax0, &     !< upper right coarse grid longitude 
     235   &  rn_latmin0, &     !< lower left  coarse grid latitude 
     236   &  rn_latmax0, &     !< upper right coarse grid latitude 
    209237   &  in_imin0,   &     !< i-direction lower left  point indice  
    210238   &  in_imax0,   &     !< i-direction upper right point indice 
     
    255283      CALL var_def_extra(TRIM(cn_varcfg)) 
    256284 
     285      ! get dimension allowed 
     286      CALL dim_def_extra(TRIM(cn_dimcfg)) 
     287 
    257288      ! get dummy variable 
    258289      CALL var_get_dummy(TRIM(cn_dumcfg)) 
     
    301332 
    302333   ! check nesting parameters 
    303    IF( in_imin0 < 0 .OR. in_imax0 < 0 .OR. in_jmin0 < 0 .OR. in_jmax0 < 0)THEN 
     334   il_index(:)=0 
     335   IF( rn_lonmin0 >= -180. .AND. rn_lonmin0 <= 360 .AND. & 
     336     & rn_latmin0 >= -90.  .AND. rn_latmin0 <= 90. )THEN 
     337 
     338      il_index(:)=grid_get_closest(tl_coord0, & 
     339         &                         REAL(rn_lonmin0,dp), REAL(rn_latmin0,dp), & 
     340         &                         cd_pos='ll')  
     341      il_imin0=il_index(1) 
     342      il_jmin0=il_index(2) 
     343   ELSE 
     344      il_imin0=in_imin0 
     345      il_jmin0=in_jmin0 
     346   ENDIF 
     347 
     348   il_index(:)=0 
     349   IF( rn_lonmax0 >= -180. .AND. rn_lonmax0 <= 360 .AND. & 
     350     & rn_latmax0 >= -90.  .AND. rn_latmax0 <= 90. )THEN 
     351 
     352      il_index(:)=grid_get_closest(tl_coord0, & 
     353         &                         REAL(rn_lonmax0,dp), REAL(rn_latmax0,dp), & 
     354         &                         cd_pos='ur')  
     355      il_imax0=il_index(1) 
     356      il_jmax0=il_index(2) 
     357   ELSE 
     358      il_imax0=in_imax0 
     359      il_jmax0=in_jmax0 
     360   ENDIF 
     361 
     362   ! forced indices for east west cyclic domain 
     363   IF( rn_lonmin0 == rn_lonmax0 .AND. & 
     364     & rn_lonmin0 /= -360. )THEN 
     365      il_imin0=0 
     366      il_imax0=0 
     367   ENDIF 
     368 
     369   IF( il_imin0 < 0 .OR. il_imax0 < 0 .OR. il_jmin0 < 0 .OR. il_jmax0 < 0)THEN 
    304370      CALL logger_fatal("CREATE COORD: invalid points indices."//& 
    305371      &  " check namelist "//TRIM(cl_namelist)) 
     
    318384 
    319385   ! check domain validity 
    320    CALL grid_check_dom(tl_coord0, in_imin0, in_imax0, in_jmin0, in_jmax0 ) 
     386   CALL grid_check_dom(tl_coord0, il_imin0, il_imax0, il_jmin0, il_jmax0 ) 
    321387 
    322388   ! compute domain 
    323389   tl_dom=dom_init( tl_coord0,         & 
    324    &                in_imin0, in_imax0,& 
    325    &                in_jmin0, in_jmax0 ) 
     390   &                il_imin0, il_imax0,& 
     391   &                il_jmin0, il_jmax0 ) 
    326392 
    327393   ! add extra band (if need be) to compute interpolation 
     
    425491   IF( il_attid == 0 )THEN 
    426492      il_ind=var_get_index(tl_fileout%t_var(:),'longitude') 
     493      IF( il_ind == 0 )THEN 
     494         il_ind=var_get_index(tl_fileout%t_var(:),'longitude_T') 
     495      ENDIF 
    427496      il_ew=grid_get_ew_overlap(tl_fileout%t_var(il_ind)) 
    428497      IF( il_ew >= 0 )THEN 
     
    447516 
    448517   CALL file_clean(tl_fileout) 
     518   CALL var_clean_extra() 
    449519 
    450520   ! close log file 
  • branches/2016/dev_CNRS_MERCATOR_2016/NEMOGCM/TOOLS/SIREN/src/create_restart.f90

    r6393 r7390  
    4848!>       - cn_varcfg : variable configuration file 
    4949!> (see ./SIREN/cfg/variable.cfg) 
     50!>       - cn_dimcfg : dimension configuration file. define dimensions allowed 
     51!> (see ./SIREN/cfg/dimension.cfg). 
    5052!>       - cn_dumcfg : useless (dummy) configuration file, for useless  
    5153!> dimension or variable (see ./SIREN/cfg/dummy.cfg). 
     
    6264!> 
    6365!>    * _vertical grid namelist (namzgr)_:<br/> 
    64 !>       - dn_pp_to_be_computed  : 
    65 !>       - dn_ppsur              : 
    66 !>       - dn_ppa0               : 
    67 !>       - dn_ppa1               : 
    68 !>       - dn_ppa2               :  
    69 !>       - dn_ppkth              : 
    70 !>       - dn_ppkth2             : 
    71 !>       - dn_ppacr              : 
    72 !>       - dn_ppacr2             : 
    73 !>       - dn_ppdzmin            : 
    74 !>       - dn_pphmax             : 
     66!>       - dn_ppsur              : coefficient to compute vertical grid 
     67!>       - dn_ppa0               : coefficient to compute vertical grid 
     68!>       - dn_ppa1               : coefficient to compute vertical grid 
     69!>       - dn_ppa2               : double tanh function parameter 
     70!>       - dn_ppkth              : coefficient to compute vertical grid 
     71!>       - dn_ppkth2             : double tanh function parameter 
     72!>       - dn_ppacr              : coefficient to compute vertical grid 
     73!>       - dn_ppacr2             : double tanh function parameter 
     74!>       - dn_ppdzmin            : minimum vertical spacing 
     75!>       - dn_pphmax             : maximum depth 
    7576!>       - in_nlevel             : number of vertical level 
    7677!> 
     78!>     @note If ppa1 and ppa0 and ppsur are undefined 
     79!>           NEMO will compute them from ppdzmin , pphmax, ppkth, ppacr 
     80!> 
    7781!>    * _partial step namelist (namzps)_:<br/> 
    78 !>       - dn_e3zps_min          : 
    79 !>       - dn_e3zps_rat          :  
     82!>       - dn_e3zps_min          : minimum thickness of partial step level (meters) 
     83!>       - dn_e3zps_rat          : minimum thickness ratio of partial step level 
    8084!> 
    8185!>    * _variable namelist (namvar)_:<br/> 
     
    158162!> @date September, 2015 
    159163!> - manage useless (dummy) variable, attributes, and dimension 
     164!> @date October, 2016 
     165!> - dimension to be used select from configuration file 
     166!> 
     167!> @todo 
     168!> - rewrite using meshmask instead of bathymetry and coordinates files 
    160169!> 
    161170!> @note Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt) 
     
    196205   INTEGER(i4)                                        :: il_status 
    197206   INTEGER(i4)                                        :: il_fileid 
     207   INTEGER(i4)                                        :: il_attid 
    198208   INTEGER(i4)                                        :: il_nvar 
    199    INTEGER(i4)                                        :: il_attid 
    200209   INTEGER(i4)                                        :: il_imin1 
    201210   INTEGER(i4)                                        :: il_imax1 
     
    249258 
    250259   ! namcfg 
    251    CHARACTER(LEN=lc)                       :: cn_varcfg = 'variable.cfg'  
    252    CHARACTER(LEN=lc)                       :: cn_dumcfg = 'dummy.cfg' 
     260   CHARACTER(LEN=lc)                       :: cn_varcfg = './cfg/variable.cfg'  
     261   CHARACTER(LEN=lc)                       :: cn_dimcfg = './cfg/dimension.cfg' 
     262   CHARACTER(LEN=lc)                       :: cn_dumcfg = './cfg/dummy.cfg' 
    253263 
    254264   ! namcrs 
     
    262272 
    263273   !namzgr 
    264    REAL(dp)                                :: dn_pp_to_be_computed = 0._dp 
    265274   REAL(dp)                                :: dn_ppsur   = -3958.951371276829_dp 
    266275   REAL(dp)                                :: dn_ppa0    =   103.953009600000_dp 
     
    304313   NAMELIST /namcfg/ &  !< configuration namelist 
    305314   &  cn_varcfg, &      !< variable configuration file 
     315   &  cn_dimcfg, &      !< dimension configuration file 
    306316   &  cn_dumcfg         !< dummy configuration file 
    307317 
     
    309319   &  cn_coord0,  &     !< coordinate file 
    310320   &  in_perio0         !< periodicity index 
    311     
     321 
    312322   NAMELIST /namfin/ &  !< fine grid namelist 
    313323   &  cn_coord1,   &    !< coordinate file 
     
    316326  
    317327   NAMELIST /namzgr/ & 
    318    &  dn_pp_to_be_computed, & 
    319328   &  dn_ppsur,     & 
    320329   &  dn_ppa0,      & 
     
    336345   &  cn_varfile, &     !< list of variable file 
    337346   &  cn_varinfo        !< list of variable and interpolation method to be used. 
    338     
     347 
    339348   NAMELIST /namnst/ &  !< nesting namelist 
    340349   &  in_rhoi,    &     !< refinement factor in i-direction 
     
    387396      CALL var_def_extra(TRIM(cn_varcfg)) 
    388397 
     398      ! get dimension allowed 
     399      CALL dim_def_extra(TRIM(cn_dimcfg)) 
     400 
    389401      ! get dummy variable 
    390402      CALL var_get_dummy(TRIM(cn_dumcfg)) 
     
    402414      ! match variable with file 
    403415      tl_multi=multi_init(cn_varfile) 
    404        
     416  
    405417      READ( il_fileid, NML = namnst ) 
    406418      READ( il_fileid, NML = namout ) 
     
    592604               !- check grid coincidence 
    593605               IF( ll_sameGrid )THEN 
     606                  il_rho(:)=1 
    594607                  CALL grid_check_coincidence( tl_mpp, tl_coord1, & 
    595608                  &                            il_imin1, il_imax1, & 
     
    896909   CALL mpp_clean(tl_mppout) 
    897910   CALL mpp_clean(tl_coord1) 
     911   CALL var_clean_extra() 
    898912 
    899913   ! close log file 
     
    12001214            &        tl_depth%d_value(:,:,:,:) ) )THEN 
    12011215 
    1202                CALL logger_warn("CREATE BOUNDARY: depth value from "//& 
     1216               CALL logger_warn("CREATE RESTART: depth value from "//& 
    12031217               &  TRIM(td_mpp%c_name)//" not conform "//& 
    12041218               &  " to those from former file(s).") 
  • branches/2016/dev_CNRS_MERCATOR_2016/NEMOGCM/TOOLS/SIREN/src/dimension.f90

    r6393 r7390  
    156156!> @date Spetember, 2015 
    157157!> - manage useless (dummy) dimension 
     158!> @date October, 2016 
     159!> - dimension allowed read in configuration file 
    158160!> 
    159161!> @note Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt) 
     
    171173 
    172174   PRIVATE :: cm_dumdim        !< dummy dimension array 
     175   PRIVATE :: cm_dimX          !< x dimension array 
     176   PRIVATE :: cm_dimY          !< y dimension array 
     177   PRIVATE :: cm_dimZ          !< z dimension array 
     178   PRIVATE :: cm_dimT          !< t dimension array 
    173179 
    174180   ! function and subroutine 
     
    188194   PUBLIC :: dim_get_dummy     !< fill dummy dimension array 
    189195   PUBLIC :: dim_is_dummy      !< check if dimension is defined as dummy dimension 
     196   PUBLIC :: dim_def_extra     !< read dimension configuration file, and save dimension allowed. 
    190197 
    191198   PRIVATE :: dim__reshape_2xyzt_dp ! reshape real(8) 4D array to ('x','y','z','t') 
     
    203210   PRIVATE :: dim__copy_unit        ! copy dimension structure 
    204211   PRIVATE :: dim__copy_arr         ! copy array of dimension structure 
     212   PRIVATE :: dim__is_allowed 
    205213 
    206214   TYPE TDIM !< dimension structure 
     
    215223   END TYPE 
    216224 
    217    CHARACTER(LEN=lc), DIMENSION(ip_maxdum), SAVE :: cm_dumdim !< dummy dimension 
     225   CHARACTER(LEN=lc), DIMENSION(ip_maxdumcfg), SAVE :: cm_dumdim !< dummy dimension 
     226   CHARACTER(LEN=lc), DIMENSION(ip_maxdimcfg), SAVE :: cm_dimX   !< x dimension 
     227   CHARACTER(LEN=lc), DIMENSION(ip_maxdimcfg), SAVE :: cm_dimY   !< y dimension 
     228   CHARACTER(LEN=lc), DIMENSION(ip_maxdimcfg), SAVE :: cm_dimZ   !< z dimension 
     229   CHARACTER(LEN=lc), DIMENSION(ip_maxdimcfg), SAVE :: cm_dimT   !< t dimension 
    218230 
    219231   INTERFACE dim_print 
     
    587599         cl_name=fct_lower(cd_name) 
    588600 
    589          IF( TRIM(cl_name) == 'x' )THEN 
     601         IF(     dim__is_allowed(TRIM(cl_name), cm_dimX(:)) )THEN 
    590602            dim_init%c_sname='x' 
    591          ELSEIF( TRIM(cl_name) == 'y' )THEN 
     603         ELSEIF( dim__is_allowed(TRIM(cl_name), cm_dimY(:)) )THEN 
    592604            dim_init%c_sname='y' 
    593          ELSEIF( TRIM(cl_name)== 'z' .OR. & 
    594          &       INDEX(cl_name,'depth')/=0 )THEN 
     605         ELSEIF( dim__is_allowed(TRIM(cl_name), cm_dimZ(:)) )THEN 
    595606            dim_init%c_sname='z' 
    596          ELSEIF( TRIM(cl_name)== 't' .OR. & 
    597          &       INDEX(cl_name,'time')/=0 )THEN 
     607         ELSEIF( dim__is_allowed(TRIM(cl_name), cm_dimT(:)) )THEN 
    598608            dim_init%c_sname='t' 
    599          ENDIF       
     609         ELSE 
     610            CALL logger_warn("DIM INIT: "//TRIM(cd_name)//& 
     611            " not allowed.") 
     612         ENDIF 
    600613 
    601614      ENDIF 
     
    14301443      ! loop indices 
    14311444      ! namelist 
    1432       CHARACTER(LEN=lc), DIMENSION(ip_maxdum) :: cn_dumvar 
    1433       CHARACTER(LEN=lc), DIMENSION(ip_maxdum) :: cn_dumdim 
    1434       CHARACTER(LEN=lc), DIMENSION(ip_maxdum) :: cn_dumatt 
     1445      CHARACTER(LEN=lc), DIMENSION(ip_maxdumcfg) :: cn_dumvar 
     1446      CHARACTER(LEN=lc), DIMENSION(ip_maxdumcfg) :: cn_dumdim 
     1447      CHARACTER(LEN=lc), DIMENSION(ip_maxdumcfg) :: cn_dumatt 
    14351448 
    14361449      !---------------------------------------------------------------- 
     
    14931506 
    14941507      dim_is_dummy=.FALSE. 
    1495       DO ji=1,ip_maxdum 
     1508      DO ji=1,ip_maxdumcfg 
    14961509         IF( fct_lower(td_dim%c_name) == fct_lower(cm_dumdim(ji)) )THEN 
    14971510            dim_is_dummy=.TRUE. 
     
    15011514 
    15021515   END FUNCTION dim_is_dummy 
     1516   !------------------------------------------------------------------- 
     1517   !> @brief This subroutine read dimension configuration file,  
     1518   !> and fill array of dimension allowed. 
     1519   !> 
     1520   !> @author J.Paul 
     1521   !> @date Ocotber, 2016 - Initial Version 
     1522   ! 
     1523   !> @param[in] cd_file input file (dimension configuration file) 
     1524   !------------------------------------------------------------------- 
     1525   SUBROUTINE dim_def_extra( cd_file ) 
     1526      IMPLICIT NONE 
     1527 
     1528      ! Argument       
     1529      CHARACTER(LEN=*), INTENT(IN) :: cd_file 
     1530 
     1531      ! local variable 
     1532      INTEGER(i4)   :: il_fileid 
     1533      INTEGER(i4)   :: il_status 
     1534 
     1535      LOGICAL       :: ll_exist 
     1536       
     1537      ! loop indices 
     1538      ! namelist 
     1539      CHARACTER(LEN=lc), DIMENSION(ip_maxdimcfg) :: cn_dimX = ''  
     1540      CHARACTER(LEN=lc), DIMENSION(ip_maxdimcfg) :: cn_dimY = '' 
     1541      CHARACTER(LEN=lc), DIMENSION(ip_maxdimcfg) :: cn_dimZ = '' 
     1542      CHARACTER(LEN=lc), DIMENSION(ip_maxdimcfg) :: cn_dimT = '' 
     1543 
     1544      !---------------------------------------------------------------- 
     1545      NAMELIST /namdim/ &   !< dimension namelist 
     1546      &  cn_dimX, &       !< x dimension name allowed 
     1547      &  cn_dimY, &       !< y dimension name allowed 
     1548      &  cn_dimZ, &       !< z dimension name allowed 
     1549      &  cn_dimT          !< t dimension name allowed 
     1550 
     1551      !---------------------------------------------------------------- 
     1552 
     1553      ! init 
     1554      cm_dimX(:)='' 
     1555      cm_dimY(:)='' 
     1556      cm_dimZ(:)='' 
     1557      cm_dimT(:)='' 
     1558 
     1559      ! read config variable file 
     1560      INQUIRE(FILE=TRIM(cd_file), EXIST=ll_exist) 
     1561      IF( ll_exist )THEN 
     1562 
     1563         il_fileid=fct_getunit() 
     1564    
     1565         OPEN( il_fileid, FILE=TRIM(cd_file), & 
     1566         &                FORM='FORMATTED',       & 
     1567         &                ACCESS='SEQUENTIAL',    & 
     1568         &                STATUS='OLD',           & 
     1569         &                ACTION='READ',          & 
     1570         &                IOSTAT=il_status) 
     1571         CALL fct_err(il_status) 
     1572         IF( il_status /= 0 )THEN 
     1573            CALL logger_fatal("DIM GET DUMMY: opening "//TRIM(cd_file)) 
     1574         ENDIF 
     1575    
     1576         READ( il_fileid, NML = namdim ) 
     1577         cm_dimX(:)=cn_dimX(:) 
     1578         cm_dimY(:)=cn_dimY(:) 
     1579         cm_dimZ(:)=cn_dimZ(:) 
     1580         cm_dimT(:)=cn_dimT(:) 
     1581 
     1582         CLOSE( il_fileid ) 
     1583 
     1584      ELSE 
     1585 
     1586         CALL logger_fatal("DIM DEF EXTRA: can't find configuration"//& 
     1587            &              " file "//TRIM(cd_file)) 
     1588 
     1589      ENDIF          
     1590 
     1591   END SUBROUTINE dim_def_extra 
     1592   !------------------------------------------------------------------- 
     1593   !> @brief This function check if dimension is allowed, i.e defined  
     1594   !> in dimension configuraton file 
     1595   !> 
     1596   !> @author J.Paul 
     1597   !> @date OCTOber, 2016 - Initial Version 
     1598   ! 
     1599   !> @param[in] cd_name dimension name 
     1600   !> @param[in] cd_dim  array dimension name allowed 
     1601   !> @return true if dimension is allowed  
     1602   !------------------------------------------------------------------- 
     1603   FUNCTION dim__is_allowed(cd_name, cd_dim) 
     1604      IMPLICIT NONE 
     1605 
     1606      ! Argument 
     1607      CHARACTER(LEN=*),               INTENT(IN) :: cd_name 
     1608      CHARACTER(LEN=*), DIMENSION(:), INTENT(IN) :: cd_dim 
     1609       
     1610      ! function 
     1611      LOGICAL :: dim__is_allowed 
     1612       
     1613      ! loop indices 
     1614      INTEGER(i4) :: ji 
     1615      !---------------------------------------------------------------- 
     1616 
     1617      dim__is_allowed=.FALSE. 
     1618      ji=1 
     1619      DO WHILE( TRIM(cd_dim(ji)) /= '' ) 
     1620         IF( TRIM(fct_lower(cd_name)) == TRIM(fct_lower(cd_dim(ji))) )THEN 
     1621            dim__is_allowed=.TRUE. 
     1622            EXIT 
     1623         ENDIF 
     1624         ji=ji+1 
     1625      ENDDO 
     1626 
     1627   END FUNCTION dim__is_allowed 
     1628 
    15031629END MODULE dim 
    15041630 
  • branches/2016/dev_CNRS_MERCATOR_2016/NEMOGCM/TOOLS/SIREN/src/docsrc/1_install.md

    r6393 r7390  
    2020  <b> 
    2121  - @ref index 
    22   - @ref md_docsrc_2_quickstart 
    23   - @ref md_docsrc_3_support_bug 
    24   - @ref md_docsrc_4_codingRules 
    25   - @ref md_docsrc_5_changeLog 
     22  - @ref md_src_docsrc_2_quickstart 
     23  - @ref md_src_docsrc_3_support_bug 
     24  - @ref md_src_docsrc_4_codingRules 
     25  - @ref md_src_docsrc_5_changeLog 
    2626  - @ref todo 
    2727  </b> 
  • branches/2016/dev_CNRS_MERCATOR_2016/NEMOGCM/TOOLS/SIREN/src/docsrc/2_quickstart.md

    r6393 r7390  
    77Actually SIREN creates all the input files you need to run a NEMO regional configuration.<br/> 
    88  
    9 SIREN is composed of a set of 5 Fortran programs : 
     9SIREN is composed of a set of 6 Fortran programs : 
    1010<ul> 
    1111 <li>create_coord.f90 to create regional grid coordinates.</li> 
     
    1616 This break may cause inconsistency between forcing fields  at boundary and regional fields. 
    1717 </li> 
     18 <li>create_meshmask.f90 to create meshmask or domain_cfg file(s) which contain(s) all the ocean domain informations.</li> 
    1819 <li>create_restart.f90 to create initial state file from coarse grid restart 
    1920 or standard outputs. 
     
    3536Here after we briefly describe how to use each programs, 
    3637and so how to create your own regional configuration. 
    37 @note A set of GLORYS files (global reanalysis on *ORCA025* 
    38 grid), as well as examples of namelists are available in dods repository.<br/> 
    39 You could create and forced a first release of your own regional configuration, 
    40 with those files.  
     38@note As demonstrator for a first start a set of GLORYS files (global reanalysis on *ORCA025* grid), as well as examples of namelists are available [here](https://cloud.mercator-ocean.fr/public.php?service=files&t=acf44730538cdda0da548ffc5f99fb55). 
     39 
    4140<!-- ######################################################################  --> 
    4241# Create coordinates file # {#coord} 
     
    6160&namcfg 
    6261   cn_varcfg = "PATH/NEMOGCM/TOOLS/SIREN/cfg/variable.cfg" 
     62   cn_dimcfg = "PATH/NEMOGCM/TOOLS/SIREN/cfg/dimension.cfg" 
    6363/ 
    6464 
     
    9292empty, as done here.<br/> This will create a log file named *create_coord.log* 
    9393 
    94 The **namcfg** sub-namelist defines where found SIREN configuration file.<br/> 
    95 This configuration file defines standard name, default interpolation method, 
     94The **namcfg** sub-namelist defines where found SIREN configuration files.<br/> 
     95- The variable configuration file defines standard name, default interpolation method, 
    9696axis,... to be used for some known variables.<br/> 
    9797Obviously, 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*. 
     98- The dimension configuration file defines dimensions allowed. 
     99 
     100@note You could find the generic version of those configuration files in the directory *NEMOGCM/TOOLS/SIREN/cfg*. 
    100101 
    101102The **namcrs** sub-namelist set parameters of the wide 
    102 coordinates file,<br/> as path to find it, and NEMO periodicity of the wide grid.<br/> 
     103coordinates file, as path to find it, and NEMO periodicity of the wide grid.<br/> 
    103104 
    104105@note the NEMO periodicity could be choose between 0 to 6: 
     
    121122example: ORCA05</dd> 
    122123</dl> 
    123 @sa For more information see @ref md_docsrc_6_perio 
     124@sa For more information see @ref md_src_docsrc_6_perio 
    124125</dd> 
    125126</dl> 
     
    150151~~~~~~~~~~~ 
    151152@image html grid_zoom_60.png 
    152 @image latex grid_zoom_40.png 
     153<center>@image latex grid_zoom_40.png 
     154</center> 
    153155<!-- @note ghost cells all around the grid are not shown here. --> 
    154156 
     
    167169~~~~~~~~~~~ 
    168170@image html grid_glob_over_30.png 
    169 @image latex grid_glob_over_20.png 
     171<center>@image latex grid_glob_over_20.png 
     172</center> 
    170173<!-- @note in blue, the east-west overlap band of ORCA grid. --> 
    171174 
     
    184187~~~~~~~~~~~ 
    185188@image html grid_glob_band_30.png 
    186 @image latex grid_glob_band_20.png 
     189<center>@image latex grid_glob_band_20.png 
     190</center> 
    187191 
    188192</ul> 
     
    217221&namcfg 
    218222   cn_varcfg = "PATH/NEMOGCM/TOOLS/SIREN/cfg/variable.cfg" 
     223   cn_dimcfg = "PATH/NEMOGCM/TOOLS/SIREN/cfg/dimension.cfg" 
    219224/ 
    220225 
     
    251256coordinates file.<br/> 
    252257@note in all SIREN namelist: <br/> 
    253 0 referred to the coarse/wide grid.<br/> 
    254 1 referred to the fine grid. 
     258**0** referred to the coarse/wide grid.<br/> 
     259**1** referred to the fine grid. 
    255260 
    256261In the same way, the **namfin** sub-namelist  set parameters of the fine 
    257262coordinates file.<br/> 
    258263@note in this namelist example, there is no need to set the variable *in_perio1* to define the NEMO 
    259 periodicity of the fine grid.<br/> Indeed, if this variable is not inform, SIREN tries to read it in the attributes of the file.<br/>  
    260 So if you created the fine coordinates with SIREN, you do not have to 
     264periodicity of the fine grid. Indeed, if this variable is not inform, SIREN tries to read it  
     265in the global attributes of the file. So if you created the fine coordinates with SIREN, you do not have to 
    261266fill it. In other case, you should add it to the namelist. 
    262267 
     
    298303# Merge bathymetry file # {#merge} 
    299304 
    300 The Bathymetry you build differs from the wider one.<br/> 
     305The Bathymetry you build, may differ from the wider one.<br/> 
    301306To avoid issue with boundaries forcing fields, you should merge fine and coarse Bathymetry on boundaries.<br/> 
    302307SIREN allows you to do this.<br/> 
     
    314319&namcfg 
    315320   cn_varcfg = "PATH/NEMOGCM/TOOLS/SIREN/cfg/variable.cfg" 
     321   cn_dimcfg = "PATH/NEMOGCM/TOOLS/SIREN/cfg/dimension.cfg" 
    316322/ 
    317323 
     
    350356 
    351357The **nambdy** sub-namelist defines the subdomain boundaries.<br/> 
    352 By 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/> 
    353 So you could let this namelist empty. 
    354  
     358By 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. So you could let this namelist empty. 
    355359@sa For more information about boundaries, see @ref boundary 
    356360 
     
    359363@sa For more information about how to merge bathymetry, see 
    360364merge_bathy.f90 
     365 
     366<!-- ######################################################################  --> 
     367# Create meshmask (ocean domain informations) # {#meshmask} 
     368 
     369 
     370Depending on the vertical grid you choose to use, NEMO may not see the bathymetry exactly as you defined it just before. To get the ocean domain informations as seen by NEMO, SIREN allows you to create the meshmask file(s) which contain(s) all those informations.<br/> 
     371Morevoer SIREN allows you to create the *domain_cfg* file which is the new input file for NEMO (release 3.7 and upper).<br/> 
     372 
     373To create the meshmask file(s), you have to run : 
     374~~~~~~~~~~~~~~~~~~ 
     375./SIREN/create_meshmask.exe create_meshmask.nam 
     376~~~~~~~~~~~~~~~~~~ 
     377 
     378Here after is an example of namelist for *create_meshmask.exe*.<br/> 
     379In this example, you create one meshmask file named *mesh_mask.nc*.<br/> 
     380It uses coordinates file *coord_fine.nc* to define horizontal grid. 
     381and defines z-coordinate with partial steps. 
     382The minimum depth of the final Bathymetry is 10m.  
     383~~~~~~~~~~~ 
     384&namlog 
     385/ 
     386 
     387&namcfg 
     388   cn_varcfg = "PATH/NEMOGCM/TOOLS/SIREN/cfg/variable.cfg" 
     389   cn_dimcfg = "PATH/NEMOGCM/TOOLS/SIREN/cfg/dimension.cfg" 
     390/ 
     391 
     392&namin 
     393   cn_bathy = "PATH/bathy_merged.nc" 
     394   cn_coord = "PATH/coord_fine.nc" 
     395   in_perio = 4 
     396/ 
     397 
     398&namhgr 
     399   in_mshhgr = 0 
     400/ 
     401 
     402&namzgr 
     403   ln_zps   = .TRUE. 
     404   in_nlevel= 75 
     405/ 
     406 
     407&namdmin 
     408   dn_hmin=10. 
     409/ 
     410 
     411&namzco 
     412   dn_ppsur   = -3958.951371276829 
     413   dn_ppa0    =   103.953009600000 
     414   dn_ppa1    =     2.415951269000 
     415   dn_ppkth   =    15.351013700000 
     416   dn_ppacr   =     7.000000000000 
     417   dn_ppdzmin = 6. 
     418   dn_pphmax  = 5750. 
     419   ln_dbletanh= .TRUE. 
     420   dn_ppa2    =   100.760928500000 
     421   dn_ppkth2  =    48.029893720000 
     422   dn_ppacr2  =    13.000000000000 
     423/ 
     424 
     425&namzps 
     426   dn_e3zps_min = 25. 
     427   dn_e3zps_rat = 0.2 
     428/ 
     429 
     430&namsco 
     431/ 
     432 
     433&namlbc 
     434/ 
     435 
     436&namwd 
     437/ 
     438 
     439&namgrd 
     440/ 
     441 
     442&namout 
     443   in_msh = 1 
     444/ 
     445~~~~~~~~~~~ 
     446 
     447Let's get describe this namelist more accurately.<br/> 
     448 
     449As previously, we have the **namlog** and **namcfg** describe above.<br/> 
     450 
     451The **namin** sub-namelist defines the Bathymetry to be used. 
     452Mainly SIREN need Bathymetry to create meshmask. 
     453Here we also read coordinates directly on a file.  
     454@note  
     455 1. here again you could add the *in_perio* parameter if need be i.e. if your 
     456Bathymetry was not created by SIREN. 
     457 2. by default SIREN suppress closed sea/lake from the ORCA domain. 
     458 
     459 
     460The **namhgr** sub-namelist defines the horizontal grid. 
     461the type of horizontal mesh is choose between :<ul> 
     462<li> in_mshhgr=0 : curvilinear coordinate on the sphere read in coordinate.nc</li> 
     463<li> in_mshhgr=1 : geographical mesh on the sphere with regular grid-spacing</li> 
     464<li> in_mshhgr=2 : f-plane with regular grid-spacing</li> 
     465<li> in_mshhgr=3 : beta-plane with regular grid-spacing</li> 
     466<li> in_mshhgr=4 : Mercator grid with T/U point at the equator</li> 
     467<li> in_mshhgr=5 : beta-plane with regular grid-spacing and rotated domain (GYRE configuration)</li> 
     468</ul> 
     469 
     470The **namzgr** sub-namelist allows to choose the type of vertical grid (z-coordinate full steps, partial steps, sigma or hybrid coordinates) and the number of level. 
     471 
     472The **namdmin** sub-namelist defines the minimum ocean depth. It could be defines in meter (>0) or in number of level (<0). 
     473 
     474The **namzco** sub-namelist defines parameters to compute z-coordinate vertical grid (**needed for all type of vertical grid**) 
     475<!-- By default, those parameters are defined the same way than in GLORYS (i.e. 75 vertical levels).<br/> --> 
     476 
     477The **namzps** sub-namelist defines extra parameters needed to define z-coordinates partial steps. 
     478 
     479The **namsco** sub-namelist defines extra parameters needed to define sigma or hybrid coordinates (not needed here). 
     480 
     481<!--The **namcla** sub-namelist defines cross land advection for exchanges through some straits only used for ORCA2 (see namgrd).--> 
     482 
     483The **namlbc** sub-namelist defines lateral boundary conditions at the coast. It is needed to modify the fmask. 
     484 
     485The **namwd** sub-namelist defines the wetting and drying parameters if activated (see namzgr sub-namelist) 
     486 
     487The **namgrd** sub-namelist allows to use configuration 1D or to choose vertical scale factors (e3.=dk or old definition). 
     488 
     489Finally, this **namout** sub-namelist defines the number output file(s).<br/> 
     490@note To create the domain_cfg file, you should put **in_msh=0**. 
     491 
     492@sa For more information about how to create meshmask, see create_meshmask.f90 
    361493 
    362494<!-- ######################################################################  --> 
     
    367499time step). Or you could start from "partial" information about ocean state (Temperature and Salinity for example). 
    368500 
    369 Siren allows you to create both of those initial state.<br/> 
     501SIREN allows you to create both of those initial state.<br/> 
    370502To create the initial state, you have to run:<br/> 
    371503~~~~~~~~~~~~~~~~~~ 
     
    374506 
    375507Here after is an example of namelist for *create_restart.exe*.<br/> 
    376 In this example, you create an initial state split on 81 "processors", and named restar_out.nc.<br/> 
     508In this example, you create an initial state split on 81 "processors", and named restart_out.nc.<br/> 
    377509The initial state is composed of temperature and salinity refined from an extraction of GLORYS fields. 
    378510~~~~~~~~~~~~~~~~~~ 
     
    382514&namcfg 
    383515   cn_varcfg = "PATH/NEMOGCM/TOOLS/SIREN/cfg/variable.cfg" 
     516   cn_dimcfg = "PATH/NEMOGCM/TOOLS/SIREN/cfg/dimension.cfg" 
    384517/ 
    385518 
     
    442575Finally, this **namout** sub-namelist defines the output files.<br/> 
    443576Here we ask for output on 81 processors, with *restart_out.nc* as file "basename".<br/> 
    444 So SIREN computes the optimal layout for 81 porcessors 
     577So SIREN computes the optimal layout for 81 processors 
    445578available,<br/> 
    446 and split restart on output files named *restart_out_num.nc*, where *num* is the porc number. 
     579and split restart on output files named *restart_out_num.nc*, where *num* is the proc number. 
    447580 
    448581@note SIREN could also create the other fields you may need for 
     
    481614&namcfg 
    482615   cn_varcfg = "PATH/NEMOGCM/TOOLS/SIREN/cfg/variable.cfg" 
     616   cn_dimcfg = "PATH/NEMOGCM/TOOLS/SIREN/cfg/dimension.cfg" 
    483617/ 
    484618 
     
    592726   <b> 
    593727   - @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 
     728   - @ref md_src_docsrc_1_install 
     729   - @ref md_src_docsrc_2_quickstart 
     730   - @ref md_src_docsrc_3_support_bug 
     731   - @ref md_src_docsrc_4_codingRules 
     732   - @ref md_src_docsrc_5_changeLog 
    599733   - @ref todo 
    600734   </b> 
  • branches/2016/dev_CNRS_MERCATOR_2016/NEMOGCM/TOOLS/SIREN/src/docsrc/3_support_bug.md

    r6393 r7390  
    2020   <b> 
    2121   - @ref index 
    22    - @ref md_docsrc_1_install 
    23    - @ref md_docsrc_2_quickstart 
    24    - @ref md_docsrc_3_support_bug 
    25    - @ref md_docsrc_4_codingRules 
    26    - @ref md_docsrc_5_changeLog 
     22   - @ref md_src_docsrc_1_install 
     23   - @ref md_src_docsrc_2_quickstart 
     24   - @ref md_src_docsrc_3_support_bug 
     25   - @ref md_src_docsrc_4_codingRules 
     26   - @ref md_src_docsrc_5_changeLog 
    2727   - @ref todo 
    2828   </b> 
  • branches/2016/dev_CNRS_MERCATOR_2016/NEMOGCM/TOOLS/SIREN/src/docsrc/4_codingRules.md

    r6393 r7390  
    1515_GET_COMMAND_ARGUMENT_.<br/> 
    1616There exist no equivalent for those Fortran 03 intrinsec functions in Fortran 
    17 95.<br/> At least none convenient for compilers tested (see @ref md_docsrc_1_install).  
     1795.<br/> At least none convenient for compilers tested (see @ref md_src_docsrc_1_install).  
    1818 
    1919#  Free Form Source {#free} 
     
    9393   <b> 
    9494   - @ref index 
    95    - @ref md_docsrc_1_install 
    96    - @ref md_docsrc_2_quickstart 
    97    - @ref md_docsrc_3_support_bug 
    98    - @ref md_docsrc_5_changeLog 
     95   - @ref md_src_docsrc_1_install 
     96   - @ref md_src_docsrc_2_quickstart 
     97   - @ref md_src_docsrc_3_support_bug 
     98   - @ref md_src_docsrc_5_changeLog 
    9999   - @ref todo 
    100100   </b> 
  • branches/2016/dev_CNRS_MERCATOR_2016/NEMOGCM/TOOLS/SIREN/src/docsrc/5_changeLog.md

    r6393 r7390  
    33@tableofcontents 
    44 
    5 # Release $Revision$ 
    6 Initial release (2016-03-17) 
     5# Release $Date:: 2016-11-16 #$ ($Revision: 7235 $) 
    76 
     7## New Features 
     8- create_meshmask.f90 program to create meshmask from coordinates and bathymetry files. 
     9- create_meshmask.f90 allows to write domain_cfg file. 
     10- merge_bathy.f90: allow to choose the number of boundary point with coarse grid value. 
     11- dimension.f90: dimension allowed read in configuration file. 
     12- variable.f90: allow to add scalar value. 
     13- create_meshmask.f90: choose vertical scale factors (e3.=dk[depth] or old definition). 
    814## Changes 
    9 ## New Features 
     15- create_coord.f90: allow to define sub domain with coarse grid indices or coordinates. 
     16- grid.f90:grid__get_closest_str: add function to get closest grid point using coarse grid coordinates strucutre. 
     17- iom_cdf.f90:iom_cdf__get_info: define cdf4 as cdf. 
     18- variable.f90: add subroutine to clean global array of extra information, and define logical for variable to be used. 
     19- create_coord.f90: dimension to be used select from configuration file. 
     20- create_bathy.f90: dimension to be used select from configuration file. 
     21- merge_bathy.f90: dimension to be used select from configuration file. 
     22- create_boundary.f90: dimension to be used select from configuration file. 
     23- create_restart.f90: dimension to be used select from configuration file. 
    1024## Bug fixes 
     25- boundary.f90:boundary_check: take into account that boundaries are compute on T point, but expressed on U,V point. 
     26- grid.f90:grid__get_closest_str: use max of zero and east-west overlap instead of east-west overlap. 
     27- mpp.f90: compare index to td_lay number of proc instead of td_mpp (bug fix) . 
     28 
     29# Initial Release 2016-03-17 
    1130 
    1231 <HR> 
    1332   <b> 
    1433   - @ref index 
    15    - @ref md_docsrc_1_install 
    16    - @ref md_docsrc_2_quickstart 
    17    - @ref md_docsrc_3_support_bug 
    18    - @ref md_docsrc_4_codingRules 
     34   - @ref md_src_docsrc_1_install 
     35   - @ref md_src_docsrc_2_quickstart 
     36   - @ref md_src_docsrc_3_support_bug 
     37   - @ref md_src_docsrc_4_codingRules 
    1938   - @ref todo 
    2039   </b> 
  • branches/2016/dev_CNRS_MERCATOR_2016/NEMOGCM/TOOLS/SIREN/src/docsrc/6_perio.md

    r6393 r7390  
    66<dd>ghost cells (solid walls) are imposed at all model boundaries.</dd>  
    77@image html perio0_20.png  
    8 @image latex perio0_20.png 
     8<center>@image latex perio0_20.png  
     9</center> 
    910<dt>cyclic east-west boundary (in_perio=1)</dt> 
    1011<dd>first and last rows are closed, whilst the first column is set to the value of the last-but-one column and the last column to the value of the second one.</dd>   
    1112@image html perio1_20.png  
    12 @image latex perio1_20.png 
     13<center>@image latex perio1_20.png  
     14</center> 
    1315<dt>symmetric boundary condition across the equator. (in_perio=2)</dt> 
    1416<dd>last row, and first and last columns are closed. </dd>  
    1517@image html perio2_20.png  
    16 @image latex perio2_20.png 
     18<center>@image latex perio2_20.png  
     19</center> 
    1720<dt>North fold boundary with a T -point pivot (in_perio=3)</dt> 
    1821<dd>first row, and first and last columns are closed. </dd>  
    1922@image html perio3_20.png  
    20 @image latex perio3_20.png 
     23<center>@image latex perio3_20.png  
     24</center> 
    2125<dt>North fold boundary with a T -point pivot and cyclic east-west boundary (in_perio=4)</dt> 
    2226<dd>first row is closed. The first column is set to the value of the last-but-one column and the last column to the value of the second one. </dd>  
    2327@image html perio4_20.png  
    24 @image latex perio4_20.png 
     28<center>@image latex perio4_20.png  
     29</center> 
    2530<dt>North fold boundary with a F -point pivot (in_perio=5)</dt> 
    2631<dd>first row, and first and last columns are closed. </dd>  
    2732@image html perio5_20.png  
    28 @image latex perio5_20.png 
     33<center>@image latex perio5_20.png  
     34</center> 
    2935<dt>North fold boundary with a F -point pivot and cyclic east-west boundary (in_perio=6)</dt> 
    3036<dd>first row is closed. The first column is set to the value of the last-but-one column and the last column to the value of the second one.</dd>  
    3137@image html perio6_20.png  
    32 @image latex perio6_20.png 
     38<center>@image latex perio6_20.png  
     39</center> 
    3340</dl> 
    3441@sa For more information about NEMO periodicity, see _Model Boundary Condition_ chapter in [NEMO documentation](http://www.nemo-ocean.eu/About-NEMO/Reference-manuals)) 
  • branches/2016/dev_CNRS_MERCATOR_2016/NEMOGCM/TOOLS/SIREN/src/docsrc/main.dox

    r6393 r7390  
    22 @mainpage About  
    33 
    4  SIREN is a software to create regional configuration with [NEMO](http://www.nemo-ocean.eu).<br/>  
    5  Actually SIREN create input files needed for a basic NEMO configuration.<br/> 
     4 SIREN is a software to set up regional configuration with [NEMO](http://www.nemo-ocean.eu).<br/>  
     5 Actually SIREN creates the input files you need to run a NEMO regional configuration.<br/> 
     6  
     7 SIREN allows you to create your own regional configuration embedded in a wider one.<br/> 
    68 
    7  SIREN allows you to create your own regional configuration embedded in a wider one.<br/> 
    8  In order to help you, a set of GLORYS files (global reanalysis on ORCA025 grid), as well as examples 
    9  of namelists are available in dods repository. 
     9 To know how to install SIREN see @ref md_src_docsrc_1_install. 
    1010 
    11  @note This software was created, and is maintain by the Configuration Manager Working Group, composed 
    12  of NEMO system team members. 
    13   
    14  To know how to install SIREN see @ref md_docsrc_1_install. 
    15  
    16  You could find a tutorial for a quick start with SIREN in @ref md_docsrc_2_quickstart.<br/> 
     11 You could find a tutorial for a quick start with SIREN in @ref md_src_docsrc_2_quickstart.<br/> 
    1712 For more information about how to use each component of SIREN 
    1813 - see create_coord.f90 to create fine grid coordinate file 
    1914 - see create_bathy.f90 to create fine grid bathymetry 
    2015 - see merge_bathy.f90 to merge fine grid bathymetry 
     16 - see create_meshmask.f90 to create mesh mask or domain_cfg file. 
    2117 - see create_restart.f90 to create initial state file, or other fields. 
    2218 - see create_boundary.F90 to create boundary condition 
     
    2420<HR> 
    2521   <b> 
    26    - @ref md_docsrc_1_install 
    27    - @ref md_docsrc_2_quickstart 
    28    - @ref md_docsrc_3_support_bug 
    29    - @ref md_docsrc_4_codingRules 
    30    - @ref md_docsrc_5_changeLog 
     22   - @ref md_src_docsrc_1_install 
     23   - @ref md_src_docsrc_2_quickstart 
     24   - @ref md_src_docsrc_3_support_bug 
     25   - @ref md_src_docsrc_4_codingRules 
     26   - @ref md_src_docsrc_5_changeLog 
    3127   - @ref todo 
    3228   </b> 
  • branches/2016/dev_CNRS_MERCATOR_2016/NEMOGCM/TOOLS/SIREN/src/global.f90

    r6393 r7390  
    6767 
    6868   INTEGER(i4)                             , PARAMETER :: ip_maxvar =200   !< maximum number of variable 
    69    INTEGER(i4)                             , PARAMETER :: ip_maxmtx =100   !< matrix variable maximum dimension (cf create_bathy) 
    70    INTEGER(i4)                             , PARAMETER :: ip_maxseg =50    !< maximum number of segment for each boundary 
     69   INTEGER(i4)                             , PARAMETER :: ip_maxmtx =50    !< matrix variable maximum dimension (cf create_bathy) 
     70   INTEGER(i4)                             , PARAMETER :: ip_maxseg =10    !< maximum number of segment for each boundary 
    7171 
    7272   INTEGER(i4)                             , PARAMETER :: ip_nsep=2        !< number of separator listed 
     
    101101   REAL(dp)                                , PARAMETER :: dp_fill_i4=NF90_FILL_INT    !< INT fill value 
    102102   REAL(dp)                                , PARAMETER :: dp_fill_sp=NF90_FILL_FLOAT  !< real fill value 
    103    REAL(dp)                                , PARAMETER :: dp_fill=NF90_FILL_DOUBLE !< double fill value 
     103   REAL(dp)                                , PARAMETER :: dp_fill=NF90_FILL_DOUBLE    !< double fill value 
    104104 
    105105   INTEGER(i4)                             , PARAMETER :: ip_npoint=4 
     
    112112 
    113113 
     114   INTEGER(i4)                             , PARAMETER :: ip_maxdimcfg=10 !< maximum allowed dimension in configuration file 
    114115   INTEGER(i4)                             , PARAMETER :: ip_maxdim=4 
    115116   INTEGER(i4)                             , PARAMETER :: jp_I=1 
     
    131132   INTEGER(i4), PARAMETER :: jp_west =4 
    132133 
    133    INTEGER(i4)                             , PARAMETER :: ip_maxdum = 10 !< maximum dummy variable, dimension, attribute 
     134   INTEGER(i4)                             , PARAMETER :: ip_maxdumcfg = 10 !< maximum dummy variable, dimension, or attribute  
     135                                                                            !< in configuration file 
    134136 
    135137END MODULE global 
  • branches/2016/dev_CNRS_MERCATOR_2016/NEMOGCM/TOOLS/SIREN/src/grid.f90

    r6393 r7390  
    218218!> @date February, 2015 
    219219!> - add function grid_fill_small_msk to fill small domain inside bigger one 
    220 !> @February, 2016 
     220!> @date February, 2016 
    221221!> - improve way to check coincidence (bug fix) 
    222222!> - manage grid cases for T,U,V or F point, with even or odd refinment (bug fix) 
     223!> @date April, 2016 
     224!> - add function to get closest grid point using coarse grid coordinates strucutre  
    223225! 
    224226!> @note Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt) 
     
    271273   PRIVATE :: grid__get_coarse_index_cc ! - using coarse and fine grid array of lon,lat 
    272274 
     275                                     ! return closest coarse grid point from another point 
     276   PRIVATE :: grid__get_closest_str    ! - using coarse grid coordinates strucutre 
     277   PRIVATE :: grid__get_closest_arr    ! - using coarse grid array of lon,lat 
     278 
    273279                                     ! get offset between fine and coarse grid 
    274280   PRIVATE :: grid__get_fine_offset_ff ! - using coarse and fine grid coordinates files 
     
    333339      MODULE PROCEDURE grid__get_ghost_mpp 
    334340   END INTERFACE  grid_get_ghost 
     341 
     342   INTERFACE  grid_get_closest 
     343      MODULE PROCEDURE grid__get_closest_str 
     344      MODULE PROCEDURE grid__get_closest_arr 
     345   END INTERFACE  grid_get_closest 
    335346 
    336347   INTERFACE  grid_get_coarse_index 
     
    467478   !------------------------------------------------------------------- 
    468479   !> @brief This subroutine get information about global domain, given mpp 
    469    !> strucutre. 
     480   !> structure. 
    470481   !> 
    471482   !> @details 
     
    536547 
    537548      SELECT CASE(il_perio) 
    538       CASE(3,4) 
    539          il_pivot=1 
    540       CASE(5,6) 
    541          il_pivot=0 
    542       CASE(0,1,2) 
    543          il_pivot=1 
     549         CASE(3,4) 
     550            il_pivot=1 
     551         CASE(5,6) 
     552            il_pivot=0 
     553         CASE(0,1,2) 
     554            il_pivot=1 
    544555      END SELECT 
    545556 
     
    13651376            END SELECT 
    13661377         ELSE 
     1378            il_perio=-1 
    13671379            ! check periodicity 
    13681380            IF(ANY(td_var%d_value(   1     ,:,1,1)/=td_var%d_fill).OR.& 
     
    16561668   !> else return the size of the ovarlap band. 
    16571669   !> East-West overlap is computed comparing longitude value of the   
    1658    !> South" part of the domain, to avoid  north fold boundary. 
     1670   !> South part of the domain, to avoid  north fold boundary. 
    16591671   !> 
    16601672   ! 
     
    16631675   !> @date October, 2014 
    16641676   !> - work on mpp file structure instead of file structure 
     1677   !> @date October, 2016 
     1678   !> - check longitude as longname 
    16651679   !> 
    16661680   !> @param[in] td_lon longitude variable structure  
     
    17121726            ALLOCATE( dl_vare(il_jmax-il_jmin+1) ) 
    17131727            ALLOCATE( dl_varw(il_jmax-il_jmin+1) ) 
    1714              
     1728 
    17151729            dl_vare(:)=dl_value(il_east,il_jmin:il_jmax) 
    17161730            dl_varw(:)=dl_value(il_west,il_jmin:il_jmax) 
    1717              
    1718             IF( .NOT.(  ALL(dl_vare(:)==td_var%d_fill) .AND. & 
    1719             &           ALL(dl_varw(:)==td_var%d_fill) ) )THEN 
    1720           
    1721                IF( TRIM(td_var%c_stdname) == 'longitude' )THEN 
     1731 
     1732            IF( .NOT.( ALL(dl_vare(:)==td_var%d_fill) .AND. & 
     1733            &          ALL(dl_varw(:)==td_var%d_fill) ) )THEN 
     1734 
     1735               IF( TRIM(td_var%c_stdname) == 'longitude' .OR. & 
     1736                 & SCAN( TRIM(td_var%c_longname), 'longitude') == 0 )THEN 
    17221737                  WHERE( dl_value(:,:) > 180._dp .AND. & 
    17231738                  &      dl_value(:,:) /= td_var%d_fill )  
     
    17431758                     ELSE 
    17441759                        dl_vare(:)=dl_value(il_east-ji,il_jmin:il_jmax) 
    1745                          
     1760 
    17461761                        IF( ALL( dl_varw(:) == dl_vare(:) ) )THEN 
    17471762                           grid__get_ew_overlap_var=ji+1 
     
    17691784   !> else return the size of the ovarlap band. 
    17701785   !> East-West overlap is computed comparing longitude value of the   
    1771    !> South" part of the domain, to avoid  north fold boundary. 
     1786   !> South part of the domain, to avoid  north fold boundary. 
    17721787   !> 
    17731788   !> @author J.Paul 
    17741789   !> @date October, 2014 - Initial Version 
     1790   !> @date October, 2016 
     1791   !> - check varid for longitude_T 
    17751792   !> 
    17761793   !> @param[in] td_file file structure  
     
    17931810      !---------------------------------------------------------------- 
    17941811 
    1795       il_varid=var_get_index(td_file%t_var(:), 'longitude') 
     1812      il_varid=var_get_id(td_file%t_var(:), 'longitude', 'longitude_T') 
    17961813      IF( il_varid /= 0 )THEN 
    17971814         ! read longitude on boundary 
    1798          tl_var=iom_read_var(td_file, 'longitude') 
     1815         tl_var=iom_read_var(td_file, il_varid) 
    17991816      ELSE 
    18001817         DO ji=1,td_file%i_nvar 
     
    18191836   !> else return the size of the ovarlap band. 
    18201837   !> East-West overlap is computed comparing longitude value of the   
    1821    !> South" part of the domain, to avoid  north fold boundary. 
     1838   !> South part of the domain, to avoid  north fold boundary. 
    18221839   !> 
    18231840   ! 
     
    18261843   !> @date October, 2014 
    18271844   !> - work on mpp file structure instead of file structure 
     1845   !> @date October, 2016 
     1846   !> - check varid for longitude_T 
    18281847   !> 
    18291848   !> @param[in] td_mpp mpp structure  
     
    18501869 
    18511870      ! read longitude on boundary 
    1852       il_varid=var_get_index(td_mpp%t_proc(1)%t_var(:),'longitude') 
     1871      il_varid=var_get_id(td_mpp%t_proc(1)%t_var(:),'longitude', 'longitude_T') 
    18531872      IF( il_varid /= 0 )THEN 
    1854          tl_var=iom_mpp_read_var(td_mpp, 'longitude') 
     1873         tl_var=iom_mpp_read_var(td_mpp, il_varid) 
    18551874      ELSE 
    18561875         DO ji=1,td_mpp%t_proc(1)%i_nvar 
     
    18661885         grid__get_ew_overlap_mpp=il_ew 
    18671886      ENDIF 
    1868  
    18691887 
    18701888      ! clean 
     
    30203038   !> 
    30213039   !> @author J.Paul 
     3040   !> @date April, 2016 - Initial Version 
     3041   !> @date October, 2016 
     3042   !> - use max of zero and east-west overlap instead of east-west overlap 
     3043   !> 
     3044   !> @param[in] td_coord0 coarse grid coordinate mpp structure 
     3045   !> @param[in] dd_lon1   fine   grid longitude 
     3046   !> @param[in] dd_lat1   fine   grid latitude 
     3047   !> @param[in] cd_pos    relative position of grid point from point  
     3048   !> @param[in] dd_fill   fill value 
     3049   !> @return coarse grid indices of closest point of fine grid point 
     3050   !------------------------------------------------------------------- 
     3051   FUNCTION grid__get_closest_str( td_coord0, dd_lon1, dd_lat1, cd_pos, dd_fill ) & 
     3052   &  RESULT(id_res) 
     3053 
     3054      IMPLICIT NONE 
     3055      ! Argument 
     3056      TYPE(TMPP )     , INTENT(IN) :: td_coord0 
     3057      REAL(dp),         INTENT(IN) :: dd_lon1 
     3058      REAL(dp),         INTENT(IN) :: dd_lat1 
     3059      CHARACTER(LEN=*), INTENT(IN), OPTIONAL :: cd_pos 
     3060      REAL(dp),         INTENT(IN), OPTIONAL :: dd_fill 
     3061 
     3062      ! function 
     3063      INTEGER(i4), DIMENSION(2) :: id_res 
     3064 
     3065      ! local variable 
     3066      CHARACTER(LEN=lc)                        :: cl_point 
     3067      CHARACTER(LEN=lc)                        :: cl_name 
     3068 
     3069      INTEGER(i4)                              :: il_ind 
     3070      INTEGER(i4)                              :: il_ew 
     3071 
     3072      REAL(dp)   , DIMENSION(:,:), ALLOCATABLE :: dl_lon0 
     3073      REAL(dp)   , DIMENSION(:,:), ALLOCATABLE :: dl_lat0 
     3074 
     3075      TYPE(TVAR)                               :: tl_lon0 
     3076      TYPE(TVAR)                               :: tl_lat0 
     3077      TYPE(TMPP)                               :: tl_coord0 
     3078      !---------------------------------------------------------------- 
     3079 
     3080      id_res(:)=-1 
     3081      cl_point='T' 
     3082 
     3083      ! copy structure 
     3084      tl_coord0=mpp_copy(td_coord0) 
     3085 
     3086      IF( .NOT. ASSOCIATED(tl_coord0%t_proc) )THEN 
     3087 
     3088         CALL logger_error("GRID GET CLOSEST: decompsition of mpp "//& 
     3089         &  "file "//TRIM(tl_coord0%c_name)//" not defined." ) 
     3090 
     3091      ELSE 
     3092 
     3093         ! open mpp files 
     3094         CALL iom_mpp_open(tl_coord0) 
     3095  
     3096         ! read coarse longitue and latitude 
     3097         WRITE(cl_name,*) 'longitude_'//TRIM(cl_point) 
     3098         il_ind=var_get_id(tl_coord0%t_proc(1)%t_var(:), cl_name) 
     3099         IF( il_ind == 0 )THEN 
     3100            CALL logger_warn("GRID GET CLOSEST: no variable "//& 
     3101            &  TRIM(cl_name)//"in file "//TRIM(tl_coord0%c_name)//". & 
     3102            &  try to use longitude.") 
     3103            WRITE(cl_name,*) 'longitude' 
     3104         ENDIF 
     3105         tl_lon0=iom_mpp_read_var(tl_coord0, TRIM(cl_name)) 
     3106  
     3107         WRITE(cl_name,*) 'latitude_'//TRIM(cl_point) 
     3108         il_ind=var_get_id(tl_coord0%t_proc(1)%t_var(:), cl_name) 
     3109         IF( il_ind == 0 )THEN 
     3110            CALL logger_warn("GRID GET CLOSEST: no variable "//& 
     3111            &  TRIM(cl_name)//"in file "//TRIM(tl_coord0%c_name)//". & 
     3112            &  try to use latitude.") 
     3113            WRITE(cl_name,*) 'latitude' 
     3114         ENDIF 
     3115         tl_lat0=iom_mpp_read_var(tl_coord0, TRIM(cl_name)) 
     3116 
     3117         ! close mpp files 
     3118         CALL iom_mpp_close(tl_coord0) 
     3119 
     3120         il_ew=MAX(0,tl_coord0%i_ew) 
     3121         ALLOCATE(dl_lon0(tl_coord0%t_dim(jp_I)%i_len-il_ew, & 
     3122            &             tl_coord0%t_dim(jp_J)%i_len) )              
     3123         ALLOCATE(dl_lat0(tl_coord0%t_dim(jp_I)%i_len-il_ew, & 
     3124            &             tl_coord0%t_dim(jp_J)%i_len) ) 
     3125 
     3126         dl_lon0(:,:)=tl_lon0%d_value(il_ew+1:,:,1,1) 
     3127         dl_lat0(:,:)=tl_lat0%d_value(il_ew+1:,:,1,1) 
     3128 
     3129         id_res(:)=grid_get_closest( dl_lon0, dl_lat0, dd_lon1, dd_lat1, cd_pos, dd_fill ) 
     3130 
     3131         DEALLOCATE(dl_lon0, dl_lat0) 
     3132         CALL var_clean(tl_lon0) 
     3133         CALL var_clean(tl_lat0) 
     3134         CALL mpp_clean(tl_coord0) 
     3135 
     3136      ENDIF 
     3137 
     3138   END FUNCTION  grid__get_closest_str 
     3139   !------------------------------------------------------------------- 
     3140   !> @brief This function return grid indices of the closest point 
     3141   !> from point (lon1,lat1)  
     3142   !>  
     3143   !> @details 
     3144   !> 
     3145   !> @note overlap band should have been already removed from coarse grid array  
     3146   !> of longitude and latitude, before running this function 
     3147   !> 
     3148   !> if you add cd_pos argument, you could choice to return closest point at 
     3149   !> - lower left  (ll) of the point 
     3150   !> - lower right (lr) of the point 
     3151   !> - upper left  (ul) of the point 
     3152   !> - upper right (ur) of the point 
     3153   !> - lower       (lo) of the point 
     3154   !> - upper       (up) of the point 
     3155   !> -       left  (le) of the point 
     3156   !> -       right (ri) of the point 
     3157   !> 
     3158   !> @author J.Paul 
    30223159   !> @date November, 2013 - Initial Version 
    30233160   !> @date February, 2015 
     
    30343171   !> @return coarse grid indices of closest point of fine grid point 
    30353172   !------------------------------------------------------------------- 
    3036    FUNCTION grid_get_closest( dd_lon0, dd_lat0, dd_lon1, dd_lat1, cd_pos, dd_fill ) 
     3173   FUNCTION grid__get_closest_arr( dd_lon0, dd_lat0, dd_lon1, dd_lat1, cd_pos, dd_fill ) 
    30373174      IMPLICIT NONE 
    30383175      ! Argument 
     
    30453182 
    30463183      ! function 
    3047       INTEGER(i4), DIMENSION(2) :: grid_get_closest 
     3184      INTEGER(i4), DIMENSION(2) :: grid__get_closest_arr 
    30483185 
    30493186      ! local variable 
     
    32613398         END SELECT 
    32623399      ENDIF 
    3263       grid_get_closest(:)=MINLOC(dl_dist(:,:),dl_dist(:,:)/=NF90_FILL_DOUBLE) 
    3264  
    3265       grid_get_closest(1)=grid_get_closest(1)+il_iinf-1 
    3266       grid_get_closest(2)=grid_get_closest(2)+il_jinf-1 
     3400      grid__get_closest_arr(:)=MINLOC(dl_dist(:,:),dl_dist(:,:)/=NF90_FILL_DOUBLE) 
     3401 
     3402      grid__get_closest_arr(1)=grid__get_closest_arr(1)+il_iinf-1 
     3403      grid__get_closest_arr(2)=grid__get_closest_arr(2)+il_jinf-1 
    32673404 
    32683405      DEALLOCATE( dl_dist ) 
    32693406      DEALLOCATE( dl_lon0 ) 
    32703407 
    3271    END FUNCTION grid_get_closest 
     3408   END FUNCTION grid__get_closest_arr 
    32723409   !------------------------------------------------------------------- 
    32733410   !> @brief This function compute the distance between a point A and grid points.   
     
    34753612         ENDIF 
    34763613         tl_lat0=iom_mpp_read_var(tl_coord0, TRIM(cl_name)) 
    3477           
     3614 
    34783615         ! close mpp files 
    34793616         CALL iom_mpp_close(tl_coord0) 
     
    46474784 
    46484785      IF( ll_even )THEN 
     4786 
    46494787         ! look for variable value on domain for F point 
    46504788         il_ind=var_get_index(tl_coord0%t_proc(1)%t_var(:), 'longitude_F') 
  • branches/2016/dev_CNRS_MERCATOR_2016/NEMOGCM/TOOLS/SIREN/src/iom.f90

    r5617 r7390  
    157157   !> @author J.Paul 
    158158   !> @date November, 2013 - Initial Version 
    159    ! 
     159   !> 
    160160   !> @param[inout] td_file file structure 
    161161   !------------------------------------------------------------------- 
  • branches/2016/dev_CNRS_MERCATOR_2016/NEMOGCM/TOOLS/SIREN/src/iom_cdf.f90

    r6393 r7390  
    316316   !> @author J.Paul 
    317317   !> @date November, 2013 - Initial Version 
     318   !> @date October, 2016 
     319   !> - define cdf4 as cdf. 
    318320   ! 
    319321   !> @param[inout] td_file   file structure 
     
    340342            td_file%c_type='cdf' 
    341343         CASE(nf90_format_netcdf4, nf90_format_netcdf4_classic) 
    342             td_file%c_type='cdf4' 
     344            !td_file%c_type='cdf4' 
     345            td_file%c_type='cdf' 
    343346      END SELECT 
    344347 
     
    351354   !> reorder dimension to ('x', 'y', 'z', 't'). 
    352355   !> The dimension structure inside file structure is then completed. 
    353    ! 
    354    !> @author J.Paul 
    355    !> @date November, 2013 - Initial Version 
    356    ! 
     356   !> 
     357   !> @author J.Paul 
     358   !> @date November, 2013 - Initial Version 
     359   !> @date October, 2016 
     360   !> - check unknown dimension 
     361   !> 
    357362   !> @param[inout] td_file   file structure 
    358363   !------------------------------------------------------------------- 
     
    375380 
    376381      IF( td_file%i_ndim > 0 )THEN 
     382 
    377383         ii=1 
    378384         DO ji = 1, td_file%i_ndim 
    379385            ! read dimension information 
    380386            tl_dim=iom_cdf_read_dim( td_file, ji) 
    381             IF( .NOT. dim_is_dummy(tl_dim) )THEN 
     387            ! sname == 'u' if dimension is unknown (not to be used) 
     388            IF( TRIM(tl_dim%c_sname) /= 'u' )THEN 
    382389               IF( ii > ip_maxdim )THEN 
    383390                  CALL logger_fatal("IOM CDF OPEN: too much dimension "//& 
    384                   & "to be read. you should remove dummy dimension using "//& 
     391                  & "to be read. you could choose dimension to be used. see "//& 
    385392                  & " configuration file") 
    386393               ENDIF 
     
    395402            &  " IOM CDF GET FILE DIM: there is no unlimited dimension in file "//& 
    396403            &  TRIM(td_file%c_name)) 
    397          ELSE 
    398             td_file%t_dim( td_file%i_uldid )%l_uld=.TRUE. 
     404         !ELSE 
     405         !   td_file%t_dim( td_file%i_uldid )%l_uld=.TRUE. 
    399406         ENDIF 
    400407 
     
    466473   !> The variable structure inside file structure is then completed. 
    467474   !> @note variable value are not read ! 
    468    ! 
     475   !> 
    469476   !> @author J.Paul 
    470477   !> @date November, 2013 - Initial Version 
     
    473480   !> @date January, 2016 
    474481   !> - increment n3d for 4D variable 
    475    ! 
     482   !> @date October, 2016 
     483   !> - check if variable to be used (variable's dimension allowed and variable 
     484   !> not "dummy") 
     485   !> 
    476486   !> @param[inout] td_file   file structure 
    477487   !------------------------------------------------------------------- 
     
    501511         il_nvar=td_file%i_nvar 
    502512         ALLOCATE(tl_var(il_nvar)) 
    503          ii=0 
    504513         DO ji = 1, il_nvar 
    505514           ! read variable information 
    506515           tl_var(ji)=iom_cdf__read_var_meta( td_file, ji)  
    507            IF( .NOT. var_is_dummy(tl_var(ji)) )THEN 
    508               ii=ii+1 
    509            ENDIF 
    510516         ENDDO 
    511517 
    512518         ! update number of variable used 
    513          td_file%i_nvar=ii 
     519         td_file%i_nvar=COUNT(tl_var(:)%l_use) 
    514520 
    515521         ALLOCATE(td_file%t_var(td_file%i_nvar)) 
     
    517523         ii=0 
    518524         DO ji = 1, il_nvar 
    519             IF( .NOT. var_is_dummy(tl_var(ji)) )THEN 
     525            IF( tl_var(ji)%l_use )THEN 
    520526               ii=ii+1 
    521527               td_file%t_var(ii)=var_copy(tl_var(ji)) 
     
    552558                     td_file%i_timeid=ji 
    553559                  ELSE 
     560                     IF( td_file%i_timeid /= ji )THEN 
     561                        CALL logger_warn("IOM CDF GET FILE VAR: find more "//& 
     562                        &                 "than one time variable in file "//& 
     563                        &                 TRIM(td_file%c_name)//". see "//& 
     564                        &                 "dummy.cfg configuration file to"//& 
     565                        &                 " not used dummy variables.") 
     566                     ENDIF 
    554567                     il_attid=0 
    555568                     IF( ASSOCIATED(td_file%t_var(ii)%t_att) )THEN 
     
    558571                     IF( il_attid /= 0 )THEN 
    559572                        td_file%i_timeid=ji 
    560                      !ELSE 
    561                      !   CALL logger_error("IOM CDF GET FILE VAR: find more "//& 
    562                      !   &                 "than one time variable in file "//& 
    563                      !   &                 TRIM(td_file%c_name) ) 
    564573                     ENDIF 
    565574                  ENDIF 
     
    652661         &  " IOM CDF READ DIM: no id associated to file "//TRIM(td_file%c_name)) 
    653662 
    654       ELSE       
     663      ELSE 
    655664 
    656665         CALL logger_trace( & 
     
    14131422         ENDDO 
    14141423 
     1424         !! check if variable is dummy 
     1425         IF( var_is_dummy(iom_cdf__read_var_meta) )THEN 
     1426            iom_cdf__read_var_meta%l_use=.FALSE. 
     1427         ENDIF 
     1428 
     1429         !! check if all dimensions are allowed 
     1430         DO ji=1,il_ndim 
     1431            IF( ALL(td_file%t_dim(:)%i_id /= il_dimid(ji)) )THEN 
     1432               iom_cdf__read_var_meta%l_use=.FALSE. 
     1433            ENDIF 
     1434         ENDDO 
     1435 
    14151436         ! clean 
    14161437         CALL dim_clean(tl_dim(:)) 
     
    14841505      ELSE IF( id_ndim > 0 )THEN 
    14851506 
    1486  
    14871507         ii=1 
    14881508         DO ji = 1, id_ndim 
    14891509 
    1490             !!! check no dummy dimension to be used 
     1510            ! check if dimension to be used, is allowed 
    14911511            IF( ANY(td_file%t_dim(:)%i_id == id_dimid(ji)) )THEN 
    14921512               IF( ii > ip_maxdim )THEN 
     
    15001520 
    15011521               il_xyzt2(ii)=td_file%t_dim(id_dimid(ji))%i_xyzt2 
    1502  
     1522                
    15031523               ! read dimension information 
    15041524               tl_dim(ii) = dim_init( td_file%t_dim(il_xyzt2(ii))%c_name, & 
    15051525               &                      td_file%t_dim(il_xyzt2(ii))%i_len ) 
    1506              
     1526 
    15071527               ii=ii+1 
    15081528            ELSE 
     
    20802100                  & 'gcost','gcosu','gcosv','gcosf', & 
    20812101                  & 'gsint','gsinu','gsinv','gsinf', & 
    2082                   & 'mbathy','misf','isf_draft',     & 
     2102                  & 'mbathy','misf','isf_draft','isfdraft',     & 
    20832103                  & 'hbatt','hbatu','hbatv','hbatf', & 
    20842104                  & 'gsigt','gsigu','gsigv','gsigf', & 
     
    21892209         CALL iom_cdf__check(il_status,"IOM CDF WRITE VAR DEF: ") 
    21902210      ENDIF 
     2211      CALL logger_debug("IOM CDF WRITE VAR DEF: type = "//TRIM(fct_str(tl_var%i_type))) 
    21912212 
    21922213      ! remove unuseful attribute 
  • branches/2016/dev_CNRS_MERCATOR_2016/NEMOGCM/TOOLS/SIREN/src/merge_bathy.f90

    r6393 r7390  
    5151!>       - cn_varcfg : variable configuration file  
    5252!> (see ./SIREN/cfg/variable.cfg) 
     53!>       - cn_dimcfg : dimension configuration file. define dimensions allowed 
     54!> (see ./SIREN/cfg/dimension.cfg). 
    5355!>       - cn_dumcfg : useless (dummy) configuration file, for useless  
    5456!> dimension or variable (see ./SIREN/cfg/dummy.cfg). 
     
    115117!>       - cn_east  : east  boundary indices on fine grid<br/> 
    116118!>       - cn_west  : west  boundary indices on fine grid<br/> 
     119!>       - in_ncrs  : number of point(s) with coarse value save at boundaries<br/> 
    117120!>       - ln_oneseg: use only one segment for each boundary or not 
    118121!> 
     
    130133!> @date September, 2015 
    131134!> - manage useless (dummy) variable, attributes, and dimension 
     135!> @date October, 2016 
     136!> - allow to choose the number of boundary point with coarse grid value. 
     137!> - dimension to be used select from configuration file 
    132138!> 
    133139!> @note Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt) 
     
    208214 
    209215   ! namcfg 
    210    CHARACTER(LEN=lc)                       :: cn_varcfg = 'variable.cfg'  
    211    CHARACTER(LEN=lc)                       :: cn_dumcfg = 'dummy.cfg' 
     216   CHARACTER(LEN=lc)                       :: cn_varcfg = './cfg/variable.cfg'  
     217   CHARACTER(LEN=lc)                       :: cn_dimcfg = './cfg/dimension.cfg' 
     218   CHARACTER(LEN=lc)                       :: cn_dumcfg = './cfg/dummy.cfg' 
    212219 
    213220   ! namcrs 
     
    231238   LOGICAL                                 :: ln_east  = .TRUE. 
    232239   LOGICAL                                 :: ln_west  = .TRUE. 
    233    LOGICAL                                 :: ln_oneseg= .TRUE. 
    234240   CHARACTER(LEN=lc)                       :: cn_north = '' 
    235241   CHARACTER(LEN=lc)                       :: cn_south = '' 
    236242   CHARACTER(LEN=lc)                       :: cn_east  = '' 
    237243   CHARACTER(LEN=lc)                       :: cn_west  = '' 
     244   INTEGER(i4)                             :: in_ncrs  = 2 
     245   LOGICAL                                 :: ln_oneseg= .TRUE. 
    238246 
    239247   ! namout 
     
    248256   NAMELIST /namcfg/ &  !< config namelist 
    249257   &  cn_varcfg, &       !< variable configuration file 
     258   &  cn_dimcfg, &       !< dimension configuration file 
    250259   &  cn_dumcfg          !< dummy configuration file 
    251260 
     
    276285   &  cn_east ,   &     !< east  boundary indices on fine grid 
    277286   &  cn_west ,   &     !< west  boundary indices on fine grid 
     287   &  in_ncrs,    &     !< number of point with coarse value save at boundaries  
    278288   &  ln_oneseg         !< use only one segment for each boundary or not 
    279289 
     
    319329      CALL var_def_extra(TRIM(cn_varcfg)) 
    320330 
     331      ! get dimension allowed 
     332      CALL dim_def_extra(TRIM(cn_dimcfg)) 
     333 
    321334      ! get dummy variable 
    322335      CALL var_get_dummy(TRIM(cn_dumcfg)) 
     
    435448   DO jk=1,ip_ncard 
    436449      CALL merge_bathy_get_boundary(tl_bathy0, tl_bathy1, tl_bdy(jk), & 
    437       &                             il_rho(:),                        & 
     450      &                             il_rho(:), in_ncrs,                      & 
    438451      &                             dl_refined(:,:,:,:), dl_weight(:,:,:,:), & 
    439452      &                             dl_fill) 
     
    621634   DEALLOCATE(dl_weight) 
    622635   CALL boundary_clean(tl_bdy(:)) 
     636   CALL var_clean_extra() 
    623637 
    624638   ! close log file 
     
    638652   !> @param[in] td_bdy          boundary structure 
    639653   !> @param[in] id_rho          array of refinement factor 
     654   !> @param[in] id_ncrs         number of point with coarse value save at boundaries 
    640655   !> @param[inout] dd_refined   array of refined bathymetry  
    641656   !> @param[inout] dd_weight    array of weight 
    642657   !> @param[in] dd_fill         fillValue 
    643658   !> 
    644    !> @todo improve boundary weight function 
    645659   !------------------------------------------------------------------- 
    646660   SUBROUTINE merge_bathy_get_boundary( td_bathy0, td_bathy1, td_bdy, & 
    647    &                                    id_rho,                       & 
     661   &                                    id_rho, id_ncrs,              & 
    648662   &                                    dd_refined, dd_weight, dd_fill ) 
    649663 
     
    655669      TYPE(TBDY)                     , INTENT(IN   ) :: td_bdy 
    656670      INTEGER(i4), DIMENSION(:)      , INTENT(IN   ) :: id_rho 
     671      INTEGER(i4)                    , INTENT(IN   ) :: id_ncrs 
    657672      REAL(dp)   , DIMENSION(:,:,:,:), INTENT(INOUT) :: dd_refined 
    658673      REAL(dp)   , DIMENSION(:,:,:,:), INTENT(INOUT) :: dd_weight 
     
    670685      INTEGER(i4) :: il_jmax0 
    671686 
     687      INTEGER(i4) :: il_width 
     688 
    672689      INTEGER(i4), DIMENSION(2,2)         :: il_offset 
    673690      INTEGER(i4), DIMENSION(2,2)         :: il_ind 
     
    838855            CASE('north') 
    839856 
    840 !               ! npoint coarse 
    841 !               il_width=td_bdy%t_seg(jl)%i_width-id_npoint 
    842 !               ! compute "distance" 
    843 !               dl_tmp1d(:)=(/(ji,ji=il_width-1,1,-1),(0,ji=1,id_npoint)/) 
    844 !               ! compute weight on segment 
    845 !               dl_tmp1d(:)= 0.5 + 0.5*COS( (dp_pi*dl_tmp1d(:)) / & 
    846 !               &                           (il_width) ) 
    847  
     857 
     858               ! save n coarse point 
     859               il_width=td_bdy%t_seg(jl)%i_width-id_ncrs 
    848860               ! compute "distance" 
    849                dl_tmp1d(:)=(/(ji-1,ji=td_bdy%t_seg(jl)%i_width-1,1,-1),0/) 
     861               dl_tmp1d(:)=(/(ji,ji=il_width,1,-1),(0,ji=1,id_ncrs)/) 
    850862 
    851863               ! compute weight on segment 
    852864               dl_tmp1d(:)= 0.5 + 0.5*COS( (dp_pi*dl_tmp1d(:)) / & 
    853                &                           (td_bdy%t_seg(jl)%i_width) ) 
     865               &                           (il_width) ) 
     866 
    854867 
    855868               ALLOCATE( dl_wseg(tl_dom1%t_dim(1)%i_len, & 
     
    862875            CASE('south') 
    863876 
     877               ! save n coarse point 
     878               il_width=td_bdy%t_seg(jl)%i_width-id_ncrs 
    864879               ! compute "distance" 
    865                dl_tmp1d(:)=(/0,(ji-1,ji=1,td_bdy%t_seg(jl)%i_width-1)/)                
     880               dl_tmp1d(:)=(/(0,ji=1,id_ncrs),(ji,ji=1,il_width)/) 
    866881 
    867882               ! compute weight on segment 
    868883               dl_tmp1d(:)= 0.5 + 0.5*COS( (dp_pi*dl_tmp1d(:)) / & 
    869                &                           (td_bdy%t_seg(jl)%i_width) ) 
     884               &                           (il_width) ) 
     885 
    870886 
    871887               ALLOCATE( dl_wseg(tl_dom1%t_dim(1)%i_len, & 
     
    878894            CASE('east') 
    879895 
     896               ! save n coarse point 
     897               il_width=td_bdy%t_seg(jl)%i_width-id_ncrs 
    880898               ! compute "distance" 
    881                dl_tmp1d(:)=(/(ji-1,ji=td_bdy%t_seg(jl)%i_width-1,1,-1),0/) 
     899               dl_tmp1d(:)=(/(ji,ji=il_width,1,-1),(0,ji=1,id_ncrs)/) 
    882900 
    883901               ! compute weight on segment 
    884902               dl_tmp1d(:)= 0.5 + 0.5*COS( (dp_pi*dl_tmp1d(:)) / & 
    885                &                           (td_bdy%t_seg(jl)%i_width) ) 
     903               &                           (il_width) ) 
     904 
    886905 
    887906               ALLOCATE( dl_wseg(tl_dom1%t_dim(1)%i_len, & 
     
    894913            CASE('west') 
    895914 
     915               ! save n coarse point 
     916               il_width=td_bdy%t_seg(jl)%i_width-id_ncrs 
    896917               ! compute "distance" 
    897                dl_tmp1d(:)=(/0,(ji-1,ji=1,td_bdy%t_seg(jl)%i_width-1)/)                
     918               dl_tmp1d(:)=(/(0,ji=1,id_ncrs),(ji,ji=1,il_width)/) 
    898919 
    899920               ! compute weight on segment 
    900921               dl_tmp1d(:)= 0.5 + 0.5*COS( (dp_pi*dl_tmp1d(:)) / & 
    901                &                           (td_bdy%t_seg(jl)%i_width) ) 
     922               &                           (il_width) ) 
     923 
    902924 
    903925               ALLOCATE( dl_wseg(tl_dom1%t_dim(1)%i_len, & 
  • branches/2016/dev_CNRS_MERCATOR_2016/NEMOGCM/TOOLS/SIREN/src/mpp.f90

    r6393 r7390  
    266266   PRIVATE :: mpp__copy_arr            ! copy array of mpp structure 
    267267   PRIVATE :: mpp__get_use_unit        ! get sub domains to be used (which cover "zoom domain") 
    268    PRIVATE :: mpp__init_mask           ! initialise mpp structure, given file name 
     268   PRIVATE :: mpp__init_mask           ! initialise mpp structure, given mask array 
    269269   PRIVATE :: mpp__init_var            ! initialise mpp structure, given variable strcuture 
    270270   PRIVATE :: mpp__init_file           ! initialise a mpp structure, given file structure  
     
    25502550   !> and the number of processors following I and J. 
    25512551   !> Then the number of sea/land processors is compute with mask 
    2552    ! 
     2552   !> 
    25532553   !> @author J.Paul 
    25542554   !> @date October, 2015 - Initial version 
    2555    ! 
     2555   !> @date October, 2016 
     2556   !> - compare index to td_lay number of proc instead of td_mpp (bug fix) 
     2557   !> 
    25562558   !> @param[in] td_mpp mpp strcuture 
    25572559   !> @param[in] id_mask   sub domain mask (sea=1, land=0) 
     
    26702672 
    26712673            ! east boundary 
    2672             IF( ji == td_mpp%i_niproc )THEN 
     2674            IF( ji == td_lay%i_niproc )THEN 
    26732675               il_lei = td_lay%i_lci(ji,jj) 
    26742676            ELSE 
     
    26772679 
    26782680            ! north boundary 
    2679             IF( jj == td_mpp%i_njproc )THEN 
     2681            IF( jj == td_lay%i_njproc )THEN 
    26802682               il_lej = td_lay%i_lcj(ji,jj) 
    26812683            ELSE 
  • branches/2016/dev_CNRS_MERCATOR_2016/NEMOGCM/TOOLS/SIREN/src/phycst.f90

    r6393 r7390  
    3434   PUBLIC :: dp_siday   !< sideral day                        [s] 
    3535 
    36    REAL(wp), PUBLIC ::   rday = 24.*60.*60.     !: day                                [s] 
    37    REAL(wp), PUBLIC ::   rsiyea                 !: sideral year                       [s] 
    38    REAL(wp), PUBLIC ::   rsiday                 !: sideral day                        [s] 
     36   REAL(dp), PUBLIC ::   rday = 24.*60.*60.     !: day                                [s] 
     37   REAL(dp), PUBLIC ::   rsiyea                 !: sideral year                       [s] 
     38   REAL(dp), PUBLIC ::   rsiday                 !: sideral day                        [s] 
    3939 
    4040   REAL(dp), PARAMETER :: dp_pi = 3.14159274101257_dp 
    41    REAL(dp), PARAMETER :: dp_eps = EPSILON(1._dp) 
     41   REAL(dp), PARAMETER :: dp_eps = 0.5 * EPSILON(1._dp) 
    4242   REAL(dp), PARAMETER :: dp_rearth = 6371229._dp 
    4343   REAL(dp), PARAMETER :: dp_deg2rad = dp_pi/180.0 
     
    4545 
    4646   REAL(dp), PARAMETER :: dp_day = 24.*60.*60.      
    47    REAL(dp), PARAMETER :: dp_siyea = 365.25_wp * dp_day * & 
    48       &  2._wp * dp_pi / 6.283076_dp 
    49    REAL(dp), PARAMETER :: dp_siday = dp_day / ( 1._wp + dp_day / dp_siyea ) 
     47   REAL(dp), PARAMETER :: dp_siyea = 365.25_dp * dp_day * & 
     48      &  2._dp * dp_pi / 6.283076_dp 
     49   REAL(dp), PARAMETER :: dp_siday = dp_day / ( 1._dp + dp_day / dp_siyea ) 
    5050 
    51    REAL(dp), PARAMETER :: dp_delta=1.e-6 
     51   REAL(dp), PARAMETER :: dp_delta=1.e-5 
    5252   REAL(dp), PARAMETER :: dp_omega= 2._dp * dp_pi / dp_siday 
    5353END MODULE phycst 
  • branches/2016/dev_CNRS_MERCATOR_2016/NEMOGCM/TOOLS/SIREN/src/variable.f90

    r6393 r7390  
    3434!>    Note:<br/> 
    3535!>       - others optionals arguments could be added, see var_init. 
    36 !>       - to put variable 0D, use td_dim with all dimension unused 
     36!>       - to put scalar variable (OD), use td_dim with all dimension unused 
    3737!> (td_dim(:)%l_use=.FALSE.) 
    3838!>     
     
    267267!>    - cd_varinfo is variable information from namelist 
    268268!> 
     269!>    to clean global array of variable structure:<br/> 
     270!>@code 
     271!>    CALL var_clean_extra( ) 
     272!>@endcode 
     273!> 
    269274!>    to check variable dimension expected, as defined in file 'variable.cfg':<br/> 
    270275!>@code 
     
    287292!> @date Spetember, 2015 
    288293!> - manage useless (dummy) variable 
    289 ! 
     294!> @date October, 2016 
     295!> - add subroutine to clean global array of extra information. 
     296!> - define logical for variable to be used 
     297!> 
    290298!> @note Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt) 
    291299!---------------------------------------------------------------------- 
     
    337345   PUBLIC :: var_def_extra     !< read variable configuration file, and save extra information. 
    338346   PUBLIC :: var_chg_extra     !< read variable namelist information, and modify extra information. 
     347   PUBLIC :: var_clean_extra   !< clean gloabl array of extra information. 
    339348   PUBLIC :: var_check_dim     !< check variable dimension expected 
    340349   PUBLIC :: var_get_dummy     !< fill dummy variable array 
     
    416425      TYPE(TDIM), DIMENSION(ip_maxdim)  :: t_dim           !< variable dimension 
    417426  
    418       LOGICAL           :: l_file = .FALSE.  !< variable read in a file 
     427      LOGICAL           :: l_file = .FALSE. !< variable read in a file 
     428      LOGICAL           :: l_use  = .TRUE.  !< variable to be used 
    419429 
    420430      ! highlight some attributes 
     
    451461                                                        !< fill when running var_def_extra()  
    452462 
    453    CHARACTER(LEN=lc), DIMENSION(ip_maxdum), SAVE :: cm_dumvar !< dummy variable 
     463   CHARACTER(LEN=lc), DIMENSION(ip_maxdumcfg), SAVE :: cm_dumvar !< dummy variable 
    454464 
    455465   INTERFACE var_init 
     
    593603         CALL att_clean(tl_att) 
    594604      ENDIF 
     605 
     606      var__copy_unit%l_file     = td_var%l_file 
     607      var__copy_unit%l_use      = td_var%l_use 
    595608 
    596609      ! copy highlight attribute 
     
    11261139   !> @date July, 2015 
    11271140   !> - add unit factor (to change unit) 
     1141   !> @date November, 2016 
     1142   !> - allow to add scalar value 
    11281143   !> 
    11291144   !> @param[in] cd_name         variable name 
     
    12791294         dl_value(1,1,1,:) = dd_value(:) 
    12801295      ELSE 
    1281          CALL logger_fatal("VAR INIT: can not add value from variable "//& 
    1282          &  TRIM(cd_name)//". invalid dimension to be used") 
     1296         IF( SIZE(dd_value(:)) > 1 )THEN 
     1297            CALL logger_fatal("VAR INIT: can not add value from variable "//& 
     1298            &  TRIM(cd_name)//". invalid dimension to be used") 
     1299         ELSE 
     1300            dl_value(1,1,1,1) = dd_value(1) 
     1301            CALL logger_warn("VAR INIT: add scalar value for variable "//& 
     1302            &  TRIM(cd_name)) 
     1303 
     1304         ENDIF 
    12831305      ENDIF 
    12841306 
     
    66696691      ! check if variable is in array of variable structure 
    66706692      DO ji=1,il_size 
     6693 
    66716694         ! look for variable name 
    66726695         IF( fct_lower(td_var(ji)%c_name) == fct_lower(cd_name) )THEN 
     
    66836706 
    66846707         ELSE IF( PRESENT(cd_stdname) )THEN  
     6708 
    66856709            IF( fct_lower(td_var(ji)%c_stdname) == fct_lower(cd_stdname) .AND.& 
    66866710            &    TRIM(fct_lower(td_var(ji)%c_stdname)) /= '' )THEN 
     
    66906714            ENDIF 
    66916715 
     6716         ENDIF 
     6717 
    66926718         ! look for variable longname 
    6693          ELSE IF( fct_lower(td_var(ji)%c_longname) == fct_lower(cd_name) .AND.& 
    6694          &    TRIM(fct_lower(td_var(ji)%c_longname)) /= '' )THEN 
     6719         IF( fct_lower(td_var(ji)%c_longname) == fct_lower(cd_name) .AND.& 
     6720         &   TRIM(fct_lower(td_var(ji)%c_longname)) /= '' )THEN 
    66956721             
    66966722            var_get_index=ji 
    66976723            EXIT 
     6724 
     6725         ELSE IF( PRESENT(cd_stdname) )THEN 
     6726 
     6727            IF( fct_lower(td_var(ji)%c_longname) == fct_lower(cd_stdname) .AND.& 
     6728            &    TRIM(fct_lower(td_var(ji)%c_longname)) /= '' )THEN 
     6729             
     6730               var_get_index=ji 
     6731               EXIT 
     6732            ENDIF 
    66986733 
    66996734         ENDIF 
     
    67346769      ! check if variable is in array of variable structure 
    67356770      DO ji=1,il_size 
     6771       
    67366772         ! look for variable name 
    67376773         IF( fct_lower(td_var(ji)%c_name) == fct_lower(cd_name) )THEN 
     
    67476783            EXIT 
    67486784 
    6749          ! look for variable long name 
    6750          ELSE IF( fct_lower(td_var(ji)%c_longname) == fct_lower(cd_name) .AND.& 
    6751          &    TRIM(fct_lower(td_var(ji)%c_longname)) /= '' )THEN 
    6752              
    6753             var_get_id=td_var(ji)%i_id 
    6754             EXIT 
    6755  
    6756          ELSE IF( PRESENT(cd_stdname) )THEN  
     6785         ELSE IF( PRESENT(cd_stdname) )THEN 
     6786 
    67576787            IF( fct_lower(td_var(ji)%c_stdname) == fct_lower(cd_stdname) .AND.& 
    67586788            &    TRIM(fct_lower(td_var(ji)%c_stdname)) /= '' )THEN 
     
    67616791               EXIT 
    67626792            ENDIF 
     6793 
     6794         ENDIF 
     6795 
     6796         ! look for variable long name 
     6797         IF( fct_lower(td_var(ji)%c_longname) == fct_lower(cd_name) .AND.& 
     6798         &    TRIM(fct_lower(td_var(ji)%c_longname)) /= '' )THEN 
     6799             
     6800            var_get_id=td_var(ji)%i_id 
     6801            EXIT 
     6802 
     6803         ELSE IF( PRESENT(cd_stdname) )THEN  
     6804 
     6805            IF( fct_lower(td_var(ji)%c_longname) == fct_lower(cd_stdname) .AND.& 
     6806            &    TRIM(fct_lower(td_var(ji)%c_longname)) /= '' )THEN 
     6807             
     6808               var_get_id=td_var(ji)%i_id 
     6809               EXIT 
     6810            ENDIF 
     6811 
    67636812         ENDIF 
    67646813 
     
    71767225   !------------------------------------------------------------------- 
    71777226   !> @brief 
     7227   !> This subroutine clean global array of variable structure  
     7228   !> with extra information: tg_varextra. 
     7229   !>  
     7230   !> @author J.Paul 
     7231   !> @date October, 2016 - Initial Version 
     7232   !------------------------------------------------------------------- 
     7233   SUBROUTINE var_clean_extra( ) 
     7234      IMPLICIT NONE 
     7235      ! Argument 
     7236      !---------------------------------------------------------------- 
     7237 
     7238      CALL var_clean(tg_varextra(:)) 
     7239      DEALLOCATE(tg_varextra) 
     7240 
     7241   END SUBROUTINE var_clean_extra 
     7242   !------------------------------------------------------------------- 
     7243   !> @brief 
    71787244   !> This subroutine read matrix value from character string in namelist 
    7179    !> and fill variable strucutre value. 
     7245   !> and fill variable structure value. 
    71807246   !> 
    71817247   !> @details 
     
    84638529      ! loop indices 
    84648530      ! namelist 
    8465       CHARACTER(LEN=lc), DIMENSION(ip_maxdum) :: cn_dumvar 
    8466       CHARACTER(LEN=lc), DIMENSION(ip_maxdum) :: cn_dumdim 
    8467       CHARACTER(LEN=lc), DIMENSION(ip_maxdum) :: cn_dumatt 
     8531      CHARACTER(LEN=lc), DIMENSION(ip_maxdumcfg) :: cn_dumvar 
     8532      CHARACTER(LEN=lc), DIMENSION(ip_maxdumcfg) :: cn_dumdim 
     8533      CHARACTER(LEN=lc), DIMENSION(ip_maxdumcfg) :: cn_dumatt 
    84688534 
    84698535      !---------------------------------------------------------------- 
     
    85268592 
    85278593      var_is_dummy=.FALSE. 
    8528       DO ji=1,ip_maxdum 
     8594      DO ji=1,ip_maxdumcfg 
    85298595         IF( fct_lower(td_var%c_name) == fct_lower(cm_dumvar(ji)) )THEN 
    85308596            var_is_dummy=.TRUE. 
  • branches/2016/dev_CNRS_MERCATOR_2016/NEMOGCM/TOOLS/SIREN/src/vgrid.f90

    r6393 r7390  
    1414!>    CALL vgrid_zgr_z(dd_gdepw(:), dd_gdept(:), dd_e3w(:), dd_e3t(:),  
    1515!>                     dd_ppkth, dd_ppkth2, dd_ppacr, dd_ppacr2,  
    16 !>                     dd_ppdzmin, dd_pphmax, dd_pp_to_be_computed,  
     16!>                     dd_ppdzmin, dd_pphmax,  
    1717!>                     dd_ppa0, dd_ppa1, dd_ppa2, dd_ppsur) 
    1818!> @endcode 
     
    2626!>       - dd_ppdzmin            see NEMO documentation 
    2727!>       - dd_pphmax             see NEMO documentation 
    28 !>       - dd_pp_to_be_computed  see NEMO documentation 
    2928!>       - dd_ppa1               see NEMO documentation 
    3029!>       - dd_ppa2               see NEMO documentation 
     
    133132   !> @param[in] dd_ppdzmin 
    134133   !> @param[in] dd_pphmax  
    135    !> @param[in] dd_pp_to_be_computed 
    136134   !> @param[in] dd_ppa1 
    137135   !> @param[in] dd_ppa2  
     
    140138   !------------------------------------------------------------------- 
    141139   SUBROUTINE vgrid_zgr_z( dd_gdepw, dd_gdept, dd_e3w, dd_e3t,          & 
    142    &                       dd_e3w_1d, dd_e3t_1d, & 
     140   &                       dd_e3w_1d, dd_e3t_1d,                        & 
    143141   &                       dd_ppkth, dd_ppkth2, dd_ppacr, dd_ppacr2,    & 
    144    &                       dd_ppdzmin, dd_pphmax, dd_pp_to_be_computed, & 
     142   &                       dd_ppdzmin, dd_pphmax,                       & 
    145143   &                       dd_ppa0, dd_ppa1, dd_ppa2, dd_ppsur ) 
    146144      IMPLICIT NONE 
     
    160158      REAL(dp)              , INTENT(IN   ) :: dd_ppdzmin 
    161159      REAL(dp)              , INTENT(IN   ) :: dd_pphmax 
    162       REAL(dp)              , INTENT(IN   ) :: dd_pp_to_be_computed 
     160      REAL(dp), PARAMETER                   :: dp_pp_to_be_computed = NF90_FILL_DOUBLE 
    163161 
    164162      REAL(dp)              , INTENT(IN   ) :: dd_ppa0 
     
    207205      !  za0, za1, zsur are computed from ppdzmin , pphmax, ppkth, ppacr 
    208206      ! 
    209        IF(  dd_ppa1  == dd_pp_to_be_computed  .AND.  & 
    210          &  dd_ppa0  == dd_pp_to_be_computed  .AND.  & 
    211          &  dd_ppsur == dd_pp_to_be_computed           ) THEN 
     207       IF(  dd_ppa1  == dp_pp_to_be_computed  .AND.  & 
     208         &  dd_ppa0  == dp_pp_to_be_computed  .AND.  & 
     209         &  dd_ppsur == dp_pp_to_be_computed           ) THEN 
    212210         dl_za1 = ( dl_zdzmin - dl_zhmax / REAL((il_jpk-1),dp) ) & 
    213211             &     / ( TANH((1-dl_zkth)/dl_zacr) - dl_zacr/REAL((il_jpk-1),dp) & 
     
    667665 
    668666      !namelist (intialise with GLORYS 75 levels parameters) 
    669       REAL(dp)                                :: dn_pp_to_be_computed = 0._dp 
    670667      REAL(dp)                                :: dn_ppsur     = -3958.951371276829_dp 
    671668      REAL(dp)                                :: dn_ppa0      =   103.9530096000000_dp 
     
    684681      !---------------------------------------------------------------- 
    685682      NAMELIST /namzgr/ & 
    686       &  dn_pp_to_be_computed, & 
    687683      &  dn_ppsur,     & 
    688684      &  dn_ppa0,      & 
     
    788784      &                 dl_e3w_1d, dl_e3t_1d, & 
    789785      &                 dn_ppkth, dn_ppkth2, dn_ppacr, dn_ppacr2,       & 
    790       &                 dn_ppdzmin, dn_pphmax, dn_pp_to_be_computed,    & 
     786      &                 dn_ppdzmin, dn_pphmax, & 
    791787      &                 dn_ppa0, dn_ppa1, dn_ppa2, dn_ppsur ) 
    792788 
  • branches/2016/dev_CNRS_MERCATOR_2016/NEMOGCM/TOOLS/SIREN/templates/merge_bathy.nam

    r6393 r7390  
    3434   cn_east= 
    3535   cn_west= 
     36   in_ncrs= 
    3637   ln_oneseg= 
    3738/ 
Note: See TracChangeset for help on using the changeset viewer.