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

Ignore:
Timestamp:
2018-08-20T15:17:09+02:00 (6 years ago)
Author:
dford
Message:

Merge in branches/UKMO/dev_r5518_GO6_package_asm_3d_bgc and address conflicts.

File:
1 edited

Legend:

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

    r8400 r10055  
    4444#endif 
    4545   USE sbc_oce          ! Surface boundary condition variables. 
     46   USE asmbgc           ! Biogeochemistry assimilation 
    4647 
    4748   IMPLICIT NONE 
     
    5455   PUBLIC   ssh_asm_inc    !: Apply the SSH increment 
    5556   PUBLIC   seaice_asm_inc !: Apply the seaice increment 
     57   PUBLIC   bgc_asm_inc    !: Apply the biogeochemistry increments 
    5658 
    5759#if defined key_asminc 
     
    6769   LOGICAL, PUBLIC :: ln_sshinc = .FALSE.      !: No sea surface height assimilation increment 
    6870   LOGICAL, PUBLIC :: ln_seaiceinc             !: No sea ice concentration increment 
     71   LOGICAL, PUBLIC :: lk_bgcinc = .FALSE.      !: No biogeochemistry increments 
    6972   LOGICAL, PUBLIC :: ln_salfix = .FALSE.      !: Apply minimum salinity check 
    7073   LOGICAL, PUBLIC :: ln_temnofreeze = .FALSE. !: Don't allow the temperature to drop below freezing 
     
    133136      REAL(wp), POINTER, DIMENSION(:,:) ::   hdiv   ! 2D workspace 
    134137      !! 
    135       NAMELIST/nam_asminc/ ln_bkgwri,                                      & 
     138      NAMELIST/nam_asminc/ ln_bkgwri, ln_balwri,                           & 
    136139         &                 ln_trainc, ln_dyninc, ln_sshinc,                & 
     140         &                 ln_phytobal, ln_slchltotinc, ln_slchldiainc,    & 
     141         &                 ln_slchlnoninc, ln_schltotinc, ln_slphytotinc,  & 
     142         &                 ln_slphydiainc, ln_slphynoninc, ln_spco2inc,    & 
     143         &                 ln_sfco2inc, ln_plchltotinc, ln_pchltotinc,     & 
     144         &                 ln_pno3inc, ln_psi4inc, ln_pdicinc, ln_palkinc, & 
     145         &                 ln_pphinc, ln_po2inc,                           & 
    137146         &                 ln_asmdin, ln_asmiau,                           & 
    138147         &                 nitbkg, nitdin, nitiaustr, nitiaufin, niaufn,   & 
    139148         &                 ln_salfix, salfixmin, nn_divdmp,                & 
    140          &                 ln_seaiceinc, ln_temnofreeze 
     149         &                 ln_seaiceinc, ln_temnofreeze,                   & 
     150         &                 mld_choice_bgc, rn_maxchlinc 
    141151      !!---------------------------------------------------------------------- 
    142152 
     
    161171         WRITE(numout,*) 'asm_inc_init : Assimilation increment initialization :' 
    162172         WRITE(numout,*) '~~~~~~~~~~~~' 
    163          WRITE(numout,*) '   Namelist namasm : set assimilation increment parameters' 
     173         WRITE(numout,*) '   Namelist nam_asminc : set assimilation increment parameters' 
    164174         WRITE(numout,*) '      Logical switch for writing out background state          ln_bkgwri = ', ln_bkgwri 
     175         WRITE(numout,*) '      Logical switch for writing out balancing increments      ln_balwri = ', ln_balwri 
    165176         WRITE(numout,*) '      Logical switch for applying tracer increments            ln_trainc = ', ln_trainc 
    166177         WRITE(numout,*) '      Logical switch for applying velocity increments          ln_dyninc = ', ln_dyninc 
     
    168179         WRITE(numout,*) '      Logical switch for Direct Initialization (DI)            ln_asmdin = ', ln_asmdin 
    169180         WRITE(numout,*) '      Logical switch for applying sea ice increments        ln_seaiceinc = ', ln_seaiceinc 
     181         WRITE(numout,*) '      Logical switch for phytoplankton balancing             ln_phytobal = ', ln_phytobal 
     182         WRITE(numout,*) '      Logical switch for applying slchltot increments     ln_slchltotinc = ', ln_slchltotinc 
     183         WRITE(numout,*) '      Logical switch for applying slchldia increments     ln_slchldiainc = ', ln_slchldiainc 
     184         WRITE(numout,*) '      Logical switch for applying slchlnon increments     ln_slchlnoninc = ', ln_slchlnoninc 
     185         WRITE(numout,*) '      Logical switch for applying schltot increments       ln_schltotinc = ', ln_schltotinc 
     186         WRITE(numout,*) '      Logical switch for applying slphytot increments     ln_slphytotinc = ', ln_slphytotinc 
     187         WRITE(numout,*) '      Logical switch for applying slphydia increments     ln_slphydiainc = ', ln_slphydiainc 
     188         WRITE(numout,*) '      Logical switch for applying slphynon increments     ln_slphynoninc = ', ln_slphynoninc 
     189         WRITE(numout,*) '      Logical switch for applying spco2 increments           ln_spco2inc = ', ln_spco2inc 
     190         WRITE(numout,*) '      Logical switch for applying sfco2 increments           ln_sfco2inc = ', ln_sfco2inc 
     191         WRITE(numout,*) '      Logical switch for applying plchltot increments     ln_plchltotinc = ', ln_plchltotinc 
     192         WRITE(numout,*) '      Logical switch for applying pchltot increments       ln_pchltotinc = ', ln_pchltotinc 
     193         WRITE(numout,*) '      Logical switch for applying pno3 increments             ln_pno3inc = ', ln_pno3inc 
     194         WRITE(numout,*) '      Logical switch for applying psi4 increments             ln_psi4inc = ', ln_psi4inc 
     195         WRITE(numout,*) '      Logical switch for applying pdic increments             ln_pdicinc = ', ln_pdicinc 
     196         WRITE(numout,*) '      Logical switch for applying palk increments             ln_palkinc = ', ln_palkinc 
     197         WRITE(numout,*) '      Logical switch for applying pph increments               ln_pphinc = ', ln_pphinc 
     198         WRITE(numout,*) '      Logical switch for applying po2 increments               ln_po2inc = ', ln_po2inc 
    170199         WRITE(numout,*) '      Logical switch for Incremental Analysis Updating (IAU)   ln_asmiau = ', ln_asmiau 
    171200         WRITE(numout,*) '      Timestep of background in [0,nitend-nit000-1]            nitbkg    = ', nitbkg 
     
    176205         WRITE(numout,*) '      Logical switch for ensuring that the sa > salfixmin      ln_salfix = ', ln_salfix 
    177206         WRITE(numout,*) '      Minimum salinity after applying the increments           salfixmin = ', salfixmin 
     207         WRITE(numout,*) '      Choice of MLD for BGC assimilation                  mld_choice_bgc = ', mld_choice_bgc 
     208         WRITE(numout,*) '      Maximum absolute chlorophyll increment (<=0 = off)    rn_maxchlinc = ', rn_maxchlinc 
    178209      ENDIF 
    179210 
     
    212243         WRITE(numout,*) '       iitiaufin_date = ', iitiaufin_date 
    213244      ENDIF 
     245       
     246      IF ( ln_slchltotinc .OR. ln_slchldiainc .OR. ln_slchlnoninc .OR. & 
     247         & ln_schltotinc  .OR. ln_slphytotinc .OR. ln_slphydiainc .OR. & 
     248         & ln_slphynoninc .OR. ln_spco2inc    .OR. ln_sfco2inc    .OR. & 
     249         & ln_plchltotinc .OR. ln_pchltotinc  .OR. ln_pno3inc     .OR. & 
     250         & ln_psi4inc     .OR. ln_pdicinc     .OR. ln_palkinc     .OR. & 
     251         & ln_pphinc      .OR. ln_po2inc ) THEN 
     252         lk_bgcinc = .TRUE. 
     253      ENDIF 
    214254 
    215255      IF ( nacc /= 0 ) & 
     
    223263 
    224264      IF (      ( ( .NOT. ln_asmdin ).AND.( .NOT. ln_asmiau ) ) & 
    225            .AND.( ( ln_trainc ).OR.( ln_dyninc ).OR.( ln_sshinc ) .OR. ( ln_seaiceinc) )) & 
    226          & CALL ctl_stop( ' One or more of ln_trainc, ln_dyninc, ln_sshinc and ln_seaiceinc is set to .true.', & 
     265         & .AND.( ( ln_trainc ).OR.( ln_dyninc ).OR.( ln_sshinc ).OR.( ln_seaiceinc ).OR. & 
     266         &        ( lk_bgcinc ) )) & 
     267         & CALL ctl_stop( ' One or more of ln_trainc, ln_dyninc, ln_sshinc, ln_seaiceinc,', & 
     268         &                ' ln_(bgc-variable)inc is set to .true.', & 
    227269         &                ' but ln_asmdin and ln_asmiau are both set to .false. :', & 
    228270         &                ' Inconsistent options') 
     
    233275 
    234276      IF ( ( .NOT. ln_trainc ).AND.( .NOT. ln_dyninc ).AND.( .NOT. ln_sshinc ).AND.( .NOT. ln_seaiceinc ) & 
    235          &                     )  & 
    236          & CALL ctl_warn( ' ln_trainc, ln_dyninc, ln_sshinc and ln_seaiceinc are set to .false. :', & 
     277         & .AND.( .NOT. lk_bgcinc ) )  & 
     278         & CALL ctl_warn( ' ln_trainc, ln_dyninc, ln_sshinc, ln_seaiceinc,', & 
     279         &                ' ln_(bgc-variable)inc are set to .false. :', & 
    237280         &                ' The assimilation increments are not applied') 
    238281 
     
    254297         &                ' Background time step for Direct Initialization is outside', & 
    255298         &                ' the cycle interval') 
     299       
     300      IF ( lk_bgcinc ) CALL asm_bgc_check_options 
    256301 
    257302      IF ( nstop > 0 ) RETURN       ! if there are any errors then go no further 
     
    350395      ssh_iau(:,:)    = 0.0 
    351396#endif 
    352       IF ( ( ln_trainc ).OR.( ln_dyninc ).OR.( ln_sshinc ).OR.( ln_seaiceinc ) ) THEN 
     397      IF ( ( ln_trainc ).OR.( ln_dyninc ).OR.( ln_sshinc ).OR.( ln_seaiceinc ) & 
     398         &  .OR.( lk_bgcinc ) ) THEN 
    353399 
    354400         !-------------------------------------------------------------------- 
     
    424470         ENDIF 
    425471 
     472         IF ( lk_bgcinc ) THEN 
     473            CALL asm_bgc_init_incs( inum ) 
     474         ENDIF 
     475 
    426476         CALL iom_close( inum ) 
    427477  
     
    534584         CALL iom_close( inum ) 
    535585 
     586      ENDIF 
     587          
     588      IF ( lk_bgcinc ) THEN 
     589         CALL asm_bgc_init_bkg 
    536590      ENDIF 
    537591      ! 
     
    11551209 
    11561210   END SUBROUTINE seaice_asm_inc 
     1211 
     1212 
     1213   SUBROUTINE bgc_asm_inc( kt ) 
     1214      !!---------------------------------------------------------------------- 
     1215      !!                    ***  ROUTINE bgc_asm_inc  *** 
     1216      !!           
     1217      !! ** Purpose : Apply the biogeochemistry assimilation increments 
     1218      !! 
     1219      !! ** Method  : Call relevant routines in asmbgc 
     1220      !! 
     1221      !! ** Action  : Call relevant routines in asmbgc 
     1222      !! 
     1223      !!---------------------------------------------------------------------- 
     1224      !! 
     1225      INTEGER, INTENT(in   ) :: kt        ! Current time step 
     1226      ! 
     1227      INTEGER                :: icycper   ! Dimension of wgtiau 
     1228      !! 
     1229      !!---------------------------------------------------------------------- 
     1230       
     1231      icycper = SIZE( wgtiau ) 
     1232       
     1233      ! Ocean colour variables first 
     1234      IF ( ln_slchltotinc .OR. ln_slchldiainc .OR. ln_slchlnoninc .OR. & 
     1235         & ln_schltotinc  .OR. ln_slphytotinc .OR. ln_slphydiainc .OR. & 
     1236         & ln_slphynoninc ) THEN 
     1237         CALL phyto2d_asm_inc( kt, ln_asmdin, ln_asmiau, icycper, wgtiau ) 
     1238      ENDIF 
     1239       
     1240      ! Surface pCO2/fCO2 next 
     1241      IF ( ln_sfco2inc .OR. ln_spco2inc ) THEN 
     1242         CALL pco2_asm_inc( kt, ln_asmdin, ln_asmiau, icycper, wgtiau, & 
     1243            &               ln_trainc, t_bkginc, s_bkginc ) 
     1244      ENDIF 
     1245       
     1246      ! Profile pH next 
     1247      IF ( ln_pphinc ) THEN 
     1248         CALL ph_asm_inc( kt, ln_asmdin, ln_asmiau, icycper, wgtiau, & 
     1249            &             ln_trainc, t_bkginc, s_bkginc ) 
     1250      ENDIF 
     1251       
     1252      ! Then chlorophyll profiles 
     1253      IF ( ln_plchltotinc .OR. ln_pchltotinc ) THEN 
     1254         CALL phyto3d_asm_inc( kt, ln_asmdin, ln_asmiau, icycper, wgtiau ) 
     1255      ENDIF 
     1256       
     1257      ! Remaining bgc profile variables 
     1258      IF ( ln_pno3inc .OR. ln_psi4inc .OR. ln_pdicinc .OR. & 
     1259         & ln_palkinc .OR. ln_po2inc ) THEN 
     1260         CALL bgc3d_asm_inc( kt, ln_asmdin, ln_asmiau, icycper, wgtiau ) 
     1261      ENDIF 
     1262 
     1263   END SUBROUTINE bgc_asm_inc 
    11571264    
    11581265   !!====================================================================== 
Note: See TracChangeset for help on using the changeset viewer.