Changeset 11555
 Timestamp:
 20190917T14:20:09+02:00 (21 months ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

branches/UKMO/dev_r5518_GO6_package_FOAMv14_updated_pcbias/NEMOGCM/NEMO/OPA_SRC/DYN/dynhpg.F90
r11478 r11555 85 85 !! 86 86 INTEGER, INTENT(in) :: kt ! ocean timestep index 87 INTEGER :: ji, jj, jk ! dummy loop indices88 INTEGER :: iku, ikv ! k indices for bottom level at u and v points87 INTEGER :: ji, jj, jk ! dummy loop indices 88 INTEGER :: iku, ikv ! k indices for bottom level at u and v points 89 89 REAL(wp), POINTER, DIMENSION(:,:,:) :: ztrdu, ztrdv 90 REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) :: z_rhd_st ! tmp density storage for pressure corr 91 REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) :: z_ua, z_va ! tmp store for ua and va including hpg but not pressure correction 92 REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) :: z_ua_bpc, z_va_bpc ! ua calculated with bias pressure correction 93 90 REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) :: z_rhd_st ! tmp density storage for pressure corr 91 REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) :: z_ua, z_va ! tmp store for ua and va including hpg but not pressure correction 92 REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) :: z_ua_bpc, z_va_bpc ! ua calculated with bias pressure correction 94 93 REAL(wp), ALLOCATABLE, DIMENSION(:,:) :: z_gru_st, z_grv_st ! tmp ua and va trends storage for pressure corr 95 94 REAL(wp), ALLOCATABLE, DIMENSION(:,:) :: z_ua_bpc_bot, z_va_bpc_bot ! bias pc fields calculated at the ocean bottom … … 108 107 IF ( ln_bias .AND. ln_bias_pc_app ) THEN 109 108 110 ! Allocate space for tempory variables109 ! allocate space for tempory variables for the bias pressure correction (bpc) 111 110 ALLOCATE( z_rhd_st(jpi,jpj,jpk), & 112 111 & z_gru_st(jpi,jpj), & 113 112 & z_grv_st(jpi,jpj), & 114 & z_ua(jpi,jpj,jpk), z_va(jpi,jpj,jpk), & 115 & z_ua_bpc(jpi,jpj,jpk), z_va_bpc(jpi,jpj,jpk), & 116 & z_ua_bpc_bot(jpi,jpj), z_va_bpc_bot(jpi,jpj) & 117 & ) 118 119 ! save the original acceleration trends (z_ua_bpc, z_va_bpc are used as temporary storage) 113 & z_ua(jpi,jpj,jpk), & 114 & z_va(jpi,jpj,jpk), & 115 & z_ua_bpc(jpi,jpj,jpk), & 116 & z_va_bpc(jpi,jpj,jpk), & 117 & z_ua_bpc_bot(jpi,jpj), & 118 & z_va_bpc_bot(jpi,jpj) & 119 & ) 120 121 ! save the original acceleration trends 122 ! (z_ua_bpc, z_va_bpc are used as temporary storage) 120 123 z_ua_bpc(:,:,:) = ua(:,:,:) 121 z_va_bpc(:,:,:) = va(:,:,:) 124 z_va_bpc(:,:,:) = va(:,:,:) 125 122 126 END IF 123 127 … … 134 138 IF ( ln_bias .AND. ln_bias_pc_app ) THEN 135 139 136 z_rhd_st(:,:,:) = rhd(:,:,:) ! store orig density 137 rhd(:,:,:) = rhd_pc(:,:,:) ! use pressure corrected density 140 ! The aim here is to calculate the contribution of the bpc to the acceleration terms. 141 ! This is done so that the effect of the bpc on the hpg at the bottom can be removed. 142 ! In order to do that: 143 ! 1. The hpg calculation is done again, but with the contributions of the bpc included. 144 ! 2. The difference between the acceleration terms (w and w/o bpc) is then calculated. 145 ! 3. The effect of the bpc on the bottom hpg is then removed. 146 ! 4. The total change to the acceleration terms is then calculated. 147 148 ! The original density fields etc (without the bpc) are stored. 149 z_rhd_st(:,:,:) = rhd(:,:,:) 138 150 z_gru_st(:,:) = gru(:,:) 139 gru(:,:) = gru_pc(:,:)140 151 z_grv_st(:,:) = grv(:,:) 141 grv(:,:) = grv_pc(:,:) 142 152 153 ! Set the density etc used in the hpc calculations to the value including the effect of the bpc. 154 rhd(:,:,:) = rhd_pc(:,:,:) 155 gru(:,:) = gru_pc(:,:) 156 grv(:,:) = grv_pc(:,:) 157 143 158 ! save the acceleration trends including hpg field but calculated without the bpc fields 144 159 z_ua(:,:,:) = ua(:,:,:) 145 146 147 ! reset the acceleration trends to their original values 160 z_va(:,:,:) = va(:,:,:) 161 162 ! reset the acceleration trends to their original values 148 163 ua(:,:,:) = z_ua_bpc(:,:,:) 149 164 va(:,:,:) = z_va_bpc(:,:,:) 150 165 151 166 ! recalculate the horizontal pressure gradients with the bpc fields … … 174 189 175 190 ! subtract off the bottom values of bpc contribution to ua and va 176 DO jk = 1, jpk  1 177 z_ua_bpc(:,:,jk) = z_ua_bpc(:,:,jk)  z_ua_bpc_bot(:,:) 178 z_va_bpc(:,:,jk) = z_va_bpc(:,:,jk)  z_va_bpc_bot(:,:) 179 END DO 180 181 ! calculate ua using the original hpg (z_ua) and the bias hpg with the bottom pressure gradients subtracted off 191 DO jk = 1, jpk  1 192 z_ua_bpc(:,:,jk) = z_ua_bpc(:,:,jk)  z_ua_bpc_bot(:,:) 193 z_va_bpc(:,:,jk) = z_va_bpc(:,:,jk)  z_va_bpc_bot(:,:) 194 END DO 195 196 ! calculate ua using the original hpg (z_ua) and the bias hpg 197 ! with the bottom pressure gradients subtracted off 182 198 ua(:,:,:) = z_ua(:,:,:) + z_ua_bpc(:,:,:) 183 199 va(:,:,:) = z_va(:,:,:) + z_va_bpc(:,:,:) 184 185 IF(lwp) THEN186 WRITE(numout,*) " ! restore original density"187 ENDIF188 200 189 201 ! restore original density, gru and grv fields … … 192 204 grv(:,:) = z_grv_st(:,:) 193 205 194 ! Deallocate tempory variables206 ! deallocate tempory variables 195 207 DEALLOCATE( z_rhd_st, z_gru_st, z_grv_st, & 196 208 & z_ua, z_va, z_ua_bpc, z_va_bpc, & 197 209 & z_ua_bpc_bot, z_va_bpc_bot & 198 210 & ) 199 211
Note: See TracChangeset
for help on using the changeset viewer.