Changeset 10707
- Timestamp:
- 2019-02-20T19:15:35+01:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/UKMO/AMM15_v3_6_STABLE_package_collate_BGC_DA/NEMOGCM/NEMO/OPA_SRC/ASM/asmphyto2dbal_ersem.F90
r10667 r10707 100 100 !!--------------------------------------------------------------------------- 101 101 !! 102 LOGICAL, INTENT(in ) :: ld_chltot ! Assim chltot y/n103 REAL(wp), INTENT(inout), DIMENSION(jpi,jpj) :: pinc_chltot ! chltot increments104 LOGICAL, INTENT(in ) :: ld_chldia ! Assim chldia y/n105 REAL(wp), INTENT(inout), DIMENSION(jpi,jpj) :: pinc_chldia ! chldia increments106 LOGICAL, INTENT(in ) :: ld_chlnan ! Assim chlnan y/n107 REAL(wp), INTENT(inout), DIMENSION(jpi,jpj) :: pinc_chlnan ! chlnan increments108 LOGICAL, INTENT(in ) :: ld_chlpic ! Assim chlpic y/n109 REAL(wp), INTENT(inout), DIMENSION(jpi,jpj) :: pinc_chlpic ! chlpic increments110 LOGICAL, INTENT(in ) :: ld_chldin ! Assim chldin y/n111 REAL(wp), INTENT(inout), DIMENSION(jpi,jpj) :: pinc_chldin ! chldin increments112 REAL(wp), INTENT(in ) :: pincper ! Assimilation period113 REAL(wp), INTENT(in ) :: p_maxchlinc ! Max chl increment114 LOGICAL, INTENT(in ) :: ld_phytobal ! Balancing y/n115 REAL(wp), INTENT(inout), DIMENSION(jpi,jpj) :: pmld ! Mixed layer depth116 REAL(wp), INTENT(in ), DIMENSION(jpi,jpj) :: pgrow_avg_bkg ! Avg phyto growth117 REAL(wp), INTENT(in ), DIMENSION(jpi,jpj) :: ploss_avg_bkg ! Avg phyto loss118 REAL(wp), INTENT(in ), DIMENSION(jpi,jpj) :: phyt_avg_bkg ! Avg phyto119 REAL(wp), INTENT(in ), DIMENSION(jpi,jpj) :: mld_max_bkg ! Max MLD120 REAL(wp), INTENT(in ), DIMENSION(jpi,jpj,jpk) :: totalk_bkg ! Total alkalinity121 REAL(wp), INTENT(in ), DIMENSION(jpi,jpj,jpk,jptra) :: tracer_bkg ! State variables122 REAL(wp), INTENT( out), DIMENSION(jpi,jpj,jpk,jptra) :: phyto2d_balinc ! Balancing increments102 LOGICAL, INTENT(in ) :: ld_chltot ! Assim chltot y/n 103 REAL(wp), INTENT(inout), DIMENSION(jpi,jpj) :: pinc_chltot ! chltot increments 104 LOGICAL, INTENT(in ) :: ld_chldia ! Assim chldia y/n 105 REAL(wp), INTENT(inout), DIMENSION(jpi,jpj) :: pinc_chldia ! chldia increments 106 LOGICAL, INTENT(in ) :: ld_chlnan ! Assim chlnan y/n 107 REAL(wp), INTENT(inout), DIMENSION(jpi,jpj) :: pinc_chlnan ! chlnan increments 108 LOGICAL, INTENT(in ) :: ld_chlpic ! Assim chlpic y/n 109 REAL(wp), INTENT(inout), DIMENSION(jpi,jpj) :: pinc_chlpic ! chlpic increments 110 LOGICAL, INTENT(in ) :: ld_chldin ! Assim chldin y/n 111 REAL(wp), INTENT(inout), DIMENSION(jpi,jpj) :: pinc_chldin ! chldin increments 112 REAL(wp), INTENT(in ) :: pincper ! Assimilation period 113 REAL(wp), INTENT(in ) :: p_maxchlinc ! Max chl increment 114 LOGICAL, INTENT(in ) :: ld_phytobal ! Balancing y/n 115 REAL(wp), INTENT(inout), DIMENSION(jpi,jpj) :: pmld ! Mixed layer depth 116 REAL(wp), INTENT(in ), DIMENSION(jpi,jpj) :: pgrow_avg_bkg ! Avg phyto growth 117 REAL(wp), INTENT(in ), DIMENSION(jpi,jpj) :: ploss_avg_bkg ! Avg phyto loss 118 REAL(wp), INTENT(in ), DIMENSION(jpi,jpj) :: phyt_avg_bkg ! Avg phyto 119 REAL(wp), INTENT(in ), DIMENSION(jpi,jpj) :: mld_max_bkg ! Max MLD 120 REAL(wp), INTENT(in ), DIMENSION(jpi,jpj,jpk) :: totalk_bkg ! Total alkalinity 121 REAL(wp), INTENT(in ), DIMENSION(jpi,jpj,jpk,jptra) :: tracer_bkg ! State variables 122 REAL(wp), INTENT( out), DIMENSION(jpi,jpj,jpk,jptra) :: phyto2d_balinc ! Balancing increments 123 123 !! 124 INTEGER :: ji, jj, jk, jn ! Loop counters 125 INTEGER :: jkmax ! Loop index 126 INTEGER, DIMENSION(6) :: i_tracer ! Tracer indices 127 REAL(wp) :: zmassc ! Carbon molar mass 128 REAL(wp) :: zmassn ! Nitrogen molar mass 129 REAL(wp) :: z4qnc ! Z4/qnc (mesozoo N:C) 130 REAL(wp) :: n2be_p ! N:biomass for total phy 131 REAL(wp) :: n2be_z ! N:biomass for total zoo 132 REAL(wp) :: n2be_d ! N:biomass for detritus 133 REAL(wp) :: zfrac ! Fractions 134 REAL(wp) :: zfrac_chl1 ! 135 REAL(wp) :: zfrac_chl2 ! 136 REAL(wp) :: zfrac_chl3 ! 137 REAL(wp) :: zfrac_chl4 ! 138 REAL(wp) :: zfrac_p1n ! 139 REAL(wp) :: zfrac_p2n ! 140 REAL(wp) :: zfrac_p3n ! 141 REAL(wp) :: zfrac_p4n ! 142 REAL(wp) :: zfrac_z4n ! 143 REAL(wp) :: zfrac_z5n ! 144 REAL(wp) :: zfrac_z6n ! 145 REAL(wp) :: zfrac_n3n ! 146 REAL(wp) :: zfrac_n4n ! 147 REAL(wp) :: zfrac_r4n ! 148 REAL(wp) :: zfrac_r6n ! 149 REAL(wp) :: zfrac_r8n ! 150 REAL(wp) :: zrat_chl1_p1n ! Ratios 151 REAL(wp) :: zrat_p1c_p1n ! 152 REAL(wp) :: zrat_p1p_p1n ! 153 REAL(wp) :: zrat_p1s_p1n ! 154 REAL(wp) :: zrat_chl2_p2n ! 155 REAL(wp) :: zrat_p2c_p2n ! 156 REAL(wp) :: zrat_p2p_p2n ! 157 REAL(wp) :: zrat_chl3_p3n ! 158 REAL(wp) :: zrat_p3c_p3n ! 159 REAL(wp) :: zrat_p3p_p3n ! 160 REAL(wp) :: zrat_chl4_p4n ! 161 REAL(wp) :: zrat_p4c_p4n ! 162 REAL(wp) :: zrat_p4p_p4n ! 163 REAL(wp) :: zrat_z4c_z4n ! 164 REAL(wp) :: zrat_z5c_z5n ! 165 REAL(wp) :: zrat_z5p_z5n ! 166 REAL(wp) :: zrat_z6c_z6n ! 167 REAL(wp) :: zrat_z6p_z6n ! 168 REAL(wp) :: zrat_r4c_r4n ! 169 REAL(wp) :: zrat_r4p_r4n ! 170 REAL(wp) :: zrat_r6c_r6n ! 171 REAL(wp) :: zrat_r6p_r6n ! 172 REAL(wp) :: zrat_r6s_r6n ! 173 REAL(wp) :: zrat_r8c_r8n ! 174 REAL(wp) :: zrat_r8p_r8n ! 175 REAL(wp) :: zrat_r8s_r8n ! 176 REAL(wp) :: zrat_p1c_chl1 ! 177 REAL(wp) :: zrat_p1n_chl1 ! 178 REAL(wp) :: zrat_p1p_chl1 ! 179 REAL(wp) :: zrat_p1s_chl1 ! 180 REAL(wp) :: zrat_p2c_chl2 ! 181 REAL(wp) :: zrat_p2n_chl2 ! 182 REAL(wp) :: zrat_p2p_chl2 ! 183 REAL(wp) :: zrat_p3c_chl3 ! 184 REAL(wp) :: zrat_p3n_chl3 ! 185 REAL(wp) :: zrat_p3p_chl3 ! 186 REAL(wp) :: zrat_p4c_chl4 ! 187 REAL(wp) :: zrat_p4n_chl4 ! 188 REAL(wp) :: zrat_p4p_chl4 ! 189 REAL(wp), DIMENSION(jpi,jpj) :: cchl_p ! C:Chl for total phy 190 REAL(wp), DIMENSION(16) :: modparm ! Model parameters 191 REAL(wp), DIMENSION(20) :: assimparm ! Assimilation parameters 192 REAL(wp), DIMENSION(jpi,jpj,jpk,6) :: bstate ! Background state 193 REAL(wp), DIMENSION(jpi,jpj,jpk,6) :: outincs ! Balancing increments 194 REAL(wp), DIMENSION(jpi,jpj,22) :: diag ! Depth-indep diagnostics 195 REAL(wp), DIMENSION(jpi,jpj,jpk,22) :: diag_fulldepth ! Full-depth diagnostics 196 REAL(wp), DIMENSION(jpi,jpj) :: pinc_chltot_temp 124 INTEGER :: ji, jj, jk, jn ! Loop counters 125 INTEGER :: jkmax ! Loop index 126 INTEGER, DIMENSION(6) :: i_tracer ! Tracer indices 127 REAL(wp) :: zmassc ! Carbon molar mass 128 REAL(wp) :: zmassn ! Nitrogen molar mass 129 REAL(wp) :: z4qnc ! Z4/qnc (mesozoo N:C) 130 REAL(wp) :: n2be_p ! N:biomass for total phy 131 REAL(wp) :: n2be_z ! N:biomass for total zoo 132 REAL(wp) :: n2be_d ! N:biomass for detritus 133 REAL(wp) :: zfrac ! Fractions 134 REAL(wp) :: zfrac_chl1 ! 135 REAL(wp) :: zfrac_chl2 ! 136 REAL(wp) :: zfrac_chl3 ! 137 REAL(wp) :: zfrac_chl4 ! 138 REAL(wp) :: zfrac_p1n ! 139 REAL(wp) :: zfrac_p2n ! 140 REAL(wp) :: zfrac_p3n ! 141 REAL(wp) :: zfrac_p4n ! 142 REAL(wp) :: zfrac_z4n ! 143 REAL(wp) :: zfrac_z5n ! 144 REAL(wp) :: zfrac_z6n ! 145 REAL(wp) :: zfrac_n3n ! 146 REAL(wp) :: zfrac_n4n ! 147 REAL(wp) :: zfrac_r4n ! 148 REAL(wp) :: zfrac_r6n ! 149 REAL(wp) :: zfrac_r8n ! 150 REAL(wp) :: zrat_chl1_p1n ! Ratios 151 REAL(wp) :: zrat_p1c_p1n ! 152 REAL(wp) :: zrat_p1p_p1n ! 153 REAL(wp) :: zrat_p1s_p1n ! 154 REAL(wp) :: zrat_chl2_p2n ! 155 REAL(wp) :: zrat_p2c_p2n ! 156 REAL(wp) :: zrat_p2p_p2n ! 157 REAL(wp) :: zrat_chl3_p3n ! 158 REAL(wp) :: zrat_p3c_p3n ! 159 REAL(wp) :: zrat_p3p_p3n ! 160 REAL(wp) :: zrat_chl4_p4n ! 161 REAL(wp) :: zrat_p4c_p4n ! 162 REAL(wp) :: zrat_p4p_p4n ! 163 REAL(wp) :: zrat_z4c_z4n ! 164 REAL(wp) :: zrat_z5c_z5n ! 165 REAL(wp) :: zrat_z5p_z5n ! 166 REAL(wp) :: zrat_z6c_z6n ! 167 REAL(wp) :: zrat_z6p_z6n ! 168 REAL(wp) :: zrat_r4c_r4n ! 169 REAL(wp) :: zrat_r4p_r4n ! 170 REAL(wp) :: zrat_r6c_r6n ! 171 REAL(wp) :: zrat_r6p_r6n ! 172 REAL(wp) :: zrat_r6s_r6n ! 173 REAL(wp) :: zrat_r8c_r8n ! 174 REAL(wp) :: zrat_r8p_r8n ! 175 REAL(wp) :: zrat_r8s_r8n ! 176 REAL(wp) :: zrat_p1c_chl1 ! 177 REAL(wp) :: zrat_p1n_chl1 ! 178 REAL(wp) :: zrat_p1p_chl1 ! 179 REAL(wp) :: zrat_p1s_chl1 ! 180 REAL(wp) :: zrat_p2c_chl2 ! 181 REAL(wp) :: zrat_p2n_chl2 ! 182 REAL(wp) :: zrat_p2p_chl2 ! 183 REAL(wp) :: zrat_p3c_chl3 ! 184 REAL(wp) :: zrat_p3n_chl3 ! 185 REAL(wp) :: zrat_p3p_chl3 ! 186 REAL(wp) :: zrat_p4c_chl4 ! 187 REAL(wp) :: zrat_p4n_chl4 ! 188 REAL(wp) :: zrat_p4p_chl4 ! 189 REAL(wp), DIMENSION(jpi,jpj) :: cchl_p ! C:Chl for total phy 190 REAL(wp), DIMENSION(16) :: modparm ! Model parameters 191 REAL(wp), DIMENSION(20) :: assimparm ! Assimilation parameters 192 REAL(wp), DIMENSION(jpi,jpj,jpk,6) :: bstate ! Background state 193 REAL(wp), DIMENSION(jpi,jpj,jpk,6) :: outincs ! Balancing increments 194 REAL(wp), DIMENSION(jpi,jpj,22) :: diag ! Depth-indep diagnostics 195 REAL(wp), DIMENSION(jpi,jpj,jpk,22) :: diag_fulldepth ! Full-depth diagnostics 196 REAL(wp), DIMENSION(jpi,jpj) :: pinc_chltot_temp ! Temporary array 197 INTEGER, DIMENSION(1) :: zkmt ! No. sea points in column 197 198 !!--------------------------------------------------------------------------- 198 199 … … 300 301 modparm(8) = 0.05 ! z_mort_1 301 302 modparm(9) = 1.0 ! z_mort_2 302 modparm(10) = 6.625 ! c2n_p303 modparm(11) = 5.625 ! c2n_z304 modparm(12) = 7.5 ! c2n_d303 !modparm(10) = 6.625 ! c2n_p - set later per grid point 304 !modparm(11) = 5.625 ! c2n_z - set later per grid point 305 !modparm(12) = 7.5 ! c2n_d - set later per grid point 305 306 modparm(13) = 0.01 ! graze_threshold 306 307 modparm(14) = 2.0 ! holling_coef … … 372 373 END DO 373 374 END DO 374 n2be_p = zmassn + ( zmassc * modparm(10) ) 375 n2be_z = zmassn + ( zmassc * modparm(11) ) 376 n2be_d = zmassn + ( zmassc * modparm(12) ) 377 378 ! Call nitrogen balancing routine 379 CALL bio_analysis( jpi, jpj, jpk, gdepw_n(:,:,2:jpk), i_tracer, modparm, & 380 & n2be_p, n2be_z, n2be_d, assimparm, & 381 & INT(pincper), 1, INT(SUM(tmask,3)), tmask(:,:,:), & 382 & pmld(:,:), mld_max_bkg(:,:), pinc_chltot(:,:), cchl_p(:,:), & 383 & nbal_active, phyt_avg_bkg(:,:), & 384 & gl_active, pgrow_avg_bkg(:,:), ploss_avg_bkg(:,:), & 385 & subsurf_active, deepneg_active, & 386 & deeppos_active, nutprof_active, & 387 & bstate, outincs, & 388 & diag_active, diag, & 389 & diag_fulldepth_active, diag_fulldepth ) 375 376 ! Call nitrogen balancing routine - loop over grid points due to variable C:N ratios 377 DO jj = 1, jpj 378 DO ji = 1, jpi 379 ! Phytoplankton C:N 380 modparm(10) = ( tracer_bkg(ji,jj,1,jp_fabm_m1+jp_fabm_p1c) + & 381 & tracer_bkg(ji,jj,1,jp_fabm_m1+jp_fabm_p2c) + & 382 & tracer_bkg(ji,jj,1,jp_fabm_m1+jp_fabm_p3c) + & 383 & tracer_bkg(ji,jj,1,jp_fabm_m1+jp_fabm_p4c) ) / & 384 & ( tracer_bkg(ji,jj,1,jp_fabm_m1+jp_fabm_p1n) + & 385 & tracer_bkg(ji,jj,1,jp_fabm_m1+jp_fabm_p2n) + & 386 & tracer_bkg(ji,jj,1,jp_fabm_m1+jp_fabm_p3n) + & 387 & tracer_bkg(ji,jj,1,jp_fabm_m1+jp_fabm_p4n) ) 388 ! Zooplankton C:N 389 modparm(11) = ( tracer_bkg(ji,jj,1,jp_fabm_m1+jp_fabm_z4c) + & 390 & tracer_bkg(ji,jj,1,jp_fabm_m1+jp_fabm_z5c) + & 391 & tracer_bkg(ji,jj,1,jp_fabm_m1+jp_fabm_z6c) ) / & 392 & ( (tracer_bkg(ji,jj,1,jp_fabm_m1+jp_fabm_z4c) * z4qnc) + & 393 & tracer_bkg(ji,jj,1,jp_fabm_m1+jp_fabm_z5n) + & 394 & tracer_bkg(ji,jj,1,jp_fabm_m1+jp_fabm_z6n) ) 395 ! Detritus C:N 396 modparm(12) = ( tracer_bkg(ji,jj,1,jp_fabm_m1+jp_fabm_r4c) + & 397 & tracer_bkg(ji,jj,1,jp_fabm_m1+jp_fabm_r6c) + & 398 & tracer_bkg(ji,jj,1,jp_fabm_m1+jp_fabm_r8c) ) / & 399 & ( tracer_bkg(ji,jj,1,jp_fabm_m1+jp_fabm_r4n) + & 400 & tracer_bkg(ji,jj,1,jp_fabm_m1+jp_fabm_r6n) + & 401 & tracer_bkg(ji,jj,1,jp_fabm_m1+jp_fabm_r8n) ) 402 ! Nitrogen to biomass equivalent for PZD 403 n2be_p = zmassn + ( zmassc * modparm(10) ) 404 n2be_z = zmassn + ( zmassc * modparm(11) ) 405 n2be_d = zmassn + ( zmassc * modparm(12) ) 406 zkmt(:) = INT(SUM(tmask(ji,jj,:))) 407 CALL bio_analysis( 1, 1, jpk, gdepw_n(ji,jj,2:jpk), i_tracer, modparm, & 408 & n2be_p, n2be_z, n2be_d, assimparm, & 409 & INT(pincper), 1, zkmt, tmask(ji,jj,:), & 410 & pmld(ji,jj), mld_max_bkg(ji,jj), pinc_chltot(ji,jj), cchl_p(ji,jj), & 411 & nbal_active, phyt_avg_bkg(ji,jj), & 412 & gl_active, pgrow_avg_bkg(ji,jj), ploss_avg_bkg(ji,jj), & 413 & subsurf_active, deepneg_active, & 414 & deeppos_active, nutprof_active, & 415 & bstate(ji,jj,:,:), outincs(ji,jj,:,:), & 416 & diag_active, diag(ji,jj,:), & 417 & diag_fulldepth_active, diag_fulldepth(ji,jj,:,:) ) 418 END DO 419 END DO 390 420 391 421 ! Loop over each grid point partioning the increments
Note: See TracChangeset
for help on using the changeset viewer.