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 6717 for branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/NEMO/OPA_SRC/LBC/mppini_2.h90 – NEMO

Ignore:
Timestamp:
2016-06-17T12:00:46+02:00 (8 years ago)
Author:
gm
Message:

#1692 - branch SIMPLIF_2_usrdef: numerous improvement in the user defined interface

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/NEMO/OPA_SRC/LBC/mppini_2.h90

    r6596 r6717  
    66      !!     FOR USING THIS VERSION, A PREPROCESSING TRAITMENT IS RECOMMENDED 
    77      !!     FOR DEFINING BETTER CUTTING OUT. 
    8       !!       This routine is used with a the bathymetry file. 
     8      !!       This routine requires the presence of the "domain_cfg.nc" file. 
    99      !!       In this version, the land processors are avoided and the adress 
    1010      !!     processor (nproc, narea,noea, ...) are calculated again. 
     
    3232      !!                    nono      : number for local neighboring processor 
    3333      !! 
    34       !! History : 
    35       !!        !  94-11  (M. Guyon)  Original code 
    36       !!        !  95-04  (J. Escobar, M. Imbard) 
    37       !!        !  98-02  (M. Guyon)  FETI method 
    38       !!        !  98-05  (M. Imbard, J. Escobar, L. Colombet )  SHMEM and MPI versions 
    39       !!   9.0  !  04-01  (G. Madec, J.M Molines)  F90 : free form , north fold jpni > 1 
     34      !! History :       !  1994-11  (M. Guyon)  Original code 
     35      !!  OPA            !  1995-04  (J. Escobar, M. Imbard) 
     36      !!                 !  1998-02  (M. Guyon)  FETI method 
     37      !!                 !  1998-05  (M. Imbard, J. Escobar, L. Colombet )  SHMEM and MPI versions 
     38      !!  NEMO      1.0  !  2004-01  (G. Madec, J.M Molines)  F90 : free form , north fold jpni > 1 
     39      !!            4.0  !  2016-06  (G. Madec)  use domain_cfg file instead of bathymetry file 
    4040      !!---------------------------------------------------------------------- 
    4141      USE in_out_manager  ! I/O Manager 
     
    6565         ione  , ionw  , iose  , iosw  ,   &  !    "           " 
    6666         ibne  , ibnw  , ibse  , ibsw         !    "           " 
    67       INTEGER,  DIMENSION(jpiglo,jpjglo) ::   & 
    68          imask                                ! temporary global workspace 
    69       REAL(wp), DIMENSION(jpiglo,jpjglo) ::   & 
    70          zdta, zdtaisf                     ! temporary data workspace 
    71       REAL(wp) ::   zidom , zjdom          ! temporary scalars 
    72  
    73       ! read namelist for ln_zco 
    74       NAMELIST/namzgr/ ln_zco, ln_zps, ln_sco, ln_isfcav 
    75  
     67      INTEGER,  DIMENSION(jpiglo,jpjglo) ::   imask        ! global workspace 
     68      REAL(wp), DIMENSION(jpiglo,jpjglo) ::   zbot, ztop   ! global workspace 
     69      REAL(wp) ::   zidom , zjdom          ! local scalars 
    7670      !!---------------------------------------------------------------------- 
    77       !!  OPA 9.0 , LOCEAN-IPSL (2005)  
     71      !! NEMO/OPA 4.0 , NEMO Consortium (2016) 
    7872      !! $Id$ 
    79       !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt 
     73      !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt) 
    8074      !!---------------------------------------------------------------------- 
    8175 
    82       REWIND( numnam_ref )              ! Namelist namzgr in reference namelist : Vertical coordinate 
    83       READ  ( numnam_ref, namzgr, IOSTAT = ios, ERR = 901) 
    84 901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namzgr in reference namelist', lwp ) 
    85  
    86       REWIND( numnam_cfg )              ! Namelist namzgr in configuration namelist : Vertical coordinate 
    87       READ  ( numnam_cfg, namzgr, IOSTAT = ios, ERR = 902 ) 
    88 902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namzgr in configuration namelist', lwp ) 
    89       IF(lwm) WRITE ( numond, namzgr ) 
    90  
    9176      IF(lwp)WRITE(numout,*) 
    92       IF(lwp)WRITE(numout,*) 'mpp_init : Message Passing MPI' 
    93       IF(lwp)WRITE(numout,*) '~~~~~~~~' 
     77      IF(lwp)WRITE(numout,*) 'mpp_init_2 : Message Passing MPI' 
     78      IF(lwp)WRITE(numout,*) '~~~~~~~~~~' 
    9479      IF(lwp)WRITE(numout,*) ' ' 
    9580 
    96       IF( jpni*jpnj < jpnij ) CALL ctl_stop( ' jpnij > jpni x jpnj impossible' ) 
     81      IF( jpni*jpnj < jpnij )   CALL ctl_stop( ' jpnij > jpni x jpnj impossible' ) 
    9782 
    9883      ! 0. initialisation 
    9984      ! ----------------- 
    100  
    101       ! open the file 
    102       ! Remember that at this level in the code, mpp is not yet initialized, so 
    103       ! the file must be open with jpdom_unknown, and kstart and kcount forced  
    104       jstartrow = 1 
    105       IF ( ln_zco ) THEN  
    106          CALL iom_open ( 'bathy_level.nc', inum )   ! Level bathymetry 
    107           ! Optionally use a file attribute (open_ocean_jstart) to set a start row for reading from the global file 
    108           ! This allows the unextended grid bathymetry to be stored in the same file as the under ice-shelf extended bathymetry 
    109          CALL iom_getatt(inum, 'open_ocean_jstart', jstartrow ) ! -999 is returned if the attribute is not found 
    110          jstartrow = MAX(1,jstartrow) 
    111          CALL iom_get( inum, jpdom_unknown, 'Bathy_level', zdta, kstart=(/1,1+jstartrow-1/), kcount=(/jpiglo,jpjglo/) ) 
    112       ELSE 
    113          CALL iom_open ( 'bathy_meter.nc', inum )   ! Meter bathy in case of partial steps 
    114          IF ( ln_isfcav ) THEN 
    115              CALL iom_get( inum, jpdom_unknown, 'Bathymetry_isf' , zdta, kstart=(/1,1/), kcount=(/jpiglo,jpjglo/) ) 
    116          ELSE 
    117              ! Optionally use a file attribute (open_ocean_jstart) to set a start row for reading from the global file 
    118              ! This allows the unextended grid bathymetry to be stored in the same file as the under ice-shelf extended bathymetry 
    119              CALL iom_getatt(inum, 'open_ocean_jstart', jstartrow ) ! -999 is returned if the attribute is not found 
    120              jstartrow = MAX(1,jstartrow) 
    121              CALL iom_get( inum, jpdom_unknown, 'Bathymetry' , zdta, kstart=(/1,1+jstartrow-1/), kcount=(/jpiglo,jpjglo/) ) 
    122          ENDIF 
    123       ENDIF 
    124       CALL iom_close (inum) 
    125        
    126       ! used to compute the land processor in case of not masked bathy file. 
    127       zdtaisf(:,:) = 0.0_wp 
    128       IF ( ln_isfcav ) THEN 
    129          CALL iom_open ( 'bathy_meter.nc', inum )   ! Meter bathy in case of partial steps 
    130          CALL iom_get ( inum, jpdom_unknown, 'isf_draft' , zdtaisf, kstart=(/1,1/), kcount=(/jpiglo,jpjglo/) ) 
    131       END IF 
    132       CALL iom_close (inum) 
    133  
    134       ! land/sea mask over the global domain 
    135  
    136       imask(:,:)=1 
    137       WHERE ( zdta(:,:) - zdtaisf(:,:) <= rn_isfhmin ) imask = 0 
     85      CALL iom_open( 'domain_cfg', inum ) 
     86      ! 
     87      !                                   ! ocean top and bottom level 
     88      CALL iom_get( inum, jpdom_data, 'bottom level' , zbot    )  ! nb of ocean T-points 
     89      CALL iom_get( inum, jpdom_data, 'top    level' , ztop     )   ! nb of ocean T-points (ISF) 
     90      ! 
     91      CALL iom_close( inum ) 
     92      ! 
     93      ! 2D ocean mask (=1 if at least one level of the water column is ocean, =0 otherwise) 
     94      WHERE( zbot(:,:) - ztop(:,:) + 1 > 0 )   ;   imask(:,:) = 1 
     95      ELSEWHERE                                ;   imask(:,:) = 0 
     96      END WHERE 
    13897 
    13998      !  1. Dimension arrays for subdomains 
     
    320279         DO jj = 1+jprecj, ilj-jprecj 
    321280            DO  ji = 1+jpreci, ili-jpreci 
    322                IF( imask(ji+iimppt(ii,ij)-1, jj+ijmppt(ii,ij)-1) == 1) isurf = isurf+1 
     281               IF( imask(ji+iimppt(ii,ij)-1, jj+ijmppt(ii,ij)-1) == 1)   isurf = isurf+1 
    323282            END DO 
    324283         END DO 
Note: See TracChangeset for help on using the changeset viewer.