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 5075 for branches/2014/dev_r4650_UKMO7_STARTHOUR/NEMOGCM/NEMO/OPA_SRC/ASM/asminc.F90 – NEMO

Ignore:
Timestamp:
2015-02-11T11:50:34+01:00 (9 years ago)
Author:
timgraham
Message:

Upgraded branch to current head of trunk (r5072) so it can be used with the trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2014/dev_r4650_UKMO7_STARTHOUR/NEMOGCM/NEMO/OPA_SRC/ASM/asminc.F90

    r4811 r5075  
    5656    LOGICAL, PUBLIC, PARAMETER :: lk_asminc = .FALSE.  !: No assimilation increments 
    5757#endif 
    58    LOGICAL, PUBLIC :: ln_bkgwri     !: No output of the background state fields 
    59    LOGICAL, PUBLIC :: ln_asmiau     !: No applying forcing with an assimilation increment 
    60    LOGICAL, PUBLIC :: ln_asmdin     !: No direct initialization 
    61    LOGICAL, PUBLIC :: ln_trainc     !: No tracer (T and S) assimilation increments 
    62    LOGICAL, PUBLIC :: ln_dyninc     !: No dynamics (u and v) assimilation increments 
    63    LOGICAL, PUBLIC :: ln_sshinc     !: No sea surface height assimilation increment 
    64    LOGICAL, PUBLIC :: ln_seaiceinc  !: No sea ice concentration increment 
    65    LOGICAL, PUBLIC :: ln_salfix     !: Apply minimum salinity check 
     58   LOGICAL, PUBLIC :: ln_bkgwri = .FALSE.      !: No output of the background state fields 
     59   LOGICAL, PUBLIC :: ln_asmiau = .FALSE.      !: No applying forcing with an assimilation increment 
     60   LOGICAL, PUBLIC :: ln_asmdin = .FALSE.      !: No direct initialization 
     61   LOGICAL, PUBLIC :: ln_trainc = .FALSE.      !: No tracer (T and S) assimilation increments 
     62   LOGICAL, PUBLIC :: ln_dyninc = .FALSE.      !: No dynamics (u and v) assimilation increments 
     63   LOGICAL, PUBLIC :: ln_sshinc = .FALSE.      !: No sea surface height assimilation increment 
     64   LOGICAL, PUBLIC :: ln_seaiceinc             !: No sea ice concentration increment 
     65   LOGICAL, PUBLIC :: ln_salfix = .FALSE.      !: Apply minimum salinity check 
    6666   LOGICAL, PUBLIC :: ln_temnofreeze = .FALSE. !: Don't allow the temperature to drop below freezing 
    67    INTEGER, PUBLIC :: nn_divdmp     !: Apply divergence damping filter nn_divdmp times 
     67   INTEGER, PUBLIC :: nn_divdmp                !: Apply divergence damping filter nn_divdmp times 
    6868 
    6969   REAL(wp), PUBLIC, DIMENSION(:,:,:), ALLOCATABLE ::   t_bkg   , s_bkg      !: Background temperature and salinity 
     
    109109      !! ** Action  :  
    110110      !!---------------------------------------------------------------------- 
    111       INTEGER :: ji, jj, jk 
    112       INTEGER :: jt 
    113       INTEGER :: imid 
    114       INTEGER :: inum 
     111      INTEGER :: ji, jj, jk, jt  ! dummy loop indices 
     112      INTEGER :: imid, inum      ! local integers 
     113      INTEGER :: ios             ! Local integer output status for namelist read 
    115114      INTEGER :: iiauper         ! Number of time steps in the IAU period 
    116115      INTEGER :: icycper         ! Number of time steps in the cycle 
    117       INTEGER :: ios             ! Local integer output status for namelist read 
    118  
    119116      REAL(KIND=dp) :: ditend_date     ! Date YYYYMMDD.HHMMSS of final time step 
    120117      REAL(KIND=dp) :: ditbkg_date     ! Date YYYYMMDD.HHMMSS of background time step for Jb term 
     
    124121 
    125122      REAL(wp) :: znorm        ! Normalization factor for IAU weights 
    126       REAL(wp) :: ztotwgt      ! Value of time-integrated IAU weights  
    127                                ! (should be equal to one) 
     123      REAL(wp) :: ztotwgt      ! Value of time-integrated IAU weights (should be equal to one) 
    128124      REAL(wp) :: z_inc_dateb  ! Start date of interval on which increment is valid 
    129125      REAL(wp) :: z_inc_datef  ! End date of interval on which increment is valid 
    130126      REAL(wp) :: zdate_bkg    ! Date in background state file for DI 
    131127      REAL(wp) :: zdate_inc    ! Time axis in increments file 
    132  
    133       REAL(wp), POINTER, DIMENSION(:,:) :: hdiv 
     128      ! 
     129      REAL(wp), POINTER, DIMENSION(:,:) ::   hdiv   ! 2D workspace 
    134130      !! 
    135131      NAMELIST/nam_asminc/ ln_bkgwri,                                      & 
     
    137133         &                 ln_asmdin, ln_asmiau,                           & 
    138134         &                 nitbkg, nitdin, nitiaustr, nitiaufin, niaufn,   & 
    139          &                 ln_salfix, salfixmin,                & 
    140          &                 nn_divdmp 
     135         &                 ln_salfix, salfixmin, nn_divdmp 
    141136      !!---------------------------------------------------------------------- 
    142137 
     
    144139      ! Read Namelist nam_asminc : assimilation increment interface 
    145140      !----------------------------------------------------------------------- 
    146  
    147141      ln_seaiceinc = .FALSE. 
    148142      ln_temnofreeze = .FALSE. 
     
    570564      ! used to prevent the applied increments taking the temperature below the local freezing point  
    571565 
    572       DO jk=1, jpkm1 
    573          fzptnz (:,:,jk) = tfreez( tsn(:,:,jk,jp_sal), fsdept(:,:,jk) ) 
    574       ENDDO 
     566      DO jk = 1, jpkm1 
     567         fzptnz(:,:,jk) = eos_fzp( tsn(:,:,jk,jp_sal), fsdept(:,:,jk) ) 
     568      END DO 
    575569 
    576570      IF ( ln_asmiau ) THEN 
     
    587581            IF(lwp) THEN 
    588582               WRITE(numout,*)  
    589                WRITE(numout,*) 'tra_asm_inc : Tracer IAU at time step = ', & 
    590                   &  kt,' with IAU weight = ', wgtiau(it) 
     583               WRITE(numout,*) 'tra_asm_inc : Tracer IAU at time step = ', kt,' with IAU weight = ', wgtiau(it) 
    591584               WRITE(numout,*) '~~~~~~~~~~~~' 
    592585            ENDIF 
     
    636629            IF (ln_temnofreeze) THEN 
    637630               ! Do not apply negative increments if the temperature will fall below freezing 
    638                WHERE(t_bkginc(:,:,:) > 0.0_wp .OR. & 
    639                   &   tsn(:,:,:,jp_tem) + t_bkginc(:,:,:) > fzptnz(:,:,:) )  
     631               WHERE( t_bkginc(:,:,:) > 0.0_wp .OR. tsn(:,:,:,jp_tem) + t_bkginc(:,:,:) > fzptnz(:,:,:) )  
    640632                  tsn(:,:,:,jp_tem) = t_bkg(:,:,:) + t_bkginc(:,:,:)    
    641633               END WHERE 
     
    646638               ! Do not apply negative increments if the salinity will fall below a specified 
    647639               ! minimum value salfixmin 
    648                WHERE(s_bkginc(:,:,:) > 0.0_wp .OR. & 
    649                   &   tsn(:,:,:,jp_sal) + s_bkginc(:,:,:) > salfixmin )  
     640               WHERE( s_bkginc(:,:,:) > 0.0_wp .OR. tsn(:,:,:,jp_sal) + s_bkginc(:,:,:) > salfixmin )  
    650641                  tsn(:,:,:,jp_sal) = s_bkg(:,:,:) + s_bkginc(:,:,:)    
    651642               END WHERE 
     
    654645            ENDIF 
    655646 
    656             tsb(:,:,:,:) = tsn(:,:,:,:)               ! Update before fields 
    657  
    658             CALL eos( tsb, rhd, rhop, gdept_0(:,:,:) )                ! Before potential and in situ densities 
    659           
     647            tsb(:,:,:,:) = tsn(:,:,:,:)                 ! Update before fields 
     648 
     649            CALL eos( tsb, rhd, rhop, gdept_0(:,:,:) )  ! Before potential and in situ densities 
     650!!gm  fabien 
     651!            CALL eos( tsb, rhd, rhop )                ! Before potential and in situ densities 
     652!!gm 
     653 
     654 
    660655            IF( ln_zps .AND. .NOT. lk_c1d ) & 
    661                &  CALL zps_hde( nit000, jpts, tsb, &  ! Partial steps: before horizontal derivative 
    662                &                gtsu, gtsv, rhd,   &  ! of T, S, rd at the bottom ocean level 
    663                &                gru , grv ) 
     656               &  CALL zps_hde( nit000, jpts, tsb, gtsu, gtsv,  &        ! Partial steps: before horizontal gradient 
     657               &                rhd, gru , grv, aru, arv, gzu, gzv, ge3ru, ge3rv,  &             ! 
     658               &                gtui, gtvi, grui, grvi, arui, arvi, gzui, gzvi, ge3rui, ge3rvi  )  ! of t, s, rd at the last ocean level 
    664659 
    665660#if defined key_zdfkpp 
    666661            CALL eos( tsn, rhd, fsdept_n(:,:,:) )                      ! Compute rhd 
     662!!gm fabien            CALL eos( tsn, rhd )                      ! Compute rhd 
    667663#endif 
    668664 
Note: See TracChangeset for help on using the changeset viewer.