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

Ignore:
Timestamp:
2018-01-04T15:19:26+01:00 (6 years ago)
Author:
kingr
Message:

Adding changes required to write out time-averaged assimilation background.

File:
1 edited

Legend:

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

    r8058 r9180  
    5757#endif 
    5858   LOGICAL, PUBLIC :: ln_bkgwri = .FALSE.      !: No output of the background state fields 
     59   LOGICAL, PUBLIC :: ln_avgbkg = .FALSE.      !: No output of the mean background state fields 
    5960   LOGICAL, PUBLIC :: ln_asmiau = .FALSE.      !: No applying forcing with an assimilation increment 
    6061   LOGICAL, PUBLIC :: ln_asmdin = .FALSE.      !: No direct initialization 
     
    8081   INTEGER , PUBLIC ::   nitiaustr   !: Time step of the start of the IAU interval  
    8182   INTEGER , PUBLIC ::   nitiaufin   !: Time step of the end of the IAU interval 
     83   INTEGER , PUBLIC ::   nitavgbkg   !: Number of timesteps to average assim bkg [0,nitavgbkg] 
    8284   !  
    8385   INTEGER , PUBLIC ::   niaufn      !: Type of IAU weighing function: = 0   Constant weighting 
     
    119121      INTEGER :: iitiaustr_date  ! Date YYYYMMDD of IAU interval start time step 
    120122      INTEGER :: iitiaufin_date  ! Date YYYYMMDD of IAU interval final time step 
     123      INTEGER :: iitavgbkg_date  ! Date YYYYMMDD of end of assim bkg averaging period 
    121124      ! 
    122125      REAL(wp) :: znorm        ! Normalization factor for IAU weights 
     
    129132      REAL(wp), POINTER, DIMENSION(:,:) ::   hdiv   ! 2D workspace 
    130133      !! 
    131       NAMELIST/nam_asminc/ ln_bkgwri,                                      & 
     134      NAMELIST/nam_asminc/ ln_bkgwri, ln_avgbkg,                           & 
    132135         &                 ln_trainc, ln_dyninc, ln_sshinc,                & 
    133136         &                 ln_asmdin, ln_asmiau,                           & 
    134137         &                 nitbkg, nitdin, nitiaustr, nitiaufin, niaufn,   & 
    135          &                 ln_salfix, salfixmin, nn_divdmp 
     138         &                 ln_salfix, salfixmin, nn_divdmp, nitavgbkg 
    136139      !!---------------------------------------------------------------------- 
    137140 
     
    139142      ! Read Namelist nam_asminc : assimilation increment interface 
    140143      !----------------------------------------------------------------------- 
     144 
     145      ! Set default values 
     146      ln_bkgwri = .FALSE. 
     147      ln_avgbkg = .FALSE. 
     148      ln_trainc = .FALSE. 
     149      ln_dyninc = .FALSE. 
     150      ln_sshinc = .FALSE. 
    141151      ln_seaiceinc = .FALSE. 
     152      ln_asmdin = .FALSE. 
     153      ln_asmiau = .TRUE. 
     154      ln_salfix = .FALSE. 
    142155      ln_temnofreeze = .FALSE. 
     156      salfixmin = -9999 
     157      nitbkg    = 0 
     158      nitdin    = 0       
     159      nitiaustr = 1 
     160      nitiaufin = 150 
     161      niaufn    = 0 
     162      nitavgbkg = 1 
    143163 
    144164      REWIND( numnam_ref )              ! Namelist nam_asminc in reference namelist : Assimilation increment 
     
    158178         WRITE(numout,*) '   Namelist namasm : set assimilation increment parameters' 
    159179         WRITE(numout,*) '      Logical switch for writing out background state          ln_bkgwri = ', ln_bkgwri 
     180         WRITE(numout,*) '      Logical switch for writing mean background state         ln_avgbkg = ', ln_avgbkg 
    160181         WRITE(numout,*) '      Logical switch for applying tracer increments            ln_trainc = ', ln_trainc 
    161182         WRITE(numout,*) '      Logical switch for applying velocity increments          ln_dyninc = ', ln_dyninc 
     
    168189         WRITE(numout,*) '      Timestep of start of IAU interval in [0,nitend-nit000-1] nitiaustr = ', nitiaustr 
    169190         WRITE(numout,*) '      Timestep of end of IAU interval in [0,nitend-nit000-1]   nitiaufin = ', nitiaufin 
     191         WRITE(numout,*) '      Number of timesteps to average assim bkg [0,nitavgbkg]   nitavgbkg = ', nitavgbkg 
    170192         WRITE(numout,*) '      Type of IAU weighting function                           niaufn    = ', niaufn 
    171193         WRITE(numout,*) '      Logical switch for ensuring that the sa > salfixmin      ln_salfix = ', ln_salfix 
     
    177199      nitiaustr_r = nitiaustr + nit000 - 1  ! Start of IAU interval referenced to nit000 
    178200      nitiaufin_r = nitiaufin + nit000 - 1  ! End of IAU interval referenced to nit000 
     201      nitavgbkg_r = nitavgbkg + nit000 - 1  ! Averaging period referenced to nit000 
    179202 
    180203      iiauper = nitiaufin_r - nitiaustr_r + 1  ! IAU interval length 
     
    186209      CALL calc_date( nit000, nitiaustr_r, ndate0, iitiaustr_date )     ! IAU start time referenced to ndate0 
    187210      CALL calc_date( nit000, nitiaufin_r, ndate0, iitiaufin_date )     ! IAU end time referenced to ndate0 
     211      CALL calc_date( nit000, nitavgbkg_r, ndate0, iitavgbkg_date )     ! End of assim bkg averaging period referenced to ndate0 
    188212      ! 
    189213      IF(lwp) THEN 
     
    197221         WRITE(numout,*) '       nitiaustr_r = ', nitiaustr_r 
    198222         WRITE(numout,*) '       nitiaufin_r = ', nitiaufin_r 
     223         WRITE(numout,*) '       nitavgbkg_r = ', nitavgbkg_r 
    199224         WRITE(numout,*) 
    200225         WRITE(numout,*) '   Dates referenced to current cycle:' 
     
    206231         WRITE(numout,*) '       iitiaustr_date = ', iitiaustr_date 
    207232         WRITE(numout,*) '       iitiaufin_date = ', iitiaufin_date 
     233         WRITE(numout,*) '       iitavgbkg_date = ', iitavgbkg_date 
    208234      ENDIF 
    209235 
     
    248274         & CALL ctl_stop( ' nitdin :',  & 
    249275         &                ' Background time step for Direct Initialization is outside', & 
     276         &                ' the cycle interval') 
     277 
     278      IF ( nitavgbkg_r > nitend ) & 
     279         & CALL ctl_stop( ' nitavgbkg_r :',  & 
     280         &                ' Assim bkg averaging period is outside', & 
    250281         &                ' the cycle interval') 
    251282 
Note: See TracChangeset for help on using the changeset viewer.