[6017] | 1 | MODULE step_diu |
---|
[6010] | 2 | !!====================================================================== |
---|
| 3 | !! *** MODULE stp_diu *** |
---|
| 4 | !! Time-stepping of diurnal cycle models |
---|
| 5 | !!====================================================================== |
---|
| 6 | !! History : 3.7 ! 2015-11 (J. While) Original code |
---|
| 7 | |
---|
[12377] | 8 | USE diu_layers ! diurnal SST bulk and coolskin routines |
---|
[6010] | 9 | USE iom |
---|
[6013] | 10 | USE sbc_oce |
---|
| 11 | USE sbcmod ! surface boundary condition (sbc routine) |
---|
| 12 | USE diaobs ! Observation operator |
---|
| 13 | USE oce |
---|
| 14 | USE daymod |
---|
| 15 | USE restart ! ocean restart (rst_wri routine) |
---|
| 16 | USE timing ! Timing |
---|
| 17 | |
---|
[6011] | 18 | IMPLICIT NONE |
---|
| 19 | PRIVATE |
---|
[6013] | 20 | |
---|
[6010] | 21 | PUBLIC stp_diurnal ! called by nemogcm.F90 or step.F90 |
---|
| 22 | |
---|
| 23 | !!---------------------------------------------------------------------- |
---|
[9598] | 24 | !! NEMO/OCE 4.0 , NEMO Consortium (2018) |
---|
[10068] | 25 | !! $Id$ |
---|
| 26 | !! Software governed by the CeCILL license (see ./LICENSE) |
---|
[6010] | 27 | !!---------------------------------------------------------------------- |
---|
| 28 | |
---|
| 29 | CONTAINS |
---|
| 30 | |
---|
| 31 | SUBROUTINE stp_diurnal( kstp ) |
---|
| 32 | INTEGER, INTENT(in) :: kstp ! ocean time-step index |
---|
| 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 :: jk ! dummy loop indices |
---|
| 48 | INTEGER :: indic ! error indicator if < 0 |
---|
| 49 | REAL(wp), DIMENSION(jpi,jpj) :: z_fvel_bkginc, z_hflux_bkginc |
---|
[12377] | 50 | INTEGER :: Nbb, Nnn, Naa, Nrhs ! local definitions as placeholders for now |
---|
[6010] | 51 | !! --------------------------------------------------------------------- |
---|
| 52 | |
---|
| 53 | IF(ln_diurnal_only) THEN |
---|
| 54 | indic = 0 ! reset to no error condition |
---|
| 55 | IF( kstp /= nit000 ) CALL day( kstp ) ! Calendar (day was already called at nit000 in day_init) |
---|
| 56 | |
---|
| 57 | CALL iom_setkt( kstp - nit000 + 1, cxios_context ) ! tell iom we are at time step kstp |
---|
| 58 | IF( ln_crs ) THEN |
---|
| 59 | CALL iom_setkt( kstp - nit000 + 1, TRIM(cxios_context)//"_crs" ) ! tell iom we are at time step kstp |
---|
| 60 | ENDIF |
---|
| 61 | |
---|
[12377] | 62 | CALL sbc ( kstp, Nbb, Nnn ) ! Sea Boundary Conditions |
---|
[6010] | 63 | ENDIF |
---|
| 64 | |
---|
[12377] | 65 | call diurnal_layers( kstp ) ! coolskin and warm layer calculations |
---|
[6010] | 66 | |
---|
[9124] | 67 | IF( ln_diurnal_only ) THEN |
---|
[12377] | 68 | ! WILL HAVE TO INCREMENT Nbb and Nnn here in ln_diurnal_only case ! |
---|
| 69 | IF( ln_diaobs ) CALL dia_obs( kstp, Nnn ) ! obs-minus-model (assimilation) diagnostics (call after dynamics update) |
---|
[6010] | 70 | |
---|
| 71 | !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
---|
| 72 | ! Control and restarts |
---|
| 73 | !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
---|
| 74 | IF( kstp == nit000 ) CALL iom_close( numror ) ! close input ocean restart file |
---|
[12377] | 75 | IF( lrst_oce ) CALL rst_write ( kstp, Nbb, Nnn ) ! write output ocean restart file |
---|
[6010] | 76 | |
---|
[9124] | 77 | IF( ln_timing .AND. kstp == nit000 ) CALL timing_reset |
---|
[6010] | 78 | ENDIF |
---|
| 79 | |
---|
| 80 | END SUBROUTINE stp_diurnal |
---|
| 81 | |
---|
[6017] | 82 | END MODULE step_diu |
---|