Changeset 11427 for NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps_rewrite_time_filterswap/src/TOP
- Timestamp:
- 2019-08-09T15:44:20+02:00 (5 years ago)
- Location:
- NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps_rewrite_time_filterswap/src/TOP
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps_rewrite_time_filterswap/src/TOP/TRP/trcatf.F90
r11099 r11427 162 162 ENDIF 163 163 ! 164 CALL lbc_lnk_multi( 'trcatf', ptr(:,:,:,:,K bb), 'T', 1._wp, ptr(:,:,:,:,Kmm), 'T', 1._wp, ptr(:,:,:,:,Kaa), 'T', 1._wp )164 CALL lbc_lnk_multi( 'trcatf', ptr(:,:,:,:,Kmm), 'T', 1._wp, ptr(:,:,:,:,Kaa), 'T', 1._wp, ptr(:,:,:,:,Kaa), 'T', 1._wp ) 165 165 ENDIF 166 166 ! -
NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps_rewrite_time_filterswap/src/TOP/TRP/trctrp.F90
r11057 r11427 36 36 PUBLIC trc_trp ! called by trc_stp 37 37 38 INTEGER, SAVE :: N_save ! Save value of time index for time swapping for ln_top_euler=.true. 39 38 40 !!---------------------------------------------------------------------- 39 41 !! NEMO/TOP 4.0 , NEMO Consortium (2018) … … 53 55 !! - Update the passive tracers 54 56 !!---------------------------------------------------------------------- 55 INTEGER, INTENT( in ) :: kt ! ocean time-step index56 INTEGER, INTENT( in ) :: Kbb, Kmm, Krhs, Kaa ! time level indices57 INTEGER, INTENT( in ) :: kt ! ocean time-step index 58 INTEGER, INTENT( inout ) :: Kbb, Kmm, Krhs, Kaa ! TOP time level indices (swapped in this routine) 57 59 !! --------------------------------------------------------------------- 58 60 ! 59 61 IF( ln_timing ) CALL timing_start('trc_trp') 62 ! 63 IF ( kt == nit000 ) N_save = Kbb 60 64 ! 61 65 IF( .NOT. lk_c1d ) THEN … … 79 83 CALL trc_zdf ( kt, Kbb, Kmm, Krhs, tr, Kaa ) ! vert. mixing & after tracer ==> after 80 84 CALL trc_atf ( kt, Kbb, Kmm, Kaa , tr ) ! time filtering of "now" tracer fields 81 IF( ln_trcrad ) CALL trc_rad ( kt, Kbb, Kmm, Krhs, tr ) ! Correct artificial negative concentrations 82 IF( ln_trcdmp_clo ) CALL trc_dmp_clo( kt, Kbb, Kmm ) ! internal damping trends on closed seas only 85 ! 86 ! Swap TOP time levels (= Nrhs_trc, Nbb_trc etc) 87 IF( ln_top_euler ) THEN 88 ! For Euler timestepping we need the "before" and "now" fields to be the same. 89 ! Use N_save to ensure that the indices stay in sync with the (leapfrogging) OCE time indices for nn_dttrc=1. 90 Krhs = N_save 91 N_save = Kmm 92 Kbb = Kaa 93 ELSE 94 Krhs = Kbb 95 Kbb = Kmm 96 ENDIF 97 Kmm = Kaa 98 Kaa = Krhs 99 ! 100 IF( ln_trcrad ) CALL trc_rad ( kt, Kbb, Kmm, Krhs, tr ) ! Correct artificial negative concentrations 101 IF( ln_trcdmp_clo ) CALL trc_dmp_clo( kt, Kbb, Kmm ) ! internal damping trends on closed seas only 83 102 84 103 ! … … 88 107 CALL trc_zdf( kt, Kbb, Kmm, Krhs, tr, Kaa ) ! vert. mixing & after tracer ==> after 89 108 CALL trc_atf( kt, Kbb, Kmm, Kaa , tr ) ! time filtering of "now" tracer fields 90 IF( ln_trcrad ) CALL trc_rad( kt, Kbb, Kmm, Krhs, tr ) ! Correct artificial negative concentrations 109 ! 110 ! Swap TOP time levels (= Nrhs_trc, Nbb_trc etc) 111 Krhs = Kbb 112 Kbb = Kmm 113 Kmm = Kaa 114 Kaa = Krhs 115 ! 116 IF( ln_trcrad ) CALL trc_rad( kt, Kbb, Kmm, Krhs, tr ) ! Correct artificial negative concentrations 91 117 ! 92 118 END IF -
NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps_rewrite_time_filterswap/src/TOP/trcini.F90
r11053 r11427 40 40 CONTAINS 41 41 42 SUBROUTINE trc_init ( Kbb, Kmm, Kaa )42 SUBROUTINE trc_init 43 43 !!--------------------------------------------------------------------- 44 44 !! *** ROUTINE trc_init *** … … 52 52 !! or read data or analytical formulation 53 53 !!--------------------------------------------------------------------- 54 INTEGER, INTENT( in ) :: Kbb, Kmm, Kaa ! time level indices55 54 ! 56 55 IF( ln_timing ) CALL timing_start('trc_init') … … 59 58 IF(lwp) WRITE(numout,*) 'trc_init : initial set up of the passive tracers' 60 59 IF(lwp) WRITE(numout,*) '~~~~~~~~' 60 ! 61 ! Initialise time level indices 62 Nbb_trc = 1; Nnn_trc = 2; Naa_trc = 3; Nrhs_trc = Naa_trc 61 63 ! 62 64 CALL trc_ini_ctl ! control … … 71 73 IF(lwp) WRITE(numout,*) 72 74 ! 73 CALL trc_ini_sms( Kmm) ! SMS75 CALL trc_ini_sms( Nnn_trc ) ! SMS 74 76 CALL trc_ini_trp ! passive tracers transport 75 77 CALL trc_ice_ini ! Tracers in sea ice … … 79 81 ENDIF 80 82 ! 81 CALL trc_ini_state( Kbb, Kmm, Kaa) ! passive tracers initialisation : from a restart or from clim83 CALL trc_ini_state( Nbb_trc, Nnn_trc, Naa_trc ) ! passive tracers initialisation : from a restart or from clim 82 84 IF( nn_dttrc /= 1 ) & 83 CALL trc_sub_ini( Kmm) ! Initialize variables for substepping passive tracers84 ! 85 CALL trc_ini_inv( Kmm) ! Inventories85 CALL trc_sub_ini( Nnn_trc ) ! Initialize variables for substepping passive tracers 86 ! 87 CALL trc_ini_inv( Nnn_trc ) ! Inventories 86 88 ! 87 89 IF( ln_timing ) CALL timing_stop('trc_init') -
NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps_rewrite_time_filterswap/src/TOP/trcstp.F90
r11053 r11427 38 38 39 39 !!---------------------------------------------------------------------- 40 !! time level indices 41 !!---------------------------------------------------------------------- 42 INTEGER, PUBLIC :: Nbb_trc, Nnn_trc, Naa_trc, Nrhs_trc !! used by trc_init 43 44 !!---------------------------------------------------------------------- 40 45 !! NEMO/TOP 4.0 , NEMO Consortium (2018) 41 46 !! $Id$ … … 44 49 CONTAINS 45 50 46 SUBROUTINE trc_stp( kt, Kbb , Kmm, Krhs, Kaa)51 SUBROUTINE trc_stp( kt, Kbb_oce, Kmm_oce, Krhs_oce, Kaa_oce ) 47 52 !!------------------------------------------------------------------- 48 53 !! *** ROUTINE trc_stp *** … … 54 59 !!------------------------------------------------------------------- 55 60 INTEGER, INTENT( in ) :: kt ! ocean time-step index 56 INTEGER, INTENT( in ) :: Kbb , Kmm, Krhs, Kaa! time level indices61 INTEGER, INTENT( in ) :: Kbb_oce, Kmm_oce, Krhs_oce, Kaa_oce ! time level indices 57 62 ! 58 63 INTEGER :: jk, jn ! dummy loop indices … … 76 81 IF( .NOT.ln_linssh ) THEN ! update ocean volume due to ssh temporal evolution 77 82 DO jk = 1, jpk 78 cvol(:,:,jk) = e1e2t(:,:) * e3t(:,:,jk,Kmm ) * tmask(:,:,jk)83 cvol(:,:,jk) = e1e2t(:,:) * e3t(:,:,jk,Kmm_oce) * tmask(:,:,jk) 79 84 END DO 80 85 IF ( ln_ctl .OR. kt == nitrst .OR. ( ln_check_mass .AND. kt == nitend ) & … … 86 91 IF( l_trcdm2dc ) CALL trc_mean_qsr( kt ) 87 92 ! 88 IF( nn_dttrc /= 1 ) CALL trc_sub_stp( kt, Kbb, Kmm, Krhs ) ! averaging physical variables for sub-stepping 93 IF( nn_dttrc == 1 ) THEN 94 IF(lwp) WRITE(numout,*) "Kbb_oce, Kmm_oce, Kaa_oce, Krhs_oce : ",Kbb_oce, Kmm_oce, Kaa_oce, Krhs_oce 95 IF(lwp) WRITE(numout,*) "Nbb_trc, Nnn_trc, Naa_trc, Nrhs_trc : ",Nbb_trc, Nnn_trc, Naa_trc, Nrhs_trc 96 IF(lwp) CALL FLUSH(numout) 97 CALL mppsync() 98 IF( Kmm_oce /= Nnn_trc .OR. Kaa_oce /= Naa_trc .OR. Krhs_oce /= Nrhs_trc ) THEN 99 ! The nn_dttrc == 1 case depends on the OCE and TRC time indices being the same always. 100 ! If this is not the case then something has gone wrong. 101 CALL ctl_stop( 'trc_stp : nn_dttrc = 1 but OCE and TRC time indices are different! Something has gone wrong.' ) 102 ENDIF 103 ELSE 104 CALL trc_sub_stp( kt, Nbb_trc, Nnn_trc, Nrhs_trc ) ! averaging physical variables for sub-stepping 105 ENDIF 89 106 ! 90 107 IF( MOD( kt , nn_dttrc ) == 0 ) THEN ! only every nn_dttrc time step … … 95 112 ENDIF 96 113 ! 97 tr(:,:,:,:, Krhs) = 0.e0114 tr(:,:,:,:,Nrhs_trc) = 0.e0 98 115 ! 99 116 CALL trc_rst_opn ( kt ) ! Open tracer restart file 100 117 IF( lrst_trc ) CALL trc_rst_cal ( kt, 'WRITE' ) ! calendar 101 CALL trc_wri ( kt, Kmm )! output of passive tracers with iom I/O manager102 CALL trc_sms ( kt, Kbb, Kmm, Krhs )! tracers: sinks and sources103 CALL trc_trp ( kt, Kbb, Kmm, Krhs, Kaa) ! transport of passive tracers118 CALL trc_wri ( kt, Nnn_trc ) ! output of passive tracers with iom I/O manager 119 CALL trc_sms ( kt, Nbb_trc, Nnn_trc, Nrhs_trc ) ! tracers: sinks and sources 120 CALL trc_trp ( kt, Nbb_trc, Nnn_trc, Nrhs_trc, Naa_trc ) ! transport of passive tracers 104 121 IF( kt == nittrc000 ) THEN 105 122 CALL iom_close( numrtr ) ! close input tracer restart file 106 123 IF(lwm) CALL FLUSH( numont ) ! flush namelist output 107 124 ENDIF 108 IF( lrst_trc ) CALL trc_rst_wri ( kt, Kbb, Kmm, Krhs) ! write tracer restart file109 IF( lk_trdmxl_trc ) CALL trd_mxl_trc ( kt, Kmm) ! trends: Mixed-layer110 ! 111 IF( nn_dttrc /= 1 ) CALL trc_sub_reset( kt, Kbb, Kmm, Krhs) ! resetting physical variables when sub-stepping125 IF( lrst_trc ) CALL trc_rst_wri ( kt, Nbb_trc, Nnn_trc, Nrhs_trc ) ! write tracer restart file 126 IF( lk_trdmxl_trc ) CALL trd_mxl_trc ( kt, Nnn_trc ) ! trends: Mixed-layer 127 ! 128 IF( nn_dttrc /= 1 ) CALL trc_sub_reset( kt, Nbb_trc, Nnn_trc, Nrhs_trc ) ! resetting physical variables when sub-stepping 112 129 ! 113 130 ENDIF … … 116 133 ztrai = 0._wp ! content of all tracers 117 134 DO jn = 1, jptra 118 ztrai = ztrai + glob_sum( 'trcstp', tr(:,:,:,jn, Kmm) * cvol(:,:,:) )135 ztrai = ztrai + glob_sum( 'trcstp', tr(:,:,:,jn,Nnn_trc) * cvol(:,:,:) ) 119 136 END DO 120 137 IF( lwm ) WRITE(numstr,9300) kt, ztrai / areatot -
NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps_rewrite_time_filterswap/src/TOP/trcsub.F90
r10969 r11427 92 92 !!------------------------------------------------------------------- 93 93 INTEGER, INTENT( in ) :: kt ! ocean time-step index 94 INTEGER, INTENT( in ) :: Kbb, Kmm, Krhs ! oceantime-level index94 INTEGER, INTENT( in ) :: Kbb, Kmm, Krhs ! time-level index 95 95 ! 96 96 INTEGER :: ji, jj, jk ! dummy loop indices
Note: See TracChangeset
for help on using the changeset viewer.