Changeset 10917
- Timestamp:
- 2019-04-30T16:44:43+02:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/UKMO/AMM15_v3_6_STABLE_package_collate_utils216/NEMOGCM/NEMO/TOP_SRC/TRP/trcsbcssr.F90
r10916 r10917 5 5 !!====================================================================== 6 6 !! History : 3.6 ! 2017-06 (D. Ford) Adapt from sbcssr.F90 7 !! ! 2019-04 (D. Ford) Add biomass balancing and error checking 7 8 !!---------------------------------------------------------------------- 8 9 #if defined key_top … … 50 51 !! surface only (nn_chldmp = 1) 51 52 !! mixed layer (nn_chldmp = 2) 53 !! - balance biomass variables 52 54 !!--------------------------------------------------------------------- 53 55 INTEGER, INTENT(in ) :: kt ! ocean time step … … 55 57 INTEGER :: ji, jj, jk ! dummy loop indices 56 58 57 REAL(wp), DIMENSION(jpi,jpj) :: ztra, zchl 58 REAL(wp) :: zpft 59 REAL(wp), DIMENSION(jpi,jpj) :: zdiff, zchl 60 REAL(wp), DIMENSION(jpi,jpj,jpk,jptra) :: ztra_save, ztra_new 61 REAL(wp) :: zpft, zrat, zinc 62 REAL(wp) :: zmax_chl, zmax_c, zmax_n, zmax_p, zmax_s 63 INTEGER :: inum 59 64 !!---------------------------------------------------------------------- 60 65 ! 61 66 IF( nn_timing == 1 ) CALL timing_start('trc_sbc_ssr') 62 67 ! 68 ! Maximum permitted (absolute) updates to phytoplankton variables 69 zmax_chl = 0.01 70 zmax_c = 0.1 71 zmax_n = 0.01 72 zmax_p = 0.001 73 zmax_s = 0.01 74 63 75 IF( kt == nittrc000 ) THEN 64 76 ! … … 68 80 ! 69 81 IF (lwp) WRITE(numout,*) 'Damping chlorophyll on timestep ', kt 82 83 ztra_save(:,:,:,:) = tra(:,:,:,:) 70 84 ! 71 85 CALL fld_read( kt, 1, sf_chldmp ) ! Read Chl data and provides it at kt … … 76 90 & trb(:,:,1,jp_fabm_m1+jp_fabm_chl3) + & 77 91 & trb(:,:,1,jp_fabm_m1+jp_fabm_chl4) 78 z tra(:,:) = rn_chldmp * ( sf_chldmp(1)%fnow(:,:,1) - zchl(:,:) )92 zdiff(:,:) = rn_chldmp * ( sf_chldmp(1)%fnow(:,:,1) - zchl(:,:) ) 79 93 ! 80 94 DO jj = 2, jpjm1 … … 83 97 & ( sf_chldmp(1)%fnow(ji,jj,1) < 100.0 ) .AND. & 84 98 & ( zchl(ji,jj) > 0.0 ) ) THEN 85 zpft = ( trb(ji,jj,1,jp_fabm_m1+jp_fabm_chl1) / zchl(ji,jj) ) * ztra(ji,jj) 86 tra(ji,jj,1,jp_fabm_m1+jp_fabm_chl1) = tra(ji,jj,1,jp_fabm_m1+jp_fabm_chl1) + zpft 87 IF( nn_chldmp == 2 ) THEN 88 DO jk = 2, jpkm1 89 IF( fsdept(ji,jj,jk) < hmlp (ji,jj) ) THEN 90 tra(ji,jj,jk,jp_fabm_m1+jp_fabm_chl1) = tra(ji,jj,jk,jp_fabm_m1+jp_fabm_chl1) + zpft 91 ENDIF 92 END DO 99 ! P1 100 IF ( ( trb(ji,jj,1,jp_fabm_m1+jp_fabm_chl1) > 0.0 ) .AND. & 101 & ( trb(ji,jj,1,jp_fabm_m1+jp_fabm_p1c) > 0.0 ) .AND. & 102 & ( trb(ji,jj,1,jp_fabm_m1+jp_fabm_p1n) > 0.0 ) .AND. & 103 & ( trb(ji,jj,1,jp_fabm_m1+jp_fabm_p1p) > 0.0 ) .AND. & 104 & ( trb(ji,jj,1,jp_fabm_m1+jp_fabm_p1s) > 0.0 ) ) THEN 105 ! Chlorophyll 106 zpft = ( trb(ji,jj,1,jp_fabm_m1+jp_fabm_chl1) / zchl(ji,jj) ) * zdiff(ji,jj) 107 zpft = MAX( -1.0 * zmax_chl, MIN( zpft, zmax_chl ) ) 108 tra(ji,jj,1,jp_fabm_m1+jp_fabm_chl1) = tra(ji,jj,1,jp_fabm_m1+jp_fabm_chl1) + zpft 109 ! Carbon 110 zrat = trb(ji,jj,1,jp_fabm_m1+jp_fabm_p1c) / trb(ji,jj,1,jp_fabm_m1+jp_fabm_chl1) 111 zinc = MAX( -1.0 * zmax_c, MIN( (zpft * zrat), zmax_c ) ) 112 tra(ji,jj,1,jp_fabm_m1+jp_fabm_p1c) = tra(ji,jj,1,jp_fabm_m1+jp_fabm_p1c) + zinc 113 ! Nitrogen 114 zrat = trb(ji,jj,1,jp_fabm_m1+jp_fabm_p1n) / trb(ji,jj,1,jp_fabm_m1+jp_fabm_chl1) 115 zinc = MAX( -1.0 * zmax_n, MIN( (zpft * zrat), zmax_n ) ) 116 tra(ji,jj,1,jp_fabm_m1+jp_fabm_p1n) = tra(ji,jj,1,jp_fabm_m1+jp_fabm_p1n) + zinc 117 ! Phosphorus 118 zrat = trb(ji,jj,1,jp_fabm_m1+jp_fabm_p1p) / trb(ji,jj,1,jp_fabm_m1+jp_fabm_chl1) 119 zinc = MAX( -1.0 * zmax_p, MIN( (zpft * zrat), zmax_p ) ) 120 tra(ji,jj,1,jp_fabm_m1+jp_fabm_p1p) = tra(ji,jj,1,jp_fabm_m1+jp_fabm_p1p) + zinc 121 ! Silicon 122 zrat = trb(ji,jj,1,jp_fabm_m1+jp_fabm_p1s) / trb(ji,jj,1,jp_fabm_m1+jp_fabm_chl1) 123 zinc = MAX( -1.0 * zmax_s, MIN( (zpft * zrat), zmax_s ) ) 124 tra(ji,jj,1,jp_fabm_m1+jp_fabm_p1s) = tra(ji,jj,1,jp_fabm_m1+jp_fabm_p1s) + zinc 125 ! 126 IF( nn_chldmp == 2 ) THEN 127 ! Mixed layer 128 DO jk = 2, jpkm1 129 IF( fsdept(ji,jj,jk) < hmlp (ji,jj) ) THEN 130 IF ( ( trb(ji,jj,jk,jp_fabm_m1+jp_fabm_chl1) > 0.0 ) .AND. & 131 & ( trb(ji,jj,jk,jp_fabm_m1+jp_fabm_p1c) > 0.0 ) .AND. & 132 & ( trb(ji,jj,jk,jp_fabm_m1+jp_fabm_p1n) > 0.0 ) .AND. & 133 & ( trb(ji,jj,jk,jp_fabm_m1+jp_fabm_p1p) > 0.0 ) .AND. & 134 & ( trb(ji,jj,jk,jp_fabm_m1+jp_fabm_p1s) > 0.0 ) ) THEN 135 ! Chlorophyll 136 tra(ji,jj,jk,jp_fabm_m1+jp_fabm_chl1) = tra(ji,jj,jk,jp_fabm_m1+jp_fabm_chl1) + zpft 137 ! Carbon 138 zrat = trb(ji,jj,jk,jp_fabm_m1+jp_fabm_p1c) / trb(ji,jj,jk,jp_fabm_m1+jp_fabm_chl1) 139 zinc = MAX( -1.0 * zmax_c, MIN( (zpft * zrat), zmax_c ) ) 140 tra(ji,jj,jk,jp_fabm_m1+jp_fabm_p1c) = tra(ji,jj,jk,jp_fabm_m1+jp_fabm_p1c) + zinc 141 ! Nitrogen 142 zrat = trb(ji,jj,jk,jp_fabm_m1+jp_fabm_p1n) / trb(ji,jj,jk,jp_fabm_m1+jp_fabm_chl1) 143 zinc = MAX( -1.0 * zmax_n, MIN( (zpft * zrat), zmax_n ) ) 144 tra(ji,jj,jk,jp_fabm_m1+jp_fabm_p1n) = tra(ji,jj,jk,jp_fabm_m1+jp_fabm_p1n) + zinc 145 ! Phosphorus 146 zrat = trb(ji,jj,jk,jp_fabm_m1+jp_fabm_p1p) / trb(ji,jj,jk,jp_fabm_m1+jp_fabm_chl1) 147 zinc = MAX( -1.0 * zmax_p, MIN( (zpft * zrat), zmax_p ) ) 148 tra(ji,jj,jk,jp_fabm_m1+jp_fabm_p1p) = tra(ji,jj,jk,jp_fabm_m1+jp_fabm_p1p) + zinc 149 ! Silicon 150 zrat = trb(ji,jj,jk,jp_fabm_m1+jp_fabm_p1s) / trb(ji,jj,jk,jp_fabm_m1+jp_fabm_chl1) 151 zinc = MAX( -1.0 * zmax_s, MIN( (zpft * zrat), zmax_s ) ) 152 tra(ji,jj,jk,jp_fabm_m1+jp_fabm_p1s) = tra(ji,jj,jk,jp_fabm_m1+jp_fabm_p1s) + zinc 153 ENDIF 154 ENDIF 155 END DO 156 ENDIF 93 157 ENDIF 94 ! 95 zpft = ( trb(ji,jj,1,jp_fabm_m1+jp_fabm_chl2) / zchl(ji,jj) ) * ztra(ji,jj) 96 tra(ji,jj,1,jp_fabm_m1+jp_fabm_chl2) = tra(ji,jj,1,jp_fabm_m1+jp_fabm_chl2) + zpft 97 IF( nn_chldmp == 2 ) THEN 98 DO jk = 2, jpkm1 99 IF( fsdept(ji,jj,jk) < hmlp (ji,jj) ) THEN 100 tra(ji,jj,jk,jp_fabm_m1+jp_fabm_chl2) = tra(ji,jj,jk,jp_fabm_m1+jp_fabm_chl2) + zpft 101 ENDIF 102 END DO 158 ! P2 159 IF ( ( trb(ji,jj,1,jp_fabm_m1+jp_fabm_chl2) > 0.0 ) .AND. & 160 & ( trb(ji,jj,1,jp_fabm_m1+jp_fabm_p2c) > 0.0 ) .AND. & 161 & ( trb(ji,jj,1,jp_fabm_m1+jp_fabm_p2n) > 0.0 ) .AND. & 162 & ( trb(ji,jj,1,jp_fabm_m1+jp_fabm_p2p) > 0.0 ) ) THEN 163 ! Chlorophyll 164 zpft = ( trb(ji,jj,1,jp_fabm_m1+jp_fabm_chl2) / zchl(ji,jj) ) * zdiff(ji,jj) 165 zpft = MAX( -1.0 * zmax_chl, MIN( zpft, zmax_chl ) ) 166 tra(ji,jj,1,jp_fabm_m1+jp_fabm_chl2) = tra(ji,jj,1,jp_fabm_m1+jp_fabm_chl2) + zpft 167 ! Carbon 168 zrat = trb(ji,jj,1,jp_fabm_m1+jp_fabm_p2c) / trb(ji,jj,1,jp_fabm_m1+jp_fabm_chl2) 169 zinc = MAX( -1.0 * zmax_c, MIN( (zpft * zrat), zmax_c ) ) 170 tra(ji,jj,1,jp_fabm_m1+jp_fabm_p2c) = tra(ji,jj,1,jp_fabm_m1+jp_fabm_p2c) + zinc 171 ! Nitrogen 172 zrat = trb(ji,jj,1,jp_fabm_m1+jp_fabm_p2n) / trb(ji,jj,1,jp_fabm_m1+jp_fabm_chl2) 173 zinc = MAX( -1.0 * zmax_n, MIN( (zpft * zrat), zmax_n ) ) 174 tra(ji,jj,1,jp_fabm_m1+jp_fabm_p2n) = tra(ji,jj,1,jp_fabm_m1+jp_fabm_p2n) + zinc 175 ! Phosphorus 176 zrat = trb(ji,jj,1,jp_fabm_m1+jp_fabm_p2p) / trb(ji,jj,1,jp_fabm_m1+jp_fabm_chl2) 177 zinc = MAX( -1.0 * zmax_p, MIN( (zpft * zrat), zmax_p ) ) 178 tra(ji,jj,1,jp_fabm_m1+jp_fabm_p2p) = tra(ji,jj,1,jp_fabm_m1+jp_fabm_p2p) + zinc 179 ! 180 IF( nn_chldmp == 2 ) THEN 181 ! Mixed layer 182 DO jk = 2, jpkm1 183 IF( fsdept(ji,jj,jk) < hmlp (ji,jj) ) THEN 184 IF ( ( trb(ji,jj,jk,jp_fabm_m1+jp_fabm_chl2) > 0.0 ) .AND. & 185 & ( trb(ji,jj,jk,jp_fabm_m1+jp_fabm_p2c) > 0.0 ) .AND. & 186 & ( trb(ji,jj,jk,jp_fabm_m1+jp_fabm_p2n) > 0.0 ) .AND. & 187 & ( trb(ji,jj,jk,jp_fabm_m1+jp_fabm_p2p) > 0.0 ) ) THEN 188 ! Chlorophyll 189 tra(ji,jj,jk,jp_fabm_m1+jp_fabm_chl2) = tra(ji,jj,jk,jp_fabm_m1+jp_fabm_chl2) + zpft 190 ! Carbon 191 zrat = trb(ji,jj,jk,jp_fabm_m1+jp_fabm_p2c) / trb(ji,jj,jk,jp_fabm_m1+jp_fabm_chl2) 192 zinc = MAX( -1.0 * zmax_c, MIN( (zpft * zrat), zmax_c ) ) 193 tra(ji,jj,jk,jp_fabm_m1+jp_fabm_p2c) = tra(ji,jj,jk,jp_fabm_m1+jp_fabm_p2c) + zinc 194 ! Nitrogen 195 zrat = trb(ji,jj,jk,jp_fabm_m1+jp_fabm_p2n) / trb(ji,jj,jk,jp_fabm_m1+jp_fabm_chl2) 196 zinc = MAX( -1.0 * zmax_n, MIN( (zpft * zrat), zmax_n ) ) 197 tra(ji,jj,jk,jp_fabm_m1+jp_fabm_p2n) = tra(ji,jj,jk,jp_fabm_m1+jp_fabm_p2n) + zinc 198 ! Phosphorus 199 zrat = trb(ji,jj,jk,jp_fabm_m1+jp_fabm_p2p) / trb(ji,jj,jk,jp_fabm_m1+jp_fabm_chl2) 200 zinc = MAX( -1.0 * zmax_p, MIN( (zpft * zrat), zmax_p ) ) 201 tra(ji,jj,jk,jp_fabm_m1+jp_fabm_p2p) = tra(ji,jj,jk,jp_fabm_m1+jp_fabm_p2p) + zinc 202 ENDIF 203 ENDIF 204 END DO 205 ENDIF 103 206 ENDIF 104 ! 105 zpft = ( trb(ji,jj,1,jp_fabm_m1+jp_fabm_chl3) / zchl(ji,jj) ) * ztra(ji,jj) 106 tra(ji,jj,1,jp_fabm_m1+jp_fabm_chl3) = tra(ji,jj,1,jp_fabm_m1+jp_fabm_chl3) + zpft 107 IF( nn_chldmp == 2 ) THEN 108 DO jk = 2, jpkm1 109 IF( fsdept(ji,jj,jk) < hmlp (ji,jj) ) THEN 110 tra(ji,jj,jk,jp_fabm_m1+jp_fabm_chl3) = tra(ji,jj,jk,jp_fabm_m1+jp_fabm_chl3) + zpft 111 ENDIF 112 END DO 207 ! P3 208 IF ( ( trb(ji,jj,1,jp_fabm_m1+jp_fabm_chl3) > 0.0 ) .AND. & 209 & ( trb(ji,jj,1,jp_fabm_m1+jp_fabm_p3c) > 0.0 ) .AND. & 210 & ( trb(ji,jj,1,jp_fabm_m1+jp_fabm_p3n) > 0.0 ) .AND. & 211 & ( trb(ji,jj,1,jp_fabm_m1+jp_fabm_p3p) > 0.0 ) ) THEN 212 ! Chlorophyll 213 zpft = ( trb(ji,jj,1,jp_fabm_m1+jp_fabm_chl3) / zchl(ji,jj) ) * zdiff(ji,jj) 214 zpft = MAX( -1.0 * zmax_chl, MIN( zpft, zmax_chl ) ) 215 tra(ji,jj,1,jp_fabm_m1+jp_fabm_chl3) = tra(ji,jj,1,jp_fabm_m1+jp_fabm_chl3) + zpft 216 ! Carbon 217 zrat = trb(ji,jj,1,jp_fabm_m1+jp_fabm_p3c) / trb(ji,jj,1,jp_fabm_m1+jp_fabm_chl3) 218 zinc = MAX( -1.0 * zmax_c, MIN( (zpft * zrat), zmax_c ) ) 219 tra(ji,jj,1,jp_fabm_m1+jp_fabm_p3c) = tra(ji,jj,1,jp_fabm_m1+jp_fabm_p3c) + zinc 220 ! Nitrogen 221 zrat = trb(ji,jj,1,jp_fabm_m1+jp_fabm_p3n) / trb(ji,jj,1,jp_fabm_m1+jp_fabm_chl3) 222 zinc = MAX( -1.0 * zmax_n, MIN( (zpft * zrat), zmax_n ) ) 223 tra(ji,jj,1,jp_fabm_m1+jp_fabm_p3n) = tra(ji,jj,1,jp_fabm_m1+jp_fabm_p3n) + zinc 224 ! Phosphorus 225 zrat = trb(ji,jj,1,jp_fabm_m1+jp_fabm_p3p) / trb(ji,jj,1,jp_fabm_m1+jp_fabm_chl3) 226 zinc = MAX( -1.0 * zmax_p, MIN( (zpft * zrat), zmax_p ) ) 227 tra(ji,jj,1,jp_fabm_m1+jp_fabm_p3p) = tra(ji,jj,1,jp_fabm_m1+jp_fabm_p3p) + zinc 228 ! 229 IF( nn_chldmp == 2 ) THEN 230 ! Mixed layer 231 DO jk = 2, jpkm1 232 IF( fsdept(ji,jj,jk) < hmlp (ji,jj) ) THEN 233 IF ( ( trb(ji,jj,jk,jp_fabm_m1+jp_fabm_chl3) > 0.0 ) .AND. & 234 & ( trb(ji,jj,jk,jp_fabm_m1+jp_fabm_p3c) > 0.0 ) .AND. & 235 & ( trb(ji,jj,jk,jp_fabm_m1+jp_fabm_p3n) > 0.0 ) .AND. & 236 & ( trb(ji,jj,jk,jp_fabm_m1+jp_fabm_p3p) > 0.0 ) ) THEN 237 ! Chlorophyll 238 tra(ji,jj,jk,jp_fabm_m1+jp_fabm_chl3) = tra(ji,jj,jk,jp_fabm_m1+jp_fabm_chl3) + zpft 239 ! Carbon 240 zrat = trb(ji,jj,jk,jp_fabm_m1+jp_fabm_p3c) / trb(ji,jj,jk,jp_fabm_m1+jp_fabm_chl3) 241 zinc = MAX( -1.0 * zmax_c, MIN( (zpft * zrat), zmax_c ) ) 242 tra(ji,jj,jk,jp_fabm_m1+jp_fabm_p3c) = tra(ji,jj,jk,jp_fabm_m1+jp_fabm_p3c) + zinc 243 ! Nitrogen 244 zrat = trb(ji,jj,jk,jp_fabm_m1+jp_fabm_p3n) / trb(ji,jj,jk,jp_fabm_m1+jp_fabm_chl3) 245 zinc = MAX( -1.0 * zmax_n, MIN( (zpft * zrat), zmax_n ) ) 246 tra(ji,jj,jk,jp_fabm_m1+jp_fabm_p3n) = tra(ji,jj,jk,jp_fabm_m1+jp_fabm_p3n) + zinc 247 ! Phosphorus 248 zrat = trb(ji,jj,jk,jp_fabm_m1+jp_fabm_p3p) / trb(ji,jj,jk,jp_fabm_m1+jp_fabm_chl3) 249 zinc = MAX( -1.0 * zmax_p, MIN( (zpft * zrat), zmax_p ) ) 250 tra(ji,jj,jk,jp_fabm_m1+jp_fabm_p3p) = tra(ji,jj,jk,jp_fabm_m1+jp_fabm_p3p) + zinc 251 ENDIF 252 ENDIF 253 END DO 254 ENDIF 113 255 ENDIF 114 ! 115 zpft = ( trb(ji,jj,1,jp_fabm_m1+jp_fabm_chl4) / zchl(ji,jj) ) * ztra(ji,jj) 116 tra(ji,jj,1,jp_fabm_m1+jp_fabm_chl4) = tra(ji,jj,1,jp_fabm_m1+jp_fabm_chl4) + zpft 117 IF( nn_chldmp == 2 ) THEN 118 DO jk = 2, jpkm1 119 IF( fsdept(ji,jj,jk) < hmlp (ji,jj) ) THEN 120 tra(ji,jj,jk,jp_fabm_m1+jp_fabm_chl4) = tra(ji,jj,jk,jp_fabm_m1+jp_fabm_chl4) + zpft 121 ENDIF 122 END DO 256 ! P4 257 IF ( ( trb(ji,jj,1,jp_fabm_m1+jp_fabm_chl4) > 0.0 ) .AND. & 258 & ( trb(ji,jj,1,jp_fabm_m1+jp_fabm_p4c) > 0.0 ) .AND. & 259 & ( trb(ji,jj,1,jp_fabm_m1+jp_fabm_p4n) > 0.0 ) .AND. & 260 & ( trb(ji,jj,1,jp_fabm_m1+jp_fabm_p4p) > 0.0 ) ) THEN 261 ! Chlorophyll 262 zpft = ( trb(ji,jj,1,jp_fabm_m1+jp_fabm_chl4) / zchl(ji,jj) ) * zdiff(ji,jj) 263 zpft = MAX( -1.0 * zmax_chl, MIN( zpft, zmax_chl ) ) 264 tra(ji,jj,1,jp_fabm_m1+jp_fabm_chl4) = tra(ji,jj,1,jp_fabm_m1+jp_fabm_chl4) + zpft 265 ! Carbon 266 zrat = trb(ji,jj,1,jp_fabm_m1+jp_fabm_p4c) / trb(ji,jj,1,jp_fabm_m1+jp_fabm_chl4) 267 zinc = MAX( -1.0 * zmax_c, MIN( (zpft * zrat), zmax_c ) ) 268 tra(ji,jj,1,jp_fabm_m1+jp_fabm_p4c) = tra(ji,jj,1,jp_fabm_m1+jp_fabm_p4c) + zinc 269 ! Nitrogen 270 zrat = trb(ji,jj,1,jp_fabm_m1+jp_fabm_p4n) / trb(ji,jj,1,jp_fabm_m1+jp_fabm_chl4) 271 zinc = MAX( -1.0 * zmax_n, MIN( (zpft * zrat), zmax_n ) ) 272 tra(ji,jj,1,jp_fabm_m1+jp_fabm_p4n) = tra(ji,jj,1,jp_fabm_m1+jp_fabm_p4n) + zinc 273 ! Phosphorus 274 zrat = trb(ji,jj,1,jp_fabm_m1+jp_fabm_p4p) / trb(ji,jj,1,jp_fabm_m1+jp_fabm_chl4) 275 zinc = MAX( -1.0 * zmax_p, MIN( (zpft * zrat), zmax_p ) ) 276 tra(ji,jj,1,jp_fabm_m1+jp_fabm_p4p) = tra(ji,jj,1,jp_fabm_m1+jp_fabm_p4p) + zinc 277 ! 278 IF( nn_chldmp == 2 ) THEN 279 ! Mixed layer 280 DO jk = 2, jpkm1 281 IF( fsdept(ji,jj,jk) < hmlp (ji,jj) ) THEN 282 IF ( ( trb(ji,jj,jk,jp_fabm_m1+jp_fabm_chl4) > 0.0 ) .AND. & 283 & ( trb(ji,jj,jk,jp_fabm_m1+jp_fabm_p4c) > 0.0 ) .AND. & 284 & ( trb(ji,jj,jk,jp_fabm_m1+jp_fabm_p4n) > 0.0 ) .AND. & 285 & ( trb(ji,jj,jk,jp_fabm_m1+jp_fabm_p4p) > 0.0 ) ) THEN 286 ! Chlorophyll 287 tra(ji,jj,jk,jp_fabm_m1+jp_fabm_chl4) = tra(ji,jj,jk,jp_fabm_m1+jp_fabm_chl4) + zpft 288 ! Carbon 289 zrat = trb(ji,jj,jk,jp_fabm_m1+jp_fabm_p4c) / trb(ji,jj,jk,jp_fabm_m1+jp_fabm_chl4) 290 zinc = MAX( -1.0 * zmax_c, MIN( (zpft * zrat), zmax_c ) ) 291 tra(ji,jj,jk,jp_fabm_m1+jp_fabm_p4c) = tra(ji,jj,jk,jp_fabm_m1+jp_fabm_p4c) + zinc 292 ! Nitrogen 293 zrat = trb(ji,jj,jk,jp_fabm_m1+jp_fabm_p4n) / trb(ji,jj,jk,jp_fabm_m1+jp_fabm_chl4) 294 zinc = MAX( -1.0 * zmax_n, MIN( (zpft * zrat), zmax_n ) ) 295 tra(ji,jj,jk,jp_fabm_m1+jp_fabm_p4n) = tra(ji,jj,jk,jp_fabm_m1+jp_fabm_p4n) + zinc 296 ! Phosphorus 297 zrat = trb(ji,jj,jk,jp_fabm_m1+jp_fabm_p4p) / trb(ji,jj,jk,jp_fabm_m1+jp_fabm_chl4) 298 zinc = MAX( -1.0 * zmax_p, MIN( (zpft * zrat), zmax_p ) ) 299 tra(ji,jj,jk,jp_fabm_m1+jp_fabm_p4p) = tra(ji,jj,jk,jp_fabm_m1+jp_fabm_p4p) + zinc 300 ENDIF 301 ENDIF 302 END DO 303 ENDIF 123 304 ENDIF 124 305 ENDIF 125 306 END DO 126 307 END DO 308 309 ! Save updates 310 ztra_new(:,:,:,:) = tra(:,:,:,:) - ztra_save(:,:,:,:) 311 CALL iom_open( 'chldmp.balincs', inum, ldwrt = .TRUE., kiolib = jprstlib) 312 zdiff(:,:) = zdiff(:,:) * tmask(:,:,1) 313 CALL iom_rstput( kt, kt, inum, 'ChlTot', zdiff(:,:) ) 314 CALL iom_rstput( kt, kt, inum, 'P1_Chl', ztra_new(:,:,:,jp_fabm_chl1) ) 315 CALL iom_rstput( kt, kt, inum, 'P1_c', ztra_new(:,:,:,jp_fabm_p1c) ) 316 CALL iom_rstput( kt, kt, inum, 'P1_n', ztra_new(:,:,:,jp_fabm_p1n) ) 317 CALL iom_rstput( kt, kt, inum, 'P1_p', ztra_new(:,:,:,jp_fabm_p1p) ) 318 CALL iom_rstput( kt, kt, inum, 'P1_s', ztra_new(:,:,:,jp_fabm_p1s) ) 319 CALL iom_rstput( kt, kt, inum, 'P2_Chl', ztra_new(:,:,:,jp_fabm_chl2) ) 320 CALL iom_rstput( kt, kt, inum, 'P2_c', ztra_new(:,:,:,jp_fabm_p2c) ) 321 CALL iom_rstput( kt, kt, inum, 'P2_n', ztra_new(:,:,:,jp_fabm_p2n) ) 322 CALL iom_rstput( kt, kt, inum, 'P2_p', ztra_new(:,:,:,jp_fabm_p2p) ) 323 CALL iom_rstput( kt, kt, inum, 'P3_Chl', ztra_new(:,:,:,jp_fabm_chl3) ) 324 CALL iom_rstput( kt, kt, inum, 'P3_c', ztra_new(:,:,:,jp_fabm_p3c) ) 325 CALL iom_rstput( kt, kt, inum, 'P3_n', ztra_new(:,:,:,jp_fabm_p3n) ) 326 CALL iom_rstput( kt, kt, inum, 'P3_p', ztra_new(:,:,:,jp_fabm_p3p) ) 327 CALL iom_rstput( kt, kt, inum, 'P4_Chl', ztra_new(:,:,:,jp_fabm_chl4) ) 328 CALL iom_rstput( kt, kt, inum, 'P4_c', ztra_new(:,:,:,jp_fabm_p4c) ) 329 CALL iom_rstput( kt, kt, inum, 'P4_n', ztra_new(:,:,:,jp_fabm_p4n) ) 330 CALL iom_rstput( kt, kt, inum, 'P4_p', ztra_new(:,:,:,jp_fabm_p4p) ) 331 CALL iom_close( inum ) 127 332 #else 128 333 CALL ctl_stop( 'STOP', 'trc_sbc_ssr: only works with FABM-ERSEM' )
Note: See TracChangeset
for help on using the changeset viewer.