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 2207 for branches/DEV_r2191_3partymerge2010/NEMO/OPA_SRC/SBC/sbcfwb.F90 – NEMO

Ignore:
Timestamp:
2010-10-11T18:51:54+02:00 (13 years ago)
Author:
acc
Message:

#733 DEV_r2191_3partymerge2010. Merged in changes from devukmo2010 branch

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/DEV_r2191_3partymerge2010/NEMO/OPA_SRC/SBC/sbcfwb.F90

    r1822 r2207  
    3131   REAL(wp) ::   a_fwb_b            ! annual domain averaged freshwater budget 
    3232   REAL(wp) ::   a_fwb              ! for 2 year before (_b) and before year. 
    33    REAL(wp) ::   empold             ! empold to be suppressed 
     33   REAL(wp) ::   fwfold             ! fwfold to be suppressed 
    3434   REAL(wp) ::   area               ! global mean ocean surface (interior domain) 
    3535 
     
    6565      INTEGER  ::   inum                  ! temporary logical unit 
    6666      INTEGER  ::   ikty, iyear           !  
    67       REAL(wp) ::   z_emp, z_emp_nsrf, zsum_emp, zsum_erp       ! temporary scalars 
     67      REAL(wp) ::   z_fwf, z_fwf_nsrf, zsum_fwf, zsum_erp       ! temporary scalars 
    6868      REAL(wp) ::   zsurf_neg, zsurf_pos, zsurf_tospread 
    6969      REAL(wp), DIMENSION(jpi,jpj) ::   ztmsk_neg, ztmsk_pos, ztmsk_tospread 
     
    7979            IF( kn_fwb == 1 )   WRITE(numout,*) '          instantaneously set to zero' 
    8080            IF( kn_fwb == 2 )   WRITE(numout,*) '          adjusted from previous year budget' 
    81             IF( kn_fwb == 3 )   WRITE(numout,*) '          emp set to zero and spread out over erp area' 
     81            IF( kn_fwb == 3 )   WRITE(numout,*) '          fwf set to zero and spread out over erp area' 
    8282            ! 
    8383            IF( kn_fwb == 3 .AND. nn_sssr /= 2 )   & 
     
    101101          
    102102      ! 
    103       CASE ( 1 )                               ! global mean emp set to zero 
     103      CASE ( 1 )                               ! global mean fwf set to zero 
    104104         IF( MOD( kt-1, kn_fsbc ) == 0 ) THEN 
    105             z_emp = SUM( e1e2_i(:,:) * emp(:,:) ) / area 
    106             IF( lk_mpp )   CALL  mpp_sum( z_emp    )   ! sum over the global domain 
    107             emp (:,:) = emp (:,:) - z_emp 
    108             emps(:,:) = emps(:,:) - z_emp 
    109          ENDIF 
    110          ! 
    111       CASE ( 2 )                               ! emp budget adjusted from the previous year 
     105            z_fwf = SUM( e1e2_i(:,:) * ( emp(:,:)-rnf(:,:) ) ) / area  
     106            IF( lk_mpp )   CALL  mpp_sum( z_fwf    )   ! sum over the global domain  
     107            emp (:,:) = emp (:,:) - z_fwf  
     108            emps(:,:) = emps(:,:) - z_fwf  
     109         ENDIF 
     110         ! 
     111      CASE ( 2 )                               ! fwf budget adjusted from the previous year 
    112112         ! initialisation 
    113113         IF( kt == nit000 ) THEN 
    114             ! Read the corrective factor on precipitations (empold) 
     114            ! Read the corrective factor on precipitations (fwfold) 
    115115            CALL ctl_opn( inum, 'EMPave_old.dat', 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. ) 
    116116            READ ( inum, "(24X,I8,2ES24.16)" ) iyear, a_fwb_b, a_fwb 
    117117            CLOSE( inum ) 
    118             empold = a_fwb                  ! current year freshwater budget correction 
     118            fwfold = a_fwb                  ! current year freshwater budget correction 
    119119            !                               ! estimate from the previous year budget 
    120120            IF(lwp)WRITE(numout,*) 
    121             IF(lwp)WRITE(numout,*)'sbc_fwb : year = ',iyear  , ' freshwater budget correction = ', empold 
     121            IF(lwp)WRITE(numout,*)'sbc_fwb : year = ',iyear  , ' freshwater budget correction = ', fwfold 
    122122            IF(lwp)WRITE(numout,*)'          year = ',iyear-1, ' freshwater budget read       = ', a_fwb 
    123123            IF(lwp)WRITE(numout,*)'          year = ',iyear-2, ' freshwater budget read       = ', a_fwb_b 
    124124         ENDIF    
    125125         !  
    126          ! Update empold if new year start 
     126         ! Update fwfold if new year start 
    127127         ikty = 365 * 86400 / rdttra(1)    !!bug  use of 365 days leap year or 360d year !!!!!!! 
    128128         IF( MOD( kt, ikty ) == 0 ) THEN 
     
    132132            a_fwb   = a_fwb * 1.e+3 / ( area * 86400. * 365. )     ! convert in Kg/m3/s = mm/s 
    133133!!gm        !                                                      !!bug 365d year  
    134             empold =  a_fwb                 ! current year freshwater budget correction 
     134            fwfold =  a_fwb                 ! current year freshwater budget correction 
    135135            !                               ! estimate from the previous year budget 
    136136         ENDIF 
     
    138138         ! correct the freshwater fluxes 
    139139         IF( MOD( kt-1, kn_fsbc ) == 0 ) THEN 
    140             emp (:,:) = emp (:,:) + empold 
    141             emps(:,:) = emps(:,:) + empold 
    142          ENDIF 
    143          ! 
    144          ! save empold value in a file 
     140            emp (:,:) = emp (:,:) + fwfold 
     141            emps(:,:) = emps(:,:) + fwfold 
     142         ENDIF 
     143         ! 
     144         ! save fwfold value in a file 
    145145         IF( kt == nitend .AND. lwp ) THEN 
    146146            CALL ctl_opn( inum, 'EMPave.dat', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE., narea ) 
     
    149149         ENDIF 
    150150         ! 
    151       CASE ( 3 )                               ! global emp set to zero and spread out over erp area 
     151      CASE ( 3 )                               ! global fwf set to zero and spread out over erp area 
    152152         ! 
    153153         IF( MOD( kt-1, kn_fsbc ) == 0 ) THEN 
     
    161161            zsurf_pos = SUM( e1e2_i(:,:)*ztmsk_pos(:,:) ) 
    162162         
    163             ! emp global mean  
    164             z_emp = SUM( e1e2_i(:,:) * emp(:,:) ) / area 
     163            ! fwf global mean  
     164            z_fwf = SUM( e1e2_i(:,:) * ( emp(:,:)-rnf(:,:) ) ) / area  
    165165            ! 
    166             IF( lk_mpp )   CALL  mpp_sum( z_emp ) 
     166            IF( lk_mpp )   CALL  mpp_sum( z_fwf ) 
    167167            IF( lk_mpp )   CALL  mpp_sum( zsurf_neg ) 
    168168            IF( lk_mpp )   CALL  mpp_sum( zsurf_pos ) 
    169169             
    170             IF( z_emp < 0.e0 ) THEN 
     170            IF( z_fwf < 0.e0 ) THEN 
    171171                ! to spread out over >0 erp area to increase evaporation damping process 
    172172                zsurf_tospread = zsurf_pos 
     
    178178            ENDIF 
    179179 
    180             ! emp global mean over <0 or >0 erp area 
    181             zsum_emp = SUM( e1e2_i(:,:) * z_emp ) 
    182             IF( lk_mpp )   CALL  mpp_sum( zsum_emp ) 
    183             z_emp_nsrf =  zsum_emp / ( zsurf_tospread + rsmall ) 
     180            ! fwf global mean over <0 or >0 erp area 
     181            zsum_fwf = SUM( e1e2_i(:,:) * z_fwf ) 
     182            IF( lk_mpp )   CALL  mpp_sum( zsum_fwf ) 
     183            z_fwf_nsrf =  zsum_fwf / ( zsurf_tospread + rsmall ) 
    184184            ! weight to respect erp field 2D structure  
    185185            zsum_erp = SUM( ztmsk_tospread(:,:) * erp(:,:) * e1e2_i(:,:) ) 
     
    188188 
    189189            ! final correction term to apply 
    190             zerp_cor(:,:) = -1. * z_emp_nsrf * zsurf_tospread * z_wgt(:,:) 
     190            zerp_cor(:,:) = -1. * z_fwf_nsrf * zsurf_tospread * z_wgt(:,:) 
    191191 
    192192            CALL lbc_lnk( zerp_cor, 'T', 1. ) 
     
    197197             
    198198            IF( nprint == 1 .AND. lwp ) THEN 
    199                IF( z_emp < 0.e0 ) THEN 
    200                   WRITE(numout,*)'       z_emp < 0' 
     199               IF( z_fwf < 0.e0 ) THEN 
     200                  WRITE(numout,*)'       z_fwf < 0' 
    201201                  WRITE(numout,*)'       SUM(erp+)        = ', SUM( ztmsk_tospread(:,:)*erp(:,:)*e1e2_i(:,:) )*1.e-3,' m3.s-1' 
    202202               ELSE 
    203                    WRITE(numout,*)'      z_emp >= 0' 
     203                   WRITE(numout,*)'      z_fwf >= 0' 
    204204                   WRITE(numout,*)'      SUM(erp-)        = ', SUM( ztmsk_tospread(:,:)*erp(:,:)*e1e2_i(:,:) )*1.e-3,' m3.s-1' 
    205205               ENDIF 
    206                WRITE(numout,*)'      SUM(empG)        = ', SUM( z_emp*e1e2_i(:,:) )*1.e-3,' m3.s-1' 
    207                WRITE(numout,*)'      z_emp            = ', z_emp      ,' mm.s-1' 
    208                WRITE(numout,*)'      z_emp_nsrf       = ', z_emp_nsrf ,' mm.s-1' 
     206               WRITE(numout,*)'      SUM(empG)        = ', SUM( z_fwf*e1e2_i(:,:) )*1.e-3,' m3.s-1' 
     207               WRITE(numout,*)'      z_fwf            = ', z_fwf      ,' mm.s-1' 
     208               WRITE(numout,*)'      z_fwf_nsrf       = ', z_fwf_nsrf ,' mm.s-1' 
    209209               WRITE(numout,*)'      MIN(zerp_cor)    = ', MINVAL(zerp_cor)  
    210210               WRITE(numout,*)'      MAX(zerp_cor)    = ', MAXVAL(zerp_cor)  
Note: See TracChangeset for help on using the changeset viewer.