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 14789 for NEMO/branches/2021/dev_r13747_HPC-11_mcastril_HPDAonline_DiagGPU/src/OCE/DIA/diawri.F90 – NEMO

Ignore:
Timestamp:
2021-05-05T13:18:04+02:00 (3 years ago)
Author:
mcastril
Message:

[2021/HPC-11_mcastril_HPDAonline_DiagGPU] Update externals

Location:
NEMO/branches/2021/dev_r13747_HPC-11_mcastril_HPDAonline_DiagGPU
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2021/dev_r13747_HPC-11_mcastril_HPDAonline_DiagGPU

    • Property svn:externals
      •  

        old new  
        33^/utils/build/mk@HEAD         mk 
        44^/utils/tools@HEAD            tools 
        5 ^/vendors/AGRIF/dev_r12970_AGRIF_CMEMS      ext/AGRIF 
         5^/vendors/AGRIF/dev@HEAD      ext/AGRIF 
        66^/vendors/FCM@HEAD            ext/FCM 
        77^/vendors/IOIPSL@HEAD         ext/IOIPSL 
         8^/vendors/PPR@HEAD            ext/PPR 
        89 
        910# SETTE 
        10 ^/utils/CI/sette@13559        sette 
         11^/utils/CI/sette@14244        sette 
  • NEMO/branches/2021/dev_r13747_HPC-11_mcastril_HPDAonline_DiagGPU/src/OCE/DIA/diawri.F90

    r13497 r14789  
    1919   !!            3.7  ! 2014-01  (G. Madec) remove eddy induced velocity from no-IOM output 
    2020   !!                 !                     change name of output variables in dia_wri_state 
     21   !!            4.0  ! 2020-10  (A. Nasser, S. Techene) add diagnostic for SWE 
    2122   !!---------------------------------------------------------------------- 
    2223 
     
    4647   USE zdfdrg         ! ocean vertical physics: top/bottom friction 
    4748   USE zdfmxl         ! mixed layer 
     49   USE zdfosm         ! mixed layer 
    4850   ! 
    4951   USE lbclnk         ! ocean lateral boundary conditions (or mpp link) 
     
    6870   PUBLIC   dia_wri_state 
    6971   PUBLIC   dia_wri_alloc           ! Called by nemogcm module 
    70 #if ! defined key_iomput    
     72#if ! defined key_xios    
    7173   PUBLIC   dia_wri_alloc_abl       ! Called by sbcabl  module (if ln_abl = .true.) 
    7274#endif 
     
    9395CONTAINS 
    9496 
    95 #if defined key_iomput 
     97#if defined key_xios 
    9698   !!---------------------------------------------------------------------- 
    97    !!   'key_iomput'                                        use IOM library 
     99   !!   'key_xios'                                        use IOM library 
    98100   !!---------------------------------------------------------------------- 
    99101   INTEGER FUNCTION dia_wri_alloc() 
     
    118120      INTEGER ::   ji, jj, jk       ! dummy loop indices 
    119121      INTEGER ::   ikbot            ! local integer 
    120       REAL(wp)::   ze3 
    121122      REAL(wp)::   zztmp , zztmpx   ! local scalar 
    122123      REAL(wp)::   zztmp2, zztmpy   !   -      - 
     124      REAL(wp)::   ze3 
    123125      REAL(wp), DIMENSION(jpi,jpj)     ::   z2d   ! 2D workspace 
    124126      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   z3d   ! 3D workspace 
     
    137139      CALL iom_put("e3u_0", e3u_0(:,:,:) ) 
    138140      CALL iom_put("e3v_0", e3v_0(:,:,:) ) 
    139       ! 
     141      CALL iom_put("e3f_0", e3f_0(:,:,:) ) 
     142      ! 
     143      IF ( iom_use("tpt_dep") ) THEN 
     144         DO jk = 1, jpk 
     145            z3d(:,:,jk) = gdept(:,:,jk,Kmm) 
     146         END DO 
     147         CALL iom_put( "tpt_dep",     z3d(:,:,:) ) 
     148      ENDIF 
     149 
    140150      IF ( iom_use("e3t") .OR. iom_use("e3tdef") ) THEN  ! time-varying e3t 
    141151         DO jk = 1, jpk 
     
    163173         CALL iom_put( "e3w" , z3d(:,:,:) ) 
    164174      ENDIF 
     175      IF ( iom_use("e3f") ) THEN                         ! time-varying e3f caution here at Kaa 
     176          DO jk = 1, jpk 
     177            z3d(:,:,jk) =  e3f(:,:,jk) 
     178         END DO 
     179         CALL iom_put( "e3f" , z3d(:,:,:) ) 
     180      ENDIF 
    165181 
    166182      IF( ll_wd ) THEN                                   ! sea surface height (brought back to the reference used for wetting and drying) 
    167          CALL iom_put( "ssh" , (ssh(:,:,Kmm)+ssh_ref)*tmask(:,:,1) ) 
     183         CALL iom_put( "ssh" , (ssh(:,:,Kmm)+ssh_ref)*ssmask(:,:) ) 
    168184      ELSE 
    169185         CALL iom_put( "ssh" , ssh(:,:,Kmm) )              ! sea surface height 
    170186      ENDIF 
    171187 
    172       IF( iom_use("wetdep") )   &                  ! wet depth 
    173          CALL iom_put( "wetdep" , ht_0(:,:) + ssh(:,:,Kmm) ) 
     188      IF( iom_use("wetdep") )    CALL iom_put( "wetdep" , ht_0(:,:) + ssh(:,:,Kmm) )   ! wet depth 
     189          
     190#if defined key_qco 
     191      IF( iom_use("ht") )   CALL iom_put( "ht" , ht(:,:)     )   ! water column at t-point 
     192      IF( iom_use("hu") )   CALL iom_put( "hu" , hu(:,:,Kmm) )   ! water column at u-point 
     193      IF( iom_use("hv") )   CALL iom_put( "hv" , hv(:,:,Kmm) )   ! water column at v-point 
     194      IF( iom_use("hf") )   CALL iom_put( "hf" , hf_0(:,:)*( 1._wp + r3f(:,:) ) )   ! water column at f-point (caution here at Naa) 
     195#endif 
    174196       
    175197      CALL iom_put( "toce", ts(:,:,:,jp_tem,Kmm) )    ! 3D temperature 
     
    193215      ENDIF 
    194216 
    195 #if ! defined key_qco 
    196       CALL iom_put( "rhop", rhop(:,:,:) )          ! 3D potential density (sigma0) 
    197 #endif 
     217      IF( .NOT.lk_SWE )   CALL iom_put( "rhop", rhop(:,:,:) )          ! 3D potential density (sigma0) 
    198218 
    199219      IF ( iom_use("taubot") ) THEN                ! bottom stress 
     
    231251      ENDIF 
    232252 
    233       IF( ln_zad_Aimp ) ww = ww + wi               ! Recombine explicit and implicit parts of vertical velocity for diagnostic output 
    234       CALL iom_put( "woce", ww )                   ! vertical velocity 
     253      !                                            ! vertical velocity 
     254      IF( ln_zad_Aimp ) THEN   ;   CALL iom_put( "woce", ww + wi )   ! explicit plus implicit parts 
     255      ELSE                     ;   CALL iom_put( "woce", ww ) 
     256      ENDIF 
    235257 
    236258      IF( iom_use('w_masstr') .OR. iom_use('w_masstr2') ) THEN   ! vertical mass transport & its square value 
    237          ! Caution: in the VVL case, it only correponds to the baroclinic mass transport. 
    238          z2d(:,:) = rho0 * e1e2t(:,:) 
     259         !                     ! Caution: in the VVL case, it only correponds to the baroclinic mass transport. 
    239260         DO jk = 1, jpk 
    240             z3d(:,:,jk) = ww(:,:,jk) * z2d(:,:) 
     261            IF( ln_zad_Aimp ) THEN 
     262               z3d(:,:,jk) = rho0 * e1e2t(:,:) * ( ww(:,:,jk) + wi(:,:,jk) ) 
     263            ELSE 
     264               z3d(:,:,jk) = rho0 * e1e2t(:,:) * ww(:,:,jk) 
     265            ENDIF 
    241266         END DO 
    242267         CALL iom_put( "w_masstr" , z3d )   
    243          IF( iom_use('w_masstr2') )   CALL iom_put( "w_masstr2", z3d(:,:,:) * z3d(:,:,:) ) 
    244       ENDIF 
    245       ! 
    246       IF( ln_zad_Aimp ) ww = ww - wi               ! Remove implicit part of vertical velocity that was added for diagnostic output 
     268         IF( iom_use('w_masstr2') )   CALL iom_put( "w_masstr2", z3d * z3d ) 
     269      ENDIF 
    247270 
    248271      CALL iom_put( "avt" , avt )                  ! T vert. eddy diff. coef. 
     
    325348      ENDIF 
    326349      ! 
     350      IF ( iom_use("sKE") ) THEN                        ! surface kinetic energy at T point 
     351         z2d(:,:) = 0._wp 
     352         DO_2D( 0, 0, 0, 0 ) 
     353            z2d(ji,jj) = 0.25_wp * ( uu(ji  ,jj,1,Kmm) * uu(ji  ,jj,1,Kmm) * e1e2u(ji  ,jj) * e3u(ji  ,jj,1,Kmm)  & 
     354               &                   + uu(ji-1,jj,1,Kmm) * uu(ji-1,jj,1,Kmm) * e1e2u(ji-1,jj) * e3u(ji-1,jj,1,Kmm)  & 
     355               &                   + vv(ji,jj  ,1,Kmm) * vv(ji,jj  ,1,Kmm) * e1e2v(ji,jj  ) * e3v(ji,jj  ,1,Kmm)  &  
     356               &                   + vv(ji,jj-1,1,Kmm) * vv(ji,jj-1,1,Kmm) * e1e2v(ji,jj-1) * e3v(ji,jj-1,1,Kmm)  )  & 
     357               &                 * r1_e1e2t(ji,jj) / e3t(ji,jj,1,Kmm) * ssmask(ji,jj) 
     358         END_2D 
     359         CALL lbc_lnk( 'diawri', z2d, 'T', 1. ) 
     360         IF ( iom_use("sKE" ) )  CALL iom_put( "sKE" , z2d )    
     361      ENDIF 
     362      !     
     363      IF ( iom_use("ssKEf") ) THEN                        ! surface kinetic energy at F point 
     364         z2d(:,:) = 0._wp                                ! CAUTION : only valid in SWE, not with bathymetry 
     365         DO_2D( 0, 0, 0, 0 ) 
     366            z2d(ji,jj) = 0.25_wp * ( uu(ji,jj  ,1,Kmm) * uu(ji,jj  ,1,Kmm) * e1e2u(ji,jj  ) * e3u(ji,jj  ,1,Kmm)  & 
     367               &                   + uu(ji,jj+1,1,Kmm) * uu(ji,jj+1,1,Kmm) * e1e2u(ji,jj+1) * e3u(ji,jj+1,1,Kmm)  & 
     368               &                   + vv(ji  ,jj,1,Kmm) * vv(ji,jj  ,1,Kmm) * e1e2v(ji  ,jj) * e3v(ji  ,jj,1,Kmm)  &  
     369               &                   + vv(ji+1,jj,1,Kmm) * vv(ji+1,jj,1,Kmm) * e1e2v(ji+1,jj) * e3v(ji+1,jj,1,Kmm)  )  & 
     370               &                 * r1_e1e2f(ji,jj) / e3f(ji,jj,1) * ssfmask(ji,jj) 
     371         END_2D 
     372         CALL lbc_lnk( 'diawri', z2d, 'F', 1. ) 
     373         CALL iom_put( "ssKEf", z2d )                      
     374      ENDIF 
     375      ! 
    327376      CALL iom_put( "hdiv", hdiv )                  ! Horizontal divergence 
    328377 
     
    424473       
    425474      IF (ln_dia25h)   CALL dia_25h( kt, Kmm )        ! 25h averaging 
     475       
     476      ! Output of surface vorticity terms 
     477      IF ( iom_use("ssrelvor")    .OR. iom_use("ssplavor")    .OR.   & 
     478         & iom_use("ssrelpotvor") .OR. iom_use("ssabspotvor") .OR.   & 
     479         & iom_use("ssEns")                                        ) THEN 
     480         ! 
     481         z2d(:,:) = 0._wp  
     482         ze3 = 0._wp  
     483         DO_2D( 1, 0, 1, 0 ) 
     484            z2d(ji,jj) = (   e2v(ji+1,jj  ) * vv(ji+1,jj  ,1,Kmm) - e2v(ji,jj) * vv(ji,jj,1,Kmm)    & 
     485            &              - e1u(ji  ,jj+1) * uu(ji  ,jj+1,1,Kmm) + e1u(ji,jj) * uu(ji,jj,1,Kmm)  ) * r1_e1e2f(ji,jj) 
     486         END_2D 
     487         CALL lbc_lnk( 'diawri', z2d, 'F', 1. ) 
     488         CALL iom_put( "ssrelvor", z2d )                  ! relative vorticity ( zeta )  
     489         ! 
     490         CALL iom_put( "ssplavor", ff_f )                 ! planetary vorticity ( f ) 
     491         ! 
     492         DO_2D( 1, 0, 1, 0 )   
     493            ze3 = (  e3t(ji,jj+1,1,Kmm) * e1e2t(ji,jj+1) + e3t(ji+1,jj+1,1,Kmm) * e1e2t(ji+1,jj+1)    & 
     494              &    + e3t(ji,jj  ,1,Kmm) * e1e2t(ji,jj  ) + e3t(ji+1,jj  ,1,Kmm) * e1e2t(ji+1,jj  )  ) * r1_e1e2f(ji,jj) 
     495            IF( ze3 /= 0._wp ) THEN   ;   ze3 = 4._wp / ze3 
     496            ELSE                      ;   ze3 = 0._wp 
     497            ENDIF 
     498            z2d(ji,jj) = ze3 * z2d(ji,jj)  
     499         END_2D 
     500         CALL lbc_lnk( 'diawri', z2d, 'F', 1. ) 
     501         CALL iom_put( "ssrelpotvor", z2d )                  ! relative potential vorticity (zeta/h) 
     502         ! 
     503         DO_2D( 1, 0, 1, 0 ) 
     504            ze3 = (  e3t(ji,jj+1,1,Kmm) * e1e2t(ji,jj+1) + e3t(ji+1,jj+1,1,Kmm) * e1e2t(ji+1,jj+1)    & 
     505              &    + e3t(ji,jj  ,1,Kmm) * e1e2t(ji,jj  ) + e3t(ji+1,jj  ,1,Kmm) * e1e2t(ji+1,jj  )  ) * r1_e1e2f(ji,jj) 
     506            IF( ze3 /= 0._wp ) THEN   ;   ze3 = 4._wp / ze3 
     507            ELSE                      ;   ze3 = 0._wp 
     508            ENDIF 
     509            z2d(ji,jj) = ze3 * ff_f(ji,jj) + z2d(ji,jj)  
     510         END_2D 
     511         CALL lbc_lnk( 'diawri', z2d, 'F', 1. ) 
     512         CALL iom_put( "ssabspotvor", z2d )                  ! absolute potential vorticity ( q ) 
     513         ! 
     514         DO_2D( 1, 0, 1, 0 )   
     515            z2d(ji,jj) = 0.5_wp * z2d(ji,jj)  * z2d(ji,jj)  
     516         END_2D 
     517         CALL lbc_lnk( 'diawri', z2d, 'F', 1. ) 
     518         CALL iom_put( "ssEns", z2d )                        ! potential enstrophy ( 1/2*q2 ) 
     519         ! 
     520      ENDIF 
    426521 
    427522      IF( ln_timing )   CALL timing_stop('dia_wri') 
     
    9971092      !! 
    9981093      INTEGER :: inum, jk 
    999       REAL(wp), DIMENSION(jpi,jpj,jpk) :: ze3t, zgdept      ! 3D workspace !!st patch to use substitution 
     1094      REAL(wp), DIMENSION(jpi,jpj,jpk) :: ze3t, zgdept       ! 3D workspace for qco substitution 
    10001095      !!---------------------------------------------------------------------- 
    10011096      !  
     
    10761171         CALL iom_rstput ( 0, 0, inum, "qz1_abl",  tq_abl(:,:,2,nt_a,2) )   ! now first level humidity 
    10771172      ENDIF 
     1173      IF( ln_zdfosm ) THEN 
     1174         CALL iom_rstput( 0, 0, inum, 'hbl', hbl*tmask(:,:,1)  )      ! now boundary-layer depth 
     1175         CALL iom_rstput( 0, 0, inum, 'hml', hml*tmask(:,:,1)  )      ! now mixed-layer depth 
     1176         CALL iom_rstput( 0, 0, inum, 'avt_k', avt_k*wmask     )      ! w-level diffusion 
     1177         CALL iom_rstput( 0, 0, inum, 'avm_k', avm_k*wmask     )      ! now w-level viscosity 
     1178         CALL iom_rstput( 0, 0, inum, 'ghamt', ghamt*wmask     )      ! non-local t forcing 
     1179         CALL iom_rstput( 0, 0, inum, 'ghams', ghams*wmask     )      ! non-local s forcing 
     1180         CALL iom_rstput( 0, 0, inum, 'ghamu', ghamu*umask     )      ! non-local u forcing 
     1181         CALL iom_rstput( 0, 0, inum, 'ghamv', ghamv*vmask     )      ! non-local v forcing 
     1182         IF( ln_osm_mle ) THEN 
     1183            CALL iom_rstput( 0, 0, inum, 'hmle', hmle*tmask(:,:,1)  ) ! now transition-layer depth 
     1184         END IF 
     1185      ENDIF 
    10781186      ! 
    10791187      CALL iom_close( inum ) 
Note: See TracChangeset for help on using the changeset viewer.