New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Changeset 15731 – NEMO

Changeset 15731


Ignore:
Timestamp:
2022-03-02T10:05:48+01:00 (2 years ago)
Author:
jenniewaters
Message:

merge in the pcbias code from NEMO_4.0.4_FOAM_pcbias

Location:
NEMO/branches/UKMO/NEMO_4.0.4_FOAM_package
Files:
5 edited
2 copied

Legend:

Unmodified
Added
Removed
  • NEMO/branches/UKMO/NEMO_4.0.4_FOAM_package/cfgs/SHARED/namelist_ref

    r14075 r15731  
    13791379   cn_storst_out = "restart_sto" !  suffix of stochastic parameter restart file (output) 
    13801380/ 
     1381!----------------------------------------------------------------------- 
     1382&nambias   ! Bias pressure correctiom 
     1383!----------------------------------------------------------------------- 
     1384   ln_bias        = .false. 
     1385   ln_bias_asm    = .false. 
     1386   ln_bias_rlx    = .false. 
     1387   ln_bias_ofl    = .false. 
     1388   ln_bias_ts_app = .false. 
     1389   ln_bias_pc_app = .false.         
     1390   fb_t_asm       = 0.0 
     1391   fb_t_rlx       = 0.0 
     1392   fb_t_ofl       = 1.0 
     1393   fb_p_asm       = 1.0 
     1394   fb_p_rlx       = 1.0 
     1395   fb_p_ofl       = 0.0 
     1396   eft_rlx        = 365.0 
     1397   eft_asm        = 365.0 
     1398   t_rlx_upd      = 0.1 
     1399   t_asm_upd      = 0.1 
     1400   nn_lat_ramp    = 0           
     1401   bias_time_unit_asm = 86400.0 
     1402   bias_time_unit_rlx = 1.0 
     1403   bias_time_unit_ofl = 1.0  
     1404   cn_bias_tot    = "bias_tot.nc"  
     1405   cn_bias_asm    = "bias_asm.nc" 
     1406   cn_dir         = './'   
     1407   ln_bsyncro     = .FALSE.  
     1408   fctamp         = 1. 
     1409   rn_maxlat_bias = 23.0       
     1410   rn_minlat_bias = 10.0 
     1411   nn_bias_itwrt  = 15 
     1412   ln_itdecay     = .FALSE. 
     1413   ln_incpc       = .FALSE. 
     1414/ 
  • NEMO/branches/UKMO/NEMO_4.0.4_FOAM_package/src/OCE/DYN/dynhpg.F90

    r14075 r15731  
    4646   USE timing          ! Timing 
    4747   USE iom 
     48   USE biaspar         ! bias correction variables 
    4849 
    4950   IMPLICIT NONE 
     
    9293      !!---------------------------------------------------------------------- 
    9394      INTEGER, INTENT(in) ::   kt   ! ocean time-step index 
    94       REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) ::   ztrdu, ztrdv 
     95      INTEGER                                   ::   ji, jj, jk                 ! dummy loop indices 
     96      INTEGER                                   ::   iku, ikv                   ! k indices for bottom level at u and v points 
     97      INTEGER                                   ::   numf 
     98      REAL(wp), POINTER, DIMENSION(:,:,:)       ::   ztrdu, ztrdv 
     99      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:)   ::   z_rhd_st, z_rhd_diff       ! tmp density storage for pressure corr 
     100      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:)   ::   z_ua, z_va                 ! tmp store for ua and va including hpg but not pressure correction  
     101      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:)   ::   z_ua_bpc, z_va_bpc         ! ua calculated with bias pressure correction   
     102      REAL(wp), ALLOCATABLE, DIMENSION(:,:)     ::   z_ua_bpc_bot, z_va_bpc_bot ! bias pc fields calculated at the ocean bottom 
    95103      !!---------------------------------------------------------------------- 
    96104      ! 
     
    102110         ztrdv(:,:,:) = va(:,:,:) 
    103111      ENDIF 
     112      ! 
     113      IF ( ln_bias .AND. ln_bias_pc_app ) THEN 
     114 
     115         ! allocate space for tempory variables for the bias pressure correction (bpc) 
     116         ALLOCATE( z_rhd_st(jpi,jpj,jpk), & 
     117            &      z_ua(jpi,jpj,jpk),     & 
     118            &      z_va(jpi,jpj,jpk),     &   
     119            &      z_ua_bpc(jpi,jpj,jpk), & 
     120            &      z_va_bpc(jpi,jpj,jpk), &  
     121            &      z_ua_bpc_bot(jpi,jpj), & 
     122            &      z_va_bpc_bot(jpi,jpj), &  
     123       &      z_rhd_diff(jpi,jpj,jpk)& 
     124            &    ) 
     125 
     126         ! save the original acceleration trends  
     127         ! (z_ua_bpc, z_va_bpc are used as temporary storage) 
     128         z_ua_bpc(:,:,:)     = ua(:,:,:) 
     129         z_va_bpc(:,:,:)     = va(:,:,:) 
     130          
     131      END IF 
    104132      ! 
    105133      SELECT CASE ( nhpg )      ! Hydrostatic pressure gradient computation 
     
    112140      END SELECT 
    113141      ! 
     142      IF ( ln_bias .AND. ln_bias_pc_app ) THEN 
     143 
     144         ! The aim here is to calculate the contribution of the bpc to the acceleration terms. 
     145         ! This is done so that the effect of the bpc on the hpg at the bottom can be removed. 
     146         ! In order to do that: 
     147         !    1. The hpg calculation is done again, but with the contributions of the bpc included. 
     148         !    2. The difference between the acceleration terms (w and w/o bpc) is then calculated. 
     149         !    3. The effect of the bpc on the bottom hpg is then removed. 
     150         !    4. The total change to the acceleration terms is then calculated. 
     151          
     152         ! The original density field (without the bpc) is stored.           
     153         z_rhd_st(:,:,:) = rhd(:,:,:) 
     154 
     155         ! Set the density used in the hpc calculations to the value including the effect of the bpc. 
     156         rhd(:,:,:)      = rhd_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 (  np_zco )   ;   CALL hpg_zco    ( kt )      ! z-coordinate 
     169         CASE (  np_zps )   ;   CALL hpg_zps    ( kt )      ! z-coordinate plus partial steps (interpolation) 
     170         CASE (  np_sco )   ;   CALL hpg_sco    ( kt )      ! s-coordinate (standard jacobian formulation) 
     171         CASE (  np_djc )   ;   CALL hpg_djc    ( kt )      ! s-coordinate (Density Jacobian with Cubic polynomial) 
     172         CASE (  np_prj )   ;   CALL hpg_prj    ( kt )      ! s-coordinate (Pressure Jacobian scheme) 
     173         CASE (  np_isf )   ;   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 field 
     202         rhd(:,:,:) = z_rhd_st(:,:,:)      
     203 
     204         ! deallocate tempory variables 
     205         DEALLOCATE( z_rhd_st, z_ua, z_va, z_ua_bpc,   & 
     206            &        z_va_bpc, z_ua_bpc_bot,           & 
     207            &        z_va_bpc_bot, z_rhd_diff          & 
     208            &                                          ) 
     209        
     210      ENDIF  ! ln_bias .AND. ln_bias_pc_app 
     211 
     212 
    114213      IF( l_trddyn ) THEN      ! save the hydrostatic pressure gradient trends for momentum trend diagnostics 
    115214         ztrdu(:,:,:) = ua(:,:,:) - ztrdu(:,:,:) 
  • NEMO/branches/UKMO/NEMO_4.0.4_FOAM_package/src/OCE/nemogcm.F90

    r14075 r15731  
    215215      ! 
    216216      IF( ln_icebergs )   CALL icb_end( nitend ) 
    217  
     217      ! 
     218      IF( lk_asminc    )  CALL bias_deallocate 
     219      ! 
    218220      !                            !------------------------! 
    219221      !                            !==  finalize the run  ==! 
     
    497499      !                                      ! Assimilation increments 
    498500      IF( lk_asminc    )   CALL asm_inc_init    ! Initialize assimilation increments 
     501                           CALL    bias_init    ! Pressure correction bias 
    499502      ! 
    500503      IF(lwp) WRITE(numout,cform_aaa)           ! Flag AAAAAAA 
  • NEMO/branches/UKMO/NEMO_4.0.4_FOAM_package/src/OCE/step.F90

    r15419 r15731  
    105105      IF( ln_crs         )   CALL iom_setkt( kstp - nit000 + 1, TRIM(cxios_context)//"_crs" )   ! tell IOM we are at time step kstp 
    106106 
     107      IF( ln_bias )          CALL bias_opn( kstp ) 
     108 
    107109      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    108110      ! Update external forcing (tides, open boundaries, and surface boundary condition (including sea-ice) 
     
    178180                         CALL dyn_ldf       ( kstp )  ! lateral mixing 
    179181      IF( ln_zdfosm  )   CALL dyn_osm       ( kstp )  ! OSMOSIS non-local velocity fluxes 
     182      IF( ln_bias    )   CALL tra_bias      ( kstp )  ! tracer bias 
     183      IF( ln_bias    )   CALL dyn_bias      ( kstp ) 
    180184                         CALL dyn_hpg       ( kstp )  ! horizontal gradient of Hydrostatic pressure 
    181185                         CALL dyn_spg       ( kstp )  ! surface pressure gradient 
     
    298302 
    299303      IF( ln_diaobs  )   CALL dia_obs      ( kstp )      ! obs-minus-model (assimilation) diagnostics (call after dynamics update) 
     304      IF( lrst_bias )    CALL bias_wrt     ( kstp )      ! write bias fields 
    300305 
    301306      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
  • NEMO/branches/UKMO/NEMO_4.0.4_FOAM_package/src/OCE/step_oce.F90

    r14075 r15731  
    8888 
    8989   USE asminc          ! assimilation increments      (tra_asm_inc routine) 
    90    !                                                   (dyn_asm_inc routine) 
     90                       !                              (dyn_asm_inc routine) 
     91   USE biaspar         ! bias param 
     92   USE bias            ! bias routines                    (tra_bias routine 
     93                       !                                  (dyn_bias routine) 
    9194   USE asmbkg 
    9295   USE stpctl          ! time stepping control            (stp_ctl routine) 
Note: See TracChangeset for help on using the changeset viewer.