source: NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/OCE/DIU/step_diu.F90 @ 10922

Last change on this file since 10922 was 10922, checked in by acc, 2 years ago

2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps : Convert IOM, LDF, OBS and SBC directories and compatibility changes elsewhere that these changes enforce. Changes pass SETTE and compare with original trunk results. Outstanding issues (currently with work-arounds) in DIU/step_diu.F90 and fld_bdy_interp within SBC/fldread.F90; proper soltions pending

  • Property svn:keywords set to Id
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   USE diurnal_bulk    ! diurnal SST bulk routines  (diurnal_sst_takaya routine)
9   USE cool_skin       ! diurnal cool skin correction (diurnal_sst_coolskin routine)   
10   USE iom
11   USE sbc_oce
12   USE sbcmod           ! surface boundary condition       (sbc     routine)
13   USE diaobs           ! Observation operator
14   USE oce
15   USE daymod
16   USE restart          ! ocean restart                    (rst_wri routine)
17   USE timing           ! Timing
18   
19   IMPLICIT NONE
20   PRIVATE
21
22   PUBLIC   stp_diurnal   ! called by nemogcm.F90 or step.F90
23
24   !!----------------------------------------------------------------------
25   !! NEMO/OCE 4.0 , NEMO Consortium (2018)
26   !! $Id$
27   !! Software governed by the CeCILL license (see ./LICENSE)
28   !!----------------------------------------------------------------------
29
30   CONTAINS
31
32   SUBROUTINE stp_diurnal( kstp ) 
33      INTEGER, INTENT(in) ::   kstp   ! ocean time-step index
34      !!----------------------------------------------------------------------
35      !!                     ***  ROUTINE stp_diurnal  ***
36      !!                       
37      !! ** Purpose : - Time stepping of diurnal SST model only
38      !!   
39      !! ** Method  : -1- Update forcings and data   
40      !!              -2- Update ocean physics   
41      !!              -3- Compute the t and s trends   
42      !!              -4- Update t and s   
43      !!              -5- Compute the momentum trends
44      !!              -6- Update the horizontal velocity
45      !!              -7- Compute the diagnostics variables (rd,N2, div,cur,w)
46      !!              -8- Outputs and diagnostics
47      !!----------------------------------------------------------------------
48      INTEGER ::   jk       ! dummy loop indices
49      INTEGER ::   indic    ! error indicator if < 0
50      REAL(wp), DIMENSION(jpi,jpj) :: z_fvel_bkginc, z_hflux_bkginc     
51      INTEGER :: Nbb, Nnn, Naa, Nrhs    ! local definitions as placeholders for now
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, Nbb, Nnn )            ! Sea Boundary Conditions
64      ENDIF
65     
66      ! Cool skin
67      IF( .NOT.ln_diurnal )   CALL ctl_stop( "stp_diurnal: ln_diurnal not set" )
68         
69      IF( .NOT. ln_blk    )   CALL ctl_stop( "stp_diurnal: diurnal flux processing only implemented for bulk forcing" ) 
70
71      CALL diurnal_sst_coolskin_step( qns, taum, rhop(:,:,1), rdt)
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, & 
78      &    qsr, qns, taum, rhop(:,:,1), rdt) 
79
80      IF( ln_diurnal_only ) THEN
81         ! WILL HAVE TO INCREMENT Nbb and Nnn here in ln_diurnal_only case !
82         IF( ln_diaobs )         CALL dia_obs( kstp, Nnn )    ! obs-minus-model (assimilation) diagnostics (call after dynamics update)
83     
84         !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
85         ! Control and restarts
86         !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
87         IF( kstp == nit000   )   CALL iom_close( numror )     ! close input  ocean restart file
88         IF( lrst_oce         )   CALL rst_write    ( kstp, Nbb, Nnn )   ! write output ocean restart file
89     
90         IF( ln_timing .AND.  kstp == nit000  )   CALL timing_reset 
91      ENDIF
92       
93   END SUBROUTINE stp_diurnal 
94   
95END MODULE step_diu
Note: See TracBrowser for help on using the repository browser.