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

Ignore:
Timestamp:
2018-01-12T10:38:50+01:00 (6 years ago)
Author:
gm
Message:

dev_merge_2017: nemogcm.F90 : updated in SAS & OFF + data assimilation initial calls (asm_bkg_wri , tra_asm_inc ...) moved to asm_inc_init + closed sea : restructure namcfg & its control print + set ln_closea = false if domcfg file not read (ln_domcfg=F

Location:
branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/ASM/asminc.F90

    r9168 r9213  
    7474   REAL(wp), PUBLIC, DIMENSION(:)    , ALLOCATABLE ::   wgtiau               !: IAU weights for each time step 
    7575#if defined key_asminc 
    76    REAL(wp), PUBLIC, DIMENSION(:,:), ALLOCATABLE ::   ssh_iau           !: IAU-weighted sea surface height increment 
     76   REAL(wp), PUBLIC, DIMENSION(:,:)  , ALLOCATABLE ::   ssh_iau              !: IAU-weighted sea surface height increment 
    7777#endif 
    7878   !                                !!! time steps relative to the cycle interval [0,nitend-nit000-1] 
     
    254254      !-------------------------------------------------------------------- 
    255255 
    256       IF ( ln_asmiau ) THEN 
    257  
     256      IF( ln_asmiau ) THEN 
     257         ! 
    258258         ALLOCATE( wgtiau( icycper ) ) 
    259  
     259         ! 
    260260         wgtiau(:) = 0._wp 
    261  
    262          IF ( niaufn == 0 ) THEN 
    263  
    264             !--------------------------------------------------------- 
    265             ! Constant IAU forcing  
    266             !--------------------------------------------------------- 
    267  
     261         ! 
     262         !                                !--------------------------------------------------------- 
     263         IF( niaufn == 0 ) THEN           ! Constant IAU forcing  
     264            !                             !--------------------------------------------------------- 
    268265            DO jt = 1, iiauper 
    269266               wgtiau(jt+nitiaustr-1) = 1.0 / REAL( iiauper ) 
    270267            END DO 
    271  
    272          ELSEIF ( niaufn == 1 ) THEN 
    273  
    274             !--------------------------------------------------------- 
    275             ! Linear hat-like, centred in middle of IAU interval  
    276             !--------------------------------------------------------- 
    277  
     268            !                             !--------------------------------------------------------- 
     269         ELSEIF ( niaufn == 1 ) THEN      ! Linear hat-like, centred in middle of IAU interval  
     270            !                             !--------------------------------------------------------- 
    278271            ! Compute the normalization factor 
    279             znorm = 0.0 
    280             IF ( MOD( iiauper, 2 ) == 0 ) THEN  ! Even number of time steps in IAU interval 
     272            znorm = 0._wp 
     273            IF( MOD( iiauper, 2 ) == 0 ) THEN   ! Even number of time steps in IAU interval 
    281274               imid = iiauper / 2  
    282275               DO jt = 1, imid 
     
    284277               END DO 
    285278               znorm = 2.0 * znorm 
    286             ELSE                               ! Odd number of time steps in IAU interval 
     279            ELSE                                ! Odd number of time steps in IAU interval 
    287280               imid = ( iiauper + 1 ) / 2         
    288281               DO jt = 1, imid - 1 
     
    292285            ENDIF 
    293286            znorm = 1.0 / znorm 
    294  
     287            ! 
    295288            DO jt = 1, imid - 1 
    296289               wgtiau(jt+nitiaustr-1) = REAL( jt ) * znorm 
     
    299292               wgtiau(jt+nitiaustr-1) = REAL( iiauper - jt + 1 ) * znorm 
    300293            END DO 
    301  
     294            ! 
    302295         ENDIF 
    303296 
     
    325318      !-------------------------------------------------------------------- 
    326319 
    327       ALLOCATE( t_bkginc(jpi,jpj,jpk) ) 
    328       ALLOCATE( s_bkginc(jpi,jpj,jpk) ) 
    329       ALLOCATE( u_bkginc(jpi,jpj,jpk) ) 
    330       ALLOCATE( v_bkginc(jpi,jpj,jpk) ) 
    331       ALLOCATE( ssh_bkginc(jpi,jpj)   ) 
    332       ALLOCATE( seaice_bkginc(jpi,jpj)) 
    333       t_bkginc     (:,:,:) = 0._wp 
    334       s_bkginc     (:,:,:) = 0._wp 
    335       u_bkginc     (:,:,:) = 0._wp 
    336       v_bkginc     (:,:,:) = 0._wp 
    337       ssh_bkginc   (:,:)   = 0._wp 
    338       seaice_bkginc(:,:)   = 0._wp 
     320      ALLOCATE( t_bkginc     (jpi,jpj,jpk) )   ;   t_bkginc     (:,:,:) = 0._wp 
     321      ALLOCATE( s_bkginc     (jpi,jpj,jpk) )   ;   s_bkginc     (:,:,:) = 0._wp 
     322      ALLOCATE( u_bkginc     (jpi,jpj,jpk) )   ;   u_bkginc     (:,:,:) = 0._wp 
     323      ALLOCATE( v_bkginc     (jpi,jpj,jpk) )   ;   v_bkginc     (:,:,:) = 0._wp 
     324      ALLOCATE( ssh_bkginc   (jpi,jpj)     )   ;   ssh_bkginc   (:,:)   = 0._wp 
     325      ALLOCATE( seaice_bkginc(jpi,jpj)     )   ;   seaice_bkginc(:,:)   = 0._wp 
    339326#if defined key_asminc 
    340       ALLOCATE( ssh_iau(jpi,jpj)      ) 
    341       ssh_iau      (:,:)   = 0._wp 
     327      ALLOCATE( ssh_iau      (jpi,jpj)     )   ;   ssh_iau      (:,:)   = 0._wp 
    342328#endif 
    343329#if defined key_cice && defined key_asminc 
    344       ALLOCATE( ndaice_da(jpi,jpj)    ) 
    345       ndaice_da    (:,:)   = 0._wp 
    346 #endif 
    347       IF ( ( ln_trainc ).OR.( ln_dyninc ).OR.( ln_sshinc ).OR.( ln_seaiceinc ) ) THEN 
    348  
    349          !-------------------------------------------------------------------- 
    350          ! Read the increments from file 
    351          !-------------------------------------------------------------------- 
    352  
     330      ALLOCATE( ndaice_da    (jpi,jpj)     )   ;   ndaice_da    (:,:)   = 0._wp 
     331#endif 
     332      ! 
     333      IF ( ln_trainc .OR. ln_dyninc .OR.   &       !-------------------------------------- 
     334         & ln_sshinc .OR. ln_seaiceinc   ) THEN    ! Read the increments from file 
     335         !                                         !-------------------------------------- 
    353336         CALL iom_open( c_asminc, inum ) 
    354  
    355          CALL iom_get( inum, 'time', zdate_inc )  
    356  
     337         ! 
     338         CALL iom_get( inum, 'time'       , zdate_inc   )  
    357339         CALL iom_get( inum, 'z_inc_dateb', z_inc_dateb ) 
    358340         CALL iom_get( inum, 'z_inc_datef', z_inc_datef ) 
    359341         z_inc_dateb = zdate_inc 
    360342         z_inc_datef = zdate_inc 
    361  
     343         ! 
    362344         IF(lwp) THEN 
    363345            WRITE(numout,*)  
    364             WRITE(numout,*) 'asm_inc_init : Assimilation increments valid ', & 
    365                &            ' between dates ', z_inc_dateb,' and ',  & 
    366                &            z_inc_datef 
     346            WRITE(numout,*) 'asm_inc_init : Assimilation increments valid between dates ', z_inc_dateb,' and ', z_inc_datef 
    367347            WRITE(numout,*) '~~~~~~~~~~~~' 
    368348         ENDIF 
    369  
    370          IF (     ( z_inc_dateb < ndastp + nn_time0*0.0001_wp ) & 
    371             & .OR.( z_inc_datef > ditend_date ) ) & 
    372             & CALL ctl_warn( ' Validity time of assimilation increments is ', & 
    373             &                ' outside the assimilation interval' ) 
     349         ! 
     350         IF ( ( z_inc_dateb < ndastp + nn_time0*0.0001_wp ) .OR.  & 
     351            & ( z_inc_datef > ditend_date ) ) & 
     352            &    CALL ctl_warn( ' Validity time of assimilation increments is ', & 
     353            &                   ' outside the assimilation interval' ) 
    374354 
    375355         IF ( ( ln_asmdin ).AND.( zdate_inc /= ditdin_date ) ) & 
     
    418398            WHERE( ABS( seaice_bkginc(:,:) ) > 1.0e+10 ) seaice_bkginc(:,:) = 0.0 
    419399         ENDIF 
    420  
     400         ! 
    421401         CALL iom_close( inum ) 
    422   
    423       ENDIF 
    424  
    425       !----------------------------------------------------------------------- 
    426       ! Apply divergence damping filter 
    427       !----------------------------------------------------------------------- 
    428  
    429       IF ( ln_dyninc .AND. nn_divdmp > 0 ) THEN 
    430          ! 
     402         ! 
     403      ENDIF 
     404      ! 
     405      !                                            !-------------------------------------- 
     406      IF ( ln_dyninc .AND. nn_divdmp > 0 ) THEN    ! Apply divergence damping filter 
     407         !                                         !-------------------------------------- 
    431408         ALLOCATE( zhdiv(jpi,jpj) )  
    432409         ! 
     
    460437         ! 
    461438      ENDIF 
    462  
    463       !----------------------------------------------------------------------- 
    464       ! Allocate and initialize the background state arrays 
    465       !----------------------------------------------------------------------- 
    466  
    467       IF ( ln_asmdin ) THEN 
    468          ! 
    469          ALLOCATE( t_bkg(jpi,jpj,jpk) ) 
    470          ALLOCATE( s_bkg(jpi,jpj,jpk) ) 
    471          ALLOCATE( u_bkg(jpi,jpj,jpk) ) 
    472          ALLOCATE( v_bkg(jpi,jpj,jpk) ) 
    473          ALLOCATE( ssh_bkg(jpi,jpj)   ) 
    474          ! 
    475          t_bkg(:,:,:) = 0._wp 
    476          s_bkg(:,:,:) = 0._wp 
    477          u_bkg(:,:,:) = 0._wp 
    478          v_bkg(:,:,:) = 0._wp 
    479          ssh_bkg(:,:) = 0._wp 
     439      ! 
     440      !                             !----------------------------------------------------- 
     441      IF ( ln_asmdin ) THEN         ! Allocate and initialize the background state arrays 
     442         !                          !----------------------------------------------------- 
     443         ! 
     444         ALLOCATE( t_bkg  (jpi,jpj,jpk) )   ;   t_bkg  (:,:,:) = 0._wp 
     445         ALLOCATE( s_bkg  (jpi,jpj,jpk) )   ;   s_bkg  (:,:,:) = 0._wp 
     446         ALLOCATE( u_bkg  (jpi,jpj,jpk) )   ;   u_bkg  (:,:,:) = 0._wp 
     447         ALLOCATE( v_bkg  (jpi,jpj,jpk) )   ;   v_bkg  (:,:,:) = 0._wp 
     448         ALLOCATE( ssh_bkg(jpi,jpj)     )   ;   ssh_bkg(:,:)   = 0._wp 
     449         ! 
    480450         ! 
    481451         !-------------------------------------------------------------------- 
     
    489459         IF(lwp) THEN 
    490460            WRITE(numout,*)  
    491             WRITE(numout,*) 'asm_inc_init : Assimilation background state valid at : ', & 
    492                &  zdate_bkg 
    493             WRITE(numout,*) '~~~~~~~~~~~~' 
    494          ENDIF 
    495          ! 
    496          IF ( zdate_bkg /= ditdin_date ) & 
     461            WRITE(numout,*) '   ==>>>  Assimilation background state valid at : ', zdate_bkg 
     462            WRITE(numout,*) 
     463         ENDIF 
     464         ! 
     465         IF ( zdate_bkg /= ditdin_date )   & 
    497466            & CALL ctl_warn( ' Validity time of assimilation background state does', & 
    498467            &                ' not agree with Direct Initialization time' ) 
     
    521490      ENDIF 
    522491      ! 
     492      IF(lwp) WRITE(numout,*) '   ==>>>   Euler time step switch is ', neuler 
     493      ! 
     494      IF( lk_asminc ) THEN                            !==  data assimilation  ==! 
     495         IF( ln_bkgwri )   CALL asm_bkg_wri( nit000 - 1 )      ! Output background fields 
     496         IF( ln_asmdin ) THEN                                  ! Direct initialization 
     497            IF( ln_trainc )   CALL tra_asm_inc( nit000 - 1 )      ! Tracers 
     498            IF( ln_dyninc )   CALL dyn_asm_inc( nit000 - 1 )      ! Dynamics 
     499            IF( ln_sshinc )   CALL ssh_asm_inc( nit000 - 1 )      ! SSH 
     500         ENDIF 
     501      ENDIF 
     502      ! 
    523503   END SUBROUTINE asm_inc_init 
     504    
     505    
    524506   SUBROUTINE tra_asm_inc( kt ) 
    525507      !!---------------------------------------------------------------------- 
     
    786768   END SUBROUTINE ssh_asm_inc 
    787769 
     770 
    788771   SUBROUTINE ssh_asm_div( kt, phdivn ) 
    789772      !!---------------------------------------------------------------------- 
     
    824807   END SUBROUTINE ssh_asm_div 
    825808 
     809 
    826810   SUBROUTINE seaice_asm_inc( kt, kindic ) 
    827811      !!---------------------------------------------------------------------- 
     
    886870            ! seaice salinity balancing (to add) 
    887871#endif 
    888  
     872            ! 
    889873#if defined key_cice && defined key_asminc 
    890874            ! Sea-ice : CICE case. Pass ice increment tendency into CICE 
    891875            ndaice_da(:,:) = seaice_bkginc(:,:) * zincwgt / rdt 
    892876#endif 
    893  
     877            ! 
    894878            IF ( kt == nitiaufin_r ) THEN 
    895879               DEALLOCATE( seaice_bkginc ) 
    896880            ENDIF 
    897  
     881            ! 
    898882         ELSE 
    899  
     883            ! 
    900884#if defined key_cice && defined key_asminc 
    901885            ndaice_da(:,:) = 0._wp        ! Sea-ice : CICE case. Zero ice increment tendency into CICE 
    902886#endif 
    903  
     887            ! 
    904888         ENDIF 
    905889         !                          !----------------------------------------- 
     
    949933#if defined key_cice && defined key_asminc 
    950934            ndaice_da(:,:) = 0._wp     ! Sea-ice : CICE case. Zero ice increment tendency into CICE 
    951  
    952935#endif 
    953936            ! 
  • branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90

    r9210 r9213  
    2828   !!             -   ! 2010-10  (C. Ethe, G. Madec) reorganisation of initialisation phase 
    2929   !!            3.3.1! 2011-01  (A. R. Porter, STFC Daresbury) dynamical allocation 
    30    !!            3.4  ! 2011-10  (A. C. Coward, NOCS & J. Donners, PRACE) add nemo_northcomms 
     30   !!            3.4  ! 2011-10  (A. C. Coward, NOCS & J. Donners, PRACE) add nemo_nfdcom 
    3131   !!             -   ! 2011-11  (C. Harris) decomposition changes for running with CICE 
    3232   !!            3.6  ! 2012-05  (C. Calone, J. Simeon, G. Madec, C. Ethe) Add grid coarsening  
    33    !!             -   ! 2013-06  (I. Epicoco, S. Mocavero, CMCC) nemo_northcomms: setup avoiding MPI communication  
     33   !!             -   ! 2013-06  (I. Epicoco, S. Mocavero, CMCC) nemo_nfdcom: setup avoiding MPI communication  
    3434   !!             -   ! 2014-12  (G. Madec) remove KPP scheme and cross-land advection (cla) 
    3535   !!            4.0  ! 2016-10  (G. Madec, S. Flavoni)  domain configuration / user defined interface 
     
    4444   !!   nemo_partition: calculate MPP domain decomposition 
    4545   !!   factorise     : calculate the factors of the no. of MPI processes 
     46   !!   nemo_nfdcom   : Setup for north fold exchanges with explicit point-to-point messaging 
    4647   !!---------------------------------------------------------------------- 
    4748   USE step_oce       ! module used in the ocean time stepping module (step.F90) 
     
    8889   USE lib_mpp        ! distributed memory computing 
    8990   USE mppini         ! shared/distributed memory setting (mpp_init routine) 
    90    USE lbcnfd , ONLY : isendto, nsndto, nfsloop, nfeloop   ! Setup of north fold exchanges  
     91   USE lbcnfd  , ONLY : isendto, nsndto, nfsloop, nfeloop   ! Setup of north fold exchanges  
    9192   USE lib_fortran    ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined) 
    9293#if defined key_iomput 
     
    104105 
    105106   !!---------------------------------------------------------------------- 
    106    !! NEMO/OPA 3.7 , NEMO Consortium (2016) 
     107   !! NEMO/OPA 4.0 , NEMO Consortium (2018) 
    107108   !! $Id$ 
    108109   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt) 
     
    130131      CALL Agrif_Init_Grids()      ! AGRIF: set the meshes 
    131132#endif 
    132       ! 
    133133      !                            !-----------------------! 
    134134      CALL nemo_init               !==  Initialisations  ==! 
     
    161161      END DO 
    162162#else 
    163  
    164 !!gm     This data assimilation calls should be part of the initialisation (i.e. put in asm_inc_init) 
    165       ! 
    166       IF( lk_asminc ) THEN                            !==  data assimilation  ==!   (done prior to time stepping) 
    167          IF( ln_bkgwri )   CALL asm_bkg_wri( nit000 - 1 )      ! Output background fields 
    168          IF( ln_asmdin ) THEN                                  ! Direct initialization 
    169             IF( ln_trainc )   CALL tra_asm_inc( nit000 - 1 )      ! Tracers 
    170             IF( ln_dyninc )   CALL dyn_asm_inc( nit000 - 1 )      ! Dynamics 
    171             IF( ln_sshinc )   CALL ssh_asm_inc( nit000 - 1 )      ! SSH 
    172          ENDIF 
    173       ENDIF 
    174 !!gm end 
    175163      ! 
    176164# if defined key_agrif 
    177165      !                                               !==  AGRIF time-stepping  ==! 
    178166      CALL Agrif_Regrid() 
     167      ! 
    179168      DO WHILE( istp <= nitend .AND. nstop == 0 ) 
    180169         CALL stp 
     
    222211      IF( nstop /= 0 .AND. lwp ) THEN        ! error print 
    223212         WRITE(numout,cform_err) 
    224          WRITE(numout,*) 'nemo_gcm: a total of ', nstop, ' errors have been found' 
     213         WRITE(numout,*) '   ==>>>   nemo_gcm: a total of ', nstop, ' errors have been found' 
    225214         WRITE(numout,*) 
    226215      ENDIF 
     
    249238      !!---------------------------------------------------------------------- 
    250239      INTEGER  ::   ji                 ! dummy loop indices 
    251       INTEGER  ::   ios, ilocal_comm   ! local integer 
    252       INTEGER  ::   iiarea, ijarea     ! local integers 
    253       INTEGER  ::   iirest, ijrest     ! local integers 
     240      INTEGER  ::   ios, ilocal_comm   ! local integers 
     241      INTEGER  ::   iiarea, ijarea     !   -       - 
     242      INTEGER  ::   iirest, ijrest     !   -       - 
    254243      CHARACTER(len=120), DIMENSION(30) ::   cltxt, cltxt2, clnam 
    255       ! 
     244      !! 
    256245      NAMELIST/namctl/ ln_ctl   , nn_print, nn_ictls, nn_ictle,   & 
    257246         &             nn_isplt , nn_jsplt, nn_jctls, nn_jctle,   & 
    258247         &             ln_timing, ln_diacfl 
    259       NAMELIST/namcfg/ ln_read_cfg, cn_domcfg, ln_write_cfg, cn_domcfg_out, ln_use_jattr, ln_closea 
     248      NAMELIST/namcfg/ ln_read_cfg, cn_domcfg, ln_closea, ln_write_cfg, cn_domcfg_out, ln_use_jattr 
    260249      !!---------------------------------------------------------------------- 
    261250      ! 
     
    269258      CALL ctl_opn( numnam_cfg, 'namelist_cfg', 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, 6, .FALSE. ) 
    270259      ! 
    271       REWIND( numnam_ref )              ! Namelist namctl in reference namelist : Control prints 
     260      REWIND( numnam_ref )              ! Namelist namctl in reference namelist 
    272261      READ  ( numnam_ref, namctl, IOSTAT = ios, ERR = 901 ) 
    273262901   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namctl in reference namelist', .TRUE. ) 
     
    276265902   IF( ios >  0 )   CALL ctl_nam ( ios , 'namctl in configuration namelist', .TRUE. ) 
    277266      ! 
    278       REWIND( numnam_ref )              ! Namelist namcfg in reference namelist : Control prints 
     267      REWIND( numnam_ref )              ! Namelist namcfg in reference namelist 
    279268      READ  ( numnam_ref, namcfg, IOSTAT = ios, ERR = 903 ) 
    280269903   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namcfg in reference namelist', .TRUE. ) 
    281       REWIND( numnam_cfg )              ! Namelist namcfg in confguration namelist : Control prints & Benchmark 
     270      REWIND( numnam_cfg )              ! Namelist namcfg in confguration namelist 
    282271      READ  ( numnam_cfg, namcfg, IOSTAT = ios, ERR = 904 ) 
    283272904   IF( ios >  0 )   CALL ctl_nam ( ios , 'namcfg in configuration namelist', .TRUE. )    
     
    435424 
    436425      !                                      ! Domain decomposition 
    437       CALL mpp_init 
    438       IF( ln_nnogather )   CALL nemo_northcomms! northfold neighbour lists 
    439       ! 
    440       IF( ln_timing    )   CALL timing_init 
     426      CALL mpp_init                             ! MPP 
     427      IF( ln_nnogather )   CALL nemo_nfdcom     ! northfold neighbour lists 
    441428      ! 
    442429      !                                      ! General initialization 
    443                            CALL     phy_cst    ! Physical constants 
    444                            CALL     eos_init   ! Equation of state 
    445       IF( lk_c1d       )   CALL     c1d_init   ! 1D column configuration 
    446                            CALL     wad_init   ! Wetting and drying options 
    447                            CALL     dom_init   ! Domain 
    448       IF( ln_crs       )   CALL     crs_init   ! coarsened grid: domain initialization  
    449       IF( ln_ctl       )   CALL prt_ctl_init   ! Print control 
     430      IF( ln_timing    )   CALL timing_init     ! timing 
     431      IF( ln_timing    )   CALL timing_start( 'nemo_init') 
     432      ! 
     433                           CALL     phy_cst     ! Physical constants 
     434                           CALL     eos_init    ! Equation of state 
     435      IF( lk_c1d       )   CALL     c1d_init    ! 1D column configuration 
     436                           CALL     wad_init    ! Wetting and drying options 
     437                           CALL     dom_init    ! Domain 
     438      IF( ln_crs       )   CALL     crs_init    ! coarsened grid: domain initialization  
     439      IF( ln_ctl       )   CALL prt_ctl_init    ! Print control 
    450440       
    451       CALL diurnal_sst_bulk_init             ! diurnal sst 
    452       IF ( ln_diurnal ) CALL diurnal_sst_coolskin_init   ! cool skin    
     441      CALL diurnal_sst_bulk_init                ! diurnal sst 
     442      IF( ln_diurnal   )   CALL diurnal_sst_coolskin_init   ! cool skin    
     443      !                             
     444      IF( ln_diurnal_only ) THEN                   ! diurnal only: a subset of the initialisation routines 
     445         CALL  istate_init                            ! ocean initial state (Dynamics and tracers) 
     446         CALL     sbc_init                            ! Forcings : surface module 
     447         CALL tra_qsr_init                            ! penetrative solar radiation qsr 
     448         IF( ln_diaobs ) THEN                         ! Observation & model comparison 
     449            CALL dia_obs_init                            ! Initialize observational data 
     450            CALL dia_obs( nit000 - 1 )                   ! Observation operator for restart 
     451         ENDIF      
     452         IF( lk_asminc )   CALL asm_inc_init          ! Assimilation increments 
     453         ! 
     454         RETURN                                       ! end of initialization 
     455      ENDIF 
    453456       
    454       ! IF ln_diurnal_only, then we only want a subset of the initialisation routines 
    455       IF( ln_diurnal_only ) THEN 
    456          CALL  istate_init   ! ocean initial state (Dynamics and tracers) 
    457          CALL     sbc_init   ! Forcings : surface module 
    458          CALL tra_qsr_init   ! penetrative solar radiation qsr 
    459          IF( ln_diaobs ) THEN                   ! Observation & model comparison 
    460             CALL dia_obs_init                      ! Initialize observational data 
    461             CALL dia_obs( nit000 - 1 )             ! Observation operator for restart 
    462          ENDIF      
    463          !                                     ! Assimilation increments 
    464          IF( lk_asminc )   CALL asm_inc_init   ! Initialize assimilation increments 
    465                   
    466          IF(lwp) WRITE(numout,*) 'Euler time step switch is ', neuler 
    467          RETURN 
    468       ENDIF 
    469        
    470                            CALL  istate_init   ! ocean initial state (Dynamics and tracers) 
     457                           CALL  istate_init    ! ocean initial state (Dynamics and tracers) 
    471458 
    472459      !                                      ! external forcing  
    473                            CALL    tide_init   ! tidal harmonics 
    474                            CALL     sbc_init   ! surface boundary conditions (including sea-ice) 
    475                            CALL     bdy_init   ! Open boundaries initialisation 
     460                           CALL    tide_init    ! tidal harmonics 
     461                           CALL     sbc_init    ! surface boundary conditions (including sea-ice) 
     462                           CALL     bdy_init    ! Open boundaries initialisation 
    476463 
    477464      !                                      ! Ocean physics 
     
    520507                           CALL     trd_init    ! Mixed-layer/Vorticity/Integral constraints trends 
    521508                           CALL dia_obs_init    ! Initialize observational data 
    522       IF( ln_diaobs    )   CALL dia_obs( nit000 - 1 )   ! Observation operator for restart 
     509                           CALL dia_tmb_init    ! TMB outputs 
     510                           CALL dia_25h_init    ! 25h mean  outputs 
     511      IF( ln_diaobs    )   CALL dia_obs( nit000-1 )   ! Observation operator for restart 
    523512 
    524513      !                                      ! Assimilation increments 
    525514      IF( lk_asminc    )   CALL asm_inc_init    ! Initialize assimilation increments 
    526       IF(lwp) WRITE(numout,*) 'Euler time step switch is ', neuler 
    527                            CALL dia_tmb_init    ! TMB outputs 
    528                            CALL dia_25h_init    ! 25h mean  outputs 
     515      ! 
     516      IF(lwp) WRITE(numout,cform_aaa)           ! Flag AAAAAAA 
     517      ! 
     518      IF( ln_timing    )   CALL timing_stop( 'nemo_init') 
    529519      ! 
    530520   END SUBROUTINE nemo_init 
     
    543533         WRITE(numout,*) 
    544534         WRITE(numout,*) 'nemo_ctl: Control prints' 
    545          WRITE(numout,*) '~~~~~~~ ' 
     535         WRITE(numout,*) '~~~~~~~~' 
    546536         WRITE(numout,*) '   Namelist namctl' 
    547537         WRITE(numout,*) '      run control (for debugging)     ln_ctl     = ', ln_ctl 
     
    563553      njctle    = nn_jctle 
    564554      isplt     = nn_isplt 
    565       jsplt     = nn_jsplt       
     555      jsplt     = nn_jsplt 
    566556 
    567557      IF(lwp) THEN                  ! control print 
    568558         WRITE(numout,*) 
    569          WRITE(numout,*) 'namcfg : configuration initialization through namelist read' 
    570          WRITE(numout,*) '~~~~~~ ' 
    571559         WRITE(numout,*) '   Namelist namcfg' 
    572560         WRITE(numout,*) '      read domain configuration file                ln_read_cfg      = ', ln_read_cfg 
    573561         WRITE(numout,*) '         filename to be read                           cn_domcfg     = ', TRIM(cn_domcfg) 
    574          WRITE(numout,*) '      write configuration definition file           ln_write_cfg     = ', ln_write_cfg 
     562         WRITE(numout,*) '         keep closed seas in the domain (if exist)     ln_closea     = ', ln_closea 
     563         WRITE(numout,*) '      create a configuration definition file        ln_write_cfg     = ', ln_write_cfg 
    575564         WRITE(numout,*) '         filename to be written                        cn_domcfg_out = ', TRIM(cn_domcfg_out) 
    576565         WRITE(numout,*) '      use file attribute if exists as i/p j-start   ln_use_jattr     = ', ln_use_jattr 
    577566      ENDIF 
     567      IF( .NOT.ln_read_cfg )   ln_closea = .false.   ! dealing possible only with a domcfg file 
     568      ! 
    578569      !                             ! Parameter control 
    579570      ! 
     
    615606      ENDIF 
    616607      ! 
    617       IF( 1_wp /= SIGN(1._wp,-0._wp)  )   CALL ctl_stop( 'nemo_ctl: The intrinsec SIGN function follows ',  & 
    618          &                                               'f2003 standard. '                              ,  & 
    619          &                                               'Compile with key_nosignedzero enabled' ) 
     608      IF( 1._wp /= SIGN(1._wp,-0._wp)  )   CALL ctl_stop( 'nemo_ctl: The intrinsec SIGN function follows f2003 standard.',  & 
     609         &                                                'Compile with key_nosignedzero enabled' ) 
    620610      ! 
    621611#if defined key_agrif 
     
    664654      !! ** Method  : 
    665655      !!---------------------------------------------------------------------- 
    666       USE diawri    , ONLY: dia_wri_alloc 
    667       USE dom_oce   , ONLY: dom_oce_alloc 
    668       USE trc_oce   , ONLY: trc_oce_alloc 
     656      USE diawri    , ONLY : dia_wri_alloc 
     657      USE dom_oce   , ONLY : dom_oce_alloc 
     658      USE trc_oce   , ONLY : trc_oce_alloc 
     659      USE bdy_oce   , ONLY : bdy_oce_alloc 
    669660#if defined key_diadct  
    670       USE diadct    , ONLY: diadct_alloc  
     661      USE diadct    , ONLY : diadct_alloc  
    671662#endif  
    672       USE bdy_oce   , ONLY: bdy_oce_alloc 
    673663      ! 
    674664      INTEGER :: ierr 
    675665      !!---------------------------------------------------------------------- 
    676666      ! 
    677       ierr =        oce_alloc       ()          ! ocean  
    678       ierr = ierr + dia_wri_alloc   () 
    679       ierr = ierr + dom_oce_alloc   ()          ! ocean domain 
    680       ierr = ierr + zdf_oce_alloc   ()          ! ocean vertical physics 
    681       ! 
    682       ierr = ierr + trc_oce_alloc   ()          ! shared TRC / TRA arrays 
     667      ierr =        oce_alloc    ()    ! ocean  
     668      ierr = ierr + dia_wri_alloc() 
     669      ierr = ierr + dom_oce_alloc()    ! ocean domain 
     670      ierr = ierr + zdf_oce_alloc()    ! ocean vertical physics 
     671      ierr = ierr + trc_oce_alloc()    ! shared TRC / TRA arrays 
     672      ierr = ierr + bdy_oce_alloc()    ! bdy masks (incl. initialization) 
    683673      ! 
    684674#if defined key_diadct  
    685       ierr = ierr + diadct_alloc    ()          !  
     675      ierr = ierr + diadct_alloc ()    !  
    686676#endif  
    687       ierr = ierr + bdy_oce_alloc   ()          ! bdy masks (incl. initialization) 
    688677      ! 
    689678      IF( lk_mpp    )   CALL mpp_sum( ierr ) 
    690       IF( ierr /= 0 )   CALL ctl_stop( 'STOP', 'nemo_alloc : unable to allocate standard ocean arrays' ) 
     679      IF( ierr /= 0 )   CALL ctl_stop( 'STOP', 'nemo_alloc: unable to allocate standard ocean arrays' ) 
    691680      ! 
    692681   END SUBROUTINE nemo_alloc 
     
    766755      knfax = 0 
    767756      ! 
    768       ! Find the factors of n. 
    769       IF( kn .NE. 1 ) THEN 
    770  
     757      IF( kn /= 1 ) THEN      ! Find the factors of n 
     758         ! 
    771759         ! nu holds the unfactorised part of the number. 
    772760         ! knfax holds the number of factors found. 
     
    781769            ifac = ilfax(jl) 
    782770            IF( ifac > inu )   CYCLE 
    783     
     771            ! 
    784772            ! Test whether the factor will divide. 
    785     
     773            ! 
    786774            IF( MOD(inu,ifac) == 0 ) THEN 
    787775               ! 
     
    807795#if defined key_mpp_mpi 
    808796 
    809    SUBROUTINE nemo_northcomms 
    810       !!---------------------------------------------------------------------- 
    811       !!                     ***  ROUTINE  nemo_northcomms  *** 
     797   SUBROUTINE nemo_nfdcom 
     798      !!---------------------------------------------------------------------- 
     799      !!                     ***  ROUTINE  nemo_nfdcom  *** 
    812800      !! ** Purpose :   Setup for north fold exchanges with explicit  
    813801      !!                point-to-point messaging 
     
    828816      nsndto     = 0 
    829817      ! 
    830       !if I am a process in the north 
    831       IF ( njmpp == njmppmax ) THEN 
    832           !sxM is the first point (in the global domain) needed to compute the 
    833           !north-fold for the current process 
    834           sxM = jpiglo - nimppt(narea) - nlcit(narea) + 1 
    835           !dxM is the last point (in the global domain) needed to compute the 
    836           !north-fold for the current process 
    837           dxM = jpiglo - nimppt(narea) + 2 
    838  
    839           !loop over the other north-fold processes to find the processes 
    840           !managing the points belonging to the sxT-dxT range 
    841    
    842           DO jn = 1, jpni 
    843                 !sxT is the first point (in the global domain) of the jn 
    844                 !process 
    845                 sxT = nfiimpp(jn, jpnj) 
    846                 !dxT is the last point (in the global domain) of the jn 
    847                 !process 
    848                 dxT = nfiimpp(jn, jpnj) + nfilcit(jn, jpnj) - 1 
    849                 IF ((sxM .gt. sxT) .AND. (sxM .lt. dxT)) THEN 
    850                    nsndto = nsndto + 1 
    851                    isendto(nsndto) = jn 
    852                 ELSEIF ((sxM .le. sxT) .AND. (dxM .ge. dxT)) THEN 
    853                    nsndto = nsndto + 1 
    854                    isendto(nsndto) = jn 
    855                 ELSEIF ((dxM .lt. dxT) .AND. (sxT .lt. dxM)) THEN 
    856                    nsndto = nsndto + 1 
    857                    isendto(nsndto) = jn 
    858                 ENDIF 
    859           END DO 
    860           nfsloop = 1 
    861           nfeloop = nlci 
    862           DO jn = 2,jpni-1 
    863            IF(nfipproc(jn,jpnj) .eq. (narea - 1)) THEN 
    864               IF (nfipproc(jn - 1 ,jpnj) .eq. -1) THEN 
    865                  nfsloop = nldi 
    866               ENDIF 
    867               IF (nfipproc(jn + 1,jpnj) .eq. -1) THEN 
    868                  nfeloop = nlei 
    869               ENDIF 
    870            ENDIF 
    871         END DO 
    872  
     818      IF ( njmpp == njmppmax ) THEN      ! if I am a process in the north 
     819         ! 
     820         !sxM is the first point (in the global domain) needed to compute the north-fold for the current process 
     821         sxM = jpiglo - nimppt(narea) - nlcit(narea) + 1 
     822         !dxM is the last point (in the global domain) needed to compute the north-fold for the current process 
     823         dxM = jpiglo - nimppt(narea) + 2 
     824         ! 
     825         ! loop over the other north-fold processes to find the processes 
     826         ! managing the points belonging to the sxT-dxT range 
     827         ! 
     828         DO jn = 1, jpni 
     829            ! 
     830            sxT = nfiimpp(jn, jpnj)                            ! sxT = 1st  point (in the global domain) of the jn process 
     831            dxT = nfiimpp(jn, jpnj) + nfilcit(jn, jpnj) - 1    ! dxT = last point (in the global domain) of the jn process 
     832            ! 
     833            IF    ( sxT < sxM  .AND.  sxM < dxT ) THEN 
     834               nsndto          = nsndto + 1 
     835               isendto(nsndto) = jn 
     836            ELSEIF( sxM <= sxT  .AND.  dxM >= dxT ) THEN 
     837               nsndto          = nsndto + 1 
     838               isendto(nsndto) = jn 
     839            ELSEIF( dxM <  dxT  .AND.  sxT <  dxM ) THEN 
     840               nsndto          = nsndto + 1 
     841               isendto(nsndto) = jn 
     842            ENDIF 
     843            ! 
     844         END DO 
     845         nfsloop = 1 
     846         nfeloop = nlci 
     847         DO jn = 2,jpni-1 
     848            IF( nfipproc(jn,jpnj) == (narea - 1) ) THEN 
     849               IF( nfipproc(jn-1,jpnj) == -1 )   nfsloop = nldi 
     850               IF( nfipproc(jn+1,jpnj) == -1 )   nfeloop = nlei 
     851            ENDIF 
     852         END DO 
     853         ! 
    873854      ENDIF 
    874855      l_north_nogather = .TRUE. 
    875    END SUBROUTINE nemo_northcomms 
     856      ! 
     857   END SUBROUTINE nemo_nfdcom 
    876858 
    877859#else 
    878    SUBROUTINE nemo_northcomms      ! Dummy routine 
    879       WRITE(*,*) 'nemo_northcomms: You should not have seen this print! error?' 
    880    END SUBROUTINE nemo_northcomms 
     860   SUBROUTINE nemo_nfdcom      ! Dummy routine 
     861      WRITE(*,*) 'nemo_nfdcom: You should not have seen this print! error?' 
     862   END SUBROUTINE nemo_nfdcom 
    881863#endif 
    882864 
  • branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/step_oce.F90

    r9023 r9213  
    8282   USE diaharm 
    8383   USE diacfl 
     84   USE diaobs          ! Observation operator 
    8485   USE flo_oce         ! floats variables 
    8586   USE floats          ! floats computation               (flo_stp routine) 
     
    9394   USE restart         ! ocean restart                    (rst_wri routine) 
    9495   USE prtctl          ! Print control                    (prt_ctl routine) 
    95  
    96    USE diaobs          ! Observation operator 
    9796 
    9897   USE in_out_manager  ! I/O manager 
Note: See TracChangeset for help on using the changeset viewer.