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 13463 for NEMO/branches/2019/dev_r11351_fldread_with_XIOS/src/OCE/C1D/step_c1d.F90 – NEMO

Ignore:
Timestamp:
2020-09-14T17:40:34+02:00 (4 years ago)
Author:
andmirek
Message:

Ticket #2195:update to trunk 13461

Location:
NEMO/branches/2019/dev_r11351_fldread_with_XIOS
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2019/dev_r11351_fldread_with_XIOS

    • Property svn:externals
      •  

        old new  
        33^/utils/build/mk@HEAD         mk 
        44^/utils/tools@HEAD            tools 
        5 ^/vendors/AGRIF/dev@HEAD      ext/AGRIF 
         5^/vendors/AGRIF/dev_r12970_AGRIF_CMEMS      ext/AGRIF 
        66^/vendors/FCM@HEAD            ext/FCM 
        77^/vendors/IOIPSL@HEAD         ext/IOIPSL 
         8 
         9# SETTE 
         10^/utils/CI/sette@13382        sette 
  • NEMO/branches/2019/dev_r11351_fldread_with_XIOS/src/OCE/C1D/step_c1d.F90

    r10068 r13463  
    66   !! History :   2.0  !  2004-04  (C. Ethe)  adapted from step.F90 for C1D 
    77   !!             3.0  !  2008-04  (G. Madec)  redo the adaptation to include SBC 
     8   !!             4.1  !  2019-08  (A. Coward, D. Storkey) rewrite in preparation for new timestepping scheme 
    89   !!---------------------------------------------------------------------- 
    910#if defined key_c1d 
     
    1415   !!---------------------------------------------------------------------- 
    1516   USE step_oce        ! time stepping definition modules  
     17   USE step, ONLY : Nbb, Nnn, Naa, Nrhs ! time level indices 
    1618#if defined key_top 
    1719   USE trcstp          ! passive tracer time-stepping      (trc_stp routine) 
    1820#endif 
    1921   USE dyncor_c1d      ! Coriolis term (c1d case)         (dyn_cor_1d     ) 
    20    USE dynnxt          ! time-stepping                    (dyn_nxt routine) 
     22   USE dynatf          ! time filtering                   (dyn_atf routine) 
    2123   USE dyndmp          ! U & V momentum damping           (dyn_dmp routine) 
    2224   USE restart         ! restart  
     
    2527   PRIVATE 
    2628 
    27    PUBLIC stp_c1d      ! called by opa.F90 
     29   PUBLIC stp_c1d      ! called by nemogcm.F90 
    2830 
    2931   !!---------------------------------------------------------------------- 
     
    5456      ! 
    5557      INTEGER ::   jk       ! dummy loop indice 
    56       INTEGER ::   indic    ! error indicator if < 0 
    5758      !! --------------------------------------------------------------------- 
    58  
    59                              indic = 0                ! reset to no error condition 
    6059      IF( kstp == nit000 )   CALL iom_init( "nemo")   ! iom_put initialization (must be done after nemo_init for AGRIF+XIOS+OASIS) 
    6160      IF( kstp /= nit000 )   CALL day( kstp )         ! Calendar (day was already called at nit000 in day_init) 
     
    6564      ! Update data, open boundaries, surface boundary condition (including sea-ice) 
    6665      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    67                          CALL sbc    ( kstp )         ! Sea Boundary Condition (including sea-ice) 
     66                         CALL sbc    ( kstp, Nbb, Nnn )  ! Sea Boundary Condition (including sea-ice) 
    6867 
    6968      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    70       ! Ocean physics update                (ua, va, ta, sa used as workspace) 
     69      ! Ocean physics update         
    7170      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    72                          CALL eos_rab( tsb, rab_b )   ! before local thermal/haline expension ratio at T-points 
    73                          CALL eos_rab( tsn, rab_n )   ! now    local thermal/haline expension ratio at T-points 
    74                          CALL bn2( tsb, rab_b, rn2b ) ! before Brunt-Vaisala frequency 
    75                          CALL bn2( tsn, rab_n, rn2 ) ! now    Brunt-Vaisala frequency 
     71                         CALL eos_rab( ts(:,:,:,:,Nbb), rab_b, Nnn )  ! before local thermal/haline expension ratio at T-points 
     72                         CALL eos_rab( ts(:,:,:,:,Nnn), rab_n, Nnn )  ! now    local thermal/haline expension ratio at T-points 
     73                         CALL bn2( ts(:,:,:,:,Nbb), rab_b, rn2b, Nnn ) ! before Brunt-Vaisala frequency 
     74                         CALL bn2( ts(:,:,:,:,Nnn), rab_n, rn2 , Nnn ) ! now    Brunt-Vaisala frequency 
    7675       
    7776      !  VERTICAL PHYSICS 
    78                          CALL zdf_phy( kstp )         ! vertical physics update (bfr, avt, avs, avm + MLD) 
     77                         CALL zdf_phy( kstp, Nbb, Nnn, Nrhs  )    ! vertical physics update (bfr, avt, avs, avm + MLD) 
    7978 
    80       IF(.NOT.ln_linssh )   CALL ssh_nxt       ( kstp )  ! after ssh (includes call to div_hor) 
    81       IF(.NOT.ln_linssh )   CALL dom_vvl_sf_nxt( kstp )  ! after vertical scale factors  
     79      IF(.NOT.ln_linssh )   CALL ssh_nxt       ( kstp, Nbb, Nnn, ssh, Naa )  ! after ssh (includes call to div_hor) 
     80      IF(.NOT.ln_linssh )   CALL dom_vvl_sf_nxt( kstp, Nbb, Nnn,      Naa )  ! after vertical scale factors  
    8281 
    83       IF(.NOT.ln_linssh )   CALL wzv           ( kstp )  ! now cross-level velocity  
     82      IF(.NOT.ln_linssh )   CALL wzv           ( kstp, Nbb, Nnn, Naa, ww )  ! now cross-level velocity  
    8483      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    85       ! diagnostics and outputs             (ua, va, ta, sa used as workspace) 
     84      ! diagnostics and outputs        
    8685      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    87                          CALL dia_wri( kstp )       ! ocean model: outputs 
    88       IF( lk_diahth  )   CALL dia_hth( kstp )       ! Thermocline depth (20°C) 
     86                         CALL dia_wri( kstp, Nnn )  ! ocean model: outputs 
     87                         CALL dia_hth( kstp, Nnn )  ! Thermocline depth (20°C) 
    8988 
    9089 
     
    9392      ! Passive Tracer Model 
    9493      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    95                         CALL trc_stp( kstp )       ! time-stepping 
     94                        CALL trc_stp( kstp, Nbb, Nnn, Nrhs, Naa  )   ! time-stepping 
    9695#endif 
    9796 
    9897      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    99       ! Active tracers                              (ua, va used as workspace) 
     98      ! Active tracers                              (uu(:,:,:,Nrhs), vv(:,:,:,Nrhs) used as workspace) 
    10099      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    101                         tsa(:,:,:,:) = 0._wp       ! set tracer trends to zero 
     100                        ts(:,:,:,:,Nrhs) = 0._wp       ! set tracer trends to zero 
    102101 
    103                         CALL tra_sbc( kstp )       ! surface boundary condition 
    104       IF( ln_traqsr )   CALL tra_qsr( kstp )       ! penetrative solar radiation qsr 
    105       IF( ln_tradmp )   CALL tra_dmp( kstp )       ! internal damping trends- tracers 
    106       IF(.NOT.ln_linssh)CALL tra_adv( kstp )       ! horizontal & vertical advection 
    107       IF( ln_zdfosm  )  CALL tra_osm( kstp )       ! OSMOSIS non-local tracer fluxes 
    108                         CALL tra_zdf( kstp )       ! vertical mixing 
    109                         CALL eos( tsn, rhd, rhop, gdept_0(:,:,:) )   ! now potential density for zdfmxl 
    110       IF( ln_zdfnpc )   CALL tra_npc( kstp )       ! applied non penetrative convective adjustment on (t,s) 
    111                         CALL tra_nxt( kstp )       ! tracer fields at next time step 
    112  
    113  
     102                        CALL tra_sbc( kstp,      Nnn, ts, Nrhs  )  ! surface boundary condition 
     103      IF( ln_traqsr )   CALL tra_qsr( kstp,      Nnn, ts, Nrhs  )  ! penetrative solar radiation qsr 
     104      IF( ln_tradmp )   CALL tra_dmp( kstp, Nbb, Nnn, ts, Nrhs  )  ! internal damping trends- tracers 
     105      IF(.NOT.ln_linssh)CALL tra_adv( kstp, Nbb, Nnn, ts, Nrhs  )  ! horizontal & vertical advection 
     106      IF( ln_zdfosm  )  CALL tra_osm( kstp, Nnn     , ts, Nrhs  )  ! OSMOSIS non-local tracer fluxes 
     107                        CALL tra_zdf( kstp, Nbb, Nnn, Nrhs, ts, Naa   )         ! vertical mixing 
     108                        CALL eos( ts(:,:,:,:,Nnn), rhd, rhop, gdept_0(:,:,:) )  ! now potential density for zdfmxl 
     109      IF( ln_zdfnpc )   CALL tra_npc( kstp,      Nnn, Nrhs, ts, Naa   )         ! applied non penetrative convective adjustment on (t,s) 
     110                        CALL tra_atf( kstp, Nbb, Nnn, Naa, ts )                 ! time filtering of "now" tracer arrays 
    114111 
    115112      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    116113      ! Dynamics                                    (ta, sa used as workspace) 
    117114      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    118                         ua(:,:,:) = 0._wp          ! set dynamics trends to zero 
    119                         va(:,:,:) = 0._wp 
     115                        uu(:,:,:,Nrhs) = 0._wp          ! set dynamics trends to zero 
     116                        vv(:,:,:,Nrhs) = 0._wp 
    120117 
    121       IF( ln_dyndmp )   CALL dyn_dmp    ( kstp )   ! internal damping trends- momentum 
    122                         CALL dyn_cor_c1d( kstp )   ! vorticity term including Coriolis 
    123       IF( ln_zdfosm  )  CALL dyn_osm    ( kstp )   ! OSMOSIS non-local velocity fluxes 
    124                         CALL dyn_zdf    ( kstp )   ! vertical diffusion 
    125                         CALL dyn_nxt    ( kstp )   ! lateral velocity at next time step 
    126       IF(.NOT.ln_linssh)CALL ssh_swp    ( kstp )   ! swap of sea surface height 
    127  
    128       IF(.NOT.ln_linssh)CALL dom_vvl_sf_swp( kstp )! swap of vertical scale factors 
     118      IF( ln_dyndmp )   CALL dyn_dmp    ( kstp, Nbb, Nnn      , uu, vv, Nrhs )  ! internal damping trends- momentum 
     119                        CALL dyn_cor_c1d( kstp,      Nnn      , uu, vv, Nrhs )  ! vorticity term including Coriolis 
     120      IF( ln_zdfosm  )  CALL dyn_osm    ( kstp,      Nnn      , uu, vv, Nrhs )  ! OSMOSIS non-local velocity fluxes 
     121                        CALL dyn_zdf    ( kstp, Nbb, Nnn, Nrhs, uu, vv, Naa  )  ! vertical diffusion 
     122                        CALL dyn_atf    ( kstp, Nbb, Nnn, Naa , uu, vv, e3t, e3u, e3v )  ! time filtering of "now" fields 
     123      IF(.NOT.ln_linssh)CALL ssh_atf    ( kstp, Nbb, Nnn, Naa , ssh )                    ! time filtering of "now" sea surface height 
     124      ! 
     125      ! Swap time levels 
     126      Nrhs = Nbb 
     127      Nbb = Nnn 
     128      Nnn = Naa 
     129      Naa = Nrhs 
     130      ! 
     131      IF(.NOT.ln_linssh)CALL dom_vvl_sf_update( kstp, Nbb, Nnn, Naa )                    ! update of vertical scale factors 
    129132 
    130133      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    131134      ! Control and restarts 
    132135      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    133                              CALL stp_ctl( kstp, indic ) 
    134       IF( kstp == nit000 )   CALL iom_close( numror )      ! close input  ocean restart file 
    135       IF( lrst_oce       )   CALL rst_write( kstp )        ! write output ocean restart file 
     136                             CALL stp_ctl( kstp, Nnn ) 
     137      IF( kstp == nit000 )   CALL iom_close( numror )          ! close input  ocean restart file 
     138      IF( lrst_oce       )   CALL rst_write( kstp, Nbb, Nnn )  ! write output ocean restart file 
    136139      ! 
    137140#if defined key_iomput 
    138       IF( kstp == nitend .OR. indic < 0 )   CALL xios_context_finalize()   ! needed for XIOS 
     141      IF( kstp == nitend .OR. nstop > 0 )   CALL xios_context_finalize()   ! needed for XIOS 
    139142      ! 
    140143#endif 
Note: See TracChangeset for help on using the changeset viewer.