- Timestamp:
- 2020-05-14T21:46:00+02:00 (4 years ago)
- Location:
- NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser
- Property svn:externals
-
old new 6 6 ^/vendors/FCM@HEAD ext/FCM 7 7 ^/vendors/IOIPSL@HEAD ext/IOIPSL 8 9 # SETTE 10 ^/utils/CI/sette@HEAD sette
-
- Property svn:externals
-
NEMO/branches/2019/dev_r11078_OSMOSIS_IMMERSE_Nurser/src/TOP/trcstp.F90
r10570 r12928 5 5 !!====================================================================== 6 6 !! History : 1.0 ! 2004-03 (C. Ethe) Original 7 !! 4.1 ! 2019-08 (A. Coward, D. Storkey) rewrite in preparation for new timestepping scheme 7 8 !!---------------------------------------------------------------------- 8 9 #if defined key_top … … 17 18 USE trcwri 18 19 USE trcrst 19 USE trcsub !20 20 USE trdtrc_oce 21 21 USE trdmxl_trc … … 44 44 CONTAINS 45 45 46 SUBROUTINE trc_stp( kt )46 SUBROUTINE trc_stp( kt, Kbb, Kmm, Krhs, Kaa ) 47 47 !!------------------------------------------------------------------- 48 48 !! *** ROUTINE trc_stp *** … … 53 53 !! Update the passive tracers 54 54 !!------------------------------------------------------------------- 55 INTEGER, INTENT( in ) :: kt ! ocean time-step index 55 INTEGER, INTENT( in ) :: kt ! ocean time-step index 56 INTEGER, INTENT( in ) :: Kbb, Kmm, Krhs, Kaa ! time level indices 56 57 ! 57 58 INTEGER :: jk, jn ! dummy loop indices … … 63 64 IF( ln_timing ) CALL timing_start('trc_stp') 64 65 ! 65 IF( ( neuler == 0 .AND. kt == nittrc000 ).OR. ln_top_euler ) THEN ! at nittrc00066 r 2dttrc = rdttrc ! = rdttrc(use or restarting with Euler time stepping)67 ELSEIF( kt <= nittrc000 + nn_dttrc ) THEN ! at nittrc000 or nittrc000+168 r 2dttrc = 2. * rdttrc ! = 2 rdttrc (leapfrog)69 ENDIF 70 ! 71 ll_trcstat = ( ln_ctl .OR.sn_cfctl%l_trcstat ) .AND. &66 IF( l_1st_euler .OR. ln_top_euler ) THEN ! at nittrc000 67 rDt_trc = rn_Dt ! = rn_Dt (use or restarting with Euler time stepping) 68 ELSEIF( kt <= nittrc000 + 1 ) THEN ! at nittrc000 or nittrc000+1 69 rDt_trc = 2. * rn_Dt ! = 2 rn_Dt (leapfrog) 70 ENDIF 71 ! 72 ll_trcstat = ( sn_cfctl%l_trcstat ) .AND. & 72 73 & ( ( MOD( kt, sn_cfctl%ptimincr ) == 0 ) .OR. ( kt == nitend ) ) 74 75 IF( kt == nittrc000 ) CALL trc_stp_ctl ! control 73 76 IF( kt == nittrc000 .AND. lk_trdmxl_trc ) CALL trd_mxl_trc_init ! trends: Mixed-layer 74 77 ! 75 78 IF( .NOT.ln_linssh ) THEN ! update ocean volume due to ssh temporal evolution 76 79 DO jk = 1, jpk 77 cvol(:,:,jk) = e1e2t(:,:) * e3t _n(:,:,jk) * tmask(:,:,jk)80 cvol(:,:,jk) = e1e2t(:,:) * e3t(:,:,jk,Kmm) * tmask(:,:,jk) 78 81 END DO 79 IF ( l n_ctl .OR. kt == nitrst .OR. ( ln_check_mass .AND. kt == nitend )&82 IF ( ll_trcstat .OR. kt == nitrst .OR. ( ln_check_mass .AND. kt == nitend ) & 80 83 & .OR. iom_use( "pno3tot" ) .OR. iom_use( "ppo4tot" ) .OR. iom_use( "psiltot" ) & 81 84 & .OR. iom_use( "palktot" ) .OR. iom_use( "pfertot" ) ) & … … 85 88 IF( l_trcdm2dc ) CALL trc_mean_qsr( kt ) 86 89 ! 87 IF( nn_dttrc /= 1 ) CALL trc_sub_stp( kt ) ! averaging physical variables for sub-stepping 88 ! 89 IF( MOD( kt , nn_dttrc ) == 0 ) THEN ! only every nn_dttrc time step 90 ! 91 IF(ln_ctl) THEN 92 WRITE(charout,FMT="('kt =', I4,' d/m/y =',I2,I2,I4)") kt, nday, nmonth, nyear 93 CALL prt_ctl_trc_info(charout) 94 ENDIF 95 ! 96 tra(:,:,:,:) = 0.e0 97 ! 98 CALL trc_rst_opn ( kt ) ! Open tracer restart file 99 IF( lrst_trc ) CALL trc_rst_cal ( kt, 'WRITE' ) ! calendar 100 CALL trc_wri ( kt ) ! output of passive tracers with iom I/O manager 101 CALL trc_sms ( kt ) ! tracers: sinks and sources 102 CALL trc_trp ( kt ) ! transport of passive tracers 103 IF( kt == nittrc000 ) THEN 104 CALL iom_close( numrtr ) ! close input tracer restart file 105 IF(lwm) CALL FLUSH( numont ) ! flush namelist output 106 ENDIF 107 IF( lrst_trc ) CALL trc_rst_wri ( kt ) ! write tracer restart file 108 IF( lk_trdmxl_trc ) CALL trd_mxl_trc ( kt ) ! trends: Mixed-layer 109 ! 110 IF( nn_dttrc /= 1 ) CALL trc_sub_reset( kt ) ! resetting physical variables when sub-stepping 111 ! 90 ! 91 IF(sn_cfctl%l_prttrc) THEN 92 WRITE(charout,FMT="('kt =', I4,' d/m/y =',I2,I2,I4)") kt, nday, nmonth, nyear 93 CALL prt_ctl_trc_info(charout) 94 ENDIF 95 ! 96 tr(:,:,:,:,Krhs) = 0._wp 97 ! 98 CALL trc_rst_opn ( kt ) ! Open tracer restart file 99 IF( lrst_trc ) CALL trc_rst_cal ( kt, 'WRITE' ) ! calendar 100 CALL trc_wri ( kt, Kmm ) ! output of passive tracers with iom I/O manager 101 CALL trc_sms ( kt, Kbb, Kmm, Krhs ) ! tracers: sinks and sources 102 CALL trc_trp ( kt, Kbb, Kmm, Krhs, Kaa ) ! transport of passive tracers 103 ! 104 ! Note passive tracers have been time-filtered in trc_trp but the time level 105 ! indices will not be swapped until after tra_atf/dyn_atf/ssh_atf in stp. Subsequent calls here 106 ! anticipate this update which will be: Nrhs= Nbb ; Nbb = Nnn ; Nnn = Naa ; Naa = Nrhs 107 ! and use the filtered levels explicitly. 108 ! 109 IF( kt == nittrc000 ) THEN 110 CALL iom_close( numrtr ) ! close input tracer restart file 111 IF(lwm) CALL FLUSH( numont ) ! flush namelist output 112 ENDIF 113 IF( lrst_trc ) CALL trc_rst_wri ( kt, Kmm, Kaa, Kbb ) ! write tracer restart file 114 IF( lk_trdmxl_trc ) CALL trd_mxl_trc ( kt, Kaa ) ! trends: Mixed-layer 115 ! 116 IF( ln_top_euler ) THEN 117 ! For Euler timestepping for TOP we need to copy the "after" to the "now" fields 118 ! here then after the (leapfrog) swapping of the time-level indices in OCE/step.F90 we have 119 ! "before" fields = "now" fields. 120 tr(:,:,:,:,Kmm) = tr(:,:,:,:,Kaa) 112 121 ENDIF 113 122 ! … … 115 124 ztrai = 0._wp ! content of all tracers 116 125 DO jn = 1, jptra 117 ztrai = ztrai + glob_sum( 'trcstp', tr n(:,:,:,jn) * cvol(:,:,:) )126 ztrai = ztrai + glob_sum( 'trcstp', tr(:,:,:,jn,Kaa) * cvol(:,:,:) ) 118 127 END DO 119 128 IF( lwm ) WRITE(numstr,9300) kt, ztrai / areatot … … 124 133 ! 125 134 END SUBROUTINE trc_stp 135 136 137 SUBROUTINE trc_stp_ctl 138 !!---------------------------------------------------------------------- 139 !! *** ROUTINE trc_stp_ctl *** 140 !! ** Purpose : Control + ocean volume 141 !!---------------------------------------------------------------------- 142 ! 143 ! Define logical parameter ton control dirunal cycle in TOP 144 l_trcdm2dc = ln_dm2dc .OR. ( ln_cpl .AND. ncpl_qsr_freq /= 1 .AND. ncpl_qsr_freq /= 0 ) 145 l_trcdm2dc = l_trcdm2dc .AND. .NOT. l_offline 146 ! 147 IF( l_trcdm2dc .AND. lwp ) CALL ctl_warn( 'Coupling with passive tracers and used of diurnal cycle.', & 148 & 'Computation of a daily mean shortwave for some biogeochemical models ' ) 149 ! 150 END SUBROUTINE trc_stp_ctl 126 151 127 152 … … 153 178 nb_rec_per_day = ncpl_qsr_freq 154 179 ELSE 155 rdt_sampl = MAX( 3600., r dttrc)180 rdt_sampl = MAX( 3600., rn_Dt ) 156 181 nb_rec_per_day = INT( rday / rdt_sampl ) 157 182 ENDIF … … 172 197 173 198 CALL iom_get( numrtr, 'ktdcy', zkt ) 174 rsecfst = INT( zkt ) * r dttrc199 rsecfst = INT( zkt ) * rn_Dt 175 200 IF(lwp) WRITE(numout,*) 'trc_qsr_mean: qsr_mean read in the restart file at time-step rsecfst =', rsecfst, ' s ' 176 201 CALL iom_get( numrtr, jpdom_autoglo, 'qsr_mean', qsr_mean ) ! A mean of qsr … … 193 218 ELSE !* no restart: set from nit000 values 194 219 IF(lwp) WRITE(numout,*) 'trc_qsr_mean: qsr_mean set to nit000 values' 195 rsecfst = kt * r dttrc220 rsecfst = kt * rn_Dt 196 221 ! 197 222 qsr_mean(:,:) = qsr(:,:) … … 203 228 ENDIF 204 229 ! 205 rseclast = kt * r dttrc230 rseclast = kt * rn_Dt 206 231 ! 207 232 llnew = ( rseclast - rsecfst ) .ge. rdt_sampl ! new shortwave to store
Note: See TracChangeset
for help on using the changeset viewer.