Changeset 15459 for NEMO/trunk/src/TOP/PISCES/P4Z/p4zsms.F90
- Timestamp:
- 2021-10-29T10:19:18+02:00 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
NEMO/trunk/src/TOP/PISCES/P4Z/p4zsms.F90
r15182 r15459 30 30 PRIVATE 31 31 32 PUBLIC p4z_sms_init ! called in p4zsms.F9033 PUBLIC p4z_sms ! called in p4zsms.F9032 PUBLIC p4z_sms_init ! called in trcini_pisces.F90 33 PUBLIC p4z_sms ! called in trcsms_pisces.F90 34 34 35 35 INTEGER :: numco2, numnut, numnit ! logical unit for co2 budget 36 REAL(wp) :: alkbudget, no3budget, silbudget, ferbudget, po4budget 36 REAL(wp) :: alkbudget, no3budget, silbudget, ferbudget, po4budget ! total budget of the different conservative elements 37 37 REAL(wp) :: xfact, xfact1, xfact2, xfact3 38 38 … … 56 56 !! routines of PISCES bio-model 57 57 !! 58 !! ** Method : - at each new day ... 59 !! - several calls of bio and sed ??? 60 !! - ... 58 !! ** Method : - calls the various SMS subroutines 59 !! - calls the sediment module (if ln_sediment) 60 !! - several calls of bio and sed (possible time-splitting) 61 !! - handles the potential negative concentrations (xnegtr) 61 62 !!--------------------------------------------------------------------- 62 63 ! … … 91 92 IF( ln_pisdmp .AND. MOD( kt - 1, nn_pisdmp ) == 0 ) CALL p4z_dmp( kt, Kbb, Kmm ) ! Relaxation of some tracers 92 93 ! 93 rfact = rDt_trc 94 rfact = rDt_trc ! time step of PISCES 94 95 ! 95 96 IF( ( ln_top_euler .AND. kt == nittrc000 ) .OR. ( .NOT.ln_top_euler .AND. kt <= nittrc000 + 1 ) ) THEN 96 rfactr = 1. / rfact 97 rfact2 = rfact / REAL( nrdttrc, wp ) 98 rfact2r = 1. / rfact2 99 xstep = rfact2 / rday ! Time step duration for biology 97 rfactr = 1. / rfact ! inverse of the time step 98 rfact2 = rfact / REAL( nrdttrc, wp ) ! time step of the biological SMS 99 rfact2r = 1. / rfact2 ! Inverse of the biological time step 100 xstep = rfact2 / rday ! Time step duration for biology relative to a day 100 101 xfact = 1.e+3 * rfact2r 101 102 IF(lwp) WRITE(numout,*) … … 131 132 CALL p4z_flx( kt, jnt, Kbb, Kmm, Krhs ) ! Compute surface fluxes 132 133 ! 134 ! Handling of the negative concentrations 135 ! The biological SMS may generate negative concentrations 136 ! Trends are tested at each grid cell. If a negative concentrations 137 ! is created at a grid cell, all the sources and sinks at that grid 138 ! cell are scale to avoid that negative concentration. This approach 139 ! is quite simplistic but it conserves mass. 140 ! ------------------------------------------------------------------ 133 141 xnegtr(:,:,:) = 1.e0 134 142 DO jn = jp_pcs0, jp_pcs1 … … 142 150 ! ! where at least 1 tracer concentration becomes negative 143 151 ! ! 152 ! Concentrations are updated 144 153 DO jn = jp_pcs0, jp_pcs1 145 154 tr(:,:,:,jn,Kbb) = tr(:,:,:,jn,Kbb) + xnegtr(:,:,:) * tr(:,:,:,jn,Krhs) … … 194 203 ENDIF 195 204 ! 205 ! Trends are are reset to 0 196 206 DO jn = jp_pcs0, jp_pcs1 197 207 tr(:,:,:,jn,Krhs) = 0._wp … … 202 212 #endif 203 213 ! 214 ! If ln_sediment is set to .true. then the sediment module is called 204 215 IF( ln_sediment ) THEN 205 216 ! … … 213 224 ztrbbio(:,:,:,jn) = 0._wp 214 225 END DO 226 ! 215 227 ! 216 228 IF( l_trdtrc ) THEN … … 236 248 !! *** p4z_sms_init *** 237 249 !! 238 !! ** Purpose : read PISCES namelist239 !! 240 !! ** input : file 'namelist .trc.s' containing the following241 !! namelist: natext, natbio, natsms250 !! ** Purpose : read the general PISCES namelist 251 !! 252 !! ** input : file 'namelist_pisces' containing the following 253 !! namelist: nampisbio, nampisdmp, nampismass 242 254 !!---------------------------------------------------------------------- 243 255 INTEGER :: ios ! Local integer output status for namelist read 244 256 !! 245 NAMELIST/nampisbio/ nrdttrc, wsbio, xkmort, ferat 3, wsbio2, wsbio2max, wsbio2scale, &246 & 257 NAMELIST/nampisbio/ nrdttrc, wsbio, xkmort, feratz, feratm, wsbio2, wsbio2max, & 258 & wsbio2scale, ldocp, ldocz, lthet, no3rat3, po4rat3 247 259 ! 248 260 NAMELIST/nampisdmp/ ln_pisdmp, nn_pisdmp … … 268 280 WRITE(numout,*) ' half saturation constant for mortality xkmort =', xkmort 269 281 IF( ln_p5z ) THEN 270 WRITE(numout,*) ' N/C in zooplankton no3rat3 =', no3rat3 271 WRITE(numout,*) ' P/C in zooplankton po4rat3 =', po4rat3 272 ENDIF 273 WRITE(numout,*) ' Fe/C in zooplankton ferat3 =', ferat3 282 WRITE(numout,*) ' N/C in zooplankton no3rat3 =', no3rat3 283 WRITE(numout,*) ' P/C in zooplankton po4rat3 =', po4rat3 284 ENDIF 285 WRITE(numout,*) ' Fe/C in microzooplankton feratz =', feratz 286 WRITE(numout,*) ' Fe/C in microzooplankton feratz =', feratm 274 287 WRITE(numout,*) ' Big particles sinking speed wsbio2 =', wsbio2 275 288 WRITE(numout,*) ' Big particles maximum sinking speed wsbio2max =', wsbio2max … … 317 330 !! *** ROUTINE p4z_rst *** 318 331 !! 319 !! ** Purpose : Read or write variables in restart file:332 !! ** Purpose : Read or write specific PISCES variables in restart file: 320 333 !! 321 334 !! WRITE(READ) mode: … … 330 343 IF( TRIM(cdrw) == 'READ' ) THEN 331 344 ! 345 ! Read the specific variable of PISCES 332 346 IF(lwp) WRITE(numout,*) 333 347 IF(lwp) WRITE(numout,*) ' p4z_rst : Read specific variables from pisces model ' 334 348 IF(lwp) WRITE(numout,*) ' ~~~~~~~~~~~~~~' 335 349 ! 350 ! Read the pH. If not in the restart file, then it is initialized from 351 ! the initial conditions 336 352 IF( iom_varid( numrtr, 'PH', ldstop = .FALSE. ) > 0 ) THEN 337 353 CALL iom_get( numrtr, jpdom_auto, 'PH' , hi(:,:,:) ) … … 341 357 ENDIF 342 358 CALL iom_get( numrtr, jpdom_auto, 'Silicalim', xksi(:,:) ) 359 360 ! Read the Si half saturation constant and the maximum Silica concentration 343 361 IF( iom_varid( numrtr, 'Silicamax', ldstop = .FALSE. ) > 0 ) THEN 344 362 CALL iom_get( numrtr, jpdom_auto, 'Silicamax' , xksimax(:,:) ) … … 346 364 xksimax(:,:) = xksi(:,:) 347 365 ENDIF 348 ! 366 367 ! Read the Fe3 consumption term by phytoplankton 368 IF( iom_varid( numrtr, 'Consfe3', ldstop = .FALSE. ) > 0 ) THEN 369 CALL iom_get( numrtr, jpdom_auto, 'Consfe3' , consfe3(:,:,:) ) 370 ELSE 371 consfe3(:,:,:) = 0._wp 372 ENDIF 373 374 375 ! Read the cumulative total flux. If not in the restart file, it is set to 0 349 376 IF( iom_varid( numrtr, 'tcflxcum', ldstop = .FALSE. ) > 0 ) THEN ! cumulative total flux of carbon 350 377 CALL iom_get( numrtr, 'tcflxcum' , t_oce_co2_flx_cum ) … … 353 380 ENDIF 354 381 ! 382 ! PISCES size proxy 383 IF( iom_varid( numrtr, 'sized', ldstop = .FALSE. ) > 0 ) THEN 384 CALL iom_get( numrtr, jpdom_auto, 'sized' , sized(:,:,:) ) 385 sized(:,:,:) = MAX( 1.0, sized(:,:,:) ) 386 ELSE 387 sized(:,:,:) = 1. 388 ENDIF 389 ! 390 IF( iom_varid( numrtr, 'sizen', ldstop = .FALSE. ) > 0 ) THEN 391 CALL iom_get( numrtr, jpdom_auto, 'sizen' , sizen(:,:,:) ) 392 sizen(:,:,:) = MAX( 1.0, sizen(:,:,:) ) 393 ELSE 394 sizen(:,:,:) = 1. 395 ENDIF 396 397 ! PISCES-QUOTA specific part 355 398 IF( ln_p5z ) THEN 356 IF( iom_varid( numrtr, 'sized', ldstop = .FALSE. ) > 0 ) THEN 399 ! Read the size of the different phytoplankton groups 400 ! If not in the restart file, they are set to 1 401 IF( iom_varid( numrtr, 'sizep', ldstop = .FALSE. ) > 0 ) THEN 357 402 CALL iom_get( numrtr, jpdom_auto, 'sizep' , sizep(:,:,:) ) 358 CALL iom_get( numrtr, jpdom_auto, 'sizen' , sizen(:,:,:) ) 359 CALL iom_get( numrtr, jpdom_auto, 'sized' , sized(:,:,:) ) 403 sizep(:,:,:) = MAX( 1.0, sizep(:,:,:) ) 360 404 ELSE 361 405 sizep(:,:,:) = 1. 362 sizen(:,:,:) = 1.363 sized(:,:,:) = 1.364 406 ENDIF 365 407 ENDIF 366 408 ! 367 409 ELSEIF( TRIM(cdrw) == 'WRITE' ) THEN 410 ! write the specific variables of PISCES 368 411 IF( kt == nitrst ) THEN 369 412 IF(lwp) WRITE(numout,*) … … 375 418 CALL iom_rstput( kt, nitrst, numrtw, 'Silicamax', xksimax(:,:) ) 376 419 CALL iom_rstput( kt, nitrst, numrtw, 'tcflxcum', t_oce_co2_flx_cum ) 377 IF( ln_p5z ) THEN378 CALL iom_rstput( kt, nitrst, numrtw, 'sizep', sizep(:,:,:) )379 CALL iom_rstput( kt, nitrst, numrtw, 'sizen', sizen(:,:,:) )380 CALL iom_rstput( kt, nitrst, numrtw, 'sized', sized(:,:,:) )381 ENDIF420 CALL iom_rstput( kt, nitrst, numrtw, 'Consfe3', consfe3(:,:,:) ) ! Si max concentration 421 CALL iom_rstput( kt, nitrst, numrtw, 'tcflxcum', t_oce_co2_flx_cum ) ! Cumulative CO2 flux 422 CALL iom_rstput( kt, nitrst, numrtw, 'sizen', sizen(:,:,:) ) ! Size of nanophytoplankton 423 CALL iom_rstput( kt, nitrst, numrtw, 'sized', sized(:,:,:) ) ! Size of diatoms 424 IF( ln_p5z ) CALL iom_rstput( kt, nitrst, numrtw, 'sizep', sizep(:,:,:) ) ! Size of picophytoplankton 382 425 ENDIF 383 426 ! … … 389 432 !! *** p4z_dmp *** 390 433 !! 391 !! ** purpose : Relaxation of some tracers 434 !! ** purpose : Relaxation of the total budget of some elements 435 !! This routine avoids the model to drift far from the 436 !! observed content in various elements 437 !! Elements that may be relaxed : Alk, P, N, Si 392 438 !!---------------------------------------------------------------------- 393 439 ! … … 396 442 ! 397 443 REAL(wp) :: alkmean = 2426. ! mean value of alkalinity ( Glodap ; for Goyet 2391. ) 398 REAL(wp) :: po4mean = 2.1 65 ! mean value of phosphates399 REAL(wp) :: no3mean = 3 0.90 ! mean value of nitrate400 REAL(wp) :: silmean = 9 1.51! mean value of silicate444 REAL(wp) :: po4mean = 2.174 ! mean value of phosphate 445 REAL(wp) :: no3mean = 31.00 ! mean value of nitrate 446 REAL(wp) :: silmean = 90.33 ! mean value of silicate 401 447 ! 402 448 REAL(wp) :: zarea, zalksumn, zpo4sumn, zno3sumn, zsilsumn … … 419 465 zsilsumn = glob_sum( 'p4zsms', tr(:,:,:,jpsil,Kmm) * cvol(:,:,:) ) * zarea 420 466 467 ! Correct the trn mean content of alkalinity 421 468 IF(lwp) WRITE(numout,*) ' TALKN mean : ', zalksumn 422 469 tr(:,:,:,jptal,Kmm) = tr(:,:,:,jptal,Kmm) * alkmean / zalksumn 423 470 471 ! Correct the trn mean content of PO4 424 472 IF(lwp) WRITE(numout,*) ' PO4N mean : ', zpo4sumn 425 473 tr(:,:,:,jppo4,Kmm) = tr(:,:,:,jppo4,Kmm) * po4mean / zpo4sumn 426 474 475 ! Correct the trn mean content of NO3 427 476 IF(lwp) WRITE(numout,*) ' NO3N mean : ', zno3sumn 428 477 tr(:,:,:,jpno3,Kmm) = tr(:,:,:,jpno3,Kmm) * no3mean / zno3sumn 429 478 479 ! Correct the trn mean content of SiO3 430 480 IF(lwp) WRITE(numout,*) ' SiO3N mean : ', zsilsumn 431 481 tr(:,:,:,jpsil,Kmm) = MIN( 400.e-6,tr(:,:,:,jpsil,Kmm) * silmean / zsilsumn ) … … 439 489 440 490 IF(lwp) WRITE(numout,*) ' ' 491 ! Correct the trb mean content of alkalinity 441 492 IF(lwp) WRITE(numout,*) ' TALKB mean : ', zalksumb 442 493 tr(:,:,:,jptal,Kbb) = tr(:,:,:,jptal,Kbb) * alkmean / zalksumb 443 494 495 ! Correct the trb mean content of PO4 444 496 IF(lwp) WRITE(numout,*) ' PO4B mean : ', zpo4sumb 445 497 tr(:,:,:,jppo4,Kbb) = tr(:,:,:,jppo4,Kbb) * po4mean / zpo4sumb 446 498 499 ! Correct the trb mean content of NO3 447 500 IF(lwp) WRITE(numout,*) ' NO3B mean : ', zno3sumb 448 501 tr(:,:,:,jpno3,Kbb) = tr(:,:,:,jpno3,Kbb) * no3mean / zno3sumb 449 502 503 ! Correct the trb mean content of SiO3 450 504 IF(lwp) WRITE(numout,*) ' SiO3B mean : ', zsilsumb 451 505 tr(:,:,:,jpsil,Kbb) = MIN( 400.e-6,tr(:,:,:,jpsil,Kbb) * silmean / zsilsumb ) … … 487 541 ENDIF 488 542 543 ! Compute the budget of NO3 489 544 IF( iom_use( "pno3tot" ) .OR. ( ln_check_mass .AND. kt == nitend ) ) THEN 490 ! Compute the budget of NO3, ALK, Si, Fer491 545 IF( ln_p4z ) THEN 492 546 zwork(:,:,:) = tr(:,:,:,jpno3,Kmm) + tr(:,:,:,jpnh4,Kmm) & … … 506 560 ENDIF 507 561 ! 562 ! Compute the budget of PO4 508 563 IF( iom_use( "ppo4tot" ) .OR. ( ln_check_mass .AND. kt == nitend ) ) THEN 509 564 IF( ln_p4z ) THEN … … 524 579 ENDIF 525 580 ! 581 ! Compute the budget of SiO3 526 582 IF( iom_use( "psiltot" ) .OR. ( ln_check_mass .AND. kt == nitend ) ) THEN 527 583 zwork(:,:,:) = tr(:,:,:,jpsil,Kmm) + tr(:,:,:,jpgsi,Kmm) + tr(:,:,:,jpdsi,Kmm) … … 540 596 ENDIF 541 597 ! 598 ! Compute the budget of Iron 542 599 IF( iom_use( "pfertot" ) .OR. ( ln_check_mass .AND. kt == nitend ) ) THEN 543 600 zwork(:,:,:) = tr(:,:,:,jpfer,Kmm) + tr(:,:,:,jpnfe,Kmm) + tr(:,:,:,jpdfe,Kmm) & 544 601 & + tr(:,:,:,jpbfe,Kmm) + tr(:,:,:,jpsfe,Kmm) & 545 & + ( tr(:,:,:,jpzoo,Kmm) + tr(:,:,:,jpmes,Kmm) ) * ferat3602 & + ( tr(:,:,:,jpzoo,Kmm) * feratz + tr(:,:,:,jpmes,Kmm) ) * feratm 546 603 ! 547 604 ferbudget = glob_sum( 'p4zsms', zwork(:,:,:) * cvol(:,:,:) )
Note: See TracChangeset
for help on using the changeset viewer.