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 – 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)

Location:
NEMO/branches/UKMO/NEMO_4.0.1_GO8_package/src/OCE
Files:
6 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 
  • NEMO/branches/UKMO/NEMO_4.0.1_GO8_package/src/OCE/DOM/domain.F90

    r11717 r12574  
    292292         &             nn_it000, nn_itend , nn_date0    , nn_time0     , nn_leapy  , nn_istate ,     & 
    293293         &             nn_stock, nn_write , ln_mskland  , ln_clobber   , nn_chunksz, nn_euler  ,     & 
    294          &             ln_cfmeta, ln_iscpl, ln_xios_read, nn_wxios, ln_rstdate 
     294         &             ln_cfmeta, ln_iscpl, ln_xios_read, nn_wxios, ln_rstdate, ln_rst_eos 
     295 
    295296      NAMELIST/namdom/ ln_linssh, rn_isfhmin, rn_rdt, rn_atfp, ln_crs, ln_meshmask 
    296297#if defined key_netcdf4 
     
    345346         WRITE(numout,*) '      NetCDF chunksize (bytes)        nn_chunksz      = ', nn_chunksz 
    346347         WRITE(numout,*) '      IS coupling at the restart step ln_iscpl        = ', ln_iscpl 
     348         WRITE(numout,*) '      check restart equation of state ln_rst_eos      = ', ln_rst_eos 
     349 
    347350         IF( TRIM(Agrif_CFixed()) == '0' ) THEN 
    348351            WRITE(numout,*) '      READ restart for a single file using XIOS ln_xios_read =', ln_xios_read 
  • NEMO/branches/UKMO/NEMO_4.0.1_GO8_package/src/OCE/IOM/in_out_manager.F90

    r11717 r12574  
    2828   LOGICAL       ::   ln_rstart        !: start from (F) rest or (T) a restart file 
    2929   LOGICAL       ::   ln_rst_list      !: output restarts at list of times (T) or by frequency (F) 
     30   LOGICAL       ::   ln_rst_eos       !: check equation of state used for the restart is consistent with model 
    3031   INTEGER       ::   nn_rstctl        !: control of the time step (0, 1 or 2) 
    3132   INTEGER       ::   nn_rstssh   = 0  !: hand made initilization of ssh or not (1/0) 
  • NEMO/branches/UKMO/NEMO_4.0.1_GO8_package/src/OCE/IOM/iom.F90

    r11715 r12574  
    362362!from restart.F90 
    363363   CALL iom_set_rstw_var_active("rdt") 
     364   CALL iom_set_rstw_var_active("neos") 
     365 
    364366   IF ( .NOT. ln_diurnal_only ) THEN 
    365367        CALL iom_set_rstw_var_active('ub'  ) 
     
    411413        i = 0 
    412414        i = i + 1; fields(i)%vname="rdt";            fields(i)%grid="grid_scalar" 
     415        i = i + 1; fields(i)%vname="neos";           fields(i)%grid="grid_scalar" 
    413416        i = i + 1; fields(i)%vname="un";             fields(i)%grid="grid_N_3D" 
    414417        i = i + 1; fields(i)%vname="ub";             fields(i)%grid="grid_N_3D" 
  • NEMO/branches/UKMO/NEMO_4.0.1_GO8_package/src/OCE/IOM/restart.F90

    r11717 r12574  
    184184                  END IF 
    185185      ENDIF 
     186                     CALL iom_rstput( kt, nitrst, numrow, 'neos'    , REAL(neos)      , ldxios = lwxios)   ! equation of state 
     187                     !CALL iom_rstput( kt, nitrst, numrow, 'neos'    , neos      , ktype = jp_i1, ldxios = lwxios)   ! equation of state 
     188 
    186189       
    187190      IF (ln_diurnal) CALL iom_rstput( kt, nitrst, numrow, 'Dsst', x_dsst, ldxios = lwxios )   
     
    260263      !!---------------------------------------------------------------------- 
    261264      REAL(wp) ::   zrdt 
     265      REAL(wp) ::   zeos 
    262266      INTEGER  ::   jk 
    263267      REAL(wp), DIMENSION(jpi, jpj, jpk) :: w3d 
     
    266270      CALL rst_read_open           ! open restart for reading (if not already opened) 
    267271 
     272      IF ( ln_rst_eos ) THEN 
     273         ! Check equation of state used is consistent with the restart 
     274         IF( iom_varid( numror, 'neos') == -1) THEN 
     275            CALL ctl_stop( 'restart, rst_read: variable neos not found. STOP check that the equations of state in the restart file and in the namelist nameos are consistent and use ln_rst_eos=F') 
     276         ELSE 
     277            CALL iom_get( numror, 'neos', zeos, ldxios = lrxios ) 
     278            IF ( INT(zeos) /= neos ) CALL ctl_stop( 'restart, rst_read: equation of state used in restart file differs from namelist nameos') 
     279         ENDIF 
     280      ENDIF 
     281 
    268282      ! Check dynamics and tracer time-step consistency and force Euler restart if changed 
    269       IF( iom_varid( numror, 'rdt', ldstop = .FALSE. ) > 0 )   THEN 
     283      IF( iom_varid( numror, 'rdt', ldstop = .FALSE. ) > 0 )   THEN  
    270284         CALL iom_get( numror, 'rdt', zrdt, ldxios = lrxios ) 
    271285         IF( zrdt /= rdt )   neuler = 0 
  • NEMO/branches/UKMO/NEMO_4.0.1_GO8_package/src/OCE/SBC/sbcssm.F90

    r11715 r12574  
    5757      REAL(wp) ::   zcoef, zf_sbc       ! local scalar 
    5858      REAL(wp), DIMENSION(jpi,jpj,jpts) :: zts 
     59      CHARACTER(len=4),SAVE :: stype 
    5960      !!--------------------------------------------------------------------- 
     61      IF( kt == nit000 ) THEN 
     62         IF( ln_TEOS10 ) THEN 
     63            stype='abs'   ! teos-10: using absolute salinity (sst is converted to potential temperature for the surface module) 
     64         ELSE IF( ln_EOS80  ) THEN 
     65            stype='pra'   ! eos-80: using practical salinity 
     66         ELSE IF ( ln_SEOS) THEN 
     67            stype='seos' ! seos using Simplified Equation of state (sst is converted to potential temperature for the surface module) 
     68         ENDIF 
     69      ENDIF 
    6070      ! 
    6171      !                                        !* surface T-, U-, V- ocean level variables (T, S, depth, velocity) 
     
    174184         CALL iom_put( 'ssu_m', ssu_m ) 
    175185         CALL iom_put( 'ssv_m', ssv_m ) 
    176          CALL iom_put( 'sst_m', sst_m ) 
    177          CALL iom_put( 'sss_m', sss_m ) 
     186         CALL iom_put( 'sst_m_pot', sst_m ) 
     187         CALL iom_put( 'sss_m_'//stype, sss_m ) 
    178188         CALL iom_put( 'ssh_m', ssh_m ) 
    179189         CALL iom_put( 'e3t_m', e3t_m ) 
Note: See TracChangeset for help on using the changeset viewer.