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 7646 for trunk/NEMOGCM/NEMO/SAS_SRC – NEMO

Ignore:
Timestamp:
2017-02-06T10:25:03+01:00 (7 years ago)
Author:
timgraham
Message:

Merge of dev_merge_2016 into trunk. UPDATE TO ARCHFILES NEEDED for XIOS2.
LIM_SRC_s/limrhg.F90 to follow in next commit due to change of kind (I'm unable to do it in this commit).
Merged using the following steps:

1) svn merge --reintegrate svn+ssh://forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/trunk .
2) Resolve minor conflicts in sette.sh and namelist_cfg for ORCA2LIM3 (due to a change in trunk after branch was created)
3) svn commit
4) svn switch svn+ssh://forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/trunk
5) svn merge svn+ssh://forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/branches/2016/dev_merge_2016 .
6) At this stage I checked out a clean copy of the branch to compare against what is about to be committed to the trunk.
6) svn commit #Commit code to the trunk

In this commit I have also reverted a change to Fcheck_archfile.sh which was causing problems on the Paris machine.

Location:
trunk/NEMOGCM/NEMO/SAS_SRC
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMOGCM/NEMO/SAS_SRC/daymod.F90

    r6140 r7646  
    268268 
    269269      ! since we no longer call rst_opn, need to define nitrst here, used by ice restart routine 
    270       IF( kt == nit000 ) nitrst = nitend 
     270      IF( kt == nit000 )  THEN 
     271         nitrst = nitend 
     272         lrst_oce = .FALSE.  ! init restart ocean (done in rst_opn when not SAS) 
     273      ENDIF 
     274 
    271275      IF( MOD( kt - 1, nstock ) == 0 ) THEN 
    272276         ! we use kt - 1 and not kt - nit000 to keep the same periodicity from the beginning of the experiment 
  • trunk/NEMOGCM/NEMO/SAS_SRC/diawri.F90

    r6140 r7646  
    3636   USE lbclnk          ! ocean lateral boundary conditions (or mpp link) 
    3737   USE in_out_manager  ! I/O manager 
    38    USE diaar5, ONLY :   lk_diaar5 
    3938   USE iom 
    4039   USE ioipsl 
  • trunk/NEMOGCM/NEMO/SAS_SRC/nemogcm.F90

    r6165 r7646  
    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-11  (C. Harris) decomposition changes for running with CICE 
     6   !! History :  3.6  ! 2011-11  (S. Alderson, G. Madec) original code 
     7   !!             -   ! 2013-06  (I. Epicoco, S. Mocavero, CMCC) nemo_northcomms: setup avoiding MPI communication  
     8   !!             -   ! 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 
    3110   !!---------------------------------------------------------------------- 
    3211 
    3312   !!---------------------------------------------------------------------- 
    34    !!   nemo_gcm       : solve ocean dynamics, tracer, biogeochemistry and/or sea-ice 
    35    !!   nemo_init      : initialization of the NEMO system 
    36    !!   nemo_ctl       : initialisation of the contol print  
    37    !!   nemo_closefile : close remaining open files 
    38    !!   nemo_alloc     : dynamical allocation 
    39    !!   nemo_partition : calculate MPP domain decomposition 
    40    !!   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 
    4120   !!---------------------------------------------------------------------- 
    42    USE step_oce        ! module used in the ocean time stepping module 
    43    USE sbc_oce         ! surface boundary condition: ocean 
    44    USE domcfg          ! domain configuration               (dom_cfg routine) 
    45    USE daymod          ! calendar 
    46    USE mppini          ! shared/distributed memory setting (mpp_init routine) 
    47    USE domain          ! domain initialization             (dom_init routine) 
    48    USE phycst          ! physical constant                  (par_cst routine) 
    49    USE step            ! NEMO time-stepping                 (stp     routine) 
    50    USE lib_mpp         ! distributed memory computing 
    51 #if defined key_nosignedzero 
    52    USE lib_fortran     ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined) 
    53 #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 icbini         ! handle bergs, initialisation 
     31   USE icbstp         ! handle bergs, calving, themodynamics and transport 
     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   ! 
     35   USE lib_mpp        ! distributed memory computing 
     36   USE mppini         ! shared/distributed memory setting (mpp_init routine) 
     37   USE lbcnfd   , ONLY: isendto, nsndto, nfsloop, nfeloop ! Setup of north fold exchanges 
     38   USE lib_fortran    ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined) 
    5439#if defined key_iomput 
    55    USE xios 
    56 #endif 
    57    USE cpl_oasis3 
    58    USE sbcssm 
    59    USE lbcnfd, ONLY: isendto, nsndto, nfsloop, nfeloop ! Setup of north fold exchanges 
    60    USE icbstp          ! handle bergs, calving, themodynamics and transport 
    61 #if defined key_bdy 
    62    USE bdyini          ! open boundary cond. setting       (bdy_init routine). clem: mandatory for LIM3 
    63    USE bdydta          ! open boundary cond. setting   (bdy_dta_init routine). clem: mandatory for LIM3 
    64 #endif 
    65    USE bdy_par 
     40   USE xios           ! xIOserver 
     41#endif 
    6642 
    6743   IMPLICIT NONE 
     
    7450 
    7551   !!---------------------------------------------------------------------- 
    76    !! NEMO/OPA 4.0 , NEMO Consortium (2011) 
     52   !! NEMO/OPA 4.0 , NEMO Consortium (2016) 
    7753   !! $Id$ 
    7854   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt) 
     
    8460      !!                     ***  ROUTINE nemo_gcm  *** 
    8561      !! 
    86       !! ** Purpose :   NEMO solves the primitive equations on an orthogonal  
     62      !! ** Purpose :   NEMO solves the primitive equations on an orthogonal 
    8763      !!              curvilinear mesh on the sphere. 
    8864      !! 
     
    9470      !!              Madec, 2008, internal report, IPSL. 
    9571      !!---------------------------------------------------------------------- 
    96       INTEGER ::   istp       ! time step index 
     72      INTEGER ::   istp   ! time step index 
    9773      !!---------------------------------------------------------------------- 
    9874      ! 
    9975#if defined key_agrif 
    100       CALL Agrif_Init_Grids()      ! AGRIF: set the meshes 
    101 #endif 
    102  
     76     CALL Agrif_Init_Grids()      ! AGRIF: set the meshes 
     77#endif 
     78      ! 
    10379      !                            !-----------------------! 
    10480      CALL nemo_init               !==  Initialisations  ==! 
     
    11389      CALL Agrif_Declare_Var_lim2  !  "      "   "   "      "  LIM 
    11490# endif 
     91# if defined key_lim3 
     92      CALL Agrif_Declare_Var_lim3  !  "      "   "   "      "  LIM3 
     93# endif 
    11594#endif 
    11695      ! check that all process are still there... If some process have an error, 
     
    124103      !                            !-----------------------! 
    125104      istp = nit000 
    126          
     105#if defined key_agrif 
     106      CALL Agrif_Regrid() 
     107#endif 
     108 
    127109      DO WHILE ( istp <= nitend .AND. nstop == 0 ) 
    128110#if defined key_agrif 
    129          CALL Agrif_Step( stp )           ! AGRIF: time stepping 
     111         CALL stp                         ! AGRIF: time stepping 
    130112#else 
    131          CALL stp( istp )                 ! standard time stepping 
     113         IF ( .NOT. ln_diurnal_only ) THEN 
     114            CALL stp( istp )                 ! standard time stepping 
     115         ELSE 
     116            CALL stp_diurnal( istp )        ! time step only the diurnal SST 
     117         ENDIF  
    132118#endif 
    133119         istp = istp + 1 
    134120         IF( lk_mpp )   CALL mpp_max( nstop ) 
    135       END DO 
     121         END DO 
    136122      ! 
    137123      IF( ln_icebergs )   CALL icb_end( nitend ) 
     
    140126      !                            !==  finalize the run  ==! 
    141127      !                            !------------------------! 
    142       IF(lwp) WRITE(numout,cform_aaa)   ! Flag AAAAAAA 
    143       ! 
    144       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 
    145131         WRITE(numout,cform_err) 
    146          WRITE(numout,*) nstop, ' error have been found'  
     132         WRITE(numout,*) nstop, ' error have been found' 
    147133      ENDIF 
    148134      ! 
    149135#if defined key_agrif 
    150       CALL Agrif_ParentGrid_To_ChildGrid() 
     136      IF( .NOT. Agrif_Root() ) THEN 
     137         CALL Agrif_ParentGrid_To_ChildGrid() 
     138         IF( nn_timing == 1 )   CALL timing_finalize 
     139         CALL Agrif_ChildGrid_To_ParentGrid() 
     140      ENDIF 
     141#endif 
    151142      IF( nn_timing == 1 )   CALL timing_finalize 
    152       CALL Agrif_ChildGrid_To_ParentGrid() 
    153 #endif 
    154       IF( nn_timing == 1 )   CALL timing_finalize 
    155143      ! 
    156144      CALL nemo_closefile 
    157145      ! 
    158146#if defined key_iomput 
    159       CALL xios_finalize                ! end mpp communications with xios 
    160       IF( lk_oasis ) CALL cpl_finalize    ! end coupling and mpp communications with OASIS 
     147      CALL xios_finalize                     ! end mpp communications with xios 
     148      IF( lk_oasis )   CALL cpl_finalize     ! end coupling and mpp communications with OASIS 
    161149#else 
    162150      IF( lk_oasis ) THEN  
    163          CALL cpl_finalize              ! end coupling and mpp communications with OASIS 
     151         CALL cpl_finalize                   ! end coupling and mpp communications with OASIS 
    164152      ELSE 
    165          IF( lk_mpp )   CALL mppstop    ! end mpp communications 
     153         IF( lk_mpp )   CALL mppstop         ! end mpp communications 
    166154      ENDIF 
    167155#endif 
     
    176164      !! ** Purpose :   initialization of the NEMO GCM 
    177165      !!---------------------------------------------------------------------- 
    178       INTEGER ::   ji            ! dummy loop indices 
    179       INTEGER ::   ilocal_comm   ! local integer       
    180       INTEGER ::   ios 
    181       CHARACTER(len=80), DIMENSION(16) ::   cltxt 
    182       CHARACTER(len=80) ::   clname 
    183       ! 
    184       NAMELIST/namctl/ ln_ctl  , nn_print, nn_ictls, nn_ictle,   & 
    185          &             nn_isplt, nn_jsplt, nn_jctls, nn_jctle,   & 
    186          &             nn_bench, nn_timing, nn_diacfl 
    187       NAMELIST/namcfg/ cp_cfg, cp_cfz, jp_cfg, jpidta, jpjdta, jpkdta, jpiglo, jpjglo, & 
    188          &             jpizoom, jpjzoom, jperio, ln_use_jattr 
    189       !!---------------------------------------------------------------------- 
    190       ! 
    191       cltxt = '' 
     166      INTEGER  ::   ji            ! dummy loop indices 
     167      INTEGER  ::   ilocal_comm   ! local integer 
     168      INTEGER  ::   ios, inum     !   -      - 
     169      CHARACTER(len=120), DIMENSION(30) ::   cltxt, cltxt2, clnam 
     170      CHARACTER(len=80)                 ::   clname 
     171      ! 
     172      NAMELIST/namctl/ ln_ctl   , nn_print, nn_ictls, nn_ictle,   & 
     173         &             nn_isplt , nn_jsplt, nn_jctls, nn_jctle,   & 
     174         &             nn_timing, nn_diacfl 
     175      NAMELIST/namcfg/ ln_read_cfg, cn_domcfg, ln_write_cfg, cn_domcfg_out, ln_use_jattr 
     176      !!---------------------------------------------------------------------- 
     177      ! 
     178      cltxt  = '' 
     179      cltxt2 = '' 
     180      clnam  = ''   
     181      cxios_context = 'nemo' 
    192182      ! 
    193183      !                             ! Open reference namelist and configuration namelist files 
     
    204194   ENDIF 
    205195      ! 
    206       REWIND( numnam_ref )              ! Namelist namctl in reference namelist : Control prints & Benchmark 
     196      REWIND( numnam_ref )              ! Namelist namctl in reference namelist : Control prints 
    207197      READ  ( numnam_ref, namctl, IOSTAT = ios, ERR = 901 ) 
    208198901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namctl in reference namelist', .TRUE. ) 
    209  
    210       REWIND( numnam_cfg )              ! Namelist namctl in confguration namelist : Control prints & Benchmark 
     199      ! 
     200      REWIND( numnam_cfg )              ! Namelist namctl in confguration namelist 
    211201      READ  ( numnam_cfg, namctl, IOSTAT = ios, ERR = 902 ) 
    212202902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namctl in configuration namelist', .TRUE. ) 
    213  
    214       ! 
    215       REWIND( numnam_ref )              ! Namelist namcfg in reference namelist : Control prints & Benchmark 
     203      ! 
     204      REWIND( numnam_ref )              ! Namelist namcfg in reference namelist : Control prints 
    216205      READ  ( numnam_ref, namcfg, IOSTAT = ios, ERR = 903 ) 
    217206903   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namcfg in reference namelist', .TRUE. ) 
     
    221210904   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namcfg in configuration namelist', .TRUE. )    
    222211 
    223 ! Force values for AGRIF zoom (cf. agrif_user.F90) 
     212      !                             !--------------------------! 
     213      !                             !  Set global domain size  !   (control print return in cltxt2) 
     214      !                             !--------------------------! 
     215      IF( ln_read_cfg ) THEN              ! Read sizes in domain configuration file 
     216         CALL domain_cfg ( cltxt2,        cn_cfg, nn_cfg, jpiglo, jpjglo, jpkglo, jperio ) 
     217         ! 
     218      ELSE                                ! user-defined namelist 
     219         CALL usr_def_nam( cltxt2, clnam, cn_cfg, nn_cfg, jpiglo, jpjglo, jpkglo, jperio ) 
     220      ENDIF 
     221      ! 
     222      jpk = jpkglo 
     223      ! 
    224224#if defined key_agrif 
    225    IF( .NOT. Agrif_Root() ) THEN 
    226       jpiglo  = nbcellsx + 2 + 2*nbghostcells 
    227       jpjglo  = nbcellsy + 2 + 2*nbghostcells 
    228       jpi     = ( jpiglo-2*jpreci + (jpni-1+0) ) / jpni + 2*jpreci 
    229       jpj     = ( jpjglo-2*jprecj + (jpnj-1+0) ) / jpnj + 2*jprecj 
    230       jpidta  = jpiglo 
    231       jpjdta  = jpjglo 
    232       jpizoom = 1 
    233       jpjzoom = 1 
    234       nperio  = 0 
    235       jperio  = 0 
    236       ln_use_jattr = .false. 
    237    ENDIF 
     225      IF( .NOT. Agrif_Root() ) THEN       ! AGRIF children: specific setting (cf. agrif_user.F90) 
     226         jpiglo  = nbcellsx + 2 + 2*nbghostcells 
     227         jpjglo  = nbcellsy + 2 + 2*nbghostcells 
     228         jpi     = ( jpiglo-2*jpreci + (jpni-1+0) ) / jpni + 2*jpreci 
     229         jpj     = ( jpjglo-2*jprecj + (jpnj-1+0) ) / jpnj + 2*jprecj 
     230         nperio  = 0 
     231         jperio  = 0 
     232         ln_use_jattr = .false. 
     233      ENDIF 
    238234#endif 
    239235      ! 
     
    249245            CALL xios_initialize( "not used",local_comm=ilocal_comm )    ! send nemo communicator to xios 
    250246         ELSE 
    251             CALL xios_initialize( "for_xios_mpi_id",return_comm=ilocal_comm )        ! nemo local communicator given by xios 
     247            CALL xios_initialize( "for_xios_mpi_id",return_comm=ilocal_comm )    ! nemo local communicator given by xios 
    252248         ENDIF 
    253249      ENDIF 
     
    264260      ENDIF 
    265261#endif 
     262 
    266263      narea = narea + 1                                     ! mynode return the rank of proc (0 --> jpnij -1 ) 
    267264 
     
    269266      lwp = (narea == 1) .OR. ln_ctl                        ! control of all listing output print 
    270267 
    271       IF(lwm) THEN 
    272          ! write merged namelists from earlier to output namelist now that the 
    273          ! file has been opened in call to mynode. nammpp has already been 
    274          ! written in mynode (if lk_mpp_mpi) 
     268      IF(lwm) THEN               ! write merged namelists from earlier to output namelist  
     269         !                       ! now that the file has been opened in call to mynode.  
     270         !                       ! NB: nammpp has already been written in mynode (if lk_mpp_mpi) 
    275271         WRITE( numond, namctl ) 
    276272         WRITE( numond, namcfg ) 
    277       ENDIF 
    278  
    279       ! If dimensions of processor grid weren't specified in the namelist file  
     273         IF( .NOT.ln_read_cfg ) THEN 
     274            DO ji = 1, SIZE(clnam) 
     275               IF( TRIM(clnam(ji)) /= '' )   WRITE(numond, * ) clnam(ji)     ! namusr_def print 
     276            END DO 
     277         ENDIF 
     278      ENDIF 
     279 
     280      ! If dimensions of processor grid weren't specified in the namelist file 
    280281      ! then we calculate them here now that we have our communicator size 
    281       IF( (jpni < 1) .OR. (jpnj < 1) )THEN 
     282      IF( jpni < 1 .OR. jpnj < 1 ) THEN 
    282283#if   defined key_mpp_mpi 
    283          IF( Agrif_Root() ) CALL nemo_partition(mppsize) 
     284         IF( Agrif_Root() )   CALL nemo_partition( mppsize ) 
    284285#else 
    285286         jpni  = 1 
     
    287288         jpnij = jpni*jpnj 
    288289#endif 
    289       END IF 
    290  
    291       ! Calculate domain dimensions given calculated jpni and jpnj 
    292       ! This used to be done in par_oce.F90 when they were parameters rather 
    293       ! than variables 
    294       IF( Agrif_Root() ) THEN 
     290      ENDIF 
     291 
     292      IF( Agrif_Root() ) THEN       ! AGRIF mother: specific setting from jpni and jpnj 
    295293#if defined key_nemocice_decomp 
    296          jpi = ( nx_global+2-2*jpreci + (jpni-1) ) / jpni + 2*jpreci ! first  dim. 
    297          jpj = ( ny_global+2-2*jprecj + (jpnj-1) ) / jpnj + 2*jprecj ! second dim.  
     294         jpi = ( nx_global+2-2*jpreci + (jpni-1) ) / jpni + 2*jpreci    ! first  dim. 
     295         jpj = ( ny_global+2-2*jprecj + (jpnj-1) ) / jpnj + 2*jprecj    ! second dim.  
    298296#else 
    299          jpi = ( jpiglo-2*jpreci + (jpni-1) ) / jpni + 2*jpreci   ! first  dim. 
    300          jpj = ( jpjglo-2*jprecj + (jpnj-1) ) / jpnj + 2*jprecj   ! second dim. 
    301 #endif 
    302       ENDIF 
    303          jpk = jpkdta                                             ! third dim 
    304          jpim1 = jpi-1                                            ! inner domain indices 
    305          jpjm1 = jpj-1                                            !   "           " 
    306          jpkm1 = jpk-1                                            !   "           " 
    307          jpij  = jpi*jpj                                          !  jpi x j 
     297         jpi = ( jpiglo     -2*jpreci + (jpni-1) ) / jpni + 2*jpreci    ! first  dim. 
     298         jpj = ( jpjglo     -2*jprecj + (jpnj-1) ) / jpnj + 2*jprecj    ! second dim. 
     299#endif 
     300      ENDIF 
     301 
     302#if defined key_agrif 
     303      ! simple trick to use same vertical grid as parent but different number of levels:  
     304      ! Save maximum number of levels in jpkglo, then define all vertical grids with this number. 
     305      ! Suppress once vertical online interpolation is ok 
     306      IF(.NOT.Agrif_Root())   jpkglo = Agrif_Parent( jpkglo ) 
     307#endif 
     308      jpim1 = jpi-1                                            ! inner domain indices 
     309      jpjm1 = jpj-1                                            !   "           " 
     310      jpkm1 = jpk-1                                            !   "           " 
     311      jpij  = jpi*jpj                                          !  jpi x j 
    308312 
    309313      IF(lwp) THEN                            ! open listing units 
     
    319323         WRITE(numout,*) '                       NEMO team' 
    320324         WRITE(numout,*) '            Ocean General Circulation Model' 
    321          WRITE(numout,*) '                  version 3.6  (2015) ' 
     325         WRITE(numout,*) '                  version 3.7  (2016) ' 
    322326         WRITE(numout,*) '             StandAlone Surface version (SAS) ' 
    323327         WRITE(numout,*) 
    324328         WRITE(numout,*) 
    325          DO ji = 1, SIZE(cltxt)  
    326             IF( TRIM(cltxt(ji)) /= '' )   WRITE(numout,*) cltxt(ji)      ! control print of mynode 
     329         DO ji = 1, SIZE(cltxt) 
     330            IF( TRIM(cltxt (ji)) /= '' )   WRITE(numout,*) cltxt(ji)    ! control print of mynode 
    327331         END DO 
    328          WRITE(numout,cform_aaa)                                         ! Flag AAAAAAA 
     332         WRITE(numout,*) 
     333         WRITE(numout,*) 
     334         DO ji = 1, SIZE(cltxt2) 
     335            IF( TRIM(cltxt2(ji)) /= '' )   WRITE(numout,*) cltxt2(ji)   ! control print of domain size 
     336         END DO 
    329337         ! 
    330       ENDIF 
    331  
    332       ! Now we know the dimensions of the grid and numout has been set we can  
    333       ! allocate arrays 
     338         WRITE(numout,cform_aaa)                                        ! Flag AAAAAAA 
     339         ! 
     340      ENDIF 
     341 
     342      ! Now we know the dimensions of the grid and numout has been set: we can allocate arrays 
    334343      CALL nemo_alloc() 
    335  
    336344      !                             !-------------------------------! 
    337345      !                             !  NEMO general initialization  ! 
    338346      !                             !-------------------------------! 
    339347 
    340       CALL nemo_ctl                          ! Control prints & Benchmark 
     348      CALL nemo_ctl                          ! Control prints 
    341349 
    342350      !                                      ! Domain decomposition 
     
    350358                            CALL phy_cst    ! Physical constants 
    351359                            CALL eos_init   ! Equation of state 
    352                             CALL dom_cfg    ! Domain configuration 
    353360                            CALL dom_init   ! Domain 
    354361 
    355       IF( ln_nnogather )    CALL nemo_northcomms   ! Initialise the northfold neighbour lists (must be done after the masks are defined) 
    356  
    357       IF( ln_ctl        )   CALL prt_ctl_init   ! Print control 
     362     IF( ln_nnogather )     CALL nemo_northcomms   ! Initialise the northfold neighbour lists (must be done after the masks are defined) 
     363 
     364      IF( ln_ctl         CALL prt_ctl_init   ! Print control 
    358365                            CALL day_init   ! model calendar (using both namelist and restart infos) 
    359366 
    360367                            CALL sbc_init   ! Forcings : surface module  
    361                              
     368 
    362369      ! ==> clem: open boundaries init. is mandatory for LIM3 because ice BDY is not decoupled from   
    363370      !           the environment of ocean BDY. Therefore bdy is called in both OPA and SAS modules.  
    364371      !           This is not clean and should be changed in the future.  
    365       IF( lk_bdy        )   CALL     bdy_init 
    366       IF( lk_bdy        )   CALL bdy_dta_init 
     372                            CALL     bdy_init 
    367373      ! ==> 
     374                            CALL icb_init( rdt, nit000)   ! initialise icebergs instance 
    368375       
    369376      IF(lwp) WRITE(numout,*) 'Euler time step switch is ', neuler 
     
    383390      IF(lwp) THEN                  ! control print 
    384391         WRITE(numout,*) 
    385          WRITE(numout,*) 'nemo_ctl: Control prints & Benchmark' 
     392         WRITE(numout,*) 'nemo_ctl: Control prints' 
    386393         WRITE(numout,*) '~~~~~~~ ' 
    387394         WRITE(numout,*) '   Namelist namctl' 
     
    394401         WRITE(numout,*) '      number of proc. following i     nn_isplt   = ', nn_isplt 
    395402         WRITE(numout,*) '      number of proc. following j     nn_jsplt   = ', nn_jsplt 
    396          WRITE(numout,*) '      benchmark parameter (0/1)       nn_bench   = ', nn_bench 
     403         WRITE(numout,*) '      timing activated    (0/1)       nn_timing  = ', nn_timing 
    397404      ENDIF 
    398405      ! 
     
    404411      isplt     = nn_isplt 
    405412      jsplt     = nn_jsplt 
    406       nbench    = nn_bench 
    407413 
    408414      IF(lwp) THEN                  ! control print 
     
    411417         WRITE(numout,*) '~~~~~~~ ' 
    412418         WRITE(numout,*) '   Namelist namcfg' 
    413          WRITE(numout,*) '      configuration name              cp_cfg      = ', TRIM(cp_cfg) 
    414          WRITE(numout,*) '      configuration zoom name         cp_cfz      = ', TRIM(cp_cfz) 
    415          WRITE(numout,*) '      configuration resolution        jp_cfg      = ', jp_cfg 
    416          WRITE(numout,*) '      1st lateral dimension ( >= jpi ) jpidta     = ', jpidta 
    417          WRITE(numout,*) '      2nd    "         "    ( >= jpj ) jpjdta     = ', jpjdta 
    418          WRITE(numout,*) '      3nd    "         "               jpkdta     = ', jpkdta 
    419          WRITE(numout,*) '      1st dimension of global domain in i jpiglo  = ', jpiglo 
    420          WRITE(numout,*) '      2nd    -                  -    in j jpjglo  = ', jpjglo 
    421          WRITE(numout,*) '      left bottom i index of the zoom (in data domain) jpizoom = ', jpizoom 
    422          WRITE(numout,*) '      left bottom j index of the zoom (in data domain) jpizoom = ', jpjzoom 
    423          WRITE(numout,*) '      lateral cond. type (between 0 and 6) jperio = ', jperio    
    424          WRITE(numout,*) '      use file attribute if exists as i/p j-start ln_use_jattr = ', ln_use_jattr 
     419         WRITE(numout,*) '      read domain configuration files               ln_read_cfg      = ', ln_read_cfg 
     420         WRITE(numout,*) '         filename to be read                           cn_domcfg     = ', TRIM(cn_domcfg) 
     421         WRITE(numout,*) '      write  configuration definition files         ln_write_cfg     = ', ln_write_cfg 
     422         WRITE(numout,*) '         filename to be written                        cn_domcfg_out = ', TRIM(cn_domcfg_out) 
     423         WRITE(numout,*) '      use file attribute if exists as i/p j-start   ln_use_jattr     = ', ln_use_jattr 
    425424      ENDIF 
    426425      !                             ! Parameter control 
     
    441440         !                              ! indices used for the SUM control 
    442441         IF( nictls+nictle+njctls+njctle == 0 )   THEN    ! print control done over the default area 
    443             lsp_area = .FALSE.                         
     442            lsp_area = .FALSE. 
    444443         ELSE                                             ! print control done over a specific  area 
    445444            lsp_area = .TRUE. 
     
    463462      ENDIF 
    464463      ! 
    465       IF( nbench == 1 ) THEN              ! Benchmark  
    466          SELECT CASE ( cp_cfg ) 
    467          CASE ( 'gyre' )   ;   CALL ctl_warn( ' The Benchmark is activated ' ) 
    468          CASE DEFAULT      ;   CALL ctl_stop( ' The Benchmark is based on the GYRE configuration:',   & 
    469             &                                 ' cp_cfg="gyre" in namelist &namcfg or set nbench = 0' ) 
    470          END SELECT 
    471       ENDIF 
    472       ! 
    473464      IF( 1_wp /= SIGN(1._wp,-0._wp)  )   CALL ctl_stop( 'nemo_ctl: The intrinsec SIGN function follows ',  & 
    474465         &                                               'f2003 standard. '                              ,  & 
     
    514505      USE diawri    , ONLY: dia_wri_alloc 
    515506      USE dom_oce   , ONLY: dom_oce_alloc 
    516 #if defined key_bdy    
    517       USE bdy_oce   , ONLY: bdy_oce_alloc 
     507      USE bdy_oce   , ONLY: ln_bdy, bdy_oce_alloc 
    518508      USE oce         ! clem: mandatory for LIM3 because needed for bdy arrays 
    519 #else 
    520       USE oce       , ONLY : sshn, sshb, snwice_mass, snwice_mass_b, snwice_fmass 
    521 #endif 
    522       ! 
    523       INTEGER :: ierr,ierr1,ierr2,ierr3,ierr4,ierr5,ierr6,ierr7,ierr8 
    524       INTEGER :: jpm 
     509      ! 
     510      INTEGER :: ierr 
    525511      !!---------------------------------------------------------------------- 
    526512      ! 
    527513      ierr =        dia_wri_alloc   () 
    528514      ierr = ierr + dom_oce_alloc   ()          ! ocean domain 
    529 #if defined key_bdy 
     515      ierr = ierr + oce_alloc       ()          ! (tsn...) needed for agrif and/or lim3 and bdy 
    530516      ierr = ierr + bdy_oce_alloc   ()          ! bdy masks (incl. initialization) 
    531       ierr = ierr + oce_alloc       ()          ! (tsn...) 
    532 #endif 
    533  
    534 #if ! defined key_bdy 
    535        ALLOCATE( snwice_mass(jpi,jpj)  , snwice_mass_b(jpi,jpj),             & 
    536          &      snwice_fmass(jpi,jpj)  , STAT= ierr1 ) 
    537       ! 
    538       ! lim code currently uses surface temperature and salinity in tsn array for initialisation 
    539       ! and ub, vb arrays in ice dynamics, so allocate enough of arrays to use 
    540       ! clem: should not be needed. To be checked out 
    541       jpm = MAX(jp_tem, jp_sal) 
    542       ALLOCATE( tsn(jpi,jpj,1,jpm)  , STAT=ierr2 ) 
    543       ALLOCATE( ub(jpi,jpj,1)       , STAT=ierr3 ) 
    544       ALLOCATE( vb(jpi,jpj,1)       , STAT=ierr4 ) 
    545       ALLOCATE( tsb(jpi,jpj,1,jpm)  , STAT=ierr5 ) 
    546       ALLOCATE( sshn(jpi,jpj)       , STAT=ierr6 ) 
    547       ALLOCATE( un(jpi,jpj,1)       , STAT=ierr7 ) 
    548       ALLOCATE( vn(jpi,jpj,1)       , STAT=ierr8 ) 
    549       ierr = ierr + ierr1 + ierr2 + ierr3 + ierr4 + ierr5 + ierr6 + ierr7 + ierr8 
    550 #endif 
    551517      ! 
    552518      IF( lk_mpp    )   CALL mpp_sum( ierr ) 
     
    564530      !! ** Method  : 
    565531      !!---------------------------------------------------------------------- 
    566       INTEGER, INTENT(in) :: num_pes ! The number of MPI processes we have 
     532      INTEGER, INTENT(in) ::   num_pes  ! The number of MPI processes we have 
    567533      ! 
    568534      INTEGER, PARAMETER :: nfactmax = 20 
     
    608574      !! 
    609575      !! ** Purpose :   return the prime factors of n. 
    610       !!                knfax factors are returned in array kfax which is of  
     576      !!                knfax factors are returned in array kfax which is of 
    611577      !!                maximum dimension kmaxfax. 
    612578      !! ** Method  : 
     
    618584      INTEGER :: ifac, jl, inu 
    619585      INTEGER, PARAMETER :: ntest = 14 
    620       INTEGER :: ilfax(ntest) 
     586      INTEGER, DIMENSION(ntest) ::   ilfax 
     587      !!---------------------------------------------------------------------- 
    621588      ! 
    622589      ! lfax contains the set of allowed factors. 
    623       data (ilfax(jl),jl=1,ntest) / 16384, 8192, 4096, 2048, 1024, 512, 256,  & 
    624          &                            128,   64,   32,   16,    8,   4,   2  / 
    625       !!---------------------------------------------------------------------- 
    626  
     590      ilfax(:) = (/(2**jl,jl=ntest,1,-1)/) 
     591      ! 
    627592      ! Clear the error flag and initialise output vars 
    628       kerr = 0 
    629       kfax = 1 
     593      kerr  = 0 
     594      kfax  = 1 
    630595      knfax = 0 
    631  
     596      ! 
    632597      ! Find the factors of n. 
    633598      IF( kn == 1 )   GOTO 20 
     
    637602      ! l points to the allowed factor list. 
    638603      ! ifac holds the current factor. 
    639  
     604      ! 
    640605      inu   = kn 
    641606      knfax = 0 
    642  
     607      ! 
    643608      DO jl = ntest, 1, -1 
    644609         ! 
     
    664629         ! 
    665630      END DO 
    666  
     631      ! 
    667632   20 CONTINUE      ! Label 20 is the exit point from the factor search loop. 
    668633      ! 
     
    670635 
    671636#if defined key_mpp_mpi 
     637 
    672638   SUBROUTINE nemo_northcomms 
    673       !!====================================================================== 
     639      !!---------------------------------------------------------------------- 
    674640      !!                     ***  ROUTINE  nemo_northcomms  *** 
    675       !! nemo_northcomms    :  Setup for north fold exchanges with explicit  
    676       !!                       point-to-point messaging 
    677       !!===================================================================== 
    678       !!---------------------------------------------------------------------- 
    679       !! 
    680       !! ** Purpose :   Initialization of the northern neighbours lists. 
     641      !! ** Purpose :   Setup for north fold exchanges with explicit  
     642      !!                point-to-point messaging 
     643      !! 
     644      !! ** Method :   Initialization of the northern neighbours lists. 
    681645      !!---------------------------------------------------------------------- 
    682646      !!    1.0  ! 2011-10  (A. C. Coward, NOCS & J. Donners, PRACE) 
    683647      !!    2.0  ! 2013-06 Setup avoiding MPI communication (I. Epicoco, S. Mocavero, CMCC)  
    684648      !!---------------------------------------------------------------------- 
    685  
    686649      INTEGER  ::   sxM, dxM, sxT, dxT, jn 
    687650      INTEGER  ::   njmppmax 
    688  
     651      !!---------------------------------------------------------------------- 
     652      ! 
    689653      njmppmax = MAXVAL( njmppt ) 
    690      
     654      ! 
    691655      !initializes the north-fold communication variables 
    692656      isendto(:) = 0 
    693       nsndto = 0 
    694  
     657      nsndto     = 0 
     658      ! 
    695659      !if I am a process in the north 
    696660      IF ( njmpp == njmppmax ) THEN 
     
    721685                   nsndto = nsndto + 1 
    722686                   isendto(nsndto) = jn 
    723                 END IF 
     687                ENDIF 
    724688          END DO 
    725689          nfsloop = 1 
     
    745709   END SUBROUTINE nemo_northcomms 
    746710#endif 
     711 
    747712   !!====================================================================== 
    748713END MODULE nemogcm 
  • trunk/NEMOGCM/NEMO/SAS_SRC/sbcssm.F90

    r6140 r7646  
    3939   LOGICAL              ::   ln_3d_uve     !: specify whether input velocity data is 3D 
    4040   LOGICAL              ::   ln_read_frq   !: specify whether we must read frq or not 
     41   LOGICAL              ::   l_sasread     !: Ice intilisation: read a file (.TRUE.) or anaytical initilaistion in namelist &namsbc_sas 
    4142   LOGICAL              ::   l_initdone = .false. 
    4243   INTEGER     ::   nfld_3d 
     
    8182      ! 
    8283      IF( nn_timing == 1 )  CALL timing_start( 'sbc_ssm') 
    83  
    84       IF( nfld_3d > 0 ) CALL fld_read( kt, 1, sf_ssm_3d )      !==   read data at kt time step   ==! 
    85       IF( nfld_2d > 0 ) CALL fld_read( kt, 1, sf_ssm_2d )      !==   read data at kt time step   ==! 
    86       !  
    87       IF( ln_3d_uve ) THEN 
    88          ssu_m(:,:) = sf_ssm_3d(jf_usp)%fnow(:,:,1) * umask(:,:,1)    ! u-velocity 
    89          ssv_m(:,:) = sf_ssm_3d(jf_vsp)%fnow(:,:,1) * vmask(:,:,1)    ! v-velocity  
    90          IF( .NOT.ln_linssh )   e3t_m(:,:) = sf_ssm_3d(jf_e3t)%fnow(:,:,1) * tmask(:,:,1)    ! v-velocity  
     84      
     85      IF ( l_sasread ) THEN 
     86         IF( nfld_3d > 0 ) CALL fld_read( kt, 1, sf_ssm_3d )      !==   read data at kt time step   ==! 
     87         IF( nfld_2d > 0 ) CALL fld_read( kt, 1, sf_ssm_2d )      !==   read data at kt time step   ==! 
     88         !  
     89         IF( ln_3d_uve ) THEN 
     90            IF( .NOT. ln_linssh )   e3t_m(:,:) = sf_ssm_3d(jf_e3t)%fnow(:,:,1) * tmask(:,:,1)    ! v-velocity  
     91                                    ssu_m(:,:) = sf_ssm_3d(jf_usp)%fnow(:,:,1) * umask(:,:,1)    ! u-velocity 
     92                                    ssv_m(:,:) = sf_ssm_3d(jf_vsp)%fnow(:,:,1) * vmask(:,:,1)    ! v-velocity  
     93         ELSE 
     94            IF( .NOT. ln_linssh )   e3t_m(:,:) = sf_ssm_2d(jf_e3t)%fnow(:,:,1) * tmask(:,:,1)    ! v-velocity  
     95                                    ssu_m(:,:) = sf_ssm_2d(jf_usp)%fnow(:,:,1) * umask(:,:,1)    ! u-velocity 
     96                                    ssv_m(:,:) = sf_ssm_2d(jf_vsp)%fnow(:,:,1) * vmask(:,:,1)    ! v-velocity  
     97         ENDIF 
     98         ! 
     99         sst_m(:,:) = sf_ssm_2d(jf_tem)%fnow(:,:,1) * tmask(:,:,1)    ! temperature 
     100         sss_m(:,:) = sf_ssm_2d(jf_sal)%fnow(:,:,1) * tmask(:,:,1)    ! salinity 
     101         ssh_m(:,:) = sf_ssm_2d(jf_ssh)%fnow(:,:,1) * tmask(:,:,1)    ! sea surface height 
     102         IF( ln_read_frq ) THEN 
     103            frq_m(:,:) = sf_ssm_2d(jf_frq)%fnow(:,:,1) * tmask(:,:,1) ! solar penetration 
     104         ELSE 
     105            frq_m(:,:) = 1._wp 
     106         ENDIF 
    91107      ELSE 
    92          ssu_m(:,:) = sf_ssm_2d(jf_usp)%fnow(:,:,1) * umask(:,:,1)    ! u-velocity 
    93          ssv_m(:,:) = sf_ssm_2d(jf_vsp)%fnow(:,:,1) * vmask(:,:,1)    ! v-velocity  
    94          IF( .NOT.ln_linssh )   e3t_m(:,:) = sf_ssm_2d(jf_e3t)%fnow(:,:,1) * tmask(:,:,1)    ! v-velocity  
    95       ENDIF 
    96       ! 
    97       sst_m(:,:) = sf_ssm_2d(jf_tem)%fnow(:,:,1) * tmask(:,:,1)    ! temperature 
    98       sss_m(:,:) = sf_ssm_2d(jf_sal)%fnow(:,:,1) * tmask(:,:,1)    ! salinity 
    99       ssh_m(:,:) = sf_ssm_2d(jf_ssh)%fnow(:,:,1) * tmask(:,:,1)    ! sea surface height 
    100       IF( ln_read_frq )   frq_m(:,:) = sf_ssm_2d(jf_frq)%fnow(:,:,1) * tmask(:,:,1)    ! sea surface height 
    101       ! 
     108         sst_m(:,:) = 0._wp 
     109         sss_m(:,:) = 0._wp 
     110         ssu_m(:,:) = 0._wp 
     111         ssv_m(:,:) = 0._wp 
     112         ssh_m(:,:) = 0._wp 
     113         e3t_m(:,:) = e3t_0(:,:,1) !clem: necessary at least for sas2D 
     114         frq_m(:,:) = 1._wp        !              - - 
     115         sshn (:,:) = 0._wp        !              - - 
     116      ENDIF 
     117       
    102118      IF ( nn_ice == 1 ) THEN 
    103119         tsn(:,:,1,jp_tem) = sst_m(:,:) 
     
    108124      ub (:,:,1) = ssu_m(:,:) 
    109125      vb (:,:,1) = ssv_m(:,:) 
    110  
     126  
    111127      IF(ln_ctl) THEN                  ! print control 
    112128         CALL prt_ctl(tab2d_1=sst_m, clinfo1=' sst_m   - : ', mask1=tmask, ovlap=1   ) 
     
    155171      TYPE(FLD_N) :: sn_ssh, sn_e3t, sn_frq 
    156172      ! 
    157       NAMELIST/namsbc_sas/cn_dir, ln_3d_uve, ln_read_frq, sn_tem, sn_sal, sn_usp, sn_vsp, sn_ssh, sn_e3t, sn_frq 
     173      NAMELIST/namsbc_sas/l_sasread, cn_dir, ln_3d_uve, ln_read_frq, sn_tem, sn_sal, sn_usp, sn_vsp, sn_ssh, sn_e3t, sn_frq 
    158174      !!---------------------------------------------------------------------- 
    159175       
     
    176192         WRITE(numout,*) '~~~~~~~~~~~ ' 
    177193         WRITE(numout,*) '   Namelist namsbc_sas' 
     194         WRITE(numout,*) '      Initialisation using an input file  = ',l_sasread  
    178195         WRITE(numout,*) '      Are we supplying a 3D u,v and e3 field                             ln_3d_uve   = ', ln_3d_uve 
    179196         WRITE(numout,*) '      Are we reading frq (fraction of qsr absorbed in the 1st T level)   ln_read_frq = ', ln_read_frq 
     
    204221         nn_closea = 0 
    205222      ENDIF 
     223      IF (l_sasread) THEN 
    206224      !  
    207225      !! following code is a bit messy, but distinguishes between when u,v are 3d arrays and 
     
    285303      IF( nfld_2d > 0 ) DEALLOCATE( slf_2d, STAT=ierr ) 
    286304 
     305   ENDIF 
     306  
    287307      CALL sbc_ssm( nit000 )   ! need to define ss?_m arrays used in limistate 
    288308      IF( .NOT. ln_read_frq )   frq_m(:,:) = 1. 
  • trunk/NEMOGCM/NEMO/SAS_SRC/step.F90

    r6140 r7646  
    2323   USE eosbn2           ! equation of state                (eos_bn2 routine) 
    2424   USE diawri           ! Standard run outputs             (dia_wri routine) 
    25    USE bdy_par          ! clem: mandatory for LIM3 
    26 #if defined key_bdy 
     25   USE bdy_oce   , ONLY: ln_bdy 
    2726   USE bdydta           ! clem: mandatory for LIM3 
    28 #endif 
    2927   USE stpctl           ! time stepping control            (stp_ctl routine) 
    3028   ! 
     
    3836#endif 
    3937 
     38#if defined key_agrif 
     39   USE agrif_oce, ONLY: lk_agrif_debug  !clem 
     40#endif 
     41    
    4042   IMPLICIT NONE 
    4143   PRIVATE 
     
    7072#if defined key_agrif 
    7173      kstp = nit000 + Agrif_Nb_Step() 
     74      IF ( lk_agrif_debug ) THEN 
     75         IF ( Agrif_Root() .and. lwp) Write(*,*) '---' 
     76         IF (lwp) Write(*,*) 'Grid Number',Agrif_Fixed(),' time step ',kstp, 'int tstep',Agrif_NbStepint() 
     77      ENDIF 
     78 
     79      IF ( kstp == (nit000 + 1) ) lk_agrif_fstep = .FALSE. 
     80 
    7281# if defined key_iomput 
    7382      IF( Agrif_Nbstepint() == 0 )   CALL iom_swap( cxios_context ) 
    7483# endif    
    7584#endif    
     85                             indic = 0                    ! although indic is not changed in stp_ctl 
     86                                                          ! need to keep the same interface  
    7687      IF( kstp == nit000 )   CALL iom_init( cxios_context ) ! iom_put initialization (must be done after nemo_init for AGRIF+XIOS+OASIS) 
    7788      IF( kstp /= nit000 )   CALL day( kstp )             ! Calendar (day was already called at nit000 in day_init) 
     
    8293      !           From SAS: ocean bdy data are wrong  (but we do not care) and ice bdy data are OK.   
    8394      !           This is not clean and should be changed in the future.  
    84 #if defined key_bdy 
    85       IF( lk_bdy     )       CALL bdy_dta ( kstp, time_offset=+1 )   ! update dynamic & tracer data at open boundaries 
    86 #endif 
     95      IF( ln_bdy     )       CALL bdy_dta ( kstp, time_offset=+1 )   ! update dynamic & tracer data at open boundaries 
    8796      ! ==> 
    8897                             CALL sbc    ( kstp )         ! Sea Boundary Condition (including sea-ice) 
     
    9099                             CALL dia_wri( kstp )         ! ocean model: outputs 
    91100 
    92                              indic = 0                    ! although indic is not changed in stp_ctl 
    93                                                           ! need to keep the same interface  
     101#if defined key_agrif 
     102      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     103      ! AGRIF 
     104      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<       
     105                             CALL Agrif_Integrate_ChildGrids( stp )   
     106#endif 
     107                              
     108      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     109      ! Control 
     110      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    94111                             CALL stp_ctl( kstp, indic ) 
     112      IF( indic < 0  )  THEN 
     113                             CALL ctl_stop( 'step: indic < 0' ) 
     114                             CALL dia_wri_state( 'output.abort', kstp ) 
     115      ENDIF 
     116      IF( kstp == nit000   ) CALL iom_close( numror )     ! close input  ocean restart file (clem: not sure...) 
     117       
    95118      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    96119      ! Coupled mode 
Note: See TracChangeset for help on using the changeset viewer.