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

Ignore:
Timestamp:
2020-04-03T13:09:33+02:00 (4 years ago)
Author:
cguiavarch
Message:

UKMO/NEMO_4.0.2_GO8_package: copy over changes from NEMO_4.0.1_GO8_package branch.

File:
1 edited

Legend:

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

    r12658 r12660  
    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 
     
    231254      IF( iom_use('logavs') )   CALL iom_put( "logavs", LOG( MAX( 1.e-20_wp, avs(:,:,:) ) ) ) 
    232255 
    233       IF ( iom_use("sstgrad") .OR. iom_use("sstgrad2") ) THEN 
     256      IF ( iom_use("sstgrad_"//ttype) .OR. iom_use("sstgrad2_"//ttype) ) THEN 
    234257         DO jj = 2, jpjm1                                    ! sst gradient 
    235258            DO ji = fs_2, fs_jpim1   ! vector opt. 
     
    242265         END DO 
    243266         CALL lbc_lnk( 'diawri', z2d, 'T', 1. ) 
    244          CALL iom_put( "sstgrad2",  z2d )          ! square of module of sst gradient 
     267         CALL iom_put( "sstgrad2_"//ttype,  z2d )          ! square of module of sst gradient 
    245268         z2d(:,:) = SQRT( z2d(:,:) ) 
    246          CALL iom_put( "sstgrad" ,  z2d )          ! module of sst gradient 
     269         CALL iom_put( "sstgrad_"//ttype ,  z2d )          ! module of sst gradient 
    247270      ENDIF 
    248271          
     
    363386      ENDIF 
    364387 
    365       IF( iom_use("tosmint") ) THEN 
     388      IF( iom_use("tosmint_"//ttype) ) THEN 
    366389         z2d(:,:) = 0._wp 
    367390         DO jk = 1, jpkm1 
     
    373396         END DO 
    374397         CALL lbc_lnk( 'diawri', z2d, 'T', -1. ) 
    375          CALL iom_put( "tosmint", rau0 * z2d )        ! Vertical integral of temperature 
    376       ENDIF 
    377       IF( iom_use("somint") ) THEN 
     398         CALL iom_put( "tosmint_"//ttype, rau0 * z2d )        ! Vertical integral of temperature 
     399      ENDIF 
     400      IF( iom_use("somint_"//stype) ) THEN 
    378401         z2d(:,:)=0._wp 
    379402         DO jk = 1, jpkm1 
     
    385408         END DO 
    386409         CALL lbc_lnk( 'diawri', z2d, 'T', -1. ) 
    387          CALL iom_put( "somint", rau0 * z2d )         ! Vertical integral of salinity 
     410         CALL iom_put( "somint_"//stype, rau0 * z2d )         ! Vertical integral of salinity 
    388411      ENDIF 
    389412 
     
    923946         CALL iom_rstput( 0, 0, inum, 'sdvecrtz', wsd            )    ! now StokesDrift k-velocity 
    924947      ENDIF 
    925   
    926948#if defined key_si3 
    927949      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.