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

Ignore:
Timestamp:
2016-06-30T15:45:10+02:00 (8 years ago)
Author:
kingr
Message:

Added code to asmbkg.F90 and asminc.F90 to allow writing of average fields (over namelist-specified window) into assimilation background file.

File:
1 edited

Legend:

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

    r6761 r6762  
    6969#endif 
    7070   LOGICAL, PUBLIC :: ln_bkgwri = .FALSE.      !: No output of the background state fields 
     71   LOGICAL, PUBLIC :: ln_avgbkg = .FALSE.      !: No output of the mean background state fields 
    7172   LOGICAL, PUBLIC :: ln_asmiau = .FALSE.      !: No applying forcing with an assimilation increment 
    7273   LOGICAL, PUBLIC :: ln_asmdin = .FALSE.      !: No direct initialization 
     
    9293   INTEGER , PUBLIC ::   nitiaustr   !: Time step of the start of the IAU interval  
    9394   INTEGER , PUBLIC ::   nitiaufin   !: Time step of the end of the IAU interval 
     95   INTEGER , PUBLIC ::   nitavgbkg   !: Number of timesteps to average assim bkg [0,nitavgbkg] 
    9496   !  
    9597   INTEGER , PUBLIC ::   niaufn      !: Type of IAU weighing function: = 0   Constant weighting 
     
    139141      INTEGER :: iitiaufin_date  ! Date YYYYMMDD of IAU interval final time step 
    140142      INTEGER :: isurfstat       ! Local integer for status of reading surft variable 
     143      INTEGER :: iitavgbkg_date  ! Date YYYYMMDD of end of assim bkg averaging period 
    141144      ! 
    142145      REAL(wp) :: znorm        ! Normalization factor for IAU weights 
     
    158161                               !               so only apply surft increments. 
    159162      !! 
    160       NAMELIST/nam_asminc/ ln_bkgwri,                                      & 
     163      NAMELIST/nam_asminc/ ln_bkgwri, ln_avgbkg                            & 
    161164         &                 ln_trainc, ln_dyninc, ln_sshinc,                & 
    162165         &                 ln_asmdin, ln_asmiau,                           & 
    163166         &                 nitbkg, nitdin, nitiaustr, nitiaufin, niaufn,   & 
    164          &                 ln_salfix, salfixmin, nn_divdmp, mld_choice 
     167         &                 ln_salfix, salfixmin, nn_divdmp, nitavgbkg, mld_choice 
    165168      !!---------------------------------------------------------------------- 
    166169 
     
    171174      ! Set default values 
    172175      ln_bkgwri = .FALSE. 
     176      ln_avgbkg = .FALSE. 
    173177      ln_trainc = .FALSE. 
    174178      ln_dyninc = .FALSE. 
     
    185189      nitiaufin = 150 
    186190      niaufn    = 0 
     191      nitavgbkg = 1 
    187192 
    188193      REWIND( numnam_ref )              ! Namelist nam_asminc in reference namelist : Assimilation increment 
     
    202207         WRITE(numout,*) '   Namelist namasm : set assimilation increment parameters' 
    203208         WRITE(numout,*) '      Logical switch for writing out background state          ln_bkgwri = ', ln_bkgwri 
     209         WRITE(numout,*) '      Logical switch for writing mean background state         ln_avgbkg = ', ln_avgbkg 
    204210         WRITE(numout,*) '      Logical switch for applying tracer increments            ln_trainc = ', ln_trainc 
    205211         WRITE(numout,*) '      Logical switch for applying velocity increments          ln_dyninc = ', ln_dyninc 
     
    212218         WRITE(numout,*) '      Timestep of start of IAU interval in [0,nitend-nit000-1] nitiaustr = ', nitiaustr 
    213219         WRITE(numout,*) '      Timestep of end of IAU interval in [0,nitend-nit000-1]   nitiaufin = ', nitiaufin 
     220         WRITE(numout,*) '      Number of timesteps to average assim bkg [0,nitavgbkg]   nitavgbkg = ', nitavgbkg 
    214221         WRITE(numout,*) '      Type of IAU weighting function                           niaufn    = ', niaufn 
    215222         WRITE(numout,*) '      Logical switch for ensuring that the sa > salfixmin      ln_salfix = ', ln_salfix 
     
    222229      nitiaustr_r = nitiaustr + nit000 - 1  ! Start of IAU interval referenced to nit000 
    223230      nitiaufin_r = nitiaufin + nit000 - 1  ! End of IAU interval referenced to nit000 
     231      nitavgbkg_r = nitavgbkg + nit000 - 1  ! Averaging period referenced to nit000 
    224232 
    225233      iiauper = nitiaufin_r - nitiaustr_r + 1  ! IAU interval length 
     
    231239      CALL calc_date( nit000, nitiaustr_r, ndate0, iitiaustr_date )     ! IAU start time referenced to ndate0 
    232240      CALL calc_date( nit000, nitiaufin_r, ndate0, iitiaufin_date )     ! IAU end time referenced to ndate0 
     241      CALL calc_date( nit000, nitavgbkg_r, ndate0, iitavgbkg_date )     ! End of assim bkg averaging period referenced to ndate0 
    233242      ! 
    234243      IF(lwp) THEN 
     
    242251         WRITE(numout,*) '       nitiaustr_r = ', nitiaustr_r 
    243252         WRITE(numout,*) '       nitiaufin_r = ', nitiaufin_r 
     253         WRITE(numout,*) '       nitavgbkg_r = ', nitavgbkg_r 
    244254         WRITE(numout,*) 
    245255         WRITE(numout,*) '   Dates referenced to current cycle:' 
     
    251261         WRITE(numout,*) '       iitiaustr_date = ', iitiaustr_date 
    252262         WRITE(numout,*) '       iitiaufin_date = ', iitiaufin_date 
     263         WRITE(numout,*) '       iitavgbkg_date = ', iitavgbkg_date 
    253264      ENDIF 
    254265 
     
    293304         & CALL ctl_stop( ' nitdin :',  & 
    294305         &                ' Background time step for Direct Initialization is outside', & 
     306         &                ' the cycle interval') 
     307 
     308      IF ( nitavgbkg_r > nitend ) & 
     309         & CALL ctl_stop( ' nitavgbkg_r :',  & 
     310         &                ' Assim bkg averaging period is outside', & 
    295311         &                ' the cycle interval') 
    296312 
Note: See TracChangeset for help on using the changeset viewer.