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 2444 for branches/nemo_v3_3_beta/NEMOGCM/NEMO/OFF_SRC/domrea.F90 – NEMO

Ignore:
Timestamp:
2010-11-29T15:30:48+01:00 (14 years ago)
Author:
cetlod
Message:

Improvment of OFFLINE in v3.3beta (review done by gm) : clean the style in all routines, suppression of key_zdfddm

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/nemo_v3_3_beta/NEMOGCM/NEMO/OFF_SRC/domrea.F90

    r2431 r2444  
    1111   !!                         = 3  :   mesh_hgr, mesh_zgr and mask 
    1212   !!---------------------------------------------------------------------- 
    13    !! * Modules used 
    1413   USE dom_oce         ! ocean space and time domain 
    15    USE dommsk   
    16    USE in_out_manager 
     14   USE dommsk          ! domain: masks 
     15   USE in_out_manager  ! I/O manager 
    1716 
    1817   IMPLICIT NONE 
    1918   PRIVATE 
    2019 
    21    !! * Accessibility 
    22    PUBLIC dom_rea        ! routine called by inidom.F90 
     20   PUBLIC   dom_rea    ! routine called by inidom.F90 
    2321   !!---------------------------------------------------------------------- 
    2422   !! NEMO/OFF 3.3 , NEMO Consortium (2010) 
     
    2927CONTAINS 
    3028 
    31 #if ( defined key_mpp_mpi || defined key_mpp_shmem ) && defined key_dimgout 
     29#if   defined key_mpp_mpi   &&  defined key_dimgout 
    3230   !!---------------------------------------------------------------------- 
    3331   !!   'key_mpp_mpi'     OR 
    34    !!   'key_mpp_shmem' 
    3532   !!   'key_dimgout' :         each processor makes its own direct access file  
    3633   !!                      use build_nc_meshmask off line to retrieve  
     
    3835   !!---------------------------------------------------------------------- 
    3936#  include "domrea_dimg.h90" 
    40  
    4137 
    4238#else 
     
    6763      !!      meshmask.nc  : domain size, horizontal grid-point position, 
    6864      !!                     masks, depth and vertical scale factors 
     65      !!---------------------------------------------------------------------- 
     66      USE iom 
    6967      !! 
    70       !! History : 
    71       !!        !  97-02  (G. Madec)  Original code 
    72       !!        !  99-11  (M. Imbard)  NetCDF FORMAT with IOIPSL 
    73       !!   9.0  !  02-08  (G. Madec)  F90 and several file 
    74       !!        !  06-07  (C. Ethe )  Use of iom module 
     68      INTEGER  ::   ji, jj, jk   ! dummy loop indices 
     69      INTEGER  ::   ik, inum0 , inum1 , inum2 , inum3 , inum4   ! local integers 
     70      REAL(wp) ::   zrefdep         ! local real 
     71      REAL(wp), DIMENSION(jpi,jpj) ::   zprt   ! 2D workspace 
    7572      !!---------------------------------------------------------------------- 
    76       !! * Modules used 
    77       USE iom 
    78  
    79       !! * Local declarations 
    80       INTEGER  ::   ji, jj, jk 
    81       INTEGER  ::                & !!! * temprary units for : 
    82          inum0 ,                 &  ! 'mesh_mask.nc' file 
    83          inum1 ,                 &  ! 'mesh.nc'      file 
    84          inum2 ,                 &  ! 'mask.nc'      file 
    85          inum3 ,                 &  ! 'mesh_hgr.nc'  file 
    86          inum4                      ! 'mesh_zgr.nc'  file 
    87   
    88       REAL(wp), DIMENSION(jpi,jpj) :: zprt 
    89       REAL(wp) ::   zrefdep         ! depth of the reference level (~10m) 
    90       INTEGER  :: ik 
    91       !!---------------------------------------------------------------------- 
    92  
    93        IF(lwp) WRITE(numout,*) 
    94        IF(lwp) WRITE(numout,*) 'dom_rea : read NetCDF mesh and mask information file(s)' 
    95        IF(lwp) WRITE(numout,*) '~~~~~~~' 
    96  
    97  
    98       zprt(:,:) = 0. 
     73 
     74      IF(lwp) WRITE(numout,*) 
     75      IF(lwp) WRITE(numout,*) 'dom_rea : read NetCDF mesh and mask information file(s)' 
     76      IF(lwp) WRITE(numout,*) '~~~~~~~' 
     77 
     78      zprt(:,:) = 0._wp 
    9979 
    10080      SELECT CASE (nmsh) 
     
    180160         DO jj = 1, jpj 
    181161            DO ji = 1, jpi 
    182                mbathy(ji,jj) = MAX( zprt(ji,jj) * tmask(ji,jj,1), 1. ) + 1 
     162               mbathy(ji,jj) = MAX( zprt(ji,jj) * tmask(ji,jj,1), 1._wp ) + 1 
    183163            ENDDO 
    184164         ENDDO 
     
    262242!!gm BUG in s-coordinate this does not work! 
    263243      ! deepest/shallowest W level Above/Below ~10m 
    264       zrefdep = 10. - ( 0.1*MINVAL(e3w_0) )                          ! ref. depth with tolerance (10% of minimum layer thickness) 
     244      zrefdep = 10._wp - ( 0.1_wp * MINVAL(e3w_0) )                  ! ref. depth with tolerance (10% of minimum layer thickness) 
    265245      nlb10 = MINLOC( gdepw_0, mask = gdepw_0 > zrefdep, dim = 1 )   ! shallowest W level Below ~10m 
    266246      nla10 = nlb10 - 1                                              ! deepest    W level Above ~10m 
     
    308288 
    309289      DO jk = 1, jpk 
    310          IF( e3w_0(jk) <= 0. .OR. e3t_0(jk) <= 0. ) CALL ctl_stop ( ' e3w_0 or e3t_0 =< 0 ' ) 
    311          IF( gdepw_0(jk) < 0. .OR. gdept_0(jk) < 0.) CALL ctl_stop( ' gdepw_0 or gdept_0 < 0 ' ) 
     290         IF( e3w_0  (jk) <= 0._wp .OR. e3t_0  (jk) <= 0._wp )   CALL ctl_stop( ' e3w_0 or e3t_0 =< 0 ' ) 
     291         IF( gdepw_0(jk) <  0._wp .OR. gdept_0(jk) <  0._wp )  CALL ctl_stop( ' gdepw_0 or gdept_0 < 0 ' ) 
    312292      END DO 
    313  
    314          !                                     ! ============================ 
    315          !                                     !        close the files  
    316          !                                     ! ============================ 
    317          SELECT CASE ( nmsh ) 
    318             CASE ( 1 )                 
    319                CALL iom_close( inum0 ) 
    320             CASE ( 2 ) 
    321                CALL iom_close( inum1 ) 
    322                CALL iom_close( inum2 ) 
    323             CASE ( 3 ) 
    324                CALL iom_close( inum2 ) 
    325                CALL iom_close( inum3 ) 
    326                CALL iom_close( inum4 ) 
    327          END SELECT 
    328  
     293      !                                     ! ============================ 
     294      !                                     !        close the files  
     295      !                                     ! ============================ 
     296      SELECT CASE ( nmsh ) 
     297         CASE ( 1 )                 
     298            CALL iom_close( inum0 ) 
     299         CASE ( 2 ) 
     300            CALL iom_close( inum1 ) 
     301            CALL iom_close( inum2 ) 
     302         CASE ( 3 ) 
     303            CALL iom_close( inum2 ) 
     304            CALL iom_close( inum3 ) 
     305            CALL iom_close( inum4 ) 
     306      END SELECT 
     307      ! 
    329308   END SUBROUTINE dom_rea 
    330309 
Note: See TracChangeset for help on using the changeset viewer.