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 13463 for NEMO/branches/2019/dev_r11351_fldread_with_XIOS/src/OCE/DOM/domwri.F90 – NEMO

Ignore:
Timestamp:
2020-09-14T17:40:34+02:00 (4 years ago)
Author:
andmirek
Message:

Ticket #2195:update to trunk 13461

Location:
NEMO/branches/2019/dev_r11351_fldread_with_XIOS
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2019/dev_r11351_fldread_with_XIOS

    • Property svn:externals
      •  

        old new  
        33^/utils/build/mk@HEAD         mk 
        44^/utils/tools@HEAD            tools 
        5 ^/vendors/AGRIF/dev@HEAD      ext/AGRIF 
         5^/vendors/AGRIF/dev_r12970_AGRIF_CMEMS      ext/AGRIF 
        66^/vendors/FCM@HEAD            ext/FCM 
        77^/vendors/IOIPSL@HEAD         ext/IOIPSL 
         8 
         9# SETTE 
         10^/utils/CI/sette@13382        sette 
  • NEMO/branches/2019/dev_r11351_fldread_with_XIOS/src/OCE/DOM/domwri.F90

    r10425 r13463  
    1313   !!---------------------------------------------------------------------- 
    1414   !!   dom_wri        : create and write mesh and mask file(s) 
    15    !!   dom_uniq       : identify unique point of a grid (TUVF) 
    1615   !!   dom_stiff      : diagnose maximum grid stiffness/hydrostatic consistency (s-coordinate) 
    1716   !!---------------------------------------------------------------------- 
     17   ! 
    1818   USE dom_oce         ! ocean space and time domain 
     19   USE domutl          !  
    1920   USE phycst ,   ONLY :   rsmall 
    2021   USE wet_dry,   ONLY :   ll_wd  ! Wetting and drying 
     
    3233 
    3334   !! * Substitutions 
    34 #  include "vectopt_loop_substitute.h90" 
     35#  include "do_loop_substitute.h90" 
    3536   !!---------------------------------------------------------------------- 
    3637   !! NEMO/OCE 4.0 , NEMO Consortium (2018) 
     
    7374      !                                  ! ============================ 
    7475      CALL iom_open( TRIM(clnam), inum, ldwrt = .TRUE. ) 
    75       ! 
    76       !                                                         ! global domain size 
    77       CALL iom_rstput( 0, 0, inum, 'jpiglo', REAL( jpiglo, wp), ktype = jp_i4 ) 
    78       CALL iom_rstput( 0, 0, inum, 'jpjglo', REAL( jpjglo, wp), ktype = jp_i4 ) 
    79       CALL iom_rstput( 0, 0, inum, 'jpkglo', REAL( jpkglo, wp), ktype = jp_i4 ) 
    80  
    8176      !                                                         ! domain characteristics 
    8277      CALL iom_rstput( 0, 0, inum, 'jperio', REAL( jperio, wp), ktype = jp_i4 ) 
     
    9994       
    10095      CALL dom_uniq( zprw, 'T' ) 
    101       DO jj = 1, jpj 
    102          DO ji = 1, jpi 
    103             zprt(ji,jj) = ssmask(ji,jj) * zprw(ji,jj)                        !    ! unique point mask 
    104          END DO 
    105       END DO                             !    ! unique point mask 
     96      DO_2D( 1, 1, 1, 1 ) 
     97         zprt(ji,jj) = ssmask(ji,jj) * zprw(ji,jj)                        !    ! unique point mask 
     98      END_2D 
    10699      CALL iom_rstput( 0, 0, inum, 'tmaskutil', zprt, ktype = jp_i1 )   
    107100      CALL dom_uniq( zprw, 'U' ) 
    108       DO jj = 1, jpj 
    109          DO ji = 1, jpi 
    110             zprt(ji,jj) = ssumask(ji,jj) * zprw(ji,jj)                        !    ! unique point mask 
    111          END DO 
    112       END DO 
     101      DO_2D( 1, 1, 1, 1 ) 
     102         zprt(ji,jj) = ssumask(ji,jj) * zprw(ji,jj)                        !    ! unique point mask 
     103      END_2D 
    113104      CALL iom_rstput( 0, 0, inum, 'umaskutil', zprt, ktype = jp_i1 )   
    114105      CALL dom_uniq( zprw, 'V' ) 
    115       DO jj = 1, jpj 
    116          DO ji = 1, jpi 
    117             zprt(ji,jj) = ssvmask(ji,jj) * zprw(ji,jj)                        !    ! unique point mask 
    118          END DO 
    119       END DO 
     106      DO_2D( 1, 1, 1, 1 ) 
     107         zprt(ji,jj) = ssvmask(ji,jj) * zprw(ji,jj)                        !    ! unique point mask 
     108      END_2D 
    120109      CALL iom_rstput( 0, 0, inum, 'vmaskutil', zprt, ktype = jp_i1 )   
    121110!!gm  ssfmask has been removed  ==>> find another solution to defined fmaskutil 
     
    155144       
    156145      ! note that mbkt is set to 1 over land ==> use surface tmask 
    157       zprt(:,:) = ssmask(:,:) * REAL( mbkt(:,:) , wp ) 
     146      zprt(:,:) = REAL( mbkt(:,:) , wp ) 
    158147      CALL iom_rstput( 0, 0, inum, 'mbathy', zprt, ktype = jp_i4 )     !    ! nb of ocean T-points 
    159       zprt(:,:) = ssmask(:,:) * REAL( mikt(:,:) , wp ) 
     148      zprt(:,:) = REAL( mikt(:,:) , wp ) 
    160149      CALL iom_rstput( 0, 0, inum, 'misf', zprt, ktype = jp_i4 )       !    ! nb of ocean T-points 
    161       zprt(:,:) = ssmask(:,:) * REAL( risfdep(:,:) , wp ) 
    162       CALL iom_rstput( 0, 0, inum, 'isfdraft', zprt, ktype = jp_r8 )   !    ! nb of ocean T-points 
    163150      !                                                         ! vertical mesh 
    164       CALL iom_rstput( 0, 0, inum, 'e3t_0', e3t_0, ktype = jp_r8  )    !    ! scale factors 
    165       CALL iom_rstput( 0, 0, inum, 'e3u_0', e3u_0, ktype = jp_r8  ) 
    166       CALL iom_rstput( 0, 0, inum, 'e3v_0', e3v_0, ktype = jp_r8  ) 
    167       CALL iom_rstput( 0, 0, inum, 'e3w_0', e3w_0, ktype = jp_r8  ) 
     151      CALL iom_rstput( 0, 0, inum, 'e3t_1d', e3t_1d, ktype = jp_r8  )    !    ! scale factors 
     152      CALL iom_rstput( 0, 0, inum, 'e3w_1d', e3w_1d, ktype = jp_r8  ) 
     153       
     154      CALL iom_rstput( 0, 0, inum, 'e3t_0' , e3t_0 , ktype = jp_r8  ) 
     155      CALL iom_rstput( 0, 0, inum, 'e3u_0' , e3u_0 , ktype = jp_r8  ) 
     156      CALL iom_rstput( 0, 0, inum, 'e3v_0' , e3v_0 , ktype = jp_r8  ) 
     157      CALL iom_rstput( 0, 0, inum, 'e3f_0' , e3f_0 , ktype = jp_r8  ) 
     158      CALL iom_rstput( 0, 0, inum, 'e3w_0' , e3w_0 , ktype = jp_r8  ) 
     159      CALL iom_rstput( 0, 0, inum, 'e3uw_0', e3uw_0, ktype = jp_r8  ) 
     160      CALL iom_rstput( 0, 0, inum, 'e3vw_0', e3vw_0, ktype = jp_r8  ) 
    168161      ! 
    169162      CALL iom_rstput( 0, 0, inum, 'gdept_1d' , gdept_1d , ktype = jp_r8 )  ! stretched system 
     
    183176      !                                     ! ============================ 
    184177   END SUBROUTINE dom_wri 
    185  
    186  
    187    SUBROUTINE dom_uniq( puniq, cdgrd ) 
    188       !!---------------------------------------------------------------------- 
    189       !!                  ***  ROUTINE dom_uniq  *** 
    190       !!                    
    191       !! ** Purpose :   identify unique point of a grid (TUVF) 
    192       !! 
    193       !! ** Method  :   1) aplly lbc_lnk on an array with different values for each element 
    194       !!                2) check which elements have been changed 
    195       !!---------------------------------------------------------------------- 
    196       CHARACTER(len=1)        , INTENT(in   ) ::   cdgrd   !  
    197       REAL(wp), DIMENSION(:,:), INTENT(inout) ::   puniq   !  
    198       ! 
    199       REAL(wp) ::  zshift   ! shift value link to the process number 
    200       INTEGER  ::  ji       ! dummy loop indices 
    201       LOGICAL, DIMENSION(SIZE(puniq,1),SIZE(puniq,2),1) ::  lldbl  ! store whether each point is unique or not 
    202       REAL(wp), DIMENSION(jpi,jpj) ::   ztstref 
    203       !!---------------------------------------------------------------------- 
    204       ! 
    205       ! build an array with different values for each element  
    206       ! in mpp: make sure that these values are different even between process 
    207       ! -> apply a shift value according to the process number 
    208       zshift = jpi * jpj * ( narea - 1 ) 
    209       ztstref(:,:) = RESHAPE( (/ (zshift + REAL(ji,wp), ji = 1, jpi*jpj) /), (/ jpi, jpj /) ) 
    210       ! 
    211       puniq(:,:) = ztstref(:,:)                   ! default definition 
    212       CALL lbc_lnk( 'domwri', puniq, cdgrd, 1. )            ! apply boundary conditions 
    213       lldbl(:,:,1) = puniq(:,:) == ztstref(:,:)   ! check which values have been changed  
    214       ! 
    215       puniq(:,:) = 1.                             ! default definition 
    216       ! fill only the inner part of the cpu with llbl converted into real  
    217       puniq(nldi:nlei,nldj:nlej) = REAL( COUNT( lldbl(nldi:nlei,nldj:nlej,:), dim = 3 ) , wp ) 
    218       ! 
    219    END SUBROUTINE dom_uniq 
    220178 
    221179 
     
    271229         END DO 
    272230      END DO 
    273       CALL lbc_lnk( 'domwri', zx1, 'T', 1. ) 
     231      CALL lbc_lnk( 'domwri', zx1, 'T', 1.0_wp ) 
    274232      ! 
    275233      IF( PRESENT( px1 ) )    px1 = zx1 
Note: See TracChangeset for help on using the changeset viewer.