Changeset 9297
- Timestamp:
- 2018-01-31T17:53:03+01:00 (6 years ago)
- 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 1 1 MODULE asmbgc 2 !!====================================================================== 2 !!=========================================================================== 3 3 !! *** MODULE asmbgc *** 4 4 !! Routines and declarations for biogeochemical assimilation 5 !!====================================================================== 5 !!=========================================================================== 6 6 !! History : 3.6 ! 2018-02 (D. Ford) Adapted from existing modules 7 !!---------------------------------------------------------------------- 7 !!--------------------------------------------------------------------------- 8 8 !! 'key_asminc' : assimilation increment interface 9 9 !! 'key_top' : passive tracers … … 13 13 !! 'key_roam' : MEDUSA extras for carbonate cycle 14 14 !! 'key_karaml' : Kara mixed layer depth 15 !!---------------------------------------------------------------------- 16 !! asm_bgc_check_options : check b iogeochemicalassimilation options15 !!--------------------------------------------------------------------------- 16 !! asm_bgc_check_options : check bgc assimilation options 17 17 !! asm_bgc_init_incs : initialise bgc increments 18 18 !! asm_bgc_init_bkg : initialise bgc background 19 !! asm_bgc_bal_wri : write out b alancing increments19 !! asm_bgc_bal_wri : write out bgc balancing increments 20 20 !! asm_bgc_bkg_wri : write out bgc background 21 21 !! slchltot_asm_inc : apply the slchltot increment 22 22 !! 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 29 34 #if defined key_karaml 30 & hmld_kara,&31 & ln_kara,&35 & hmld_kara, & 36 & ln_kara, & 32 37 #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 36 48 #if defined key_top 37 USE trc, ONLY: &38 & trn, &49 USE trc, ONLY: & ! passive tracer variables 50 & trn, & 39 51 & trb 40 USE par_trc, ONLY: &52 USE par_trc, ONLY: & ! passive tracer parameters 41 53 & jptra 42 54 #endif 43 55 #if defined key_medusa && defined key_foam_medusa 44 USE asmlogchlbal_medusa, ONLY: & 56 USE asmlogchlbal_medusa, ONLY: & ! logchl balancing for MEDUSA 45 57 & asm_logchl_bal_medusa 46 USE asmpco2bal, ONLY: &58 USE asmpco2bal, ONLY: & ! pCO2 balancing for MEDUSA 47 59 & 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 54 68 #elif defined key_hadocc 55 USE asmlogchlbal_hadocc, ONLY: & 69 USE asmlogchlbal_hadocc, ONLY: & ! logchl balancing for HadOCC 56 70 & asm_logchl_bal_hadocc 57 USE asmpco2bal, ONLY: &71 USE asmpco2bal, ONLY: & ! pCO2 balancing for HadOCC 58 72 & asm_pco2_bal 59 USE par_hadocc 60 USE trc, ONLY: pgrow_avg, &61 & ploss_avg,&62 & phyt_avg,&63 & mld_max,&64 & HADOCC_CHL65 USE had_bgc_const, ONLY: cchl_p66 #endif 67 USE asmpar ! c_asmbkg, c_asmbal, nitbkg_r, nitdin_r, nitiaustr_r, nitiaufin_r68 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 69 83 70 84 IMPLICIT NONE 71 85 PRIVATE 72 86 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 80 94 81 95 LOGICAL, PUBLIC :: ln_balwri = .FALSE. !: No output of balancing incs … … 85 99 LOGICAL, PUBLIC :: ln_sfco2inc = .FALSE. !: No fCO2 increment 86 100 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 89 122 #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 93 127 #if defined key_hadocc || (defined key_medusa && defined key_foam_medusa) 94 REAL(wp), DIMENSION(:,:), ALLOCATABLE :: pgrow_avg_bkg !: Background phyto growth for logchl balancing95 REAL(wp), DIMENSION(:,:), ALLOCATABLE :: ploss_avg_bkg !: Background phyto loss for logchl balancing96 REAL(wp), DIMENSION(:,:), ALLOCATABLE :: phyt_avg_bkg !: Background phyto for logchl balancing97 REAL(wp), DIMENSION(:,:), ALLOCATABLE :: mld_max_bkg !: Background max MLD for logchl balancing98 REAL(wp), DIMENSION(:,:,:,:), ALLOCATABLE :: tracer_bkg !: Background tracer state variables128 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 99 133 #endif 100 134 #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 114 138 115 139 CONTAINS 116 140 117 141 SUBROUTINE asm_bgc_check_options 118 !!------------------------------------------------------------------------ ---142 !!------------------------------------------------------------------------ 119 143 !! *** ROUTINE asm_bgc_check_options *** 120 144 !! … … 126 150 !! 127 151 !! 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 131 156 CALL ctl_warn( ' Balancing increments are only calculated for logchl and pCO2/fCO2', & 132 157 & ' Not assimilating logchl, pCO2 or fCO2, so ln_balwri will be set to .false.') … … 146 171 END SUBROUTINE asm_bgc_check_options 147 172 148 !!====================================================================== 149 !!====================================================================== 150 !!====================================================================== 173 !!=========================================================================== 174 !!=========================================================================== 175 !!=========================================================================== 151 176 152 177 SUBROUTINE asm_bgc_init_incs( knum ) 153 !!------------------------------------------------------------------------ ---178 !!------------------------------------------------------------------------ 154 179 !! *** ROUTINE asm_bgc_init_incs *** 155 180 !! … … 161 186 !! 162 187 !! References : asm_inc_init 163 !!------------------------------------------------------------------------ ---188 !!------------------------------------------------------------------------ 164 189 !! 165 190 INTEGER, INTENT(in ) :: knum ! i/o unit of increments file 166 191 !! 167 !!------------------------------------------------------------------------ ---192 !!------------------------------------------------------------------------ 168 193 169 194 IF ( ln_slchltotinc ) THEN … … 208 233 END SUBROUTINE asm_bgc_init_incs 209 234 210 !!====================================================================== 211 !!====================================================================== 212 !!====================================================================== 235 !!=========================================================================== 236 !!=========================================================================== 237 !!=========================================================================== 213 238 214 239 SUBROUTINE asm_bgc_init_bkg 215 !!------------------------------------------------------------------------ ---240 !!------------------------------------------------------------------------ 216 241 !! *** ROUTINE asm_bgc_init_bkg *** 217 242 !! … … 223 248 !! 224 249 !! References : asm_inc_init 225 !!------------------------------------------------------------------------ ---250 !!------------------------------------------------------------------------ 226 251 !! 227 252 INTEGER :: inum ! i/o unit of background file 228 253 INTEGER :: jt ! loop counter 229 254 !! 230 !!------------------------------------------------------------------------ ---255 !!------------------------------------------------------------------------ 231 256 232 257 #if defined key_hadocc || (defined key_medusa && defined key_foam_medusa) … … 349 374 END SUBROUTINE asm_bgc_init_bkg 350 375 351 !!====================================================================== 352 !!====================================================================== 353 !!====================================================================== 376 !!=========================================================================== 377 !!=========================================================================== 378 !!=========================================================================== 354 379 355 380 SUBROUTINE asm_bgc_bal_wri( kt ) 356 !!----------------------------------------------------------------------- 381 !!------------------------------------------------------------------------ 357 382 !! 358 383 !! *** ROUTINE asm_bgc_bal_wri *** … … 370 395 !! History : 371 396 !! ! 2014-08 (D. Ford) Initial version, based on asm_bkg_wri 372 !!----------------------------------------------------------------------- 397 !!------------------------------------------------------------------------ 373 398 !! * Arguments 374 399 INTEGER, INTENT( IN ) :: kt ! Current time-step … … 378 403 INTEGER :: inum ! File unit number 379 404 REAL(wp) :: zdate ! Date 380 !!----------------------------------------------------------------------- 405 !!------------------------------------------------------------------------ 381 406 382 407 ! Set things up … … 456 481 END SUBROUTINE asm_bgc_bal_wri 457 482 458 !!====================================================================== 459 !!====================================================================== 460 !!====================================================================== 483 !!=========================================================================== 484 !!=========================================================================== 485 !!=========================================================================== 461 486 462 487 SUBROUTINE asm_bgc_bkg_wri( kt, knum ) 463 !!------------------------------------------------------------------------ ---488 !!------------------------------------------------------------------------ 464 489 !! *** ROUTINE asm_bgc_bkg_wri *** 465 490 !! … … 471 496 !! 472 497 !! References : asm_bkg_wri 473 !!------------------------------------------------------------------------ ---498 !!------------------------------------------------------------------------ 474 499 !! 475 500 INTEGER, INTENT(in ) :: kt ! Current time-step 476 501 INTEGER, INTENT(in ) :: knum ! i/o unit of increments file 477 502 !! 478 !!------------------------------------------------------------------------ ---503 !!------------------------------------------------------------------------ 479 504 480 505 #if defined key_hadocc … … 515 540 END SUBROUTINE asm_bgc_bkg_wri 516 541 517 !!====================================================================== 518 !!====================================================================== 519 !!====================================================================== 542 !!=========================================================================== 543 !!=========================================================================== 544 !!=========================================================================== 520 545 521 546 SUBROUTINE slchltot_asm_inc( kt, ll_asmdin, ll_asmiau, kcycper, pwgtiau ) 522 !!---------------------------------------------------------------------- 547 !!------------------------------------------------------------------------ 523 548 !! *** ROUTINE logchl_asm_inc *** 524 549 !! … … 530 555 !! 531 556 !! ** Action : 532 !!---------------------------------------------------------------------- 557 !!------------------------------------------------------------------------ 533 558 INTEGER, INTENT(IN) :: kt ! Current time step 534 559 LOGICAL, INTENT(IN) :: ll_asmdin ! Flag for direct initialisation … … 541 566 REAL(wp) :: zincwgt ! IAU weight for current time step 542 567 REAL(wp) :: zincper ! IAU interval in seconds 543 !!---------------------------------------------------------------------- 568 !!------------------------------------------------------------------------ 544 569 545 570 IF ( kt <= nit000 ) THEN … … 645 670 END SUBROUTINE slchltot_asm_inc 646 671 647 !!====================================================================== 648 !!====================================================================== 649 !!====================================================================== 672 !!=========================================================================== 673 !!=========================================================================== 674 !!=========================================================================== 650 675 651 676 SUBROUTINE spco2_asm_inc( kt, ll_asmdin, ll_asmiau, kcycper, pwgtiau, & 652 677 & ll_trainc, pt_bkginc, ps_bkginc ) 653 !!---------------------------------------------------------------------- 678 !!------------------------------------------------------------------------ 654 679 !! *** ROUTINE pco2_asm_inc *** 655 680 !! … … 661 686 !! 662 687 !! ** Action : 663 !!---------------------------------------------------------------------- 688 !!------------------------------------------------------------------------ 664 689 INTEGER, INTENT(IN) :: kt ! Current time step 665 690 LOGICAL, INTENT(IN) :: ll_asmdin ! Flag for direct initialisation … … 693 718 REAL(wp) :: zcoef_fco2_7 = 0.118 694 719 REAL(wp) :: zcoef_fco2_8 = 82.0578 695 !!---------------------------------------------------------------------- 720 !!------------------------------------------------------------------------ 696 721 697 722 IF ( kt <= nit000 ) THEN 698 723 699 !-------------------------------------------------------------------- 724 !---------------------------------------------------------------------- 700 725 ! DIC and alkalinity balancing 701 !-------------------------------------------------------------------- 726 !---------------------------------------------------------------------- 702 727 703 728 IF ( ln_sfco2inc ) THEN … … 912 937 END SUBROUTINE spco2_asm_inc 913 938 914 !!====================================================================== 939 !!=========================================================================== 915 940 916 941 END MODULE asmbgc
Note: See TracChangeset
for help on using the changeset viewer.