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 branches/2015/dev_MetOffice_merge_2015/NEMOGCM/NEMO/OPA_SRC/DIU – NEMO

source: branches/2015/dev_MetOffice_merge_2015/NEMOGCM/NEMO/OPA_SRC/DIU/step_diu.F90 @ 6011

Last change on this file since 6011 was 6011, checked in by timgraham, 8 years ago

bug fix for sette testing

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