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 8418 for branches/UKMO/dev_r5518_GO6_package_avgback/NEMOGCM/NEMO/OPA_SRC/ASM/asminc.F90 – NEMO

Ignore:
Timestamp:
2017-08-08T13:19:48+02:00 (7 years ago)
Author:
mattmartin
Message:

Updated branch of GO6 package branch to enable averaging the assimilation background file.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/UKMO/dev_r5518_GO6_package_avgback/NEMOGCM/NEMO/OPA_SRC/ASM/asminc.F90

    r8400 r8418  
    6161#endif 
    6262   LOGICAL, PUBLIC :: ln_bkgwri = .FALSE.      !: No output of the background state fields 
     63   LOGICAL, PUBLIC :: ln_avgbkg = .FALSE.      !: No output of the mean background state fields 
    6364   LOGICAL, PUBLIC :: ln_asmiau = .FALSE.      !: No applying forcing with an assimilation increment 
    6465   LOGICAL, PUBLIC :: ln_asmdin = .FALSE.      !: No direct initialization 
     
    8485   INTEGER , PUBLIC ::   nitiaustr   !: Time step of the start of the IAU interval  
    8586   INTEGER , PUBLIC ::   nitiaufin   !: Time step of the end of the IAU interval 
     87   INTEGER , PUBLIC ::   nitavgbkg   !: Number of timesteps to average assim bkg [0,nitavgbkg] 
    8688   !  
    8789   INTEGER , PUBLIC ::   niaufn      !: Type of IAU weighing function: = 0   Constant weighting 
     
    123125      INTEGER :: iitiaustr_date  ! Date YYYYMMDD of IAU interval start time step 
    124126      INTEGER :: iitiaufin_date  ! Date YYYYMMDD of IAU interval final time step 
     127      INTEGER :: iitavgbkg_date  ! Date YYYYMMDD of end of assim bkg averaging period 
    125128      ! 
    126129      REAL(wp) :: znorm        ! Normalization factor for IAU weights 
     
    133136      REAL(wp), POINTER, DIMENSION(:,:) ::   hdiv   ! 2D workspace 
    134137      !! 
    135       NAMELIST/nam_asminc/ ln_bkgwri,                                      & 
     138      NAMELIST/nam_asminc/ ln_bkgwri, ln_avgbkg,                           & 
    136139         &                 ln_trainc, ln_dyninc, ln_sshinc,                & 
    137140         &                 ln_asmdin, ln_asmiau,                           & 
    138141         &                 nitbkg, nitdin, nitiaustr, nitiaufin, niaufn,   & 
    139142         &                 ln_salfix, salfixmin, nn_divdmp,                & 
    140          &                 ln_seaiceinc, ln_temnofreeze 
     143         &                 ln_seaiceinc, ln_temnofreeze, nitavgbkg 
    141144      !!---------------------------------------------------------------------- 
    142145 
     
    163166         WRITE(numout,*) '   Namelist namasm : set assimilation increment parameters' 
    164167         WRITE(numout,*) '      Logical switch for writing out background state          ln_bkgwri = ', ln_bkgwri 
     168         WRITE(numout,*) '      Logical switch for writing mean background state         ln_avgbkg = ', ln_avgbkg 
    165169         WRITE(numout,*) '      Logical switch for applying tracer increments            ln_trainc = ', ln_trainc 
    166170         WRITE(numout,*) '      Logical switch for applying velocity increments          ln_dyninc = ', ln_dyninc 
     
    173177         WRITE(numout,*) '      Timestep of start of IAU interval in [0,nitend-nit000-1] nitiaustr = ', nitiaustr 
    174178         WRITE(numout,*) '      Timestep of end of IAU interval in [0,nitend-nit000-1]   nitiaufin = ', nitiaufin 
     179         WRITE(numout,*) '      Number of timesteps to average assim bkg [0,nitavgbkg]   nitavgbkg = ', nitavgbkg 
    175180         WRITE(numout,*) '      Type of IAU weighting function                           niaufn    = ', niaufn 
    176181         WRITE(numout,*) '      Logical switch for ensuring that the sa > salfixmin      ln_salfix = ', ln_salfix 
     
    182187      nitiaustr_r = nitiaustr + nit000 - 1  ! Start of IAU interval referenced to nit000 
    183188      nitiaufin_r = nitiaufin + nit000 - 1  ! End of IAU interval referenced to nit000 
     189      nitavgbkg_r = nitavgbkg + nit000 - 1  ! Averaging period referenced to nit000 
    184190 
    185191      iiauper = nitiaufin_r - nitiaustr_r + 1  ! IAU interval length 
     
    191197      CALL calc_date( nit000, nitiaustr_r, ndate0, iitiaustr_date )     ! IAU start time referenced to ndate0 
    192198      CALL calc_date( nit000, nitiaufin_r, ndate0, iitiaufin_date )     ! IAU end time referenced to ndate0 
     199      CALL calc_date( nit000, nitavgbkg_r, ndate0, iitavgbkg_date )     ! End of assim bkg averaging period referenced to ndate0 
    193200      ! 
    194201      IF(lwp) THEN 
     
    202209         WRITE(numout,*) '       nitiaustr_r = ', nitiaustr_r 
    203210         WRITE(numout,*) '       nitiaufin_r = ', nitiaufin_r 
     211         WRITE(numout,*) '       nitavgbkg_r = ', nitavgbkg_r 
    204212         WRITE(numout,*) 
    205213         WRITE(numout,*) '   Dates referenced to current cycle:' 
     
    211219         WRITE(numout,*) '       iitiaustr_date = ', iitiaustr_date 
    212220         WRITE(numout,*) '       iitiaufin_date = ', iitiaufin_date 
     221         WRITE(numout,*) '       iitavgbkg_date = ', iitavgbkg_date 
    213222      ENDIF 
    214223 
     
    253262         & CALL ctl_stop( ' nitdin :',  & 
    254263         &                ' Background time step for Direct Initialization is outside', & 
     264         &                ' the cycle interval') 
     265 
     266      IF ( nitavgbkg_r > nitend ) & 
     267         & CALL ctl_stop( ' nitavgbkg_r :',  & 
     268         &                ' Assim bkg averaging period is outside', & 
    255269         &                ' the cycle interval') 
    256270 
Note: See TracChangeset for help on using the changeset viewer.