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 473 for trunk/NEMO/OPA_SRC/DOM – NEMO

Changeset 473 for trunk/NEMO/OPA_SRC/DOM


Ignore:
Timestamp:
2006-05-11T17:04:37+02:00 (18 years ago)
Author:
opalod
Message:

nemo_v1_update_060: SM: IOM + 301 levels + CORE + begining of ctl_stop

Location:
trunk/NEMO/OPA_SRC/DOM
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMO/OPA_SRC/DOM/domhgr.F90

    r434 r473  
    44   !! Ocean initialization : domain initialization 
    55   !!============================================================================== 
     6   !! History :       !  88-03  (G. Madec) 
     7   !!                 !  91-11  (G. Madec) 
     8   !!                 !  92-06  (M. Imbard) 
     9   !!                 !  96-01  (G. Madec)  terrain following coordinates 
     10   !!                 !  97-02  (G. Madec)  print mesh informations 
     11   !!                 !  99-11  (M. Imbard) NetCDF format with IO-IPSL 
     12   !!                 !  00-08  (D. Ludicone) Reduced section at Bab el Mandeb 
     13   !!                 !  01-09  (M. Levy)  eel config: grid in km, beta-plane 
     14   !!            8.5  !  02-08  (G. Madec)  F90: Free form and module, namelist 
     15   !!            9.0  !  04-01  (A.M. Treguier, J.M. Molines) Case 4 (Mercator mesh) 
     16   !!                           use of parameters in par_CONFIG-Rxx.h90, not in namelist 
     17   !!                 !  04-05  (A. Koch-Larrouy) Add Gyre configuration  
     18   !!---------------------------------------------------------------------- 
    619 
    720   !!---------------------------------------------------------------------- 
     
    2740   !!   OPA 9.0 , LOCEAN-IPSL (2005)  
    2841   !! $Header$  
    29    !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt  
     42   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
    3043   !!---------------------------------------------------------------------- 
    3144 
     
    8497      !!        define ff: coriolis factor at f-point 
    8598      !! 
    86       !! References : 
    87       !!      Marti, Madec and Delecluse, 1992, j. geophys. res., in press. 
    88       !! 
    89       !! History : 
    90       !!        !  88-03  (G. Madec) 
    91       !!        !  91-11  (G. Madec) 
    92       !!        !  92-06  (M. Imbard) 
    93       !!        !  96-01  (G. Madec)  terrain following coordinates 
    94       !!        !  97-02  (G. Madec)  print mesh informations 
    95       !!        !  01-09  (M. Levy)  eel config: grid in km, beta-plane 
    96       !!   8.5  !  02-08  (G. Madec)  F90: Free form and module, namelist 
    97       !!   9.0  !  04-01  (A.M. Treguier, J.M. Molines) Case 4 (Mercator mesh) 
    98       !!                  use of parameters in par_CONFIG-Rxx.h90, not in namelist 
    99       !!        !  04-05  (A. Koch-Larrouy) Add Gyre configuration  
     99      !! References :   Marti, Madec and Delecluse, 1992, JGR 
     100      !!                Madec, Imbard, 1996, Clim. Dyn. 
    100101      !!---------------------------------------------------------------------- 
    101       !! * local declarations 
    102102      INTEGER  ::   ji, jj              ! dummy loop indices 
    103103      INTEGER  ::   ii0, ii1, ij0, ij1  ! temporary integers 
     
    164164            IF(lwp) WRITE(numout,*) 
    165165            IF(lwp) WRITE(numout,*) '             orca_r05: Reduced e2u at the Gibraltar Strait' 
     166            ! 
     167            ii0 = 627   ;   ii1 = 628        ! Bosphore Strait (e2u = 10 km) 
     168            ij0 = 343   ;   ij1 = 343   ;   e2u( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) =  10.e3 
     169            IF(lwp) WRITE(numout,*) 
     170            IF(lwp) WRITE(numout,*) '             orca_r05: Reduced e2u at the Bosphore Strait' 
     171            ! 
     172            ii0 =  93   ;   ii1 =  94        ! Sumba Strait (e2u = 40 km) 
     173            ij0 = 232   ;   ij1 = 232   ;   e2u( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) =  40.e3 
     174            IF(lwp) WRITE(numout,*) 
     175            IF(lwp) WRITE(numout,*) '             orca_r05: Reduced e2u at the Sumba Strait' 
     176            ! 
     177            ii0 = 103   ;   ii1 = 103        ! Ombai Strait (e2u = 15 km) 
     178            ij0 = 232   ;   ij1 = 232   ;   e2u( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) =  15.e3 
     179            IF(lwp) WRITE(numout,*) 
     180            IF(lwp) WRITE(numout,*) '             orca_r05: Reduced e2u at the Ombai Strait' 
     181            ! 
     182            ii0 =  15   ;   ii1 =  15        ! Palk Strait (e2u = 10 km) 
     183            ij0 = 270   ;   ij1 = 270   ;   e2u( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) =  10.e3 
     184            IF(lwp) WRITE(numout,*) 
     185            IF(lwp) WRITE(numout,*) '             orca_r05: Reduced e2u at the Palk Strait' 
     186            ! 
     187            ii0 =  87   ;   ii1 =  87        ! Lombok Strait (e1v = 10 km) 
     188            ij0 = 232   ;   ij1 = 233   ;   e1v( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) =  10.e3 
     189            IF(lwp) WRITE(numout,*) 
     190            IF(lwp) WRITE(numout,*) '             orca_r05: Reduced e1v at the Lombok Strait' 
     191            ! 
     192            ! 
     193            ii0 = 662   ;   ii1 = 662        ! Bab el Mandeb (e1v = 25 km) 
     194            ij0 = 276   ;   ij1 = 276   ;   e1v( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) =  25.e3 
     195            IF(lwp) WRITE(numout,*) 
     196            IF(lwp) WRITE(numout,*) '             orca_r05: Reduced e1v at the Bab el Mandeb' 
    166197            ! 
    167198         ENDIF 
     
    269300         IF(lwp) WRITE(numout,*) '          geographical mesh on the sphere, MERCATOR type' 
    270301         IF(lwp) WRITE(numout,*) '          longitudinal/latitudinal spacing given by ppe1_deg' 
    271          IF ( ppgphi0 == -90 ) THEN 
    272                 IF(lwp) WRITE(numout,*) ' Mercator grid cannot start at south pole !!!! ' 
    273                 IF(lwp) WRITE(numout,*) ' We stop ' 
    274                 STOP 
    275          ENDIF 
     302         IF ( ppgphi0 == -90 ) CALL ctl_stop( ' Mercator grid cannot start at south pole !!!! ' ) 
    276303 
    277304         !  Find index corresponding to the equator, given the grid spacing e1_deg 
     
    368395 
    369396      CASE DEFAULT 
    370          IF(lwp) WRITE(numout,cform_err) 
    371          IF(lwp) WRITE(numout,*) '          bad flag value for jphgr_msh = ', jphgr_msh 
    372          nstop = nstop + 1 
     397         WRITE(ctmp1,*) '          bad flag value for jphgr_msh = ', jphgr_msh 
     398         CALL ctl_stop( ctmp1 ) 
    373399 
    374400      END SELECT 
     
    480506      IF( nperio == 2 ) THEN 
    481507         znorme = SQRT( SUM( gphiu(:,2) * gphiu(:,2) ) ) / FLOAT( jpi ) 
    482          IF( znorme > 1.e-13 ) THEN 
    483             IF(lwp) WRITE(numout,cform_err) 
    484             IF(lwp) WRITE(numout,*) ' ===>>>> : symmetrical condition: rerun with good equator line' 
    485             nstop = nstop + 1 
    486          ENDIF 
     508         IF( znorme > 1.e-13 ) CALL ctl_stop( ' ===>>>> : symmetrical condition: rerun with good equator line' ) 
    487509      ENDIF 
    488510 
     
    499521      !!      or semi-analytical method. It is read in a NetCDF file.  
    500522      !!      
    501       !! References : 
    502       !!      Marti, Madec and Delecluse, 1992, JGR, 97, 12,763-12,766. 
    503       !!      Madec, Imbard, 1996, Clim. Dyn., 12, 381-388. 
    504       !! 
    505       !! History : 
    506       !!        !         (O. Marti)  Original code 
    507       !!        !  91-03  (G. Madec) 
    508       !!        !  92-07  (M. Imbard) 
    509       !!        !  99-11  (M. Imbard) NetCDF format with IOIPSL 
    510       !!        !  00-08  (D. Ludicone) Reduced section at Bab el Mandeb 
    511       !!   8.5  !  02-06  (G. Madec)  F90: Free form 
    512523      !!---------------------------------------------------------------------- 
    513       !! * Modules used 
    514       USE ioipsl 
    515  
    516       !! * Local declarations 
    517       LOGICAL ::   llog = .FALSE. 
    518       CHARACTER(len=21) ::   clname 
    519       INTEGER  ::   ji, jj              ! dummy loop indices 
    520       INTEGER  ::   inum                ! temporary logical unit 
    521       INTEGER  ::   ilev, itime         ! temporary integers 
    522       REAL(wp) ::   zdt, zdate0         ! temporary scalars 
    523       REAL(wp) ::   zdept(1)            ! temporary workspace 
    524       REAL(wp), DIMENSION(jpidta,jpjdta) ::   & 
    525          zlamt, zphit, zdta             ! temporary workspace (NetCDF read) 
     524      USE iom 
     525 
     526      INTEGER ::   inum   ! temporary logical unit 
    526527      !!---------------------------------------------------------------------- 
    527       clname = 'coordinates' 
    528 #if defined key_agrif 
    529       if ( .NOT. Agrif_Root() ) then 
    530          clname = TRIM(Agrif_CFixed())//'_'//TRIM(clname) 
    531       endif 
    532 #endif          
    533  
    534  
    535       ! 1. Read of the grid coordinates and scale factors 
    536       ! ------------------------------------------------- 
    537528 
    538529      IF(lwp) THEN 
    539530         WRITE(numout,*) 
    540531         WRITE(numout,*) 'hgr_read : read the horizontal coordinates' 
    541          WRITE(numout,*) '~~~~~~~~~~~      jpiglo = ', jpiglo, ' jpjglo = ', jpjglo, ' jpk = ', jpk 
     532         WRITE(numout,*) '~~~~~~~~      jpiglo = ', jpiglo, ' jpjglo = ', jpjglo, ' jpk = ', jpk 
    542533      ENDIF 
    543  
    544       ! read the file 
    545       itime = 0 
    546       ilev = 1    
    547       zlamt(:,:) = 0.e0 
    548       zphit(:,:) = 0.e0 
    549       CALL restini( clname, jpidta, jpjdta, zlamt , zphit,   & 
    550          &                  ilev  , zdept , 'NONE',          & 
    551          &                  itime , zdate0, zdt   , inum, domain_id=nidom ) 
    552  
    553       CALL restget( inum, 'glamt', jpidta, jpjdta, 1, itime, llog, zdta ) 
    554       DO jj = 1, nlcj 
    555          DO ji = 1, nlci 
    556             glamt(ji,jj) = zdta(mig(ji),mjg(jj)) 
    557          END DO 
    558       END DO 
    559       CALL restget( inum, 'glamu', jpidta, jpjdta, 1, itime, llog, zdta ) 
    560       DO jj = 1, nlcj 
    561          DO ji = 1, nlci 
    562             glamu(ji,jj) = zdta(mig(ji),mjg(jj))                     
    563          END DO 
    564       END DO 
    565       CALL restget( inum, 'glamv', jpidta, jpjdta, 1, itime, llog, zdta ) 
    566       DO jj = 1, nlcj 
    567          DO ji = 1, nlci 
    568             glamv(ji,jj) = zdta(mig(ji),mjg(jj))                     
    569          END DO 
    570       END DO 
    571       CALL restget( inum, 'glamf', jpidta, jpjdta, 1, itime, llog, zdta ) 
    572       DO jj = 1, nlcj 
    573          DO ji = 1, nlci 
    574             glamf(ji,jj) = zdta(mig(ji),mjg(jj))                     
    575          END DO 
    576       END DO 
    577       CALL restget( inum, 'gphit', jpidta, jpjdta, 1, itime, llog, zdta ) 
    578       DO jj = 1, nlcj 
    579          DO ji = 1, nlci 
    580             gphit(ji,jj) = zdta(mig(ji),mjg(jj))                     
    581          END DO 
    582       END DO 
    583       CALL restget( inum, 'gphiu', jpidta, jpjdta, 1, itime, llog, zdta ) 
    584       DO jj = 1, nlcj 
    585          DO ji = 1, nlci 
    586             gphiu(ji,jj) = zdta(mig(ji),mjg(jj))                     
    587          END DO 
    588       END DO 
    589       CALL restget( inum, 'gphiv', jpidta, jpjdta, 1, itime, llog, zdta ) 
    590       DO jj = 1, nlcj 
    591          DO ji = 1, nlci 
    592             gphiv(ji,jj) = zdta(mig(ji),mjg(jj))                     
    593          END DO 
    594       END DO 
    595       CALL restget( inum, 'gphif', jpidta, jpjdta, 1, itime, llog, zdta ) 
    596       DO jj = 1, nlcj 
    597          DO ji = 1, nlci 
    598             gphif(ji,jj) = zdta(mig(ji),mjg(jj))                     
    599          END DO 
    600       END DO 
    601       CALL restget( inum, 'e1t', jpidta, jpjdta, 1, itime, llog, zdta ) 
    602       DO jj = 1, nlcj 
    603          DO ji = 1, nlci 
    604             e1t  (ji,jj) = zdta(mig(ji),mjg(jj))                     
    605          END DO 
    606       END DO 
    607       CALL restget( inum, 'e1u', jpidta, jpjdta, 1, itime, llog, zdta ) 
    608       DO jj = 1, nlcj 
    609          DO ji = 1, nlci 
    610             e1u  (ji,jj) = zdta(mig(ji),mjg(jj))                     
    611          END DO 
    612       END DO 
    613       CALL restget( inum, 'e1v', jpidta, jpjdta, 1, itime, llog, zdta ) 
    614       DO jj = 1, nlcj 
    615          DO ji = 1, nlci 
    616             e1v  (ji,jj) = zdta(mig(ji),mjg(jj))                     
    617          END DO 
    618       END DO 
    619       CALL restget( inum, 'e1f', jpidta, jpjdta, 1, itime, llog, zdta ) 
    620       DO jj = 1, nlcj 
    621          DO ji = 1, nlci 
    622             e1f  (ji,jj) = zdta(mig(ji),mjg(jj))                     
    623          END DO 
    624       END DO 
    625       CALL restget( inum, 'e2t', jpidta, jpjdta, 1, itime, llog, zdta ) 
    626       DO jj = 1, nlcj 
    627          DO ji = 1, nlci 
    628             e2t  (ji,jj) = zdta(mig(ji),mjg(jj))                     
    629          END DO 
    630       END DO 
    631       CALL restget( inum, 'e2u', jpidta, jpjdta, 1, itime, llog, zdta ) 
    632       DO jj = 1, nlcj 
    633          DO ji = 1, nlci 
    634             e2u  (ji,jj) = zdta(mig(ji),mjg(jj))                     
    635          END DO 
    636       END DO 
    637       CALL restget( inum, 'e2v', jpidta, jpjdta, 1, itime, llog, zdta ) 
    638       DO jj = 1, nlcj 
    639          DO ji = 1, nlci 
    640             e2v  (ji,jj) = zdta(mig(ji),mjg(jj))                     
    641          END DO 
    642       END DO 
    643       CALL restget( inum, 'e2f', jpidta, jpjdta, 1, itime, llog, zdta ) 
    644       DO jj = 1, nlcj 
    645          DO ji = 1, nlci 
    646             e2f  (ji,jj) = zdta(mig(ji),mjg(jj))                     
    647          END DO 
    648       END DO 
    649  
    650       CALL restclo( inum ) 
    651  
    652       ! set extra rows add in mpp to none zero values 
    653       DO jj = nlcj+1, jpj 
    654          DO ji = 1, nlci 
    655             glamt(ji,jj) = glamt(ji,1)   ;   gphit(ji,jj) = gphit(ji,1) 
    656             glamu(ji,jj) = glamu(ji,1)   ;   gphiu(ji,jj) = gphiu(ji,1) 
    657             glamv(ji,jj) = glamv(ji,1)   ;   gphiv(ji,jj) = gphiv(ji,1) 
    658             glamf(ji,jj) = glamf(ji,1)   ;   gphif(ji,jj) = gphif(ji,1) 
    659             e1t  (ji,jj) = e1t  (ji,1)   ;   e2t  (ji,jj) = e2t  (ji,1) 
    660             e1u  (ji,jj) = e1u  (ji,1)   ;   e2u  (ji,jj) = e2u  (ji,1) 
    661             e1v  (ji,jj) = e1v  (ji,1)   ;   e2v  (ji,jj) = e2v  (ji,1) 
    662             e1f  (ji,jj) = e1f  (ji,1)   ;   e2f  (ji,jj) = e2f  (ji,1) 
    663          END DO 
    664       END DO 
    665  
    666       ! set extra columns add in mpp to none zero values 
    667       DO ji = nlci+1, jpi 
    668          glamt(ji,:) = glamt(1,:)   ;   gphit(ji,:) = gphit(1,:) 
    669          glamu(ji,:) = glamu(1,:)   ;   gphiu(ji,:) = gphiu(1,:) 
    670          glamv(ji,:) = glamv(1,:)   ;   gphiv(ji,:) = gphiv(1,:) 
    671          glamf(ji,:) = glamf(1,:)   ;   gphif(ji,:) = gphif(1,:) 
    672          e1t  (ji,:) = e1t  (1,:)   ;   e2t  (ji,:) = e2t  (1,:) 
    673          e1u  (ji,:) = e1u  (1,:)   ;   e2u  (ji,:) = e2u  (1,:) 
    674          e1v  (ji,:) = e1v  (1,:)   ;   e2v  (ji,:) = e2v  (1,:) 
    675          e1f  (ji,:) = e1f  (1,:)   ;   e2f  (ji,:) = e2f  (1,:) 
    676       END DO 
    677  
    678    END SUBROUTINE hgr_read 
    679  
     534       
     535      CALL iom_open( 'coordinates', inum ) 
     536       
     537      CALL iom_get( inum, jpdom_data, 'glamt', glamt ) 
     538      CALL iom_get( inum, jpdom_data, 'glamu', glamu ) 
     539      CALL iom_get( inum, jpdom_data, 'glamv', glamv ) 
     540      CALL iom_get( inum, jpdom_data, 'glamf', glamf ) 
     541       
     542      CALL iom_get( inum, jpdom_data, 'gphit', gphit ) 
     543      CALL iom_get( inum, jpdom_data, 'gphiu', gphiu ) 
     544      CALL iom_get( inum, jpdom_data, 'gphiv', gphiv ) 
     545      CALL iom_get( inum, jpdom_data, 'gphif', gphif ) 
     546       
     547      CALL iom_get( inum, jpdom_data, 'e1t', e1t ) 
     548      CALL iom_get( inum, jpdom_data, 'e1u', e1u ) 
     549      CALL iom_get( inum, jpdom_data, 'e1v', e1v ) 
     550      CALL iom_get( inum, jpdom_data, 'e1f', e1f ) 
     551       
     552      CALL iom_get( inum, jpdom_data, 'e2t', e2t ) 
     553      CALL iom_get( inum, jpdom_data, 'e2u', e2u ) 
     554      CALL iom_get( inum, jpdom_data, 'e2v', e2v ) 
     555      CALL iom_get( inum, jpdom_data, 'e2f', e2f ) 
     556       
     557      CALL iom_close( inum ) 
     558       
     559    END SUBROUTINE hgr_read 
     560     
    680561   !!====================================================================== 
    681562END MODULE domhgr 
  • trunk/NEMO/OPA_SRC/DOM/domzgr.F90

    r454 r473  
    9393      IF( ln_zps ) ioptio = ioptio + 1 
    9494      IF( ln_sco ) ioptio = ioptio + 1 
    95       IF ( ioptio /= 1 ) THEN 
    96           IF(lwp) WRITE(numout,cform_err) 
    97           IF(lwp) WRITE(numout,*) ' none or several vertical coordinate options used' 
    98           nstop = nstop + 1 
    99       ENDIF 
     95      IF ( ioptio /= 1 ) CALL ctl_stop( ' none or several vertical coordinate options used' ) 
    10096 
    10197      IF( ln_zco ) THEN 
    10298          IF(lwp) WRITE(numout,*) '          z-coordinate with reduced incore memory requirement' 
    103           IF( ln_zps .OR. ln_sco ) THEN 
    104              IF(lwp) WRITE(numout,cform_err) 
    105              IF(lwp) WRITE(numout,*) ' reduced memory with zps or sco option is impossible' 
    106              nstop = nstop + 1 
    107           ENDIF 
     99          IF( ln_zps .OR. ln_sco ) CALL ctl_stop( ' reduced memory with zps or sco option is impossible' ) 
    108100      ENDIF 
    109101 
     
    264256 
    265257      DO jk = 1, jpk 
    266          IF( e3w_0(jk) <= 0. .OR. e3t_0(jk) <= 0. ) THEN 
    267             IF(lwp) WRITE(numout,cform_err) 
    268             IF(lwp) WRITE(numout,*) ' e3w or e3t =< 0 ' 
    269             nstop = nstop + 1 
    270          ENDIF 
    271          IF( gdepw_0(jk) < 0. .OR. gdept_0(jk) < 0.) THEN 
    272             IF(lwp) WRITE(numout,cform_err) 
    273             IF(lwp) WRITE(numout,*) ' gdepw or gdept < 0 ' 
    274             nstop = nstop + 1 
    275          ENDIF 
     258         IF( e3w_0(jk)  <= 0. .OR. e3t_0(jk)  <= 0. ) CALL ctl_stop( ' e3w or e3t =< 0 ' ) 
     259         IF( gdepw_0(jk) < 0. .OR. gdept_0(jk) < 0. ) CALL ctl_stop( ' gdepw or gdept < 0 ' ) 
    276260      END DO 
    277261 
     
    318302      !!---------------------------------------------------------------------- 
    319303      !! * Modules used 
    320       USE ioipsl 
     304      USE iom 
    321305 
    322306      !! * Local declarations 
    323       CHARACTER (len=18) ::   clname    ! temporary characters 
    324       LOGICAL ::   llbon                ! check the existence of bathy files 
    325307      INTEGER ::   ji, jj, jl, jk       ! dummy loop indices 
    326       INTEGER ::   inum = 11            ! temporary logical unit 
     308      INTEGER ::   inum                 ! temporary logical unit 
    327309      INTEGER  ::   & 
    328          ipi, ipj, ipk,              &  ! temporary integers 
    329          itime, ih,                  &  !    "          " 
    330          ii_bump, ij_bump               ! bump center position 
    331       INTEGER, DIMENSION (1) ::   istep 
     310         ii_bump, ij_bump, ih           ! bump center position 
    332311      INTEGER , DIMENSION(jpidta,jpjdta) ::   & 
    333312         idta                           ! global domain integer data 
    334313      REAL(wp) ::   & 
    335314         r_bump, h_bump, h_oce,      &  ! bump characteristics  
    336          zi, zj, zdate0, zdt, zh        ! temporary scalars 
     315         zi, zj, zh                     ! temporary scalars 
    337316      REAL(wp), DIMENSION(jpidta,jpjdta) ::   & 
    338          zlamt, zphit,               &  ! 2D workspace (NetCDF read) 
    339317         zdta                           ! global domain scalar data 
    340       REAL(wp), DIMENSION(jpk) ::   & 
    341          zdept                          ! 1D workspace (NetCDF read) 
    342318      !!---------------------------------------------------------------------- 
    343319 
     
    427403         ENDIF 
    428404 
     405         ! ======================================= 
     406         ! local domain level and meter bathymetry (mbathy,bathy) 
     407         ! ======================================= 
     408          
     409         mbathy(:,:) = 0                                 ! set to zero extra halo points 
     410         bathy (:,:) = 0.e0                              ! (require for mpp case) 
     411          
     412         DO jj = 1, nlcj                                 ! interior values 
     413            DO ji = 1, nlci 
     414               mbathy(ji,jj) = idta( mig(ji), mjg(jj) ) 
     415               bathy (ji,jj) = zdta( mig(ji), mjg(jj) ) 
     416            END DO 
     417         END DO 
     418 
    429419         !                                            ! =============== ! 
    430420      ELSEIF( ntopo == 1 ) THEN                       !   read in file  ! 
    431421         !                                            ! =============== ! 
    432422 
    433          clname = 'bathy_level.nc'                       ! Level bathymetry 
    434 #if defined key_agrif 
    435          IF( .NOT. Agrif_Root() ) THEN 
    436             clname = TRIM(Agrif_CFixed())//'_'//TRIM(clname) 
    437          ENDIF 
    438 #endif 
    439          INQUIRE( FILE=clname, EXIST=llbon ) 
    440          IF( llbon ) THEN 
    441             IF(lwp) WRITE(numout,*) 
    442             IF(lwp) WRITE(numout,*) '         read level bathymetry in ', clname 
    443             IF(lwp) WRITE(numout,*) 
    444             ipi = jpidta      ;       ipj   = jpjdta 
    445             ipk = 1           ;       itime = 1           ;       zdt = rdt 
    446             CALL flinopen( clname, 1, jpidta, 1, jpjdta, .FALSE.,   & 
    447                &           ipi, ipj, ipk, zlamt, zphit, zdept, itime, istep, zdate0, zdt, inum ) 
    448             CALL flinget( inum, 'Bathy_level', jpidta, jpjdta, 1,   & 
    449                &          itime, 1, 1, 1, jpidta, 1, jpjdta, zdta(:,:) ) 
    450             CALL flinclo( inum ) 
    451             idta(:,:) = zdta(:,:) 
    452          ELSE 
     423         CALL iom_open ( 'bathy_level.nc', inum )   ! Level bathymetry 
     424         IF ( inum > 0 ) THEN 
     425            CALL iom_get ( inum, jpdom_data, 'Bathy_level', bathy ) 
     426            CALL iom_close (inum) 
     427            mbathy(:,:) = INT( bathy(:,:) ) 
     428         ELSE  
    453429            IF( ln_zco ) THEN 
    454                IF(lwp) WRITE(numout,cform_err) 
    455                IF(lwp) WRITE(numout,*)'    zgr_bat : unable to read the file ', clname 
    456                nstop = nstop + 1 
     430               CALL ctl_stop( '    zgr_bat : unable to read the file ' ) 
    457431            ELSE 
    458432               IF(lwp) WRITE(numout,*)'    zgr_bat : bathy_level will be computed from bathy_meter' 
    459                idta(:,:) = jpkm1      ! initialisation 
     433               nstop = nstop - 1        ! supress the error count for opening 'bathy_level.nc' 
     434               mbathy(:,:) = jpkm1       
    460435            ENDIF 
    461436         ENDIF 
    462437 
    463          clname = 'bathy_meter.nc'                       ! meter bathymetry 
    464 #if defined key_agrif 
    465             IF( .NOT. Agrif_Root() ) THEN 
    466                clname = TRIM(Agrif_CFixed())//'_'//TRIM(clname) 
    467             ENDIF 
    468 #endif 
    469          INQUIRE( FILE=clname, EXIST=llbon ) 
    470          IF( llbon ) THEN 
    471             IF(lwp) WRITE(numout,*) 
    472             IF(lwp) WRITE(numout,*) '         read meter bathymetry in ', clname 
    473             IF(lwp) WRITE(numout,*) 
    474             ipi = jpidta      ;       ipj   = jpjdta 
    475             ipk = 1           ;       itime = 1         ;       zdt = rdt 
    476             CALL flinopen( clname, 1, jpidta, 1, jpjdta, .FALSE.,   &     
    477                &           ipi, ipj, ipk, zlamt, zphit, zdept, itime, istep, zdate0, zdt, inum ) 
    478             CALL flinget( inum, 'Bathymetry', jpidta, jpjdta, 1,   & 
    479                &          itime, 1, 1, 1, jpidta, 1, jpjdta, zdta(:,:) )  
    480             CALL flinclo( inum ) 
    481          ELSE 
     438         CALL iom_open ( 'bathy_meter.nc', inum )   ! meter bathymetry 
     439         IF ( inum > 0 ) THEN 
     440            CALL iom_get ( inum, jpdom_data, 'Bathymetry', bathy ) 
     441            CALL iom_close (inum) 
     442         ELSE  
    482443            IF( ln_zps .OR. ln_sco ) THEN 
    483                IF(lwp) WRITE(numout,cform_err)        
    484                IF(lwp) WRITE(numout,*)'    zgr_bat : unable to read the file', clname 
    485                nstop = nstop + 1 
     444              CALL ctl_stop( '    zgr_bat : unable to read the file ' ) 
    486445            ELSE 
    487                zdta(:,:) = 0.e0 
     446               bathy(:,:) = 0.e0        ! initialisation 
     447               nstop = nstop - 1        ! supress the error count for opening 'bathy_level.nc' 
    488448               IF(lwp) WRITE(numout,*)'    zgr_bat : bathy_meter not found, but not used, bathy array set to zero' 
    489449            ENDIF 
     
    492452      ELSE                                            !      error      ! 
    493453         !                                            ! =============== ! 
    494          IF(lwp) WRITE(numout,cform_err) 
    495          IF(lwp) WRITE(numout,*) '          parameter , ntopo = ', ntopo 
    496          nstop = nstop + 1 
    497       ENDIF 
    498  
    499  
    500       ! ======================================= 
    501       ! local domain level and meter bathymetry (mbathy,bathy) 
    502       ! ======================================= 
    503  
    504       mbathy(:,:) = 0                                 ! set to zero extra halo points 
    505       bathy (:,:) = 0.e0                              ! (require for mpp case) 
    506  
    507       DO jj = 1, nlcj                                 ! interior values 
    508          DO ji = 1, nlci 
    509             mbathy(ji,jj) = idta( mig(ji), mjg(jj) ) 
    510             bathy (ji,jj) = zdta( mig(ji), mjg(jj) ) 
    511          END DO 
    512       END DO 
    513  
    514       write(numout,*) ' MIN val mbathy 2 ', MINVAL( mbathy(:,:) ), ' MAX ', MAXVAL( mbathy(:,:) ) 
    515  
     454         WRITE(ctmp1,*) '          parameter , ntopo = ', ntopo 
     455         CALL ctl_stop( '    zgr_bat : '//trim(ctmp1) ) 
     456      ENDIF 
    516457 
    517458      ! ======================= 
     
    531472      ENDIF 
    532473 
     474#if defined key_orca_lev10 
     475      ! 10 time the vertical resolution 
     476      mbathy(:,:) = 10 * mbathy(:,:) 
     477      IF(lwp) WRITE(numout,*) ' ATTENTION: 300 niveaux avec bathy levels "vraie?"' 
     478#endif 
    533479      ! =========== 
    534480      ! Zoom domain  
     
    12211167         WRITE(numout,9430) (jk,fsdept(1,1,jk),fsdepw(1,1,jk),     & 
    12221168                             fse3t (1,1,jk),fse3w (1,1,jk),jk=1,jpk) 
    1223          WRITE(numout,*) 
    1224          WRITE(numout,*) ' domzgr: vertical coordinates : point (20,20,k)   bathy = ', bathy(20,20), hbatt(20,20) 
    1225          WRITE(numout,*) ' ~~~~~~  --------------------' 
    1226          WRITE(numout,9420) 
    1227          WRITE(numout,9430) (jk,fsdept(20,20,jk),fsdepw(20,20,jk),     & 
    1228                              fse3t (20,20,jk),fse3w (20,20,jk),jk=1,jpk) 
    1229          WRITE(numout,*) 
    1230          WRITE(numout,*) ' domzgr: vertical coordinates : point (100,74,k)   bathy = ', bathy(100,74), hbatt(100,74) 
    1231          WRITE(numout,*) ' ~~~~~~  --------------------' 
    1232          WRITE(numout,9420) 
    1233          WRITE(numout,9430) (jk,fsdept(100,74,jk),fsdepw(100,74,jk),     & 
    1234                              fse3t (100,74,jk),fse3w (100,74,jk),jk=1,jpk) 
     1169         DO jj = mj0(20), mj1(20) 
     1170            DO ji = mi0(20), mi1(20) 
     1171               WRITE(numout,*) 
     1172               WRITE(numout,*) ' domzgr: vertical coordinates : point (20,20,k)   bathy = ', bathy(ji,jj), hbatt(ji,jj) 
     1173               WRITE(numout,*) ' ~~~~~~  --------------------' 
     1174               WRITE(numout,9420) 
     1175               WRITE(numout,9430) (jk,fsdept(ji,jj,jk),fsdepw(ji,jj,jk),     & 
     1176                    &                 fse3t (ji,jj,jk),fse3w (ji,jj,jk),jk=1,jpk) 
     1177            END DO 
     1178         END DO 
     1179         DO jj = mj0(74), mj1(74) 
     1180            DO ji = mi0(100), mi1(100) 
     1181               WRITE(numout,*) 
     1182               WRITE(numout,*) ' domzgr: vertical coordinates : point (100,74,k)   bathy = ', bathy(ji,jj), hbatt(ji,jj) 
     1183               WRITE(numout,*) ' ~~~~~~  --------------------' 
     1184               WRITE(numout,9420) 
     1185               WRITE(numout,9430) (jk,fsdept(ji,jj,jk),fsdepw(ji,jj,jk),     & 
     1186                    &                 fse3t (ji,jj,jk),fse3w (ji,jj,jk),jk=1,jpk) 
     1187            END DO 
     1188         END DO 
    12351189      ENDIF 
    12361190 
Note: See TracChangeset for help on using the changeset viewer.