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 1756 for trunk/NEMO/OPA_SRC/DIA/diawri.F90 – NEMO

Ignore:
Timestamp:
2009-11-25T15:15:20+01:00 (14 years ago)
Author:
smasson
Message:

implement AR5 diagnostics, see ticket:610

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMO/OPA_SRC/DIA/diawri.F90

    r1715 r1756  
    2424   USE in_out_manager  ! I/O manager 
    2525   USE diadimg         ! dimg direct access file format output 
     26   USE diaar5, ONLY :   lk_diaar5 
    2627   USE iom 
    2728   USE ioipsl 
     
    5051   !! * Substitutions 
    5152#  include "zdfddm_substitute.h90" 
     53#  include "domzgr_substitute.h90" 
     54#  include "vectopt_loop_substitute.h90" 
    5255   !!---------------------------------------------------------------------- 
    5356   !!   OPA 9.0 , LOCEAN-IPSL (2005)  
     
    8588      !!   3.2  !  05-11  (B. Lemaire) creation from old diawri 
    8689      !!---------------------------------------------------------------------- 
     90      USE oce, ONLY :   z3d => ta   ! use ta as 3D workspace 
     91      !! 
    8792      INTEGER, INTENT( in ) ::   kt      ! ocean time-step index 
     93      !! 
     94      INTEGER                      ::   ji, jj, jk              ! dummy loop indices 
     95      REAL(wp)                     ::   zztmp, zztmpx, zztmpy   !  
     96      REAL(wp), DIMENSION(jpi,jpj) ::   z2d                     !  
    8897      !!---------------------------------------------------------------------- 
    8998      !  
     
    94103      ENDIF 
    95104 
    96       CALL iom_put( "toce"   , tn        )    ! temperature 
    97       CALL iom_put( "soce"   , sn        )    ! salinity 
    98       CALL iom_put( "sst"    , tn(:,:,1) )    ! sea surface temperature 
    99       CALL iom_put( "sss"    , sn(:,:,1) )    ! sea surface salinity 
    100       CALL iom_put( "uoce"   , un        )    ! i-current       
    101       CALL iom_put( "voce"   , vn        )    ! j-current 
     105      CALL iom_put( "toce"   , tn                    )    ! temperature 
     106      CALL iom_put( "soce"   , sn                    )    ! salinity 
     107      CALL iom_put( "sst"    , tn(:,:,1)             )    ! sea surface temperature 
     108      CALL iom_put( "sst2"   , tn(:,:,1) * tn(:,:,1) )    ! square of sea surface temperature 
     109      CALL iom_put( "sss"    , sn(:,:,1)             )    ! sea surface salinity 
     110      CALL iom_put( "sss2"   , sn(:,:,1) * sn(:,:,1) )    ! square of sea surface salinity 
     111      CALL iom_put( "uoce"   , un                    )    ! i-current       
     112      CALL iom_put( "voce"   , vn                    )    ! j-current 
    102113       
    103       CALL iom_put( "avt"    , avt       )    ! T vert. eddy diff. coef. 
    104       CALL iom_put( "avm"    , avmu      )    ! T vert. eddy visc. coef. 
     114      CALL iom_put( "avt"    , avt                   )    ! T vert. eddy diff. coef. 
     115      CALL iom_put( "avm"    , avmu                  )    ! T vert. eddy visc. coef. 
    105116      IF( lk_zdfddm ) THEN 
    106          CALL iom_put( "avs", fsavs(:,:,:) )    ! S vert. eddy diff. coef. 
     117         CALL iom_put( "avs" , fsavs(:,:,:)          )    ! S vert. eddy diff. coef. 
     118      ENDIF 
     119 
     120      DO jj = 2, jpjm1                                    ! sst gradient 
     121         DO ji = fs_2, fs_jpim1   ! vector opt. 
     122            zztmp      = tn(ji,jj,1) 
     123            zztmpx     = ( tn(ji+1,jj  ,1) - zztmp ) / e1u(ji,jj) + ( zztmp - tn(ji-1,jj  ,1) ) / e1u(ji-1,jj  ) 
     124            zztmpy     = ( tn(ji  ,jj+1,1) - zztmp ) / e2v(ji,jj) + ( zztmp - tn(ji  ,jj-1,1) ) / e2v(ji  ,jj-1) 
     125            z2d(ji,jj) = 0.25 * ( zztmpx * zztmpx + zztmpy * zztmpy )   & 
     126               &              * umask(ji,jj,1) * umask(ji-1,jj,1) * vmask(ji,jj,1) * umask(ji,jj-1,1) 
     127         END DO 
     128      END DO 
     129      CALL lbc_lnk( z2d, 'T', 1. ) 
     130      CALL iom_put( "|sstgrad|2",  z2d               )    ! square of module of sst gradient 
     131!CDIR NOVERRCHK 
     132      z2d(:,:) = SQRT( z2d(:,:) ) 
     133      CALL iom_put( "|sstgrad|" ,  z2d               )    ! module of sst gradient 
     134 
     135      IF( lk_diaar5 ) THEN 
     136         z3d(:,:,jpk) = 0.e0 
     137         DO jk = 1, jpkm1 
     138            z3d(:,:,jk) = rau0 * un(:,:,jk) * e1u(:,:) * fse3u(:,:,jk) 
     139         END DO 
     140         CALL iom_put( "u_masstr", z3d )                  ! mass transport in i-direction 
     141         zztmp = 0.5 * rcp 
     142         z2d(:,:) = 0.e0  
     143         DO jk = 1, jpkm1 
     144            DO jj = 2, jpjm1 
     145               DO ji = fs_2, fs_jpim1   ! vector opt. 
     146                  z2d(ji,jj) = z2d(ji,jj) + z3d(ji,jj,jk) * zztmp * ( tn(ji,jj,jk) + tn(ji+1,jj,jk) ) 
     147               END DO 
     148            END DO 
     149         END DO 
     150         CALL lbc_lnk( z2d, 'U', -1. ) 
     151         CALL iom_put( "u_heattr", z2d )                  ! heat transport in i-direction 
     152         DO jk = 1, jpkm1 
     153            z3d(:,:,jk) = rau0 * vn(:,:,jk) * e2v(:,:) * fse3v(:,:,jk) 
     154         END DO 
     155         CALL iom_put( "v_masstr", z3d )                  ! mass transport in j-direction 
     156         z2d(:,:) = 0.e0  
     157         DO jk = 1, jpkm1 
     158            DO jj = 2, jpjm1 
     159               DO ji = fs_2, fs_jpim1   ! vector opt. 
     160                  z2d(ji,jj) = z2d(ji,jj) + z3d(ji,jj,jk) * zztmp * ( tn(ji,jj,jk) + tn(ji,jj+1,jk) ) 
     161               END DO 
     162            END DO 
     163         END DO 
     164         CALL lbc_lnk( z2d, 'V', -1. ) 
     165         CALL iom_put( "v_heattr", z2d )                  !  heat transport in i-direction 
    107166      ENDIF 
    108167 
Note: See TracChangeset for help on using the changeset viewer.