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 15183 for NEMO/branches/UKMO/NEMO_4.0.4_CO9_OBS_ASM/src/OCE/ASM/asminc.F90 – NEMO

Ignore:
Timestamp:
2021-08-12T15:18:46+02:00 (3 years ago)
Author:
kingr
Message:

Adding changes required to write out time-averaged assimilation background. Required moving call to asm_bkg_wri from asminc.F90 to nemogcm.F90 to avoid circular USE statements.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/UKMO/NEMO_4.0.4_CO9_OBS_ASM/src/OCE/ASM/asminc.F90

    r14075 r15183  
    3131   USE zpshde          ! Partial step : Horizontal Derivative 
    3232   USE asmpar          ! Parameters for the assmilation interface 
    33    USE asmbkg          !  
    3433   USE c1d             ! 1D initialization 
    3534   USE sbc_oce         ! Surface boundary condition variables. 
     
    5958#endif 
    6059   LOGICAL, PUBLIC :: ln_bkgwri     !: No output of the background state fields 
     60   LOGICAL, PUBLIC :: ln_avgbkg     !: No output of the mean background state fields 
    6161   LOGICAL, PUBLIC :: ln_asmiau     !: No applying forcing with an assimilation increment 
    6262   LOGICAL, PUBLIC :: ln_asmdin     !: No direct initialization 
     
    8282   INTEGER , PUBLIC ::   nitiaustr   !: Time step of the start of the IAU interval  
    8383   INTEGER , PUBLIC ::   nitiaufin   !: Time step of the end of the IAU interval 
     84   INTEGER , PUBLIC ::   nitavgbkg   !: Number of timesteps to average assim bkg [0,nitavgbkg] 
    8485   !  
    8586   INTEGER , PUBLIC ::   niaufn      !: Type of IAU weighing function: = 0   Constant weighting 
     
    122123      REAL(KIND=dp) :: ditiaustr_date  ! Date YYYYMMDD.HHMMSS of IAU interval start time step 
    123124      REAL(KIND=dp) :: ditiaufin_date  ! Date YYYYMMDD.HHMMSS of IAU interval final time step 
     125      REAL(KIND=dp) :: ditavgbkg_date  ! Date YYYYMMDD.HHMMSS of end of assim bkg averaging period 
    124126 
    125127      REAL(wp) :: znorm        ! Normalization factor for IAU weights 
     
    132134      REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   zhdiv   ! 2D workspace 
    133135      !! 
    134       NAMELIST/nam_asminc/ ln_bkgwri,                                      & 
     136      NAMELIST/nam_asminc/ ln_bkgwri, ln_avgbkg,                           & 
    135137         &                 ln_trainc, ln_dyninc, ln_sshinc,                & 
    136138         &                 ln_asmdin, ln_asmiau,                           & 
    137139         &                 nitbkg, nitdin, nitiaustr, nitiaufin, niaufn,   & 
    138          &                 ln_salfix, salfixmin, nn_divdmp 
     140         &                 ln_salfix, salfixmin, nn_divdmp, nitavgbkg 
    139141      !!---------------------------------------------------------------------- 
    140142 
     
    142144      ! Read Namelist nam_asminc : assimilation increment interface 
    143145      !----------------------------------------------------------------------- 
    144       ln_seaiceinc   = .FALSE. 
     146      ! Set default values 
     147      ln_bkgwri = .FALSE. 
     148      ln_avgbkg = .FALSE. 
     149      ln_trainc = .FALSE. 
     150      ln_dyninc = .FALSE. 
     151      ln_sshinc = .FALSE. 
     152      ln_asmdin = .FALSE. 
     153      ln_asmiau = .TRUE. 
     154      ln_salfix = .FALSE. 
     155      ln_seaiceinc = .FALSE. 
    145156      ln_temnofreeze = .FALSE. 
     157      nitbkg    = 0 
     158      nitdin    = 0       
     159      nitiaustr = 1 
     160      nitiaufin = 150 
     161      niaufn    = 0 
     162      salfixmin = -9999 
     163      nitavgbkg = 1 
    146164 
    147165      REWIND( numnam_ref )              ! Namelist nam_asminc in reference namelist : Assimilation increment 
     
    160178         WRITE(numout,*) '   Namelist namasm : set assimilation increment parameters' 
    161179         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 
    162181         WRITE(numout,*) '      Logical switch for applying tracer increments            ln_trainc = ', ln_trainc 
    163182         WRITE(numout,*) '      Logical switch for applying velocity increments          ln_dyninc = ', ln_dyninc 
     
    170189         WRITE(numout,*) '      Timestep of start of IAU interval in [0,nitend-nit000-1] nitiaustr = ', nitiaustr 
    171190         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 
    172192         WRITE(numout,*) '      Type of IAU weighting function                           niaufn    = ', niaufn 
    173193         WRITE(numout,*) '      Logical switch for ensuring that the sa > salfixmin      ln_salfix = ', ln_salfix 
     
    179199      nitiaustr_r = nitiaustr + nit000 - 1            ! Start of IAU interval referenced to nit000 
    180200      nitiaufin_r = nitiaufin + nit000 - 1            ! End of IAU interval referenced to nit000 
     201      nitavgbkg_r = nitavgbkg + nit000 - 1            ! Averaging period referenced to nit000 
    181202 
    182203      iiauper     = nitiaufin_r - nitiaustr_r + 1     ! IAU interval length 
     
    188209      CALL calc_date( nitiaustr_r, ditiaustr_date )   ! IAU start time referenced to ndate0 
    189210      CALL calc_date( nitiaufin_r, ditiaufin_date )   ! IAU end time referenced to ndate0 
     211      CALL calc_date( nitavgbkg_r, ditavgbkg_date )   ! End of assim bkg averaging period referenced to ndate0 
    190212 
    191213      IF(lwp) THEN 
     
    199221         WRITE(numout,*) '       nitiaustr_r = ', nitiaustr_r 
    200222         WRITE(numout,*) '       nitiaufin_r = ', nitiaufin_r 
     223         WRITE(numout,*) '       nitavgbkg_r = ', nitavgbkg_r 
    201224         WRITE(numout,*) 
    202225         WRITE(numout,*) '   Dates referenced to current cycle:' 
     
    209232         WRITE(numout,*) '       ditiaustr_date = ', ditiaustr_date 
    210233         WRITE(numout,*) '       ditiaufin_date = ', ditiaufin_date 
     234         WRITE(numout,*) '       ditavgbkg_date = ', ditavgbkg_date 
    211235      ENDIF 
    212236 
     
    249273         &                ' the cycle interval') 
    250274 
     275      IF ( nitavgbkg_r > nitend ) & 
     276         & CALL ctl_stop( ' nitavgbkg_r :',  & 
     277         &                ' Assim bkg averaging period is outside', & 
     278         &                ' the cycle interval') 
     279       
    251280      IF ( nstop > 0 ) RETURN       ! if there are any errors then go no further 
    252281 
     
    494523      ! 
    495524      IF( lk_asminc ) THEN                            !==  data assimilation  ==! 
    496          IF( ln_bkgwri )   CALL asm_bkg_wri( nit000 - 1 )      ! Output background fields 
     525!         IF( ln_bkgwri )   CALL asm_bkg_wri( nit000 - 1 )      ! Output background fields 
    497526         IF( ln_asmdin ) THEN                                  ! Direct initialization 
    498527            IF( ln_trainc )   CALL tra_asm_inc( nit000 - 1 )      ! Tracers 
Note: See TracChangeset for help on using the changeset viewer.