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 9019 for branches/2017/dev_merge_2017/NEMOGCM/NEMO/SAS_SRC – NEMO

Ignore:
Timestamp:
2017-12-13T15:58:53+01:00 (6 years ago)
Author:
timgraham
Message:

Merge of dev_CNRS_2017 into branch

Location:
branches/2017/dev_merge_2017/NEMOGCM/NEMO/SAS_SRC
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/2017/dev_merge_2017/NEMOGCM/NEMO/SAS_SRC/diawri.F90

    r7761 r9019  
    3838   USE iom 
    3939   USE ioipsl 
    40 #if defined key_lim2 
    41    USE limwri_2  
    42 #elif defined key_lim3 
    43    USE limwri 
     40#if defined key_lim3 
     41   USE icewri 
    4442#endif 
    4543   USE lib_mpp         ! MPP library 
     
    397395         &          jpi, jpj, nh_i, 1  , 1, 1  , -99 , 32, clop, zsto, zout ) 
    398396 
    399 #if defined key_lim2 
    400       CALL lim_wri_state_2( kt, id_i, nh_i ) 
    401 #elif defined key_lim3 
    402       CALL lim_wri_state( kt, id_i, nh_i ) 
     397#if defined key_lim3 
     398      IF( nn_ice == 2 ) THEN   ! condition needed in case agrif + lim but no-ice in child grid 
     399         CALL ice_wri_state( kt, id_i, nh_i ) 
     400      ENDIF 
    403401#else 
    404402      CALL histend( id_i, snc4chunks=snc4set ) 
  • branches/2017/dev_merge_2017/NEMOGCM/NEMO/SAS_SRC/nemogcm.F90

    r8583 r9019  
    3131   USE icbini         ! handle bergs, initialisation 
    3232   USE icbstp         ! handle bergs, calving, themodynamics and transport 
    33    USE bdyini         ! open boundary cond. setting       (bdy_init routine). clem: mandatory for LIM3 
    34    USE bdydta         ! open boundary cond. setting   (bdy_dta_init routine). clem: mandatory for LIM3 
     33   USE bdyini         ! open boundary cond. setting       (bdy_init routine). mandatory for sea-ice 
     34   USE bdydta         ! open boundary cond. setting   (bdy_dta_init routine). mandatory for sea-ice 
    3535   ! 
    3636   USE lib_mpp        ! distributed memory computing 
     
    8787      CALL Agrif_Declare_Var_top   !  "      "   "   "      "  TOP 
    8888# endif 
    89 # if defined key_lim2 
    90       CALL Agrif_Declare_Var_lim2  !  "      "   "   "      "  LIM 
    91 # endif 
    9289# if defined key_lim3 
    9390      CALL Agrif_Declare_Var_lim3  !  "      "   "   "      "  LIM3 
     
    135132      ! 
    136133#if defined key_agrif 
    137       IF( .NOT. Agrif_Root() ) THEN 
    138134         CALL Agrif_ParentGrid_To_ChildGrid() 
    139          IF( nn_timing == 1 )   CALL timing_finalize 
     135         IF( ln_timing )   CALL timing_finalize 
    140136         CALL Agrif_ChildGrid_To_ParentGrid() 
    141       ENDIF 
    142 #endif 
    143       IF( nn_timing == 1 )   CALL timing_finalize 
     137#endif 
     138      IF( ln_timing )   CALL timing_finalize 
    144139      ! 
    145140      CALL nemo_closefile 
     
    168163      INTEGER  ::   ilocal_comm   ! local integer 
    169164      INTEGER  ::   ios, inum     !   -      - 
     165      INTEGER  ::   iiarea, ijarea     ! local integers 
     166      INTEGER  ::   iirest, ijrest     ! local integers 
    170167      CHARACTER(len=120), DIMENSION(30) ::   cltxt, cltxt2, clnam 
    171168      CHARACTER(len=80)                 ::   clname 
     
    173170      NAMELIST/namctl/ ln_ctl   , nn_print, nn_ictls, nn_ictle,   & 
    174171         &             nn_isplt , nn_jsplt, nn_jctls, nn_jctle,   & 
    175          &             nn_timing, nn_diacfl 
     172         &             ln_timing, ln_diacfl 
    176173      NAMELIST/namcfg/ ln_read_cfg, cn_domcfg, ln_write_cfg, cn_domcfg_out, ln_use_jattr 
    177174      !!---------------------------------------------------------------------- 
     
    221218      ENDIF 
    222219      ! 
    223       jpk = jpkglo 
    224       ! 
    225 #if defined key_agrif 
    226       IF( .NOT. Agrif_Root() ) THEN       ! AGRIF children: specific setting (cf. agrif_user.F90) 
    227          jpiglo  = nbcellsx + 2 + 2*nbghostcells 
    228          jpjglo  = nbcellsy + 2 + 2*nbghostcells 
    229          jpi     = ( jpiglo-2*jpreci + (jpni-1+0) ) / jpni + 2*jpreci 
    230          jpj     = ( jpjglo-2*jprecj + (jpnj-1+0) ) / jpnj + 2*jprecj 
    231          nperio  = 0 
    232          jperio  = 0 
    233          ln_use_jattr = .false. 
    234       ENDIF 
    235 #endif 
    236220      ! 
    237221      !                             !--------------------------------------------! 
     
    290274#endif 
    291275      ENDIF 
     276      ! 
     277#if defined key_agrif 
     278      IF( .NOT. Agrif_Root() ) THEN       ! AGRIF children: specific setting (cf. agrif_user.F90) 
     279         jpiglo  = nbcellsx + 2 + 2*nbghostcells 
     280         jpjglo  = nbcellsy + 2 + 2*nbghostcells 
     281         jpi     = ( jpiglo-2*nn_hls + (jpni-1+0) ) / jpni + 2*nn_hls 
     282         jpj     = ( jpjglo-2*nn_hls + (jpnj-1+0) ) / jpnj + 2*nn_hls 
     283         jpimax  = jpi 
     284         jpjmax  = jpj 
     285         nperio  = 0 
     286         jperio  = 0 
     287         ln_use_jattr = .false. 
     288      ENDIF 
     289#endif 
    292290 
    293291      IF( Agrif_Root() ) THEN       ! AGRIF mother: specific setting from jpni and jpnj 
     292         iiarea = 1 + MOD( narea - 1 , jpni ) 
     293         ijarea = 1 + ( narea - 1 ) / jpni 
     294         iirest = 1 + MOD( jpiglo - 2*nn_hls - 1 , jpni ) 
     295         ijrest = 1 + MOD( jpjglo - 2*nn_hls - 1 , jpnj ) 
    294296#if defined key_nemocice_decomp 
    295          jpi = ( nx_global+2-2*jpreci + (jpni-1) ) / jpni + 2*jpreci    ! first  dim. 
    296          jpj = ( ny_global+2-2*jprecj + (jpnj-1) ) / jpnj + 2*jprecj    ! second dim.  
     297         jpi = ( nx_global+2-2*nn_hls + (jpni-1) ) / jpni + 2*nn_hls    ! first  dim. 
     298         jpj = ( ny_global+2-2*nn_hls + (jpnj-1) ) / jpnj + 2*nn_hls    ! second dim.  
     299         jpimax  = jpi 
     300         jpjmax  = jpj 
     301         IF( iiarea == jpni ) jpi = jpiglo - (jpni - 1) * (jpi - 2*nn_hls) 
     302         IF( ijarea == jpnj ) jpj = jpjglo - (jpnj - 1) * (jpj - 2*nn_hls) 
    297303#else 
    298          jpi = ( jpiglo     -2*jpreci + (jpni-1) ) / jpni + 2*jpreci    ! first  dim. 
    299          jpj = ( jpjglo     -2*jprecj + (jpnj-1) ) / jpnj + 2*jprecj    ! second dim. 
    300 #endif 
    301       ENDIF 
     304         jpi = ( jpiglo     -2*nn_hls + (jpni-1) ) / jpni + 2*nn_hls    ! first  dim. 
     305         jpj = ( jpjglo     -2*nn_hls + (jpnj-1) ) / jpnj + 2*nn_hls    ! second dim. 
     306         jpimax  = jpi 
     307         jpjmax  = jpj 
     308         IF( iiarea > iirest ) jpi = jpi - 1 
     309         IF( ijarea > ijrest ) jpj = jpj - 1 
     310#endif 
     311      ENDIF 
     312 
     313      jpk = jpkglo                                             ! third dim 
    302314 
    303315#if defined key_agrif 
     
    350362 
    351363      !                                      ! Domain decomposition 
    352       IF( jpni*jpnj == jpnij ) THEN   ;   CALL mpp_init      ! standard cutting out 
    353       ELSE                            ;   CALL mpp_init2     ! eliminate land processors 
    354       ENDIF 
    355       ! 
    356       IF( nn_timing == 1 )  CALL timing_init 
     364      CALL mpp_init 
     365      ! 
     366      IF( ln_timing    )   CALL timing_init 
    357367      ! 
    358368      !                                     ! General initialization 
    359                             CALL phy_cst    ! Physical constants 
    360                             CALL eos_init   ! Equation of state 
    361                             CALL dom_init   ! Domain 
    362  
    363      IF( ln_nnogather )     CALL nemo_northcomms   ! Initialise the northfold neighbour lists (must be done after the masks are defined) 
    364  
    365       IF( ln_ctl      )     CALL prt_ctl_init   ! Print control 
    366                             CALL day_init   ! model calendar (using both namelist and restart infos) 
     369                           CALL phy_cst    ! Physical constants 
     370                           CALL eos_init   ! Equation of state 
     371                           CALL dom_init   ! Domain 
     372 
     373     IF( ln_nnogather )    CALL nemo_northcomms   ! Initialise the northfold neighbour lists (must be done after the masks are defined) 
     374 
     375      IF( ln_ctl      )    CALL prt_ctl_init   ! Print control 
     376                           CALL day_init   ! model calendar (using both namelist and restart infos) 
    367377      IF( ln_rstart )       CALL rst_read_open 
    368378 
    369                             CALL sbc_init   ! Forcings : surface module  
    370  
    371       ! ==> clem: open boundaries init. is mandatory for LIM3 because ice BDY is not decoupled from   
     379                           CALL sbc_init   ! Forcings : surface module  
     380 
     381      ! ==> clem: open boundaries init. is mandatory for sea-ice because ice BDY is not decoupled from   
    372382      !           the environment of ocean BDY. Therefore bdy is called in both OPA and SAS modules.  
    373383      !           This is not clean and should be changed in the future.  
    374                             CALL bdy_init 
     384                           CALL bdy_init 
    375385      ! ==> 
    376                             CALL icb_init( rdt, nit000)   ! initialise icebergs instance 
     386                           CALL icb_init( rdt, nit000)   ! initialise icebergs instance 
    377387       
    378388      IF(lwp) WRITE(numout,*) 'Euler time step switch is ', neuler 
     
    403413         WRITE(numout,*) '      number of proc. following i     nn_isplt   = ', nn_isplt 
    404414         WRITE(numout,*) '      number of proc. following j     nn_jsplt   = ', nn_jsplt 
    405          WRITE(numout,*) '      timing activated    (0/1)       nn_timing  = ', nn_timing 
     415         WRITE(numout,*) '      timing by routine               ln_timing  = ', ln_timing 
     416         WRITE(numout,*) '      CFL diagnostics                 ln_diacfl  = ', ln_diacfl 
    406417      ENDIF 
    407418      ! 
     
    413424      isplt     = nn_isplt 
    414425      jsplt     = nn_jsplt 
     426!!gm to be remove at the end of the 2017 merge party 
     427      if( ln_timing ) then  ;  nn_timing = 1 
     428      else                  ;  nn_timing = 0 
     429      endif 
     430!!gm end 
    415431 
    416432      IF(lwp) THEN                  ! control print 
     
    508524      USE dom_oce   , ONLY: dom_oce_alloc 
    509525      USE bdy_oce   , ONLY: ln_bdy, bdy_oce_alloc 
    510       USE oce         ! clem: mandatory for LIM3 because needed for bdy arrays 
     526      USE oce       ! mandatory for sea-ice because needed for bdy arrays 
    511527      ! 
    512528      INTEGER :: ierr 
     
    515531      ierr =        dia_wri_alloc   () 
    516532      ierr = ierr + dom_oce_alloc   ()          ! ocean domain 
    517       ierr = ierr + oce_alloc       ()          ! (tsn...) needed for agrif and/or lim3 and bdy 
     533      ierr = ierr + oce_alloc       ()          ! (tsn...) needed for agrif and/or ESIM and bdy 
    518534      ierr = ierr + bdy_oce_alloc   ()          ! bdy masks (incl. initialization) 
    519535      ! 
  • branches/2017/dev_merge_2017/NEMOGCM/NEMO/SAS_SRC/sbcssm.F90

    r7761 r9019  
    114114         ENDIF 
    115115      ELSE 
    116          sst_m(:,:) = 0._wp 
    117          sss_m(:,:) = 0._wp 
     116         sss_m(:,:) = 35._wp                             ! =35. to obtain a physical value for the freezing point 
     117         CALL eos_fzp( sss_m(:,:), sst_m(:,:) )          ! sst_m is set at the freezing point 
    118118         ssu_m(:,:) = 0._wp 
    119119         ssv_m(:,:) = 0._wp 
     
    313313   ENDIF 
    314314  
    315       CALL sbc_ssm( nit000 )   ! need to define ss?_m arrays used in limistate 
     315      CALL sbc_ssm( nit000 )   ! need to define ss?_m arrays used in iceistate 
    316316      l_initdone = .TRUE. 
    317317      ! 
  • branches/2017/dev_merge_2017/NEMOGCM/NEMO/SAS_SRC/step.F90

    r7761 r9019  
    2424   USE diawri           ! Standard run outputs             (dia_wri routine) 
    2525   USE bdy_oce   , ONLY: ln_bdy 
    26    USE bdydta           ! clem: mandatory for LIM3 
     26   USE bdydta           ! mandatory for sea-ice 
    2727   USE stpctl           ! time stepping control            (stp_ctl routine) 
    2828   ! 
     
    3737 
    3838#if defined key_agrif 
    39    USE agrif_oce, ONLY: lk_agrif_debug  !clem 
     39   USE agrif_oce, ONLY: lk_agrif_debug 
    4040#endif 
    4141    
     
    8989                             CALL iom_setkt( kstp - nit000 + 1, cxios_context )   ! tell iom we are at time step kstp 
    9090 
    91       ! ==> clem: open boundaries is mandatory for LIM3 because ice BDY is not decoupled from   
     91      ! ==> clem: open boundaries is mandatory for sea-ice because ice BDY is not decoupled from   
    9292      !           the environment of ocean BDY. Therefore bdy is called in both OPA and SAS modules. 
    9393      !           From SAS: ocean bdy data are wrong  (but we do not care) and ice bdy data are OK.   
     
    114114                             CALL dia_wri_state( 'output.abort', kstp ) 
    115115      ENDIF 
    116       IF( kstp == nit000   ) CALL iom_close( numror )     ! close input  ocean restart file (clem: not sure...) 
     116      IF( kstp == nit000   ) CALL iom_close( numror )     ! close input  ocean restart file 
    117117       
    118118      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     
    127127#endif 
    128128      ! 
    129       IF( nn_timing == 1 .AND.  kstp == nit000  )   CALL timing_reset 
     129      IF( ln_timing .AND.  kstp == nit000  )   CALL timing_reset 
    130130      ! 
    131131   END SUBROUTINE stp 
Note: See TracChangeset for help on using the changeset viewer.