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 3764 for branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/DOM – NEMO

Ignore:
Timestamp:
2013-01-23T15:33:04+01:00 (11 years ago)
Author:
smasson
Message:

dev_MERGE_2012: report bugfixes done in the trunk from r3555 to r3763 into dev_MERGE_2012

Location:
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/DOM
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/DOM/daymod.F90

    r3680 r3764  
    22   !!====================================================================== 
    33   !!                       ***  MODULE  daymod  *** 
    4    !! Ocean        :  calendar  
     4   !! Ocean        :  calendar 
    55   !!===================================================================== 
    66   !! History :  OPA  ! 1994-09  (M. Pontaud M. Imbard)  Original code 
    77   !!                 ! 1997-03  (O. Marti) 
    8    !!                 ! 1997-05  (G. Madec)  
     8   !!                 ! 1997-05  (G. Madec) 
    99   !!                 ! 1997-08  (M. Imbard) 
    1010   !!   NEMO     1.0  ! 2003-09  (G. Madec)  F90 + nyear, nmonth, nday 
    1111   !!                 ! 2004-01  (A.M. Treguier) new calculation based on adatrj 
    1212   !!                 ! 2006-08  (G. Madec)  surface module major update 
    13    !!----------------------------------------------------------------------       
     13   !!---------------------------------------------------------------------- 
    1414 
    1515   !!---------------------------------------------------------------------- 
    1616   !!   day        : calendar 
    17    !!   
     17   !! 
    1818   !!           ------------------------------- 
    1919   !!           ----------- WARNING ----------- 
     
    2424   !!           ----------- WARNING ----------- 
    2525   !!           ------------------------------- 
    26    !!   
     26   !! 
    2727   !!---------------------------------------------------------------------- 
    2828   USE dom_oce         ! ocean space and time domain 
    2929   USE phycst          ! physical constants 
    3030   USE in_out_manager  ! I/O manager 
    31    USE iom             !  
     31   USE iom             ! 
    3232   USE ioipsl, ONLY :   ymds2ju   ! for calendar 
    3333   USE prtctl          ! Print control 
     
    4141   PUBLIC   day        ! called by step.F90 
    4242   PUBLIC   day_init   ! called by istate.F90 
    43  
    44    INTEGER ::   nsecd, nsecd05, ndt, ndt05 
     43   PUBLIC   day_mth    ! Needed by TAM 
     44 
     45   INTEGER, PUBLIC ::   nsecd, nsecd05, ndt, ndt05 ! (PUBLIC for TAM) 
    4546 
    4647   !!---------------------------------------------------------------------- 
     
    5455      !!---------------------------------------------------------------------- 
    5556      !!                   ***  ROUTINE day_init  *** 
    56       !!  
    57       !! ** Purpose :   Initialization of the calendar values to their values 1 time step before nit000  
     57      !! 
     58      !! ** Purpose :   Initialization of the calendar values to their values 1 time step before nit000 
    5859      !!                because day will be called at the beginning of step 
    5960      !! 
     
    8182      ndt05   = NINT(0.5 * rdttra(1)) 
    8283 
    83       IF( .NOT. lk_offline ) CALL day_rst( nit000, 'READ' )  
     84      IF( .NOT. lk_offline ) CALL day_rst( nit000, 'READ' ) 
    8485 
    8586      ! set the calandar from ndastp (read in restart file and namelist) 
     
    8788      nyear   =   ndastp / 10000 
    8889      nmonth  = ( ndastp - (nyear * 10000) ) / 100 
    89       nday    =   ndastp - (nyear * 10000) - ( nmonth * 100 )  
     90      nday    =   ndastp - (nyear * 10000) - ( nmonth * 100 ) 
    9091 
    9192      CALL ymds2ju( nyear, nmonth, nday, 0.0, fjulday )  ! we assume that we start run at 00:00 
     
    9596      nsec1jan000 = 0 
    9697      CALL day_mth 
    97        
     98 
    9899      IF ( nday == 0 ) THEN     !   for ex if ndastp = ndate0 - 1 
    99          nmonth = nmonth - 1   
     100         nmonth = nmonth - 1 
    100101         nday = nmonth_len(nmonth) 
    101102      ENDIF 
     
    106107         IF( nleapy == 1 )   CALL day_mth 
    107108      ENDIF 
    108        
     109 
    109110      ! day since january 1st 
    110111      nday_year = nday + SUM( nmonth_len(1:nmonth - 1) ) 
    111112 
    112       !compute number of days between last monday and today       
     113      !compute number of days between last monday and today 
    113114      CALL ymds2ju( 1900, 01, 01, 0.0, zjul )  ! compute julian day value of 01.01.1900 (our reference that was a Monday) 
    114       inbday = NINT(fjulday - zjul)            ! compute nb day between  01.01.1900 and current day   
    115       idweek = MOD(inbday, 7)                  ! compute nb day between last monday and current day   
     115      inbday = NINT(fjulday - zjul)            ! compute nb day between  01.01.1900 and current day 
     116      idweek = MOD(inbday, 7)                  ! compute nb day between last monday and current day 
    116117 
    117118      ! number of seconds since the beginning of current year/month/week/day at the middle of the time-step 
     
    135136      !!---------------------------------------------------------------------- 
    136137      !!                   ***  ROUTINE day_init  *** 
    137       !!  
     138      !! 
    138139      !! ** Purpose :   calendar values related to the months 
    139140      !! 
     
    147148 
    148149      ! length of the month of the current year (from nleapy, read in namelist) 
    149       IF ( nleapy < 2 ) THEN  
     150      IF ( nleapy < 2 ) THEN 
    150151         nmonth_len(:) = (/ 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31 /) 
    151152         nyear_len(:) = 365 
     
    167168      ! time since Jan 1st   0     1     2    ...    11    12    13 
    168169      !          ---------*--|--*--|--*--| ... |--*--|--*--|--*--|-------------------------------------- 
    169       !                 <---> <---> <--->  ...  <---> <---> <--->         
     170      !                 <---> <---> <--->  ...  <---> <---> <---> 
    170171      ! month number      0     1     2    ...    11    12    13 
    171172      ! 
     
    180181         nmonth_end(jm) = nmonth_end(jm-1) + nsecd * nmonth_len(jm) 
    181182      END DO 
    182       !            
    183    END SUBROUTINE  
     183      ! 
     184   END SUBROUTINE 
    184185 
    185186 
     
    187188      !!---------------------------------------------------------------------- 
    188189      !!                      ***  ROUTINE day  *** 
    189       !!  
     190      !! 
    190191      !! ** Purpose :   Compute the date with a day iteration IF necessary. 
    191192      !! 
     
    199200      !!              - adatrj    : date in days since the beginning of the run 
    200201      !!              - nsec_year : current time of the year (in second since 00h, jan 1st) 
    201       !!----------------------------------------------------------------------       
     202      !!---------------------------------------------------------------------- 
    202203      INTEGER, INTENT(in) ::   kt        ! ocean time-step indices 
    203204      ! 
     
    210211      zprec = 0.1 / rday 
    211212      !                                                 ! New time-step 
    212       nsec_year  = nsec_year  + ndt  
    213       nsec_month = nsec_month + ndt                  
     213      nsec_year  = nsec_year  + ndt 
     214      nsec_month = nsec_month + ndt 
    214215      nsec_week  = nsec_week  + ndt 
    215       nsec_day   = nsec_day   + ndt                 
     216      nsec_day   = nsec_day   + ndt 
    216217      adatrj  = adatrj  + rdttra(1) / rday 
    217218      fjulday = fjulday + rdttra(1) / rday 
    218219      IF( ABS(fjulday - REAL(NINT(fjulday),wp)) < zprec )   fjulday = REAL(NINT(fjulday),wp)   ! avoid truncation error 
    219220      IF( ABS(adatrj  - REAL(NINT(adatrj ),wp)) < zprec )   adatrj  = REAL(NINT(adatrj ),wp)   ! avoid truncation error 
    220        
     221 
    221222      IF( nsec_day > nsecd ) THEN                       ! New day 
    222223         ! 
     
    251252 
    252253      IF( nsec_week > 7*nsecd )   nsec_week = ndt05     ! New week 
    253        
     254 
    254255      IF(ln_ctl) THEN 
    255256         WRITE(charout,FMT="('kt =', I4,'  d/m/y =',I2,I2,I4)") kt, nday, nmonth, nyear 
     
    268269      !!--------------------------------------------------------------------- 
    269270      !!                   ***  ROUTINE ts_rst  *** 
    270       !!  
     271      !! 
    271272      !!  ** Purpose : Read or write calendar in restart file: 
    272       !!  
     273      !! 
    273274      !!  WRITE(READ) mode: 
    274       !!       kt        : number of time step since the begining of the experiment at the  
     275      !!       kt        : number of time step since the begining of the experiment at the 
    275276      !!                   end of the current(previous) run 
    276       !!       adatrj(0) : number of elapsed days since the begining of the experiment at the  
     277      !!       adatrj(0) : number of elapsed days since the begining of the experiment at the 
    277278      !!                   end of the current(previous) run (REAL -> keep fractions of day) 
    278279      !!       ndastp    : date at the end of the current(previous) run (coded as yyyymmdd integer) 
    279       !!  
     280      !! 
    280281      !!   According to namelist parameter nrstdt, 
    281282      !!       nrstdt = 0  no control on the date (nit000 is  arbitrary). 
     
    295296      REAL(wp) ::   zkt, zndastp 
    296297      !!---------------------------------------------------------------------- 
    297        
     298 
    298299      IF( TRIM(cdrw) == 'READ' ) THEN 
    299300 
     
    312313               WRITE(numout,*) 
    313314            ENDIF 
    314             ! Control of date  
    315             IF( nit000 - NINT( zkt ) /= 1 .AND. nrstdt /= 0 )                                         &  
    316                  &   CALL ctl_stop( ' ===>>>> : problem with nit000 for the restart',                 &  
     315            ! Control of date 
     316            IF( nit000 - NINT( zkt ) /= 1 .AND. nrstdt /= 0 )                                         & 
     317                 &   CALL ctl_stop( ' ===>>>> : problem with nit000 for the restart',                 & 
    317318                 &                  ' verify the restart file or rerun with nrstdt = 0 (namelist)' ) 
    318319            ! define ndastp and adatrj 
    319             IF ( nrstdt == 2 ) THEN  
     320            IF ( nrstdt == 2 ) THEN 
    320321               ! read the parameters correspondting to nit000 - 1 (last time step of previous run) 
    321322               CALL iom_get( numror, 'ndastp', zndastp ) 
    322323               ndastp = NINT( zndastp ) 
    323324               CALL iom_get( numror, 'adatrj', adatrj  ) 
    324             ELSE  
     325            ELSE 
    325326               ! parameters correspondting to nit000 - 1 (as we start the step loop with a call to day) 
    326327               ndastp = ndate0 - 1     ! ndate0 read in the namelist in dom_nam, we assume that we start run at 00:00 
    327                adatrj = ( REAL( nit000-1, wp ) * rdttra(1) ) / rday  
    328                ! note this is wrong if time step has changed during run  
     328               adatrj = ( REAL( nit000-1, wp ) * rdttra(1) ) / rday 
     329               ! note this is wrong if time step has changed during run 
    329330            ENDIF 
    330331         ELSE 
    331332            ! parameters correspondting to nit000 - 1 (as we start the step loop with a call to day) 
    332333            ndastp = ndate0 - 1        ! ndate0 read in the namelist in dom_nam, we assume that we start run at 00:00 
    333             adatrj = ( REAL( nit000-1, wp ) * rdttra(1) ) / rday  
     334            adatrj = ( REAL( nit000-1, wp ) * rdttra(1) ) / rday 
    334335         ENDIF 
    335336         IF( ABS(adatrj  - REAL(NINT(adatrj),wp)) < 0.1 / rday )   adatrj = REAL(NINT(adatrj),wp)   ! avoid truncation error 
     
    347348            IF(lwp) WRITE(numout,*) 
    348349            IF(lwp) WRITE(numout,*) 'rst_write : write oce restart file  kt =', kt 
    349             IF(lwp) WRITE(numout,*) '~~~~~~~'          
     350            IF(lwp) WRITE(numout,*) '~~~~~~~' 
    350351         ENDIF 
    351352         ! calendar control 
    352          CALL iom_rstput( kt, nitrst, numrow, 'kt'     , REAL( kt    , wp) )   ! time-step  
     353         CALL iom_rstput( kt, nitrst, numrow, 'kt'     , REAL( kt    , wp) )   ! time-step 
    353354         CALL iom_rstput( kt, nitrst, numrow, 'ndastp' , REAL( ndastp, wp) )   ! date 
    354355         CALL iom_rstput( kt, nitrst, numrow, 'adatrj' , adatrj            )   ! number of elapsed days since 
  • branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/DOM/domain.F90

    r3680 r3764  
    6868      !!              - 1D configuration, move Coriolis, u and v at T-point 
    6969      !!---------------------------------------------------------------------- 
    70       INTEGER ::   jk                ! dummy loop argument 
    71       INTEGER ::   iconf = 0         ! temporary integers 
    72       !!---------------------------------------------------------------------- 
    73       ! 
    74       IF( nn_timing == 1 )  CALL timing_start('dom_init') 
     70      INTEGER ::   jk          ! dummy loop argument 
     71      INTEGER ::   iconf = 0   ! local integers 
     72      !!---------------------------------------------------------------------- 
     73      ! 
     74      IF( nn_timing == 1 )   CALL timing_start('dom_init') 
    7575      ! 
    7676      IF(lwp) THEN 
     
    8888      IF( lk_vvl         )   CALL dom_vvl      ! Vertical variable mesh 
    8989      ! 
    90       IF( lk_c1d ) THEN                        ! 1D configuration  
    91          CALL cor_c1d                          ! Coriolis set at T-point 
    92          umask(:,:,:) = tmask(:,:,:)           ! U, V moved at T-point 
    93          vmask(:,:,:) = tmask(:,:,:) 
    94       END IF 
    95       ! 
    96       hu(:,:) = 0.e0                           ! Ocean depth at U- and V-points 
    97       hv(:,:) = 0.e0 
     90      IF( lk_c1d         )   CALL cor_c1d      ! 1D configuration: Coriolis set at T-point 
     91      ! 
     92      hu(:,:) = 0._wp                          ! Ocean depth at U- and V-points 
     93      hv(:,:) = 0._wp 
    9894      DO jk = 1, jpk 
    9995         hu(:,:) = hu(:,:) + fse3u(:,:,jk) * umask(:,:,jk) 
     
    10197      END DO 
    10298      !                                        ! Inverse of the local depth 
    103       hur(:,:) = 1. / ( hu(:,:) + 1.e0 - umask(:,:,1) ) * umask(:,:,1) 
    104       hvr(:,:) = 1. / ( hv(:,:) + 1.e0 - vmask(:,:,1) ) * vmask(:,:,1) 
     99      hur(:,:) = 1._wp / ( hu(:,:) + 1._wp - umask(:,:,1) ) * umask(:,:,1) 
     100      hvr(:,:) = 1._wp / ( hv(:,:) + 1._wp - vmask(:,:,1) ) * vmask(:,:,1) 
    105101 
    106102                             CALL dom_stp      ! time step 
     
    108104      IF( .NOT.ln_rstart )   CALL dom_ctl      ! Domain control 
    109105      ! 
    110       IF( nn_timing == 1 )  CALL timing_stop('dom_init') 
     106      IF( nn_timing == 1 )   CALL timing_stop('dom_init') 
    111107      ! 
    112108   END SUBROUTINE dom_init 
     
    294290         CALL mpp_maxloc( e2t(:,:), tmask(:,:,1), ze2max, iima2,ijma2 ) 
    295291      ELSE 
    296          ze1min = MINVAL( e1t(:,:), mask = tmask(:,:,1) == 1.e0 )     
    297          ze2min = MINVAL( e2t(:,:), mask = tmask(:,:,1) == 1.e0 )     
    298          ze1max = MAXVAL( e1t(:,:), mask = tmask(:,:,1) == 1.e0 )     
    299          ze2max = MAXVAL( e2t(:,:), mask = tmask(:,:,1) == 1.e0 )     
    300  
    301          iloc  = MINLOC( e1t(:,:), mask = tmask(:,:,1) == 1.e0 ) 
     292         ze1min = MINVAL( e1t(:,:), mask = tmask(:,:,1) == 1._wp )     
     293         ze2min = MINVAL( e2t(:,:), mask = tmask(:,:,1) == 1._wp )     
     294         ze1max = MAXVAL( e1t(:,:), mask = tmask(:,:,1) == 1._wp )     
     295         ze2max = MAXVAL( e2t(:,:), mask = tmask(:,:,1) == 1._wp )     
     296 
     297         iloc  = MINLOC( e1t(:,:), mask = tmask(:,:,1) == 1._wp ) 
    302298         iimi1 = iloc(1) + nimpp - 1 
    303299         ijmi1 = iloc(2) + njmpp - 1 
    304          iloc  = MINLOC( e2t(:,:), mask = tmask(:,:,1) == 1.e0 ) 
     300         iloc  = MINLOC( e2t(:,:), mask = tmask(:,:,1) == 1._wp ) 
    305301         iimi2 = iloc(1) + nimpp - 1 
    306302         ijmi2 = iloc(2) + njmpp - 1 
    307          iloc  = MAXLOC( e1t(:,:), mask = tmask(:,:,1) == 1.e0 ) 
     303         iloc  = MAXLOC( e1t(:,:), mask = tmask(:,:,1) == 1._wp ) 
    308304         iima1 = iloc(1) + nimpp - 1 
    309305         ijma1 = iloc(2) + njmpp - 1 
    310          iloc  = MAXLOC( e2t(:,:), mask = tmask(:,:,1) == 1.e0 ) 
     306         iloc  = MAXLOC( e2t(:,:), mask = tmask(:,:,1) == 1._wp ) 
    311307         iima2 = iloc(1) + nimpp - 1 
    312308         ijma2 = iloc(2) + njmpp - 1 
  • branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/DOM/domzgr.F90

    r3702 r3764  
    1616   !!            3.3  ! 2010-11  (G. Madec) add mbk. arrays associated to the deepest ocean level 
    1717   !!            3.4  ! 2012-08  (J. Siddorn) added Siddorn and Furner stretching function 
     18   !!            3.4  ! 2012-12  (R. Bourdalle-Badie and G. Reffray)  modify C1D case   
    1819   !!---------------------------------------------------------------------- 
    1920 
     
    4041   USE lbclnk            ! ocean lateral boundary conditions (or mpp link) 
    4142   USE lib_mpp           ! distributed memory computing library 
    42    USE wrk_nemo        ! Memory allocation 
    43    USE timing          ! Timing 
     43   USE wrk_nemo          ! Memory allocation 
     44   USE timing            ! Timing 
    4445 
    4546   IMPLICIT NONE 
     
    8485      !!                ***  ROUTINE dom_zgr  *** 
    8586      !!                    
    86       !! ** Purpose :  set the depth of model levels and the resulting  
    87       !!      vertical scale factors. 
     87      !! ** Purpose :   set the depth of model levels and the resulting  
     88      !!              vertical scale factors. 
    8889      !! 
    8990      !! ** Method  : - reference 1D vertical coordinate (gdep._0, e3._0) 
     
    9798      !! ** Action  :   define gdep., e3., mbathy and bathy 
    9899      !!---------------------------------------------------------------------- 
    99       INTEGER ::   ioptio = 0   ! temporary integer 
     100      INTEGER ::   ioptio, ibat   ! local integer 
    100101      ! 
    101102      NAMELIST/namzgr/ ln_zco, ln_zps, ln_sco 
    102103      !!---------------------------------------------------------------------- 
    103104      ! 
    104       IF( nn_timing == 1 )  CALL timing_start('dom_zgr') 
     105      IF( nn_timing == 1 )   CALL timing_start('dom_zgr') 
    105106      ! 
    106107      REWIND( numnam )                 ! Read Namelist namzgr : vertical coordinate' 
     
    118119 
    119120      ioptio = 0                       ! Check Vertical coordinate options 
    120       IF( ln_zco ) ioptio = ioptio + 1 
    121       IF( ln_zps ) ioptio = ioptio + 1 
    122       IF( ln_sco ) ioptio = ioptio + 1 
     121      IF( ln_zco      )  ioptio = ioptio + 1 
     122      IF( ln_zps      )  ioptio = ioptio + 1 
     123      IF( ln_sco      )  ioptio = ioptio + 1 
    123124      IF( ioptio /= 1 )   CALL ctl_stop( ' none or several vertical coordinate options used' ) 
    124125      ! 
     
    127128                          CALL zgr_z            ! Reference z-coordinate system (always called) 
    128129                          CALL zgr_bat          ! Bathymetry fields (levels and meters) 
     130      IF( lk_c1d      )   CALL lbc_lnk( bathy , 'T', 1._wp )   ! 1D config.: same bathy value over the 3x3 domain 
    129131      IF( ln_zco      )   CALL zgr_zco          ! z-coordinate 
    130132      IF( ln_zps      )   CALL zgr_zps          ! Partial step z-coordinate 
     
    134136      ! ----------------------------------- 
    135137      IF( lzoom       )   CALL zgr_bat_zoom     ! correct mbathy in case of zoom subdomain 
    136       IF( .NOT.lk_c1d )   CALL zgr_bat_ctl      ! check bathymetry (mbathy) and suppress isoated ocean points 
     138      IF( .NOT.lk_c1d )   CALL zgr_bat_ctl      ! check bathymetry (mbathy) and suppress isolated ocean points 
    137139                          CALL zgr_bot_level    ! deepest ocean level for t-, u- and v-points 
    138140      ! 
    139       ! 
    140  
     141      IF( lk_c1d ) THEN                         ! 1D config.: same mbathy value over the 3x3 domain 
     142         ibat = mbathy(2,2) 
     143         mbathy(:,:) = ibat 
     144      END IF 
     145      ! 
    141146      IF( nprint == 1 .AND. lwp )   THEN 
    142147         WRITE(numout,*) ' MIN val mbathy ', MINVAL( mbathy(:,:) ), ' MAX ', MAXVAL( mbathy(:,:) ) 
     
    478483                    END DO 
    479484                 END DO 
    480                  IF(lwp) WRITE(numout,*) 
     485                 IF(lwp) WRITE(numout,*)      
    481486                 IF(lwp) WRITE(numout,*) '      orca_r2: Gibraltar strait open at i=',ii0,' j=',ij0 
    482487                 ! 
     
    742747      ! 
    743748      mbkt(:,:) = MAX( mbathy(:,:) , 1 )    ! bottom k-index of T-level (=1 over land) 
     749  
    744750      !                                     ! bottom k-index of W-level = mbkt+1 
    745751      DO jj = 1, jpjm1                      ! bottom k-index of u- (v-) level 
     
    12201226         END DO 
    12211227         ! 
    1222          ! Apply lateral boundary condition   CAUTION: kept the value when the lbc field is zero 
     1228         ! Apply lateral boundary condition   CAUTION: keep the value when the lbc field is zero 
    12231229         ztmp(:,:) = zenv(:,:)   ;   CALL lbc_lnk( zenv, 'T', 1._wp ) 
    12241230         DO jj = 1, nlcj 
     
    12311237      !                                                     ! ================ ! 
    12321238      ! 
    1233       !                                        ! envelop bathymetry saved in hbatt 
     1239      ! Fill ghost rows with appropriate values to avoid undefined e3 values with some mpp decompositions 
     1240      DO ji = nlci+1, jpi  
     1241         zenv(ji,1:nlcj) = zenv(nlci,1:nlcj) 
     1242      END DO 
     1243      ! 
     1244      DO jj = nlcj+1, jpj 
     1245         zenv(:,jj) = zenv(:,nlcj) 
     1246      END DO 
     1247      ! 
     1248      ! Envelope bathymetry saved in hbatt 
    12341249      hbatt(:,:) = zenv(:,:)  
    12351250      IF( MINVAL( gphit(:,:) ) * MAXVAL( gphit(:,:) ) <= 0._wp ) THEN 
  • branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/DOM/istate.F90

    r3680 r3764  
    4141   USE dynspg_exp      ! pressure gradient schemes 
    4242   USE dynspg_ts       ! pressure gradient schemes 
     43   USE sol_oce         ! ocean solver variables 
    4344   USE lib_mpp         ! MPP library 
    4445   USE restart         ! restart 
     
    106107         hdivb(:,:,:) = 0._wp   ;   hdivn(:,:,:) = 0._wp 
    107108         ! 
    108          !                                       ! define e3u_b, e3v_b from e3t_b initialized in domzgr 
    109          CALL dom_vvl_2( nit000, fse3u_b(:,:,:), fse3v_b(:,:,:) ) 
    110          ! 
    111109         IF( cp_cfg == 'eel' ) THEN 
    112110            CALL istate_eel                      ! EEL   configuration : start from pre-defined U,V T-S fields 
     
    133131            ENDDO 
    134132         ENDIF 
     133         !                                       ! define e3u_b, e3v_b from e3t_b initialized in domzgr 
     134         CALL dom_vvl_2( nit000, fse3u_b(:,:,:), fse3v_b(:,:,:) ) 
    135135         !  
    136136      ENDIF 
     
    138138      IF( lk_agrif ) THEN                  ! read free surface arrays in restart file 
    139139         IF( ln_rstart ) THEN 
    140             IF( lk_dynspg_flt )   CALL flt_rst( nit000, 'READ' )      ! read or initialize the following fields 
    141             !                                                         ! gcx, gcxb for agrif_opa_init 
    142          ENDIF                                                        ! explicit case not coded yet with AGRIF 
     140            IF( lk_dynspg_flt )  THEN      ! read or initialize the following fields 
     141               !                           ! gcx, gcxb for agrif_opa_init 
     142               IF( sol_oce_alloc()  > 0 )   CALL ctl_stop('agrif sol_oce_alloc: allocation of arrays failed') 
     143               CALL flt_rst( nit000, 'READ' ) 
     144            ENDIF 
     145         ENDIF                             ! explicit case not coded yet with AGRIF 
    143146      ENDIF 
    144147      ! 
Note: See TracChangeset for help on using the changeset viewer.