Index: /branches/UKMO/dev_r5518_fa_am_dt_deltadelta_toa/NEMOGCM/NEMO/OPA_SRC/SBC/sbcflx_adj.F90
===================================================================
--- /branches/UKMO/dev_r5518_fa_am_dt_deltadelta_toa/NEMOGCM/NEMO/OPA_SRC/SBC/sbcflx_adj.F90	(revision 7168)
+++ /branches/UKMO/dev_r5518_fa_am_dt_deltadelta_toa/NEMOGCM/NEMO/OPA_SRC/SBC/sbcflx_adj.F90	(revision 7169)
@@ -32,10 +32,11 @@
    PUBLIC   sbc_flx_adj_init   ! routine called in sbcmod
 
+   !ky 01/11/2016 uncommented below two lines for test
    !ky 16/10/2016 commented out below two lines
    !ky 06/09/2016 uncommented below two lines for FA test
    !ky 11/12/2015 recommented below two lines
    !!ky 3/12/2015 uncommented below two lines for FA test!
-   !REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   erp   !: evaporation damping   [kg/m2/s]
-   !REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   qrp   !: heat flux damping        [w/m2]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   erp   !: evaporation damping   [kg/m2/s]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   qrp   !: heat flux damping        [w/m2]
 
    !                                   !!* Namelist namsbc_flx_adj *
@@ -106,6 +107,9 @@
                      ! K.Y. 16/03/2016 Apply Arctic mask to heat flux adjustment
                      zqrp = ( 1. - 2.*only_arcmsk(ji,jj) )  &
-                        &        * sf_qrp(1)%fnow(ji,jj,1)  &
-                        &        + delta_toa + delta_delta_toa
+                        &        * (sf_qrp(1)%fnow(ji,jj,1)  &
+                        &        + delta_toa + delta_delta_toa)
+                     !   &        * sf_qrp(1)%fnow(ji,jj,1)  &
+                     !   &        + delta_toa + delta_delta_toa
+                     ! K.Y. 02/11/2016 recoded two lines above to only add delta_toas to FA regions
                      ! K.Y. 16/10/2016 added "&" to 2 lines above and 
                      !   delta_toa, delta_delta_toa to above line
@@ -117,13 +121,17 @@
                      !ky 07/09/2016 copied 1 line above and modified as below for FA test
                      !ky 16/10/2016 commented out 1 line below
-                     !qrp(ji,jj) = zqrp
+                     !ky 01/11/2016 uncommented 1 line below for test
+                     qrp(ji,jj) = zqrp
                      qns(ji,jj) = qns(ji,jj) + zqrp
                   END DO
                END DO
+               !ky 01/11/2016 uncommented 1 line below for test
                !ky 16/10/2016 commented out below 1 line below
                !ky 06/09/2016 uncommented below 1 line below for FA test!
                !ky 11/12/2015 recommented out below 1 line below
                !!ky 3/12/2015 uncommented below 1 line below for FA test!
-               !CALL iom_put( "qrp", qrp )                             ! heat flux damping
+               CALL iom_put( "qrp", qrp )                             ! heat flux damping
+               !ky 01/11/2016 added 1 line below for test
+               CALL iom_put( "only_arcmsk", only_arcmsk )                             ! arctic mask
             ENDIF
             !
@@ -142,16 +150,20 @@
                      !!ky 3/12/2015 1 line below for FA test!
                      !erp(ji,jj) = sf_erp(1)%fnow(ji,jj,1)
+                     !ky 01/11/2016 uncommented two lines below for test. erp is freshwater flux.
                      !ky 16/10/2016 commented out below two lines
                      !ky 06/09/2016 copied line above and changed to below two lines for FA test!
-                     !erp(ji,jj) = ( 1. - 2.*rnfmsk_arcmsk(ji,jj) )  &        ! No damping in vicinity of river mouths
-                     !   &        * sf_erp(1)%fnow(ji,jj,1) 
+                     erp(ji,jj) = ( 1. - 2.*rnfmsk_arcmsk(ji,jj) )  &        ! No damping in vicinity of river mouths
+                        &        * sf_erp(1)%fnow(ji,jj,1) 
                      sfx(ji,jj) = sfx(ji,jj) + zerp                 ! salt flux
                   END DO
                END DO
