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 9297 – NEMO

Changeset 9297


Ignore:
Timestamp:
2018-01-31T17:53:03+01:00 (6 years ago)
Author:
dford
Message:

Cosmetic changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/UKMO/dev_r5518_GO6_package_asm_3d_bgc/NEMOGCM/NEMO/OPA_SRC/ASM/asmbgc.F90

    r9296 r9297  
    11MODULE asmbgc 
    2    !!====================================================================== 
     2   !!=========================================================================== 
    33   !!                       ***  MODULE asmbgc  *** 
    44   !! Routines and declarations for biogeochemical assimilation 
    5    !!====================================================================== 
     5   !!=========================================================================== 
    66   !! History :  3.6  ! 2018-02 (D. Ford)  Adapted from existing modules 
    7    !!---------------------------------------------------------------------- 
     7   !!--------------------------------------------------------------------------- 
    88   !! 'key_asminc'          : assimilation increment interface 
    99   !! 'key_top'             : passive tracers 
     
    1313   !! 'key_roam'            : MEDUSA extras for carbonate cycle 
    1414   !! 'key_karaml'          : Kara mixed layer depth 
    15    !!---------------------------------------------------------------------- 
    16    !! asm_bgc_check_options : check biogeochemical assimilation options 
     15   !!--------------------------------------------------------------------------- 
     16   !! asm_bgc_check_options : check bgc assimilation options 
    1717   !! asm_bgc_init_incs     : initialise bgc increments 
    1818   !! asm_bgc_init_bkg      : initialise bgc background 
    19    !! asm_bgc_bal_wri       : write out balancing increments 
     19   !! asm_bgc_bal_wri       : write out bgc balancing increments 
    2020   !! asm_bgc_bkg_wri       : write out bgc background 
    2121   !! slchltot_asm_inc      : apply the slchltot increment 
    2222   !! spco2_asm_inc         : apply the pCO2/fCO2 increment 
    23    !!---------------------------------------------------------------------- 
    24    USE par_kind,      ONLY: wp             ! kind parameters 
    25    USE par_oce,       ONLY: jpi, jpj, jpk  ! domain array sizes 
    26    USE iom                                 ! i/o 
    27    USE zdfmxl, ONLY :  &   
    28 !   &  hmld_tref,       &    
     23   !!--------------------------------------------------------------------------- 
     24   USE par_kind, ONLY:      & ! kind parameters 
     25      & wp 
     26   USE par_oce, ONLY:       & ! domain array sizes 
     27      & jpi,                & 
     28      & jpj,                & 
     29      & jpk 
     30   USE iom                    ! i/o 
     31   USE oce, ONLY:           & ! active tracer variables 
     32      & tsn 
     33   USE zdfmxl, ONLY :       & ! mixed layer depth  
    2934#if defined key_karaml 
    30    &  hmld_kara,       & 
    31    &  ln_kara,         & 
     35      & hmld_kara,          & 
     36      & ln_kara,            & 
    3237#endif    
    33    &  hmld,            &  
    34    &  hmlp,            & 
    35    &  hmlpt  
     38      & hmld,               &  
     39      & hmlp,               & 
     40      & hmlpt  
     41   USE asmpar, ONLY:        & ! assimilation parameters 
     42      & c_asmbkg,           & 
     43      & c_asmbal,           & 
     44      & nitbkg_r,           & 
     45      & nitdin_r,           & 
     46      & nitiaustr_r,        & 
     47      & nitiaufin_r 
    3648#if defined key_top 
    37    USE trc, ONLY: & 
    38       & trn,      & 
     49   USE trc, ONLY:           & ! passive tracer variables 
     50      & trn,                & 
    3951      & trb 
    40    USE par_trc, ONLY: & 
     52   USE par_trc, ONLY:       & ! passive tracer parameters 
    4153      & jptra 
    4254#endif 
    4355#if defined key_medusa && defined key_foam_medusa 
    44    USE asmlogchlbal_medusa, ONLY: & 
     56   USE asmlogchlbal_medusa, ONLY: & ! logchl balancing for MEDUSA 
    4557      & asm_logchl_bal_medusa 
    46    USE asmpco2bal, ONLY: & 
     58   USE asmpco2bal, ONLY:    & ! pCO2 balancing for MEDUSA 
    4759      & asm_pco2_bal 
    48    USE par_medusa 
    49    USE mocsy_mainmod     ! f2pCO2 
    50    USE sms_medusa, ONLY: pgrow_avg, & 
    51       &                  ploss_avg, & 
    52       &                  phyt_avg,  & 
    53       &                  mld_max 
     60   USE par_medusa             ! MEDUSA parameters 
     61   USE mocsy_mainmod, ONLY: & ! MEDUSA carbonate system 
     62      & f2pCO2 
     63   USE sms_medusa, ONLY:    & ! MEDUSA diagnostic variables 
     64      & pgrow_avg,          & 
     65      & ploss_avg,          & 
     66      & phyt_avg,           & 
     67      & mld_max 
    5468#elif defined key_hadocc 
    55    USE asmlogchlbal_hadocc, ONLY: & 
     69   USE asmlogchlbal_hadocc, ONLY: & ! logchl balancing for HadOCC 
    5670      & asm_logchl_bal_hadocc 
    57    USE asmpco2bal, ONLY: & 
     71   USE asmpco2bal, ONLY:    & ! pCO2 balancing for HadOCC 
    5872      & asm_pco2_bal 
    59    USE par_hadocc 
    60    USE trc, ONLY: pgrow_avg, & 
    61        &     ploss_avg, & 
    62        &     phyt_avg,  & 
    63        &     mld_max,   & 
    64        &     HADOCC_CHL 
    65    USE had_bgc_const, ONLY: cchl_p 
    66 #endif 
    67    USE asmpar    ! c_asmbkg, c_asmbal, nitbkg_r, nitdin_r, nitiaustr_r, nitiaufin_r 
    68    USE oce              ! tsn 
     73   USE par_hadocc             ! HadOCC parameters 
     74   USE trc, ONLY:           & ! HadOCC diagnostic variables 
     75      & pgrow_avg,          & 
     76      & ploss_avg,          & 
     77      & phyt_avg,           & 
     78      & mld_max,            & 
     79      & HADOCC_CHL 
     80   USE had_bgc_const, ONLY: & ! HadOCC C:Chl ratio 
     81      & cchl_p 
     82#endif 
    6983 
    7084   IMPLICIT NONE 
    7185   PRIVATE                    
    7286 
    73    PUBLIC asm_bgc_check_options 
    74    PUBLIC asm_bgc_init_incs 
    75    PUBLIC asm_bgc_init_bkg 
    76    PUBLIC asm_bgc_bal_wri 
    77    PUBLIC asm_bgc_bkg_wri 
    78    PUBLIC slchltot_asm_inc 
    79    PUBLIC spco2_asm_inc 
     87   PUBLIC asm_bgc_check_options  ! called by asm_inc_init in asminc.F90 
     88   PUBLIC asm_bgc_init_incs      ! called by asm_inc_init in asminc.F90 
     89   PUBLIC asm_bgc_init_bkg       ! called by asm_inc_init in asminc.F90 
     90   PUBLIC asm_bgc_bal_wri        ! called by nemo_gcm in nemogcm.F90 
     91   PUBLIC asm_bgc_bkg_wri        ! called by asm_bkg_wri in asmbkg.F90 
     92   PUBLIC slchltot_asm_inc       ! called by bgc_asm_inc in asminc.F90 
     93   PUBLIC spco2_asm_inc          ! called by bgc_asm_inc in asminc.F90 
    8094 
    8195   LOGICAL, PUBLIC :: ln_balwri = .FALSE.        !: No output of balancing incs 
     
    8599   LOGICAL, PUBLIC :: ln_sfco2inc = .FALSE.      !: No fCO2 increment 
    86100 
    87    REAL(wp), PUBLIC, DIMENSION(:,:), ALLOCATABLE :: slchltot_bkginc !: Increment to background slchltot 
    88    REAL(wp), PUBLIC, DIMENSION(:,:), ALLOCATABLE :: spco2_bkginc   !: Increment to background pCO2 
     101   INTEGER, PUBLIC :: mld_choice_bgc = 1 !: choice of mld for bgc assimilation 
     102                                         !  1) hmld      - Turbocline/mixing depth 
     103                                         !                 [W points] 
     104                                         !  2) hmlp      - Density criterion 
     105                                         !                 (0.01 kg/m^3 change from 10m) 
     106                                         !                 [W points] 
     107                                         !  3) hmld_kara - Kara MLD 
     108                                         !                 [Interpolated] 
     109                                         !  4) hmld_tref - Temperature criterion 
     110                                         !                 (0.2 K change from surface) 
     111                                         !                 [T points] 
     112                                         !  5) hmlpt     - Density criterion 
     113                                         !                 (0.01 kg/m^3 change from 10m) 
     114                                         !                 [T points] 
     115 
     116   REAL(wp), PUBLIC :: rn_maxchlinc = -999.0 !: maximum absolute non-log chlorophyll inc 
     117                                             ! <= 0 no maximum applied (switch turned off) 
     118                                             !  > 0 absolute chl inc capped at this value 
     119 
     120   REAL(wp), DIMENSION(:,:),     ALLOCATABLE :: slchltot_bkginc ! slchltot inc 
     121   REAL(wp), DIMENSION(:,:),     ALLOCATABLE :: spco2_bkginc    ! sp(/f)co2 inc 
    89122#if defined key_top 
    90    REAL(wp), PUBLIC, DIMENSION(:,:,:,:), ALLOCATABLE :: slchltot_balinc  !: Increment to BGC variables from logchl assim 
    91    REAL(wp), PUBLIC, DIMENSION(:,:,:,:), ALLOCATABLE :: spco2_balinc    !: Increment to BGC variables from pCO2 assim 
    92 #endif 
     123   REAL(wp), DIMENSION(:,:,:,:), ALLOCATABLE :: slchltot_balinc ! Balancing incs from slchltot asm 
     124   REAL(wp), DIMENSION(:,:,:,:), ALLOCATABLE :: spco2_balinc    ! Balancing incs from sp(/f)co2 asm 
     125#endif 
     126 
    93127#if defined key_hadocc || (defined key_medusa && defined key_foam_medusa) 
    94    REAL(wp), DIMENSION(:,:),     ALLOCATABLE :: pgrow_avg_bkg  !: Background phyto growth for logchl balancing 
    95    REAL(wp), DIMENSION(:,:),     ALLOCATABLE :: ploss_avg_bkg  !: Background phyto loss for logchl balancing 
    96    REAL(wp), DIMENSION(:,:),     ALLOCATABLE :: phyt_avg_bkg   !: Background phyto for logchl balancing 
    97    REAL(wp), DIMENSION(:,:),     ALLOCATABLE :: mld_max_bkg    !: Background max MLD for logchl balancing 
    98    REAL(wp), DIMENSION(:,:,:,:), ALLOCATABLE :: tracer_bkg     !: Background tracer state variables 
     128   REAL(wp), DIMENSION(:,:),     ALLOCATABLE :: pgrow_avg_bkg   ! Background phyto growth 
     129   REAL(wp), DIMENSION(:,:),     ALLOCATABLE :: ploss_avg_bkg   ! Background phyto loss 
     130   REAL(wp), DIMENSION(:,:),     ALLOCATABLE :: phyt_avg_bkg    ! Background phyto conc 
     131   REAL(wp), DIMENSION(:,:),     ALLOCATABLE :: mld_max_bkg     ! Background max MLD 
     132   REAL(wp), DIMENSION(:,:,:,:), ALLOCATABLE :: tracer_bkg      ! Background tracer state 
    99133#endif 
    100134#if defined key_hadocc 
    101    REAL(wp), DIMENSION(:,:),     ALLOCATABLE :: chl_bkg        !: Background surface chlorophyll 
    102    REAL(wp), DIMENSION(:,:),     ALLOCATABLE :: cchl_p_bkg     !: Background surface carbon:chlorophyll 
    103 #endif 
    104    REAL(wp), PUBLIC :: rn_maxchlinc = -999.0  !: maximum absolute non-log chlorophyll increment from logchl assimilation 
    105                                       !: <= 0 implies no maximum applied (switch turned off) 
    106                                       !:  > 0 implies maximum absolute chl increment capped at this value 
    107  
    108    INTEGER, PUBLIC :: mld_choice_bgc    = 1   !: choice of mld criteria to use for biogeochemistry assimilation 
    109                                       !: 1) hmld      - Turbocline/mixing depth                           [W points] 
    110                                       !: 2) hmlp      - Density criterion (0.01 kg/m^3 change from 10m)   [W points] 
    111                                       !: 3) hmld_kara - Kara MLD                                          [Interpolated] 
    112                                       !: 4) hmld_tref - Temperature criterion (0.2 K change from surface) [T points] 
    113                                       !: 5) hmlpt     - Density criterion (0.01 kg/m^3 change from 10m)   [T points] 
     135   REAL(wp), DIMENSION(:,:),     ALLOCATABLE :: chl_bkg         ! Background surface chl 
     136   REAL(wp), DIMENSION(:,:),     ALLOCATABLE :: cchl_p_bkg      ! Background surface c:chl 
     137#endif 
    114138 
    115139CONTAINS 
    116140 
    117141   SUBROUTINE asm_bgc_check_options 
    118       !!--------------------------------------------------------------------------- 
     142      !!------------------------------------------------------------------------ 
    119143      !!                    ***  ROUTINE asm_bgc_check_options  *** 
    120144      !! 
     
    126150      !! 
    127151      !! References :   asm_inc_init 
    128       !!--------------------------------------------------------------------------- 
    129  
    130       IF ( ( ln_balwri ).AND.( .NOT. ln_slchltotinc ).AND.( .NOT. ln_spco2inc ).AND.( .NOT. ln_sfco2inc ) ) THEN 
     152      !!------------------------------------------------------------------------ 
     153 
     154      IF ( ( ln_balwri ).AND.( .NOT. ln_slchltotinc ).AND. & 
     155         & ( .NOT. ln_spco2inc ).AND.( .NOT. ln_sfco2inc ) ) THEN 
    131156         CALL ctl_warn( ' Balancing increments are only calculated for logchl and pCO2/fCO2', & 
    132157            &           ' Not assimilating logchl, pCO2 or fCO2, so ln_balwri will be set to .false.') 
     
    146171   END SUBROUTINE asm_bgc_check_options 
    147172 
    148    !!====================================================================== 
    149    !!====================================================================== 
    150    !!====================================================================== 
     173   !!=========================================================================== 
     174   !!=========================================================================== 
     175   !!=========================================================================== 
    151176 
    152177   SUBROUTINE asm_bgc_init_incs( knum ) 
    153       !!--------------------------------------------------------------------------- 
     178      !!------------------------------------------------------------------------ 
    154179      !!                    ***  ROUTINE asm_bgc_init_incs  *** 
    155180      !! 
     
    161186      !! 
    162187      !! References :   asm_inc_init 
    163       !!--------------------------------------------------------------------------- 
     188      !!------------------------------------------------------------------------ 
    164189      !! 
    165190      INTEGER, INTENT(in   ) :: knum   ! i/o unit of increments file 
    166191      !! 
    167       !!--------------------------------------------------------------------------- 
     192      !!------------------------------------------------------------------------ 
    168193 
    169194      IF ( ln_slchltotinc ) THEN 
     
    208233   END SUBROUTINE asm_bgc_init_incs 
    209234 
    210    !!====================================================================== 
    211    !!====================================================================== 
    212    !!====================================================================== 
     235   !!=========================================================================== 
     236   !!=========================================================================== 
     237   !!=========================================================================== 
    213238 
    214239   SUBROUTINE asm_bgc_init_bkg 
    215       !!--------------------------------------------------------------------------- 
     240      !!------------------------------------------------------------------------ 
    216241      !!                    ***  ROUTINE asm_bgc_init_bkg  *** 
    217242      !! 
     
    223248      !! 
    224249      !! References :   asm_inc_init 
    225       !!--------------------------------------------------------------------------- 
     250      !!------------------------------------------------------------------------ 
    226251      !! 
    227252      INTEGER :: inum   ! i/o unit of background file 
    228253      INTEGER :: jt     ! loop counter 
    229254      !! 
    230       !!--------------------------------------------------------------------------- 
     255      !!------------------------------------------------------------------------ 
    231256 
    232257#if defined key_hadocc || (defined key_medusa && defined key_foam_medusa) 
     
    349374   END SUBROUTINE asm_bgc_init_bkg 
    350375 
    351    !!====================================================================== 
    352    !!====================================================================== 
    353    !!====================================================================== 
     376   !!=========================================================================== 
     377   !!=========================================================================== 
     378   !!=========================================================================== 
    354379 
    355380   SUBROUTINE asm_bgc_bal_wri( kt ) 
    356       !!----------------------------------------------------------------------- 
     381      !!------------------------------------------------------------------------ 
    357382      !! 
    358383      !!                  ***  ROUTINE asm_bgc_bal_wri *** 
     
    370395      !! History    : 
    371396      !!        ! 2014-08 (D. Ford)  Initial version, based on asm_bkg_wri 
    372       !!----------------------------------------------------------------------- 
     397      !!------------------------------------------------------------------------ 
    373398      !! * Arguments 
    374399      INTEGER, INTENT( IN ) :: kt        ! Current time-step 
     
    378403      INTEGER           :: inum          ! File unit number 
    379404      REAL(wp)          :: zdate         ! Date 
    380       !!----------------------------------------------------------------------- 
     405      !!------------------------------------------------------------------------ 
    381406      
    382407      ! Set things up 
     
    456481   END SUBROUTINE asm_bgc_bal_wri 
    457482 
    458    !!====================================================================== 
    459    !!====================================================================== 
    460    !!====================================================================== 
     483   !!=========================================================================== 
     484   !!=========================================================================== 
     485   !!=========================================================================== 
    461486 
    462487   SUBROUTINE asm_bgc_bkg_wri( kt, knum ) 
    463       !!--------------------------------------------------------------------------- 
     488      !!------------------------------------------------------------------------ 
    464489      !!                    ***  ROUTINE asm_bgc_bkg_wri  *** 
    465490      !! 
     
    471496      !! 
    472497      !! References :   asm_bkg_wri 
    473       !!--------------------------------------------------------------------------- 
     498      !!------------------------------------------------------------------------ 
    474499      !! 
    475500      INTEGER, INTENT(in   ) :: kt     ! Current time-step 
    476501      INTEGER, INTENT(in   ) :: knum   ! i/o unit of increments file 
    477502      !! 
    478       !!--------------------------------------------------------------------------- 
     503      !!------------------------------------------------------------------------ 
    479504 
    480505#if defined key_hadocc 
     
    515540   END SUBROUTINE asm_bgc_bkg_wri 
    516541 
    517    !!====================================================================== 
    518    !!====================================================================== 
    519    !!====================================================================== 
     542   !!=========================================================================== 
     543   !!=========================================================================== 
     544   !!=========================================================================== 
    520545 
    521546   SUBROUTINE slchltot_asm_inc( kt, ll_asmdin, ll_asmiau, kcycper, pwgtiau ) 
    522       !!---------------------------------------------------------------------- 
     547      !!------------------------------------------------------------------------ 
    523548      !!                    ***  ROUTINE logchl_asm_inc  *** 
    524549      !!           
     
    530555      !! 
    531556      !! ** Action  :  
    532       !!---------------------------------------------------------------------- 
     557      !!------------------------------------------------------------------------ 
    533558      INTEGER,  INTENT(IN) :: kt        ! Current time step 
    534559      LOGICAL,  INTENT(IN) :: ll_asmdin ! Flag for direct initialisation 
     
    541566      REAL(wp) :: zincwgt         ! IAU weight for current time step 
    542567      REAL(wp) :: zincper         ! IAU interval in seconds 
    543       !!---------------------------------------------------------------------- 
     568      !!------------------------------------------------------------------------ 
    544569 
    545570      IF ( kt <= nit000 ) THEN 
     
    645670   END SUBROUTINE slchltot_asm_inc 
    646671 
    647    !!====================================================================== 
    648    !!====================================================================== 
    649    !!====================================================================== 
     672   !!=========================================================================== 
     673   !!=========================================================================== 
     674   !!=========================================================================== 
    650675 
    651676   SUBROUTINE spco2_asm_inc( kt, ll_asmdin, ll_asmiau, kcycper, pwgtiau, & 
    652677      &                      ll_trainc, pt_bkginc, ps_bkginc ) 
    653       !!---------------------------------------------------------------------- 
     678      !!------------------------------------------------------------------------ 
    654679      !!                    ***  ROUTINE pco2_asm_inc  *** 
    655680      !!           
     
    661686      !! 
    662687      !! ** Action  :  
    663       !!---------------------------------------------------------------------- 
     688      !!------------------------------------------------------------------------ 
    664689      INTEGER, INTENT(IN)                   :: kt           ! Current time step 
    665690      LOGICAL, INTENT(IN)                   :: ll_asmdin    ! Flag for direct initialisation 
     
    693718      REAL(wp)                              :: zcoef_fco2_7 = 0.118 
    694719      REAL(wp)                              :: zcoef_fco2_8 = 82.0578 
    695       !!---------------------------------------------------------------------- 
     720      !!------------------------------------------------------------------------ 
    696721 
    697722      IF ( kt <= nit000 ) THEN 
    698723 
    699          !-------------------------------------------------------------------- 
     724         !---------------------------------------------------------------------- 
    700725         ! DIC and alkalinity balancing 
    701          !-------------------------------------------------------------------- 
     726         !---------------------------------------------------------------------- 
    702727 
    703728         IF ( ln_sfco2inc ) THEN 
     
    912937   END SUBROUTINE spco2_asm_inc 
    913938 
    914    !!====================================================================== 
     939   !!=========================================================================== 
    915940 
    916941END MODULE asmbgc 
Note: See TracChangeset for help on using the changeset viewer.