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

Ignore:
Timestamp:
2020-12-04T11:17:01+01:00 (4 years ago)
Author:
cguiavarch
Message:

UKMO/NEMO_4.0.4_GO8_package: copy over changes from NEMO_4.0.3_GO8_package branch @13647.

File:
1 edited

Legend:

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

    r14075 r14078  
    4949   USE iom            !  
    5050   USE ioipsl         !  
    51  
     51   USE eosbn2 
    5252#if defined key_si3 
    5353   USE ice  
     
    113113      REAL(wp), DIMENSION(jpi,jpj)     ::   z2d   ! 2D workspace 
    114114      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   z3d   ! 3D workspace 
     115      CHARACTER(len=4),SAVE :: ttype , stype           ! temperature and salinity type 
    115116      !!---------------------------------------------------------------------- 
    116117      !  
     118      IF( kt == nit000 ) THEN 
     119         IF( ln_TEOS10 ) THEN 
     120            IF ( iom_use("toce_pot") .OR. iom_use("soce_pra") .OR. iom_use("sst_pot") .OR. iom_use("sss_pra") & 
     121                  & .OR. iom_use("sbt_pot") .OR. iom_use("sbs_pra") .OR. iom_use("sstgrad_pot") .OR. iom_use("sstgrad2_pot") & 
     122                  & .OR. iom_use("tosmint_pot") .OR. iom_use("somint_pra"))  THEN  
     123               CALL ctl_stop( 'diawri: potential temperature and practical salinity not available with ln_TEOS10' ) 
     124            ELSE 
     125               ttype='con' ; stype='abs'   ! teos-10 using conservative temperature and absolute salinity 
     126            ENDIF  
     127         ELSE IF( ln_EOS80  ) THEN 
     128            IF ( iom_use("toce_con") .OR. iom_use("soce_abs") .OR. iom_use("sst_con") .OR. iom_use("sss_abs") & 
     129                  & .OR. iom_use("sbt_con") .OR. iom_use("sbs_abs") .OR. iom_use("sstgrad_con") .OR. iom_use("sstgrad2_con") & 
     130                  & .OR. iom_use("tosmint_con") .OR. iom_use("somint_abs"))  THEN  
     131               CALL ctl_stop( 'diawri: conservative temperature and absolute salinity not available with ln_EOS80' ) 
     132            ELSE 
     133               ttype='pot' ; stype='pra'   ! eos-80 using potential temperature and practical salinity 
     134            ENDIF 
     135         ELSE IF ( ln_SEOS) THEN 
     136            ttype='seos' ; stype='seos' ! seos using Simplified Equation of state 
     137         ENDIF 
     138      ENDIF 
     139 
    117140      IF( ln_timing )   CALL timing_start('dia_wri') 
    118141      !  
     
    144167         CALL iom_put( "wetdep" , ht_0(:,:) + sshn(:,:) ) 
    145168       
    146       CALL iom_put( "toce", tsn(:,:,:,jp_tem) )    ! 3D temperature 
    147       CALL iom_put(  "sst", tsn(:,:,1,jp_tem) )    ! surface temperature 
    148       IF ( iom_use("sbt") ) THEN 
     169      CALL iom_put( "toce_"//ttype, tsn(:,:,:,jp_tem) )    ! 3D temperature 
     170      CALL iom_put(  "sst_"//ttype, tsn(:,:,1,jp_tem) )    ! surface temperature 
     171      IF ( iom_use("sbt_"//ttype) ) THEN 
    149172         DO jj = 1, jpj 
    150173            DO ji = 1, jpi 
     
    153176            END DO 
    154177         END DO 
    155          CALL iom_put( "sbt", z2d )                ! bottom temperature 
     178         CALL iom_put( "sbt_"//ttype, z2d )                ! bottom temperature 
    156179      ENDIF 
    157180       
    158       CALL iom_put( "soce", tsn(:,:,:,jp_sal) )    ! 3D salinity 
    159       CALL iom_put(  "sss", tsn(:,:,1,jp_sal) )    ! surface salinity 
    160       IF ( iom_use("sbs") ) THEN 
     181      CALL iom_put( "soce_"//stype, tsn(:,:,:,jp_sal) )    ! 3D salinity 
     182      CALL iom_put(  "sss_"//stype, tsn(:,:,1,jp_sal) )    ! surface salinity 
     183      IF ( iom_use("sbs_"//stype) ) THEN 
    161184         DO jj = 1, jpj 
    162185            DO ji = 1, jpi 
     
    165188            END DO 
    166189         END DO 
    167          CALL iom_put( "sbs", z2d )                ! bottom salinity 
     190         CALL iom_put( "sbs_"//stype, z2d )                ! bottom salinity 
    168191      ENDIF 
    169192 
     
    233256      IF( iom_use('logavs') )   CALL iom_put( "logavs", LOG( MAX( 1.e-20_wp, avs(:,:,:) ) ) ) 
    234257 
    235       IF ( iom_use("sstgrad") .OR. iom_use("sstgrad2") ) THEN 
     258      IF ( iom_use("sstgrad_"//ttype) .OR. iom_use("sstgrad2_"//ttype) ) THEN 
    236259         DO jj = 2, jpjm1                                    ! sst gradient 
    237260            DO ji = fs_2, fs_jpim1   ! vector opt. 
     
    244267         END DO 
    245268         CALL lbc_lnk( 'diawri', z2d, 'T', 1. ) 
    246          CALL iom_put( "sstgrad2",  z2d )          ! square of module of sst gradient 
     269         CALL iom_put( "sstgrad2_"//ttype,  z2d )          ! square of module of sst gradient 
    247270         z2d(:,:) = SQRT( z2d(:,:) ) 
    248          CALL iom_put( "sstgrad" ,  z2d )          ! module of sst gradient 
     271         CALL iom_put( "sstgrad_"//ttype ,  z2d )          ! module of sst gradient 
    249272      ENDIF 
    250273          
     
    365388      ENDIF 
    366389 
    367       IF( iom_use("tosmint") ) THEN 
     390      IF( iom_use("tosmint_"//ttype) ) THEN 
    368391         z2d(:,:) = 0._wp 
    369392         DO jk = 1, jpkm1 
     
    375398         END DO 
    376399         CALL lbc_lnk( 'diawri', z2d, 'T', -1. ) 
    377          CALL iom_put( "tosmint", rau0 * z2d )        ! Vertical integral of temperature 
    378       ENDIF 
    379       IF( iom_use("somint") ) THEN 
     400         CALL iom_put( "tosmint_"//ttype, rau0 * z2d )        ! Vertical integral of temperature 
     401      ENDIF 
     402      IF( iom_use("somint_"//stype) ) THEN 
    380403         z2d(:,:)=0._wp 
    381404         DO jk = 1, jpkm1 
     
    387410         END DO 
    388411         CALL lbc_lnk( 'diawri', z2d, 'T', -1. ) 
    389          CALL iom_put( "somint", rau0 * z2d )         ! Vertical integral of salinity 
     412         CALL iom_put( "somint_"//stype, rau0 * z2d )         ! Vertical integral of salinity 
    390413      ENDIF 
    391414 
     
    930953         CALL iom_rstput( 0, 0, inum, 'sdvecrtz', wsd            )    ! now StokesDrift k-velocity 
    931954      ENDIF 
    932   
    933955#if defined key_si3 
    934956      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.