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 12574 for NEMO/branches/UKMO/NEMO_4.0.1_GO8_package/src/OCE/DIA/diawri.F90 – NEMO

Ignore:
Timestamp:
2020-03-19T15:52:52+01:00 (4 years ago)
Author:
cguiavarch
Message:

Add Equation of State tag to salinity and temperature outputs and cell_methods attribute for mean_nemo (mean_nemo_wrapper not needed anymore)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/UKMO/NEMO_4.0.1_GO8_package/src/OCE/DIA/diawri.F90

    r11715 r12574  
    5050   USE iom            !  
    5151   USE ioipsl         !  
    52  
     52   USE eosbn2 
    5353#if defined key_si3 
    5454   USE ice  
     
    114114      REAL(wp), DIMENSION(jpi,jpj)     ::   z2d   ! 2D workspace 
    115115      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   z3d   ! 3D workspace 
     116      CHARACTER(len=4),SAVE :: ttype , stype           ! temperature and salinity type 
    116117      !!---------------------------------------------------------------------- 
    117118      !  
     119      IF( kt == nit000 ) THEN 
     120         IF( ln_TEOS10 ) THEN 
     121            IF ( iom_use("toce_pot") .OR. iom_use("soce_pra") .OR. iom_use("sst_pot") .OR. iom_use("sss_pra") & 
     122                  & .OR. iom_use("sbt_pot") .OR. iom_use("sbs_pra") .OR. iom_use("sstgrad_pot") .OR. iom_use("sstgrad2_pot") & 
     123                  & .OR. iom_use("tosmint_pot") .OR. iom_use("somint_pra"))  THEN  
     124               CALL ctl_stop( 'diawri: potential temperature and practical salinity not available with ln_TEOS10' ) 
     125            ELSE 
     126               ttype='con' ; stype='abs'   ! teos-10 using conservative temperature and absolute salinity 
     127            ENDIF  
     128         ELSE IF( ln_EOS80  ) THEN 
     129            IF ( iom_use("toce_con") .OR. iom_use("soce_abs") .OR. iom_use("sst_con") .OR. iom_use("sss_abs") & 
     130                  & .OR. iom_use("sbt_con") .OR. iom_use("sbs_abs") .OR. iom_use("sstgrad_con") .OR. iom_use("sstgrad2_con") & 
     131                  & .OR. iom_use("tosmint_con") .OR. iom_use("somint_abs"))  THEN  
     132               CALL ctl_stop( 'diawri: conservative temperature and absolute salinity not available with ln_EOS80' ) 
     133            ELSE 
     134               ttype='pot' ; stype='pra'   ! eos-80 using potential temperature and practical salinity 
     135            ENDIF 
     136         ELSE IF ( ln_SEOS) THEN 
     137            ttype='seos' ; stype='seos' ! seos using Simplified Equation of state 
     138         ENDIF 
     139      ENDIF 
     140 
    118141      IF( ln_timing )   CALL timing_start('dia_wri') 
    119142      !  
     
    145168         CALL iom_put( "wetdep" , ht_0(:,:) + sshn(:,:) ) 
    146169       
    147       CALL iom_put( "toce", tsn(:,:,:,jp_tem) )    ! 3D temperature 
    148       CALL iom_put(  "sst", tsn(:,:,1,jp_tem) )    ! surface temperature 
    149       IF ( iom_use("sbt") ) THEN 
     170      CALL iom_put( "toce_"//ttype, tsn(:,:,:,jp_tem) )    ! 3D temperature 
     171      CALL iom_put(  "sst_"//ttype, tsn(:,:,1,jp_tem) )    ! surface temperature 
     172      IF ( iom_use("sbt_"//ttype) ) THEN 
    150173         DO jj = 1, jpj 
    151174            DO ji = 1, jpi 
     
    154177            END DO 
    155178         END DO 
    156          CALL iom_put( "sbt", z2d )                ! bottom temperature 
     179         CALL iom_put( "sbt_"//ttype, z2d )                ! bottom temperature 
    157180      ENDIF 
    158181       
    159       CALL iom_put( "soce", tsn(:,:,:,jp_sal) )    ! 3D salinity 
    160       CALL iom_put(  "sss", tsn(:,:,1,jp_sal) )    ! surface salinity 
    161       IF ( iom_use("sbs") ) THEN 
     182      CALL iom_put( "soce_"//stype, tsn(:,:,:,jp_sal) )    ! 3D salinity 
     183      CALL iom_put(  "sss_"//stype, tsn(:,:,1,jp_sal) )    ! surface salinity 
     184      IF ( iom_use("sbs_"//stype) ) THEN 
    162185         DO jj = 1, jpj 
    163186            DO ji = 1, jpi 
     
    166189            END DO 
    167190         END DO 
    168          CALL iom_put( "sbs", z2d )                ! bottom salinity 
     191         CALL iom_put( "sbs_"//stype, z2d )                ! bottom salinity 
    169192      ENDIF 
    170193 
     
    232255      IF( iom_use('logavs') )   CALL iom_put( "logavs", LOG( MAX( 1.e-20_wp, avs(:,:,:) ) ) ) 
    233256 
    234       IF ( iom_use("sstgrad") .OR. iom_use("sstgrad2") ) THEN 
     257      IF ( iom_use("sstgrad_"//ttype) .OR. iom_use("sstgrad2_"//ttype) ) THEN 
    235258         DO jj = 2, jpjm1                                    ! sst gradient 
    236259            DO ji = fs_2, fs_jpim1   ! vector opt. 
     
    243266         END DO 
    244267         CALL lbc_lnk( 'diawri', z2d, 'T', 1. ) 
    245          CALL iom_put( "sstgrad2",  z2d )          ! square of module of sst gradient 
     268         CALL iom_put( "sstgrad2_"//ttype,  z2d )          ! square of module of sst gradient 
    246269         z2d(:,:) = SQRT( z2d(:,:) ) 
    247          CALL iom_put( "sstgrad" ,  z2d )          ! module of sst gradient 
     270         CALL iom_put( "sstgrad_"//ttype ,  z2d )          ! module of sst gradient 
    248271      ENDIF 
    249272          
     
    364387      ENDIF 
    365388 
    366       IF( iom_use("tosmint") ) THEN 
     389      IF( iom_use("tosmint_"//ttype) ) THEN 
    367390         z2d(:,:) = 0._wp 
    368391         DO jk = 1, jpkm1 
     
    374397         END DO 
    375398         CALL lbc_lnk( 'diawri', z2d, 'T', -1. ) 
    376          CALL iom_put( "tosmint", rau0 * z2d )        ! Vertical integral of temperature 
    377       ENDIF 
    378       IF( iom_use("somint") ) THEN 
     399         CALL iom_put( "tosmint_"//ttype, rau0 * z2d )        ! Vertical integral of temperature 
     400      ENDIF 
     401      IF( iom_use("somint_"//stype) ) THEN 
    379402         z2d(:,:)=0._wp 
    380403         DO jk = 1, jpkm1 
     
    386409         END DO 
    387410         CALL lbc_lnk( 'diawri', z2d, 'T', -1. ) 
    388          CALL iom_put( "somint", rau0 * z2d )         ! Vertical integral of salinity 
     411         CALL iom_put( "somint_"//stype, rau0 * z2d )         ! Vertical integral of salinity 
    389412      ENDIF 
    390413 
     
    926949         CALL iom_rstput( 0, 0, inum, 'sdvecrtz', wsd            )    ! now StokesDrift k-velocity 
    927950      ENDIF 
    928   
    929951#if defined key_si3 
    930952      IF( nn_ice == 2 ) THEN   ! condition needed in case agrif + ice-model but no-ice in child grid 
Note: See TracChangeset for help on using the changeset viewer.