[1457] | 1 | MODULE trcstp |
---|
| 2 | !!====================================================================== |
---|
| 3 | !! *** MODULE trcstp *** |
---|
| 4 | !! Time-stepping : time loop of opa for passive tracer |
---|
| 5 | !!====================================================================== |
---|
[2528] | 6 | !! History : 1.0 ! 2004-03 (C. Ethe) Original |
---|
| 7 | !!---------------------------------------------------------------------- |
---|
[1457] | 8 | #if defined key_top |
---|
| 9 | !!---------------------------------------------------------------------- |
---|
| 10 | !! trc_stp : passive tracer system time-stepping |
---|
| 11 | !!---------------------------------------------------------------------- |
---|
| 12 | USE oce_trc ! ocean dynamics and active tracers variables |
---|
[2528] | 13 | USE trc |
---|
[1457] | 14 | USE trctrp ! passive tracers transport |
---|
| 15 | USE trcsms ! passive tracers sources and sinks |
---|
| 16 | USE prtctl_trc ! Print control for debbuging |
---|
| 17 | USE trcdia |
---|
| 18 | USE trcwri |
---|
| 19 | USE trcrst |
---|
[2528] | 20 | USE trdmod_trc_oce |
---|
[1457] | 21 | USE trdmld_trc |
---|
| 22 | USE iom |
---|
| 23 | USE in_out_manager |
---|
[3294] | 24 | USE trcsub |
---|
[1457] | 25 | |
---|
| 26 | IMPLICIT NONE |
---|
| 27 | PRIVATE |
---|
| 28 | |
---|
[2528] | 29 | PUBLIC trc_stp ! called by step |
---|
[3294] | 30 | |
---|
| 31 | !! * Substitutions |
---|
| 32 | # include "domzgr_substitute.h90" |
---|
[1457] | 33 | !!---------------------------------------------------------------------- |
---|
[2528] | 34 | !! NEMO/TOP 3.3 , NEMO Consortium (2010) |
---|
| 35 | !! $Id$ |
---|
| 36 | !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) |
---|
[1457] | 37 | !!---------------------------------------------------------------------- |
---|
| 38 | CONTAINS |
---|
| 39 | |
---|
| 40 | SUBROUTINE trc_stp( kt ) |
---|
| 41 | !!------------------------------------------------------------------- |
---|
| 42 | !! *** ROUTINE trc_stp *** |
---|
| 43 | !! |
---|
| 44 | !! ** Purpose : Time loop of opa for passive tracer |
---|
| 45 | !! |
---|
| 46 | !! ** Method : |
---|
| 47 | !! Compute the passive tracers trends |
---|
| 48 | !! Update the passive tracers |
---|
| 49 | !!------------------------------------------------------------------- |
---|
[3294] | 50 | INTEGER, INTENT( in ) :: kt ! ocean time-step index |
---|
| 51 | INTEGER :: jk, jn ! dummy loop indices |
---|
| 52 | REAL(wp) :: ztrai |
---|
[1457] | 53 | CHARACTER (len=25) :: charout |
---|
[2528] | 54 | !!------------------------------------------------------------------- |
---|
[3294] | 55 | ! |
---|
| 56 | IF( nn_timing == 1 ) CALL timing_start('trc_stp') |
---|
| 57 | ! |
---|
[3319] | 58 | IF( kt == nittrc000 .AND. lk_trdmld_trc ) CALL trd_mld_trc_init ! trends: Mixed-layer |
---|
[3294] | 59 | ! |
---|
[3319] | 60 | IF( lk_vvl ) THEN ! update ocean volume due to ssh temporal evolution |
---|
[3294] | 61 | DO jk = 1, jpk |
---|
| 62 | cvol(:,:,jk) = e1e2t(:,:) * fse3t(:,:,jk) * tmask(:,:,jk) |
---|
| 63 | END DO |
---|
[3319] | 64 | IF( lk_degrad ) cvol(:,:,:) = cvol(:,:,:) * facvol(:,:,:) ! degrad option: reduction by facvol |
---|
[3294] | 65 | areatot = glob_sum( cvol(:,:,:) ) |
---|
| 66 | ENDIF |
---|
| 67 | ! |
---|
| 68 | IF( nn_dttrc /= 1 ) CALL trc_sub_stp( kt ) ! averaging physical variables for sub-stepping |
---|
[1457] | 69 | |
---|
[3294] | 70 | IF( MOD( kt , nn_dttrc ) == 0 ) THEN ! only every nn_dttrc time step |
---|
[2528] | 71 | ! |
---|
| 72 | IF(ln_ctl) THEN |
---|
| 73 | WRITE(charout,FMT="('kt =', I4,' d/m/y =',I2,I2,I4)") kt, nday, nmonth, nyear |
---|
| 74 | CALL prt_ctl_trc_info(charout) |
---|
| 75 | ENDIF |
---|
| 76 | ! |
---|
| 77 | tra(:,:,:,:) = 0.e0 |
---|
| 78 | ! |
---|
[3294] | 79 | CALL trc_rst_opn ( kt ) ! Open tracer restart file |
---|
[3680] | 80 | IF( lrst_trc ) CALL trc_rst_cal ( kt, 'WRITE' ) ! calendar |
---|
[3294] | 81 | IF( lk_iomput ) THEN ; CALL trc_wri ( kt ) ! output of passive tracers with iom I/O manager |
---|
| 82 | ELSE ; CALL trc_dia ( kt ) ! output of passive tracers with old I/O manager |
---|
[2528] | 83 | ENDIF |
---|
[3294] | 84 | CALL trc_sms ( kt ) ! tracers: sinks and sources |
---|
| 85 | CALL trc_trp ( kt ) ! transport of passive tracers |
---|
[3680] | 86 | IF( kt == nittrc000 ) CALL iom_close( numrtr ) ! close input tracer restart file |
---|
[3294] | 87 | IF( lrst_trc ) CALL trc_rst_wri ( kt ) ! write tracer restart file |
---|
| 88 | IF( lk_trdmld_trc ) CALL trd_mld_trc ( kt ) ! trends: Mixed-layer |
---|
[2528] | 89 | ! |
---|
[3294] | 90 | IF( nn_dttrc /= 1 ) CALL trc_sub_reset( kt ) ! resetting physical variables when sub-stepping |
---|
| 91 | ! |
---|
[1457] | 92 | ENDIF |
---|
[3294] | 93 | ! |
---|
| 94 | ztrai = 0._wp ! content of all tracers |
---|
| 95 | DO jn = 1, jptra |
---|
| 96 | ztrai = ztrai + glob_sum( trn(:,:,:,jn) * cvol(:,:,:) ) |
---|
| 97 | END DO |
---|
| 98 | IF( lwp ) WRITE(numstr,9300) kt, ztrai / areatot |
---|
| 99 | 9300 FORMAT(i10,e18.10) |
---|
| 100 | ! |
---|
| 101 | IF( nn_timing == 1 ) CALL timing_stop('trc_stp') |
---|
| 102 | ! |
---|
[1457] | 103 | END SUBROUTINE trc_stp |
---|
| 104 | |
---|
| 105 | #else |
---|
| 106 | !!---------------------------------------------------------------------- |
---|
| 107 | !! Default key NO passive tracers |
---|
| 108 | !!---------------------------------------------------------------------- |
---|
| 109 | CONTAINS |
---|
| 110 | SUBROUTINE trc_stp( kt ) ! Empty routine |
---|
| 111 | WRITE(*,*) 'trc_stp: You should not have seen this print! error?', kt |
---|
| 112 | END SUBROUTINE trc_stp |
---|
| 113 | #endif |
---|
| 114 | |
---|
| 115 | !!====================================================================== |
---|
| 116 | END MODULE trcstp |
---|