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

Ignore:
Timestamp:
2019-01-24T16:48:24+01:00 (5 years ago)
Author:
dford
Message:

Merge in functionality added to GO6 at r10149.

File:
1 edited

Legend:

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

    r9537 r10574  
    5252   USE bdy_oce, ONLY: bdytmask   
    5353#endif   
     54   USE asmbgc           ! Biogeochemistry assimilation 
    5455 
    5556   IMPLICIT NONE 
     
    6263   PUBLIC   ssh_asm_inc    !: Apply the SSH increment 
    6364   PUBLIC   seaice_asm_inc !: Apply the seaice increment 
     65   PUBLIC   bgc_asm_inc    !: Apply the biogeochemistry increments 
    6466 
    6567#if defined key_asminc 
     
    7678   LOGICAL, PUBLIC :: ln_sshinc = .FALSE.      !: No sea surface height assimilation increment 
    7779   LOGICAL, PUBLIC :: ln_seaiceinc             !: No sea ice concentration increment 
     80   LOGICAL, PUBLIC :: lk_bgcinc = .FALSE.      !: No biogeochemistry increments 
    7881   LOGICAL, PUBLIC :: ln_salfix = .FALSE.      !: Apply minimum salinity check 
    7982   LOGICAL, PUBLIC :: ln_temnofreeze = .FALSE. !: Don't allow the temperature to drop below freezing 
     
    161164                               !               so only apply surft increments. 
    162165      !! 
    163       NAMELIST/nam_asminc/ ln_bkgwri, ln_avgbkg,                           & 
     166      NAMELIST/nam_asminc/ ln_bkgwri, ln_avgbkg, ln_balwri,                & 
    164167         &                 ln_trainc, ln_dyninc, ln_sshinc,                & 
     168         &                 ln_phytobal, ln_slchltotinc, ln_slchldiainc,    & 
     169         &                 ln_slchlnoninc, ln_schltotinc, ln_slphytotinc,  & 
     170         &                 ln_slphydiainc, ln_slphynoninc, ln_spco2inc,    & 
     171         &                 ln_sfco2inc, ln_plchltotinc, ln_pchltotinc,     & 
     172         &                 ln_pno3inc, ln_psi4inc, ln_pdicinc, ln_palkinc, & 
     173         &                 ln_pphinc, ln_po2inc,                           & 
    165174         &                 ln_asmdin, ln_asmiau,                           & 
    166175         &                 nitbkg, nitdin, nitiaustr, nitiaufin, niaufn,   & 
    167          &                 ln_salfix, salfixmin, nn_divdmp, nitavgbkg, mld_choice 
     176         &                 ln_salfix, salfixmin, nn_divdmp, nitavgbkg,     & 
     177         &                 mld_choice, mld_choice_bgc, rn_maxchlinc 
    168178      !!---------------------------------------------------------------------- 
    169179 
     
    205215         WRITE(numout,*) 'asm_inc_init : Assimilation increment initialization :' 
    206216         WRITE(numout,*) '~~~~~~~~~~~~' 
    207          WRITE(numout,*) '   Namelist namasm : set assimilation increment parameters' 
     217         WRITE(numout,*) '   Namelist nam_asminc : set assimilation increment parameters' 
    208218         WRITE(numout,*) '      Logical switch for writing out background state          ln_bkgwri = ', ln_bkgwri 
    209219         WRITE(numout,*) '      Logical switch for writing mean background state         ln_avgbkg = ', ln_avgbkg 
     220         WRITE(numout,*) '      Logical switch for writing out balancing increments      ln_balwri = ', ln_balwri 
    210221         WRITE(numout,*) '      Logical switch for applying tracer increments            ln_trainc = ', ln_trainc 
    211222         WRITE(numout,*) '      Logical switch for applying velocity increments          ln_dyninc = ', ln_dyninc 
     
    213224         WRITE(numout,*) '      Logical switch for Direct Initialization (DI)            ln_asmdin = ', ln_asmdin 
    214225         WRITE(numout,*) '      Logical switch for applying sea ice increments        ln_seaiceinc = ', ln_seaiceinc 
     226         WRITE(numout,*) '      Logical switch for phytoplankton balancing             ln_phytobal = ', ln_phytobal 
     227         WRITE(numout,*) '      Logical switch for applying slchltot increments     ln_slchltotinc = ', ln_slchltotinc 
     228         WRITE(numout,*) '      Logical switch for applying slchldia increments     ln_slchldiainc = ', ln_slchldiainc 
     229         WRITE(numout,*) '      Logical switch for applying slchlnon increments     ln_slchlnoninc = ', ln_slchlnoninc 
     230         WRITE(numout,*) '      Logical switch for applying schltot increments       ln_schltotinc = ', ln_schltotinc 
     231         WRITE(numout,*) '      Logical switch for applying slphytot increments     ln_slphytotinc = ', ln_slphytotinc 
     232         WRITE(numout,*) '      Logical switch for applying slphydia increments     ln_slphydiainc = ', ln_slphydiainc 
     233         WRITE(numout,*) '      Logical switch for applying slphynon increments     ln_slphynoninc = ', ln_slphynoninc 
     234         WRITE(numout,*) '      Logical switch for applying spco2 increments           ln_spco2inc = ', ln_spco2inc 
     235         WRITE(numout,*) '      Logical switch for applying sfco2 increments           ln_sfco2inc = ', ln_sfco2inc 
     236         WRITE(numout,*) '      Logical switch for applying plchltot increments     ln_plchltotinc = ', ln_plchltotinc 
     237         WRITE(numout,*) '      Logical switch for applying pchltot increments       ln_pchltotinc = ', ln_pchltotinc 
     238         WRITE(numout,*) '      Logical switch for applying pno3 increments             ln_pno3inc = ', ln_pno3inc 
     239         WRITE(numout,*) '      Logical switch for applying psi4 increments             ln_psi4inc = ', ln_psi4inc 
     240         WRITE(numout,*) '      Logical switch for applying pdic increments             ln_pdicinc = ', ln_pdicinc 
     241         WRITE(numout,*) '      Logical switch for applying palk increments             ln_palkinc = ', ln_palkinc 
     242         WRITE(numout,*) '      Logical switch for applying pph increments               ln_pphinc = ', ln_pphinc 
     243         WRITE(numout,*) '      Logical switch for applying po2 increments               ln_po2inc = ', ln_po2inc 
    215244         WRITE(numout,*) '      Logical switch for Incremental Analysis Updating (IAU)   ln_asmiau = ', ln_asmiau 
    216245         WRITE(numout,*) '      Timestep of background in [0,nitend-nit000-1]            nitbkg    = ', nitbkg 
     
    223252         WRITE(numout,*) '      Minimum salinity after applying the increments           salfixmin = ', salfixmin 
    224253         WRITE(numout,*) '      Choice of MLD for physics assimilation                  mld_choice = ', mld_choice 
     254         WRITE(numout,*) '      Choice of MLD for BGC assimilation                  mld_choice_bgc = ', mld_choice_bgc 
     255         WRITE(numout,*) '      Maximum absolute chlorophyll increment (<=0 = off)    rn_maxchlinc = ', rn_maxchlinc 
    225256      ENDIF 
    226257 
     
    263294         WRITE(numout,*) '       iitavgbkg_date = ', iitavgbkg_date 
    264295      ENDIF 
     296      IF ( ln_slchltotinc .OR. ln_slchldiainc .OR. ln_slchlnoninc .OR. & 
     297         & ln_schltotinc  .OR. ln_slphytotinc .OR. ln_slphydiainc .OR. & 
     298         & ln_slphynoninc .OR. ln_spco2inc    .OR. ln_sfco2inc    .OR. & 
     299         & ln_plchltotinc .OR. ln_pchltotinc  .OR. ln_pno3inc     .OR. & 
     300         & ln_psi4inc     .OR. ln_pdicinc     .OR. ln_palkinc     .OR. & 
     301         & ln_pphinc      .OR. ln_po2inc ) THEN 
     302         lk_bgcinc = .TRUE. 
     303      ENDIF 
    265304 
    266305      IF ( nacc /= 0 ) & 
     
    274313 
    275314      IF (      ( ( .NOT. ln_asmdin ).AND.( .NOT. ln_asmiau ) ) & 
    276            .AND.( ( ln_trainc ).OR.( ln_dyninc ).OR.( ln_sshinc ) .OR. ( ln_seaiceinc) )) & 
    277          & CALL ctl_stop( ' One or more of ln_trainc, ln_dyninc, ln_sshinc and ln_seaiceinc is set to .true.', & 
     315         & .AND.( ( ln_trainc ).OR.( ln_dyninc ).OR.( ln_sshinc ).OR.( ln_seaiceinc ).OR. & 
     316         &        ( lk_bgcinc ) )) & 
     317         & CALL ctl_stop( ' One or more of ln_trainc, ln_dyninc, ln_sshinc, ln_seaiceinc,', & 
     318         &                ' ln_(bgc-variable)inc is set to .true.', & 
    278319         &                ' but ln_asmdin and ln_asmiau are both set to .false. :', & 
    279320         &                ' Inconsistent options') 
     
    284325 
    285326      IF ( ( .NOT. ln_trainc ).AND.( .NOT. ln_dyninc ).AND.( .NOT. ln_sshinc ).AND.( .NOT. ln_seaiceinc ) & 
    286          &                     )  & 
    287          & CALL ctl_warn( ' ln_trainc, ln_dyninc, ln_sshinc and ln_seaiceinc are set to .false. :', & 
     327         & .AND.( .NOT. lk_bgcinc ) )  & 
     328         & CALL ctl_warn( ' ln_trainc, ln_dyninc, ln_sshinc, ln_seaiceinc,', & 
     329         &                ' ln_(bgc-variable)inc are set to .false. :', & 
    288330         &                ' The assimilation increments are not applied') 
    289331 
     
    310352         &                ' Assim bkg averaging period is outside', & 
    311353         &                ' the cycle interval') 
     354       
     355      IF ( lk_bgcinc ) CALL asm_bgc_check_options 
    312356 
    313357      IF ( nstop > 0 ) RETURN       ! if there are any errors then go no further 
     
    412456      ssh_iau(:,:)    = 0.0 
    413457#endif 
    414       IF ( ( ln_trainc ).OR.( ln_dyninc ).OR.( ln_sshinc ).OR.( ln_seaiceinc ) ) THEN 
     458      IF ( ( ln_trainc ).OR.( ln_dyninc ).OR.( ln_sshinc ).OR.( ln_seaiceinc ) & 
     459         &  .OR.( lk_bgcinc ) ) THEN 
    415460 
    416461         !-------------------------------------------------------------------- 
     
    545590         ENDIF 
    546591 
     592         IF ( lk_bgcinc ) THEN 
     593            CALL asm_bgc_init_incs( inum ) 
     594         ENDIF 
     595 
    547596         CALL iom_close( inum ) 
    548597  
     
    655704         CALL iom_close( inum ) 
    656705 
     706      ENDIF 
     707          
     708      IF ( lk_bgcinc ) THEN 
     709         CALL asm_bgc_init_bkg 
    657710      ENDIF 
    658711      ! 
     
    12761329 
    12771330   END SUBROUTINE seaice_asm_inc 
     1331 
     1332 
     1333   SUBROUTINE bgc_asm_inc( kt ) 
     1334      !!---------------------------------------------------------------------- 
     1335      !!                    ***  ROUTINE bgc_asm_inc  *** 
     1336      !!           
     1337      !! ** Purpose : Apply the biogeochemistry assimilation increments 
     1338      !! 
     1339      !! ** Method  : Call relevant routines in asmbgc 
     1340      !! 
     1341      !! ** Action  : Call relevant routines in asmbgc 
     1342      !! 
     1343      !!---------------------------------------------------------------------- 
     1344      !! 
     1345      INTEGER, INTENT(in   ) :: kt        ! Current time step 
     1346      ! 
     1347      INTEGER                :: icycper   ! Dimension of wgtiau 
     1348      !! 
     1349      !!---------------------------------------------------------------------- 
     1350       
     1351      icycper = SIZE( wgtiau ) 
     1352       
     1353      ! Ocean colour variables first 
     1354      IF ( ln_slchltotinc .OR. ln_slchldiainc .OR. ln_slchlnoninc .OR. & 
     1355         & ln_schltotinc  .OR. ln_slphytotinc .OR. ln_slphydiainc .OR. & 
     1356         & ln_slphynoninc ) THEN 
     1357         CALL phyto2d_asm_inc( kt, ln_asmdin, ln_asmiau, icycper, wgtiau ) 
     1358      ENDIF 
     1359       
     1360      ! Surface pCO2/fCO2 next 
     1361      IF ( ln_sfco2inc .OR. ln_spco2inc ) THEN 
     1362         CALL pco2_asm_inc( kt, ln_asmdin, ln_asmiau, icycper, wgtiau, & 
     1363            &               ln_trainc, t_bkginc, s_bkginc ) 
     1364      ENDIF 
     1365       
     1366      ! Profile pH next 
     1367      IF ( ln_pphinc ) THEN 
     1368         CALL ph_asm_inc( kt, ln_asmdin, ln_asmiau, icycper, wgtiau, & 
     1369            &             ln_trainc, t_bkginc, s_bkginc ) 
     1370      ENDIF 
     1371       
     1372      ! Then chlorophyll profiles 
     1373      IF ( ln_plchltotinc .OR. ln_pchltotinc ) THEN 
     1374         CALL phyto3d_asm_inc( kt, ln_asmdin, ln_asmiau, icycper, wgtiau ) 
     1375      ENDIF 
     1376       
     1377      ! Remaining bgc profile variables 
     1378      IF ( ln_pno3inc .OR. ln_psi4inc .OR. ln_pdicinc .OR. & 
     1379         & ln_palkinc .OR. ln_po2inc ) THEN 
     1380         CALL bgc3d_asm_inc( kt, ln_asmdin, ln_asmiau, icycper, wgtiau ) 
     1381      ENDIF 
     1382 
     1383   END SUBROUTINE bgc_asm_inc 
    12781384    
    12791385   !!====================================================================== 
Note: See TracChangeset for help on using the changeset viewer.