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 7200 for branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/NEMO/OPA_SRC/DOM/domzgr.F90 – NEMO

Ignore:
Timestamp:
2016-11-06T17:31:33+01:00 (7 years ago)
Author:
gm
Message:

#1692 - branch SIMPLIF_2_usrdef: add depth_e3 module + management of ORCA family + domain_cfg filename (in&out) given in namelist

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/NEMO/OPA_SRC/DOM/domzgr.F90

    r7189 r7200  
    2323   !!---------------------------------------------------------------------- 
    2424   !!   dom_zgr       : read or set the ocean vertical coordinate system 
    25    !!   zgr_read      : read the vertical domain coordinate and mask in domain_cfg file 
     25   !!   zgr_read      : read the vertical information in the domain configuration file 
    2626   !!   zgr_top_bot   : ocean top and bottom level for t-, u, and v-points with 1 as minimum value 
    2727   !!--------------------------------------------------------------------- 
     
    8989      IF( ln_read_cfg ) THEN        !==  read in mesh_mask.nc file  ==! 
    9090         IF(lwp) WRITE(numout,*) 
    91          IF(lwp) WRITE(numout,*) '          Read vertical mesh in "domain_cfg" file' 
     91         IF(lwp) WRITE(numout,*) '          Read vertical mesh in ', TRIM( cn_domcfg ), ' file' 
    9292         ! 
    9393         CALL zgr_read   ( ln_zco  , ln_zps  , ln_sco, ln_isfcav,   &  
     
    120120      IF(lwp) THEN                     ! Control print 
    121121         WRITE(numout,*) 
    122          WRITE(numout,*) '   Type of vertical coordinate (read in domain_cfg.nc or set through user defined routines) :' 
     122         WRITE(numout,*) '   Type of vertical coordinate (read in ', TRIM( cn_domcfg ), ' file or set in userdef_nam) :' 
    123123         WRITE(numout,*) '      z-coordinate - full steps      ln_zco    = ', ln_zco 
    124124         WRITE(numout,*) '      z-coordinate - partial steps   ln_zps    = ', ln_zps 
     
    178178      !!              ***  ROUTINE zgr_read  *** 
    179179      !! 
    180       !! ** Purpose :   Read the vertical information in a domain_cfg.nc file 
     180      !! ** Purpose :   Read the vertical information in the domain configuration file 
    181181      !! 
    182182      !!---------------------------------------------------------------------- 
     
    198198      IF(lwp) THEN 
    199199         WRITE(numout,*) 
    200          WRITE(numout,*) '   zgr_read : read the vertical coordinates in "domain_cfg.nc" file' 
    201          WRITE(numout,*) '   ~~~~~~~~      jpiglo = ', jpiglo, ' jpjglo = ', jpjglo, ' jpkglo = ', jpkglo 
    202       ENDIF 
    203       ! 
    204       CALL iom_open( 'domain_cfg', inum ) 
    205       ! 
    206       !                                   ! type of vertical coordinate 
     200         WRITE(numout,*) '   zgr_read : read the vertical coordinates in ', TRIM( cn_domcfg ), ' file' 
     201         WRITE(numout,*) '   ~~~~~~~~' 
     202      ENDIF 
     203      ! 
     204      CALL iom_open( cn_domcfg, inum ) 
     205      ! 
     206      !                          !* type of vertical coordinate 
    207207      CALL iom_get( inum, 'ln_zco'   , z_zco ) 
    208208      CALL iom_get( inum, 'ln_zps'   , z_zps ) 
     
    212212      IF( z_sco == 0._wp ) THEN   ;   ld_sco = .false.   ;   ELSE   ;   ld_sco = .true.   ;   ENDIF 
    213213      ! 
    214       !                                   ! ocean cavities under iceshelves 
     214      !                          !* ocean cavities under iceshelves 
    215215      CALL iom_get( inum, 'ln_isfcav', z_cav ) 
    216216      IF( z_cav == 0._wp ) THEN   ;   ld_isfcav = .false.   ;   ELSE   ;   ld_isfcav = .true.   ;   ENDIF 
    217217      ! 
    218       !                                   ! 1D vertical scale factors (reference coordinate) 
    219       CALL iom_get( inum, jpdom_unknown, 'e3t_1d'  , pe3t_1d  ) 
     218      !                          !* vertical scale factors 
     219      CALL iom_get( inum, jpdom_unknown, 'e3t_1d'  , pe3t_1d  )                     ! 1D reference coordinate 
    220220      CALL iom_get( inum, jpdom_unknown, 'e3w_1d'  , pe3w_1d  ) 
    221221      ! 
    222       !                                   ! 3D vertical scale factors 
    223       CALL iom_get( inum, jpdom_data, 'e3t_0'  , pe3t  , lrowattr=ln_use_jattr ) 
     222      CALL iom_get( inum, jpdom_data, 'e3t_0'  , pe3t  , lrowattr=ln_use_jattr )    ! 3D coordinate 
    224223      CALL iom_get( inum, jpdom_data, 'e3u_0'  , pe3u  , lrowattr=ln_use_jattr ) 
    225224      CALL iom_get( inum, jpdom_data, 'e3v_0'  , pe3v  , lrowattr=ln_use_jattr ) 
     
    229228      CALL iom_get( inum, jpdom_data, 'e3vw_0' , pe3vw , lrowattr=ln_use_jattr ) 
    230229      ! 
    231       !                                   ! 1D & 3D depths 
    232       ! 
    233       !                                         ! old depth definition (obsolescent feature) 
     230      !                          !* depths 
     231      !                                   !- old depth definition (obsolescent feature) 
    234232      IF(  iom_varid( inum, 'gdept_1d', ldstop = .FALSE. ) > 0  .AND.  & 
    235233         & iom_varid( inum, 'gdepw_1d', ldstop = .FALSE. ) > 0  .AND.  & 
     
    237235         & iom_varid( inum, 'gdepw_0' , ldstop = .FALSE. ) > 0    ) THEN 
    238236         CALL ctl_warn( 'zgr_read : old definition of depths and scale factors used ', &  
    239             &                      'depths at t- and w-points read in domain_cfg file') 
     237            &           '           depths at t- and w-points read in the domain configuration file') 
    240238         CALL iom_get( inum, jpdom_unknown, 'gdept_1d', pdept_1d )    
    241239         CALL iom_get( inum, jpdom_unknown, 'gdepw_1d', pdepw_1d ) 
     
    243241         CALL iom_get( inum, jpdom_data   , 'gdepw_0' , pdepw , lrowattr=ln_use_jattr ) 
    244242         ! 
    245       ELSE                                      ! depths computed from e3. scale factors 
    246          ! 
     243      ELSE                                !- depths computed from e3. scale factors 
    247244         CALL e3_to_depth( pe3t_1d, pe3w_1d, pdept_1d, pdepw_1d )    ! 1D reference depth 
     245         CALL e3_to_depth( pe3t   , pe3w   , pdept   , pdepw    )    ! 3D depths 
    248246         IF(lwp) THEN 
    249247            WRITE(numout,*) 
     
    252250            WRITE(numout, "(10x, i4, 4f9.2)" ) ( jk, pdept_1d(jk), pdepw_1d(jk), pe3t_1d(jk), pe3w_1d(jk), jk = 1, jpk ) 
    253251         ENDIF 
    254          !                                       
    255          CALL e3_to_depth( pe3t   , pe3w   , pdept   , pdepw    )    ! 3D depths 
    256          ! 
    257       ENDIF 
    258       ! 
    259       !                                   ! ocean top and bottom level 
    260       CALL iom_get( inum, jpdom_data, 'bottom_level' , z2d  , lrowattr=ln_use_jattr )  ! nb of ocean T-points 
     252      ENDIF 
     253      ! 
     254      !                          !* ocean top and bottom level 
     255      CALL iom_get( inum, jpdom_data, 'top_level'    , z2d  , lrowattr=ln_use_jattr )   ! 1st wet T-points (ISF) 
     256      k_top(:,:) = INT( z2d(:,:) ) 
     257      CALL iom_get( inum, jpdom_data, 'bottom_level' , z2d  , lrowattr=ln_use_jattr )   ! last wet T-points 
    261258      k_bot(:,:) = INT( z2d(:,:) ) 
    262       CALL iom_get( inum, jpdom_data, 'top_level'    , z2d  , lrowattr=ln_use_jattr )   ! nb of ocean T-points (ISF) 
    263       k_top(:,:) = INT( z2d(:,:) ) 
    264259      ! 
    265260      CALL iom_close( inum ) 
Note: See TracChangeset for help on using the changeset viewer.