+               !ky 01/11/2016 uncommented below one line for test
                !ky 16/10/2016 commented out below one line
                !ky 06/09/2016 uncommented below one line for FA test!
                !ky 11/12/2015 recommented out below one line
                !!ky 3/12/2015 uncommented below one line for FA test!
-               !CALL iom_put( "erp", erp )                             ! freshwater flux damping
+               CALL iom_put( "erp", erp )                             ! freshwater flux damping
+               !ky 01/11/2016 added 1 line below for test
+               CALL iom_put( "rnfmsk_arcmsk", rnfmsk_arcmsk )                         ! river mough & arctic 
                !
             ELSEIF( nn_flxadjfw == 2 ) THEN                               !* Salinity damping term (volume flux (emp) and associated heat flux (qns)
@@ -167,15 +179,19 @@
                      !erp(ji,jj) = sf_erp(1)%fnow(ji,jj,1)
                      !ky 06/09/2016 copied line above and changed to below line for FA test!
+                     !ky 01/11/2016 uncommented below line for test
                      !ky 16/10/2016 commented out below line
-                     !erp(ji,jj) = zerp
+                     erp(ji,jj) = zerp
                      emp(ji,jj) = emp (ji,jj) + zerp
                      qns(ji,jj) = qns(ji,jj) - zerp * rcp * sst_m(ji,jj)
                   END DO
                END DO
+               !ky 01/11/2016 uncommented below 1 line for test
                !ky 16/10/2016 commented out below 1 line
                !ky 06/09/2016 uncommented below 1 line for FA test!
                !ky 11/12/2015 recommented out below 1 line
                !!ky 3/12/2015 uncommented below 1 line for FA test!
-               !CALL iom_put( "erp", erp )                             ! freshwater flux damping
+               CALL iom_put( "erp", erp )                             ! freshwater flux damping
+               !ky 01/11/2016 added 1 line below for test
+               CALL iom_put( "rnfmsk_arcmsk", rnfmsk_arcmsk )                         ! river mough & arctic 
             ENDIF
             !
@@ -238,10 +254,11 @@
       !
       !                            !* Allocate erp and qrp array
+      !ky 01/11/2016 uncommented out below two lines for test
       !ky 16/10/2016 commented out below two lines
       !ky 06/09/2016 uncommented below two lines for FA test!
       !ky 11/12/2015 recommented out below two lines
       !!ky 3/12/2015 uncommented below two lines for FA test!
-      !ALLOCATE( qrp(jpi,jpj), erp(jpi,jpj), STAT=ierror )
-      !IF( ierror > 0 )   CALL ctl_stop( 'STOP', 'sbc_ssr: unable to allocate erp and qrp array' )
+      ALLOCATE( qrp(jpi,jpj), erp(jpi,jpj), STAT=ierror )
+      IF( ierror > 0 )   CALL ctl_stop( 'STOP', 'sbc_ssr: unable to allocate erp and qrp array' )
       !
       IF( nn_flxadjht == 1 ) THEN      !* set sf_qrp structure & allocate arrays
@@ -274,10 +291,11 @@
       !
       !ky!!                            !* Initialize qrp and erp if no restoring 
+      !ky 01/11/2016 uncommented below two lines for test
       !ky 16/10/2016 commented out below two lines
       !ky 06/09/2016 below two lines for FA test!
       !ky 11/12/2015 commented out below two lines
       !!ky 3/12/2015 below two lines for FA test!
-      !IF( nn_flxadjht /= 1                   )   qrp(:,:) = 0._wp
-      !IF( nn_flxadjfw /= 1 .OR. nn_flxadjfw /= 2 )   erp(:,:) = 0._wp
+      IF( nn_flxadjht /= 1                   )   qrp(:,:) = 0._wp
+      IF( nn_flxadjfw /= 1 .OR. nn_flxadjfw /= 2 )   erp(:,:) = 0._wp
       !!ky!!IF( nn_sstr /= 1                   )   qrp(:,:) = 0._wp
       !!ky!!IF( nn_sssr /= 1 .OR. nn_sssr /= 2 )   erp(:,:) = 0._wp
