- Timestamp:
- 2015-08-12T17:46:45+02:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2015/dev_r5072_UKMO2_OBS_simplification/NEMOGCM/NEMO/TOP_SRC/trcstp.F90
r4990 r5682 30 30 PUBLIC trc_stp ! called by step 31 31 32 REAL(wp), DIMENSION(:,:,:), SAVE, ALLOCATABLE :: qsr_arr ! save qsr during TOP time-step 33 REAL(wp) :: rdt_sampl 34 INTEGER :: nb_rec_per_days 35 INTEGER :: isecfst, iseclast 36 LOGICAL :: llnew 37 32 38 !! * Substitutions 33 39 # include "domzgr_substitute.h90" … … 54 60 CHARACTER (len=25) :: charout 55 61 56 REAL(wp), DIMENSION(:,:), POINTER :: zqsr_tmp ! save qsr during TOP time-step57 62 !!------------------------------------------------------------------- 58 63 ! … … 68 73 areatot = glob_sum( cvol(:,:,:) ) 69 74 ENDIF 70 ! 71 IF( ltrcdm2dc ) THEN 72 ! When Diurnal cycle, core bulk and LIM2 are activated, put daily mean qsr in qsr for TOP/biogeochemistery time-step 73 ! and save qsr with diurnal cycle in qsr_tmp 74 CALL wrk_alloc( jpi,jpj, zqsr_tmp ) 75 zqsr_tmp(:,:) = qsr (:,:) 76 qsr (:,:) = qsr_mean(:,:) 77 ENDIF 75 ! 76 IF( l_trcdm2dc ) CALL trc_mean_qsr( kt ) 78 77 ! 79 78 IF( nn_dttrc /= 1 ) CALL trc_sub_stp( kt ) ! averaging physical variables for sub-stepping … … 106 105 ENDIF 107 106 ! 108 IF( ltrcdm2dc ) THEN109 ! put back qsr with diurnal cycle in qsr110 qsr(:,:) = zqsr_tmp(:,:)111 CALL wrk_dealloc( jpi,jpj, zqsr_tmp )112 ENDIF113 !114 107 ztrai = 0._wp ! content of all tracers 115 108 DO jn = 1, jptra … … 122 115 ! 123 116 END SUBROUTINE trc_stp 117 118 SUBROUTINE trc_mean_qsr( kt ) 119 !!---------------------------------------------------------------------- 120 !! *** ROUTINE trc_mean_qsr *** 121 !! 122 !! ** Purpose : Compute daily mean qsr for biogeochemical model in case 123 !! of diurnal cycle 124 !! 125 !! ** Method : store in TOP the qsr every hour ( or every time-step the latter 126 !! is greater than 1 hour ) and then, compute the mean with 127 !! a moving average over 24 hours. 128 !! In coupled mode, the sampling is done at every coupling frequency 129 !!---------------------------------------------------------------------- 130 INTEGER, INTENT(in) :: kt 131 INTEGER :: jn 132 133 IF( kt == nittrc000 ) THEN 134 IF( ln_cpl ) THEN 135 rdt_sampl = 86400. / ncpl_qsr_freq 136 nb_rec_per_days = ncpl_qsr_freq 137 ELSE 138 rdt_sampl = MAX( 3600., rdt * nn_dttrc ) 139 nb_rec_per_days = INT( 86400 / rdt_sampl ) 140 ENDIF 141 ! 142 IF( lwp ) THEN 143 WRITE(numout,*) 144 WRITE(numout,*) ' Sampling frequency dt = ', rdt_sampl, 's',' Number of sampling per day nrec = ', nb_rec_per_days 145 WRITE(numout,*) 146 ENDIF 147 ! 148 ALLOCATE( qsr_arr(jpi,jpj,nb_rec_per_days ) ) 149 DO jn = 1, nb_rec_per_days 150 qsr_arr(:,:,jn) = qsr(:,:) 151 ENDDO 152 qsr_mean(:,:) = qsr(:,:) 153 ! 154 isecfst = nsec_year + nsec1jan000 ! number of seconds between Jan. 1st 00h of nit000 year and the middle of time step 155 iseclast = isecfst 156 ! 157 ENDIF 158 ! 159 iseclast = nsec_year + nsec1jan000 160 llnew = ( iseclast - isecfst ) > INT( rdt_sampl ) ! new shortwave to store 161 IF( kt /= nittrc000 .AND. llnew ) THEN 162 IF( lwp ) WRITE(numout,*) ' New shortwave to sample for TOP at time kt = ', kt, & 163 & ' time = ', (iseclast+rdt*nn_dttrc/2.)/3600.,'hours ' 164 isecfst = iseclast 165 DO jn = 1, nb_rec_per_days - 1 166 qsr_arr(:,:,jn) = qsr_arr(:,:,jn+1) 167 ENDDO 168 qsr_arr (:,:,nb_rec_per_days) = qsr(:,:) 169 qsr_mean(:,: ) = SUM( qsr_arr(:,:,:), 3 ) / nb_rec_per_days 170 ENDIF 171 ! 172 END SUBROUTINE trc_mean_qsr 124 173 125 174 #else
Note: See TracChangeset
for help on using the changeset viewer.