MODULE step_c1d !!====================================================================== !! *** MODULE step_c1d *** !! Time-stepping : manager of the ocean, tracer and ice time stepping - c1d case !!====================================================================== !! History : 2.0 ! 2004-04 (C. Ethe) adapted from step.F90 for C1D !! 3.0 ! 2008-04 (G. Madec) redo the adaptation to include SBC !!---------------------------------------------------------------------- #if defined key_cfg_1d !!---------------------------------------------------------------------- !! 'key_cfg_1d' 1D Configuration !!---------------------------------------------------------------------- !! stp_c1d : NEMO system time-stepping in c1d case !!---------------------------------------------------------------------- USE oce ! ocean dynamics and tracers variables USE dom_oce ! ocean space and time domain variables USE zdf_oce ! ocean vertical physics variables USE in_out_manager ! I/O manager USE iom ! USE lbclnk USE daymod ! calendar (day routine) USE dtatem ! ocean temperature data (dta_tem routine) USE dtasal ! ocean salinity data (dta_sal routine) USE sbcmod ! surface boundary condition (sbc routine) USE sbcrnf ! surface boundary condition: runoff variables USE ocfzpt ! surface ocean freezing point (oc_fz_pt routine) USE trcstp ! passive tracer time-stepping (trc_stp routine) USE traqsr ! solar radiation penetration (tra_qsr routine) USE trasbc ! surface boundary condition (tra_sbc routine) ! zdfkpp ! KPP non-local tracer fluxes (tra_kpp routine) USE trazdf ! vertical mixing (tra_zdf routine) USE tranxt ! time-stepping (tra_nxt routine) USE tranpc ! non-penetrative convection (tra_npc routine) USE eosbn2 ! equation of state (eos_bn2 routine) USE dyncor1d ! Coriolis term (c1d case) (dyn_cor_1d ) USE dynzdf ! vertical diffusion (dyn_zdf routine) USE dynnxt1d ! time-stepping (dyn_nxt routine) USE zdfbfr ! bottom friction (zdf_bfr routine) USE zdftke ! TKE vertical mixing (zdf_tke routine) USE zdfkpp ! KPP vertical mixing (zdf_kpp routine) USE zdfddm ! double diffusion mixing (zdf_ddm routine) USE zdfevd ! enhanced vertical diffusion (zdf_evd routine) USE zdfric ! Richardson vertical mixing (zdf_ric routine) USE zdfmxl ! Mixed-layer depth (zdf_mxl routine) USE ice_oce ! sea-ice variable USE diawri ! Standard run outputs (dia_wri routine) USE stpctl ! time stepping control (stp_ctl routine) USE restart ! ocean restart (rst_wri routine) USE prtctl ! Print control (prt_ctl routine) IMPLICIT NONE PRIVATE PUBLIC stp_c1d ! called by opa.F90 !! * Substitutions # include "domzgr_substitute.h90" # include "zdfddm_substitute.h90" !!---------------------------------------------------------------------- !! NEMO 3.0 , LOCEAN-IPSL (2008) !! $Id:$ !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) !!---------------------------------------------------------------------- CONTAINS SUBROUTINE stp_c1d( kstp ) !!---------------------------------------------------------------------- !! *** ROUTINE stp_c1d *** !! !! ** Purpose : - Time stepping of SBC including LIM (dynamic and thermodynamic eqs.) !! - Time stepping of OPA (momentum and active tracer eqs.) !! - Time stepping of TOP (passive tracer eqs.) !! !! ** Method : -1- Update forcings and data !! -2- Update vertical ocean physics !! -3- Compute the t and s trends !! -4- Update t and s !! -5- Compute the momentum trends !! -6- Update the horizontal velocity !! -7- Compute the diagnostics variables (rd,N2, div,cur,w) !! -8- Outputs and diagnostics !!---------------------------------------------------------------------- INTEGER, INTENT(in) :: kstp ! ocean time-step index INTEGER :: jk ! dummy loop indice INTEGER :: indic ! error indicator if < 0 !! --------------------------------------------------------------------- indic = 1 ! reset to no error condition CALL day( kstp ) ! Calendar CALL rst_opn( kstp ) ! Open the restart file !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ! Update data, open boundaries, surface boundary condition (including sea-ice) !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< IF( lk_dtatem ) CALL dta_tem( kstp ) ! update 3D temperature data IF( lk_dtasal ) CALL dta_sal( kstp ) ! update 3D salinity data CALL sbc ( kstp ) ! Sea Boundary Condition (including sea-ice) IF( ninist == 1 ) THEN ! Output the initial state and forcings CALL dia_wri_state( 'output.init' ) ; ninist = 0 ENDIF !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ! Ocean physics update !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< !----------------------------------------------------------------------- ! VERTICAL PHYSICS !----------------------------------------------------------------------- ! N.B. ua, va, ta, sa arrays are used as workspace in this section !----------------------------------------------------------------------- CALL bn2( tb, sb, rn2 ) ! before Brunt-Vaisala frequency ! ! Vertical eddy viscosity and diffusivity coefficients IF( lk_zdfric ) CALL zdf_ric( kstp ) ! Richardson number dependent Kz IF( lk_zdftke ) CALL zdf_tke( kstp ) ! TKE closure scheme for Kz IF( lk_zdfkpp ) CALL zdf_kpp( kstp ) ! KPP closure scheme for Kz IF( lk_zdfcst ) THEN ! Constant Kz (reset avt, avm to the background value) avt (:,:,:) = avt0 * tmask(:,:,:) avmu(:,:,:) = avm0 * umask(:,:,:) avmv(:,:,:) = avm0 * vmask(:,:,:) ENDIF IF( nn_runoff /=0 ) THEN ! increase diffusivity at rivers mouths DO jk = 2, nkrnf ; avt(:,:,jk) = avt(:,:,jk) + rn_avt_rnf * rnfmsk(:,:) ; END DO ENDIF IF( ln_zdfevd ) CALL zdf_evd( kstp ) ! enhanced vertical eddy diffusivity IF( lk_zdfddm .AND. .NOT. lk_zdfkpp ) & & CALL zdf_ddm( kstp ) ! double diffusive mixing CALL zdf_bfr( kstp ) ! bottom friction CALL zdf_mxl( kstp ) ! mixed layer depth #if defined key_passivetrc !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ! Passive Tracer Model !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ! N.B. ua, va, ta, sa arrays are used as workspace in this section !----------------------------------------------------------------------- CALL trc_stp( kstp, indic ) ! time-stepping #endif !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ! Active tracers !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ! N.B. ua, va arrays are used as workspace in this section !----------------------------------------------------------------------- ta(:,:,:) = 0.e0 ! set tracer trends to zero sa(:,:,:) = 0.e0 CALL tra_sbc ( kstp ) ! surface boundary condition IF( ln_traqsr ) CALL tra_qsr ( kstp ) ! penetrative solar radiation qsr CALL tra_adv ( kstp ) ! horizontal & vertical advection IF( lk_zdfkpp ) CALL tra_kpp ( kstp ) ! KPP non-local tracer fluxes CALL tra_zdf ( kstp ) ! vertical mixing CALL tra_nxt( kstp ) ! tracer fields at next time step IF( ln_zdfnpc ) CALL tra_npc( kstp ) ! applied non penetrative convective adjustment on (t,s) CALL eos( tb, sb, rhd, rhop ) ! now (swap=before) in situ density for dynhpg module !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ! Dynamics !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ! N.B. ta, sa arrays are used as workspace in this section !----------------------------------------------------------------------- ua(:,:,:) = 0.e0 ! set dynamics trends to zero va(:,:,:) = 0.e0 CALL dyn_vor_c1d( kstp ) ! vorticity term including Coriolis CALL dyn_zdf ( kstp ) ! vertical diffusion CALL dyn_nxt_c1d( kstp ) ! lateral velocity at next time step !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ! Computation of diagnostic variables !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ! N.B. ua, va, ta, sa arrays are used as workspace in this section !----------------------------------------------------------------------- CALL oc_fz_pt ! ocean surface freezing temperature !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ! Control and restarts !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< CALL stp_ctl( kstp, indic ) IF( kstp == nit000 ) CALL iom_close( numror ) ! close input ocean restart file IF( lrst_oce ) CALL rst_write ( kstp ) ! write output ocean restart file !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ! diagnostics and outputs !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ! N.B. ua, va, ta, sa arrays are used as workspace in this section !----------------------------------------------------------------------- IF( nstop == 0 ) CALL dia_wri_c1d( kstp, indic ) ! ocean model: outputs ! END SUBROUTINE stp_c1d #else !!---------------------------------------------------------------------- !! Default key NO 1D Config !!---------------------------------------------------------------------- CONTAINS SUBROUTINE stp_c1d ( kt ) ! dummy routine WRITE(*,*) 'stp_c1d: You should not have seen this print! error?', kt END SUBROUTINE stp_c1d #endif !!====================================================================== END MODULE step_c1d