Changeset 14987 for branches/UKMO/dev_r5518_GO6_starthour_obsoper/NEMOGCM
- Timestamp:
- 2021-06-14T14:14:01+02:00 (3 years ago)
- Location:
- branches/UKMO/dev_r5518_GO6_starthour_obsoper/NEMOGCM/NEMO/OPA_SRC
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/UKMO/dev_r5518_GO6_starthour_obsoper/NEMOGCM/NEMO/OPA_SRC/ASM/bias.F90
r12555 r14987 995 995 ! 996 996 IF( lrst_oce .AND. .NOT.lrst_bias ) THEN ! create bias file 997 IF( nitend > 999999999 ) THEN ; WRITE(clbkt, * ) nitend998 ELSE ; WRITE(clbkt, '(i8.8)') nitend997 IF( nitend > 999999999 ) THEN ; WRITE(clbkt, * ) kt+1 998 ELSE ; WRITE(clbkt, '(i8.8)') kt+1 999 999 ENDIF 1000 1000 clbias_tot = TRIM(cexper)//"_"//TRIM(ADJUSTL(clbkt))//"_"//TRIM(cn_bias_tot) … … 1053 1053 ENDIF 1054 1054 1055 IF( kt == nit end) THEN1056 CALL iom_close( numbias_tot ) ! close the restart file (only at lasttime step)1055 IF( kt == nitrst ) THEN 1056 CALL iom_close( numbias_tot ) ! close the restart file (only at writing time step) 1057 1057 lrst_bias = .FALSE. 1058 1058 ENDIF -
branches/UKMO/dev_r5518_GO6_starthour_obsoper/NEMOGCM/NEMO/OPA_SRC/DYN/dynhpg.F90
r12555 r14987 17 17 !! ! (A. Coward) suppression of hel, wdj and rot options 18 18 !! 3.6 ! 2014-11 (P. Mathiot) hpg_isf: original code for ice shelf cavity 19 !! 3.6 ! 2019-08 (M. Bell) Revisions to bias pressure correction 19 20 !!---------------------------------------------------------------------- 20 21 … … 84 85 !!---------------------------------------------------------------------- 85 86 INTEGER, INTENT(in) :: kt ! ocean time-step index 86 REAL(wp), POINTER, DIMENSION(:,:,:) :: ztrdu, ztrdv 87 REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) :: z_rhd_st ! tmp density storage for pressure corr 88 REAL(wp), ALLOCATABLE, DIMENSION(:,:) :: z_gru_st ! tmp ua trends storage for pressure corr 89 REAL(wp), ALLOCATABLE, DIMENSION(:,:) :: z_grv_st ! tmp va trends storage for pressure corr 87 INTEGER :: ji, jj, jk ! dummy loop indices 88 INTEGER :: iku, ikv ! k indices for bottom level at u and v points 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 REAL(wp), ALLOCATABLE, DIMENSION(:,:) :: z_gru_st, z_grv_st ! tmp ua and va trends storage for pressure corr 94 REAL(wp), ALLOCATABLE, DIMENSION(:,:) :: z_ua_bpc_bot, z_va_bpc_bot ! bias pc fields calculated at the ocean bottom 95 90 96 !!---------------------------------------------------------------------- 91 97 ! … … 98 104 ENDIF 99 105 ! 106 100 107 IF ( ln_bias .AND. ln_bias_pc_app ) THEN 101 108 102 ! Allocate space for tempory variables109 ! allocate space for tempory variables for the bias pressure correction (bpc) 103 110 ALLOCATE( z_rhd_st(jpi,jpj,jpk), & 104 111 & z_gru_st(jpi,jpj), & 105 & z_grv_st(jpi,jpj) ) 106 107 z_rhd_st(:,:,:) = rhd(:,:,:) ! store orig density 108 rhd(:,:,:) = rhd_pc(:,:,:) ! use pressure corrected density 109 z_gru_st(:,:) = gru(:,:) 110 gru(:,:) = gru_pc(:,:) 111 z_grv_st(:,:) = grv(:,:) 112 grv(:,:) = grv_pc(:,:) 113 114 ENDIF 112 & z_grv_st(jpi,jpj), & 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) 123 z_ua_bpc(:,:,:) = ua(:,:,:) 124 z_va_bpc(:,:,:) = va(:,:,:) 125 126 END IF 115 127 116 128 SELECT CASE ( nhpg ) ! Hydrostatic pressure gradient computation … … 123 135 END SELECT 124 136 ! 137 138 IF ( ln_bias .AND. ln_bias_pc_app ) THEN 139 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(:,:,:) 150 z_gru_st(:,:) = gru(:,:) 151 z_grv_st(:,:) = grv(:,:) 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 158 ! save the acceleration trends including hpg field but calculated without the bpc fields 159 z_ua(:,:,:) = ua(:,:,:) 160 z_va(:,:,:) = va(:,:,:) 161 162 ! reset the acceleration trends to their original values 163 ua(:,:,:) = z_ua_bpc(:,:,:) 164 va(:,:,:) = z_va_bpc(:,:,:) 165 166 ! re-calculate the horizontal pressure gradients with the bpc fields 167 SELECT CASE ( nhpg ) ! Hydrostatic pressure gradient computation 168 CASE ( 0 ) ; CALL hpg_zco ( kt ) ! z-coordinate 169 CASE ( 1 ) ; CALL hpg_zps ( kt ) ! z-coordinate plus partial steps (interpolation) 170 CASE ( 2 ) ; CALL hpg_sco ( kt ) ! s-coordinate (standard jacobian formulation) 171 CASE ( 3 ) ; CALL hpg_djc ( kt ) ! s-coordinate (Density Jacobian with Cubic polynomial) 172 CASE ( 4 ) ; CALL hpg_prj ( kt ) ! s-coordinate (Pressure Jacobian scheme) 173 CASE ( 5 ) ; CALL hpg_isf ( kt ) ! s-coordinate similar to sco modify for ice shelf 174 END SELECT 175 176 ! calculate the bpc contribution to ua and va 177 z_ua_bpc(:,:,:) = ua(:,:,:) - z_ua(:,:,:) 178 z_va_bpc(:,:,:) = va(:,:,:) - z_va(:,:,:) 179 180 ! calculate the bpc contribution to ua and va at the bottom 181 DO jj = 2, jpjm1 182 DO ji = 2, jpim1 183 iku = mbku(ji,jj) 184 ikv = mbkv(ji,jj) 185 z_ua_bpc_bot(ji,jj) = z_ua_bpc(ji,jj,iku) 186 z_va_bpc_bot(ji,jj) = z_va_bpc(ji,jj,ikv) 187 END DO ! ji 188 END DO ! jj 189 190 ! subtract off the bottom values of bpc contribution to ua and va 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 198 ua(:,:,:) = z_ua(:,:,:) + z_ua_bpc(:,:,:) 199 va(:,:,:) = z_va(:,:,:) + z_va_bpc(:,:,:) 200 201 ! restore original density, gru and grv fields 202 rhd(:,:,:) = z_rhd_st(:,:,:) 203 gru(:,:) = z_gru_st(:,:) 204 grv(:,:) = z_grv_st(:,:) 205 206 ! deallocate tempory variables 207 DEALLOCATE( z_rhd_st, z_gru_st, z_grv_st, & 208 & z_ua, z_va, z_ua_bpc, z_va_bpc, & 209 & z_ua_bpc_bot, z_va_bpc_bot & 210 & ) 211 212 ENDIF ! ln_bias .AND. ln_bias_pc_app 213 214 125 215 IF( l_trddyn ) THEN ! save the hydrostatic pressure gradient trends for momentum trend diagnostics 126 216 ztrdu(:,:,:) = ua(:,:,:) - ztrdu(:,:,:) … … 132 222 IF(ln_ctl) CALL prt_ctl( tab3d_1=ua, clinfo1=' hpg - Ua: ', mask1=umask, & 133 223 & tab3d_2=va, clinfo2= ' Va: ', mask2=vmask, clinfo3='dyn' ) 134 !135 IF ( ln_bias .AND. ln_bias_pc_app ) THEN136 IF(lwp) THEN137 WRITE(numout,*) " ! restore original density"138 IF(lflush) CALL flush(numout)139 ENDIF140 rhd(:,:,:) = z_rhd_st(:,:,:) ! restore original density141 gru(:,:) = z_gru_st(:,:)142 grv(:,:) = z_grv_st(:,:)143 144 !Deallocate tempory variables145 DEALLOCATE( z_rhd_st, &146 & z_gru_st, &147 & z_grv_st )148 ENDIF149 224 ! 150 225 IF( nn_timing == 1 ) CALL timing_stop('dyn_hpg') -
branches/UKMO/dev_r5518_GO6_starthour_obsoper/NEMOGCM/NEMO/OPA_SRC/step.F90
r12555 r14987 351 351 IF( lk_vvl ) CALL dom_vvl_sf_swp( kstp ) ! swap of vertical scale factors 352 352 ! 353 354 ! Moved bias _wrt to before rst_write as used restart parameters for nn_stocklist option that are changed by rst_wrt 355 IF( lrst_bias ) CALL bias_wrt ( kstp ) 356 353 357 IF( lrst_oce ) CALL rst_write( kstp ) ! write output ocean restart file 354 358 IF( ln_sto_eos ) CALL sto_rst_write( kstp ) ! write restart file for stochastic parameters … … 383 387 ENDIF 384 388 385 386 IF( lrst_bias ) CALL bias_wrt ( kstp )387 388 389 !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 389 390 ! Coupled mode
Note: See TracChangeset
for help on using the changeset viewer.