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 9987 for branches/UKMO/dev_r5518_obs_oper_update_icethick/NEMOGCM/NEMO/OPA_SRC/DIA/diawri.F90 – NEMO

Ignore:
Timestamp:
2018-07-23T11:33:03+02:00 (6 years ago)
Author:
emmafiedler
Message:

Merge with GO6 FOAMv14 package branch r9288

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/UKMO/dev_r5518_obs_oper_update_icethick/NEMOGCM/NEMO/OPA_SRC/DIA/diawri.F90

    r7960 r9987  
    3939   USE zdfmxl          ! mixed layer 
    4040   USE dianam          ! build name of file (routine) 
     41   USE zdftke          ! vertical physics: one-equation scheme  
    4142   USE zdfddm          ! vertical  physics: double diffusion 
    4243   USE diahth          ! thermocline diagnostics 
     
    4647   USE iom 
    4748   USE ioipsl 
    48    USE dynspg_oce, ONLY: un_adv, vn_adv ! barotropic velocities      
    49  
     49   USE dynspg_oce, ONLY: un_adv, vn_adv ! barotropic velocities     
     50   USE insitu_tem, ONLY: insitu_t, theta2t 
    5051#if defined key_lim2 
    5152   USE limwri_2  
     
    145146      ENDIF 
    146147 
    147       IF( .NOT.lk_vvl ) THEN 
    148          CALL iom_put( "e3t" , fse3t_n(:,:,:) ) 
    149          CALL iom_put( "e3u" , fse3u_n(:,:,:) ) 
    150          CALL iom_put( "e3v" , fse3v_n(:,:,:) ) 
    151          CALL iom_put( "e3w" , fse3w_n(:,:,:) ) 
    152       ENDIF 
     148      ! Output of initial vertical scale factor 
     149      CALL iom_put("e3t_0", e3t_0(:,:,:) ) 
     150      CALL iom_put("e3u_0", e3t_0(:,:,:) ) 
     151      CALL iom_put("e3v_0", e3t_0(:,:,:) ) 
     152      ! 
     153      CALL iom_put( "e3t" , fse3t_n(:,:,:) ) 
     154      CALL iom_put( "e3u" , fse3u_n(:,:,:) ) 
     155      CALL iom_put( "e3v" , fse3v_n(:,:,:) ) 
     156      CALL iom_put( "e3w" , fse3w_n(:,:,:) ) 
     157      IF( iom_use("e3tdef") )   & 
     158         CALL iom_put( "e3tdef"  , ( ( fse3t_n(:,:,:) - e3t_0(:,:,:) ) / e3t_0(:,:,:) * 100 * tmask(:,:,:) ) ** 2 ) 
     159      CALL iom_put("tpt_dep", fsdept_n(:,:,:) ) 
     160      CALL iom_put("wpt_dep", fsdepw_n(:,:,:) ) 
     161 
    153162 
    154163      CALL iom_put( "ssh" , sshn )                 ! sea surface height 
    155       if( iom_use('ssh2') )   CALL iom_put( "ssh2", sshn(:,:) * sshn(:,:) )   ! square of sea surface height 
    156164       
    157165      CALL iom_put( "toce", tsn(:,:,:,jp_tem) )    ! 3D temperature 
     166      CALL theta2t ! in-situ temperature conversion 
     167      CALL iom_put( "tinsitu", insitu_t(:,:,:))    ! in-situ temperature 
    158168      CALL iom_put(  "sst", tsn(:,:,1,jp_tem) )    ! surface temperature 
    159169      IF ( iom_use("sbt") ) THEN 
     
    194204         CALL iom_put( "taubot", z2d )            
    195205      ENDIF 
    196           
     206       
    197207      CALL iom_put( "uoce", un(:,:,:)         )    ! 3D i-current 
    198208      CALL iom_put(  "ssu", un(:,:,1)         )    ! surface i-current 
     
    242252      CALL iom_put( "avt" , avt                        )    ! T vert. eddy diff. coef. 
    243253      CALL iom_put( "avm" , avmu                       )    ! T vert. eddy visc. coef. 
     254      IF( lk_zdftke ) THEN    
     255         CALL iom_put( "tke"      , en                               )    ! TKE budget: Turbulent Kinetic Energy    
     256         CALL iom_put( "tke_niw"  , e_niw                            )    ! TKE budget: Near-inertial waves    
     257      ENDIF  
    244258      CALL iom_put( "avs" , fsavs(:,:,:)               )    ! S vert. eddy diff. coef. (useful only with key_zdfddm) 
     259                                                            ! Log of eddy diff coef 
     260      IF( iom_use('logavt') )   CALL iom_put( "logavt", LOG( MAX( 1.e-20_wp, avt  (:,:,:) ) ) ) 
     261      IF( iom_use('logavs') )   CALL iom_put( "logavs", LOG( MAX( 1.e-20_wp, fsavs(:,:,:) ) ) ) 
    245262 
    246263      IF ( iom_use("sstgrad") .OR. iom_use("sstgrad2") ) THEN 
     
    307324         CALL iom_put( "eken", rke )            
    308325      ENDIF 
    309           
    310       IF( iom_use("u_masstr") .OR. iom_use("u_heattr") .OR. iom_use("u_salttr") ) THEN 
     326      ! 
     327      CALL iom_put( "hdiv", hdivn )                  ! Horizontal divergence 
     328      ! 
     329      IF( iom_use("u_masstr") .OR. iom_use("u_masstr_vint") .OR. iom_use("u_heattr") .OR. iom_use("u_salttr") ) THEN 
    311330         z3d(:,:,jpk) = 0.e0 
     331         z2d(:,:) = 0.e0 
    312332         DO jk = 1, jpkm1 
    313333            z3d(:,:,jk) = rau0 * un(:,:,jk) * e2u(:,:) * fse3u(:,:,jk) * umask(:,:,jk) 
     334            z2d(:,:) = z2d(:,:) + z3d(:,:,jk) 
    314335         END DO 
    315336         CALL iom_put( "u_masstr", z3d )                  ! mass transport in i-direction 
     337         CALL iom_put( "u_masstr_vint", z2d )             ! mass transport in i-direction vertical sum 
    316338      ENDIF 
    317339       
     
    376398         CALL iom_put( "v_salttr", 0.5 * z2d )            !  heat transport in j-direction 
    377399      ENDIF 
     400 
     401      ! Vertical integral of temperature 
     402      IF( iom_use("tosmint") ) THEN 
     403         z2d(:,:)=0._wp 
     404         DO jk = 1, jpkm1 
     405            DO jj = 2, jpjm1 
     406               DO ji = fs_2, fs_jpim1   ! vector opt. 
     407                  z2d(ji,jj) = z2d(ji,jj) + rau0 * fse3t(ji,jj,jk) *  tsn(ji,jj,jk,jp_tem) 
     408               END DO 
     409            END DO 
     410         END DO 
     411         CALL lbc_lnk( z2d, 'T', -1. ) 
     412         CALL iom_put( "tosmint", z2d )  
     413      ENDIF 
     414 
     415      ! Vertical integral of salinity 
     416      IF( iom_use("somint") ) THEN 
     417         z2d(:,:)=0._wp 
     418         DO jk = 1, jpkm1 
     419            DO jj = 2, jpjm1 
     420               DO ji = fs_2, fs_jpim1   ! vector opt. 
     421                  z2d(ji,jj) = z2d(ji,jj) + rau0 * fse3t(ji,jj,jk) * tsn(ji,jj,jk,jp_sal) 
     422               END DO 
     423            END DO 
     424         END DO 
     425         CALL lbc_lnk( z2d, 'T', -1. ) 
     426         CALL iom_put( "somint", z2d )  
     427      ENDIF 
     428 
     429      CALL iom_put( "bn2", rn2 )  !Brunt-Vaisala buoyancy frequency (N^2) 
    378430      ! 
    379431      CALL wrk_dealloc( jpi , jpj      , z2d ) 
     
    438490      zdt = rdt 
    439491      IF( nacc == 1 ) zdt = rdtmin 
    440       IF( ln_mskland )   THEN   ;   clop = "only(x)"   ! put 1.e+20 on land (very expensive!!) 
    441       ELSE                      ;   clop = "x"         ! no use of the mask value (require less cpu time) 
    442       ENDIF 
     492      clop = "x"         ! no use of the mask value (require less cpu time, and otherwise the model crashes) 
    443493#if defined key_diainstant 
    444494      zsto = nwrite * zdt 
     
    10201070         CALL histdef( id_i, "vovvldep", "T point depth"         , "m"      ,   &   ! t-point depth 
    10211071            &          jpi, jpj, nh_i, jpk, 1, jpk, nz_i, 32, clop, zsto, zout ) 
     1072         CALL histdef( id_i, "vovvle3t", "T point thickness"         , "m"      ,   &   ! t-point depth 
     1073            &          jpi, jpj, nh_i, jpk, 1, jpk, nz_i, 32, clop, zsto, zout ) 
    10221074      END IF 
    10231075 
     
    10501102      CALL histwrite( id_i, "sozotaux", kt, utau             , jpi*jpj    , idex )    ! i-wind stress 
    10511103      CALL histwrite( id_i, "sometauy", kt, vtau             , jpi*jpj    , idex )    ! j-wind stress 
     1104      IF( lk_vvl ) THEN 
     1105         CALL histwrite( id_i, "vovvldep", kt, fsdept_n(:,:,:), jpi*jpj*jpk, idex )!  T-cell depth        
     1106         CALL histwrite( id_i, "vovvle3t", kt, fse3t_n (:,:,:), jpi*jpj*jpk, idex )!  T-cell thickness   
     1107      END IF 
    10521108 
    10531109      ! 3. Close the file 
     
    10621118      ENDIF 
    10631119#endif 
     1120 
     1121      IF (cdfile_name == "output.abort") THEN 
     1122         CALL ctl_stop('MPPSTOP', 'NEMO abort from dia_wri_state') 
     1123      END IF 
    10641124        
    10651125!     IF( nn_timing == 1 )   CALL timing_stop('dia_wri_state') ! not sure this works for routines not called in first timestep 
Note: See TracChangeset for help on using the changeset viewer.