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

Changeset 7200


Ignore:
Timestamp:
2016-11-06T17:31:33+01:00 (7 years ago)
Author:
gm
Message:

#1692 - branch SIMPLIF_2_usrdef: add depth_e3 module + management of ORCA family + domain_cfg filename (in&out) given in namelist

Location:
branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM
Files:
1 added
54 edited

Legend:

Unmodified
Added
Removed
  • branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/CONFIG/AMM12/EXP00/namelist_cfg

    r6982 r7200  
    2020&namcfg        !   parameters of the configuration 
    2121!----------------------------------------------------------------------- 
    22    ln_read_cfg = .true.   !  (=T) read the domain configuration in 'domain_cfg.nc" file 
    23    !                       !  (=F) user defined configuration  ==>>>  see usrdef(_...) modules 
    24    ln_write_cfg= .false.   !  (=T) create the domain configuration file 
    25    ! 
    26    cp_cfg      =  "amm"    !  name of the configuration 
    27    jp_cfg      =     011   !  resolution of the configuration 
     22   ln_read_cfg = .false.   !  (=T) read the domain configuration file 
     23      !                    !  (=F) user defined configuration  ==>>>  see usrdef(_...) modules 
     24      cn_domcfg = "AMM_R12_domcfg"     ! domain configuration filename 
    2825/ 
    2926 
  • branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/CONFIG/GYRE/EXP00/namelist_cfg

    r7188 r7200  
    2525&namcfg     !   parameters of the configuration    
    2626!----------------------------------------------------------------------- 
    27    ln_read_cfg = .false.   !  (=T) read the domain configuration in 'domain_cfg.nc" file 
    28    !                       !  (=F) user defined configuration  ==>>>  see usrdef(_...) modules 
     27   ln_read_cfg = .false.   !  (=T) read the domain configuration file 
     28      !                    !  (=F) user defined configuration  ==>>>  see usrdef(_...) modules 
    2929   ln_write_cfg= .false.   !  (=T) create the domain configuration file 
    3030   ! 
    31    cp_cfg      = "default" !  name of the configuration 
    32    jp_cfg      =      0    !  resolution of the configuration 
    33    ln_use_jattr = .false.  !  use (T) the file attribute: open_ocean_jstart, if present 
    34    !                       !  in netcdf input files, as the start j-row for reading 
    3531/ 
    3632!----------------------------------------------------------------------- 
  • branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/CONFIG/GYRE_BFM/EXP00/namelist_cfg

    r7188 r7200  
    2222&namcfg     !   parameters of the configuration    
    2323!----------------------------------------------------------------------- 
    24    ln_read_cfg = .false.   !  (=T) read the domain configuration in 'domain_cfg.nc" file 
    25    !                       !  (=F) user defined configuration  ==>>>  see usrdef(_...) modules 
     24   ln_read_cfg = .false.   !  (=T) read the domain configuration file 
     25      !                    !  (=F) user defined configuration  ==>>>  see usrdef(_...) modules 
    2626   ln_write_cfg= .false.   !  (=T) create the domain configuration file 
    27    ! 
    28    cp_cfg      = "default" !  name of the configuration 
    29    jp_cfg      =      0    !  resolution of the configuration 
    30    ln_use_jattr = .false.  !  use (T) the file attribute: open_ocean_jstart, if present 
    31    !                       !  in netcdf input files, as the start j-row for reading 
    3227/ 
    3328!----------------------------------------------------------------------- 
  • branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/CONFIG/GYRE_PISCES/EXP00/namelist_cfg

    r7188 r7200  
    1515&namcfg     !   parameters of the configuration    
    1616!----------------------------------------------------------------------- 
    17    ln_read_cfg = .false.   !  (=T) read the domain configuration in 'domain_cfg.nc" file 
    18    !                       !  (=F) user defined configuration  ==>>>  see usrdef(_...) modules 
     17   ln_read_cfg = .false.   !  (=T) read the domain configuration file 
     18      !                    !  (=F) user defined configuration  ==>>>  see usrdef(_...) modules 
    1919   ln_write_cfg= .false.   !  (=T) create the domain configuration file 
    20    ! 
    21    cp_cfg      = "default" !  name of the configuration 
    22    jp_cfg      =      0    !  resolution of the configuration 
    23    ln_use_jattr = .false.  !  use (T) the file attribute: open_ocean_jstart, if present 
    24    !                       !  in netcdf input files, as the start j-row for reading 
    2520/ 
    2621!----------------------------------------------------------------------- 
  • branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/CONFIG/GYRE_XIOS/EXP00/namelist_cfg

    r7188 r7200  
    1515&namcfg     !   parameters of the configuration    
    1616!----------------------------------------------------------------------- 
    17    ln_read_cfg = .false.   !  (=T) read the domain configuration in 'domain_cfg.nc" file 
    18    !                       !  (=F) user defined configuration  ==>>>  see usrdef(_...) modules 
     17   ln_read_cfg = .false.   !  (=T) read the domain configuration file 
     18      !                    !  (=F) user defined configuration  ==>>>  see usrdef(_...) modules 
    1919   ln_write_cfg= .false.   !  (=T) create the domain configuration file 
    20    ! 
    21    cp_cfg      = "default" !  name of the configuration 
    22    jp_cfg      =      0    !  resolution of the configuration 
    23    ln_use_jattr = .false.  !  use (T) the file attribute: open_ocean_jstart, if present 
    24    !                       !  in netcdf input files, as the start j-row for reading 
    2520/ 
    2621!----------------------------------------------------------------------- 
  • branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/CONFIG/ISOMIP/EXP00/namelist_cfg

    r7112 r7200  
    2020&namcfg     !   parameters of the configuration    
    2121!----------------------------------------------------------------------- 
    22    ln_read_cfg = .true.    !  (=T) read the domain configuration in 'domain_cfg.nc" file 
    23    !                       !  (=F) user defined configuration  ==>>>  see usrdef(_...) modules 
    24    ln_write_cfg= .false.   !  (=T) create the domain configuration file 
    25    ! 
    26    cp_cfg      = "default" !  name of the configuration 
    27    jp_cfg      =      0    !  resolution of the configuration 
    28    ln_use_jattr = .false.  !  use (T) the file attribute: open_ocean_jstart, if present 
    29    !                       !  in netcdf input files, as the start j-row for reading 
     22   ln_read_cfg = .true.    !  (=T) read the domain configuration file 
     23      !                    !  (=F) user defined configuration  ==>>>  see usrdef(_...) modules 
     24      cn_domcfg = "ISOMIP_domcfg"      ! domain configuration filename 
    3025/ 
    3126!----------------------------------------------------------------------- 
     
    3328!----------------------------------------------------------------------- 
    3429   ln_linssh   = .true.    !  =T  linear free surface  ==>>  model level are fixed in time 
    35  !  ln_isfcav   = .true.    !  ice shelf cavity 
     30   ln_isfcav   = .true.    !  ice shelf cavity 
    3631   ! 
    3732   nn_msh      =    0      !  create (>0) a mesh file or not (=0) 
  • branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/CONFIG/LOCK_EXCHANGE/EXP00/namelist_cfg

    r6914 r7200  
    2424&namcfg        !   parameters of the configuration 
    2525!----------------------------------------------------------------------- 
    26    ln_read_cfg = .false.   !  (=T) read the domain configuration in 'domain_cfg.nc" file 
    27    !                       !  (=F) user defined configuration  ==>>>  see usrdef(_...) modules 
     26   ln_read_cfg = .false.   !  (=T) read the domain configuration file 
     27      !                    !  (=F) user defined configuration  ==>>>  see usrdef(_...) modules 
    2828   ln_write_cfg= .false.   !  (=T) create the domain configuration file 
    29    ! 
    30    cp_cfg      = "lock"    !  name of the configuration 
    31    jp_cfg      =      0    !  resolution of the configuration 
    32    ln_use_jattr = .false.  !  use (T) the file attribute: open_ocean_jstart, if present 
    33    !                       !  in netcdf input files, as the start j-row for reading 
    3429/ 
    3530!----------------------------------------------------------------------- 
  • branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/CONFIG/LOCK_EXCHANGE/MY_SRC/usrdef_nam.F90

    r6923 r7200  
    3838CONTAINS 
    3939 
    40    SUBROUTINE usr_def_nam( ldtxt, ldnam, kpi, kpj, kpk, kperio ) 
     40   SUBROUTINE usr_def_nam( ldtxt, ldnam, cd_cfg, kk_cfg, kpi, kpj, kpk, kperio ) 
    4141      !!---------------------------------------------------------------------- 
    4242      !!                     ***  ROUTINE dom_nam  *** 
     
    5151      !!---------------------------------------------------------------------- 
    5252      CHARACTER(len=*), DIMENSION(:), INTENT(out) ::   ldtxt, ldnam    ! stored print information 
     53      CHARACTER(len=*)              , INTENT(out) ::   cd_cfg          ! configuration name 
     54      INTEGER                       , INTENT(out) ::   kk_cfg          ! configuration resolution 
    5355      INTEGER                       , INTENT(out) ::   kpi, kpj, kpk   ! global domain sizes  
    5456      INTEGER                       , INTENT(out) ::   kperio          ! lateral global domain b.c.  
     
    6668      ! 
    6769      WRITE( ldnam(:), namusr_def ) 
     70      ! 
     71      ! 
     72      cd_cfg = 'LOCK_EXCHANGE'      ! name & resolution (not used) 
     73      cp_cfg = INT( rn_dx ) 
    6874      ! 
    6975      ! Global Domain size:  LOCK_EXCHANGE domain is 64 km x 3 grid-points x 20 m 
  • branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/1_namelist_cfg

    r6624 r7200  
    1515&namcfg        !   parameters of the configuration 
    1616!----------------------------------------------------------------------- 
    17    cp_cfg      =  "default"             !  name of the configuration 
    18    jp_cfg      =      -1               !  resolution of the configuration 
     17   ln_read_cfg = .true.    !  (=T) read the domain configuration file 
     18      !                    !  (=F) user defined configuration  ==>>>  see usrdef(_...) modules 
     19      cn_domcfg = "AGRIF_AGULHAS_domain_cfg"    ! domain configuration filename 
    1920/ 
    2021!----------------------------------------------------------------------- 
  • branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/namelist_cfg

    r6982 r7200  
    1414&namcfg     !   parameters of the configuration 
    1515!----------------------------------------------------------------------- 
    16    ln_read_cfg = .true.   !  (=T) read the domain configuration in 'domain_cfg.nc" file 
    17    !                       !  (=F) user defined configuration  ==>>>  see usrdef(_...) modules 
    18    ln_write_cfg= .false.    !  (=T) create the domain configuration file 
    19    ! 
    20    cp_cfg      =  "orca"   !  name of the configuration 
    21    jp_cfg      =       2   !  resolution of the configuration 
    22    ln_use_jattr = .false.  !  use (T) the file attribute: open_ocean_jstart, if present 
    23    !                       !  in netcdf input files, as the start j-row for reading 
     16   ln_read_cfg = .true.    !  (=T) read the domain configuration file 
     17      !                    !  (=F) user defined configuration  ==>>>  see usrdef(_...) modules 
     18      cn_domcfg = "ORCA_R2_domcfg"    ! domain configuration filename 
    2419/ 
    2520!----------------------------------------------------------------------- 
  • branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/CONFIG/ORCA2_LIM3/EXP00/1_namelist_cfg

    r6624 r7200  
    1414&namcfg        !   parameters of the configuration 
    1515!----------------------------------------------------------------------- 
    16    cp_cfg      =  "default"             !  name of the configuration 
    17    jp_cfg      =      -1               !  resolution of the configuration 
     16   ln_read_cfg = .true.    !  (=T) read the domain configuration file 
     17      !                    !  (=F) user defined configuration  ==>>>  see usrdef(_...) modules 
     18      cn_domcfg = "AGRIF_AGULHAS_domcfg"    ! domain configuration filename 
    1819/ 
    1920!----------------------------------------------------------------------- 
  • branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/CONFIG/ORCA2_LIM3/EXP00/namelist_cfg

    r7110 r7200  
    1414&namcfg     !   parameters of the configuration 
    1515!----------------------------------------------------------------------- 
    16    ln_read_cfg = .true.   !  (=T) read the domain configuration in 'domain_cfg.nc" file 
    17    !                       !  (=F) user defined configuration  ==>>>  see usrdef(_...) modules 
    18    ln_write_cfg= .false.    !  (=T) create the domain configuration file 
    19    ! 
    20    cp_cfg      =  "orca"   !  name of the configuration 
    21    jp_cfg      =       2   !  resolution of the configuration 
    22    ln_use_jattr = .false.  !  use (T) the file attribute: open_ocean_jstart, if present 
    23    !                       !  in netcdf input files, as the start j-row for reading 
     16   ln_read_cfg = .true.    !  (=T) read the domain configuration file 
     17      !                    !  (=F) user defined configuration  ==>>>  see usrdef(_...) modules 
     18      cn_domcfg = "ORCA_R2_domcfg"    ! domain configuration filename 
    2419/ 
    2520!----------------------------------------------------------------------- 
  • branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/CONFIG/ORCA2_LIM_CFC_C14b/EXP00/namelist_cfg

    r6624 r7200  
    1717&namcfg        !   parameters of the configuration 
    1818!----------------------------------------------------------------------- 
    19    cp_cfg      =  "orca"               !  name of the configuration 
    20    jp_cfg      =       2               !  resolution of the configuration 
     19   ln_read_cfg = .true.    !  (=T) read the domain configuration file 
     20      !                    !  (=F) user defined configuration  ==>>>  see usrdef(_...) modules 
     21      cn_domcfg = "ORCA_R2_domcfg"    ! domain configuration filename 
    2122/ 
    2223!----------------------------------------------------------------------- 
  • branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/CONFIG/ORCA2_LIM_PISCES/EXP00/namelist_cfg

    r7005 r7200  
    1414&namcfg     !   parameters of the configuration 
    1515!----------------------------------------------------------------------- 
    16    ln_read_cfg = .true.   !  (=T) read the domain configuration in 'domain_cfg.nc" file 
    17    !                       !  (=F) user defined configuration  ==>>>  see usrdef(_...) modules 
    18    ln_write_cfg= .false.    !  (=T) create the domain configuration file 
    19    ! 
    20    cp_cfg      =  "orca"   !  name of the configuration 
    21    jp_cfg      =       2   !  resolution of the configuration 
    22    ln_use_jattr = .false.  !  use (T) the file attribute: open_ocean_jstart, if present 
    23    !                       !  in netcdf input files, as the start j-row for reading 
     16   ln_read_cfg = .true.    !  (=T) read the domain configuration file 
     17      !                    !  (=F) user defined configuration  ==>>>  see usrdef(_...) modules 
     18      cn_domcfg = "ORCA_R2_domcfg"    ! domain configuration filename 
    2419/ 
    2520!----------------------------------------------------------------------- 
  • branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/CONFIG/ORCA2_OFF_PISCES/EXP00/namelist_cfg

    r6979 r7200  
    1313&namcfg        !   parameters of the configuration 
    1414!----------------------------------------------------------------------- 
    15    ln_read_cfg = .true.   !  (=T) read the domain configuration in 'domain_cfg.nc" file 
    16    !                       !  (=F) user defined configuration  ==>>>  see usrdef(_...) modules 
    17    cp_cfg      = "orca" !  name of the configuration 
    18    jp_cfg      =      2    !  resolution of the configuration 
     15   ln_read_cfg = .true.    !  (=T) read the domain configuration file 
     16      !                    !  (=F) user defined configuration  ==>>>  see usrdef(_...) modules 
     17      cn_domcfg = "ORCA_R2_domcfg"    ! domain configuration filename 
    1918/ 
    2019!----------------------------------------------------------------------- 
  • branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/CONFIG/ORCA2_SAS_LIM/EXP00/namelist_cfg

    r7000 r7200  
    1414&namcfg     !   parameters of the configuration 
    1515!----------------------------------------------------------------------- 
    16    ln_read_cfg = .true.   !  (=T) read the domain configuration in 'domain_cfg.nc" file 
    17    !                       !  (=F) user defined configuration  ==>>>  see usrdef(_...) modules 
    18    ln_write_cfg= .false.    !  (=T) create the domain configuration file 
    19    ! 
    20    cp_cfg      =  "orca"   !  name of the configuration 
    21    jp_cfg      =       2   !  resolution of the configuration 
    22    ln_use_jattr = .false.  !  use (T) the file attribute: open_ocean_jstart, if present 
    23    !                       !  in netcdf input files, as the start j-row for reading 
     16   ln_read_cfg = .true.    !  (=T) read the domain configuration file 
     17      !                    !  (=F) user defined configuration  ==>>>  see usrdef(_...) modules 
     18      cn_domcfg = "ORCA_R2_domcfg"    ! domain configuration filename 
    2419/ 
    2520!----------------------------------------------------------------------- 
  • branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/CONFIG/OVERFLOW/EXP00/namelist_cfg

    r6914 r7200  
    3131   !                       !  (=F) user defined configuration  ==>>>  see usrdef(_...) modules 
    3232   ln_write_cfg= .false.   !  (=T) create the domain configuration file 
    33    ! 
    34    cp_cfg      = "overflow" !  name of the configuration 
    35    jp_cfg      =      0    !  resolution of the configuration 
    36    ln_use_jattr = .false.  !  use (T) the file attribute: open_ocean_jstart, if present 
    37    !                       !  in netcdf input files, as the start j-row for reading 
    3833/ 
    3934!----------------------------------------------------------------------- 
  • branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/CONFIG/OVERFLOW/MY_SRC/usrdef_nam.F90

    r6923 r7200  
    3939CONTAINS 
    4040 
    41    SUBROUTINE usr_def_nam( ldtxt, ldnam, kpi, kpj, kpk, kperio ) 
     41   SUBROUTINE usr_def_nam( ldtxt, ldnam, cd_cfg, kk_cfg, kpi, kpj, kpk, kperio ) 
    4242      !!---------------------------------------------------------------------- 
    4343      !!                     ***  ROUTINE dom_nam  *** 
     
    5252      !!---------------------------------------------------------------------- 
    5353      CHARACTER(len=*), DIMENSION(:), INTENT(out) ::   ldtxt, ldnam    ! stored print information 
     54      CHARACTER(len=*)              , INTENT(out) ::   cd_cfg          ! configuration name 
     55      INTEGER                       , INTENT(out) ::   kk_cfg          ! configuration resolution 
    5456      INTEGER                       , INTENT(out) ::   kpi, kpj, kpk   ! global domain sizes  
    5557      INTEGER                       , INTENT(out) ::   kperio          ! lateral global domain b.c.  
     
    6769      ! 
    6870      WRITE( ldnam(:), namusr_def ) 
     71      ! 
     72      cd_cfg = 'OVERFLOW'           ! name & resolution (not used) 
     73      kk_cfg = INT( rn_dx ) 
    6974      ! 
    7075      ! Global Domain size:  OVERFLOW domain is  200 km x 3 grid-points x 2000 m 
  • branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/CONFIG/SHARED/namelist_ref

    r7024 r7200  
    7171&namcfg        !   parameters of the configuration 
    7272!----------------------------------------------------------------------- 
    73    ln_read_cfg = .false.   !  (=T) read the domain configuration in 'domain_cfg.nc" file 
    74    !                       !  (=F) user defined configuration  ==>>>  see usrdef(_...) modules 
     73   ln_read_cfg = .false.   !  (=T) read the domain configuration file 
     74      !                    !  (=F) user defined configuration  ==>>>  see usrdef(_...) modules 
     75      cn_domcfg = "domain_cfg"         ! domain configuration filename 
     76      ! 
    7577   ln_write_cfg= .false.   !  (=T) create the domain configuration file 
    76    ! 
    77    cp_cfg      = "default" !  name of the configuration 
    78    jp_cfg      =      0    !  resolution of the configuration 
     78      cn_domcfg_out = "domain_cfg_out" ! newly created domain configuration filename 
     79      ! 
    7980   ln_use_jattr = .false.  !  use (T) the file attribute: open_ocean_jstart, if present 
    8081   !                       !  in netcdf input files, as the start j-row for reading 
     
    458459&namberg       !   iceberg parameters                                   (default: No iceberg) 
    459460!----------------------------------------------------------------------- 
    460       ln_icebergs              = .false.              ! iceberg floats or not 
    461       ln_bergdia               = .true.               ! Calculate budgets 
    462       nn_verbose_level         = 1                    ! Turn on more verbose output if level > 0 
    463       nn_verbose_write         = 15                   ! Timesteps between verbose messages 
    464       nn_sample_rate           = 1                    ! Timesteps between sampling for trajectory storage 
    465                                                       ! Initial mass required for an iceberg of each class 
    466       rn_initial_mass          = 8.8e7, 4.1e8, 3.3e9, 1.8e10, 3.8e10, 7.5e10, 1.2e11, 2.2e11, 3.9e11, 7.4e11 
    467                                                       ! Proportion of calving mass to apportion to each class 
    468       rn_distribution          = 0.24, 0.12, 0.15, 0.18, 0.12, 0.07, 0.03, 0.03, 0.03, 0.02 
    469                                                       ! Ratio between effective and real iceberg mass (non-dim) 
    470                                                       ! i.e. number of icebergs represented at a point 
    471       rn_mass_scaling          = 2000, 200, 50, 20, 10, 5, 2, 1, 1, 1 
    472                                                       ! thickness of newly calved bergs (m) 
    473       rn_initial_thickness     = 40., 67., 133., 175., 250., 250., 250., 250., 250., 250. 
    474       rn_rho_bergs             = 850.                 ! Density of icebergs 
    475       rn_LoW_ratio             = 1.5                  ! Initial ratio L/W for newly calved icebergs 
    476       ln_operator_splitting    = .true.               ! Use first order operator splitting for thermodynamics 
    477       rn_bits_erosion_fraction = 0.                   ! Fraction of erosion melt flux to divert to bergy bits 
    478       rn_sicn_shift            = 0.                   ! Shift of sea-ice concn in erosion flux (0<sicn_shift<1) 
    479       ln_passive_mode          = .false.              ! iceberg - ocean decoupling 
    480       nn_test_icebergs         =  10                  ! Create test icebergs of this class (-1 = no) 
    481                                                       ! Put a test iceberg at each gridpoint in box (lon1,lon2,lat1,lat2) 
    482       rn_test_box              = 108.0,  116.0, -66.0, -58.0 
    483       rn_speed_limit           = 0.                   ! CFL speed limit for a berg 
    484  
    485 !            ! file name ! frequency (hours) !   variable   ! time interp. !  clim   ! 'yearly'/ ! weights  ! rotation ! land/sea mask ! 
    486 !            !           !  (if <0  months)  !     name     !   (logical)  !  (T/F ) ! 'monthly' ! filename ! pairing  ! filename      ! 
    487       sn_icb =  'calving',       -1          , 'calvingmask',  .true.      , .true.  , 'yearly'  , ''       , ''       , '' 
    488  
    489       cn_dir = './' 
     461   ln_icebergs              = .false.              ! iceberg floats or not 
     462   ln_bergdia               = .true.               ! Calculate budgets 
     463   nn_verbose_level         = 1                    ! Turn on more verbose output if level > 0 
     464   nn_verbose_write         = 15                   ! Timesteps between verbose messages 
     465   nn_sample_rate           = 1                    ! Timesteps between sampling for trajectory storage 
     466                                                   ! Initial mass required for an iceberg of each class 
     467   rn_initial_mass          = 8.8e7, 4.1e8, 3.3e9, 1.8e10, 3.8e10, 7.5e10, 1.2e11, 2.2e11, 3.9e11, 7.4e11 
     468                                                   ! Proportion of calving mass to apportion to each class 
     469   rn_distribution          = 0.24, 0.12, 0.15, 0.18, 0.12, 0.07, 0.03, 0.03, 0.03, 0.02 
     470                                                   ! Ratio between effective and real iceberg mass (non-dim) 
     471                                                   ! i.e. number of icebergs represented at a point 
     472   rn_mass_scaling          = 2000, 200, 50, 20, 10, 5, 2, 1, 1, 1 
     473                                                   ! thickness of newly calved bergs (m) 
     474   rn_initial_thickness     = 40., 67., 133., 175., 250., 250., 250., 250., 250., 250. 
     475   rn_rho_bergs             = 850.                 ! Density of icebergs 
     476   rn_LoW_ratio             = 1.5                  ! Initial ratio L/W for newly calved icebergs 
     477   ln_operator_splitting    = .true.               ! Use first order operator splitting for thermodynamics 
     478   rn_bits_erosion_fraction = 0.                   ! Fraction of erosion melt flux to divert to bergy bits 
     479   rn_sicn_shift            = 0.                   ! Shift of sea-ice concn in erosion flux (0<sicn_shift<1) 
     480   ln_passive_mode          = .false.              ! iceberg - ocean decoupling 
     481   nn_test_icebergs         =  10                  ! Create test icebergs of this class (-1 = no) 
     482                                                   ! Put a test iceberg at each gridpoint in box (lon1,lon2,lat1,lat2) 
     483   rn_test_box              = 108.0,  116.0, -66.0, -58.0 
     484   rn_speed_limit           = 0.                   ! CFL speed limit for a berg 
     485 
     486!         ! file name ! frequency (hours) !   variable   ! time interp. !  clim   ! 'yearly'/ ! weights  ! rotation ! land/sea mask ! 
     487!         !           !  (if <0  months)  !     name     !   (logical)  !  (T/F ) ! 'monthly' ! filename ! pairing  ! filename      ! 
     488   sn_icb =  'calving',       -1          , 'calvingmask',  .true.      , .true.  , 'yearly'  , ''       , ''       , '' 
     489 
     490   cn_dir = './' 
    490491/ 
    491492 
     
    519520&nam_tide      !   tide parameters                                      ("key_tide") 
    520521!----------------------------------------------------------------------- 
    521    ln_tide_pot   = .true.   !  use tidal potential forcing 
    522    ln_tide_ramp  = .false.  ! 
    523    rdttideramp   =    0.    ! 
    524    clname(1)     = 'DUMMY'  !  name of constituent - all tidal components must be set in namelist_cfg 
     522   ln_tide_pot = .true.    !  use tidal potential forcing 
     523   ln_tide_ramp= .false.   ! 
     524   rdttideramp =    0.     ! 
     525   clname(1)   = 'DUMMY'   !  name of constituent  
     526   !                       !  all tidal components must be set in namelist_cfg 
    525527/ 
    526528!----------------------------------------------------------------------- 
    527529&nambdy        !  unstructured open boundaries                          ("key_bdy") 
    528530!----------------------------------------------------------------------- 
    529     nb_bdy         = 0                    !  number of open boundary sets 
    530     ln_coords_file = .true.               !  =T : read bdy coordinates from file 
    531     cn_coords_file = 'coordinates.bdy.nc' !  bdy coordinates files 
    532     ln_mask_file   = .false.              !  =T : read mask from file 
    533     cn_mask_file   = ''                   !  name of mask file (if ln_mask_file=.TRUE.) 
    534     cn_dyn2d       = 'none'               ! 
    535     nn_dyn2d_dta   =  0                   !  = 0, bdy data are equal to the initial state 
    536                                           !  = 1, bdy data are read in 'bdydata   .nc' files 
    537                                           !  = 2, use tidal harmonic forcing data from files 
    538                                           !  = 3, use external data AND tidal harmonic forcing 
    539     cn_dyn3d      =  'none'               ! 
    540     nn_dyn3d_dta  =  0                    !  = 0, bdy data are equal to the initial state 
    541                                           !  = 1, bdy data are read in 'bdydata   .nc' files 
    542     cn_tra        =  'none'               ! 
    543     nn_tra_dta    =  0                    !  = 0, bdy data are equal to the initial state 
    544                                           !  = 1, bdy data are read in 'bdydata   .nc' files 
    545     cn_ice_lim      =  'none'             ! 
    546     nn_ice_lim_dta  =  0                  !  = 0, bdy data are equal to the initial state 
    547                                           !  = 1, bdy data are read in 'bdydata   .nc' files 
    548     rn_ice_tem      = 270.                !  lim3 only: arbitrary temperature of incoming sea ice 
    549     rn_ice_sal      = 10.                 !  lim3 only:      --   salinity           -- 
    550     rn_ice_age      = 30.                 !  lim3 only:      --   age                -- 
    551  
    552     ln_tra_dmp    =.false.                !  open boudaries conditions for tracers 
    553     ln_dyn3d_dmp  =.false.                !  open boundary condition for baroclinic velocities 
    554     rn_time_dmp   =  1.                   ! Damping time scale in days 
    555     rn_time_dmp_out =  1.                 ! Outflow damping time scale 
    556     nn_rimwidth   = 10                    !  width of the relaxation zone 
    557     ln_vol        = .false.               !  total volume correction (see nn_volctl parameter) 
    558     nn_volctl     = 1                     !  = 0, the total water flux across open boundaries is zero 
     531   nb_bdy         = 0                    !  number of open boundary sets 
     532   ln_coords_file = .true.               !  =T : read bdy coordinates from file 
     533   cn_coords_file = 'coordinates.bdy.nc' !  bdy coordinates files 
     534   ln_mask_file   = .false.              !  =T : read mask from file 
     535   cn_mask_file   = ''                   !  name of mask file (if ln_mask_file=.TRUE.) 
     536   cn_dyn2d       = 'none'               ! 
     537   nn_dyn2d_dta   =  0                   !  = 0, bdy data are equal to the initial state 
     538      !                                  !  = 1, bdy data are read in 'bdydata   .nc' files 
     539      !                                  !  = 2, use tidal harmonic forcing data from files 
     540      !                                  !  = 3, use external data AND tidal harmonic forcing 
     541   cn_dyn3d      =  'none'               ! 
     542   nn_dyn3d_dta  =  0                    !  = 0, bdy data are equal to the initial state 
     543      !                                  !  = 1, bdy data are read in 'bdydata   .nc' files 
     544   cn_tra        =  'none'               ! 
     545   nn_tra_dta    =  0                    !  = 0, bdy data are equal to the initial state 
     546      !                                  !  = 1, bdy data are read in 'bdydata   .nc' files 
     547   cn_ice_lim      =  'none'             ! 
     548   nn_ice_lim_dta  =  0                  !  = 0, bdy data are equal to the initial state 
     549      !                                  !  = 1, bdy data are read in 'bdydata   .nc' files 
     550   rn_ice_tem      = 270.                !  lim3 only: arbitrary temperature of incoming sea ice 
     551   rn_ice_sal      = 10.                 !  lim3 only:      --   salinity           -- 
     552   rn_ice_age      = 30.                 !  lim3 only:      --   age                -- 
     553   ! 
     554   ln_tra_dmp    =.false.                !  open boudaries conditions for tracers 
     555   ln_dyn3d_dmp  =.false.                !  open boundary condition for baroclinic velocities 
     556   rn_time_dmp   =  1.                   ! Damping time scale in days 
     557   rn_time_dmp_out =  1.                 ! Outflow damping time scale 
     558   nn_rimwidth   = 10                    !  width of the relaxation zone 
     559   ln_vol        = .false.               !  total volume correction (see nn_volctl parameter) 
     560   nn_volctl     = 1                     !  = 0, the total water flux across open boundaries is zero 
    559561/ 
    560562!----------------------------------------------------------------------- 
  • branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/NEMO/LIM_SRC_2/limthd_2.F90

    r6596 r7200  
    479479 
    480480      !! Fram Strait sea-ice transport (sea-ice + snow)  (in ORCA2 = 5 points) 
    481       IF( iom_use('fram_trans') .and. cp_cfg == "orca" .AND. jp_cfg == 2 ) THEN    ! ORCA R2 configuration 
     481      IF( iom_use('fram_trans') .and. cn_cfg == "orca" .AND. nn_cfg == 2 ) THEN    ! ORCA R2 configuration 
    482482         DO jj = mj0(137), mj1(137) ! B grid 
    483483            IF( mj0(jj-1) >= nldj ) THEN 
  • branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/NEMO/NST_SRC/agrif_user.F90

    r6717 r7200  
    11#if defined key_agrif 
    22!!---------------------------------------------------------------------- 
    3 !! NEMO/NST 3.7 , NEMO Consortium (2015) 
     3!! NEMO/NST 3.7 , NEMO Consortium (2016) 
    44!! $Id$ 
    55!! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 
     
    1818   USE dom_oce 
    1919   USE nemogcm 
    20    ! 
     20   !! 
    2121   IMPLICIT NONE 
    2222   !!---------------------------------------------------------------------- 
     
    6060   USE tradmp 
    6161   USE bdy_par 
    62  
    63    IMPLICIT NONE 
    64    !!---------------------------------------------------------------------- 
    65    ! 0. Initializations 
    66    !------------------- 
    67    IF( cp_cfg == 'orca' ) THEN 
    68       IF ( jp_cfg == 2 .OR. jp_cfg == 025 .OR. jp_cfg == 05 & 
    69             &                      .OR. jp_cfg == 4 ) THEN 
    70          jp_cfg = -1    ! set special value for jp_cfg on fine grids 
    71          cp_cfg = "default" 
     62   !! 
     63   IMPLICIT NONE 
     64   !!---------------------------------------------------------------------- 
     65   ! 
     66!!gm  I think this is now useless ...   nn_cfg & cn_cfg are set to -999999 and "UNKNOWN"  
     67!!gm                                    when reading the AGRIF domain configuration file 
     68   IF( cn_cfg == 'orca' ) THEN 
     69      IF ( nn_cfg == 2 .OR. nn_cfg == 025 .OR. nn_cfg == 05  .OR. nn_cfg == 4 ) THEN 
     70         nn_cfg = -1    ! set special value for nn_cfg on fine grids 
     71         cn_cfg = "default" 
    7272      ENDIF 
    7373   ENDIF 
    74    ! Specific fine grid Initializations 
    75    ! no tracer damping on fine grids 
    76    ln_tradmp = .FALSE. 
    77    ! no open boundary on fine grids 
    78    lk_bdy = .FALSE. 
    79  
    80  
    81    CALL nemo_init  ! Initializations of each fine grid 
    82  
     74!!gm end 
     75 
     76   !                    !* Specific fine grid Initializations 
     77   ln_tradmp = .FALSE.        ! no tracer damping on fine grids 
     78   ! 
     79   lk_bdy    = .FALSE.        ! no open boundary on fine grids 
     80 
     81   CALL nemo_init       !* Initializations of each fine grid 
     82 
     83   !                    !* Agrif initialization 
    8384   CALL agrif_nemo_init 
    8485   CALL Agrif_InitValues_cont_dom 
     
    8889# if defined key_top 
    8990   CALL Agrif_InitValues_cont_top 
    90 # endif       
     91# endif 
     92   ! 
    9193END SUBROUTINE Agrif_initvalues 
    9294 
     
    106108   USE agrif_opa_interp 
    107109   USE agrif_opa_sponge 
    108    ! 
    109    IMPLICIT NONE 
    110    ! 
    111    !!---------------------------------------------------------------------- 
    112  
     110   !! 
     111   IMPLICIT NONE 
     112   !!---------------------------------------------------------------------- 
     113   ! 
    113114   ! Declaration of the type of variable which have to be interpolated 
    114    !--------------------------------------------------------------------- 
     115   ! 
    115116   CALL agrif_declare_var_dom 
    116117   ! 
     
    127128   USE par_oce        
    128129   USE oce 
     130   !! 
    129131   IMPLICIT NONE 
    130132   !!---------------------------------------------------------------------- 
     
    174176   USE agrif_opa_interp 
    175177   USE agrif_opa_sponge 
    176    ! 
     178   !! 
    177179   IMPLICIT NONE 
    178180   ! 
     
    344346   USE oce 
    345347   USE agrif_oce 
     348   !! 
    346349   IMPLICIT NONE 
    347350   !!---------------------------------------------------------------------- 
     
    482485   USE agrif_lim2_interp 
    483486   USE lib_mpp 
    484    ! 
    485    IMPLICIT NONE 
    486    ! 
     487   !! 
     488   IMPLICIT NONE 
    487489   !!---------------------------------------------------------------------- 
    488490 
     
    519521END SUBROUTINE Agrif_InitValues_cont_lim2 
    520522 
     523 
    521524SUBROUTINE agrif_declare_var_lim2 
    522525   !!---------------------------------------------------------------------- 
     
    527530   USE agrif_util 
    528531   USE ice_2 
    529  
     532   !! 
    530533   IMPLICIT NONE 
    531534   !!---------------------------------------------------------------------- 
     
    583586   USE agrif_top_interp 
    584587   USE agrif_top_sponge 
    585    ! 
     588   !! 
    586589   IMPLICIT NONE 
    587590   ! 
     
    682685   USE dom_oce 
    683686   USE trc 
    684  
    685    IMPLICIT NONE 
     687   !! 
     688   IMPLICIT NONE 
     689   !!---------------------------------------------------------------------- 
    686690 
    687691   ! 1. Declaration of the type of variable which have to be interpolated 
     
    714718SUBROUTINE Agrif_detect( kg, ksizex ) 
    715719   !!---------------------------------------------------------------------- 
    716    !!   *** ROUTINE Agrif_detect *** 
    717    !!---------------------------------------------------------------------- 
    718    ! 
     720   !!                      *** ROUTINE Agrif_detect *** 
     721   !!---------------------------------------------------------------------- 
    719722   INTEGER, DIMENSION(2) :: ksizex 
    720723   INTEGER, DIMENSION(ksizex(1),ksizex(2)) :: kg  
     
    734737   USE in_out_manager 
    735738   USE lib_mpp 
     739   !! 
    736740   IMPLICIT NONE 
    737741   ! 
     
    787791   !!---------------------------------------------------------------------- 
    788792   USE dom_oce 
     793   !! 
    789794   IMPLICIT NONE 
    790795   ! 
     
    801806END SUBROUTINE Agrif_InvLoc 
    802807 
     808 
    803809SUBROUTINE Agrif_get_proc_info( imin, imax, jmin, jmax ) 
    804810   !!---------------------------------------------------------------------- 
     
    806812   !!---------------------------------------------------------------------- 
    807813   USE par_oce 
     814   !! 
    808815   IMPLICIT NONE 
    809816   ! 
     
    819826END SUBROUTINE Agrif_get_proc_info 
    820827 
     828 
    821829SUBROUTINE Agrif_estimate_parallel_cost(imin, imax,jmin, jmax, nbprocs, grid_cost) 
    822830   !!---------------------------------------------------------------------- 
     
    824832   !!---------------------------------------------------------------------- 
    825833   USE par_oce 
     834   !! 
    826835   IMPLICIT NONE 
    827836   ! 
  • branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/NEMO/OFF_SRC/nemogcm.F90

    r6979 r7200  
    22   !!====================================================================== 
    33   !!                       ***  MODULE nemogcm   *** 
    4    !! Off-line Ocean   : passive tracer evolution, dynamics read in files 
     4   !! OFF-line Ocean   : passive tracer evolution, dynamics read in files 
    55   !!====================================================================== 
    66   !! History :  3.3  ! 2010-05  (C. Ethe)  Full reorganization of the off-line: phasing with the on-line 
    77   !!            4.0  ! 2011-01  (C. Ethe, A. R. Porter, STFC Daresbury) dynamical allocation 
     8   !!            4.0  ! 2016-10  (C. Ethe, G. Madec, S. Flavoni)  domain configuration / user defined interface 
    89   !!---------------------------------------------------------------------- 
    910 
    1011   !!---------------------------------------------------------------------- 
    11    !!   nemo_gcm        : off-line: solve ocean tracer only 
    12    !!   nemo_init       : initialization of the nemo model 
    13    !!   nemo_ctl        : initialisation of algorithm flag  
    14    !!   nemo_closefile  : close remaining files 
     12   !!   nemo_gcm      : solve ocean dynamics, tracer, biogeochemistry and/or sea-ice 
     13   !!   nemo_init     : initialization of the NEMO system 
     14   !!   nemo_ctl      : initialisation of the contol print 
     15   !!   nemo_closefile: close remaining open files 
     16   !!   nemo_alloc    : dynamical allocation 
     17   !!   nemo_partition: calculate MPP domain decomposition 
     18   !!   factorise     : calculate the factors of the no. of MPI processes 
     19   !!   istate_init   : ocean variables set to zero 
     20   !!   stp_ctl       : step control for OFF-line 
    1521   !!---------------------------------------------------------------------- 
    1622   USE dom_oce         ! ocean space domain variables 
    1723   USE oce             ! dynamics and tracers variables 
    1824   USE c1d             ! 1D configuration 
    19    USE domcfg          ! domain configuration               (dom_cfg routine) 
    2025   USE domain          ! domain initialization from coordinate & bathymetry (dom_init routine) 
    21 !   USE domrea          ! domain initialization from mesh_mask            (dom_init routine) 
     26   USE usrdef_nam     ! user defined configuration 
    2227   USE eosbn2          ! equation of state            (eos bn2 routine) 
    2328   !              ! ocean physics 
     
    3540   USE trcstp          ! passive tracer time-stepping      (trc_stp routine) 
    3641   USE dtadyn          ! Lecture and interpolation of the dynamical fields 
     42   !              ! Passive tracers needs 
     43   USE trc             ! passive tracer : variables 
     44   USE trcnam          ! passive tracer : namelist 
     45   USE trcrst          ! passive tracer restart 
     46   USE diaptr          ! Need to initialise this as some variables are used in if statements later 
     47   USE sbc_oce  , ONLY : ln_rnf 
     48   USE sbcrnf          ! surface boundary condition : runoffs 
    3749   !              ! I/O & MPP 
    3850   USE iom             ! I/O library 
     
    4860   USE lbcnfd, ONLY: isendto, nsndto, nfsloop, nfeloop ! Setup of north fold exchanges 
    4961 
    50    USE trc 
    51    USE trcnam 
    52    USE trcrst 
    53    USE diaptr         ! Need to initialise this as some variables are used in if statements later 
    54    USE sbc_oce, ONLY: ln_rnf 
    55    USE sbcrnf 
    56    USE usrdef_nam     ! user defined configuration 
    57  
    58  
    5962   IMPLICIT NONE 
    6063   PRIVATE 
     
    6568 
    6669   !!---------------------------------------------------------------------- 
    67    !! NEMO/OFF 3.3 , NEMO Consortium (2010) 
     70   !! NEMO/OFF 4.0 , NEMO Consortium (2016) 
    6871   !! $Id$ 
    6972   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt) 
     
    7578      !!                     ***  ROUTINE nemo_gcm  *** 
    7679      !! 
    77       !! ** Purpose :   nemo solves the primitive equations on an orthogonal 
    78       !!      curvilinear mesh on the sphere. 
     80      !! ** Purpose :   NEMO solves the primitive equations on an orthogonal 
     81      !!              curvilinear mesh on the sphere. 
    7982      !! 
    8083      !! ** Method  : - model general initialization 
     
    8588      !!              Madec, 2008, internal report, IPSL. 
    8689      !!---------------------------------------------------------------------- 
    87       INTEGER :: istp, indic       ! time step index 
    88       !!---------------------------------------------------------------------- 
    89  
    90       CALL nemo_init  ! Initializations 
     90      INTEGER :: istp, indic   ! time step index 
     91      !!---------------------------------------------------------------------- 
     92 
     93      !                            !-----------------------! 
     94      CALL nemo_init               !==  Initialisations  ==! 
     95      !                            !-----------------------! 
    9196 
    9297      ! check that all process are still there... If some process have an error, 
     
    121126      !                            !==  finalize the run  ==! 
    122127      !                            !------------------------! 
    123       IF(lwp) WRITE(numout,cform_aaa)                 ! Flag AAAAAAA 
    124  
    125       IF( nstop /= 0 .AND. lwp ) THEN                 ! error print 
     128      IF(lwp) WRITE(numout,cform_aaa)        ! Flag AAAAAAA 
     129      ! 
     130      IF( nstop /= 0 .AND. lwp ) THEN        ! error print 
    126131         WRITE(numout,cform_err) 
    127132         WRITE(numout,*) nstop, ' error have been found' 
     
    132137      CALL nemo_closefile 
    133138      ! 
    134 # if defined key_iomput 
    135       CALL xios_finalize             ! end mpp communications 
    136 # else 
    137       IF( lk_mpp )   CALL mppstop       ! end mpp communications 
    138 # endif 
     139#if defined key_iomput 
     140      CALL xios_finalize                     ! end mpp communications 
     141#else 
     142      IF( lk_mpp )   CALL mppstop            ! end mpp communications 
     143#endif 
    139144      ! 
    140145   END SUBROUTINE nemo_gcm 
     
    143148   SUBROUTINE nemo_init 
    144149      !!---------------------------------------------------------------------- 
    145       !!                     ***  ROUTINE nemo_init *** 
    146       !! 
    147       !! ** Purpose :   initialization of the nemo model in off-line mode 
    148       !!---------------------------------------------------------------------- 
    149       INTEGER ::   ji            ! dummy loop indices 
    150       INTEGER ::   ilocal_comm   ! local integer 
    151       INTEGER ::   ios, inum 
    152       REAL(wp) ::   ziglo, zjglo, zkglo, zperio   ! local scalars 
     150      !!                     ***  ROUTINE nemo_init  *** 
     151      !! 
     152      !! ** Purpose :   initialization of NEMO in off-line mode 
     153      !!---------------------------------------------------------------------- 
     154      INTEGER  ::   ji            ! dummy loop indices 
     155      INTEGER  ::   ilocal_comm   ! local integer 
     156      INTEGER  ::   ios, inum     !   -      - 
    153157      CHARACTER(len=120), DIMENSION(30) ::   cltxt, cltxt2, clnam 
    154       !! 
    155       NAMELIST/namctl/ ln_ctl  , nn_print, nn_ictls, nn_ictle,   & 
    156          &             nn_isplt, nn_jsplt, nn_jctls, nn_jctle,   & 
     158      ! 
     159      NAMELIST/namctl/ ln_ctl   , nn_print, nn_ictls, nn_ictle,   & 
     160         &             nn_isplt , nn_jsplt, nn_jctls, nn_jctle,   & 
    157161         &             nn_timing, nn_diacfl 
    158  
    159       NAMELIST/namcfg/ ln_read_cfg, ln_write_cfg, cp_cfg, jp_cfg, ln_use_jattr 
    160       !!---------------------------------------------------------------------- 
     162      NAMELIST/namcfg/ ln_read_cfg, cn_domcfg, ln_write_cfg, cn_domcfg_out, ln_use_jattr 
     163      !!---------------------------------------------------------------------- 
     164      ! 
    161165      cltxt  = '' 
    162166      cltxt2 = '' 
     
    168172      CALL ctl_opn( numnam_cfg, 'namelist_cfg', 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, 6, .FALSE. ) 
    169173      ! 
    170       REWIND( numnam_ref )              ! Namelist namctl in reference namelist : Control prints & Benchmark 
     174      REWIND( numnam_ref )              ! Namelist namctl in reference namelist : Control prints 
    171175      READ  ( numnam_ref, namctl, IOSTAT = ios, ERR = 901 ) 
    172176901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namctl in reference namelist', .TRUE. ) 
    173  
    174       REWIND( numnam_cfg )              ! Namelist namctl in confguration namelist : Control prints & Benchmark 
     177      ! 
     178      REWIND( numnam_cfg )              ! Namelist namctl in confguration namelist 
    175179      READ  ( numnam_cfg, namctl, IOSTAT = ios, ERR = 902 ) 
    176180902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namctl in configuration namelist', .TRUE. ) 
    177  
    178       ! 
    179       REWIND( numnam_ref )              ! Namelist namcfg in reference namelist : Control prints & Benchmark 
     181      ! 
     182      REWIND( numnam_ref )              ! Namelist namcfg in reference namelist : Control prints 
    180183      READ  ( numnam_ref, namcfg, IOSTAT = ios, ERR = 903 ) 
    181184903   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namcfg in reference namelist', .TRUE. ) 
     
    185188904   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namcfg in configuration namelist', .TRUE. )    
    186189 
    187  
    188190      !                             !--------------------------! 
    189191      !                             !  Set global domain size  !   (control print return in cltxt2) 
    190192      !                             !--------------------------! 
    191       IF( ln_read_cfg ) THEN              ! Read sizes in configuration "mesh_mask" file 
    192          CALL iom_open( 'domain_cfg', inum ) 
    193          CALL iom_get( inum, 'jpiglo', ziglo  )   ;   jpiglo = INT( ziglo ) 
    194          CALL iom_get( inum, 'jpjglo', zjglo  )   ;   jpjglo = INT( zjglo ) 
    195          CALL iom_get( inum, 'jpkglo', zkglo  )   ;   jpkglo = INT( zkglo ) 
    196          CALL iom_get( inum, 'jperio', zperio )   ;   jperio = INT( zperio ) 
    197          CALL iom_close( inum ) 
    198          WRITE(cltxt2(1),*) '~~~~~~~~~~   '       
    199          WRITE(cltxt2(2),*) 'domain_cfg : domain size read in "domain_cfg" file : jp(i,j,k)glo = ' 
    200          WRITE(cltxt2(3),*) '            ', jpiglo, jpjglo, jpkglo         
    201          WRITE(cltxt2(1),*) '~~~~~~~~~~   lateral boudary type of the global domain jperio= ', jperio 
    202          !         
     193      IF( ln_read_cfg ) THEN              ! Read sizes in domain configuration file 
     194         CALL domain_cfg ( cltxt2, clnam, cn_cfg, nn_cfg, jpiglo, jpjglo, jpkglo, jperio ) 
     195         ! 
    203196      ELSE                                ! user-defined namelist 
    204          CALL usr_def_nam( cltxt2, clnam, jpiglo, jpjglo, jpkglo, jperio ) 
     197         CALL usr_def_nam( cltxt2, clnam, cn_cfg, nn_cfg, jpiglo, jpjglo, jpkglo, jperio ) 
    205198      ENDIF 
    206199      jpk    = jpkglo 
     
    224217      lwp = (narea == 1) .OR. ln_ctl          ! control of all listing output print 
    225218 
    226       IF(lwm) THEN 
    227          ! write merged namelists from earlier to output namelist now that the 
    228          ! file has been opened in call to mynode. nammpp has already been 
    229          ! written in mynode (if lk_mpp_mpi) 
     219      IF(lwm) THEN               ! write merged namelists from earlier to output namelist  
     220         !                       ! now that the file has been opened in call to mynode.  
     221         !                       ! NB: nammpp has already been written in mynode (if lk_mpp_mpi) 
    230222         WRITE( numond, namctl ) 
    231223         WRITE( numond, namcfg ) 
    232224         IF( .NOT.ln_read_cfg ) THEN 
    233225            DO ji = 1, SIZE(clnam) 
    234                IF( TRIM(clnam (ji)) /= '' )   WRITE(numond, * ) clnam(ji)    ! namusr_def print 
     226               IF( TRIM(clnam(ji)) /= '' )   WRITE(numond, * ) clnam(ji)     ! namusr_def print 
    235227            END DO 
    236228         ENDIF 
    237229      ENDIF 
    238230 
    239       ! If dimensions of processor grid weren't specified in the namelist file  
     231      ! If dimensions of processor grid weren't specified in the namelist file 
    240232      ! then we calculate them here now that we have our communicator size 
    241       IF( (jpni < 1) .OR. (jpnj < 1) )THEN 
    242 #if   defined key_mpp_mpi 
    243          CALL nemo_partition(mppsize) 
     233      IF( jpni < 1 .OR. jpnj < 1 ) THEN 
     234#if defined key_mpp_mpi 
     235         CALL nemo_partition( mppsize ) 
    244236#else 
    245          jpni = 1 
    246          jpnj = 1 
     237         jpni  = 1 
     238         jpnj  = 1 
    247239         jpnij = jpni*jpnj 
    248240#endif 
    249       END IF 
     241      ENDIF 
    250242 
    251243      ! Calculate domain dimensions given calculated jpni and jpnj 
     
    259251      jpij  = jpi*jpj                                          !  jpi x j 
    260252 
    261  
    262253      IF(lwp) THEN                            ! open listing units 
    263254         ! 
     
    268259         WRITE(numout,*) '                       NEMO team' 
    269260         WRITE(numout,*) '            Ocean General Circulation Model' 
    270          WRITE(numout,*) '                  version 3.6  (2015) ' 
     261         WRITE(numout,*) '                  version 3.7  (2016) ' 
    271262         WRITE(numout,*) 
    272263         WRITE(numout,*) 
    273          DO ji = 1, SIZE(cltxt)  
    274             IF( TRIM(cltxt(ji)) /= '' )   WRITE(numout,*) cltxt(ji)      ! control print of mynode 
     264         DO ji = 1, SIZE(cltxt) 
     265            IF( TRIM(cltxt (ji)) /= '' )   WRITE(numout,*) cltxt(ji)    ! control print of mynode 
    275266         END DO 
    276          WRITE(numout,cform_aaa)                                         ! Flag AAAAAAA 
     267         WRITE(numout,*) 
     268         WRITE(numout,*) 
     269         DO ji = 1, SIZE(cltxt2) 
     270            IF( TRIM(cltxt2(ji)) /= '' )   WRITE(numout,*) cltxt2(ji)   ! control print of domain size 
     271         END DO 
     272         WRITE(numout,cform_aaa)                                        ! Flag AAAAAAA 
    277273         ! 
    278274      ENDIF 
    279275 
    280       ! Now we know the dimensions of the grid and numout has been set we can  
    281       ! allocate arrays 
     276      ! Now we know the dimensions of the grid and numout has been set: we can allocate arrays 
    282277      CALL nemo_alloc() 
    283  
    284       !                             !--------------------------------! 
    285       !                             !  Model general initialization  ! 
    286       !                             !--------------------------------! 
    287  
    288       CALL nemo_ctl                           ! Control prints & Benchmark 
     278      !                             !-------------------------------! 
     279      !                             !  NEMO general initialization  ! 
     280      !                             !-------------------------------! 
     281 
     282      CALL nemo_ctl                          ! Control prints 
    289283 
    290284      !                                      ! Domain decomposition 
     
    295289      IF( nn_timing == 1 )  CALL timing_init 
    296290      ! 
    297  
    298291      !                                      ! General initialization 
    299292      IF( nn_timing == 1 )  CALL timing_start( 'nemo_init') 
     
    374367         WRITE(numout,*) '~~~~~~~ ' 
    375368         WRITE(numout,*) '   Namelist namcfg' 
    376          WRITE(numout,*) '      read configuration definition files          ln_read_cfg = ', ln_read_cfg 
    377          WRITE(numout,*) '      configuration name                               cp_cfg  = ', TRIM(cp_cfg) 
    378          WRITE(numout,*) '      configuration resolution                         jp_cfg  = ', jp_cfg 
    379          WRITE(numout,*) '      use file attribute if exists as i/p j-start ln_use_jattr = ', ln_use_jattr 
     369         WRITE(numout,*) '      read domain configuration files               ln_read_cfg      = ', ln_read_cfg 
     370         WRITE(numout,*) '         filename to be read                           cn_domcfg     = ', TRIM(cn_domcfg) 
     371         WRITE(numout,*) '      write  configuration definition files         ln_write_cfg     = ', ln_write_cfg 
     372         WRITE(numout,*) '         filename to be written                        cn_domcfg_out = ', TRIM(cn_domcfg_out) 
     373         WRITE(numout,*) '      use file attribute if exists as i/p j-start   ln_use_jattr     = ', ln_use_jattr 
    380374      ENDIF 
    381375      !                             ! Parameter control 
     
    432426      !!---------------------------------------------------------------------- 
    433427      ! 
    434       IF ( lk_mpp ) CALL mppsync 
     428      IF( lk_mpp )  CALL mppsync 
    435429      ! 
    436430      CALL iom_close                                 ! close all input/output files managed by iom_* 
     
    455449      !! ** Method  : 
    456450      !!---------------------------------------------------------------------- 
    457       USE diawri,       ONLY: dia_wri_alloc 
     451      USE diawri ,      ONLY: dia_wri_alloc 
    458452      USE dom_oce,      ONLY: dom_oce_alloc 
    459453      USE zdf_oce,      ONLY: zdf_oce_alloc 
     
    484478      !! ** Method  : 
    485479      !!---------------------------------------------------------------------- 
    486       INTEGER, INTENT(in) :: num_pes ! The number of MPI processes we have 
     480      INTEGER, INTENT(in) ::   num_pes  ! The number of MPI processes we have 
    487481      ! 
    488482      INTEGER, PARAMETER :: nfactmax = 20 
     
    493487      INTEGER, DIMENSION(nfactmax) :: ifact ! Array of factors 
    494488      !!---------------------------------------------------------------------- 
    495  
     489      ! 
    496490      ierr = 0 
    497  
     491      ! 
    498492      CALL factorise( ifact, nfactmax, nfact, num_pes, ierr ) 
    499  
     493      ! 
    500494      IF( nfact <= 1 ) THEN 
    501495         WRITE (numout, *) 'WARNING: factorisation of number of PEs failed' 
     
    528522      !! 
    529523      !! ** Purpose :   return the prime factors of n. 
    530       !!                knfax factors are returned in array kfax which is of  
     524      !!                knfax factors are returned in array kfax which is of 
    531525      !!                maximum dimension kmaxfax. 
    532526      !! ** Method  : 
     
    538532      INTEGER :: ifac, jl, inu 
    539533      INTEGER, PARAMETER :: ntest = 14 
    540       INTEGER :: ilfax(ntest) 
     534      INTEGER, DIMENSION(ntest) ::   ilfax 
     535      !!---------------------------------------------------------------------- 
    541536      ! 
    542537      ! lfax contains the set of allowed factors. 
    543       data (ilfax(jl),jl=1,ntest) / 16384, 8192, 4096, 2048, 1024, 512, 256,  & 
    544          &                            128,   64,   32,   16,    8,   4,   2  / 
    545       !!---------------------------------------------------------------------- 
    546  
     538      ilfax(:) = (/(2**jl,jl=ntest,1,-1)/) 
     539      ! 
    547540      ! Clear the error flag and initialise output vars 
    548       kerr = 0 
    549       kfax = 1 
     541      kerr  = 0 
     542      kfax  = 1 
    550543      knfax = 0 
    551  
     544      ! 
    552545      ! Find the factors of n. 
    553546      IF( kn == 1 )   GOTO 20 
     
    557550      ! l points to the allowed factor list. 
    558551      ! ifac holds the current factor. 
    559  
     552      ! 
    560553      inu   = kn 
    561554      knfax = 0 
    562  
     555      ! 
    563556      DO jl = ntest, 1, -1 
    564557         ! 
     
    584577         ! 
    585578      END DO 
    586  
     579      ! 
    587580   20 CONTINUE      ! Label 20 is the exit point from the factor search loop. 
    588581      ! 
     
    590583 
    591584#if defined key_mpp_mpi 
     585 
    592586   SUBROUTINE nemo_northcomms 
    593       !!====================================================================== 
     587      !!---------------------------------------------------------------------- 
    594588      !!                     ***  ROUTINE  nemo_northcomms  *** 
    595       !! nemo_northcomms    :  Setup for north fold exchanges with explicit  
    596       !!                       point-to-point messaging 
    597       !!===================================================================== 
    598       !!---------------------------------------------------------------------- 
    599       !! 
    600       !! ** Purpose :   Initialization of the northern neighbours lists. 
     589      !! ** Purpose :   Setup for north fold exchanges with explicit  
     590      !!                point-to-point messaging 
     591      !! 
     592      !! ** Method :   Initialization of the northern neighbours lists. 
    601593      !!---------------------------------------------------------------------- 
    602594      !!    1.0  ! 2011-10  (A. C. Coward, NOCS & J. Donners, PRACE) 
    603       !!    2.0  ! 2013-06 Setup avoiding MPI communication (I. Epicoco, S. 
    604       !Mocavero, CMCC)  
    605       !!---------------------------------------------------------------------- 
    606  
     595      !!    2.0  ! 2013-06 Setup avoiding MPI communication (I. Epicoco, S. Mocavero, CMCC)  
     596      !!---------------------------------------------------------------------- 
    607597      INTEGER  ::   sxM, dxM, sxT, dxT, jn 
    608598      INTEGER  ::   njmppmax 
    609  
     599      !!---------------------------------------------------------------------- 
     600      ! 
    610601      njmppmax = MAXVAL( njmppt ) 
    611  
     602      ! 
    612603      !initializes the north-fold communication variables 
    613604      isendto(:) = 0 
    614       nsndto = 0 
    615  
     605      nsndto     = 0 
     606      ! 
    616607      !if I am a process in the north 
    617608      IF ( njmpp == njmppmax ) THEN 
     
    625616          !loop over the other north-fold processes to find the processes 
    626617          !managing the points belonging to the sxT-dxT range 
    627  
     618   
    628619          DO jn = 1, jpni 
    629620                !sxT is the first point (in the global domain) of the jn 
     
    660651      l_north_nogather = .TRUE. 
    661652   END SUBROUTINE nemo_northcomms 
     653 
    662654#else 
    663655   SUBROUTINE nemo_northcomms      ! Dummy routine 
     
    686678   END SUBROUTINE istate_init 
    687679 
     680 
    688681   SUBROUTINE stp_ctl( kt, kindic ) 
    689682      !!---------------------------------------------------------------------- 
     
    712705      ! 
    713706   END SUBROUTINE stp_ctl 
     707 
    714708   !!====================================================================== 
    715709END MODULE nemogcm 
  • branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/NEMO/OPA_SRC/C1D/domc1d.F90

    r6596 r7200  
    8585      !  mesh, only glamt and gphit   ! 
    8686      ! ============================= ! 
    87  
     87      ! 
    8888      SELECT CASE( jphgr_msh )   ! type of horizontal mesh 
    89  
     89      ! 
    9090      CASE ( 0 )                 !  curvilinear coordinate on the sphere read in coordinate.nc file 
    91  
     91         ! 
    9292         CALL iom_open( 'coordinates', inum ) 
    9393         CALL iom_get( inum, jpdom_unknown, 'glamt', glamdta ) ! mig, mjg undefined at this point 
    9494         CALL iom_get( inum, jpdom_unknown, 'gphit', gphidta ) ! so use jpdom_unknown not jpdom_data 
    9595         CALL iom_close ( inum ) 
    96  
     96         ! 
    9797      CASE ( 1 )                 ! geographical mesh on the sphere with regular grid-spacing 
    98  
     98         ! 
    9999         DO jj = 1, jpjdta 
    100100            DO ji = 1, jpidta 
    101101               zti = FLOAT( ji - 1 + nimpp - 1 ) 
    102102               ztj = FLOAT( jj - 1 + njmpp - 1 ) 
    103  
     103               ! 
    104104               glamdta(ji,jj) = ppglam0 + ppe1_deg * zti 
    105105               gphidta(ji,jj) = ppgphi0 + ppe2_deg * ztj 
    106106            END DO 
    107107         END DO 
    108  
     108         ! 
    109109      CASE ( 2:3 )               ! f- or beta-plane with regular grid-spacing 
    110           
     110         ! 
    111111         glam0 = 0.e0 
    112112         gphi0 = - ppe2_m * 1.e-3 
    113  
     113         ! 
    114114         DO jj = 1, jpjdta 
    115115            DO ji = 1, jpidta 
     
    118118            END DO 
    119119         END DO 
    120  
     120         ! 
    121121      CASE ( 4 )                 ! geographical mesh on the sphere, isotropic MERCATOR type 
    122  
     122         ! 
    123123         IF( ppgphi0 == -90 )   CALL ctl_stop( ' Mercator grid cannot start at south pole !!!! ' ) 
    124  
     124         ! 
    125125         zarg = rpi / 4. - rpi / 180. * ppgphi0 / 2. 
    126126         ijeq = ABS( 180. / rpi * LOG( COS( zarg ) / SIN( zarg ) ) / ppe1_deg ) 
    127127         IF( ppgphi0 > 0 )   ijeq = -ijeq 
    128  
     128         ! 
    129129         DO jj = 1, jpjdta 
    130130            DO ji = 1, jpidta 
    131131               zti = FLOAT( ji - 1    + nimpp - 1 ) 
    132132               ztj = FLOAT( jj - ijeq + njmpp - 1 ) 
    133  
     133               ! 
    134134               glamdta(ji,jj) = ppglam0 + ppe1_deg * zti 
    135135               gphidta(ji,jj) = 1. / rad * ASIN ( TANH( ppe1_deg * rad * ztj ) ) 
    136136            END DO 
    137137         END DO 
    138  
     138         ! 
    139139      CASE ( 5 )                 ! beta-plane with regular grid-spacing and rotated domain (GYRE configuration) 
    140     
     140         ! 
    141141         zlam1 = -85 
    142142         zphi1 = 29 
    143          ze1 = 106000. / FLOAT(jp_cfg) 
    144   
     143         ze1 = 106000. / REAL( nn_cfg , wp ) 
     144         ! 
    145145         zsin_alpha = - SQRT( 2. ) / 2. 
    146146         zcos_alpha =   SQRT( 2. ) / 2. 
    147147         ze1deg = ze1 / (ra * rad) 
    148  
     148         ! 
    149149         glam0 = zlam1 + zcos_alpha * ze1deg * FLOAT( jpjdta-2 ) ! Force global 
    150150         gphi0 = zphi1 + zsin_alpha * ze1deg * FLOAT( jpjdta-2 ) 
    151  
     151         ! 
    152152         DO jj = 1, jpjdta 
    153153            DO ji = 1, jpidta 
     
    159159            END DO 
    160160         END DO 
    161  
     161         ! 
    162162      CASE DEFAULT 
    163  
     163         ! 
    164164         WRITE(ctmp1,*) '          bad flag value for jphgr_msh = ', jphgr_msh 
    165165         CALL ctl_stop( ctmp1 ) 
    166  
     166         ! 
    167167      END SELECT 
    168168 
  • branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/NEMO/OPA_SRC/DOM/domain.F90

    r7188 r7200  
    2222   !!   dom_nam       : read and contral domain namelists 
    2323   !!   dom_ctl       : control print for the ocean domain 
    24    !!   cfg_write     : create the "domain_cfg.nc" file containing all required configuration information    
     24   !!   domain_cfg    : read the global domain size in domain configuration file 
     25   !!   cfg_write     : create the domain configuration file 
    2526   !!---------------------------------------------------------------------- 
    2627   USE oce            ! ocean variables 
     
    4849   PRIVATE 
    4950 
    50    PUBLIC   dom_init   ! called by opa.F90 
     51   PUBLIC   dom_init     ! called by nemogcm.F90 
     52   PUBLIC   domain_cfg   ! called by nemogcm.F90 
    5153 
    5254   !!------------------------------------------------------------------------- 
     
    110112         END SELECT 
    111113         WRITE(numout,*)     '      Ocean model configuration used:' 
    112          WRITE(numout,*)     '              cp_cfg = ', cp_cfg 
    113          WRITE(numout,*)     '              jp_cfg = ', jp_cfg 
     114         WRITE(numout,*)     '              cn_cfg = ', cn_cfg 
     115         WRITE(numout,*)     '              nn_cfg = ', nn_cfg 
    114116      ENDIF 
    115117      ! 
     
    123125      CALL dom_glo                     ! global domain versus local domain 
    124126      CALL dom_nam                     ! read namelist ( namrun, namdom ) 
    125       CALL dom_clo( cp_cfg, jp_cfg )   ! Closed seas and lake 
     127      CALL dom_clo( cn_cfg, nn_cfg )   ! Closed seas and lake 
    126128      CALL dom_hgr                     ! Horizontal mesh 
    127129      CALL dom_zgr( ik_top, ik_bot )   ! Vertical mesh and bathymetry 
     
    287289      INTEGER  ::   ios                 ! Local integer output status for namelist read 
    288290      !!---------------------------------------------------------------------- 
    289  
     291      ! 
    290292      REWIND( numnam_ref )              ! Namelist namrun in reference namelist : Parameters of the run 
    291293      READ  ( numnam_ref, namrun, IOSTAT = ios, ERR = 901) 
    292294901   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namrun in reference namelist', lwp ) 
    293  
     295      ! 
    294296      REWIND( numnam_cfg )              ! Namelist namrun in configuration namelist : Parameters of the run 
    295297      READ  ( numnam_cfg, namrun, IOSTAT = ios, ERR = 902 ) 
     
    380382      READ  ( numnam_ref, namdom, IOSTAT = ios, ERR = 903) 
    381383903   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namdom in reference namelist', lwp ) 
    382    
    383384      ! 
    384385      REWIND( numnam_cfg )              ! Namelist namdom in configuration namelist : space & time domain (bathymetry, mesh, timestep) 
     
    414415      READ  ( numnam_ref, namnc4, IOSTAT = ios, ERR = 907) 
    415416907   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namnc4 in reference namelist', lwp ) 
    416  
     417      ! 
    417418      REWIND( numnam_cfg )              ! Namelist namnc4 in configuration namelist : NETCDF 
    418419      READ  ( numnam_cfg, namnc4, IOSTAT = ios, ERR = 908 ) 
     
    492493 
    493494 
     495   SUBROUTINE domain_cfg( ldtxt, ldnam, cd_cfg, kk_cfg, kpi, kpj, kpk, kperio ) 
     496      !!---------------------------------------------------------------------- 
     497      !!                     ***  ROUTINE dom_nam  *** 
     498      !!                     
     499      !! ** Purpose :   read the domain size in domain configuration file 
     500      !! 
     501      !! ** Method  :    
     502      !! 
     503      !!---------------------------------------------------------------------- 
     504      CHARACTER(len=*), DIMENSION(:), INTENT(out) ::   ldtxt, ldnam    ! stored print information 
     505      CHARACTER(len=*)              , INTENT(out) ::   cd_cfg          ! configuration name 
     506      INTEGER                       , INTENT(out) ::   kk_cfg          ! configuration resolution 
     507      INTEGER                       , INTENT(out) ::   kpi, kpj, kpk   ! global domain sizes  
     508      INTEGER                       , INTENT(out) ::   kperio          ! lateral global domain b.c.  
     509      ! 
     510      INTEGER ::   inum, ii   ! local integer 
     511      REAL(wp) ::   zorca_res                     ! local scalars 
     512      REAL(wp) ::   ziglo, zjglo, zkglo, zperio   !   -      - 
     513      !!---------------------------------------------------------------------- 
     514      ! 
     515      ii = 1 
     516      WRITE(ldtxt(ii),*) '           '                                                    ;   ii = ii+1 
     517      WRITE(ldtxt(ii),*) 'domain_cfg : domain size read in', TRIM( cn_domcfg ), ' file'   ;   ii = ii+1 
     518      WRITE(ldtxt(ii),*) '~~~~~~~~~~ '                                                    ;   ii = ii+1 
     519      ! 
     520      CALL iom_open( cn_domcfg, inum ) 
     521      ! 
     522      !                                   !- ORCA family specificity 
     523      IF(  iom_varid( inum, 'ORCA'           , ldstop = .FALSE. ) > 0  .AND.  & 
     524         & iom_varid( inum, 'ORCA_resolution', ldstop = .FALSE. ) > 0    ) THEN 
     525         ! 
     526         cd_cfg = 'ORCA' 
     527         CALL iom_get( inum, 'ORCA_resolution', zorca_res )   ;   kk_cfg = INT( zorca_res ) 
     528         ! 
     529         WRITE(ldtxt(ii),*) '       '                                                    ;   ii = ii+1 
     530         WRITE(ldtxt(ii),*) '       ==>>>   ORCA configuration '                         ;   ii = ii+1 
     531         WRITE(ldtxt(ii),*) '       '                                                    ;   ii = ii+1 
     532         ! 
     533      ELSE                                !- cd_cfg & k_cfg are not used 
     534         cd_cfg = 'UNKNOWN' 
     535         kk_cfg = -9999999 
     536      ENDIF 
     537      ! 
     538      CALL iom_get( inum, 'jpiglo', ziglo  )   ;   jpiglo = INT( ziglo ) 
     539      CALL iom_get( inum, 'jpjglo', zjglo  )   ;   jpjglo = INT( zjglo ) 
     540      CALL iom_get( inum, 'jpkglo', zkglo  )   ;   jpkglo = INT( zkglo ) 
     541      CALL iom_get( inum, 'jperio', zperio )   ;   jperio = INT( zperio ) 
     542      CALL iom_close( inum ) 
     543      ! 
     544      WRITE(ldtxt(ii),*) '   cn_cfg = ', TRIM(cd_cfg), '   nn_cfg = ', kk_cfg             ;   ii = ii+1 
     545      WRITE(ldtxt(ii),*) '   jpiglo = ', jpiglo                                           ;   ii = ii+1 
     546      WRITE(ldtxt(ii),*) '   jpjglo = ', jpjglo      , '   jpkglo = ', jpkglo             ;   ii = ii +1 
     547      WRITE(ldtxt(ii),*) '   jpkglo = ', jpkglo                                           ;   ii = ii +1 
     548      WRITE(ldtxt(ii),*) '   type of global domain lateral boundary   jperio = ', jperio  ;   ii = ii +1 
     549      !         
     550   END SUBROUTINE domain_cfg 
     551    
     552    
    494553   SUBROUTINE cfg_write 
    495554      !!---------------------------------------------------------------------- 
    496555      !!                  ***  ROUTINE cfg_write  *** 
    497556      !!                    
    498       !! ** Purpose :   Create the "domain_cfg" file, a NetCDF file which  
     557      !! ** Purpose :   Create the "cn_domcfg_out" file, a NetCDF file which  
    499558      !!              contains all the ocean domain informations required to  
    500559      !!              define an ocean configuration. 
     
    503562      !!              ocean configuration. 
    504563      !! 
    505       !! ** output file :   domain_cfg.nc : domain size, characteristics, horizontal mesh, 
    506       !!                              Coriolis parameter, depth and vertical scale factors 
     564      !! ** output file :   domcfg_out.nc : domain size, characteristics, horizontal  
     565      !!                       mesh, Coriolis parameter, and vertical scale factors 
     566      !!                    NB: also contain ORCA family information 
    507567      !!---------------------------------------------------------------------- 
    508568      INTEGER           ::   ji, jj, jk   ! dummy loop indices 
    509569      INTEGER           ::   izco, izps, isco, icav 
    510       INTEGER           ::   inum     ! temprary units for 'domain_cfg.nc' file 
     570      INTEGER           ::   inum     ! local units 
    511571      CHARACTER(len=21) ::   clnam    ! filename (mesh and mask informations) 
    512572      REAL(wp), DIMENSION(jpi,jpj) ::   z2d   ! workspace 
     
    514574      ! 
    515575      IF(lwp) WRITE(numout,*) 
    516       IF(lwp) WRITE(numout,*) 'cfg_write : create the "domain_cfg.nc" file containing all required configuration information' 
     576      IF(lwp) WRITE(numout,*) 'cfg_write : create the domain configuration file (', TRIM(cn_domcfg_out),'.nc)' 
    517577      IF(lwp) WRITE(numout,*) '~~~~~~~~~' 
    518578      ! 
    519579      !                       ! ============================= ! 
    520       !                       !  create 'domain_cfg.nc' file  ! 
     580      !                       !  create 'domcfg_out.nc' file  ! 
    521581      !                       ! ============================= ! 
    522582      !          
    523       clnam = 'domain_cfg'  ! filename (configuration information) 
     583      clnam = 'domcfg_out'  ! filename (configuration information) 
    524584      CALL iom_open( TRIM(clnam), inum, ldwrt = .TRUE., kiolib = jprstlib ) 
    525585       
     586      ! 
     587      !                             !==  ORCA family specificities  ==! 
     588      IF( cn_cfg == "ORCA" ) THEN 
     589         CALL iom_rstput( 0, 0, inum, 'ORCA'      , 1._wp            , ktype = jp_i4 ) 
     590         CALL iom_rstput( 0, 0, inum, 'ORCA_index', REAL( nn_cfg, wp), ktype = jp_i4 )          
     591      ENDIF 
     592      ! 
    526593      !                             !==  global domain size  ==! 
    527594      ! 
     
    574641      !                             !==  vertical mesh  ==! 
    575642      !                                                      
    576       CALL iom_rstput( 0, 0, inum, 'e3t_1d'  , e3t_1d  , ktype = jp_r8 )   ! reference 1D-coordinate 
    577       CALL iom_rstput( 0, 0, inum, 'e3w_1d'  , e3w_1d  , ktype = jp_r8 ) 
    578       ! 
    579       CALL iom_rstput( 0, 0, inum, 'e3t_0'   , e3t_0   , ktype = jp_r8 )   ! vertical scale factors 
    580       CALL iom_rstput( 0, 0, inum, 'e3u_0'   , e3u_0   , ktype = jp_r8 ) 
    581       CALL iom_rstput( 0, 0, inum, 'e3v_0'   , e3v_0   , ktype = jp_r8 ) 
    582       CALL iom_rstput( 0, 0, inum, 'e3f_0'   , e3f_0   , ktype = jp_r8 ) 
    583       CALL iom_rstput( 0, 0, inum, 'e3w_0'   , e3w_0   , ktype = jp_r8 ) 
    584       CALL iom_rstput( 0, 0, inum, 'e3uw_0'  , e3uw_0  , ktype = jp_r8 ) 
    585       CALL iom_rstput( 0, 0, inum, 'e3vw_0'  , e3vw_0  , ktype = jp_r8 ) 
     643      CALL iom_rstput( 0, 0, inum, 'e3t_1d'  , e3t_1d , ktype = jp_r8 )   ! reference 1D-coordinate 
     644      CALL iom_rstput( 0, 0, inum, 'e3w_1d'  , e3w_1d , ktype = jp_r8 ) 
     645      ! 
     646      CALL iom_rstput( 0, 0, inum, 'e3t_0'   , e3t_0  , ktype = jp_r8 )   ! vertical scale factors 
     647      CALL iom_rstput( 0, 0, inum, 'e3u_0'   , e3u_0  , ktype = jp_r8 ) 
     648      CALL iom_rstput( 0, 0, inum, 'e3v_0'   , e3v_0  , ktype = jp_r8 ) 
     649      CALL iom_rstput( 0, 0, inum, 'e3f_0'   , e3f_0  , ktype = jp_r8 ) 
     650      CALL iom_rstput( 0, 0, inum, 'e3w_0'   , e3w_0  , ktype = jp_r8 ) 
     651      CALL iom_rstput( 0, 0, inum, 'e3uw_0'  , e3uw_0 , ktype = jp_r8 ) 
     652      CALL iom_rstput( 0, 0, inum, 'e3vw_0'  , e3vw_0 , ktype = jp_r8 ) 
    586653      !                                          
    587654      !                             !==  wet top and bottom level  ==!   (caution: multiplied by ssmask) 
  • branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/NEMO/OPA_SRC/DOM/domhgr.F90

    r6894 r7200  
    2121   !!---------------------------------------------------------------------- 
    2222   !!   dom_hgr       : initialize the horizontal mesh  
    23    !!   hgr_read      : read "coordinate" NetCDF file  
     23   !!   hgr_read      : read horizontal information in the domain configuration file  
    2424   !!---------------------------------------------------------------------- 
    2525   USE dom_oce        ! ocean space and time domain 
     
    9191      IF( ln_read_cfg ) THEN        !==  read in mesh_mask.nc file  ==! 
    9292         IF(lwp) WRITE(numout,*) 
    93          IF(lwp) WRITE(numout,*) '          read horizontal mesh in "domain_cfg" file' 
     93         IF(lwp) WRITE(numout,*) '          read horizontal mesh in ', TRIM( cn_domcfg ), ' file' 
    9494         ! 
    9595         CALL hgr_read   ( glamt , glamu , glamv , glamf ,   &    ! geographic position (required) 
     
    121121      ELSE 
    122122         IF( ln_read_cfg ) THEN 
    123             IF(lwp) WRITE(numout,*) '          Coriolis parameter have been read in "domain_cfg" file' 
     123            IF(lwp) WRITE(numout,*) '          Coriolis parameter have been read in ', TRIM( cn_domcfg ), ' file' 
    124124         ELSE 
    125125            IF(lwp) WRITE(numout,*) '          Coriolis parameter have been set in usr_def_hgr routine' 
     
    186186      ENDIF 
    187187      ! 
    188       CALL iom_open( 'domain_cfg', inum ) 
     188      CALL iom_open( cn_domcfg, inum ) 
    189189      ! 
    190190      CALL iom_get( inum, jpdom_data, 'glamt', plamt, lrowattr=ln_use_jattr ) 
     
    210210      IF(  iom_varid( inum, 'ff_f', ldstop = .FALSE. ) > 0  .AND.  & 
    211211         & iom_varid( inum, 'ff_t', ldstop = .FALSE. ) > 0    ) THEN 
    212          IF(lwp) WRITE(numout,*) '           Coriolis factor at f- and t-points read in domain_cfg file' 
     212         IF(lwp) WRITE(numout,*) '           Coriolis factor at f- and t-points read in ', TRIM( cn_domcfg ), ' file' 
    213213         CALL iom_get( inum, jpdom_data, 'ff_f'  , pff_f  , lrowattr=ln_use_jattr ) 
    214214         CALL iom_get( inum, jpdom_data, 'ff_t'  , pff_t  , lrowattr=ln_use_jattr ) 
     
    219219      ! 
    220220      IF( iom_varid( inum, 'e1e2u', ldstop = .FALSE. ) > 0 ) THEN 
    221          IF(lwp) WRITE(numout,*) '           e1e2u & e1e2v read in domain_cfg file' 
     221         IF(lwp) WRITE(numout,*) '           e1e2u & e1e2v read in ', TRIM( cn_domcfg ), ' file' 
    222222         CALL iom_get( inum, jpdom_data, 'e1e2u'  , pe1e2u  , lrowattr=ln_use_jattr ) 
    223223         CALL iom_get( inum, jpdom_data, 'e1e2v'  , pe1e2v  , lrowattr=ln_use_jattr ) 
  • branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/NEMO/OPA_SRC/DOM/dommsk.F90

    r7111 r7200  
    140140         END DO   
    141141      END DO   
    142 !SF  add here lbc_lnk: bug not still understood : cause now domain_cfg is read ! 
     142!SF  add here lbc_lnk: bug not still understood : cause now domain configuration is read ! 
     143!!gm I don't understand why...   
    143144   CALL lbc_lnk( tmask  , 'T', 1._wp )      ! Lateral boundary conditions 
    144145 
     
    263264      ! --------------------------------  
    264265      ! 
    265       CALL usr_def_fmask( cp_cfg, jp_cfg, fmask ) 
     266      CALL usr_def_fmask( cn_cfg, nn_cfg, fmask ) 
    266267      ! 
    267268      ! 
  • branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/NEMO/OPA_SRC/DOM/domvvl.F90

    r6667 r7200  
    232232               END DO 
    233233            END DO 
    234             IF( cp_cfg == "orca" .AND. jp_cfg == 3 ) THEN   ! ORCA2: Suppress ztilde in the Foxe Basin for ORCA2 
     234            IF( cn_cfg == "orca" .AND. nn_cfg == 3 ) THEN   ! ORCA2: Suppress ztilde in the Foxe Basin for ORCA2 
    235235               ii0 = 103   ;   ii1 = 111        
    236236               ij0 = 128   ;   ij1 = 135   ;    
  • branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/NEMO/OPA_SRC/DOM/domzgr.F90

    r7189 r7200  
    2323   !!---------------------------------------------------------------------- 
    2424   !!   dom_zgr       : read or set the ocean vertical coordinate system 
    25    !!   zgr_read      : read the vertical domain coordinate and mask in domain_cfg file 
     25   !!   zgr_read      : read the vertical information in the domain configuration file 
    2626   !!   zgr_top_bot   : ocean top and bottom level for t-, u, and v-points with 1 as minimum value 
    2727   !!--------------------------------------------------------------------- 
     
    8989      IF( ln_read_cfg ) THEN        !==  read in mesh_mask.nc file  ==! 
    9090         IF(lwp) WRITE(numout,*) 
    91          IF(lwp) WRITE(numout,*) '          Read vertical mesh in "domain_cfg" file' 
     91         IF(lwp) WRITE(numout,*) '          Read vertical mesh in ', TRIM( cn_domcfg ), ' file' 
    9292         ! 
    9393         CALL zgr_read   ( ln_zco  , ln_zps  , ln_sco, ln_isfcav,   &  
     
    120120      IF(lwp) THEN                     ! Control print 
    121121         WRITE(numout,*) 
    122          WRITE(numout,*) '   Type of vertical coordinate (read in domain_cfg.nc or set through user defined routines) :' 
     122         WRITE(numout,*) '   Type of vertical coordinate (read in ', TRIM( cn_domcfg ), ' file or set in userdef_nam) :' 
    123123         WRITE(numout,*) '      z-coordinate - full steps      ln_zco    = ', ln_zco 
    124124         WRITE(numout,*) '      z-coordinate - partial steps   ln_zps    = ', ln_zps 
     
    178178      !!              ***  ROUTINE zgr_read  *** 
    179179      !! 
    180       !! ** Purpose :   Read the vertical information in a domain_cfg.nc file 
     180      !! ** Purpose :   Read the vertical information in the domain configuration file 
    181181      !! 
    182182      !!---------------------------------------------------------------------- 
     
    198198      IF(lwp) THEN 
    199199         WRITE(numout,*) 
    200          WRITE(numout,*) '   zgr_read : read the vertical coordinates in "domain_cfg.nc" file' 
    201          WRITE(numout,*) '   ~~~~~~~~      jpiglo = ', jpiglo, ' jpjglo = ', jpjglo, ' jpkglo = ', jpkglo 
    202       ENDIF 
    203       ! 
    204       CALL iom_open( 'domain_cfg', inum ) 
    205       ! 
    206       !                                   ! type of vertical coordinate 
     200         WRITE(numout,*) '   zgr_read : read the vertical coordinates in ', TRIM( cn_domcfg ), ' file' 
     201         WRITE(numout,*) '   ~~~~~~~~' 
     202      ENDIF 
     203      ! 
     204      CALL iom_open( cn_domcfg, inum ) 
     205      ! 
     206      !                          !* type of vertical coordinate 
    207207      CALL iom_get( inum, 'ln_zco'   , z_zco ) 
    208208      CALL iom_get( inum, 'ln_zps'   , z_zps ) 
     
    212212      IF( z_sco == 0._wp ) THEN   ;   ld_sco = .false.   ;   ELSE   ;   ld_sco = .true.   ;   ENDIF 
    213213      ! 
    214       !                                   ! ocean cavities under iceshelves 
     214      !                          !* ocean cavities under iceshelves 
    215215      CALL iom_get( inum, 'ln_isfcav', z_cav ) 
    216216      IF( z_cav == 0._wp ) THEN   ;   ld_isfcav = .false.   ;   ELSE   ;   ld_isfcav = .true.   ;   ENDIF 
    217217      ! 
    218       !                                   ! 1D vertical scale factors (reference coordinate) 
    219       CALL iom_get( inum, jpdom_unknown, 'e3t_1d'  , pe3t_1d  ) 
     218      !                          !* vertical scale factors 
     219      CALL iom_get( inum, jpdom_unknown, 'e3t_1d'  , pe3t_1d  )                     ! 1D reference coordinate 
    220220      CALL iom_get( inum, jpdom_unknown, 'e3w_1d'  , pe3w_1d  ) 
    221221      ! 
    222       !                                   ! 3D vertical scale factors 
    223       CALL iom_get( inum, jpdom_data, 'e3t_0'  , pe3t  , lrowattr=ln_use_jattr ) 
     222      CALL iom_get( inum, jpdom_data, 'e3t_0'  , pe3t  , lrowattr=ln_use_jattr )    ! 3D coordinate 
    224223      CALL iom_get( inum, jpdom_data, 'e3u_0'  , pe3u  , lrowattr=ln_use_jattr ) 
    225224      CALL iom_get( inum, jpdom_data, 'e3v_0'  , pe3v  , lrowattr=ln_use_jattr ) 
     
    229228      CALL iom_get( inum, jpdom_data, 'e3vw_0' , pe3vw , lrowattr=ln_use_jattr ) 
    230229      ! 
    231       !                                   ! 1D & 3D depths 
    232       ! 
    233       !                                         ! old depth definition (obsolescent feature) 
     230      !                          !* depths 
     231      !                                   !- old depth definition (obsolescent feature) 
    234232      IF(  iom_varid( inum, 'gdept_1d', ldstop = .FALSE. ) > 0  .AND.  & 
    235233         & iom_varid( inum, 'gdepw_1d', ldstop = .FALSE. ) > 0  .AND.  & 
     
    237235         & iom_varid( inum, 'gdepw_0' , ldstop = .FALSE. ) > 0    ) THEN 
    238236         CALL ctl_warn( 'zgr_read : old definition of depths and scale factors used ', &  
    239             &                      'depths at t- and w-points read in domain_cfg file') 
     237            &           '           depths at t- and w-points read in the domain configuration file') 
    240238         CALL iom_get( inum, jpdom_unknown, 'gdept_1d', pdept_1d )    
    241239         CALL iom_get( inum, jpdom_unknown, 'gdepw_1d', pdepw_1d ) 
     
    243241         CALL iom_get( inum, jpdom_data   , 'gdepw_0' , pdepw , lrowattr=ln_use_jattr ) 
    244242         ! 
    245       ELSE                                      ! depths computed from e3. scale factors 
    246          ! 
     243      ELSE                                !- depths computed from e3. scale factors 
    247244         CALL e3_to_depth( pe3t_1d, pe3w_1d, pdept_1d, pdepw_1d )    ! 1D reference depth 
     245         CALL e3_to_depth( pe3t   , pe3w   , pdept   , pdepw    )    ! 3D depths 
    248246         IF(lwp) THEN 
    249247            WRITE(numout,*) 
     
    252250            WRITE(numout, "(10x, i4, 4f9.2)" ) ( jk, pdept_1d(jk), pdepw_1d(jk), pe3t_1d(jk), pe3w_1d(jk), jk = 1, jpk ) 
    253251         ENDIF 
    254          !                                       
    255          CALL e3_to_depth( pe3t   , pe3w   , pdept   , pdepw    )    ! 3D depths 
    256          ! 
    257       ENDIF 
    258       ! 
    259       !                                   ! ocean top and bottom level 
    260       CALL iom_get( inum, jpdom_data, 'bottom_level' , z2d  , lrowattr=ln_use_jattr )  ! nb of ocean T-points 
     252      ENDIF 
     253      ! 
     254      !                          !* ocean top and bottom level 
     255      CALL iom_get( inum, jpdom_data, 'top_level'    , z2d  , lrowattr=ln_use_jattr )   ! 1st wet T-points (ISF) 
     256      k_top(:,:) = INT( z2d(:,:) ) 
     257      CALL iom_get( inum, jpdom_data, 'bottom_level' , z2d  , lrowattr=ln_use_jattr )   ! last wet T-points 
    261258      k_bot(:,:) = INT( z2d(:,:) ) 
    262       CALL iom_get( inum, jpdom_data, 'top_level'    , z2d  , lrowattr=ln_use_jattr )   ! nb of ocean T-points (ISF) 
    263       k_top(:,:) = INT( z2d(:,:) ) 
    264259      ! 
    265260      CALL iom_close( inum ) 
  • branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/NEMO/OPA_SRC/DOM/dtatsd.F90

    r6580 r7200  
    155155      ! 
    156156      ! 
     157!!gm  This should be removed from the code   ===>>>>  T & S files has to be changed 
     158      ! 
    157159      !                                   !==   ORCA_R2 configuration and T & S damping   ==!  
    158       IF( cp_cfg == "orca" .AND. jp_cfg == 2 .AND. ln_tsd_tradmp ) THEN    ! some hand made alterations 
     160      IF( cn_cfg == "orca" .AND. nn_cfg == 2 .AND. ln_tsd_tradmp ) THEN    ! some hand made alterations 
    159161         ! 
    160162         ij0 = 101   ;   ij1 = 109                       ! Reduced T & S in the Alboran Sea 
     
    178180         sf_tsd(jp_tem)%fnow( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) , 14:20 ) = 6.0_wp 
    179181      ENDIF 
     182!!gm end 
    180183      ! 
    181184      ptsd(:,:,:,jp_tem) = sf_tsd(jp_tem)%fnow(:,:,:)    ! NO mask 
  • branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/NEMO/OPA_SRC/LBC/mppini_2.h90

    r6977 r7200  
    66      !!     FOR USING THIS VERSION, A PREPROCESSING TRAITMENT IS RECOMMENDED 
    77      !!     FOR DEFINING BETTER CUTTING OUT. 
    8       !!       This routine requires the presence of the "domain_cfg.nc" file. 
     8      !!       This routine requires the presence of the domain configuration file. 
    99      !!       In this version, the land processors are avoided and the adress 
    1010      !!     processor (nproc, narea,noea, ...) are calculated again. 
     
    3737      !!                 !  1998-05  (M. Imbard, J. Escobar, L. Colombet )  SHMEM and MPI versions 
    3838      !!  NEMO      1.0  !  2004-01  (G. Madec, J.M Molines)  F90 : free form , north fold jpni > 1 
    39       !!            4.0  !  2016-06  (G. Madec)  use domain_cfg file instead of bathymetry file 
     39      !!            4.0  !  2016-06  (G. Madec)  use domain configuration file instead of bathymetry file 
    4040      !!---------------------------------------------------------------------- 
    4141      USE in_out_manager  ! I/O Manager 
     
    8383      ! 0. initialisation 
    8484      ! ----------------- 
    85       CALL iom_open( 'domain_cfg', inum ) 
     85      CALL iom_open( cn_domcfg, inum ) 
    8686      ! 
    8787      !                                   ! ocean top and bottom level 
  • branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/NEMO/OPA_SRC/LDF/ldftra.F90

    r6596 r7200  
    558558      END DO 
    559559 
    560 !!gm      IF( cp_cfg == "orca" .AND. jp_cfg == 2 ) THEN   ! ORCA R2 
    561 !!gm         DO jj = 2, jpjm1 
    562 !!gm            DO ji = fs_2, fs_jpim1   ! vector opt. 
    563 !!gm               ! Take the minimum between aeiw and 1000 m2/s over shelves (depth shallower than 650 m) 
    564 !!gm               IF( mbkt(ji,jj) <= 20 )   zaeiw(ji,jj) = MIN( zaeiw(ji,jj), 1000. ) 
    565 !!gm            END DO 
    566 !!gm         END DO 
    567 !!gm      ENDIF 
    568  
    569560      !                                         !==  Bound on eiv coeff.  ==! 
    570561      z1_f20 = 1._wp / (  2._wp * omega * sin( rad * 20._wp )  ) 
  • branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/NEMO/OPA_SRC/SBC/sbcmod.F90

    r6900 r7200  
    378378      ! (update freshwater fluxes) 
    379379      ! Should not be ran if ln_diurnal_only 
    380       IF( .NOT.(ln_diurnal_only) .AND. (nn_closea == 1) )   CALL sbc_clo( kt )    
     380      IF( .NOT.ln_diurnal_only .AND. nn_closea == 1 )   CALL sbc_clo( kt, cn_cfg, nn_cfg )    
    381381 
    382382!RBbug do not understand why see ticket 667 
  • branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_fct.F90

    r6900 r7200  
    3838   REAL(wp) ::   r1_6 = 1._wp / 6._wp   ! =1/6 
    3939 
     40   !                                        ! tridiag solver associated indices: 
     41   INTEGER, PARAMETER ::   np_NH   = 0   ! Neumann homogeneous boundary condition 
     42   INTEGER, PARAMETER ::   np_CEN2 = 1   ! 2nd order centered  boundary condition 
     43 
    4044   !! * Substitutions 
    4145#  include "vectopt_loop_substitute.h90" 
     
    706710 
    707711 
    708    SUBROUTINE interp_4th_cpt( pt_in, pt_out ) 
    709       !!---------------------------------------------------------------------- 
    710       !!                  ***  ROUTINE interp_4th_cpt  *** 
     712   SUBROUTINE interp_4th_cpt_org( pt_in, pt_out ) 
     713      !!---------------------------------------------------------------------- 
     714      !!                  ***  ROUTINE interp_4th_cpt_org  *** 
    711715      !!  
    712716      !! **  Purpose :   Compute the interpolation of tracer at w-point 
     
    739743      END DO 
    740744      ! 
    741       jk=2                                            ! Switch to second order centered at top 
    742       DO jj=1,jpj 
    743          DO ji=1,jpi 
     745      jk = 2                                          ! Switch to second order centered at top 
     746      DO jj = 1, jpj 
     747         DO ji = 1, jpi 
    744748            zwd (ji,jj,jk) = 1._wp 
    745749            zwi (ji,jj,jk) = 0._wp 
     
    789793      END DO 
    790794      !     
     795   END SUBROUTINE interp_4th_cpt_org 
     796    
     797 
     798   SUBROUTINE interp_4th_cpt( pt_in, pt_out ) 
     799      !!---------------------------------------------------------------------- 
     800      !!                  ***  ROUTINE interp_4th_cpt  *** 
     801      !!  
     802      !! **  Purpose :   Compute the interpolation of tracer at w-point 
     803      !! 
     804      !! **  Method  :   4th order compact interpolation 
     805      !!---------------------------------------------------------------------- 
     806      REAL(wp),DIMENSION(jpi,jpj,jpk), INTENT(in   ) ::   pt_in    ! field at t-point 
     807      REAL(wp),DIMENSION(jpi,jpj,jpk), INTENT(  out) ::   pt_out   ! field interpolated at w-point 
     808      ! 
     809      INTEGER ::   ji, jj, jk   ! dummy loop integers 
     810      INTEGER ::   ikt, ikb     ! local integers 
     811      REAL(wp),DIMENSION(jpi,jpj,jpk) :: zwd, zwi, zws, zwrm, zwt 
     812      !!---------------------------------------------------------------------- 
     813      ! 
     814      !                      !==  build the three diagonal matrix & the RHS  ==! 
     815      ! 
     816      DO jk = 3, jpkm1                 ! interior (from jk=3 to jpk-1) 
     817         DO jj = 2, jpjm1 
     818            DO ji = fs_2, fs_jpim1 
     819               zwd (ji,jj,jk) = 3._wp * wmask(ji,jj,jk) + 1._wp                 !       diagonal 
     820               zwi (ji,jj,jk) =         wmask(ji,jj,jk)                         ! lower diagonal 
     821               zws (ji,jj,jk) =         wmask(ji,jj,jk)                         ! upper diagonal 
     822               zwrm(ji,jj,jk) = 3._wp * wmask(ji,jj,jk)                     &   ! RHS 
     823                  &           *       ( pt_in(ji,jj,jk) + pt_in(ji,jj,jk-1) ) 
     824            END DO 
     825         END DO 
     826      END DO 
     827      ! 
     828!!gm 
     829!      SELECT CASE( kbc )               !* boundary condition 
     830!      CASE( np_NH   )   ! Neumann homogeneous at top & bottom 
     831!      CASE( np_CEN2 )   ! 2nd order centered  at top & bottom 
     832!      END SELECT 
     833!!gm   
     834      ! 
     835      DO jj = 2, jpjm1                 ! 2nd order centered at top & bottom 
     836         DO ji = fs_2, fs_jpim1 
     837            ikt = mikt(ji,jj) + 1            ! w-point below the 1st  wet point 
     838            ikb = mbkt(ji,jj)                !     -   above the last wet point 
     839            ! 
     840            zwd (ji,jj,ikt) = 1._wp          ! top 
     841            zwi (ji,jj,ikt) = 0._wp 
     842            zws (ji,jj,ikt) = 0._wp 
     843            zwrm(ji,jj,ikt) = 0.5_wp * ( pt_in(ji,jj,jk-1) + pt_in(ji,jj,jk) ) 
     844            ! 
     845            zwd (ji,jj,ikb) = 1._wp          ! bottom 
     846            zwi (ji,jj,ikb) = 0._wp 
     847            zws (ji,jj,ikb) = 0._wp 
     848            zwrm(ji,jj,ikb) = 0.5_wp * ( pt_in(ji,jj,jk-1) + pt_in(ji,jj,jk) )             
     849         END DO 
     850      END DO    
     851      ! 
     852      !                       !==  tridiagonal solver  ==! 
     853      ! 
     854      DO jj = 2, jpjm1              !* 1st recurrence:   Tk = Dk - Ik Sk-1 / Tk-1 
     855         DO ji = fs_2, fs_jpim1 
     856            zwt(ji,jj,2) = zwd(ji,jj,2) 
     857         END DO 
     858      END DO 
     859      DO jk = 3, jpkm1 
     860         DO jj = 2, jpjm1 
     861            DO ji = fs_2, fs_jpim1 
     862               zwt(ji,jj,jk) = zwd(ji,jj,jk) - zwi(ji,jj,jk) * zws(ji,jj,jk-1) /zwt(ji,jj,jk-1) 
     863            END DO 
     864         END DO 
     865      END DO 
     866      ! 
     867      DO jj = 2, jpjm1              !* 2nd recurrence:    Zk = Yk - Ik / Tk-1  Zk-1 
     868         DO ji = fs_2, fs_jpim1 
     869            pt_out(ji,jj,2) = zwrm(ji,jj,2) 
     870         END DO 
     871      END DO 
     872      DO jk = 3, jpkm1 
     873         DO jj = 2, jpjm1 
     874            DO ji = fs_2, fs_jpim1 
     875               pt_out(ji,jj,jk) = zwrm(ji,jj,jk) - zwi(ji,jj,jk) / zwt(ji,jj,jk-1) *pt_out(ji,jj,jk-1)              
     876            END DO 
     877         END DO 
     878      END DO 
     879 
     880      DO jj = 2, jpjm1              !* 3d recurrence:    Xk = (Zk - Sk Xk+1 ) / Tk 
     881         DO ji = fs_2, fs_jpim1 
     882            pt_out(ji,jj,jpkm1) = pt_out(ji,jj,jpkm1) / zwt(ji,jj,jpkm1) 
     883         END DO 
     884      END DO 
     885      DO jk = jpk-2, 2, -1 
     886         DO jj = 2, jpjm1 
     887            DO ji = fs_2, fs_jpim1 
     888               pt_out(ji,jj,jk) = ( pt_out(ji,jj,jk) - zws(ji,jj,jk) * pt_out(ji,jj,jk+1) ) / zwt(ji,jj,jk) 
     889            END DO 
     890         END DO 
     891      END DO 
     892      !     
    791893   END SUBROUTINE interp_4th_cpt 
    792     
     894 
     895 
     896   SUBROUTINE tridia_solver( pD, pU, pL, pRHS, pt_out , klev ) 
     897      !!---------------------------------------------------------------------- 
     898      !!                  ***  ROUTINE tridia_solver  *** 
     899      !!  
     900      !! **  Purpose :   solve a symmetric 3diagonal system 
     901      !! 
     902      !! **  Method  :   solve M.t_out = RHS(t)  where M is a tri diagonal matrix ( jpk*jpk ) 
     903      !!      
     904      !!             ( D_1 U_1  0   0   0  )( t_1 )   ( RHS_1 ) 
     905      !!             ( L_2 D_2 U_2  0   0  )( t_2 )   ( RHS_2 ) 
     906      !!             (  0  L_3 D_3 U_3  0  )( t_3 ) = ( RHS_3 ) 
     907      !!             (        ...          )( ... )   ( ...  ) 
     908      !!             (  0   0   0  L_k D_k )( t_k )   ( RHS_k ) 
     909      !!      
     910      !!        M is decomposed in the product of an upper and lower triangular matrix. 
     911      !!        The tri-diagonals matrix is given as input 3D arrays:   pD, pU, pL  
     912      !!        (i.e. the Diagonal, the Upper diagonal, and the Lower diagonal). 
     913      !!        The solution is pta. 
     914      !!        The 3d array zwt is used as a work space array. 
     915      !!---------------------------------------------------------------------- 
     916      REAL(wp),DIMENSION(:,:,:), INTENT(in   ) ::   pD, pU, PL    ! 3-diagonal matrix 
     917      REAL(wp),DIMENSION(:,:,:), INTENT(in   ) ::   pRHS          ! Right-Hand-Side 
     918      REAL(wp),DIMENSION(:,:,:), INTENT(  out) ::   pt_out        !!gm field at level=F(klev) 
     919      INTEGER                  , INTENT(in   ) ::   klev          ! =1 pt_out at w-level  
     920      !                                                           ! =0 pt at t-level 
     921      INTEGER ::   ji, jj, jk   ! dummy loop integers 
     922      INTEGER ::   kstart       ! local indices 
     923      REAL(wp),DIMENSION(jpi,jpj,jpk) ::   zwt   ! 3D work array 
     924      !!---------------------------------------------------------------------- 
     925      ! 
     926      kstart =  1  + klev 
     927      ! 
     928      DO jj = 2, jpjm1              !* 1st recurrence:   Tk = Dk - Ik Sk-1 / Tk-1 
     929         DO ji = fs_2, fs_jpim1 
     930            zwt(ji,jj,kstart) = pD(ji,jj,kstart) 
     931         END DO 
     932      END DO 
     933      DO jk = kstart+1, jpkm1 
     934         DO jj = 2, jpjm1 
     935            DO ji = fs_2, fs_jpim1 
     936               zwt(ji,jj,jk) = pD(ji,jj,jk) - pL(ji,jj,jk) * pU(ji,jj,jk-1) /zwt(ji,jj,jk-1) 
     937            END DO 
     938         END DO 
     939      END DO 
     940      ! 
     941      DO jj = 2, jpjm1              !* 2nd recurrence:    Zk = Yk - Ik / Tk-1  Zk-1 
     942         DO ji = fs_2, fs_jpim1 
     943            pt_out(ji,jj,kstart) = pRHS(ji,jj,kstart) 
     944         END DO 
     945      END DO 
     946      DO jk = kstart+1, jpkm1 
     947         DO jj = 2, jpjm1 
     948            DO ji = fs_2, fs_jpim1 
     949               pt_out(ji,jj,jk) = pRHS(ji,jj,jk) - pL(ji,jj,jk) / zwt(ji,jj,jk-1) *pt_out(ji,jj,jk-1)              
     950            END DO 
     951         END DO 
     952      END DO 
     953 
     954      DO jj = 2, jpjm1              !* 3d recurrence:    Xk = (Zk - Sk Xk+1 ) / Tk 
     955         DO ji = fs_2, fs_jpim1 
     956            pt_out(ji,jj,jpkm1) = pt_out(ji,jj,jpkm1) / zwt(ji,jj,jpkm1) 
     957         END DO 
     958      END DO 
     959      DO jk = jpk-2, kstart, -1 
     960         DO jj = 2, jpjm1 
     961            DO ji = fs_2, fs_jpim1 
     962               pt_out(ji,jj,jk) = ( pt_out(ji,jj,jk) - pU(ji,jj,jk) * pt_out(ji,jj,jk+1) ) / zwt(ji,jj,jk) 
     963            END DO 
     964         END DO 
     965      END DO 
     966      ! 
     967   END SUBROUTINE tridia_solver 
     968 
    793969   !!====================================================================== 
    794970END MODULE traadv_fct 
  • branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/NEMO/OPA_SRC/TRA/trabbl.F90

    r6717 r7200  
    545545      CALL wrk_dealloc( jpi, jpj, zmbk ) 
    546546 
    547                                         !* sign of grad(H) at u- and v-points 
     547      !                                 !* sign of grad(H) at u- and v-points 
    548548      mgrhu(jpi,:) = 0   ;   mgrhu(:,jpj) = 0   ;   mgrhv(jpi,:) = 0   ;   mgrhv(:,jpj) = 0 
    549549      DO jj = 1, jpjm1 
     
    553553         END DO 
    554554      END DO 
    555  
     555      ! 
    556556      DO jj = 1, jpjm1              !* bbl thickness at u- (v-) point 
    557557         DO ji = 1, jpim1                 ! minimum of top & bottom e3u_0 (e3v_0) 
     
    561561      END DO 
    562562      CALL lbc_lnk( e3u_bbl_0, 'U', 1. )   ;   CALL lbc_lnk( e3v_bbl_0, 'V', 1. )      ! lateral boundary conditions 
    563  
     563      ! 
    564564      !                             !* masked diffusive flux coefficients 
    565565      ahu_bbl_0(:,:) = rn_ahtbbl * e2_e1u(:,:) * e3u_bbl_0(:,:) * umask(:,:,1) 
    566566      ahv_bbl_0(:,:) = rn_ahtbbl * e1_e2v(:,:) * e3v_bbl_0(:,:) * vmask(:,:,1) 
    567567 
    568  
    569       IF( cp_cfg == "orca" ) THEN   !* ORCA configuration : regional enhancement of ah_bbl 
    570          ! 
    571          SELECT CASE ( jp_cfg ) 
    572          CASE ( 2 )                          ! ORCA_R2 
    573             ij0 = 102   ;   ij1 = 102              ! Gibraltar enhancement of BBL 
    574             ii0 = 139   ;   ii1 = 140 
    575             ahu_bbl_0(mi0(ii0):mi1(ii1),mj0(ij0):mj1(ij1)) =  4.e0*ahu_bbl_0(mi0(ii0):mi1(ii1),mj0(ij0):mj1(ij1)) 
    576             ahv_bbl_0(mi0(ii0):mi1(ii1),mj0(ij0):mj1(ij1)) =  4.e0*ahv_bbl_0(mi0(ii0):mi1(ii1),mj0(ij0):mj1(ij1)) 
    577             ! 
    578             ij0 =  88   ;   ij1 =  88              ! Red Sea enhancement of BBL 
    579             ii0 = 161   ;   ii1 = 162 
    580             ahu_bbl_0(mi0(ii0):mi1(ii1),mj0(ij0):mj1(ij1)) = 10.e0*ahu_bbl_0(mi0(ii0):mi1(ii1),mj0(ij0):mj1(ij1)) 
    581             ahv_bbl_0(mi0(ii0):mi1(ii1),mj0(ij0):mj1(ij1)) = 10.e0*ahv_bbl_0(mi0(ii0):mi1(ii1),mj0(ij0):mj1(ij1)) 
    582             ! 
    583          END SELECT 
    584          ! 
    585       ENDIF 
    586568      ! 
    587569      IF( nn_timing == 1 )  CALL timing_stop( 'tra_bbl_init') 
  • branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/NEMO/OPA_SRC/USR/usrdef_closea.F90

    r6923 r7200  
    3535   PRIVATE 
    3636 
    37    PUBLIC dom_clo      ! routine called by domain module 
    38    PUBLIC sbc_clo      ! routine called by step module 
    39    PUBLIC clo_rnf      ! routine called by sbcrnf module 
    40    PUBLIC clo_bat      ! routine called in domzgr module 
     37   PUBLIC dom_clo      ! called by domain module 
     38   PUBLIC sbc_clo      ! called by step module 
     39   PUBLIC clo_rnf      ! called by sbcrnf module 
     40   PUBLIC clo_bat      ! called in domzgr module 
    4141 
    4242   INTEGER, PUBLIC, PARAMETER          ::   jpncs   = 4      !: number of closed sea 
     
    7575      !!                                   =2 put at location runoff 
    7676      !!---------------------------------------------------------------------- 
    77       CHARACTER(len=1), INTENT(in   ) ::   cd_cfg   ! configuration name 
     77      CHARACTER(len=*), INTENT(in   ) ::   cd_cfg   ! configuration name 
    7878      INTEGER         , INTENT(in   ) ::   kcfg     ! configuration identifier  
    7979      ! 
     
    177177 
    178178 
    179    SUBROUTINE sbc_clo( kt ) 
     179   SUBROUTINE sbc_clo( kt, cd_cfg, kcfg ) 
    180180      !!--------------------------------------------------------------------- 
    181181      !!                  ***  ROUTINE sbc_clo  *** 
     
    189189      !! ** Action  :   emp updated surface freshwater fluxes and associated heat content at kt 
    190190      !!---------------------------------------------------------------------- 
    191       INTEGER, INTENT(in) ::   kt   ! ocean model time step 
     191      INTEGER         , INTENT(in   ) ::   kt       ! ocean model time step 
     192      CHARACTER(len=*), INTENT(in   ) ::   cd_cfg   ! configuration name 
     193      INTEGER         , INTENT(in   ) ::   kcfg     ! configuration identifier  
    192194      ! 
    193195      INTEGER             ::   ji, jj, jc, jn   ! dummy loop indices 
     
    272274      ENDIF 
    273275 
    274       IF( cp_cfg == "orca" .AND. jp_cfg == 2 ) THEN      ! Black Sea case for ORCA_R2 configuration 
     276      IF( cd_cfg == "orca" .AND. kcfg == 2 ) THEN      ! Black Sea case for ORCA_R2 configuration 
    275277         zze2    = ( zfwf(3) + zfwf(4) ) * 0.5_wp 
    276278         zfwf(3) = zze2 
  • branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/NEMO/OPA_SRC/USR/usrdef_nam.F90

    r6923 r7200  
    3838CONTAINS 
    3939 
    40    SUBROUTINE usr_def_nam( ldtxt, ldnam, kpi, kpj, kpk, kperio ) 
     40   SUBROUTINE usr_def_nam( ldtxt, ldnam, cd_cfg, kk_cfg, kpi, kpj, kpk, kperio ) 
    4141      !!---------------------------------------------------------------------- 
    4242      !!                     ***  ROUTINE dom_nam  *** 
     
    5151      !!---------------------------------------------------------------------- 
    5252      CHARACTER(len=*), DIMENSION(:), INTENT(out) ::   ldtxt, ldnam    ! stored print information 
     53      CHARACTER(len=*)              , INTENT(out) ::   cd_cfg          ! configuration name 
     54      INTEGER                       , INTENT(out) ::   kk_cfg          ! configuration resolution 
    5355      INTEGER                       , INTENT(out) ::   kpi, kpj, kpk   ! global domain sizes  
    5456      INTEGER                       , INTENT(out) ::   kperio          ! lateral global domain b.c.  
     
    6668      ! 
    6769      WRITE( ldnam(:), namusr_def ) 
     70      ! 
     71      cd_cfg = 'GYRE'               ! name & resolution (not used) 
     72      kk_cfg = nn_GYRE 
    6873      ! 
    6974      kpi = 30 * nn_GYRE + 2        ! Global Domain size 
  • branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/NEMO/OPA_SRC/USR/usrdef_zgr.F90

    r7188 r7200  
    112112      !!                   e3t_1d(jpk) = 2 * ( dept_1d(jpk) - depw_1d(jpk) ) 
    113113      !!       The depth are then re-computed from the sum of e3. This ensures  
    114       !!    that depths are identical when reading domain_cfg.nc file. Indeed, 
    115       !!    Only e3. are saved in this file, depth are compute by a call to  
    116       !!    the e3_to_depth subroutine. 
     114      !!    that depths are identical when reading domain configuration file.  
     115      !!    Indeed, only e3. are saved in this file, depth are compute by a call 
     116      !!    to the e3_to_depth subroutine. 
    117117      !! 
    118118      !!       Here the Madec & Imbard (1996) function is used. 
  • branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90

    r7188 r7200  
    4646   !!---------------------------------------------------------------------- 
    4747   USE step_oce       ! module used in the ocean time stepping module (step.F90) 
    48    USE mppini         ! shared/distributed memory setting (mpp_init routine) 
    49    USE domain         ! domain initialization             (dom_init routine) 
    50 #if defined key_nemocice_decomp 
    51    USE ice_domain_size, only: nx_global, ny_global 
    52 #endif 
     48   USE phycst         ! physical constant                  (par_cst routine) 
     49   USE domain         ! domain initialization   (dom_init & dom_cfg routines) 
     50   USE usrdef_nam     ! user defined configuration 
    5351   USE tideini        ! tidal components initialization   (tide_ini routine) 
    5452   USE bdyini         ! open boundary cond. setting       (bdy_init routine) 
     
    6058   USE ldftra         ! lateral diffusivity setting    (ldftra_init routine) 
    6159   USE zdfini         ! vertical physics setting          (zdf_init routine) 
    62    USE phycst         ! physical constant                  (par_cst routine) 
    6360   USE trdini         ! dyn/tra trends initialization     (trd_init routine) 
    6461   USE asminc         ! assimilation increments      
     
    6865   USE diaobs         ! Observation diagnostics       (dia_obs_init routine) 
    6966   USE diacfl         ! CFL diagnostics               (dia_cfl_init routine) 
    70    USE lib_fortran    ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined) 
    7167   USE step           ! NEMO time-stepping                 (stp     routine) 
    7268   USE icbini         ! handle bergs, initialisation 
     
    7874   USE stopar         ! Stochastic param.: ??? 
    7975   USE stopts         ! Stochastic param.: ??? 
     76   USE diurnal_bulk   ! diurnal bulk SST  
     77   USE step_diu       ! diurnal bulk SST timestepping (called from here if run offline) 
     78   USE crsini         ! initialise grid coarsening utility 
     79   USE diatmb         ! Top,middle,bottom output 
     80   USE dia25h         ! 25h mean output 
     81   USE sbc_oce , ONLY : lk_oasis 
     82   USE wet_dry        ! Wetting and drying setting   (wad_init routine) 
    8083#if defined key_top 
    8184   USE trcini         ! passive tracer initialisation 
    8285#endif 
     86#if defined key_nemocice_decomp 
     87   USE ice_domain_size, only: nx_global, ny_global 
     88#endif 
     89   ! 
    8390   USE lib_mpp        ! distributed memory computing 
    84    USE diurnal_bulk   ! diurnal bulk SST  
    85    USE step_diu       ! diurnal bulk SST timestepping (called from here if run offline) 
     91   USE mppini         ! shared/distributed memory setting (mpp_init routine) 
     92   USE lbcnfd , ONLY  : isendto, nsndto, nfsloop, nfeloop   ! Setup of north fold exchanges  
     93   USE lib_fortran    ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined) 
    8694#if defined key_iomput 
    8795   USE xios           ! xIOserver 
    8896#endif 
    89    USE crsini         ! initialise grid coarsening utility 
    90    USE lbcnfd , ONLY  : isendto, nsndto, nfsloop, nfeloop   ! Setup of north fold exchanges  
    91    USE sbc_oce, ONLY  : lk_oasis 
    92    USE diatmb         ! Top,middle,bottom output 
    93    USE dia25h         ! 25h mean output 
    94    USE wet_dry        ! Wetting and drying setting   (wad_init routine) 
    95    USE usrdef_nam     ! user defined configuration 
    9697 
    9798   IMPLICIT NONE 
     
    125126      !!              Madec, 2008, internal report, IPSL. 
    126127      !!---------------------------------------------------------------------- 
    127       INTEGER ::   istp       ! time step index 
     128      INTEGER ::   istp   ! time step index 
    128129      !!---------------------------------------------------------------------- 
    129130      ! 
     
    196197      !                            !==  finalize the run  ==! 
    197198      !                            !------------------------! 
    198       IF(lwp) WRITE(numout,cform_aaa)   ! Flag AAAAAAA 
    199       ! 
    200       IF( nstop /= 0 .AND. lwp ) THEN   ! error print 
     199      IF(lwp) WRITE(numout,cform_aaa)        ! Flag AAAAAAA 
     200      ! 
     201      IF( nstop /= 0 .AND. lwp ) THEN        ! error print 
    201202         WRITE(numout,cform_err) 
    202203         WRITE(numout,*) nstop, ' error have been found' 
     
    216217      ! 
    217218#if defined key_iomput 
    218       CALL xios_finalize                  ! end mpp communications with xios 
    219       IF( lk_oasis )   CALL cpl_finalize  ! end coupling and mpp communications with OASIS 
     219      CALL xios_finalize                     ! end mpp communications with xios 
     220      IF( lk_oasis )   CALL cpl_finalize     ! end coupling and mpp communications with OASIS 
    220221#else 
    221222      IF( lk_oasis ) THEN  
    222          CALL cpl_finalize              ! end coupling and mpp communications with OASIS 
     223         CALL cpl_finalize                   ! end coupling and mpp communications with OASIS 
    223224      ELSE 
    224          IF( lk_mpp )   CALL mppstop    ! end mpp communications 
     225         IF( lk_mpp )   CALL mppstop         ! end mpp communications 
    225226      ENDIF 
    226227#endif 
     
    235236      !! ** Purpose :   initialization of the NEMO GCM 
    236237      !!---------------------------------------------------------------------- 
    237       INTEGER  ::   ji            ! dummy loop indices 
    238       INTEGER  ::   ilocal_comm   ! local integer 
    239       INTEGER  ::   ios, inum     !   -      - 
    240       REAL(wp) ::   ziglo, zjglo, zkglo, zperio   ! local scalars 
     238      INTEGER  ::   ji                 ! dummy loop indices 
     239      INTEGER  ::   ios, ilocal_comm   ! local integer 
    241240      CHARACTER(len=120), DIMENSION(30) ::   cltxt, cltxt2, clnam 
    242241      ! 
     
    244243         &             nn_isplt , nn_jsplt, nn_jctls, nn_jctle,   & 
    245244         &             nn_timing, nn_diacfl 
    246       NAMELIST/namcfg/ ln_read_cfg, ln_write_cfg, cp_cfg, jp_cfg, ln_use_jattr 
     245      NAMELIST/namcfg/ ln_read_cfg, cn_domcfg, ln_write_cfg, cn_domcfg_out, ln_use_jattr 
    247246      !!---------------------------------------------------------------------- 
    248247      ! 
     
    260259901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namctl in reference namelist', .TRUE. ) 
    261260      ! 
    262       REWIND( numnam_cfg )              ! Namelist namctl in confguration namelist : Control prints 
     261      REWIND( numnam_cfg )              ! Namelist namctl in confguration namelist 
    263262      READ  ( numnam_cfg, namctl, IOSTAT = ios, ERR = 902 ) 
    264263902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namctl in configuration namelist', .TRUE. ) 
    265264      ! 
    266       REWIND( numnam_ref )              ! Namelist namcfg in reference namelist 
     265      REWIND( numnam_ref )              ! Namelist namcfg in reference namelist : Control prints 
    267266      READ  ( numnam_ref, namcfg, IOSTAT = ios, ERR = 903 ) 
    268267903   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namcfg in reference namelist', .TRUE. ) 
    269       ! 
    270       REWIND( numnam_cfg )              ! Namelist namcfg in confguration namelist 
     268 
     269      REWIND( numnam_cfg )              ! Namelist namcfg in confguration namelist : Control prints & Benchmark 
    271270      READ  ( numnam_cfg, namcfg, IOSTAT = ios, ERR = 904 ) 
    272271904   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namcfg in configuration namelist', .TRUE. )    
     
    275274      !                             !  Set global domain size  !   (control print return in cltxt2) 
    276275      !                             !--------------------------! 
    277       IF( ln_read_cfg ) THEN              ! Read sizes in configuration "domain_cfg" file 
    278          CALL iom_open( 'domain_cfg', inum ) 
    279          CALL iom_get( inum, 'jpiglo', ziglo  )   ;   jpiglo = INT( ziglo ) 
    280          CALL iom_get( inum, 'jpjglo', zjglo  )   ;   jpjglo = INT( zjglo ) 
    281          CALL iom_get( inum, 'jpkglo', zkglo  )   ;   jpkglo = INT( zkglo ) 
    282          CALL iom_get( inum, 'jperio', zperio )   ;   jperio = INT( zperio ) 
    283          CALL iom_close( inum ) 
    284          WRITE(cltxt2(1),*) ' '       
    285          WRITE(cltxt2(2),*) 'domain_cfg : domain size read in "domain_cfg" file '          
    286          WRITE(cltxt2(3),*) '~~~~~~~~~~    ' 
    287          WRITE(cltxt2(4),*) '   jpiglo = ', jpiglo, ' jpjglo = ', jpjglo,  ' jpkglo = ', jpkglo 
    288          WRITE(cltxt2(5),*) '   global domain type of lateral boundary   jperio = ', jperio 
    289          !         
     276      IF( ln_read_cfg ) THEN              ! Read sizes in domain configuration file 
     277         CALL domain_cfg ( cltxt2, clnam, cn_cfg, nn_cfg, jpiglo, jpjglo, jpkglo, jperio ) 
     278         ! 
    290279      ELSE                                ! user-defined namelist 
    291          CALL usr_def_nam( cltxt2, clnam, jpiglo, jpjglo, jpkglo, jperio ) 
    292       ENDIF 
    293       jpk    = jpkglo 
     280         CALL usr_def_nam( cltxt2, clnam, cn_cfg, nn_cfg, jpiglo, jpjglo, jpkglo, jperio ) 
     281      ENDIF 
     282      ! 
     283      jpk = jpkglo 
    294284      ! 
    295285#if defined key_agrif 
     
    313303      IF( Agrif_Root() ) THEN 
    314304         IF( lk_oasis ) THEN 
    315             CALL cpl_init( "oceanx", ilocal_comm )                     ! nemo local communicator given by oasis 
    316             CALL xios_initialize( "not used",local_comm=ilocal_comm )    ! send nemo communicator to xios 
     305            CALL cpl_init( "oceanx", ilocal_comm )                               ! nemo local communicator given by oasis 
     306            CALL xios_initialize( "not used"       ,local_comm= ilocal_comm )    ! send nemo communicator to xios 
    317307         ELSE 
    318308            CALL xios_initialize( "for_xios_mpi_id",return_comm=ilocal_comm )    ! nemo local communicator given by xios 
     
    324314      IF( lk_oasis ) THEN 
    325315         IF( Agrif_Root() ) THEN 
    326             CALL cpl_init( "oceanx", ilocal_comm )                      ! nemo local communicator given by oasis 
     316            CALL cpl_init( "oceanx", ilocal_comm )          ! nemo local communicator given by oasis 
    327317         ENDIF 
    328318         ! Nodes selection (control print return in cltxt) 
    329319         narea = mynode( cltxt, 'output.namelist.dyn', numnam_ref, numnam_cfg, numond , nstop, ilocal_comm ) 
    330320      ELSE 
    331          ilocal_comm = 0 
    332          ! Nodes selection (control print return in cltxt) 
     321         ilocal_comm = 0                                    ! Nodes selection (control print return in cltxt) 
    333322         narea = mynode( cltxt, 'output.namelist.dyn', numnam_ref, numnam_cfg, numond , nstop ) 
    334323      ENDIF 
     
    340329      lwp = (narea == 1) .OR. ln_ctl                        ! control of all listing output print 
    341330 
    342       IF(lwm) THEN 
    343          ! write merged namelists from earlier to output namelist now that the 
    344          ! file has been opened in call to mynode. nammpp has already been 
    345          ! written in mynode (if lk_mpp_mpi) 
     331      IF(lwm) THEN               ! write merged namelists from earlier to output namelist  
     332         !                       ! now that the file has been opened in call to mynode.  
     333         !                       ! NB: nammpp has already been written in mynode (if lk_mpp_mpi) 
    346334         WRITE( numond, namctl ) 
    347335         WRITE( numond, namcfg ) 
    348336         IF( .NOT.ln_read_cfg ) THEN 
    349337            DO ji = 1, SIZE(clnam) 
    350                IF( TRIM(clnam (ji)) /= '' )   WRITE(numond, * ) clnam(ji)    ! namusr_def print 
     338               IF( TRIM(clnam(ji)) /= '' )   WRITE(numond, * ) clnam(ji)     ! namusr_def print 
    351339            END DO 
    352340         ENDIF 
     
    394382         CALL ctl_opn( numout, 'ocean.output', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, 6, .FALSE., narea ) 
    395383         ! 
    396  
    397  
    398384         WRITE(numout,*) 
    399385         WRITE(numout,*) '   CNRS - NERC - Met OFFICE - MERCATOR-ocean - INGV - CMCC' 
    400386         WRITE(numout,*) '                       NEMO team' 
    401387         WRITE(numout,*) '            Ocean General Circulation Model' 
    402          WRITE(numout,*) '                  version 3.7  (2016) ' 
     388         WRITE(numout,*) '                NEMO version 3.7  (2016) ' 
    403389         WRITE(numout,*) 
    404390         WRITE(numout,*) 
    405391         DO ji = 1, SIZE(cltxt) 
    406             IF( TRIM(cltxt (ji)) /= '' )   WRITE(numout,*) cltxt(ji)      ! control print of mynode 
     392            IF( TRIM(cltxt (ji)) /= '' )   WRITE(numout,*) cltxt(ji)    ! control print of mynode 
    407393         END DO 
    408394         WRITE(numout,*) 
    409395         WRITE(numout,*) 
    410396         DO ji = 1, SIZE(cltxt2) 
    411             IF( cltxt2(ji) /= '' )   WRITE(numout,*) cltxt2(ji)     ! control print of domain size 
     397            IF( TRIM(cltxt2(ji)) /= '' )   WRITE(numout,*) cltxt2(ji)   ! control print of domain size 
    412398         END DO 
    413399         ! 
    414          WRITE(numout,cform_aaa)                                         ! Flag AAAAAAA 
     400         WRITE(numout,cform_aaa)                                        ! Flag AAAAAAA 
    415401         ! 
    416402      ENDIF 
     
    418404      ! Now we know the dimensions of the grid and numout has been set: we can allocate arrays 
    419405      CALL nemo_alloc() 
     406 
    420407      !                             !-------------------------------! 
    421408      !                             !  NEMO general initialization  ! 
     
    534521                            CALL dia_tmb_init  ! TMB outputs 
    535522                            CALL dia_25h_init  ! 25h mean  outputs 
    536  
    537523      ! 
    538524   END SUBROUTINE nemo_init 
     
    577563         WRITE(numout,*) '~~~~~~~ ' 
    578564         WRITE(numout,*) '   Namelist namcfg' 
    579          WRITE(numout,*) '      read configuration definition files          ln_read_cfg = ', ln_read_cfg 
    580          WRITE(numout,*) '      configuration name                               cp_cfg  = ', TRIM(cp_cfg) 
    581          WRITE(numout,*) '      configuration resolution                         jp_cfg  = ', jp_cfg 
    582          WRITE(numout,*) '      use file attribute if exists as i/p j-start ln_use_jattr = ', ln_use_jattr 
     565         WRITE(numout,*) '      read domain configuration file                ln_read_cfg      = ', ln_read_cfg 
     566         WRITE(numout,*) '         filename to be read                           cn_domcfg     = ', TRIM(cn_domcfg) 
     567         WRITE(numout,*) '      write configuration definition file           ln_write_cfg     = ', ln_write_cfg 
     568         WRITE(numout,*) '         filename to be written                        cn_domcfg_out = ', TRIM(cn_domcfg_out) 
     569         WRITE(numout,*) '      use file attribute if exists as i/p j-start   ln_use_jattr     = ', ln_use_jattr 
    583570      ENDIF 
    584571      !                             ! Parameter control 
     
    679666      !!---------------------------------------------------------------------- 
    680667      ! 
    681       ierr =        oce_alloc       ()          ! ocean 
     668      ierr =        oce_alloc       ()          ! ocean  
    682669      ierr = ierr + dia_wri_alloc   () 
    683670      ierr = ierr + dom_oce_alloc   ()          ! ocean domain 
     
    855842                IF ((sxM .gt. sxT) .AND. (sxM .lt. dxT)) THEN 
    856843                   nsndto = nsndto + 1 
    857                      isendto(nsndto) = jn 
     844                   isendto(nsndto) = jn 
    858845                ELSEIF ((sxM .le. sxT) .AND. (dxM .ge. dxT)) THEN 
    859846                   nsndto = nsndto + 1 
    860                      isendto(nsndto) = jn 
     847                   isendto(nsndto) = jn 
    861848                ELSEIF ((dxM .lt. dxT) .AND. (sxT .lt. dxM)) THEN 
    862849                   nsndto = nsndto + 1 
    863                      isendto(nsndto) = jn 
    864                 END IF 
     850                   isendto(nsndto) = jn 
     851                ENDIF 
    865852          END DO 
    866853          nfsloop = 1 
  • branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/NEMO/OPA_SRC/par_oce.F90

    r6717 r7200  
    1616   !!                   namcfg namelist parameters 
    1717   !!---------------------------------------------------------------------- 
    18    LOGICAL       ::   ln_read_cfg      !: (=T) read the domain configuration in 'domain_cfg.nc" file 
     18   LOGICAL       ::   ln_read_cfg      !: (=T) read the domain configuration file or (=F) not 
     19   CHARACTER(lc) ::      cn_domcfg        !: filename the configuration file to be read 
    1920   LOGICAL       ::   ln_write_cfg     !: (=T) create the domain configuration file 
     21   CHARACTER(lc) ::      cn_domcfg_out    !: filename the configuration file to be read 
    2022   ! 
    21    CHARACTER(lc) ::   cp_cfg           !: name of the configuration 
    22    INTEGER       ::   jp_cfg           !: resolution of the configuration  
    2323   LOGICAL       ::   ln_use_jattr     !: input file read offset 
    2424   !                                   !  Use file global attribute: open_ocean_jstart to determine start j-row  
     
    2727   !                                   !  with the extended grids used in the under ice shelf configurations to  
    2828   !                                   !  be used without redundant rows when the ice shelves are not in use. 
     29   !  
    2930 
    3031   !!--------------------------------------------------------------------- 
    3132   !! Domain Matrix size  
    3233   !!--------------------------------------------------------------------- 
     34   ! configuration name & resolution   (required only in ORCA family case) 
     35   CHARACTER(lc) ::   cn_cfg           !: name of the configuration 
     36   INTEGER       ::   nn_cfg           !: resolution of the configuration  
    3337 
    3438   ! global domain size               !!! * total computational domain * 
  • branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/NEMO/SAO_SRC/nemogcm.F90

    r6982 r7200  
    44   !! Ocean system   : NEMO GCM (ocean dynamics, on-line tracers, biochemistry and sea-ice) 
    55   !!====================================================================== 
    6    !! History :  OPA  ! 1990-10  (C. Levy, G. Madec)  Original code 
    7    !!            7.0  ! 1991-11  (M. Imbard, C. Levy, G. Madec) 
    8    !!            7.1  ! 1993-03  (M. Imbard, C. Levy, G. Madec, O. Marti, M. Guyon, A. Lazar, 
    9    !!                             P. Delecluse, C. Perigaud, G. Caniaux, B. Colot, C. Maes) release 7.1 
    10    !!             -   ! 1992-06  (L.Terray)  coupling implementation 
    11    !!             -   ! 1993-11  (M.A. Filiberti) IGLOO sea-ice 
    12    !!            8.0  ! 1996-03  (M. Imbard, C. Levy, G. Madec, O. Marti, M. Guyon, A. Lazar, 
    13    !!                             P. Delecluse, L.Terray, M.A. Filiberti, J. Vialar, A.M. Treguier, M. Levy) release 8.0 
    14    !!            8.1  ! 1997-06  (M. Imbard, G. Madec) 
    15    !!            8.2  ! 1999-11  (M. Imbard, H. Goosse)  LIM sea-ice model 
    16    !!                 ! 1999-12  (V. Thierry, A-M. Treguier, M. Imbard, M-A. Foujols)  OPEN-MP 
    17    !!                 ! 2000-07  (J-M Molines, M. Imbard)  Open Boundary Conditions  (CLIPPER) 
    18    !!   NEMO     1.0  ! 2002-08  (G. Madec)  F90: Free form and modules 
    19    !!             -   ! 2004-06  (R. Redler, NEC CCRLE, Germany) add OASIS[3/4] coupled interfaces 
    20    !!             -   ! 2004-08  (C. Talandier) New trends organization 
    21    !!             -   ! 2005-06  (C. Ethe) Add the 1D configuration possibility 
    22    !!             -   ! 2005-11  (V. Garnier) Surface pressure gradient organization 
    23    !!             -   ! 2006-03  (L. Debreu, C. Mazauric)  Agrif implementation 
    24    !!             -   ! 2006-04  (G. Madec, R. Benshila)  Step reorganization 
    25    !!             -   ! 2007-07  (J. Chanut, A. Sellar) Unstructured open boundaries (BDY) 
    26    !!            3.2  ! 2009-08  (S. Masson)  open/write in the listing file in mpp 
    27    !!            3.3  ! 2010-05  (K. Mogensen, A. Weaver, M. Martin, D. Lea) Assimilation interface 
    28    !!             -   ! 2010-10  (C. Ethe, G. Madec) reorganisation of initialisation phase 
    29    !!            3.3.1! 2011-01  (A. R. Porter, STFC Daresbury) dynamical allocation 
    30    !!            3.4  ! 2011-10  (A. C. Coward, NOCS & J. Donners, PRACE) add nemo_northcomms 
    31    !!             -   ! 2011-11  (C. Harris) decomposition changes for running with CICE 
    32    !!            3.6  ! 2012-05  (C. Calone, J. Simeon, G. Madec, C. Ethe) Add grid coarsening  
    33    !!             -   ! 2013-06  (I. Epicoco, S. Mocavero, CMCC) nemo_northcomms: setup avoiding MPI communication  
    34    !!             -   ! 2014-12  (G. Madec) remove KPP scheme and cross-land advection (cla) 
     6   !! History :  3.6  ! 2015-12  (A. Ryan) Original code   (from OPA_SRC/)  
     7   !!            4.0  ! 2016-11  (G. Madec, S. Flavoni)  domain configuration / user defined interface 
    358   !!---------------------------------------------------------------------- 
    369 
    3710   !!---------------------------------------------------------------------- 
    38    !!   nemo_gcm       : solve ocean dynamics, tracer, biogeochemistry and/or sea-ice 
    39    !!   nemo_init      : initialization of the NEMO system 
    40    !!   nemo_ctl       : initialisation of the contol print 
    41    !!   nemo_closefile : close remaining open files 
    42    !!   nemo_alloc     : dynamical allocation 
    43    !!   nemo_partition : calculate MPP domain decomposition 
    44    !!   factorise      : calculate the factors of the no. of MPI processes 
     11   !!   nemo_gcm      : solve ocean dynamics, tracer, biogeochemistry and/or sea-ice 
     12   !!   nemo_init     : initialization of the NEMO system 
     13   !!   nemo_ctl      : initialisation of the contol print 
     14   !!   nemo_closefile: close remaining open files 
     15   !!   nemo_alloc    : dynamical allocation 
     16   !!   nemo_partition: calculate MPP domain decomposition 
     17   !!   factorise     : calculate the factors of the no. of MPI processes 
    4518   !!---------------------------------------------------------------------- 
    4619   USE step_oce       ! module used in the ocean time stepping module (step.F90) 
    47    USE domcfg         ! domain configuration               (dom_cfg routine) 
    48    USE mppini         ! shared/distributed memory setting (mpp_init routine) 
    49    USE domain         ! domain initialization             (dom_init routine) 
     20   USE domain         ! domain initialization   (dom_init & dom_cfg routines) 
     21   USE istate         ! initial state setting          (istate_init routine) 
     22   USE phycst         ! physical constant                  (par_cst routine) 
     23   USE step           ! NEMO time-stepping                 (stp     routine) 
     24   USE cpl_oasis3     ! OASIS3 coupling 
     25   USE diaobs         ! Observation diagnostics       (dia_obs_init routine) 
    5026#if defined key_nemocice_decomp 
    5127   USE ice_domain_size, only: nx_global, ny_global 
    5228#endif 
    53    USE istate          ! initial state setting          (istate_init routine) 
    54    USE phycst          ! physical constant                  (par_cst routine) 
    55    USE diaobs          ! Observation diagnostics       (dia_obs_init routine) 
    56    USE lib_fortran     ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined) 
    57    USE step            ! NEMO time-stepping                 (stp     routine) 
    58    USE cpl_oasis3      ! OASIS3 coupling 
    59    USE lib_mpp         ! distributed memory computing 
     29   !           ! Stand Alone Observation operator modules 
     30   USE sao_data 
     31   USE sao_intp 
     32   ! 
     33   USE lib_mpp        ! distributed memory computing 
     34   USE mppini         ! shared/distributed memory setting (mpp_init routine) 
     35   USE lbcnfd  , ONLY : isendto, nsndto, nfsloop, nfeloop ! Setup of north fold exchanges  
     36   USE lib_fortran    ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined) 
    6037#if defined key_iomput 
    6138   USE xios           ! xIOserver 
    6239#endif 
    63    USE lbcnfd, ONLY: isendto, nsndto, nfsloop, nfeloop ! Setup of north fold exchanges  
    64  
    65    ! Stand Alone Observation operator modules 
    66    USE sao_data 
    67    USE sao_intp 
    6840 
    6941   IMPLICIT NONE 
     
    9466         !!             3. Cycle through match ups 
    9567         !!             4. Write results to file 
    96          !! 
    9768         !!---------------------------------------------------------------------- 
    98          !! Initialise NEMO 
    99          CALL nemo_init 
    100          !! Initialise Stand Alone Observation operator data 
    101          CALL sao_data_init 
    102          !! Initialise obs_oper 
    103          CALL dia_obs_init 
    104          !! Interpolate to observation space 
    105          CALL sao_interp 
    106          !! Pipe to output files 
    107          CALL dia_obs_wri 
    108          !! Reset the obs_oper between 
    109          CALL dia_obs_dealloc 
    110          !! Safely stop MPI 
    111          IF(lk_mpp) CALL mppstop  ! end mpp communications 
     69         ! 
     70         CALL nemo_init       ! Initialise NEMO 
     71         ! 
     72         CALL sao_data_init   ! Initialise Stand Alone Observation operator data 
     73         ! 
     74         CALL dia_obs_init    ! Initialise obs_operator 
     75         ! 
     76         CALL sao_interp      ! Interpolate to observation space 
     77         ! 
     78         CALL dia_obs_wri     ! Pipe to output files 
     79         ! 
     80         CALL dia_obs_dealloc ! Reset the obs_oper between 
     81         ! 
     82         IF(lk_mpp)   CALL mppstop  ! Safely stop MPI (end mpp communications) 
     83         ! 
    11284   END SUBROUTINE nemo_gcm 
    11385 
     
    11991      !! ** Purpose :   initialization of the NEMO GCM 
    12092      !!---------------------------------------------------------------------- 
    121       INTEGER ::   ji            ! dummy loop indices 
    122       INTEGER ::   ilocal_comm   ! local integer 
    123       INTEGER ::   ios 
    124 !!gm      CHARACTER(len=80), DIMENSION(16) ::   cltxt 
    125       CHARACTER(len=80), DIMENSION(-10:16) ::   cltxt 
    126       ! 
    127       NAMELIST/namctl/ ln_ctl, nn_print, nn_ictls, nn_ictle,   & 
    128          &             nn_isplt, nn_jsplt, nn_jctls, nn_jctle,   & 
     93      INTEGER ::   ji                 ! dummy loop indices 
     94      INTEGER ::   ios, ilocal_comm   ! local integer 
     95      CHARACTER(len=120), DIMENSION(30) ::   cltxt, cltxt2, clnam 
     96      ! 
     97      NAMELIST/namctl/ ln_ctl   , nn_print, nn_ictls, nn_ictle,   & 
     98         &             nn_isplt , nn_jsplt, nn_jctls, nn_jctle,   & 
    12999         &             nn_timing, nn_diacfl 
    130       NAMELIST/namcfg/ ln_read_cfg, ln_write_cfg, cp_cfg, jp_cfg, ln_use_jattr 
    131       !!---------------------------------------------------------------------- 
    132       ! 
    133       cltxt = '' 
     100      NAMELIST/namcfg/ ln_read_cfg, cn_domcfg, ln_write_cfg, cn_domcfg_out, ln_use_jattr 
     101      !!---------------------------------------------------------------------- 
     102      ! 
     103      cltxt  = '' 
     104      cltxt2 = '' 
     105      clnam  = ''   
    134106      cxios_context = 'nemo' 
    135107      ! 
     
    138110      CALL ctl_opn( numnam_cfg, 'namelist_cfg', 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, 6, .FALSE. ) 
    139111      ! 
    140       REWIND( numnam_ref )              ! Namelist namctl in reference namelist : Control prints & Benchmark 
     112      REWIND( numnam_ref )              ! Namelist namctl in reference namelist : Control prints 
    141113      READ  ( numnam_ref, namctl, IOSTAT = ios, ERR = 901 ) 
    142114901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namctl in reference namelist', .TRUE. ) 
    143  
    144       REWIND( numnam_cfg )              ! Namelist namctl in confguration namelist : Control prints & Benchmark 
     115      ! 
     116      REWIND( numnam_cfg )              ! Namelist namctl in confguration namelist 
    145117      READ  ( numnam_cfg, namctl, IOSTAT = ios, ERR = 902 ) 
    146118902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namctl in configuration namelist', .TRUE. ) 
    147  
    148       ! 
    149       REWIND( numnam_ref )              ! Namelist namcfg in reference namelist : Control prints & Benchmark 
     119      ! 
     120      REWIND( numnam_ref )              ! Namelist namcfg in reference namelist : Control prints 
    150121      READ  ( numnam_ref, namcfg, IOSTAT = ios, ERR = 903 ) 
    151122903   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namcfg in reference namelist', .TRUE. ) 
     
    155126904   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namcfg in configuration namelist', .TRUE. )    
    156127 
    157 !!gm      WRITE(clbug(3),*) ' after namelist namcfg read    nstop', nstop 
    158  
    159128      !                             !--------------------------! 
    160129      !                             !  Set global domain size  !   (control print return in cltxt2) 
    161130      !                             !--------------------------! 
    162       IF( ln_read_cfg ) THEN              ! Read sizes in configuration "mesh_mask" file 
    163          CALL iom_open( 'domain_cfg', inum ) 
    164          CALL iom_get( inum, 'jpiglo', ziglo  )   ;   jpiglo = INT( ziglo ) 
    165          CALL iom_get( inum, 'jpjglo', zjglo  )   ;   jpjglo = INT( zjglo ) 
    166          CALL iom_get( inum, 'jpkglo', zkglo  )   ;   jpkglo = INT( zkglo ) 
    167          CALL iom_get( inum, 'jperio', zperio )   ;   jperio = INT( zperio ) 
    168          CALL iom_close( inum ) 
    169          WRITE(cltxt2(1),*)        
    170          WRITE(cltxt2(2),*) 'domain_cfg : domain size read in "domain_cfg" file : jp(i,j,k)glo = ', jpiglo, jpjglo, jpkglo         
    171          WRITE(cltxt2(3),*) '~~~~~~~~~~   lateral boudary type of the global domain      jperio= ', jperio 
    172          !         
     131      IF( ln_read_cfg ) THEN              ! Read sizes in domain configuration file 
     132         CALL domain_cfg ( cltxt2, clnam, cn_cfg, nn_cfg, jpiglo, jpjglo, jpkglo, jperio ) 
     133         ! 
    173134      ELSE                                ! user-defined namelist 
    174          CALL usr_def_nam( cltxt2, clnam, jpiglo, jpjglo, jpkglo, jperio ) 
    175       ENDIF 
    176       jpk    = jpkglo 
     135         CALL usr_def_nam( cltxt2, clnam, cn_cfg, nn_cfg, jpiglo, jpjglo, jpkglo, jperio ) 
     136      ENDIF 
     137      ! 
     138      jpk = jpkglo 
    177139      ! 
    178140#if defined key_agrif 
     
    217179      ENDIF 
    218180#endif 
     181 
    219182      narea = narea + 1                                     ! mynode return the rank of proc (0 --> jpnij -1 ) 
    220183 
     
    230193         IF( .NOT.ln_read_cfg ) THEN 
    231194            DO ji = 1, SIZE(clnam) 
    232                IF( TRIM(clnam (ji)) /= '' )   WRITE(numond, * ) clnam(ji)    ! namusr_def print 
     195               IF( TRIM(clnam(ji)) /= '' )   WRITE(numond, * ) clnam(ji)     ! namusr_def print 
    233196            END DO 
    234197         ENDIF 
     
    239202      IF( jpni < 1 .OR. jpnj < 1 ) THEN 
    240203#if   defined key_mpp_mpi 
    241          IF( Agrif_Root() ) CALL nemo_partition(mppsize) 
     204         IF( Agrif_Root() )   CALL nemo_partition( mppsize ) 
    242205#else 
    243206         jpni  = 1 
     
    247210      ENDIF 
    248211 
    249       ! Calculate domain dimensions given calculated jpni and jpnj 
    250       ! This used to be done in par_oce.F90 when they were parameters rather 
    251       ! than variables 
    252       IF( Agrif_Root() ) THEN 
     212      IF( Agrif_Root() ) THEN       ! AGRIF mother: specific setting from jpni and jpnj 
    253213#if defined key_nemocice_decomp 
    254          jpi = ( nx_global+2-2*jpreci + (jpni-1) ) / jpni + 2*jpreci ! first  dim. 
    255          jpj = ( ny_global+2-2*jprecj + (jpnj-1) ) / jpnj + 2*jprecj ! second dim.  
     214         jpi = ( nx_global+2-2*jpreci + (jpni-1) ) / jpni + 2*jpreci    ! first  dim. 
     215         jpj = ( ny_global+2-2*jprecj + (jpnj-1) ) / jpnj + 2*jprecj    ! second dim.  
    256216#else 
    257          jpi = ( jpiglo-2*jpreci + (jpni-1) ) / jpni + 2*jpreci   ! first  dim. 
    258          jpj = ( jpjglo-2*jprecj + (jpnj-1) ) / jpnj + 2*jprecj   ! second dim. 
     217         jpi = ( jpiglo     -2*jpreci + (jpni-1) ) / jpni + 2*jpreci    ! first  dim. 
     218         jpj = ( jpjglo     -2*jprecj + (jpnj-1) ) / jpnj + 2*jprecj    ! second dim. 
    259219#endif 
    260220      ENDIF 
     
    272232         CALL ctl_opn( numout, 'ocean.output', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, 6, .FALSE., narea ) 
    273233         ! 
    274  
    275          DO ji = 1, SIZE(clbug) 
    276             IF( TRIM(clbug (ji)) /= '' )   WRITE(numout,*) clbug(ji)      ! bug print  
    277          END DO 
    278          WRITE(numout,*) 
    279  
    280  
    281  
    282  
    283234         WRITE(numout,*) 
    284235         WRITE(numout,*) '   CNRS - NERC - Met OFFICE - MERCATOR-ocean - INGV - CMCC' 
    285236         WRITE(numout,*) '                       NEMO team' 
    286237         WRITE(numout,*) '            Stand Alone Observation operator' 
    287          WRITE(numout,*) '                  version 1.0  (2015) ' 
     238         WRITE(numout,*) '                NEMO version 3.7  (2015) ' 
    288239         WRITE(numout,*) 
    289240         WRITE(numout,*) 
    290241         DO ji = 1, SIZE(cltxt) 
    291             IF( TRIM(cltxt(ji)) /= '' )   WRITE(numout,*) cltxt(ji)      ! control print of mynode 
     242            IF( TRIM(cltxt (ji)) /= '' )   WRITE(numout,*) cltxt(ji)    ! control print of mynode 
    292243         END DO 
    293          WRITE(numout,cform_aaa)                                         ! Flag AAAAAAA 
    294          ! 
    295       ENDIF 
    296  
    297       ! Now we know the dimensions of the grid and numout has been set we can 
    298       ! allocate arrays 
     244         WRITE(numout,*) 
     245         WRITE(numout,*) 
     246         DO ji = 1, SIZE(cltxt2) 
     247            IF( TRIM(cltxt2(ji)) /= '' )   WRITE(numout,*) cltxt2(ji)   ! control print of domain size 
     248         END DO 
     249         ! 
     250         WRITE(numout,cform_aaa)                                        ! Flag AAAAAAA 
     251         ! 
     252      ENDIF 
     253 
     254      ! Now we know the dimensions of the grid and numout has been set: we can allocate arrays 
    299255      CALL nemo_alloc() 
    300256 
     
    315271                            CALL     phy_cst    ! Physical constants 
    316272                            CALL     eos_init   ! Equation of state 
    317                             CALL     dom_cfg    ! Domain configuration 
    318273                            CALL     dom_init   ! Domain 
    319274 
     
    337292      IF(lwp) THEN                  ! control print 
    338293         WRITE(numout,*) 
    339          WRITE(numout,*) 'nemo_ctl: Control prints & Benchmark' 
     294         WRITE(numout,*) 'nemo_ctl: Control prints' 
    340295         WRITE(numout,*) '~~~~~~~ ' 
    341296         WRITE(numout,*) '   Namelist namctl' 
     
    364319         WRITE(numout,*) '~~~~~~~ ' 
    365320         WRITE(numout,*) '   Namelist namcfg' 
    366          WRITE(numout,*) '      read configuration definition files          ln_read_cfg = ', ln_read_cfg 
    367          WRITE(numout,*) '      configuration name                               cp_cfg  = ', TRIM(cp_cfg) 
    368          WRITE(numout,*) '      configuration resolution                         jp_cfg  = ', jp_cfg 
    369          WRITE(numout,*) '      use file attribute if exists as i/p j-start ln_use_jattr = ', ln_use_jattr 
     321         WRITE(numout,*) '      read domain configuration file                ln_read_cfg      = ', ln_read_cfg 
     322         WRITE(numout,*) '         filename to be read                           cn_domcfg     = ', TRIM(cn_domcfg) 
     323         WRITE(numout,*) '      write configuration definition file           ln_write_cfg     = ', ln_write_cfg 
     324         WRITE(numout,*) '         filename to be written                        cn_domcfg_out = ', TRIM(cn_domcfg_out) 
     325         WRITE(numout,*) '      use file attribute if exists as i/p j-start   ln_use_jattr     = ', ln_use_jattr 
    370326      ENDIF 
    371327      !                             ! Parameter control 
     
    439395      IF( numdct_heat     /= -1 )   CLOSE( numdct_heat     )   ! heat transports 
    440396      IF( numdct_salt     /= -1 )   CLOSE( numdct_salt     )   ! salt transports 
    441  
    442397      ! 
    443398      numout = 6                                     ! redefine numout in case it is used after this point... 
     
    478433      !! ** Method  : 
    479434      !!---------------------------------------------------------------------- 
    480       INTEGER, INTENT(in) :: num_pes ! The number of MPI processes we have 
     435      INTEGER, INTENT(in) ::   num_pes  ! The number of MPI processes we have 
    481436      ! 
    482437      INTEGER, PARAMETER :: nfactmax = 20 
     
    532487      INTEGER :: ifac, jl, inu 
    533488      INTEGER, PARAMETER :: ntest = 14 
    534       INTEGER :: ilfax(ntest) 
     489      INTEGER, DIMENSION(ntest) ::   ilfax 
     490      !!---------------------------------------------------------------------- 
    535491      ! 
    536492      ! lfax contains the set of allowed factors. 
    537       data (ilfax(jl),jl=1,ntest) / 16384, 8192, 4096, 2048, 1024, 512, 256,  & 
    538          &                            128,   64,   32,   16,    8,   4,   2  / 
    539       !!---------------------------------------------------------------------- 
    540  
     493      ilfax(:) = (/(2**jl,jl=ntest,1,-1)/) 
     494      ! 
    541495      ! Clear the error flag and initialise output vars 
    542       kerr = 0 
    543       kfax = 1 
     496      kerr  = 0 
     497      kfax  = 1 
    544498      knfax = 0 
    545  
     499      ! 
    546500      ! Find the factors of n. 
    547501      IF( kn == 1 )   GOTO 20 
     
    551505      ! l points to the allowed factor list. 
    552506      ! ifac holds the current factor. 
    553  
     507      ! 
    554508      inu   = kn 
    555509      knfax = 0 
    556  
     510      ! 
    557511      DO jl = ntest, 1, -1 
    558512         ! 
     
    578532         ! 
    579533      END DO 
    580  
     534      ! 
    581535   20 CONTINUE      ! Label 20 is the exit point from the factor search loop. 
    582536      ! 
     
    586540 
    587541   SUBROUTINE nemo_northcomms 
    588       !!====================================================================== 
     542      !!---------------------------------------------------------------------- 
    589543      !!                     ***  ROUTINE  nemo_northcomms  *** 
    590       !! nemo_northcomms    :  Setup for north fold exchanges with explicit  
    591       !!                       point-to-point messaging 
    592       !!===================================================================== 
    593       !!---------------------------------------------------------------------- 
    594       !! 
    595       !! ** Purpose :   Initialization of the northern neighbours lists. 
     544      !! ** Purpose :   Setup for north fold exchanges with explicit  
     545      !!                point-to-point messaging 
     546      !! 
     547      !! ** Method :   Initialization of the northern neighbours lists. 
    596548      !!---------------------------------------------------------------------- 
    597549      !!    1.0  ! 2011-10  (A. C. Coward, NOCS & J. Donners, PRACE) 
    598550      !!    2.0  ! 2013-06 Setup avoiding MPI communication (I. Epicoco, S. Mocavero, CMCC)  
    599551      !!---------------------------------------------------------------------- 
    600  
    601552      INTEGER  ::   sxM, dxM, sxT, dxT, jn 
    602553      INTEGER  ::   njmppmax 
    603  
     554      !!---------------------------------------------------------------------- 
     555      ! 
    604556      njmppmax = MAXVAL( njmppt ) 
    605      
     557      ! 
    606558      !initializes the north-fold communication variables 
    607559      isendto(:) = 0 
    608       nsndto = 0 
    609  
     560      nsndto     = 0 
     561      ! 
    610562      !if I am a process in the north 
    611563      IF ( njmpp == njmppmax ) THEN 
     
    629581                IF ((sxM .gt. sxT) .AND. (sxM .lt. dxT)) THEN 
    630582                   nsndto = nsndto + 1 
    631                      isendto(nsndto) = jn 
     583                   isendto(nsndto) = jn 
    632584                ELSEIF ((sxM .le. sxT) .AND. (dxM .ge. dxT)) THEN 
    633585                   nsndto = nsndto + 1 
    634                      isendto(nsndto) = jn 
     586                   isendto(nsndto) = jn 
    635587                ELSEIF ((dxM .lt. dxT) .AND. (sxT .lt. dxM)) THEN 
    636588                   nsndto = nsndto + 1 
    637                      isendto(nsndto) = jn 
    638                 END IF 
     589                   isendto(nsndto) = jn 
     590                ENDIF 
    639591          END DO 
    640592          nfsloop = 1 
     
    654606      l_north_nogather = .TRUE. 
    655607   END SUBROUTINE nemo_northcomms 
     608 
    656609#else 
    657610   SUBROUTINE nemo_northcomms      ! Dummy routine 
     
    663616END MODULE nemogcm 
    664617 
    665  
  • branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/NEMO/SAO_SRC/sao_data.F90

    r5063 r7200  
    11MODULE sao_data 
    2    !! ================================================================= 
    3    !!                    *** MODULE sao_data *** 
    4    !! ================================================================= 
     2   !!====================================================================== 
     3   !!                       ***  MODULE sao_data  *** 
     4   !!====================================================================== 
     5   !! History :  3.6  ! 2015-12  (A. Ryan)  Original code 
     6   !!---------------------------------------------------------------------- 
    57   USE par_kind, ONLY: lc 
    68   USE lib_mpp         ! distributed memory computing 
     9   USE in_out_manager 
    710 
    811   IMPLICIT NONE 
    9  
    10    !! Public data 
    1112 
    1213   INTEGER, PARAMETER :: MaxNumFiles = 1000 
    1314 
    1415   !! Stand Alone Observation operator settings 
    15    CHARACTER(len=lc) :: & 
    16       & sao_files(MaxNumFiles)         !: model files 
    17    INTEGER            :: & 
    18       & n_files, &                     !: number of files 
    19       & nn_sao_idx(MaxNumFiles), &     !: time_counter indices 
    20       & nn_sao_freq                    !: read frequency in time steps 
     16   CHARACTER(len=lc) ::   sao_files(MaxNumFiles)   !: model files 
     17   INTEGER           ::   n_files                  !: number of files 
     18   INTEGER           :: nn_sao_idx(MaxNumFiles)    !: time_counter indices 
     19   INTEGER           :: nn_sao_freq                !: read frequency in time steps 
     20    
     21   !!---------------------------------------------------------------------- 
     22   !! NEMO/OPA 3.7 , NEMO Consortium (2015) 
     23   !! $Id: trazdf_imp.F90 6140 2015-12-21 11:35:23Z timgraham $ 
     24   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt) 
     25   !!---------------------------------------------------------------------- 
    2126CONTAINS 
     27 
    2228   SUBROUTINE sao_data_init() 
    2329      !!---------------------------------------------------------------------- 
     
    2733      !! 
    2834      !!---------------------------------------------------------------------- 
    29       USE in_out_manager 
    30       INTEGER            :: & 
    31          & jf                           !: file dummy loop index 
    32       LOGICAL :: lmask(MaxNumFiles)     !: Logical mask used for counting 
    33       INTEGER :: ios 
    34  
    35       ! Standard offline obs_oper information 
     35      INTEGER ::   jf                   ! file dummy loop index 
     36      LOGICAL ::   lmask(MaxNumFiles)   ! Logical mask used for counting 
     37      INTEGER ::   ios 
     38      !! 
    3639      NAMELIST/namsao/sao_files, nn_sao_idx, nn_sao_freq 
     40      !!---------------------------------------------------------------------- 
    3741 
    3842      ! Standard offline obs_oper initialisation 
    39       n_files = 0                   !: number of files to cycle through 
    40       sao_files(:) = ''             !: list of files to read in 
    41       nn_sao_idx(:) = 0             !: list of indices inside each file 
    42       nn_sao_freq = -1              !: input frequency in time steps 
     43      n_files = 0                   ! number of files to cycle through 
     44      sao_files(:) = ''             ! list of files to read in 
     45      nn_sao_idx(:) = 0             ! list of indices inside each file 
     46      nn_sao_freq = -1              ! input frequency in time steps 
    4347 
    4448      ! Standard offline obs_oper settings 
     
    4650      READ  ( numnam_ref, namsao, IOSTAT = ios, ERR = 901 ) 
    4751901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namsao in reference namelist', .TRUE. ) 
    48  
     52      ! 
    4953      REWIND( numnam_cfg )              ! Namelist namctl in confguration namelist : Control prints & Benchmark 
    5054      READ  ( numnam_cfg, namsao, IOSTAT = ios, ERR = 902 ) 
    5155902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namsao in configuration namelist', .TRUE. ) 
    52  
    53  
    54       ! count input files 
    55       lmask(:) = .FALSE. 
     56      
     57      lmask(:) = .FALSE.               ! count input files 
    5658      WHERE (sao_files(:) /= '') lmask(:) = .TRUE. 
    5759      n_files = COUNT(lmask) 
    58  
    59       !! Initialise sub obs window frequency 
    60       IF (nn_sao_freq == -1) THEN 
    61          !! Run length 
    62          nn_sao_freq = nitend - nit000 + 1 
     60      ! 
     61      IF(nn_sao_freq == -1) THEN      ! Initialise sub obs window frequency 
     62         nn_sao_freq = nitend - nit000 + 1      ! Run length 
    6363      ENDIF 
    64  
    65       !! Print summary of settings 
    66       IF(lwp) THEN 
     64      ! 
     65      IF(lwp) THEN                     ! Print summary of settings 
    6766         WRITE(numout,*) 
    6867         WRITE(numout,*) 'offline obs_oper : Initialization' 
     
    7069         WRITE(numout,*) '   Namelist namsao : set stand alone obs_oper parameters' 
    7170         DO jf = 1, n_files 
    72             WRITE(numout,'(1X,2A)') '   Input forecast file name          forecastfile = ', & 
    73                TRIM(sao_files(jf)) 
    74             WRITE(numout,*) '   Input forecast file index        forecastindex = ', & 
    75                nn_sao_idx(jf) 
     71            WRITE(numout,'(1X,2A)') '   Input forecast file name          forecastfile = ', TRIM(sao_files(jf)) 
     72            WRITE(numout,*) '   Input forecast file index        forecastindex = ', nn_sao_idx(jf) 
    7673         END DO 
    7774      END IF 
    78  
     75      ! 
    7976   END SUBROUTINE sao_data_init 
    8077 
     78   !!====================================================================== 
    8179END MODULE sao_data 
    8280 
  • branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/NEMO/SAO_SRC/sao_intp.F90

    r5063 r7200  
    44   !! ** Purpose : Run NEMO observation operator in offline mode 
    55   !!====================================================================== 
    6    !! NEMO modules 
     6   !! History :  3.6  ! 2015-12  (A. Ryan)  Original code 
     7   !!---------------------------------------------------------------------- 
     8   !        ! NEMO modules 
    79   USE in_out_manager 
    810   USE diaobs 
    9    !! Stand Alone Observation operator modules 
     11   !        ! Stand Alone Observation operator modules 
    1012   USE sao_read 
    1113   USE sao_data 
     
    1618   PUBLIC sao_interp 
    1719 
    18    CONTAINS 
     20   !!---------------------------------------------------------------------- 
     21   !! NEMO/OPA 3.7 , NEMO Consortium (2015) 
     22   !! $Id: trazdf_imp.F90 6140 2015-12-21 11:35:23Z timgraham $ 
     23   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt) 
     24   !!---------------------------------------------------------------------- 
     25CONTAINS 
    1926 
    20       SUBROUTINE sao_interp 
    21          !!---------------------------------------------------------------------- 
    22          !!                    ***  SUBROUTINE sao_interp *** 
    23          !! 
    24          !! ** Purpose : To interpolate the model as if it were running online. 
    25          !! 
    26          !! ** Method : 1. Populate model counterparts 
    27          !!             2. Call dia_obs at appropriate time steps 
    28          !!---------------------------------------------------------------------- 
    29          INTEGER :: & 
    30             & istp, & ! time step index 
    31             & ifile   ! file index 
    32          istp = nit000 - 1 
    33          nstop = 0 
    34          ifile = 1 
    35          CALL sao_rea_dri(ifile) 
    36          DO WHILE ( istp <= nitend .AND. nstop == 0 ) 
    37             IF (ifile <= n_files + 1) THEN 
    38                IF ( MOD(istp, nn_sao_freq) == nit000 ) THEN 
    39                   CALL sao_rea_dri(ifile) 
    40                   ifile = ifile + 1 
    41                ENDIF 
    42                CALL dia_obs(istp) 
     27   SUBROUTINE sao_interp 
     28      !!---------------------------------------------------------------------- 
     29      !!                    ***  SUBROUTINE sao_interp *** 
     30      !! 
     31      !! ** Purpose : To interpolate the model as if it were running online. 
     32      !! 
     33      !! ** Method : 1. Populate model counterparts 
     34      !!             2. Call dia_obs at appropriate time steps 
     35      !!---------------------------------------------------------------------- 
     36      INTEGER ::   istp    ! time step index 
     37      INTEGER ::   ifile   ! file index 
     38      !!---------------------------------------------------------------------- 
     39      istp = nit000 - 1 
     40      nstop = 0 
     41      ifile = 1 
     42      CALL sao_rea_dri(ifile) 
     43      ! 
     44      DO WHILE ( istp <= nitend .AND. nstop == 0 ) 
     45         IF (ifile <= n_files + 1) THEN 
     46            IF ( MOD(istp, nn_sao_freq) == nit000 ) THEN 
     47               CALL sao_rea_dri(ifile) 
     48               ifile = ifile + 1 
    4349            ENDIF 
    44             istp = istp + 1 
    45          END DO 
    46       END SUBROUTINE sao_interp 
     50            CALL dia_obs(istp) 
     51         ENDIF 
     52         istp = istp + 1 
     53      END DO 
     54      ! 
     55   END SUBROUTINE sao_interp 
    4756 
     57   !!====================================================================== 
    4858END MODULE sao_intp 
  • branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/NEMO/SAO_SRC/sao_read.F90

    r5063 r7200  
    11MODULE sao_read 
    2    !!================================================================== 
    3    !!                    *** MODULE sao_read *** 
     2   !!====================================================================== 
     3   !!                      ***  MODULE sao_read *** 
    44   !! Read routines : I/O for Stand Alone Observation operator 
    5    !!================================================================== 
     5   !!====================================================================== 
    66   USE mppini 
    77   USE lib_mpp 
     
    1212   USE dom_oce, ONLY: nlci, nlcj, nimpp, njmpp, tmask 
    1313   USE par_oce, ONLY: jpi, jpj, jpk 
     14   ! 
    1415   USE obs_fbm, ONLY: fbimdi, fbrmdi, fbsp, fbdp 
    1516   USE sao_data 
     
    2021   PUBLIC sao_rea_dri 
    2122 
     23   !!---------------------------------------------------------------------- 
     24   !! NEMO/OPA 3.7 , NEMO Consortium (2015) 
     25   !! $Id: trazdf_imp.F90 6140 2015-12-21 11:35:23Z timgraham $ 
     26   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt) 
     27   !!---------------------------------------------------------------------- 
    2228CONTAINS 
    23    SUBROUTINE sao_rea_dri(kfile) 
     29 
     30   SUBROUTINE sao_rea_dri( kfile ) 
    2431      !!------------------------------------------------------------------------ 
    2532      !!             *** sao_rea_dri *** 
     
    3138      !! 
    3239      !!------------------------------------------------------------------------ 
    33       INTEGER, INTENT(IN) :: & 
    34               & kfile         !: File number 
    35       CHARACTER(len=lc) :: & 
    36               & cdfilename    !: File name 
    37       INTEGER :: & 
    38               & kindex        !: File index to read 
    39  
    40       cdfilename = TRIM(sao_files(kfile)) 
     40      INTEGER, INTENT(in) ::   kfile         ! File number 
     41      ! 
     42      CHARACTER(len=lc)   ::   cdfilename    ! File name 
     43      INTEGER ::   kindex        ! File index to read 
     44      !!------------------------------------------------------------------------ 
     45      ! 
     46      cdfilename = TRIM( sao_files(kfile) ) 
    4147      kindex = nn_sao_idx(kfile) 
    42       CALL sao_read_file(TRIM(cdfilename), kindex) 
    43  
     48      CALL sao_read_file( TRIM( cdfilename ), kindex ) 
     49      ! 
    4450   END SUBROUTINE sao_rea_dri 
    4551 
    46    SUBROUTINE sao_read_file(filename, ifcst) 
     52 
     53   SUBROUTINE sao_read_file( filename, ifcst ) 
    4754      !!------------------------------------------------------------------------ 
    48       !!             *** sao_read_file *** 
     55      !!                         ***  sao_read_file *** 
    4956      !! 
    5057      !! Purpose : To fill tn and sn with dailymean field from netcdf files 
     
    5461      !! Author  : A. Ryan Oct 2010 
    5562      !!------------------------------------------------------------------------ 
    56  
    57       INTEGER,          INTENT(IN) :: ifcst 
    58       CHARACTER(len=*), INTENT(IN) :: filename 
    59       INTEGER                      :: ncid, & 
    60                                     & varid,& 
    61                                     & istat,& 
    62                                     & ntimes,& 
    63                                     & tdim, & 
    64                                     & xdim, & 
    65                                     & ydim, & 
    66                                     & zdim 
    67       INTEGER                      :: ii, ij, ik 
    68       INTEGER, DIMENSION(4)        :: start_n, & 
    69                                     & count_n 
    70       INTEGER, DIMENSION(3)        :: start_s, & 
    71                                     & count_s 
    72       REAL(fbdp), DIMENSION(:,:,:),ALLOCATABLE :: temp_tn, & 
    73                                               & temp_sn 
    74       REAL(fbdp), DIMENSION(:,:),  ALLOCATABLE :: temp_sshn 
    75       REAL(fbdp)                     :: fill_val 
     63      INTEGER,          INTENT(in) ::   ifcst 
     64      CHARACTER(len=*), INTENT(in) ::   filename 
     65      INTEGER                      ::   ncid, varid, istat, ntimes 
     66      INTEGER                      ::   tdim, xdim, ydim, zdim 
     67      INTEGER                      ::   ii, ij, ik 
     68      INTEGER, DIMENSION(4)        ::   start_n, count_n 
     69      INTEGER, DIMENSION(3)        ::   start_s, count_s 
     70      REAL(fbdp)                   ::   fill_val 
     71      REAL(fbdp), DIMENSION(:,:,:), ALLOCATABLE ::   temp_tn, temp_sn 
     72      REAL(fbdp), DIMENSION(:,:)  , ALLOCATABLE ::   temp_sshn 
    7673 
    7774      ! DEBUG 
    78       INTEGER :: istage 
     75      INTEGER ::   istage 
     76      !!------------------------------------------------------------------------ 
    7977 
    8078      IF (TRIM(filename) == 'nofile') THEN 
    81          tsn(:,:,:,:) = fbrmdi 
    82          sshn(:,:) = fbrmdi 
     79         tsn (:,:,:,:) = fbrmdi 
     80         sshn(:,:)     = fbrmdi 
    8381      ELSE 
    8482         WRITE(numout,*) "Opening :", TRIM(filename) 
     
    169167         istat = nf90_close(ncid) 
    170168      END IF 
     169      ! 
    171170   END SUBROUTINE sao_read_file 
     171    
     172   !!------------------------------------------------------------------------ 
    172173END MODULE sao_read 
  • branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/NEMO/SAS_SRC/nemogcm.F90

    r6982 r7200  
    22   !!====================================================================== 
    33   !!                       ***  MODULE nemogcm   *** 
    4    !! Ocean system   : NEMO GCM (ocean dynamics, on-line tracers, biochemistry and sea-ice) 
     4   !! StandAlone Surface module : surface fluxes + sea-ice + iceberg floats 
    55   !!====================================================================== 
    6    !! History :  OPA  ! 1990-10  (C. Levy, G. Madec)  Original code 
    7    !!            7.0  ! 1991-11  (M. Imbard, C. Levy, G. Madec) 
    8    !!            7.1  ! 1993-03  (M. Imbard, C. Levy, G. Madec, O. Marti, M. Guyon, A. Lazar, 
    9    !!                             P. Delecluse, C. Perigaud, G. Caniaux, B. Colot, C. Maes) release 7.1 
    10    !!             -   ! 1992-06  (L.Terray)  coupling implementation 
    11    !!             -   ! 1993-11  (M.A. Filiberti) IGLOO sea-ice 
    12    !!            8.0  ! 1996-03  (M. Imbard, C. Levy, G. Madec, O. Marti, M. Guyon, A. Lazar, 
    13    !!                             P. Delecluse, L.Terray, M.A. Filiberti, J. Vialar, A.M. Treguier, M. Levy) release 8.0 
    14    !!            8.1  ! 1997-06  (M. Imbard, G. Madec) 
    15    !!            8.2  ! 1999-11  (M. Imbard, H. Goosse)  LIM sea-ice model 
    16    !!                 ! 1999-12  (V. Thierry, A-M. Treguier, M. Imbard, M-A. Foujols)  OPEN-MP 
    17    !!                 ! 2000-07  (J-M Molines, M. Imbard)  Open Boundary Conditions  (CLIPPER) 
    18    !!   NEMO     1.0  ! 2002-08  (G. Madec)  F90: Free form and modules 
    19    !!             -   ! 2004-06  (R. Redler, NEC CCRLE, Germany) add OASIS[3/4] coupled interfaces 
    20    !!             -   ! 2004-08  (C. Talandier) New trends organization 
    21    !!             -   ! 2005-06  (C. Ethe) Add the 1D configuration possibility 
    22    !!             -   ! 2005-11  (V. Garnier) Surface pressure gradient organization 
    23    !!             -   ! 2006-03  (L. Debreu, C. Mazauric)  Agrif implementation 
    24    !!             -   ! 2006-04  (G. Madec, R. Benshila)  Step reorganization 
    25    !!             -   ! 2007-07  (J. Chanut, A. Sellar) Unstructured open boundaries (BDY) 
    26    !!            3.2  ! 2009-08  (S. Masson)  open/write in the listing file in mpp 
    27    !!            3.3  ! 2010-05  (K. Mogensen, A. Weaver, M. Martin, D. Lea) Assimilation interface 
    28    !!             -   ! 2010-10  (C. Ethe, G. Madec) reorganisation of initialisation phase 
    29    !!            3.3.1! 2011-01  (A. R. Porter, STFC Daresbury) dynamical allocation 
    30    !!            3.4  ! 2011-10  (A. C. Coward, NOCS & J. Donners, PRACE) add nemo_northcomms 
    31    !!             -   ! 2011-11  (C. Harris) decomposition changes for running with CICE 
    32    !!            3.6  ! 2012-05  (C. Calone, J. Simeon, G. Madec, C. Ethe) Add grid coarsening  
     6   !! History :  3.6  ! 2011-11  (S. Alderson, G. Madec) original code 
    337   !!             -   ! 2013-06  (I. Epicoco, S. Mocavero, CMCC) nemo_northcomms: setup avoiding MPI communication  
    348   !!             -   ! 2014-12  (G. Madec) remove KPP scheme and cross-land advection (cla) 
     9   !!            4.0  ! 2016-10  (G. Madec, S. Flavoni)  domain configuration / user defined interface 
    3510   !!---------------------------------------------------------------------- 
    3611 
    3712   !!---------------------------------------------------------------------- 
    38    !!   nemo_gcm       : solve ocean dynamics, tracer, biogeochemistry and/or sea-ice 
    39    !!   nemo_init      : initialization of the NEMO system 
    40    !!   nemo_ctl       : initialisation of the contol print  
    41    !!   nemo_closefile : close remaining open files 
    42    !!   nemo_alloc     : dynamical allocation 
    43    !!   nemo_partition : calculate MPP domain decomposition 
    44    !!   factorise      : calculate the factors of the no. of MPI processes 
     13   !!   nemo_gcm      : solve ocean dynamics, tracer, biogeochemistry and/or sea-ice 
     14   !!   nemo_init     : initialization of the NEMO system 
     15   !!   nemo_ctl      : initialisation of the contol print 
     16   !!   nemo_closefile: close remaining open files 
     17   !!   nemo_alloc    : dynamical allocation 
     18   !!   nemo_partition: calculate MPP domain decomposition 
     19   !!   factorise     : calculate the factors of the no. of MPI processes 
    4520   !!---------------------------------------------------------------------- 
    46    USE step_oce        ! module used in the ocean time stepping module 
    47    USE sbc_oce         ! surface boundary condition: ocean 
    48    USE domcfg          ! domain configuration               (dom_cfg routine) 
    49    USE daymod          ! calendar 
    50    USE mppini          ! shared/distributed memory setting (mpp_init routine) 
    51    USE domain          ! domain initialization             (dom_init routine) 
    52    USE phycst          ! physical constant                  (par_cst routine) 
    53    USE step            ! NEMO time-stepping                 (stp     routine) 
    54    USE lib_mpp         ! distributed memory computing 
    55 #if defined key_nosignedzero 
    56    USE lib_fortran     ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined) 
    57 #endif 
     21   USE step_oce       ! module used in the ocean time stepping module 
     22   USE sbc_oce        ! surface boundary condition: ocean 
     23   USE phycst         ! physical constant                  (par_cst routine) 
     24   USE domain         ! domain initialization   (dom_init & dom_cfg routines) 
     25   USE usrdef_nam     ! user defined configuration 
     26   USE daymod         ! calendar 
     27   USE step           ! NEMO time-stepping                 (stp     routine) 
     28   USE cpl_oasis3     ! 
     29   USE sbcssm         ! 
     30   USE icbstp         ! handle bergs, calving, themodynamics and transport 
     31#if defined key_bdy 
     32   USE bdyini         ! open boundary cond. setting       (bdy_init routine). clem: mandatory for LIM3 
     33   USE bdydta         ! open boundary cond. setting   (bdy_dta_init routine). clem: mandatory for LIM3 
     34#endif 
     35   USE bdy_par 
     36   ! 
     37   USE lib_mpp        ! distributed memory computing 
     38   USE mppini         ! shared/distributed memory setting (mpp_init routine) 
     39   USE lbcnfd   , ONLY: isendto, nsndto, nfsloop, nfeloop ! Setup of north fold exchanges 
     40   USE lib_fortran    ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined) 
    5841#if defined key_iomput 
    59    USE xios 
    60 #endif 
    61    USE cpl_oasis3 
    62    USE sbcssm 
    63    USE lbcnfd, ONLY: isendto, nsndto, nfsloop, nfeloop ! Setup of north fold exchanges 
    64    USE icbstp          ! handle bergs, calving, themodynamics and transport 
    65 #if defined key_bdy 
    66    USE bdyini          ! open boundary cond. setting       (bdy_init routine). clem: mandatory for LIM3 
    67    USE bdydta          ! open boundary cond. setting   (bdy_dta_init routine). clem: mandatory for LIM3 
    68 #endif 
    69    USE bdy_par 
    70    USE usrdef_nam     ! user defined configuration 
     42   USE xios           ! xIOserver 
     43#endif 
    7144 
    7245   IMPLICIT NONE 
     
    9972      !!              Madec, 2008, internal report, IPSL. 
    10073      !!---------------------------------------------------------------------- 
    101       INTEGER ::   istp       ! time step index 
     74      INTEGER ::   istp   ! time step index 
    10275      !!---------------------------------------------------------------------- 
    10376      ! 
     
    10578      CALL Agrif_Init_Grids()      ! AGRIF: set the meshes 
    10679#endif 
    107  
     80      ! 
    10881      !                            !-----------------------! 
    10982      CALL nemo_init               !==  Initialisations  ==! 
     
    152125      !                            !==  finalize the run  ==! 
    153126      !                            !------------------------! 
    154       IF(lwp) WRITE(numout,cform_aaa)   ! Flag AAAAAAA 
    155       ! 
    156       IF( nstop /= 0 .AND. lwp ) THEN   ! error print 
     127      IF(lwp) WRITE(numout,cform_aaa)        ! Flag AAAAAAA 
     128      ! 
     129      IF( nstop /= 0 .AND. lwp ) THEN        ! error print 
    157130         WRITE(numout,cform_err) 
    158          WRITE(numout,*) nstop, ' error have been found'  
     131         WRITE(numout,*) nstop, ' error have been found' 
    159132      ENDIF 
    160133      ! 
     
    169142      ! 
    170143#if defined key_iomput 
    171       CALL xios_finalize                  ! end mpp communications with xios 
    172       IF( lk_oasis )   CALL cpl_finalize  ! end coupling and mpp communications with OASIS 
     144      CALL xios_finalize                     ! end mpp communications with xios 
     145      IF( lk_oasis )   CALL cpl_finalize     ! end coupling and mpp communications with OASIS 
    173146#else 
    174147      IF( lk_oasis ) THEN  
    175          CALL cpl_finalize              ! end coupling and mpp communications with OASIS 
     148         CALL cpl_finalize                   ! end coupling and mpp communications with OASIS 
    176149      ELSE 
    177          IF( lk_mpp )   CALL mppstop    ! end mpp communications 
     150         IF( lk_mpp )   CALL mppstop         ! end mpp communications 
    178151      ENDIF 
    179152#endif 
     
    191164      INTEGER  ::   ilocal_comm   ! local integer 
    192165      INTEGER  ::   ios, inum     !   -      - 
    193       REAL(wp) ::   ziglo, zjglo, zkglo, zperio   ! local scalars 
    194       CHARACTER(len=120), DIMENSION(30) ::   cltxt, cltxt2, clnam, clbug 
     166      CHARACTER(len=120), DIMENSION(30) ::   cltxt, cltxt2, clnam 
    195167      CHARACTER(len=80)                 ::   clname 
    196168      ! 
    197       NAMELIST/namctl/ ln_ctl  , nn_print, nn_ictls, nn_ictle,   & 
    198          &             nn_isplt, nn_jsplt, nn_jctls, nn_jctle,   & 
     169      NAMELIST/namctl/ ln_ctl   , nn_print, nn_ictls, nn_ictle,   & 
     170         &             nn_isplt , nn_jsplt, nn_jctls, nn_jctle,   & 
    199171         &             nn_timing, nn_diacfl 
    200       NAMELIST/namcfg/ ln_read_cfg, ln_write_cfg, cp_cfg, jp_cfg, ln_use_jattr 
     172      NAMELIST/namcfg/ ln_read_cfg, cn_domcfg, ln_write_cfg, cn_domcfg_out, ln_use_jattr 
    201173      !!---------------------------------------------------------------------- 
    202174      ! 
     
    204176      cltxt2 = '' 
    205177      clnam  = ''   
    206       clbug  = '' 
    207178      cxios_context = 'nemo' 
    208179      ! 
     
    220191   ENDIF 
    221192      ! 
    222       REWIND( numnam_ref )              ! Namelist namctl in reference namelist : Control prints & Benchmark 
     193      REWIND( numnam_ref )              ! Namelist namctl in reference namelist : Control prints 
    223194      READ  ( numnam_ref, namctl, IOSTAT = ios, ERR = 901 ) 
    224195901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namctl in reference namelist', .TRUE. ) 
    225  
    226       REWIND( numnam_cfg )              ! Namelist namctl in confguration namelist : Control prints & Benchmark 
     196      ! 
     197      REWIND( numnam_cfg )              ! Namelist namctl in confguration namelist 
    227198      READ  ( numnam_cfg, namctl, IOSTAT = ios, ERR = 902 ) 
    228199902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namctl in configuration namelist', .TRUE. ) 
    229  
    230       ! 
    231       REWIND( numnam_ref )              ! Namelist namcfg in reference namelist : Control prints & Benchmark 
     200      ! 
     201      REWIND( numnam_ref )              ! Namelist namcfg in reference namelist : Control prints 
    232202      READ  ( numnam_ref, namcfg, IOSTAT = ios, ERR = 903 ) 
    233203903   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namcfg in reference namelist', .TRUE. ) 
     
    237207904   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namcfg in configuration namelist', .TRUE. )    
    238208 
    239 !!gm      WRITE(clbug(3),*) ' after namelist namcfg read    nstop', nstop 
    240  
    241209      !                             !--------------------------! 
    242210      !                             !  Set global domain size  !   (control print return in cltxt2) 
    243211      !                             !--------------------------! 
    244       IF( ln_read_cfg ) THEN              ! Read sizes in configuration "mesh_mask" file 
    245          CALL iom_open( 'domain_cfg', inum ) 
    246          CALL iom_get( inum, 'jpiglo', ziglo  )   ;   jpiglo = INT( ziglo ) 
    247          CALL iom_get( inum, 'jpjglo', zjglo  )   ;   jpjglo = INT( zjglo ) 
    248          CALL iom_get( inum, 'jpkglo', zkglo  )   ;   jpkglo = INT( zkglo ) 
    249          CALL iom_get( inum, 'jperio', zperio )   ;   jperio = INT( zperio ) 
    250          CALL iom_close( inum ) 
    251          WRITE(cltxt2(1),*)        
    252          WRITE(cltxt2(2),*) 'domain_cfg : domain size read in "domain_cfg" file : jp(i,j,k)glo = ', jpiglo, jpjglo, jpkglo         
    253          WRITE(cltxt2(3),*) '~~~~~~~~~~   lateral boudary type of the global domain      jperio= ', jperio 
    254          !         
     212      IF( ln_read_cfg ) THEN              ! Read sizes in domain configuration file 
     213         CALL domain_cfg ( cltxt2, clnam, cn_cfg, nn_cfg, jpiglo, jpjglo, jpkglo, jperio ) 
     214         ! 
    255215      ELSE                                ! user-defined namelist 
    256          CALL usr_def_nam( cltxt2, clnam, jpiglo, jpjglo, jpkglo, jperio ) 
    257       ENDIF 
    258       jpk    = jpkglo 
     216         CALL usr_def_nam( cltxt2, clnam, cn_cfg, nn_cfg, jpiglo, jpjglo, jpkglo, jperio ) 
     217      ENDIF 
     218      ! 
     219      jpk = jpkglo 
    259220      ! 
    260221#if defined key_agrif 
     
    281242            CALL xios_initialize( "not used",local_comm=ilocal_comm )    ! send nemo communicator to xios 
    282243         ELSE 
    283             CALL xios_initialize( "for_xios_mpi_id",return_comm=ilocal_comm )        ! nemo local communicator given by xios 
     244            CALL xios_initialize( "for_xios_mpi_id",return_comm=ilocal_comm )    ! nemo local communicator given by xios 
    284245         ENDIF 
    285246      ENDIF 
     
    296257      ENDIF 
    297258#endif 
     259 
    298260      narea = narea + 1                                     ! mynode return the rank of proc (0 --> jpnij -1 ) 
    299261 
     
    301263      lwp = (narea == 1) .OR. ln_ctl                        ! control of all listing output print 
    302264 
    303       IF(lwm) THEN 
    304          ! write merged namelists from earlier to output namelist now that the 
    305          ! file has been opened in call to mynode. nammpp has already been 
    306          ! written in mynode (if lk_mpp_mpi) 
     265      IF(lwm) THEN               ! write merged namelists from earlier to output namelist  
     266         !                       ! now that the file has been opened in call to mynode.  
     267         !                       ! NB: nammpp has already been written in mynode (if lk_mpp_mpi) 
    307268         WRITE( numond, namctl ) 
    308269         WRITE( numond, namcfg ) 
    309270         IF( .NOT.ln_read_cfg ) THEN 
    310271            DO ji = 1, SIZE(clnam) 
    311                IF( TRIM(clnam (ji)) /= '' )   WRITE(numond, * ) clnam(ji)    ! namusr_def print 
     272               IF( TRIM(clnam(ji)) /= '' )   WRITE(numond, * ) clnam(ji)     ! namusr_def print 
    312273            END DO 
    313274         ENDIF 
    314275      ENDIF 
    315276 
    316       ! If dimensions of processor grid weren't specified in the namelist file  
     277      ! If dimensions of processor grid weren't specified in the namelist file 
    317278      ! then we calculate them here now that we have our communicator size 
    318279      IF( jpni < 1 .OR. jpnj < 1 ) THEN 
     
    326287      ENDIF 
    327288 
    328       ! Calculate domain dimensions given calculated jpni and jpnj 
    329       ! This used to be done in par_oce.F90 when they were parameters rather 
    330       ! than variables 
    331       IF( Agrif_Root() ) THEN 
     289      IF( Agrif_Root() ) THEN       ! AGRIF mother: specific setting from jpni and jpnj 
    332290#if defined key_nemocice_decomp 
    333          jpi = ( nx_global+2-2*jpreci + (jpni-1) ) / jpni + 2*jpreci ! first  dim. 
    334          jpj = ( ny_global+2-2*jprecj + (jpnj-1) ) / jpnj + 2*jprecj ! second dim.  
     291         jpi = ( nx_global+2-2*jpreci + (jpni-1) ) / jpni + 2*jpreci    ! first  dim. 
     292         jpj = ( ny_global+2-2*jprecj + (jpnj-1) ) / jpnj + 2*jprecj    ! second dim.  
    335293#else 
    336          jpi = ( jpiglo-2*jpreci + (jpni-1) ) / jpni + 2*jpreci   ! first  dim. 
    337          jpj = ( jpjglo-2*jprecj + (jpnj-1) ) / jpnj + 2*jprecj   ! second dim. 
     294         jpi = ( jpiglo     -2*jpreci + (jpni-1) ) / jpni + 2*jpreci    ! first  dim. 
     295         jpj = ( jpjglo     -2*jprecj + (jpnj-1) ) / jpnj + 2*jprecj    ! second dim. 
    338296#endif 
    339297      ENDIF 
     
    366324         WRITE(numout,*) '                       NEMO team' 
    367325         WRITE(numout,*) '            Ocean General Circulation Model' 
    368          WRITE(numout,*) '                  version 3.7  (2015) ' 
     326         WRITE(numout,*) '                  version 3.7  (2016) ' 
    369327         WRITE(numout,*) '             StandAlone Surface version (SAS) ' 
    370328         WRITE(numout,*) 
    371329         WRITE(numout,*) 
    372          DO ji = 1, SIZE(cltxt)  
    373             IF( TRIM(cltxt(ji)) /= '' )   WRITE(numout,*) cltxt(ji)      ! control print of mynode 
     330         DO ji = 1, SIZE(cltxt) 
     331            IF( TRIM(cltxt (ji)) /= '' )   WRITE(numout,*) cltxt(ji)    ! control print of mynode 
    374332         END DO 
    375333         WRITE(numout,*) 
    376334         WRITE(numout,*) 
    377335         DO ji = 1, SIZE(cltxt2) 
    378 !            IF( TRIM(cltxt2(ji)) /= '' )   WRITE(numout,*) cltxt2(ji)     ! control print of domain size 
    379             IF( cltxt2(ji) /= '' )   WRITE(numout,*) cltxt2(ji)     ! control print of domain size 
     336            IF( TRIM(cltxt2(ji)) /= '' )   WRITE(numout,*) cltxt2(ji)   ! control print of domain size 
    380337         END DO 
    381338         ! 
    382          WRITE(numout,cform_aaa)                                         ! Flag AAAAAAA 
     339         WRITE(numout,cform_aaa)                                        ! Flag AAAAAAA 
    383340         ! 
    384341      ENDIF 
    385342 
    386       ! Now we know the dimensions of the grid and numout has been set we can  
    387       ! allocate arrays 
     343      ! Now we know the dimensions of the grid and numout has been set: we can allocate arrays 
    388344      CALL nemo_alloc() 
    389  
    390345      !                             !-------------------------------! 
    391346      !                             !  NEMO general initialization  ! 
    392347      !                             !-------------------------------! 
    393348 
    394       CALL nemo_ctl                          ! Control prints & Benchmark 
     349      CALL nemo_ctl                          ! Control prints 
    395350 
    396351      !                                      ! Domain decomposition 
     
    404359                            CALL phy_cst    ! Physical constants 
    405360                            CALL eos_init   ! Equation of state 
    406                             CALL dom_cfg    ! Domain configuration 
    407361                            CALL dom_init   ! Domain 
    408362 
     
    437391      IF(lwp) THEN                  ! control print 
    438392         WRITE(numout,*) 
    439          WRITE(numout,*) 'nemo_ctl: Control prints & Benchmark' 
     393         WRITE(numout,*) 'nemo_ctl: Control prints' 
    440394         WRITE(numout,*) '~~~~~~~ ' 
    441395         WRITE(numout,*) '   Namelist namctl' 
     
    464418         WRITE(numout,*) '~~~~~~~ ' 
    465419         WRITE(numout,*) '   Namelist namcfg' 
    466          WRITE(numout,*) '      read configuration definition files          ln_read_cfg = ', ln_read_cfg 
    467          WRITE(numout,*) '      configuration name                               cp_cfg  = ', TRIM(cp_cfg) 
    468          WRITE(numout,*) '      configuration resolution                         jp_cfg  = ', jp_cfg 
    469          WRITE(numout,*) '      use file attribute if exists as i/p j-start ln_use_jattr = ', ln_use_jattr 
     420         WRITE(numout,*) '      read domain configuration files               ln_read_cfg      = ', ln_read_cfg 
     421         WRITE(numout,*) '         filename to be read                           cn_domcfg     = ', TRIM(cn_domcfg) 
     422         WRITE(numout,*) '      write  configuration definition files         ln_write_cfg     = ', ln_write_cfg 
     423         WRITE(numout,*) '         filename to be written                        cn_domcfg_out = ', TRIM(cn_domcfg_out) 
     424         WRITE(numout,*) '      use file attribute if exists as i/p j-start   ln_use_jattr     = ', ln_use_jattr 
    470425      ENDIF 
    471426      !                             ! Parameter control 
     
    486441         !                              ! indices used for the SUM control 
    487442         IF( nictls+nictle+njctls+njctle == 0 )   THEN    ! print control done over the default area 
    488             lsp_area = .FALSE.                         
     443            lsp_area = .FALSE. 
    489444         ELSE                                             ! print control done over a specific  area 
    490445            lsp_area = .TRUE. 
     
    558513#endif 
    559514      ! 
    560       INTEGER :: ierr,ierr1,ierr2,ierr3,ierr4,ierr5,ierr6,ierr7,ierr8 
     515      INTEGER :: ierr, ierr1, ierr2, ierr3, ierr4, ierr5, ierr6, ierr7, ierr8 
    561516      INTEGER :: jpm 
    562517      !!---------------------------------------------------------------------- 
     
    577532      ! clem: should not be needed. To be checked out 
    578533      jpm = MAX(jp_tem, jp_sal) 
    579       ALLOCATE( tsn(jpi,jpj,1,jpm) , STAT=ierr2 ) 
    580       ALLOCATE( ub(jpi,jpj,1)       , STAT=ierr3 ) 
    581       ALLOCATE( vb(jpi,jpj,1)       , STAT=ierr4 ) 
    582       ALLOCATE( tsb(jpi,jpj,1,jpm) , STAT=ierr5 ) 
     534      ALLOCATE( tsn (jpi,jpj,1,jpm) , STAT=ierr2 ) 
     535      ALLOCATE( ub  (jpi,jpj,1)     , STAT=ierr3 ) 
     536      ALLOCATE( vb  (jpi,jpj,1)     , STAT=ierr4 ) 
     537      ALLOCATE( tsb (jpi,jpj,1,jpm) , STAT=ierr5 ) 
    583538      ALLOCATE( sshn(jpi,jpj)       , STAT=ierr6 ) 
    584       ALLOCATE( un(jpi,jpj,1)       , STAT=ierr7 ) 
    585       ALLOCATE( vn(jpi,jpj,1)       , STAT=ierr8 ) 
     539      ALLOCATE( un  (jpi,jpj,1)     , STAT=ierr7 ) 
     540      ALLOCATE( vn  (jpi,jpj,1)     , STAT=ierr8 ) 
    586541      ierr = ierr + ierr1 + ierr2 + ierr3 + ierr4 + ierr5 + ierr6 + ierr7 + ierr8 
    587542#endif 
     
    601556      !! ** Method  : 
    602557      !!---------------------------------------------------------------------- 
    603       INTEGER, INTENT(in) :: num_pes ! The number of MPI processes we have 
     558      INTEGER, INTENT(in) ::   num_pes  ! The number of MPI processes we have 
    604559      ! 
    605560      INTEGER, PARAMETER :: nfactmax = 20 
     
    645600      !! 
    646601      !! ** Purpose :   return the prime factors of n. 
    647       !!                knfax factors are returned in array kfax which is of  
     602      !!                knfax factors are returned in array kfax which is of 
    648603      !!                maximum dimension kmaxfax. 
    649604      !! ** Method  : 
     
    655610      INTEGER :: ifac, jl, inu 
    656611      INTEGER, PARAMETER :: ntest = 14 
    657       INTEGER :: ilfax(ntest) 
     612      INTEGER, DIMENSION(ntest) ::   ilfax 
     613      !!---------------------------------------------------------------------- 
    658614      ! 
    659615      ! lfax contains the set of allowed factors. 
    660       data (ilfax(jl),jl=1,ntest) / 16384, 8192, 4096, 2048, 1024, 512, 256,  & 
    661          &                            128,   64,   32,   16,    8,   4,   2  / 
    662       !!---------------------------------------------------------------------- 
    663  
     616      ilfax(:) = (/(2**jl,jl=ntest,1,-1)/) 
     617      ! 
    664618      ! Clear the error flag and initialise output vars 
    665619      kerr  = 0 
     
    709663 
    710664   SUBROUTINE nemo_northcomms 
    711       !!====================================================================== 
     665      !!---------------------------------------------------------------------- 
    712666      !!                     ***  ROUTINE  nemo_northcomms  *** 
    713       !! nemo_northcomms    :  Setup for north fold exchanges with explicit  
    714       !!                       point-to-point messaging 
    715       !!===================================================================== 
    716       !!---------------------------------------------------------------------- 
    717       !! 
    718       !! ** Purpose :   Initialization of the northern neighbours lists. 
     667      !! ** Purpose :   Setup for north fold exchanges with explicit  
     668      !!                point-to-point messaging 
     669      !! 
     670      !! ** Method :   Initialization of the northern neighbours lists. 
    719671      !!---------------------------------------------------------------------- 
    720672      !!    1.0  ! 2011-10  (A. C. Coward, NOCS & J. Donners, PRACE) 
     
    783735   END SUBROUTINE nemo_northcomms 
    784736#endif 
     737 
    785738   !!====================================================================== 
    786739END MODULE nemogcm 
  • branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zsms.F90

    r6140 r7200  
    416416      IF(lwp)  WRITE(numout,*) 
    417417 
    418       IF( cp_cfg == "orca" .AND. .NOT. lk_c1d ) THEN      ! ORCA configuration (not 1D) ! 
    419          !                                                    ! --------------------------- ! 
     418      IF( cn_cfg == "orca" .AND. .NOT. lk_c1d ) THEN      ! ORCA configuration (not 1D) ! 
     419         !                                                ! --------------------------- ! 
    420420         ! set total alkalinity, phosphate, nitrate & silicate 
    421421         zarea          = 1._wp / glob_sum( cvol(:,:,:) ) * 1e6               
  • branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/NEMO/TOP_SRC/PISCES/trcice_pisces.F90

    r5725 r7200  
    225225            WHERE( gphit(:,:) <  0._wp ) ; trc_o(:,:,jn) = zpisc(jn,3) ; END WHERE ! Antarctic  
    226226         ENDIF 
    227          IF( cp_cfg == "orca" ) THEN     !  Baltic Sea particular case for ORCA configurations 
     227         IF( cn_cfg == "orca" ) THEN     !  Baltic Sea particular case for ORCA configurations 
    228228             WHERE( 14._wp <= glamt(:,:) .AND. glamt(:,:) <= 32._wp .AND.    & 
    229229                    54._wp <= gphit(:,:) .AND. gphit(:,:) <= 66._wp ) 
     
    264264        
    265265         !-- Baltic 
    266          IF( cp_cfg == "orca" ) THEN  ! Baltic treated seperately for ORCA configs 
     266         IF( cn_cfg == "orca" ) THEN  ! Baltic treated seperately for ORCA configs 
    267267            IF ( trc_ice_ratio(jn) >= - 1._wp ) THEN ! no prescribed conc. ; typically everything but iron)  
    268268               WHERE( 14._wp <= glamt(:,:) .AND. glamt(:,:) <= 32._wp .AND.    & 
  • branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/NEMO/TOP_SRC/TRP/trcdmp.F90

    r6596 r7200  
    252252         ! ------------------- 
    253253 
    254          IF( cp_cfg == "orca" ) THEN 
    255             ! 
    256             SELECT CASE ( jp_cfg ) 
     254         IF( cn_cfg == "orca" ) THEN 
     255            ! 
     256            SELECT CASE ( nn_cfg ) 
    257257            !                                           ! ======================= 
    258258            CASE ( 1 )                                  ! eORCA_R1 configuration 
  • branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/NEMO/TOP_SRC/TRP/trdmxl_trc.F90

    r6596 r7200  
    429429 
    430430!!gm Test removed, nothing specific to a configuration should survive out of usrdef modules 
    431 !!gm      IF ( cp_cfg .NE. 'gyre' ) THEN            ! other than GYRE configuration 
     431!!gm      IF ( cn_cfg .NE. 'gyre' ) THEN            ! other than GYRE configuration 
    432432!!gm      ! GYRE : for diagnostic fields, are needed if cyclic B.C. are present, but not for purely MPI comm.  
    433433!!gm      ! therefore we do not call lbc_lnk in GYRE config. (closed basin, no cyclic B.C.) 
     
    569569                
    570570         !-- Lateral boundary conditions 
    571                IF ( cp_cfg .NE. 'gyre' ) THEN 
     571               IF ( cn_cfg .NE. 'gyre' ) THEN 
    572572                  CALL lbc_lnk( ztmltot(:,:,jn) , 'T', 1. )   ;   CALL lbc_lnk( ztmlres(:,:,jn) , 'T', 1. ) 
    573573                  CALL lbc_lnk( ztmlatf(:,:,jn) , 'T', 1. )   ;   CALL lbc_lnk( ztmlrad(:,:,jn) , 'T', 1. ) 
     
    620620 
    621621         !-- Lateral boundary conditions  
    622                IF ( cp_cfg .NE. 'gyre' ) THEN            ! other than GYRE configuration     
     622               IF ( cn_cfg .NE. 'gyre' ) THEN            ! other than GYRE configuration     
    623623                  CALL lbc_lnk( ztmltot2(:,:,jn), 'T', 1. ) 
    624624                  CALL lbc_lnk( ztmlres2(:,:,jn), 'T', 1. ) 
     
    992992 
    993993         !-- Lateral boundary conditions 
    994          IF ( cp_cfg .NE. 'gyre' ) THEN            ! other than GYRE configuration  
     994         IF ( cn_cfg .NE. 'gyre' ) THEN            ! other than GYRE configuration  
    995995            ! ES_B27_CD_WARN : lbc inutile GYRE, cf. + haut 
    996996            DO jn = 1, jpdiabio 
    997997              CALL lbc_lnk( ztmltrdbio2(:,:,jn), 'T', 1. ) 
    998             ENDDO 
     998            END DO 
    999999         ENDIF 
    10001000 
  • branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/TOOLS/DOMAINcfg/namelist_cfg

    r7189 r7200  
    1515!----------------------------------------------------------------------- 
    1616   ! 
    17    ln_e2_dep   = .true.    ! =T : e3=dk[depth] in discret sens.  
     17   ln_e3_dep   = .true.    ! =T : e3=dk[depth] in discret sens.  
    1818   !                       !      ===>>> will become the only possibility in v4.0 
    1919   !                       ! =F : e3 analytical derivative of depth function 
  • branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/TOOLS/DOMAINcfg/namelist_ref

    r7189 r7200  
    7474!----------------------------------------------------------------------- 
    7575   ! 
    76    ln_e2_dep   = .true.    ! =T : e3=dk[depth] in discret sens.  
     76   ln_e3_dep   = .true.    ! =T : e3=dk[depth] in discret sens.  
    7777   !                       !      ===>>> will become the only possibility in v4.0 
    7878   !                       ! =F : e3 analytical derivative of depth function 
  • branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/TOOLS/DOMAINcfg/src/domain.f90

    r7189 r7200  
    379379      !!              ocean configuration. 
    380380      !! 
    381       !! ** output file :   domain_cfg.nc : domain size, characteristics, 
    382       !horizontal mesh, 
    383       !!                              Coriolis parameter, depth and vertical 
    384       !scale factors 
     381      !! ** output file :   domain_cfg.nc : domain size, characteristics,horizontal mesh, 
     382      !!                              Coriolis parameter, and vertical scale factors 
     383      !!                              NB: also contains ORCA family information (if cp_cfg = "ORCA") 
     384      !!                              and depths (ln_e3_dep=F)  
    385385      !!---------------------------------------------------------------------- 
    386386      INTEGER           ::   ji, jj, jk   ! dummy loop indices 
     
    402402      CALL iom_open( TRIM(clnam), inum, ldwrt = .TRUE., kiolib = jprstlib ) 
    403403       
     404      ! 
     405      !                             !==  ORCA family specificities  ==! 
     406      IF( cp_cfg == "ORCA" ) THEN 
     407         CALL iom_rstput( 0, 0, inum, 'ORCA'      , 1._wp            , ktype = jp_i4 ) 
     408         CALL iom_rstput( 0, 0, inum, 'ORCA_index', REAL( jp_cfg, wp), ktype = jp_i4 )          
     409      ENDIF 
    404410      !                             !==  global domain size  ==! 
    405411      ! 
     
    456462      CALL iom_rstput( 0, 0, inum, 'e3w_1d'  , e3w_1d  , ktype = jp_r8 ) 
    457463      ! 
    458       IF(.NOT.ln_e2_dep ) THEN                                             !  depth (t- & w-points) 
    459          CALL iom_rstput( 0, 0, inum, 'gdept_1d', gdept_1d, ktype = jp_r8 )   ! required only with   
    460          CALL iom_rstput( 0, 0, inum, 'gdepw_1d', gdepw_1d, ktype = jp_r8 )   ! the old e3. definition 
    461          CALL iom_rstput( 0, 0, inum, 'gdept_0' , gdept_0 , ktype = jp_r8 ) 
    462          CALL iom_rstput( 0, 0, inum, 'gdepw_0' , gdepw_0 , ktype = jp_r8 ) 
    463       ENDIF 
    464       ! 
    465464      CALL iom_rstput( 0, 0, inum, 'e3t_0'   , e3t_0   , ktype = jp_r8 )   !  vertical scale factors (e 
    466465      CALL iom_rstput( 0, 0, inum, 'e3u_0'   , e3u_0   , ktype = jp_r8 ) 
     
    470469      CALL iom_rstput( 0, 0, inum, 'e3uw_0'  , e3uw_0  , ktype = jp_r8 ) 
    471470      CALL iom_rstput( 0, 0, inum, 'e3vw_0'  , e3vw_0  , ktype = jp_r8 ) 
     471      ! 
     472      IF(.NOT.ln_e3_dep ) THEN                                             !  depth (t- & w-points) 
     473         CALL iom_rstput( 0, 0, inum, 'gdept_1d', gdept_1d, ktype = jp_r8 )   ! required only with   
     474         CALL iom_rstput( 0, 0, inum, 'gdepw_1d', gdepw_1d, ktype = jp_r8 )   ! the old e3. definition 
     475         CALL iom_rstput( 0, 0, inum, 'gdept_0' , gdept_0 , ktype = jp_r8 ) 
     476         CALL iom_rstput( 0, 0, inum, 'gdepw_0' , gdepw_0 , ktype = jp_r8 ) 
     477      ENDIF 
    472478      !                                          
    473479      !                             !==  ocean top and bottom level  ==! 
  • branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/TOOLS/DOMAINcfg/src/domzgr.f90

    r7189 r7200  
    314314      ENDIF 
    315315 
    316       IF ( ln_isfcav .OR. ln_e2_dep ) THEN      ! e3. = dk[gdep]    
     316      IF ( ln_isfcav .OR. ln_e3_dep ) THEN      ! e3. = dk[gdep]    
    317317         ! 
    318318!==>>>   need to be like this to compute the pressure gradient with ISF.  
  • branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/TOOLS/DOMAINcfg/src/nemogcm.f90

    r7189 r7200  
    131131         &             nn_isplt, nn_jsplt, nn_jctls, nn_jctle,   & 
    132132         &             nn_bench, nn_timing, nn_diacfl 
    133       NAMELIST/namcfg/ ln_e2_dep,                                & 
     133      NAMELIST/namcfg/ ln_e3_dep,                                & 
    134134         &             cp_cfg, cp_cfz, jp_cfg, jpidta, jpjdta, jpkdta, jpiglo, jpjglo, & 
    135135         &             jpizoom, jpjzoom, jperio, ln_use_jattr 
     
    288288         WRITE(numout,*) '~~~~~~~ ' 
    289289         WRITE(numout,*) '   Namelist namcfg' 
    290          WRITE(numout,*) '      vertical scale factors =T: e3.=dk[depth]       ln_e2_dep = ', ln_e2_dep 
     290         WRITE(numout,*) '      vertical scale factors =T: e3.=dk[depth]       ln_e3_dep = ', ln_e3_dep 
    291291         WRITE(numout,*) '                             =F: old definition                 ' 
    292292         WRITE(numout,*) '      configuration name                               cp_cfg  = ', TRIM(cp_cfg) 
     
    303303         WRITE(numout,*) '      use file attribute if exists as i/p j-start ln_use_jattr = ', ln_use_jattr 
    304304         ! 
    305          IF(.NOT.ln_e2_dep ) THEN 
     305         IF(.NOT.ln_e3_dep ) THEN 
    306306            WRITE(numout,cform_war) 
    307307            WRITE(numout,*) 
  • branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/TOOLS/DOMAINcfg/src/par_oce.f90

    r7189 r7200  
    2929   !!---------------------------------------------------------------------- 
    3030   ! 
    31    LOGICAL       ::   ln_e2_dep        ! e3. definition flag 
     31   LOGICAL       ::   ln_e3_dep        ! e3. definition flag 
    3232   ! 
    3333   CHARACTER(lc) ::   cp_cfg           !: name of the configuration 
Note: See TracChangeset for help on using the changeset viewer.