Index: branches/UKMO/dev_r5518_pcbias/NEMOGCM/CONFIG/SHARED/namelist_ref
===================================================================
--- branches/UKMO/dev_r5518_pcbias/NEMOGCM/CONFIG/SHARED/namelist_ref	(revision 6277)
+++ branches/UKMO/dev_r5518_pcbias/NEMOGCM/CONFIG/SHARED/namelist_ref	(revision 6278)
@@ -1299,2 +1299,16 @@
    rn_htrmax         =  200.0   ! max. depth of transition range
 /
+!-----------------------------------------------------------------------
+&nambias   ! Bias pressure correctiom
+!-----------------------------------------------------------------------
+   ln_bias = .false.
+   ln_bias_asm    = .false.
+   ln_bias_rlx    = .false.
+   ln_bias_ofl    = .false.
+   ln_bias_ts_app = .false.
+   ln_bias_pc_app = .false.
+   eft_asm        = 90.    
+   cn_bias_tot    = 'pcbias.nc'
+   bias_time_unit_asm = 86400.0
+   ln_inertial    = .false.
+/
Index: branches/UKMO/dev_r5518_pcbias/NEMOGCM/NEMO/OPA_SRC/DYN/dynhpg.F90
===================================================================
--- branches/UKMO/dev_r5518_pcbias/NEMOGCM/NEMO/OPA_SRC/DYN/dynhpg.F90	(revision 6277)
+++ branches/UKMO/dev_r5518_pcbias/NEMOGCM/NEMO/OPA_SRC/DYN/dynhpg.F90	(revision 6278)
@@ -44,4 +44,5 @@
    USE wrk_nemo        ! Memory Allocation
    USE timing          ! Timing
+   USE biaspar         ! bias correction variables
 
    IMPLICIT NONE
@@ -84,4 +85,7 @@
       INTEGER, INTENT(in) ::   kt   ! ocean time-step index
       REAL(wp), POINTER, DIMENSION(:,:,:) ::  ztrdu, ztrdv
+      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   z_rhd_st       ! for pressure correction
+      REAL(wp), DIMENSION(jpi,jpj)     ::   z_gru_st       ! for pressure correction
+      REAL(wp), DIMENSION(jpi,jpj)     ::   z_grv_st       ! for pressure correction
       !!----------------------------------------------------------------------
       !
@@ -92,4 +96,13 @@
          ztrdu(:,:,:) = ua(:,:,:)
          ztrdv(:,:,:) = va(:,:,:)
+      ENDIF
+      !
+      IF ( ln_bias .AND. ln_bias_pc_app ) THEN
+         z_rhd_st(:,:,:) = rhd(:,:,:)     ! store orig density 
+         rhd(:,:,:)      = rhd_pc(:,:,:)  ! use pressure corrected density
+         z_gru_st(:,:)   = gru(:,:)
+         gru(:,:)        = gru_pc(:,:)
+         z_grv_st(:,:)   = grv(:,:)
+         grv(:,:)        = grv_pc(:,:)
       ENDIF
       !
@@ -112,4 +125,10 @@
       IF(ln_ctl)   CALL prt_ctl( tab3d_1=ua, clinfo1=' hpg  - Ua: ', mask1=umask,   &
          &                       tab3d_2=va, clinfo2=       ' Va: ', mask2=vmask, clinfo3='dyn' )
+      !
+      IF ( ln_bias .AND. ln_bias_pc_app )  THEN
+         rhd(:,:,:) = z_rhd_st(:,:,:)     ! restore original density
+         gru(:,:)   = z_gru_st(:,:)
+         grv(:,:)   = z_grv_st(:,:)
+      ENDIF
       !
       IF( nn_timing == 1 )  CALL timing_stop('dyn_hpg')
Index: branches/UKMO/dev_r5518_pcbias/NEMOGCM/NEMO/OPA_SRC/IOM/in_out_manager.F90
===================================================================
--- branches/UKMO/dev_r5518_pcbias/NEMOGCM/NEMO/OPA_SRC/IOM/in_out_manager.F90	(revision 6277)
+++ branches/UKMO/dev_r5518_pcbias/NEMOGCM/NEMO/OPA_SRC/IOM/in_out_manager.F90	(revision 6278)
@@ -121,4 +121,5 @@
    INTEGER ::   numout          =    6      !: logical unit for output print; Set to stdout to ensure any early
                                             !  output can be collected; do not change
+   INTEGER ::   numnam          =   -1      !: logical unit for namelist
    INTEGER ::   numnam_ref      =   -1      !: logical unit for reference namelist
    INTEGER ::   numnam_cfg      =   -1      !: logical unit for configuration specific namelist
