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.
step_diu.F90 in NEMO/branches/2018/dev_r9838_ENHANCE04_MLF/src/OCE/DIU – NEMO

source: NEMO/branches/2018/dev_r9838_ENHANCE04_MLF/src/OCE/DIU/step_diu.F90 @ 9923

Last change on this file since 9923 was 9923, checked in by gm, 6 years ago

#1911 (ENHANCE-04): step I.2: dev_r9838_ENHANCE04_MLF

File size: 4.3 KB
Line 
1MODULE step_diu
2   !!======================================================================
3   !!                       ***  MODULE stp_diu  ***
4   !! Time-stepping of diurnal cycle models
5   !!======================================================================
6   !! History :  3.7  ! 2015-11  (J. While)  Original code
7   !!----------------------------------------------------------------------
8
9   USE diurnal_bulk    ! diurnal SST bulk routines  (diurnal_sst_takaya routine)
10   USE cool_skin       ! diurnal cool skin correction (diurnal_sst_coolskin routine)   
11   USE iom
12   USE sbc_oce
13   USE sbcmod           ! surface boundary condition       (sbc     routine)
14   USE diaobs           ! Observation operator
15   USE oce
16   USE daymod
17   USE restart          ! ocean restart                    (rst_wri routine)
18   USE timing           ! Timing
19   
20   IMPLICIT NONE
21   PRIVATE
22
23   PUBLIC   stp_diurnal   ! called by nemogcm.F90 or step.F90
24
25   !!----------------------------------------------------------------------
26   !! NEMO/OCE 4.0 , NEMO Consortium (2018)
27   !! $Id:$
28   !! Software governed by the CeCILL licence     (./LICENSE)
29   !!----------------------------------------------------------------------
30   CONTAINS
31
32   SUBROUTINE stp_diurnal( kstp ) 
33      !!----------------------------------------------------------------------
34      !!                     ***  ROUTINE stp_diurnal  ***
35      !!                       
36      !! ** Purpose : - Time stepping of diurnal SST model only
37      !!   
38      !! ** Method  : -1- Update forcings and data   
39      !!              -2- Update ocean physics   
40      !!              -3- Compute the t and s trends   
41      !!              -4- Update t and s   
42      !!              -5- Compute the momentum trends
43      !!              -6- Update the horizontal velocity
44      !!              -7- Compute the diagnostics variables (rd,N2, div,cur,w)
45      !!              -8- Outputs and diagnostics
46      !!----------------------------------------------------------------------
47      INTEGER, INTENT(in) ::   kstp   ! ocean time-step index
48      !
49      INTEGER ::   jk       ! dummy loop indices
50      INTEGER ::   indic    ! error indicator if < 0
51      REAL(wp), DIMENSION(jpi,jpj) :: z_fvel_bkginc, z_hflux_bkginc     
52      !! ---------------------------------------------------------------------
53     
54      IF( ln_diurnal_only ) THEN
55         indic = 0                                 ! reset to no error condition
56         IF( kstp /= nit000 )   CALL day( kstp )   ! Calendar (day was already called at nit000 in day_init)
57 
58         CALL iom_setkt( kstp - nit000 + 1, cxios_context )   ! tell iom we are at time step kstp
59         IF( ln_crs ) THEN
60            CALL iom_setkt( kstp - nit000 + 1, TRIM(cxios_context)//"_crs" ) ! tell iom we are at time step kstp
61         ENDIF
62       
63         CALL sbc( kstp )                          ! Sea Surface Boundary Conditions
64      ENDIF
65     
66      IF( .NOT.ln_diurnal )   CALL ctl_stop( "stp_diurnal: ln_diurnal not set" )
67         
68      IF( .NOT. ln_blk    )   CALL ctl_stop( "stp_diurnal: diurnal flux processing only implemented for bulk forcing" ) 
69
70      !                                            ! Cool skin
71      CALL diurnal_sst_coolskin_step( qns, taum, rhop(:,:,1), rn_Dt )
72
73      CALL iom_put( "sst_wl", x_dsst   )                 ! warm layer (write out before update below).
74      CALL iom_put( "sst_cs", x_csdsst )                 ! cool skin
75
76      !                                            ! Diurnal warm layer model       
77      CALL diurnal_sst_takaya_step( kstp, qsr, qns, taum, rhop(:,:,1), rn_Dt ) 
78
79      IF( ln_diurnal_only ) THEN
80         IF( ln_diaobs )   CALL dia_obs( kstp )    ! obs-minus-model (assimilation) diagnostics (call after dynamics update)
81     
82         !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
83         ! Control and restarts
84         !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
85         IF( kstp == nit000   )   CALL iom_close( numror )     ! close input  ocean restart file
86         IF( lrst_oce         )   CALL rst_write( kstp   )     ! write output ocean restart file
87     
88         IF( ln_timing .AND.  kstp == nit000  )   CALL timing_reset 
89      ENDIF
90       
91   END SUBROUTINE stp_diurnal 
92   
93   !!======================================================================
94END MODULE step_diu
Note: See TracBrowser for help on using the repository browser.