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

Changeset 6595


Ignore:
Timestamp:
2016-05-22T08:57:02+02:00 (8 years ago)
Author:
gm
Message:

#1692 - branch SIMPLIF_2_usrdef: add namusr_def, domain size read in file, interface with arguments for hgr_read and usr_def_hgr

Location:
branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM
Files:
1 deleted
27 edited

Legend:

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

    r6140 r6595  
    8383   nn_fsbc     = 1         !  frequency of surface boundary condition computation 
    8484                           !     (also = the frequency of sea-ice model call) 
    85    ln_flx      = .true.    !  flux formulation       (T => fill namsbc_flx ) 
     85   ln_flx      = .true.    !  flux formulation                          (T => fill namsbc_flx ) 
    8686   ln_blk_core = .false.   !  CORE bulk formulation                     (T => fill namsbc_core) 
    8787   nn_ice      = 0         !  =0 no ice boundary condition   , 
     
    9191   ln_traqsr   = .false.   !  Light penetration (T) or not (F) 
    9292 
    93 / 
    94 !----------------------------------------------------------------------- 
    95 &namsbc_ana    !   analytical surface boundary condition 
    96 !----------------------------------------------------------------------- 
    9793/ 
    9894!----------------------------------------------------------------------- 
  • branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/CONFIG/C1D_PAPA/EXP00/namelist_cfg

    r6140 r6595  
    9595/ 
    9696!----------------------------------------------------------------------- 
    97 &namsbc_ana    !   analytical surface boundary condition 
    98 !----------------------------------------------------------------------- 
    99 / 
    100 !----------------------------------------------------------------------- 
    10197&namsbc_flx    !   surface boundary condition : flux formulation 
    10298!----------------------------------------------------------------------- 
  • branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/CONFIG/GYRE/EXP00/namelist_cfg

    r6422 r6595  
    22!! NEMO/OPA  : GYRE_PISCES Configuration namelist to overwrite reference dynamical namelist 
    33!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     4!----------------------------------------------------------------------- 
     5&namusr_def    !   GYRE user defined namelist   
     6!----------------------------------------------------------------------- 
     7   nn_GYRE     =     1     !  GYRE resolution [1/degrees] 
     8   ln_bench    = .false.   !  ! =T benchmark with gyre: the gridsize is kept constant 
     9   jpkglo      =    31     !  number of model levels 
     10/ 
     11 
    412!----------------------------------------------------------------------- 
    513&namrun        !   parameters of the run 
     
    1826&namcfg     !   parameters of the configuration    
    1927!----------------------------------------------------------------------- 
    20    ln_read_cfg = .false.  !  flag to read (.true.) configuration definition files (coordinates, 
     28   ln_read_cfg = .false.  !!gm .false.  !  flag to read (.true.) configuration definition files (coordinates, 
    2129   cp_cfg      =  "gyre"                 !  name of the configuration 
    2230   jp_cfg      =       1                 !  resolution of the configuration 
     
    8290   nn_fsbc     = 1         !  frequency of surface boundary condition computation 
    8391   !                       !     (also = the frequency of sea-ice model call) 
    84    ln_ana      = .true.    !  analytical formulation                    (T => fill namsbc_ana ) 
    85    ln_blk_core = .false.   !  CORE bulk formulation                     (T => fill namsbc_core) 
     92   ln_usr      = .true.    !  user defined formulation                  (T => check usrdef_sbc) 
    8693   nn_ice      = 0         !  =0 no ice boundary condition   , 
    8794   ln_rnf      = .false.   !  runoffs                                   (T => fill namsbc_rnf) 
  • branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/CONFIG/GYRE/cpp_GYRE.fcm

    r5930 r6595  
    1  bld::tool::fppkeys key_zdftke key_iomput key_mpp_mpi 
     1 bld::tool::fppkeys key_zdftke key_iomput key_mpp_mpi key_nosignedzero key_mpp_rep 
  • branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/CONFIG/GYRE_BFM/EXP00/namelist_cfg

    r6140 r6595  
    8585   nn_fsbc     = 1         !  frequency of surface boundary condition computation 
    8686                           !     (also = the frequency of sea-ice model call) 
    87    ln_ana      = .true.    !  analytical formulation                    (T => fill namsbc_ana ) 
    88    ln_blk_core = .false.   !  CORE bulk formulation                     (T => fill namsbc_core) 
     87   ln_usr      = .true.    !  user defined formulation                  (T => check usrdef_sbc) 
    8988   nn_ice      = 0         !  =0 no ice boundary condition   , 
    9089   ln_rnf      = .false.   !  runoffs                                   (T => fill namsbc_rnf) 
    9190   ln_ssr      = .false.   !  Sea Surface Restoring on T and/or S       (T => fill namsbc_ssr) 
    9291   nn_fwb      = 0         !  FreshWater Budget: =0 unchecked 
    93 / 
    94 !----------------------------------------------------------------------- 
    95 &namsbc_ana    !   analytical surface boundary condition 
    96 !----------------------------------------------------------------------- 
    97    nn_tau000   =   100     !  gently increase the stress over the first ntau_rst time-steps 
    98    rn_utau0    =   0.1e0   !  uniform value for the i-stress 
    9992/ 
    10093!----------------------------------------------------------------------- 
  • branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/CONFIG/GYRE_BFM/cpp_GYRE_BFM.fcm

    r5930 r6595  
    1 bld::tool::fppkeys key_zdftke key_top key_my_trc key_mpp_mpi key_iomput 
     1bld::tool::fppkeys key_zdftke key_top key_my_trc key_mpp_mpi key_iomput key_mpp_rep 
    22inc $BFMDIR/src/nemo/bfm.fcm 
  • branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/CONFIG/GYRE_PISCES/EXP00/namelist_cfg

    r6140 r6595  
    7373   nn_fsbc     = 1         !  frequency of surface boundary condition computation 
    7474                           !     (also = the frequency of sea-ice model call) 
    75    ln_ana      = .true.    !  analytical formulation                    (T => fill namsbc_ana ) 
    76    ln_blk_core = .false.   !  CORE bulk formulation                     (T => fill namsbc_core) 
     75   ln_usr      = .true.    !  user defined formulation                  (T => check usrdef_sbc) 
    7776   nn_ice      = 0         !  =0 no ice boundary condition   , 
    7877   ln_rnf      = .false.   !  runoffs                                   (T => fill namsbc_rnf) 
  • branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/CONFIG/GYRE_XIOS/EXP00/namelist_cfg

    r6140 r6595  
    7878   nn_fsbc     = 1         !  frequency of surface boundary condition computation 
    7979                           !     (also = the frequency of sea-ice model call) 
    80    ln_ana      = .true.    !  analytical formulation                    (T => fill namsbc_ana ) 
    81    ln_blk_core = .false.   !  CORE bulk formulation                     (T => fill namsbc_core) 
     80   ln_usr      = .true.    !  user defined formulation                  (T => check usrdef_sbc) 
    8281   nn_ice      = 0         !  =0 no ice boundary condition   , 
    8382   ln_rnf      = .false.   !  runoffs                                   (T => fill namsbc_rnf) 
  • branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/1_namelist_cfg

    r6140 r6595  
    6767&namsbc        !   Surface Boundary Condition (surface module) 
    6868!----------------------------------------------------------------------- 
     69   ln_blk_core = .true.    !  CORE bulk formulation                     (T => fill namsbc_core) 
    6970   nn_ice      = 0         !  =0 no ice boundary condition   , 
    7071                           !  =1 use observed ice-cover      , 
  • branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/namelist_cfg

    r6140 r6595  
    6565&namsbc        !   Surface Boundary Condition (surface module) 
    6666!----------------------------------------------------------------------- 
     67   ln_blk_core = .true.    !  CORE bulk formulation                     (T => fill namsbc_core) 
    6768/ 
    6869!----------------------------------------------------------------------- 
  • branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/CONFIG/ORCA2_LIM3/EXP00/namelist_cfg

    r6140 r6595  
    6464&namsbc        !   Surface Boundary Condition (surface module) 
    6565!----------------------------------------------------------------------- 
     66   ln_blk_core = .true.    !  CORE bulk formulation                     (T => fill namsbc_core) 
    6667/ 
    6768!----------------------------------------------------------------------- 
  • branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/CONFIG/ORCA2_LIM_CFC_C14b/EXP00/1_namelist_cfg

    r6140 r6595  
    116116   nn_fsbc     = 5         !  frequency of surface boundary condition computation  
    117117                           !     (also = the frequency of sea-ice model call) 
    118    ln_ana      = .false.   !  analytical formulation                    (T => fill namsbc_ana )  
    119    ln_flx      = .false.   !  flux formulation                          (T => fill namsbc_flx ) 
    120    ln_blk_clio = .false.   !  CLIO bulk formulation                     (T => fill namsbc_clio)  
    121118   ln_blk_core = .true.    !  CORE bulk formulation                     (T => fill namsbc_core)  
    122    ln_cpl      = .false.   !  Coupled formulation                       (T => fill namsbc_cpl ) 
    123    ln_apr_dyn  = .false.   !  Patm gradient added in ocean & ice Eqs.   (T => fill namsbc_apr ) 
    124119   nn_ice      = 0         !  =0 no ice boundary condition   , 
    125120                           !  =1 use observed ice-cover      , 
  • branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/CONFIG/ORCA2_LIM_CFC_C14b/EXP00/namelist_cfg

    r6140 r6595  
    8484&namsbc        !   Surface Boundary Condition (surface module) 
    8585!----------------------------------------------------------------------- 
    86 / 
    87 !----------------------------------------------------------------------- 
    88 &namsbc_ana    !   analytical surface boundary condition 
    89 !----------------------------------------------------------------------- 
     86   ln_blk_core = .true.    !  CORE bulk formulation                     (T => fill namsbc_core) 
    9087/ 
    9188!----------------------------------------------------------------------- 
  • branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/CONFIG/ORCA2_LIM_PISCES/EXP00/namelist_cfg

    r6140 r6595  
    6161&namsbc        !   Surface Boundary Condition (surface module) 
    6262!----------------------------------------------------------------------- 
     63   ln_blk_core = .true.    !  CORE bulk formulation                     (T => fill namsbc_core) 
    6364/ 
    6465!----------------------------------------------------------------------- 
  • branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/CONFIG/ORCA2_OFF_PISCES/EXP00/namelist_cfg

    r6140 r6595  
    6767!----------------------------------------------------------------------- 
    6868   nn_fsbc     = 1         !  frequency of surface boundary condition computation  
     69   ln_blk_core = .true.    !  CORE bulk formulation                     (T => fill namsbc_core) 
    6970   ln_rnf      = .false.   !  runoffs 
    7071   ln_traqsr   = .false.   !  Light penetration (T) or not (F) 
  • branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/CONFIG/ORCA2_SAS_LIM/EXP00/namelist_cfg

    r6140 r6595  
    6363&namsbc        !   Surface Boundary Condition (surface module) 
    6464!----------------------------------------------------------------------- 
     65   ln_blk_core = .true.    !  CORE bulk formulation                     (T => fill namsbc_core) 
    6566/ 
    6667!----------------------------------------------------------------------- 
  • branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/CONFIG/SHARED/namelist_ref

    r6422 r6595  
    44!! NEMO/OPA  :  1 - run manager      (namrun) 
    55!! namelists    2 - Domain           (namcfg, namzgr, namzgr_sco, namdom, namtsd) 
    6 !!              3 - Surface boundary (namsbc, namsbc_ana, namsbc_flx, namsbc_clio, namsbc_core, namsbc_sas 
     6!!              3 - Surface boundary (namsbc, namsbc_flx, namsbc_clio, namsbc_core, namsbc_sas 
    77!!                                    namsbc_cpl, namtra_qsr, namsbc_rnf, 
    88!!                                    namsbc_apr, namsbc_ssr, namsbc_alb, namsbc_wave) 
     
    222222!!====================================================================== 
    223223!!   namsbc          surface boundary condition 
    224 !!   namsbc_ana      analytical         formulation                     (ln_ana     =T) 
    225224!!   namsbc_flx      flux               formulation                     (ln_flx     =T) 
    226225!!   namsbc_clio     CLIO bulk formulae formulation                     (ln_blk_clio=T) 
     
    246245                           !     (also = the frequency of sea-ice & iceberg model call) 
    247246                     ! Type of air-sea fluxes  
    248    ln_ana      = .false.   !  analytical formulation                    (T => fill namsbc_ana ) 
     247   ln_usr      = .false.   !  user defined formulation                  (T => check usrdef_sbc) 
    249248   ln_flx      = .false.   !  flux formulation                          (T => fill namsbc_flx ) 
    250249   ln_blk_clio = .false.   !  CLIO bulk formulation                     (T => fill namsbc_clio) 
    251    ln_blk_core = .true.    !  CORE bulk formulation                     (T => fill namsbc_core) 
     250   ln_blk_core = .false.    !  CORE bulk formulation                     (T => fill namsbc_core) 
    252251   ln_blk_mfs  = .false.   !  MFS bulk formulation                      (T => fill namsbc_mfs ) 
    253252                     ! Type of coupling (Ocean/Ice/Atmosphere) : 
     
    280279   ln_apr_dyn  = .false.   !  Patm gradient added in ocean & ice Eqs.   (T => fill namsbc_apr ) 
    281280   ln_isf      = .false.   !  ice shelf                                 (T   => fill namsbc_isf) 
    282    ln_wave = .false.       !  coupling with surface wave                (T => fill namsbc_wave) 
    283    nn_lsm  = 0             !  =0 land/sea mask for input fields is not applied (keep empty land/sea mask filename field) , 
     281   ln_wave     = .false.   !  coupling with surface wave                (T => fill namsbc_wave) 
     282   nn_lsm      = 0         !  =0 land/sea mask for input fields is not applied (keep empty land/sea mask filename field) , 
    284283                           !  =1:n number of iterations of land/sea mask application for input fields (fill land/sea mask filename field) 
    285 / 
    286 !----------------------------------------------------------------------- 
    287 &namsbc_ana    !   analytical surface boundary condition 
    288 !----------------------------------------------------------------------- 
    289    nn_tau000   =   0       !  gently increase the stress over the first ntau_rst time-steps 
    290    rn_utau0    =   0.5     !  uniform value for the i-stress 
    291    rn_vtau0    =   0.e0    !  uniform value for the j-stress 
    292    rn_qns0     =   0.e0    !  uniform value for the total heat flux 
    293    rn_qsr0     =   0.e0    !  uniform value for the solar radiation 
    294    rn_emp0     =   0.e0    !  uniform value for the freswater budget (E-P) 
    295284/ 
    296285!----------------------------------------------------------------------- 
     
    389378/ 
    390379!----------------------------------------------------------------------- 
    391 &namsbc_sas    !   analytical surface boundary condition 
     380&namsbc_sas    !   Stand Alone Surface boundary condition 
    392381!----------------------------------------------------------------------- 
    393382!              !  file name  ! frequency (hours) ! variable  ! time interp. !  clim  ! 'yearly'/ ! weights  ! rotation ! land/sea mask ! 
     
    10431032!!====================================================================== 
    10441033!!   nammpp            Massively Parallel Processing                    ("key_mpp_mpi) 
    1045 !!   namctl            Control prints & Benchmark 
     1034!!   namctl            Control prints  
    10461035!!   namsto            Stochastic parametrization of EOS 
    10471036!!====================================================================== 
     
    10591048/ 
    10601049!----------------------------------------------------------------------- 
    1061 &namctl        !   Control prints & Benchmark 
     1050&namctl        !   Control prints  
    10621051!----------------------------------------------------------------------- 
    10631052   ln_ctl      = .false.   !  trends control print (expensive!) 
     
    10691058   nn_isplt    =    1      !  number of processors in i-direction 
    10701059   nn_jsplt    =    1      !  number of processors in j-direction 
    1071    nn_bench    =    0      !  Bench mode (1/0): CAUTION use zero except for bench 
    1072                            !     (no physical validity of the results) 
    10731060   nn_timing   =    0      !  timing by routine activated (=1) creates timing.output file, or not (=0) 
    10741061   nn_diacfl   =    0      !  Write out CFL diagnostics (=1) in cfl_diagnostics.ascii, or not (=0) 
  • branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/CONFIG/cfg.txt

    r6403 r6595  
    99ORCA2_LIM OPA_SRC LIM_SRC_2 NST_SRC 
    1010ORCA2_OFF_PISCES OPA_SRC OFF_SRC TOP_SRC 
     11ORCA2_LIM_PISCES OPA_SRC LIM_SRC_2 NST_SRC TOP_SRC 
    1112GYRE OPA_SRC 
    12 ORCA2_LIM_PISCES OPA_SRC LIM_SRC_2 NST_SRC TOP_SRC 
  • branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/NEMO/OPA_SRC/DOM/domhgr.F90

    r6593 r6595  
    1616   !!            3.7  ! 2015-09  (G. Madec, S. Flavoni) add cell surface and their inverse 
    1717   !!                                       add optional read of e1e2u & e1e2v 
    18    !!             -   ! 2016-04  (S. Flavoni) change configuration's interface: 
    19    !!                            read file or CALL usr_def module to compute  
    20    !!                            horizontal grid (example given for GYRE) 
     18   !!             -   ! 2016-04  (S. Flavoni, G. Madec) new configuration interface: read or usrdef.F90 
    2119   !!---------------------------------------------------------------------- 
    2220 
     
    2927   USE phycst         ! physical constants 
    3028   USE usrdef         ! User defined routine 
    31 !   USE domwri         ! write 'meshmask.nc' & 'coordinate_e1e2u_v.nc' files 
    3229   ! 
    3330   USE in_out_manager ! I/O manager 
     31   USE iom            ! I/O library 
    3432   USE lib_mpp        ! MPP library 
    3533   USE timing         ! Timing 
     
    3836   PRIVATE 
    3937 
    40    REAL(wp) ::   glam0, gphi0   ! variables corresponding to parameters ppglam0 ppgphi0 set in namelist !SF modify some routines???? 
    41  
    4238   PUBLIC   dom_hgr   ! called by domain.F90 
    4339 
    4440   !!---------------------------------------------------------------------- 
    45    !! NEMO/OPA 3.7 , NEMO Consortium (2014) 
     41   !! NEMO/OPA 3.7 , NEMO Consortium (2016) 
    4642   !! $Id$  
    4743   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt) 
     
    5349      !!                  ***  ROUTINE dom_hgr  *** 
    5450      !! 
    55       !! ** Purpose :   Compute the geographical position (in degre) of the  
    56       !!      model grid-points,  the horizontal scale factors (in meters) and  
    57       !!      the Coriolis factor (in s-1). 
     51      !! ** Purpose :   Read or compute the geographical position (in degrees)  
     52      !!      of the model grid-points, the horizontal scale factors (in meters),  
     53      !!      the associated horizontal metrics, and the Coriolis factor (in s-1). 
    5854      !! 
    5955      !! ** Method  :   Controlled by ln_read_cfg logical 
     
    7874      !!                (inverse of scale factors 1/e1 & 1/e2, surface e1*e2, ratios e1/e2 & e2/e1) 
    7975      !!---------------------------------------------------------------------- 
    80       INTEGER  ::   ji, jj                   ! dummy loop indices 
    81       !INTEGER  ::   ii0, ii1, ij0, ij1, iff  ! temporary integers 
    82       !INTEGER  ::   ijeq                     ! index of equator T point (used in case 4) 
    83       !REAL(wp) ::   zti, zui, zvi, zfi       ! local scalars 
    84       !REAL(wp) ::   ztj, zuj, zvj, zfj       !   -      - 
    85       !REAL(wp) ::   zphi0, zbeta, znorme     ! 
    86       !REAL(wp) ::   zarg, zf0, zminff, zmaxff 
    87       !REAL(wp) ::   zlam1, zcos_alpha, zim1 , zjm1 , ze1, ze1deg 
    88       !REAL(wp) ::   zphi1, zsin_alpha, zim05, zjm05 
    89       !INTEGER  ::   isrow                    ! index for ORCA1 starting row 
    90       INTEGER  ::   ie1e2u_v                 ! flag for u- & v-surfaces  
    91       INTEGER  ::   iff                      ! flag for Coriolis parameter 
     76      INTEGER ::   ji, jj     ! dummy loop indices 
     77      INTEGER ::   ie1e2u_v   ! flag for u- & v-surfaces  
     78      INTEGER ::   iff        ! flag for Coriolis parameter 
    9279      !!---------------------------------------------------------------------- 
    9380      ! 
     
    9885         WRITE(numout,*) 'dom_hgr : define the horizontal mesh from ithe following par_oce parameters ' 
    9986         WRITE(numout,*) '~~~~~~~   ' 
     87         WRITE(numout,*) '   namcfg : read (=T) or user defined (=F) configuration    ln_read_cfg  = ', ln_read_cfg 
    10088      ENDIF 
    10189      ! 
     
    10593         IF(lwp) WRITE(numout,*) '          read horizontal mesh in "mesh_mask" file' 
    10694         ! 
    107          CALL hgr_read( ie1e2u_v, iff )      
    108          ! 
    109       ELSE     
    110          IF(lwp) WRITE(numout,*) '          ln_read_cfg CALL user_defined module' 
    111          CALL usr_def_hgr( nbench , jp_cfg, iff   , ff    ,    & 
    112          &                 glamt  , glamu , glamv , glamf ,    & 
    113          &                 gphit  , gphiu , gphiv , gphif ,    & 
    114          &                 e1t    , e1u   , e1v   , e1f   ,    & 
    115          &                 e2t    , e2u   , e2v   , e2f   ,    & 
    116          &                 ie1e2u_v  ) 
    117          ! 
    118       ENDIF 
    119       ! 
    120       ! associated horizontal metrics 
    121       ! ----------------------------- 
     95         CALL hgr_read   ( glamt , glamu , glamv , glamf ,   &    ! geographic position (required) 
     96            &              gphit , gphiu , gphiv , gphif ,   &    !     -        - 
     97            &              iff   , ff    ,                   &    ! Coriolis parameter (if not on the sphere) 
     98            &              e1t   , e1u   , e1v   , e1f   ,   &    ! scale factors (required) 
     99            &              e2t   , e2u   , e2v   , e2f   ,   &    !    -     -        - 
     100            &              ie1e2u_v      , e1e2u , e1e2v     )    ! u- & v-surfaces (if gridsize reduction in some straits) 
     101         ! 
     102      ELSE                          !==  User defined configuration  ==!  
     103         IF(lwp) WRITE(numout,*) 
     104         IF(lwp) WRITE(numout,*) '          User defined horizontal mesh (usr_def_hgr)' 
     105         ! 
     106         CALL usr_def_hgr( glamt , glamu , glamv , glamf ,   &    ! geographic position (required) 
     107            &              gphit , gphiu , gphiv , gphif ,   &    ! 
     108            &              iff   , ff    ,                   &    ! Coriolis parameter  (if domain not on the sphere) 
     109            &              e1t   , e1u   , e1v   , e1f   ,   &    ! scale factors       (required) 
     110            &              e2t   , e2u   , e2v   , e2f   ,   &    ! 
     111            &              ie1e2u_v      , e1e2u , e1e2v     )    ! u- & v-surfaces (if gridsize reduction is used in strait(s)) 
     112         ! 
     113      ENDIF 
     114      ! 
     115      !                             !==  Coriolis parameter  ==!   (if necessary) 
     116      ! 
     117      IF( iff == 0 ) THEN                 ! Coriolis parameter has not been defined  
     118         IF(lwp) WRITE(numout,*) '          Coriolis parameter calculated on the sphere from gphif' 
     119         ff(:,:) = 2. * omega * SIN( rad * gphif(:,:) )     ! compute it on the sphere 
     120      ELSE 
     121         IF(lwp) WRITE(numout,*) '          Coriolis parameter have been read in "mesh_mask" file' 
     122      ENDIF 
     123      ! 
     124      !                             !==  associated horizontal metrics  ==! 
    122125      ! 
    123126      r1_e1t(:,:) = 1._wp / e1t(:,:)   ;   r1_e2t (:,:) = 1._wp / e2t(:,:) 
     
    128131      e1e2t (:,:) = e1t(:,:) * e2t(:,:)   ;   r1_e1e2t(:,:) = 1._wp / e1e2t(:,:) 
    129132      e1e2f (:,:) = e1f(:,:) * e2f(:,:)   ;   r1_e1e2f(:,:) = 1._wp / e1e2f(:,:) 
    130       IF( ie1e2u_v == 0 ) THEN               ! e1e2u and e1e2v have not been set: compute them 
    131          e1e2u (:,:) = e1u(:,:) * e2u(:,:)    
     133      IF( ie1e2u_v == 0 ) THEN               ! u- & v-surfaces have not been defined 
     134         IF(lwp) WRITE(numout,*) '          u- & v-surfaces calculated as e1 e2 product' 
     135         e1e2u (:,:) = e1u(:,:) * e2u(:,:)         ! compute them 
    132136         e1e2v (:,:) = e1v(:,:) * e2v(:,:)  
    133       ENDIF 
    134       r1_e1e2u(:,:) = 1._wp / e1e2u(:,:)     ! compute their invert in both cases 
     137      ELSE 
     138         IF(lwp) WRITE(numout,*) '          u- & v-surfaces have been read in "mesh_mask" file:' 
     139         IF(lwp) WRITE(numout,*) '                     grid size reduction in strait(s) is used' 
     140      ENDIF 
     141      r1_e1e2u(:,:) = 1._wp / e1e2u(:,:)     ! compute their invert in any cases 
    135142      r1_e1e2v(:,:) = 1._wp / e1e2v(:,:) 
    136143      !    
    137144      e2_e1u(:,:) = e2u(:,:) / e1u(:,:) 
    138145      e1_e2v(:,:) = e1v(:,:) / e2v(:,:) 
    139        
    140       ! ================= ! 
    141       !  Coriolis factor  ! 
    142       ! ================= ! 
    143       IF ( iff == 0 ) THEN       ! Coriolis parameter has not been defined: compute it on the sphere  
    144          ! 
    145          ff(:,:) = 2. * omega * SIN( rad * gphif(:,:) )  
    146          ! 
    147       ENDIF 
     146      ! 
    148147      ! 
    149148      IF( nn_timing == 1 )  CALL timing_stop('dom_hgr') 
     
    152151 
    153152 
    154    SUBROUTINE hgr_read( ke1e2u_v, kff ) 
     153   SUBROUTINE hgr_read( plamt , plamu , plamv  , plamf  ,     &    ! gridpoints position (required) 
     154      &                 pphit , pphiu , pphiv  , pphif  ,     &      
     155      &                 kff   , pff   ,                       &    ! Coriolis parameter  (if not on the sphere) 
     156      &                 pe1t  , pe1u  , pe1v   , pe1f   ,     &    ! scale factors       (required) 
     157      &                 pe2t  , pe2u  , pe2v   , pe2f   ,     & 
     158      &                 ke1e2u_v      , pe2_e1u, pe1_e2v   )       ! u- & v-surfaces (if gridsize reduction in some straits) 
    155159      !!--------------------------------------------------------------------- 
    156160      !!              ***  ROUTINE hgr_read  *** 
     
    159163      !! 
    160164      !!---------------------------------------------------------------------- 
    161       USE iom 
    162       !! 
    163       INTEGER, INTENT( out ) ::   ke1e2u_v   ! fag: e1e2u & e1e2v read in mesh_mask file (=1) or not (=0) 
    164       INTEGER, INTENT( out ) ::   kff        ! fag: kff read in mesh_mask file (=1) or not (=0) 
    165       ! 
    166       INTEGER ::   inum   ! temporary logical unit 
     165      REAL(wp), DIMENSION(:,:), INTENT(out) ::   plamt, plamu, plamv, plamf   ! longitude outputs  
     166      REAL(wp), DIMENSION(:,:), INTENT(out) ::   pphit, pphiu, pphiv, pphif   ! latitude outputs 
     167      INTEGER                 , INTENT(out) ::   kff                          ! =1 Coriolis parameter read here, =0 otherwise 
     168      REAL(wp), DIMENSION(:,:), INTENT(out) ::   pff                          ! Coriolis factor at f-point (if found in file) 
     169      REAL(wp), DIMENSION(:,:), INTENT(out) ::   pe1t, pe1u, pe1v, pe1f       ! i-scale factors  
     170      REAL(wp), DIMENSION(:,:), INTENT(out) ::   pe2t, pe2u, pe2v, pe2f       ! j-scale factors 
     171      INTEGER                 , INTENT(out) ::   ke1e2u_v                     ! =1 u- & v-surfaces read here, =0 otherwise  
     172      REAL(wp), DIMENSION(:,:), INTENT(out) ::   pe2_e1u, pe1_e2v             ! u- & v-surfaces (if found in file) 
     173      ! 
     174      INTEGER  ::   inum                  ! logical unit 
     175      REAL(wp) ::   ziglo, zjglo, zkglo   ! domain size 
    167176      !!---------------------------------------------------------------------- 
    168177      ! 
     
    175184      CALL iom_open( 'mesh_mask', inum ) 
    176185      ! 
    177       CALL iom_get( inum, jpdom_data, 'glamt', glamt, lrowattr=ln_use_jattr ) 
    178       CALL iom_get( inum, jpdom_data, 'glamu', glamu, lrowattr=ln_use_jattr ) 
    179       CALL iom_get( inum, jpdom_data, 'glamv', glamv, lrowattr=ln_use_jattr ) 
    180       CALL iom_get( inum, jpdom_data, 'glamf', glamf, lrowattr=ln_use_jattr ) 
    181       ! 
    182       CALL iom_get( inum, jpdom_data, 'gphit', gphit, lrowattr=ln_use_jattr ) 
    183       CALL iom_get( inum, jpdom_data, 'gphiu', gphiu, lrowattr=ln_use_jattr ) 
    184       CALL iom_get( inum, jpdom_data, 'gphiv', gphiv, lrowattr=ln_use_jattr ) 
    185       CALL iom_get( inum, jpdom_data, 'gphif', gphif, lrowattr=ln_use_jattr ) 
    186       ! 
    187       CALL iom_get( inum, jpdom_data, 'e1t'  , e1t  , lrowattr=ln_use_jattr ) 
    188       CALL iom_get( inum, jpdom_data, 'e1u'  , e1u  , lrowattr=ln_use_jattr ) 
    189       CALL iom_get( inum, jpdom_data, 'e1v'  , e1v  , lrowattr=ln_use_jattr ) 
    190       CALL iom_get( inum, jpdom_data, 'e1f'  , e1f  , lrowattr=ln_use_jattr ) 
    191       ! 
    192       CALL iom_get( inum, jpdom_data, 'e2t'  , e2t  , lrowattr=ln_use_jattr ) 
    193       CALL iom_get( inum, jpdom_data, 'e2u'  , e2u  , lrowattr=ln_use_jattr ) 
    194       CALL iom_get( inum, jpdom_data, 'e2v'  , e2v  , lrowattr=ln_use_jattr ) 
    195       CALL iom_get( inum, jpdom_data, 'e2f'  , e2f  , lrowattr=ln_use_jattr ) 
    196       !SF add read coriolis in mesh_mask file 
    197       CALL iom_get( inum, jpdom_data, 'ff'   , ff   , lrowattr=ln_use_jattr ) 
     186      CALL iom_get( inum, 'jpiglo', ziglo ) 
     187      CALL iom_get( inum, 'jpjglo', zjglo ) 
     188      CALL iom_get( inum, 'jpkglo', zkglo ) 
     189      WRITE(numout,*) ' read size read: i,j,k = ', INT(ziglo), INT(zjglo), INT(zkglo) 
     190 
     191      ! 
     192      CALL iom_get( inum, jpdom_data, 'glamt', plamt, lrowattr=ln_use_jattr ) 
     193      CALL iom_get( inum, jpdom_data, 'glamu', plamu, lrowattr=ln_use_jattr ) 
     194      CALL iom_get( inum, jpdom_data, 'glamv', plamv, lrowattr=ln_use_jattr ) 
     195      CALL iom_get( inum, jpdom_data, 'glamf', plamf, lrowattr=ln_use_jattr ) 
     196      ! 
     197      CALL iom_get( inum, jpdom_data, 'gphit', pphit, lrowattr=ln_use_jattr ) 
     198      CALL iom_get( inum, jpdom_data, 'gphiu', pphiu, lrowattr=ln_use_jattr ) 
     199      CALL iom_get( inum, jpdom_data, 'gphiv', pphiv, lrowattr=ln_use_jattr ) 
     200      CALL iom_get( inum, jpdom_data, 'gphif', pphif, lrowattr=ln_use_jattr ) 
     201      ! 
     202      CALL iom_get( inum, jpdom_data, 'e1t'  , pe1t  , lrowattr=ln_use_jattr ) 
     203      CALL iom_get( inum, jpdom_data, 'e1u'  , pe1u  , lrowattr=ln_use_jattr ) 
     204      CALL iom_get( inum, jpdom_data, 'e1v'  , pe1v  , lrowattr=ln_use_jattr ) 
     205      CALL iom_get( inum, jpdom_data, 'e1f'  , pe1f  , lrowattr=ln_use_jattr ) 
     206      ! 
     207      CALL iom_get( inum, jpdom_data, 'e2t'  , pe2t  , lrowattr=ln_use_jattr ) 
     208      CALL iom_get( inum, jpdom_data, 'e2u'  , pe2u  , lrowattr=ln_use_jattr ) 
     209      CALL iom_get( inum, jpdom_data, 'e2v'  , pe2v  , lrowattr=ln_use_jattr ) 
     210      CALL iom_get( inum, jpdom_data, 'e2f'  , pe2f  , lrowattr=ln_use_jattr ) 
     211      ! 
     212      IF( iom_varid( inum, 'ff', ldstop = .FALSE. ) > 0 ) THEN 
     213         IF(lwp) WRITE(numout,*) '           ff read in mesh_mask file' 
     214         CALL iom_get( inum, jpdom_data, 'ff'  , ff  , lrowattr=ln_use_jattr ) 
     215         kff = 1 
     216      ELSE 
     217         kff = 0 
     218      ENDIF 
    198219      ! 
    199220      IF( iom_varid( inum, 'e1e2u', ldstop = .FALSE. ) > 0 ) THEN 
    200          IF(lwp) WRITE(numout,*) 'hgr_read : e1e2u & e1e2v read in mesh_mask file' 
     221         IF(lwp) WRITE(numout,*) '          e1e2u & e1e2v read in mesh_mask file' 
    201222         CALL iom_get( inum, jpdom_data, 'e1e2u'  , e1e2u  , lrowattr=ln_use_jattr ) 
    202223         CALL iom_get( inum, jpdom_data, 'e1e2v'  , e1e2v  , lrowattr=ln_use_jattr ) 
     
    206227      ENDIF 
    207228      ! 
    208       IF( iom_varid( inum, 'kff', ldstop = .FALSE. ) > 0 ) THEN 
    209          IF(lwp) WRITE(numout,*) 'hgr_read : ff read in mesh_mask file' 
    210          CALL iom_get( inum, jpdom_data, 'ff'  , ff  , lrowattr=ln_use_jattr ) 
    211          kff = 1 
    212       ELSE 
    213          kff = 0 
    214       ENDIF 
    215       ! 
    216229      CALL iom_close( inum ) 
    217        
    218     END SUBROUTINE hgr_read 
     230      ! 
     231   END SUBROUTINE hgr_read 
    219232     
    220233   !!====================================================================== 
  • branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/NEMO/OPA_SRC/DOM/domwri.F90

    r6579 r6595  
    129129      !!                                   masks, depth and vertical scale factors 
    130130      !!---------------------------------------------------------------------- 
    131       !! 
    132131      INTEGER           ::   inum0    ! temprary units for 'mesh_mask.nc' file 
    133132      INTEGER           ::   inum1    ! temprary units for 'mesh.nc'      file 
     
    188187         ! 
    189188      END SELECT 
    190        
     189 
     190      !                                                         ! global domain size 
     191      CALL iom_rstput( 0, 0, inum2, 'jpiglo', REAL( jpiglo, wp), ktype = jp_i4 ) 
     192      CALL iom_rstput( 0, 0, inum2, 'jpjglo', REAL( jpjglo, wp), ktype = jp_i4 ) 
     193      CALL iom_rstput( 0, 0, inum2, 'jpkglo', REAL( jpk   , wp), ktype = jp_i4 ) 
     194 
     195 
     196 
     197 
    191198      !                                                         ! masks (inum2)  
    192199      CALL iom_rstput( 0, 0, inum2, 'tmask', tmask, ktype = jp_i1 )     !    ! land-sea mask 
  • branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/NEMO/OPA_SRC/IOM/in_out_manager.F90

    r6140 r6595  
    105105   INTEGER ::   nn_isplt     !: number of processors following i 
    106106   INTEGER ::   nn_jsplt     !: number of processors following j 
    107    INTEGER ::   nn_bench     !: benchmark parameter (0/1) 
    108107   INTEGER ::   nn_bit_cmp   =    0    !: bit reproducibility  (0/1) 
    109108 
    110109   !                                           
    111    INTEGER ::   nprint, nictls, nictle, njctls, njctle, isplt, jsplt, nbench    !: OLD namelist names 
     110   INTEGER ::   nprint, nictls, nictle, njctls, njctle, isplt, jsplt    !: OLD namelist names 
    112111 
    113112   INTEGER ::   ijsplt     =    1      !: nb of local domain = nb of processors 
  • branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/NEMO/OPA_SRC/SBC/sbc_oce.F90

    r6583 r6595  
    3030   !!---------------------------------------------------------------------- 
    3131   !                                   !!* namsbc namelist * 
    32    LOGICAL , PUBLIC ::   ln_ana         !: user defined formulation 
     32   LOGICAL , PUBLIC ::   ln_usr         !: user defined formulation 
    3333   LOGICAL , PUBLIC ::   ln_flx         !: flux         formulation 
    3434   LOGICAL , PUBLIC ::   ln_blk_clio    !: CLIO bulk    formulation 
     
    7272   !!           switch definition (improve readability) 
    7373   !!---------------------------------------------------------------------- 
    74    INTEGER , PUBLIC, PARAMETER ::   jp_ana     = 1        !: user defined                  formulation 
     74   INTEGER , PUBLIC, PARAMETER ::   jp_usr     = 1        !: user defined                  formulation 
    7575   INTEGER , PUBLIC, PARAMETER ::   jp_flx     = 2        !: flux                          formulation 
    7676   INTEGER , PUBLIC, PARAMETER ::   jp_clio    = 3        !: CLIO bulk                     formulation 
  • branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/NEMO/OPA_SRC/SBC/sbcmod.F90

    r6583 r6595  
    8787      INTEGER ::   icpt   ! local integer 
    8888      !! 
    89       NAMELIST/namsbc/ nn_fsbc  , ln_ana   , ln_flx, ln_blk_clio, ln_blk_core, ln_blk_mfs,   & 
     89      NAMELIST/namsbc/ nn_fsbc  , ln_usr   , ln_flx, ln_blk_clio, ln_blk_core, ln_blk_mfs,   & 
    9090         &             ln_cpl   , ln_mixcpl, nn_components      , nn_limflx  ,               & 
    9191         &             ln_traqsr, ln_dm2dc ,                                                 &   
     
    125125         WRITE(numout,*) '           frequency update of sbc (and ice)             nn_fsbc     = ', nn_fsbc 
    126126         WRITE(numout,*) '           Type of air-sea fluxes : ' 
    127          WRITE(numout,*) '              user defined formulation                   ln_ana        = ', ln_ana 
     127         WRITE(numout,*) '              user defined formulation                   ln_usr        = ', ln_usr 
    128128         WRITE(numout,*) '              flux         formulation                   ln_flx        = ', ln_flx 
    129129         WRITE(numout,*) '              CLIO bulk    formulation                   ln_blk_clio   = ', ln_blk_clio 
     
    220220      ! 
    221221      icpt = 0 
    222       IF( ln_ana          ) THEN   ;   nsbc = jp_ana     ; icpt = icpt + 1   ;   ENDIF       ! user defined         formulation 
     222      IF( ln_usr          ) THEN   ;   nsbc = jp_usr     ; icpt = icpt + 1   ;   ENDIF       ! user defined         formulation 
    223223      IF( ln_flx          ) THEN   ;   nsbc = jp_flx     ; icpt = icpt + 1   ;   ENDIF       ! flux                 formulation 
    224224      IF( ln_blk_clio     ) THEN   ;   nsbc = jp_clio    ; icpt = icpt + 1   ;   ENDIF       ! CLIO bulk            formulation 
     
    234234         WRITE(numout,*) 
    235235         SELECT CASE( nsbc ) 
    236          CASE( jp_ana     )   ;   WRITE(numout,*) '   user defined formulation' 
     236         CASE( jp_usr     )   ;   WRITE(numout,*) '   user defined formulation' 
    237237         CASE( jp_flx     )   ;   WRITE(numout,*) '   flux formulation' 
    238238         CASE( jp_clio    )   ;   WRITE(numout,*) '   CLIO bulk formulation' 
     
    331331      SELECT CASE( nsbc )                                ! Compute ocean surface boundary condition 
    332332      !                                                  ! (i.e. utau,vtau, qns, qsr, emp, sfx) 
    333       CASE( jp_ana   )   ;   CALL usr_def_sbc ( kt )                    ! user defined formulation  
     333      CASE( jp_usr   )   ;   CALL usr_def_sbc ( kt )                    ! user defined formulation  
    334334      CASE( jp_flx   )   ;   CALL sbc_flx     ( kt )                    ! flux formulation 
    335335      CASE( jp_clio  )   ;   CALL sbc_blk_clio( kt )                    ! bulk formulation : CLIO for the ocean 
  • branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90

    r6422 r6595  
    8282#endif 
    8383   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) 
     84   USE diurnal_bulk   ! diurnal bulk SST  
     85   USE step_diu       ! diurnal bulk SST timestepping (called from here if run offline) 
    8686#if defined key_iomput 
    8787   USE xios           ! xIOserver 
     
    9090   USE lbcnfd , ONLY  : isendto, nsndto, nfsloop, nfeloop   ! Setup of north fold exchanges  
    9191   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) 
     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         ! user defined configuration 
    9596 
    9697   IMPLICIT NONE 
     
    234235      !! ** Purpose :   initialization of the NEMO GCM 
    235236      !!---------------------------------------------------------------------- 
    236       INTEGER ::   ji            ! dummy loop indices 
    237       INTEGER ::   ilocal_comm   ! local integer 
    238       INTEGER ::   ios 
    239       CHARACTER(len=80), DIMENSION(16) ::   cltxt 
     237      INTEGER  ::   ji            ! dummy loop indices 
     238      INTEGER  ::   ilocal_comm   ! local integer 
     239      INTEGER  ::   ios, inum     !   -      - 
     240      REAL(wp) ::   ziglo, zjglo, zkglo   ! local scalars 
     241      CHARACTER(len=120), DIMENSION(16) ::   cltxt, cltxt2, clnam 
    240242      ! 
    241243      NAMELIST/namctl/ ln_ctl  , nn_print, nn_ictls, nn_ictle,   & 
    242244         &             nn_isplt, nn_jsplt, nn_jctls, nn_jctle,   & 
    243          &             nn_bench, nn_timing, nn_diacfl 
     245         &             nn_timing, nn_diacfl 
    244246      NAMELIST/namcfg/ ln_read_cfg, cp_cfg, cp_cfz, jp_cfg, jpidta, jpjdta, jpkdta, jpiglo, jpjglo, & 
    245247         &             jpizoom, jpjzoom, jperio, ln_use_jattr 
    246248      !!---------------------------------------------------------------------- 
    247249      ! 
    248       cltxt = '' 
     250      cltxt  = '' 
     251      cltxt2 = '' 
     252      clnam  = '' 
    249253      cxios_context = 'nemo' 
    250254      ! 
     
    253257      CALL ctl_opn( numnam_cfg, 'namelist_cfg', 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, 6, .FALSE. ) 
    254258      ! 
    255       REWIND( numnam_ref )              ! Namelist namctl in reference namelist : Control prints & Benchmark 
     259      REWIND( numnam_ref )              ! Namelist namctl in reference namelist : Control prints 
    256260      READ  ( numnam_ref, namctl, IOSTAT = ios, ERR = 901 ) 
    257261901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namctl in reference namelist', .TRUE. ) 
    258262 
    259       REWIND( numnam_cfg )              ! Namelist namctl in confguration namelist : Control prints & Benchmark 
     263      REWIND( numnam_cfg )              ! Namelist namctl in confguration namelist : Control prints 
    260264      READ  ( numnam_cfg, namctl, IOSTAT = ios, ERR = 902 ) 
    261265902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namctl in configuration namelist', .TRUE. ) 
    262266 
    263267      ! 
    264       REWIND( numnam_ref )              ! Namelist namcfg in reference namelist : Control prints & Benchmark 
     268      REWIND( numnam_ref )              ! Namelist namcfg in reference namelist 
    265269      READ  ( numnam_ref, namcfg, IOSTAT = ios, ERR = 903 ) 
    266270903   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namcfg in reference namelist', .TRUE. ) 
    267271 
    268       REWIND( numnam_cfg )              ! Namelist namcfg in confguration namelist : Control prints & Benchmark 
     272      REWIND( numnam_cfg )              ! Namelist namcfg in confguration namelist 
    269273      READ  ( numnam_cfg, namcfg, IOSTAT = ios, ERR = 904 ) 
    270274904   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namcfg in configuration namelist', .TRUE. )    
    271275 
    272 ! Force values for AGRIF zoom (cf. agrif_user.F90) 
     276      !                             !--------------------------! 
     277      !                             !  Set global domain size  ! 
     278      !                             !--------------------------! 
     279      IF( ln_read_cfg ) THEN              ! Read sizes in configuration "mesh_mask" file 
     280         CALL iom_open( 'mesh_mask', inum ) 
     281         CALL iom_get( inum, 'jpiglo', ziglo )   ;   jpiglo = INT( ziglo ) 
     282         CALL iom_get( inum, 'jpjglo', zjglo )   ;   jpjglo = INT( zjglo ) 
     283         CALL iom_get( inum, 'jpkglo', zkglo )   ;   jpkglo = INT( zkglo ) 
     284         CALL iom_close( inum ) 
     285         WRITE(cltxt2(1),*)        
     286         WRITE(cltxt2(2),*) 'mesh_mask : domain size read in "mesh_mask" file : i,j,k = ', jpiglo, jpjglo, jpk         
     287         WRITE(cltxt2(3),*) '~~~~~~~~~'         
     288      ELSE                                ! user-defined namelist (control print return in cltxt2) 
     289         CALL usr_def_nam( cltxt2, clnam, jpiglo, jpjglo, jpkglo ) 
     290      ENDIF 
     291      jpk    = jpkglo 
     292      jpidta = jpiglo         !!gm  jpidta, jpjdta : to be suppressed 
     293      jpjdta = jpjglo         !!gm  together with jpizoom, jpjzoom and all associated variables...  
     294      ! 
    273295#if defined key_agrif 
    274    IF( .NOT. Agrif_Root() ) THEN 
    275       jpiglo  = nbcellsx + 2 + 2*nbghostcells 
    276       jpjglo  = nbcellsy + 2 + 2*nbghostcells 
    277       jpi     = ( jpiglo-2*jpreci + (jpni-1+0) ) / jpni + 2*jpreci 
    278       jpj     = ( jpjglo-2*jprecj + (jpnj-1+0) ) / jpnj + 2*jprecj 
    279       jpidta  = jpiglo 
    280       jpjdta  = jpjglo 
    281       jpizoom = 1 
    282       jpjzoom = 1 
    283       nperio  = 0 
    284       jperio  = 0 
    285       ln_use_jattr = .false. 
    286    ENDIF 
     296      IF( .NOT. Agrif_Root() ) THEN       ! AGRIF children: specific setting (cf. agrif_user.F90) 
     297         jpiglo  = nbcellsx + 2 + 2*nbghostcells 
     298         jpjglo  = nbcellsy + 2 + 2*nbghostcells 
     299         jpi     = ( jpiglo-2*jpreci + (jpni-1+0) ) / jpni + 2*jpreci 
     300         jpj     = ( jpjglo-2*jprecj + (jpnj-1+0) ) / jpnj + 2*jprecj 
     301         jpidta  = jpiglo 
     302         jpjdta  = jpjglo 
     303         jpizoom = 1 
     304         jpjzoom = 1 
     305         nperio  = 0 
     306         jperio  = 0 
     307         ln_use_jattr = .false. 
     308      ENDIF 
    287309#endif 
    288310      ! 
     
    298320            CALL xios_initialize( "not used",local_comm=ilocal_comm )    ! send nemo communicator to xios 
    299321         ELSE 
    300             CALL  xios_initialize( "for_xios_mpi_id",return_comm=ilocal_comm )    ! nemo local communicator given by xios 
     322            CALL xios_initialize( "for_xios_mpi_id",return_comm=ilocal_comm )    ! nemo local communicator given by xios 
    301323         ENDIF 
    302324      ENDIF 
     
    327349         WRITE( numond, namctl ) 
    328350         WRITE( numond, namcfg ) 
     351         IF( .NOT.ln_read_cfg ) THEN 
     352            DO ji = 1, SIZE(clnam) 
     353               IF( TRIM(clnam (ji)) /= '' )   WRITE(numond, * ) clnam(ji)    ! namusr_def print 
     354            END DO 
     355         ENDIF 
    329356      ENDIF 
    330357 
     
    341368      ENDIF 
    342369 
    343       ! Calculate domain dimensions given calculated jpni and jpnj 
    344       ! This used to be done in par_oce.F90 when they were parameters rather than variables 
    345       IF( Agrif_Root() ) THEN 
     370      IF( Agrif_Root() ) THEN       ! AGRIF mother: specific setting from jpni and jpnj 
    346371#if defined key_nemocice_decomp 
    347372         jpi = ( nx_global+2-2*jpreci + (jpni-1) ) / jpni + 2*jpreci    ! first  dim. 
     
    376401         WRITE(numout,*) 
    377402         DO ji = 1, SIZE(cltxt) 
    378             IF( TRIM(cltxt(ji)) /= '' )   WRITE(numout,*) cltxt(ji)      ! control print of mynode 
     403            IF( TRIM(cltxt (ji)) /= '' )   WRITE(numout,*) cltxt(ji)      ! control print of mynode 
    379404         END DO 
     405         WRITE(numout,*) 
     406         WRITE(numout,*) 
     407         DO ji = 1, SIZE(cltxt2) 
     408            IF( TRIM(cltxt2(ji)) /= '' )   WRITE(numout,*) cltxt2(ji)     ! control print of domain size 
     409         END DO 
     410         ! 
    380411         WRITE(numout,cform_aaa)                                         ! Flag AAAAAAA 
    381412         ! 
     
    390421      !                             !-------------------------------! 
    391422 
    392       CALL nemo_ctl                          ! Control prints & Benchmark 
     423      CALL nemo_ctl                          ! Control prints 
    393424 
    394425      !                                      ! Domain decomposition 
     
    519550      IF(lwp) THEN                  ! control print 
    520551         WRITE(numout,*) 
    521          WRITE(numout,*) 'nemo_ctl: Control prints & Benchmark' 
     552         WRITE(numout,*) 'nemo_ctl: Control prints' 
    522553         WRITE(numout,*) '~~~~~~~ ' 
    523554         WRITE(numout,*) '   Namelist namctl' 
     
    530561         WRITE(numout,*) '      number of proc. following i     nn_isplt   = ', nn_isplt 
    531562         WRITE(numout,*) '      number of proc. following j     nn_jsplt   = ', nn_jsplt 
    532          WRITE(numout,*) '      benchmark parameter (0/1)       nn_bench   = ', nn_bench 
    533563         WRITE(numout,*) '      timing activated    (0/1)       nn_timing  = ', nn_timing 
    534564      ENDIF 
     
    541571      isplt     = nn_isplt 
    542572      jsplt     = nn_jsplt 
    543       nbench    = nn_bench 
    544573 
    545574      IF(lwp) THEN                  ! control print 
     
    601630      ENDIF 
    602631      ! 
    603       IF( nbench == 1 ) THEN              ! Benchmark 
    604          SELECT CASE ( cp_cfg ) 
    605          CASE ( 'gyre' )   ;   CALL ctl_warn( ' The Benchmark is activated ' ) 
    606          CASE DEFAULT      ;   CALL ctl_stop( ' The Benchmark is based on the GYRE configuration:',   & 
    607             &                                 ' cp_cfg = "gyre" in namelist &namcfg or set nbench = 0' ) 
    608          END SELECT 
    609       ENDIF 
    610       ! 
    611632      IF( 1_wp /= SIGN(1._wp,-0._wp)  )   CALL ctl_stop( 'nemo_ctl: The intrinsec SIGN function follows ',  & 
    612633         &                                               'f2003 standard. '                              ,  & 
  • branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/NEMO/OPA_SRC/par_oce.F90

    r6422 r6595  
    3939 
    4040   ! global or zoom domain size                      !!! * computational domain * 
    41    INTEGER       ::   jpiglo           !: 1st dimension of global domain --> i 
    42    INTEGER       ::   jpjglo           !: 2nd    -                  -    --> j 
     41   INTEGER       ::   jpiglo           !: 1st dimension of global domain --> i-direction 
     42   INTEGER       ::   jpjglo           !: 2nd    -                  -    --> j-direction 
     43   INTEGER       ::   jpkglo           !: 3nd    -                  -    --> k levels 
    4344 
    4445   ! zoom starting position  
  • branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/NEMO/OPA_SRC/usrdef.F90

    r6593 r6595  
    88 
    99   !!---------------------------------------------------------------------- 
     10   !!   usr_def_nam       : read user defined namelist and set global domain size 
    1011   !!   usr_def_hgr       : initialize the horizontal mesh  
    1112   !!   usr_def_ini       : initial state  
    1213   !!---------------------------------------------------------------------- 
    13    USE step_oce       ! module used in the ocean time stepping module (step.F90) 
    14    USE mppini         ! shared/distributed memory setting (mpp_init routine)              
    15    USE phycst         ! physical constants  
     14   USE dom_oce  , ONLY: nimpp, njmpp       ! ocean space and time domain 
     15   USE par_oce        ! ocean space and time domain 
     16   USE phycst         ! physical constants 
     17   ! 
     18   USE in_out_manager ! I/O manager 
     19   USE lib_mpp        ! MPP library 
     20   USE timing         ! Timing 
     21    
    1622   IMPLICIT NONE 
    1723   PRIVATE 
    1824 
    19  
    20    PUBLIC usr_def_hgr 
    21    PUBLIC usr_def_ini 
     25   PUBLIC   usr_def_nam   ! called in nemogcm.F90 module 
     26   PUBLIC   usr_def_hgr   ! called in domhgr.F90  module 
     27   PUBLIC   usr_def_ini   ! called in istate.F90  module 
     28 
     29   !                      !!* namusr_def namelist *!! 
     30   LOGICAL ::   ln_bench   ! =T benchmark test with gyre: the gridsize is constant (no need to adjust timestep or viscosity) 
     31   INTEGER ::   nn_GYRE    ! 1/nn_GYRE = the resolution chosen in degrees and thus defining the horizontal domain size 
    2232 
    2333   !!---------------------------------------------------------------------- 
     
    2838CONTAINS 
    2939 
    30    SUBROUTINE usr_def_hgr( kbench, k_cfg , kff    , pff   , & ! Coriolis parameter  (if domain not on the sphere) 
    31       &                    pglamt, pglamu, pglamv , pglamf, & ! gridpoints position (required) 
    32       &                    pgphit, pgphiu, pgphiv , pgphif, & !          
    33       &                    pe1t  , pe1u  , pe1v   , pe1f  , & ! scale factors (required) 
    34       &                    pe2t  , pe2u  , pe2v   , pe2f  , & ! 
    35       &                    ke1e2u_v                       )   ! u- & v-surfaces (if gridsize reduction is used in strait(s)) 
     40   SUBROUTINE usr_def_nam( ldtxt, ldnam, kpi, kpj, kpk ) 
     41      !!---------------------------------------------------------------------- 
     42      !!                     ***  ROUTINE dom_nam  *** 
     43      !!                     
     44      !! ** Purpose :   read user defined namelist and define the domain size 
     45      !! 
     46      !! ** Method  :   read in namusr_def containing all the user specific namelist parameter 
     47      !! 
     48      !!                Here GYRE configuration 
     49      !! 
     50      !! ** input   : - namusr_def namelist found in namelist_cfg 
     51      !!---------------------------------------------------------------------- 
     52      CHARACTER(len=*), DIMENSION(:), INTENT(out) ::   ldtxt, ldnam    ! stored print information 
     53      INTEGER                       , INTENT(out) ::   kpi, kpj, kpk   ! global domain sizes  
     54      ! 
     55      INTEGER ::   ios, ii   ! Local integer 
     56      !! 
     57      NAMELIST/namusr_def/ nn_GYRE, ln_bench, jpkglo 
     58      !!---------------------------------------------------------------------- 
     59      ! 
     60      ii = 1 
     61      ! 
     62      REWIND( numnam_cfg )          ! Namelist namusr_def (exist in namelist_cfg only) 
     63      READ  ( numnam_cfg, namusr_def, IOSTAT = ios, ERR = 902 ) 
     64902   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namusr_def in configuration namelist', .TRUE. ) 
     65      ! 
     66!!gm  This does not work...  I don't know how to write namusr_def in "output.namelist.dyn" 
     67      WRITE( ldnam(ii), namusr_def ) 
     68      ! 
     69      kpi = 30 * nn_GYRE + 2        ! Global Domain size 
     70      kpj = 20 * nn_GYRE + 2 
     71      kpk = jpkglo 
     72      ! 
     73      !                             ! control print 
     74      WRITE(ldtxt(ii),*)                                                                              ;   ii = ii + 1 
     75      WRITE(ldtxt(ii),*) 'usr_def_nam  : read the user defined namelist (namusr_def) in namelist_cfg'     ;   ii = ii + 1 
     76      WRITE(ldtxt(ii),*) '~~~~~~~~~~~ '                                                                   ;   ii = ii + 1 
     77      WRITE(ldtxt(ii),*) '   Namelist namusr_def : GYRE case'                                             ;   ii = ii + 1 
     78      WRITE(ldtxt(ii),*) '      GYRE used as Benchmark (=T)                      ln_bench  = ', ln_bench  ;   ii = ii + 1 
     79      WRITE(ldtxt(ii),*) '      inverse resolution & implied domain size         nn_GYRE   = ', nn_GYRE   ;   ii = ii + 1 
     80      WRITE(ldtxt(ii),*) '         jpiglo = 30*nn_GYRE+2                            jpiglo = ', kpi       ;   ii = ii + 1 
     81      WRITE(ldtxt(ii),*) '         jpjglo = 20*nn_GYRE+2                            jpjglo = ', kpj       ;   ii = ii + 1 
     82      WRITE(ldtxt(ii),*) '      number of model levels                           jpkglo    = ', kpk       ;   ii = ii + 1 
     83      ! 
     84   END SUBROUTINE usr_def_nam 
     85 
     86 
     87   SUBROUTINE usr_def_hgr( plamt , plamu , plamv  , plamf  ,   &   ! geographic position (required) 
     88      &                    pphit , pphiu , pphiv  , pphif  ,   &   ! 
     89      &                    kff   , pff   ,                     &   ! Coriolis parameter  (if domain not on the sphere) 
     90      &                    pe1t  , pe1u  , pe1v   , pe1f   ,   &   ! scale factors       (required) 
     91      &                    pe2t  , pe2u  , pe2v   , pe2f   ,   &   ! 
     92      &                    ke1e2u_v      , pe1e2u , pe1e2v   )     ! u- & v-surfaces (if gridsize reduction is used in strait(s)) 
    3693      !!---------------------------------------------------------------------- 
    3794      !!                  ***  ROUTINE usr_def_hgr  *** 
     
    52109      !!              - define u- & v-surfaces (if gridsize reduction is used in some straits) (in m2) 
    53110      !!---------------------------------------------------------------------- 
    54       INTEGER                 , INTENT(in   ) ::   kbench, k_cfg   ! parameter of namelist for benchmark, and dimension of GYRE 
    55       INTEGER                 , INTENT(  out) ::   kff             ! =1 Coriolis parameter computed here, =0 otherwise 
    56       REAL(wp), DIMENSION(:,:), INTENT(  out) ::   pff             ! Coriolis factor at f-point                  [1/s] 
    57       REAL(wp), DIMENSION(:,:), INTENT(  out) ::   pglamt, pglamu, pglamv, pglamf !  longitude outputs        [degrees] 
    58       REAL(wp), DIMENSION(:,:), INTENT(  out) ::   pgphit, pgphiu, pgphiv, pgphif !  latitude outputs         [degrees] 
    59       REAL(wp), DIMENSION(:,:), INTENT(  out) ::   pe1t, pe1u, pe1v, pe1f   !  i-scale factors                      [m] 
    60       REAL(wp), DIMENSION(:,:), INTENT(  out) ::   pe2t, pe2u, pe2v, pe2f   !  j-scale factors                      [m] 
    61       INTEGER                 , INTENT(  out) ::   ke1e2u_v                 ! =1 u- & v-surfaces read here, =0 otherwise  
    62       !!------------------------------------------------------------------------------- 
     111      REAL(wp), DIMENSION(:,:), INTENT(out) ::   plamt, plamu, plamv, plamf   ! longitude outputs                     [degrees] 
     112      REAL(wp), DIMENSION(:,:), INTENT(out) ::   pphit, pphiu, pphiv, pphif   ! latitude outputs                      [degrees] 
     113      INTEGER                 , INTENT(out) ::   kff                          ! =1 Coriolis parameter computed here, =0 otherwise 
     114      REAL(wp), DIMENSION(:,:), INTENT(out) ::   pff                          ! Coriolis factor at f-point                [1/s] 
     115      REAL(wp), DIMENSION(:,:), INTENT(out) ::   pe1t, pe1u, pe1v, pe1f       ! i-scale factors                             [m] 
     116      REAL(wp), DIMENSION(:,:), INTENT(out) ::   pe2t, pe2u, pe2v, pe2f       ! j-scale factors                             [m] 
     117      INTEGER                 , INTENT(out) ::   ke1e2u_v                     ! =1 u- & v-surfaces computed here, =0 otherwise  
     118      REAL(wp), DIMENSION(:,:), INTENT(out) ::   pe1e2u, pe1e2v               ! u- & v-surfaces (if reduction in strait)   [m2] 
     119      ! 
    63120      INTEGER  ::   ji, jj               ! dummy loop indices 
    64121      REAL(wp) ::   zlam1, zlam0, zcos_alpha, zim1 , zjm1 , ze1  , ze1deg, zf0 ! local scalars 
    65       REAL(wp) ::   zphi1, zphi0, zsin_alpha, zim05, zjm05, zbeta, znorme      ! local scalars 
     122      REAL(wp) ::   zphi1, zphi0, zsin_alpha, zim05, zjm05, zbeta, znorme      !   -      - 
    66123      !!------------------------------------------------------------------------------- 
    67124      ! 
    68125      IF( nn_timing == 1 )  CALL timing_start('usr_def_hgr') 
    69126      ! 
    70       !==  beta-plane with regular grid-spacing and rotated domain ==! (GYRE configuration) 
     127      !     !==  beta-plane with regular grid-spacing and rotated domain ==! (GYRE configuration) 
    71128      ! 
    72129      IF(lwp) WRITE(numout,*) 
    73130      IF(lwp) WRITE(numout,*) '          beta-plane with regular grid-spacing and rotated domain (GYRE configuration)' 
    74131      ! 
    75       ! angle 45deg and ze1=106.e+3 / k_cfg forced -> zlam1 = -85deg, zphi1 = 29degN 
    76       zlam1 = -85._wp 
     132      !           !==  grid point position  ==! 
     133      ! 
     134      zlam1 = -85._wp                        ! position of gridpoint (i,j) = (1,jpjglo) 
    77135      zphi1 =  29._wp 
    78       ! resolution in meters 
    79       ze1 = 106000. / REAL( k_cfg , wp ) 
    80       zsin_alpha = - SQRT( 2._wp ) * 0.5_wp 
     136      ! 
     137      ze1 = 106000. / REAL( nn_GYRE , wp )   ! gridspacing in meters 
     138      ! 
     139      zsin_alpha = - SQRT( 2._wp ) * 0.5_wp  ! angle: 45 degrees 
    81140      zcos_alpha =   SQRT( 2._wp ) * 0.5_wp 
    82141      ze1deg = ze1 / (ra * rad) 
     
    84143      zphi0 = zphi1 + zsin_alpha * ze1deg * REAL( jpjglo-2 , wp ) 
    85144      !    
    86       IF( kbench == 1 )  ze1 = 106000._wp ! benchmark: forced the resolution to be about 100 km   
    87       !                                   ! but keep (lat,lon) at the right jp_cfg resolution 
     145      IF( ln_bench ) THEN     ! benchmark: forced the resolution to be 106 km  
     146         ze1 = 106000._wp     ! but keep (lat,lon) at the right nn_GYRE resolution 
     147         CALL ctl_warn( ' GYRE used as Benchmark: e1=e2=106km, no need to adjust rdt, ahm,aht ' ) 
     148      ENDIF 
    88149      IF( nprint==1 .AND. lwp )   THEN 
    89          WRITE(numout,*) '          ze1', ze1, 'cosalpha', zcos_alpha, 'sinalpha', zsin_alpha 
    90          WRITE(numout,*) '          ze1deg', ze1deg, 'zlam0', zlam0, 'zphi0', zphi0 
     150         WRITE(numout,*) 'ze1', ze1, 'cosalpha', zcos_alpha, 'sinalpha', zsin_alpha 
     151         WRITE(numout,*) 'ze1deg', ze1deg, 'zlam0', zlam0, 'zphi0', zphi0 
    91152      ENDIF 
    92153      !    
     
    98159            !glamt(i,j) longitude at T-point 
    99160            !gphit(i,j) latitude at T-point   
    100             pglamt(ji,jj) = zlam0 + zim05 * ze1deg * zcos_alpha + zjm05 * ze1deg * zsin_alpha 
    101             pgphit(ji,jj) = zphi0 - zim05 * ze1deg * zsin_alpha + zjm05 * ze1deg * zcos_alpha 
     161            plamt(ji,jj) = zlam0 + zim05 * ze1deg * zcos_alpha + zjm05 * ze1deg * zsin_alpha 
     162            pphit(ji,jj) = zphi0 - zim05 * ze1deg * zsin_alpha + zjm05 * ze1deg * zcos_alpha 
    102163            !    
    103164            !glamu(i,j) longitude at U-point 
    104165            !gphiu(i,j) latitude at U-point 
    105             pglamu(ji,jj) = zlam0 + zim1  * ze1deg * zcos_alpha + zjm05 * ze1deg * zsin_alpha 
    106             pgphiu(ji,jj) = zphi0 - zim1  * ze1deg * zsin_alpha + zjm05 * ze1deg * zcos_alpha 
     166            plamu(ji,jj) = zlam0 + zim1  * ze1deg * zcos_alpha + zjm05 * ze1deg * zsin_alpha 
     167            pphiu(ji,jj) = zphi0 - zim1  * ze1deg * zsin_alpha + zjm05 * ze1deg * zcos_alpha 
    107168            !    
    108169            !glamv(i,j) longitude at V-point 
    109170            !gphiv(i,j) latitude at V-point 
    110             pglamv(ji,jj) = zlam0 + zim05 * ze1deg * zcos_alpha + zjm1  * ze1deg * zsin_alpha 
    111             pgphiv(ji,jj) = zphi0 - zim05 * ze1deg * zsin_alpha + zjm1  * ze1deg * zcos_alpha 
     171            plamv(ji,jj) = zlam0 + zim05 * ze1deg * zcos_alpha + zjm1  * ze1deg * zsin_alpha 
     172            pphiv(ji,jj) = zphi0 - zim05 * ze1deg * zsin_alpha + zjm1  * ze1deg * zcos_alpha 
    112173            ! 
    113174            !glamf(i,j) longitude at F-point 
    114175            !gphif(i,j) latitude at F-point  
    115             pglamf(ji,jj) = zlam0 + zim1  * ze1deg * zcos_alpha + zjm1  * ze1deg * zsin_alpha 
    116             pgphif(ji,jj) = zphi0 - zim1  * ze1deg * zsin_alpha + zjm1  * ze1deg * zcos_alpha 
     176            plamf(ji,jj) = zlam0 + zim1  * ze1deg * zcos_alpha + zjm1  * ze1deg * zsin_alpha 
     177            pphif(ji,jj) = zphi0 - zim1  * ze1deg * zsin_alpha + zjm1  * ze1deg * zcos_alpha 
    117178         END DO 
    118179      END DO 
    119180      ! 
    120       !       !== Horizontal scale factors ==! (in meters) 
     181      !           !== Horizontal scale factors ==! (in meters) 
    121182      !                      
    122183      !                             ! constant grid spacing 
     
    125186      pe1v(:,:) =  ze1     ;      pe2v(:,:) = ze1 
    126187      pe1f(:,:) =  ze1     ;      pe2f(:,:) = ze1 
     188      ! 
    127189      !                             ! NO reduction of grid size in some straits  
    128190      ke1e2u_v = 0                  !    ==>> u_ & v_surfaces will be computed in dom_ghr routine 
    129191      ! 
    130192      ! 
    131  
    132       !                      !==  Coriolis parameter  ==! 
    133       kff = 1                                                           !  indicate not to compute ff afterward 
    134       ! 
    135       zbeta = 2. * omega * COS( rad * zphi1 ) / ra                      ! beta at latitude zphi1 
    136       !SF we overwrite zphi0 (south point in latitude) used just above to define pgphif (value of zphi0=15.5190567531966) 
    137       !SF for computation of coriolis we keep the parameter of Hazeleger, W., and S. S. Drijfhout, JPO 1998. 
    138       zphi0 = 15._wp                                                    !  latitude of the most southern grid point   
    139       zf0   = 2. * omega * SIN( rad * zphi0 )                           !  compute f0 1st point south 
    140       ! 
    141       pff(:,:) = ( zf0 + zbeta * ABS( gphif(:,:) - zphi0 ) * rad * ra ) ! f = f0 +beta* y ( y=0 at south) 
     193      !           !==  Coriolis parameter  ==! 
     194      kff = 1                                            !  indicate not to compute ff afterward 
     195      ! 
     196      zbeta = 2. * omega * COS( rad * zphi1 ) / ra       ! beta at latitude zphi1 
     197      !SF we overwrite zphi0 (south point in latitude) used just above to define pphif (value of zphi0=15.5190567531966) 
     198      !SF for computation of Coriolis we keep the parameter of Hazeleger, W., and S. S. Drijfhout, JPO 1998. 
     199      zphi0 = 15._wp                                     !  latitude of the most southern grid point   
     200      zf0   = 2. * omega * SIN( rad * zphi0 )            !  compute f0 1st point south 
     201      ! 
     202      pff(:,:) = ( zf0 + zbeta * ABS( pphif(:,:) - zphi0 ) * rad * ra ) ! f = f0 +beta* y ( y=0 at south) 
    142203      ! 
    143204      IF(lwp) WRITE(numout,*) '                           beta-plane used. beta = ', zbeta, ' 1/(s.m)' 
     
    148209 
    149210 
    150    SUBROUTINE usr_def_zgr()           ! Coriolis parameter  (if domain not on the sphere) 
     211   SUBROUTINE usr_def_zgr() 
    151212       ! subroutine for vertical grid 
    152213   END SUBROUTINE usr_def_zgr 
     
    163224      !!              - set salinity   field 
    164225      !!---------------------------------------------------------------------- 
     226      USE dom_oce, ONLY : gdept_0, tmask 
    165227      REAL(wp), DIMENSION(jpi,jpj,jpk,jpts), INTENT(  out) ::   pts   ! T & S data 
    166228      ! 
     
    170232      IF(lwp) WRITE(numout,*) 
    171233      IF(lwp) WRITE(numout,*) 'usr_def_ini : analytical definition of initial state ' 
    172       IF(lwp) WRITE(numout,*) '              T and S profiles deduced from LEVITUS ' 
    173       IF(lwp) WRITE(numout,*) '~~~~~~~~~~~' 
     234      IF(lwp) WRITE(numout,*) '~~~~~~~~~~~   T and S profiles deduced from LEVITUS ' 
    174235      ! 
    175236      DO jk = 1, jpk 
    176237         DO jj = 1, jpj 
    177238            DO ji = 1, jpi 
    178                pts(ji,jj,jk,jp_tem) =  (  (  16. - 12. * TANH( (gdept_n(ji,jj,jk) - 400) / 700 ) )   & 
    179                     &           * (-TANH( (500-gdept_n(ji,jj,jk)) / 150 ) + 1) / 2               & 
    180                     &           + ( 15. * ( 1. - TANH( (gdept_n(ji,jj,jk)-50.) / 1500.) )        & 
    181                     &           - 1.4 * TANH((gdept_n(ji,jj,jk)-100.) / 100.)                    & 
    182                     &           + 7.  * (1500. - gdept_n(ji,jj,jk)) / 1500.)                     & 
    183                     &           * (-TANH( (gdept_n(ji,jj,jk) - 500) / 150) + 1) / 2  ) * tmask(ji,jj,jk) 
    184  
    185                pts(ji,jj,jk,jp_sal) =  (  (  36.25 - 1.13 * TANH( (gdept_n(ji,jj,jk) - 305) / 460 ) )  & 
    186                     &         * (-TANH((500 - gdept_n(ji,jj,jk)) / 150) + 1) / 2              & 
    187                     &         + ( 35.55 + 1.25 * (5000. - gdept_n(ji,jj,jk)) / 5000.          & 
    188                     &         - 1.62 * TANH( (gdept_n(ji,jj,jk) - 60.  ) / 650. )             & 
    189                     &         + 0.2  * TANH( (gdept_n(ji,jj,jk) - 35.  ) / 100. )             & 
    190                     &         + 0.2  * TANH( (gdept_n(ji,jj,jk) - 1000.) / 5000.) )           & 
    191                     &         * (-TANH((gdept_n(ji,jj,jk) - 500) / 150) + 1) / 2  ) * tmask(ji,jj,jk) 
     239               pts(ji,jj,jk,jp_tem) =  (  (  16. - 12. * TANH( (gdept_0(ji,jj,jk) - 400) / 700 ) )   & 
     240                    &           * (-TANH( (500-gdept_0(ji,jj,jk)) / 150. ) + 1.) / 2.               & 
     241                    &           + ( 15. * ( 1. - TANH( (gdept_0(ji,jj,jk)-50.) / 1500.) )        & 
     242                    &           - 1.4 * TANH((gdept_0(ji,jj,jk)-100.) / 100.)                    & 
     243                    &           + 7.  * (1500. - gdept_0(ji,jj,jk) ) / 1500.)                     & 
     244                    &           * (-TANH( (gdept_0(ji,jj,jk) - 500.) / 150.) + 1.) / 2.  ) * tmask(ji,jj,jk) 
     245 
     246               pts(ji,jj,jk,jp_sal) =  (  (  36.25 - 1.13 * TANH( (gdept_0(ji,jj,jk) - 305) / 460 ) )  & 
     247                    &         * (-TANH((500. - gdept_0(ji,jj,jk)) / 150.) + 1.) / 2              & 
     248                    &         + ( 35.55 + 1.25 * (5000. - gdept_0(ji,jj,jk)) / 5000.          & 
     249                    &         - 1.62 * TANH( (gdept_0(ji,jj,jk) - 60.  ) / 650. )             & 
     250                    &         + 0.2  * TANH( (gdept_0(ji,jj,jk) - 35.  ) / 100. )             & 
     251                    &         + 0.2  * TANH( (gdept_0(ji,jj,jk) - 1000.) / 5000.) )           & 
     252                    &         * (-TANH((gdept_0(ji,jj,jk) - 500.) / 150.) + 1.) / 2  ) * tmask(ji,jj,jk) 
    192253            END DO 
    193254         END DO 
  • branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/NEMO/OPA_SRC/usrdef_sbc.F90

    r6583 r6595  
    1515   USE sbc_oce         ! Surface boundary condition: ocean fields 
    1616   USE phycst          ! physical constants 
     17   ! 
    1718   USE in_out_manager  ! I/O manager 
    1819   USE lib_mpp         ! distribued memory computing library 
    1920   USE lbclnk          ! ocean lateral boundary conditions (or mpp link) 
    20    USE lib_fortran 
     21   USE lib_fortran     ! 
    2122 
    2223   IMPLICIT NONE 
     
    4950      !! Reference : Hazeleger, W., and S. Drijfhout, JPO, 30, 677-695, 2000. 
    5051      !!---------------------------------------------------------------------- 
    51       INTEGER, INTENT(in) ::   kt          ! ocean time step 
     52      INTEGER, INTENT(in) ::   kt   ! ocean time step 
    5253      !! 
    5354      INTEGER  ::   ji, jj                 ! dummy loop indices 
     
    109110            ! and 13 degC at 50N 53.5 + or - 11 = 1/4 period : 
    110111            ! 64.5 in summer, 42.5 in winter 
    111             t_star = zTstar * ( 1 + 1. / 50. * zcos_sais2 )                & 
     112            t_star = zTstar * ( 1. + 1. / 50. * zcos_sais2 )                & 
    112113               &                    * COS( rpi * (gphit(ji,jj) - 5.)               & 
    113114               &                    / ( 53.5 * ( 1 + 11 / 53.5 * zcos_sais2 ) * 2.) ) 
     
    127128      END DO 
    128129 
    129       ! Compute the emp flux such as its integration on the whole domain at each time is zero 
    130       IF( nbench /= 1 ) THEN 
    131          zsumemp = GLOB_SUM( emp(:,:) )  
    132          zsurf   = GLOB_SUM( tmask(:,:,1) )  
    133          ! Default GYRE configuration 
    134          zsumemp = zsumemp / zsurf 
    135       ELSE 
    136          ! Benchmark GYRE configuration (to allow the bit to bit comparison between Mpp/Mono case) 
    137          zsumemp = 0.e0   ;    zsurf = 0.e0 
    138       ENDIF 
     130!!gm  ===>>> The following lines are to be de-commented 
     131!!    Commented here as they change the GYRE results  
     132!#if !defined key_mpp_rep 
     133!      CALL ctl_stop( 'usr_def_sbc: key_mpp_rep is required to run GYRE configuration') 
     134!#endif 
     135!!gm 
     136 
     137      zsumemp = GLOB_SUM( emp  (:,:)   )  
     138      zsurf   = GLOB_SUM( tmask(:,:,1) )  
     139      zsumemp = zsumemp / zsurf         ! Default GYRE configuration 
    139140 
    140141      ! freshwater (mass flux) and update of qns with heat content of emp 
Note: See TracChangeset for help on using the changeset viewer.