Index: branches/UKMO/dev_r5518_pcbias/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90
===================================================================
--- branches/UKMO/dev_r5518_pcbias/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90	(revision 6277)
+++ branches/UKMO/dev_r5518_pcbias/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90	(revision 6278)
@@ -452,5 +452,6 @@
       IF( lk_diadct     )   CALL dia_dct_init   ! Sections tranports
                             CALL dia_hsb_init   ! heat content, salt content and volume budgets
-                            CALL     trd_init   ! Mixed-layer/Vorticity/Integral constraints trends
+                            CALL     trd_init   ! Mixed-layer/Vorticity/Integral constraints trend
+      IF (lk_bias       )   CALL     bias_init  ! Pressure correction bias
       IF( lk_diaobs     ) THEN                  ! Observation & model comparison
                             CALL dia_obs_init            ! Initialize observational data
Index: branches/UKMO/dev_r5518_pcbias/NEMOGCM/NEMO/OPA_SRC/step.F90
===================================================================
--- branches/UKMO/dev_r5518_pcbias/NEMOGCM/NEMO/OPA_SRC/step.F90	(revision 6277)
+++ branches/UKMO/dev_r5518_pcbias/NEMOGCM/NEMO/OPA_SRC/step.F90	(revision 6278)
@@ -97,4 +97,8 @@
       IF( ln_crs     )       CALL iom_setkt( kstp - nit000 + 1, TRIM(cxios_context)//"_crs" )   ! tell iom we are at time step kstp
 
+      IF( lk_bias ) THEN
+         IF( ln_bias )          CALL bias_opn( kstp )
+      ENDIF
+
       !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
       ! Update data, open boundaries, surface boundary condition (including sea-ice)
@@ -255,4 +259,7 @@
       IF( lk_trabbl      )   CALL tra_bbl    ( kstp )       ! advective (and/or diffusive) bottom boundary layer scheme
       IF( ln_tradmp      )   CALL tra_dmp    ( kstp )       ! internal damping trends
+      IF( lk_bias  ) THEN
+         IF( ln_bias     )   CALL tra_bias   ( kstp )
+      ENDIF
       IF( lk_bdy         )   CALL bdy_tra_dmp( kstp )       ! bdy damping trends
                              CALL tra_adv    ( kstp )       ! horizontal & vertical advection
@@ -279,4 +286,7 @@
                &                                           rhd, gru , grv , aru , arv , gzu , gzv , ge3ru , ge3rv ,   &
                &                                    gtui, gtvi, grui, grvi, arui, arvi, gzui, gzvi, ge3rui, ge3rvi    ) ! of t, s, rd at the last ocean level
+            IF( lk_bias  ) THEN
+               IF( ln_bias ) CALL dyn_bias( kstp )
+            ENDIF
       ELSE                                                  ! centered hpg  (eos then time stepping)
          IF ( .NOT. lk_dynspg_ts ) THEN                     ! eos already called in time-split case
@@ -293,4 +303,7 @@
          IF( ln_zdfnpc   )   CALL tra_npc( kstp )                ! update after fields by non-penetrative convection
                              CALL tra_nxt( kstp )                ! tracer fields at next time step
+         IF( lk_bias  ) THEN
+            IF( ln_bias ) CALL dyn_bias( kstp )
+         ENDIF
       ENDIF
 
@@ -353,4 +366,7 @@
       ENDIF
       IF( lrst_oce         )   CALL rst_write    ( kstp )   ! write output ocean restart file
+      IF( lk_bias  ) THEN
+         IF( lrst_bias )       CALL bias_wrt     ( kstp )
+      ENDIF
 
       !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Index: branches/UKMO/dev_r5518_pcbias/NEMOGCM/NEMO/OPA_SRC/step_oce.F90
===================================================================
--- branches/UKMO/dev_r5518_pcbias/NEMOGCM/NEMO/OPA_SRC/step_oce.F90	(revision 6277)
+++ branches/UKMO/dev_r5518_pcbias/NEMOGCM/NEMO/OPA_SRC/step_oce.F90	(revision 6278)
@@ -99,5 +99,7 @@
 
    USE crsfld           ! Standard output on coarse grid   (crs_fld routine)
-
+   USE biaspar          ! bias param
+   USE bias             ! bias routines                    (tra_bias routine
+                        !                                   dyn_bias routine)
    USE asminc           ! assimilation increments      (tra_asm_inc routine)
    !                                                   (dyn_asm_inc routine)
