Changeset 9262 for branches/UKMO/dev_r5518_GO6_package/NEMOGCM
- Timestamp:
- 2018-01-18T15:06:49+01:00 (6 years ago)
- Location:
- branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/TOP_SRC
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/TOP_SRC/trc.F90
r9114 r9262 33 33 !! -------------------------------------------------- 34 34 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: trai !: initial total tracer 35 # if defined key_medusa && key_roam 36 !! AXY (17/11/2017): elemental cycle initial totals 37 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: cycletot !: initial elemental cycle total 38 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: cycletot2 !: initial elemental cycle total excl. halo in mpp_sum 39 # endif 35 40 REAL(wp), PUBLIC :: areatot !: total volume 36 41 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,: ) :: cvol !: volume correction -degrad option- … … 266 271 & cvol(jpi,jpj,jpk) , rdttrc(jpk) , trai(jptra) , & 267 272 & ctrcnm(jptra) , ctrcln(jptra) , ctrcun(jptra) , & 273 # if defined key_medusa && defined key_roam 274 & cycletot(6), cycletot2(6) , & 275 # endif 268 276 & ln_trc_ini(jptra) , ln_trc_wri(jptra) , qsr_mean(jpi,jpj) , STAT = trc_alloc ) 269 277 -
branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/TOP_SRC/trcini.F90
r8442 r9262 28 28 USE trcini_idtra ! idealize tracer initialisation 29 29 USE trcini_medusa ! MEDUSA initialisation 30 USE par_medusa ! MEDUSA parameters (needed for elemental cycles) 30 31 USE trcdta ! initialisation from files 31 32 USE daymod ! calendar manager … … 35 36 USE sbc_oce 36 37 USE trcice ! tracers in sea ice 37 38 USE sms_medusa ! MEDUSA initialisation 38 39 IMPLICIT NONE 39 40 PRIVATE … … 62 63 !! or read data or analytical formulation 63 64 !!--------------------------------------------------------------------- 64 INTEGER :: jk, jn, jl ! dummy loop indices 65 INTEGER :: ji, jj, jk, jn, jl ! dummy loop indices 66 # if defined key_medusa && defined key_roam 67 !! AXY (23/11/2017) 68 REAL(wp) :: zsum3d, zsum2d 69 REAL(wp) :: zq1, zq2, loc_vol, loc_area 70 REAL(wp), DIMENSION(6) :: loc_cycletot3, loc_cycletot2 71 REAL(wp), DIMENSION(jpi,jpj,jpk) :: ztot3d 72 REAL(wp), DIMENSION(jpi,jpj) :: ztot2d, carea 73 # endif 65 74 CHARACTER (len=25) :: charout 66 75 !!--------------------------------------------------------------------- … … 98 107 ! ! total volume of the ocean 99 108 areatot = glob_sum( cvol(:,:,:) ) 109 carea(:,:) = e1e2t(:,:) * tmask(:,:,1) 100 110 101 111 IF( lk_pisces ) CALL trc_ini_pisces ! PISCES bio-model … … 192 202 ENDIF 193 203 194 IF(lwp) WRITE(numout,*) 195 IF(lwp) WRITE(numout,*) 'trc_init : passive tracer set up completed' 196 IF(lwp) WRITE(numout,*) '~~~~~~~' 197 IF(lwp) CALL flush(numout) 204 # if defined key_medusa && defined key_roam 205 ! AXY (17/11/2017): calculate initial totals of elemental cycles 206 ! 207 ! This is done in a very hard-wired way here; in future, this could be 208 ! replaced with loops and using a 2D array; one dimension would cover 209 ! the tracers, the other would be for the elements; each tracer would 210 ! have a factor for each element to say how much of that element was 211 ! in that tracer; for example, PHN would be 1.0 for N, xrfn for Fe and 212 ! xthetapn for C, with the other elements 0.0; the array entry for PHN 213 ! would then be (1. 0. xrfn xthetapn 0. 0.) for (N, Si, Fe, C, A, O2); 214 ! saving this for the next iteration 215 ! 216 cycletot(:) = 0._wp 217 ! report elemental totals at initialisation as we go along 218 IF ( lwp ) WRITE(numout,*) 219 IF ( lwp ) WRITE(numout,*) ' Elemental cycle totals: ' 220 ! nitrogen 221 ztot3d(:,:,:) = trn(:,:,:,jpphn) + trn(:,:,:,jpphd) + trn(:,:,:,jpzmi) + & 222 trn(:,:,:,jpzme) + trn(:,:,:,jpdet) + trn(:,:,:,jpdin) 223 ztot2d(:,:) = zn_sed_n(:,:) 224 zsum3d = glob_sum( ztot3d(:,:,:) * cvol(:,:,:) ) 225 zsum2d = glob_sum( ztot2d(:,:) * carea(:,:) ) 226 cycletot(1) = zsum3d + zsum2d 227 IF ( lwp ) WRITE(numout,9010) 'nitrogen', zsum3d, zsum2d, cycletot(1) 228 ! silicon 229 ztot3d(:,:,:) = trn(:,:,:,jppds) + trn(:,:,:,jpsil) 230 ztot2d(:,:) = zn_sed_si(:,:) 231 zsum3d = glob_sum( ztot3d(:,:,:) * cvol(:,:,:) ) 232 zsum2d = glob_sum( ztot2d(:,:) * carea(:,:) ) 233 cycletot(2) = zsum3d + zsum2d 234 IF ( lwp ) WRITE(numout,9010) 'silicon', zsum3d, zsum2d, cycletot(2) 235 ! iron 236 ztot3d(:,:,:) = ((trn(:,:,:,jpphn) + trn(:,:,:,jpphd) + trn(:,:,:,jpzmi) + & 237 trn(:,:,:,jpzme) + trn(:,:,:,jpdet)) * xrfn) + trn(:,:,:,jpfer) 238 ztot2d(:,:) = zn_sed_fe(:,:) 239 zsum3d = glob_sum( ztot3d(:,:,:) * cvol(:,:,:) ) 240 zsum2d = glob_sum( ztot2d(:,:) * carea(:,:) ) 241 cycletot(3) = zsum3d + zsum2d 242 IF ( lwp ) WRITE(numout,9010) 'iron', zsum3d, zsum2d, cycletot(3) 243 ! carbon (uses fixed C:N ratios on plankton tracers) 244 ztot3d(:,:,:) = (trn(:,:,:,jpphn) * xthetapn) + (trn(:,:,:,jpphd) * xthetapd) + & 245 (trn(:,:,:,jpzmi) * xthetazmi) + (trn(:,:,:,jpzme) * xthetazme) + & 246 trn(:,:,:,jpdtc) + trn(:,:,:,jpdic) 247 ztot2d(:,:) = zn_sed_c(:,:) + zn_sed_ca(:,:) 248 zsum3d = glob_sum( ztot3d(:,:,:) * cvol(:,:,:) ) 249 zsum2d = glob_sum( ztot2d(:,:) * carea(:,:) ) 250 cycletot(4) = zsum3d + zsum2d 251 IF ( lwp ) WRITE(numout,9010) 'carbon', zsum3d, zsum2d, cycletot(4) 252 ! alkalinity (note benthic correction) 253 ztot3d(:,:,:) = trn(:,:,:,jpalk) 254 ztot2d(:,:) = zn_sed_ca(:,:) * 2._wp 255 zsum3d = glob_sum( ztot3d(:,:,:) * cvol(:,:,:) ) 256 zsum2d = glob_sum( ztot2d(:,:) * carea(:,:) ) 257 cycletot(5) = zsum3d + zsum2d 258 IF ( lwp ) WRITE(numout,9010) 'alkalinity', zsum3d, zsum2d, cycletot(5) 259 ! oxygen (note no benthic) 260 ztot3d(:,:,:) = trn(:,:,:,jpoxy) 261 ztot2d(:,:) = 0._wp 262 zsum3d = glob_sum( ztot3d(:,:,:) * cvol(:,:,:) ) 263 zsum2d = glob_sum( ztot2d(:,:) * carea(:,:) ) 264 cycletot(6) = zsum3d + zsum2d 265 IF ( lwp ) WRITE(numout,9010) 'oxygen', zsum3d, zsum2d, cycletot(6) 266 ! Check 267 zsum3d = glob_sum( cvol(:,:,:) ) 268 zsum2d = glob_sum( carea(:,:) ) 269 IF ( lwp ) THEN 270 WRITE(numout,*) 271 WRITE(numout,*) ' check : cvol : ', zsum3d 272 WRITE(numout,*) ' check : carea : ', zsum2d 273 WRITE(numout,*) 274 ENDIF 275 ! 276 # endif 277 278 IF(lwp) THEN 279 WRITE(numout,*) 280 WRITE(numout,*) 'trc_init : passive tracer set up completed' 281 WRITE(numout,*) '~~~~~~~' 282 ENDIF 198 283 # if defined key_debug_medusa 199 284 CALL trc_rst_stat … … 202 287 203 288 9000 FORMAT(' tracer nb : ',i2,' name :',a10,' initial content :',e18.10) 289 9010 FORMAT(' element:',a10, & 290 ' 3d sum:',e18.10,' 2d sum:',e18.10, & 291 ' total:',e18.10) 204 292 ! 205 293 IF( nn_timing == 1 ) CALL timing_stop('trc_init') -
branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/TOP_SRC/trcrst.F90
r9163 r9262 30 30 USE daymod 31 31 !! AXY (05/11/13): need these for MEDUSA to input/output benthic reservoirs 32 USE par_medusa 32 33 USE sms_medusa 33 34 USE trcsms_medusa … … 53 54 PUBLIC trc_rst_cal 54 55 PUBLIC trc_rst_stat 56 #if defined key_medusa && defined key_roam 57 PUBLIC trc_rst_conserve 58 #endif 55 59 56 60 !! * Substitutions … … 539 543 IF( kt == nitrst ) THEN 540 544 CALL trc_rst_stat ! statistics 545 #if defined key_medusa && defined key_roam 546 CALL trc_rst_conserve ! conservation check 547 #endif 541 548 CALL iom_close( numrtw ) ! close the restart file (only at last time step) 542 549 #if ! defined key_trdmxl_trc … … 705 712 706 713 714 # if defined key_medusa && defined key_roam 715 SUBROUTINE trc_rst_conserve 716 !!---------------------------------------------------------------------- 717 !! *** trc_rst_conserve *** 718 !! 719 !! ** purpose : Compute tracers conservation statistics 720 !! 721 !! AXY (17/11/2017) 722 !! This routine calculates the "now" inventories of the elemental 723 !! cycles of MEDUSA and compares them to those calculate when the 724 !! model was initialised / restarted; the cycles calculated are: 725 !! nitrogen, silicon, iron, carbon, alkalinity and oxygen 726 !!---------------------------------------------------------------------- 727 INTEGER :: ji, jj, jk, jn 728 REAL(wp) :: zsum3d, zsum2d, zinvt, zdelta, zratio, loc_vol, loc_are 729 REAL(wp) :: zq1, zq2, loc_vol, loc_area 730 REAL(wp), DIMENSION(jpi,jpj,jpk) :: z3d, zvol 731 REAL(wp), DIMENSION(jpi,jpj) :: z2d, zarea 732 REAL(wp), DIMENSION(6) :: loc_cycletot3, loc_cycletot2 733 !!---------------------------------------------------------------------- 734 ! 735 IF( lwp ) THEN 736 WRITE(numout,*) 737 WRITE(numout,*) ' ----TRACER CONSERVATION---- ' 738 WRITE(numout,*) 739 ENDIF 740 ! 741 ! ocean volume 742 DO jk = 1, jpk 743 zvol(:,:,jk) = e1e2t(:,:) * fse3t_a(:,:,jk) * tmask(:,:,jk) 744 END DO 745 ! 746 ! ocean area (for sediments) 747 zarea(:,:) = e1e2t(:,:) * tmask(:,:,1) 748 ! 749 !---------------------------------------------------------------------- 750 ! nitrogen 751 z3d(:,:,:) = trn(:,:,:,jpphn) + trn(:,:,:,jpphd) + trn(:,:,:,jpzmi) + & 752 trn(:,:,:,jpzme) + trn(:,:,:,jpdet) + trn(:,:,:,jpdin) 753 z2d(:,:) = zn_sed_n(:,:) 754 zsum3d = glob_sum( z3d(:,:,:) * zvol(:,:,:) ) 755 zsum2d = glob_sum( z2d(:,:) * zarea(:,:) ) 756 ! total tracer, and delta 757 zinvt = zsum3d + zsum2d 758 zdelta = zinvt - cycletot(1) 759 zratio = 1.0e2 * zdelta / cycletot(1) 760 ! 761 IF ( lwp ) WRITE(numout,9010) 'nitrogen', zsum3d, zsum2d, zinvt, & 762 cycletot(1), zdelta, zratio 763 IF ( lwp ) WRITE(numout,*) 764 ! 765 !---------------------------------------------------------------------- 766 ! silicon 767 z3d(:,:,:) = trn(:,:,:,jppds) + trn(:,:,:,jpsil) 768 z2d(:,:) = zn_sed_si(:,:) 769 zsum3d = glob_sum( z3d(:,:,:) * zvol(:,:,:) ) 770 zsum2d = glob_sum( z2d(:,:) * zarea(:,:) ) 771 ! total tracer, and delta 772 zinvt = zsum3d + zsum2d 773 zdelta = zinvt - cycletot(2) 774 zratio = 1.0e2 * zdelta / cycletot(2) 775 ! 776 IF ( lwp ) WRITE(numout,9010) 'silicon', zsum3d, zsum2d, zinvt, & 777 cycletot(2), zdelta, zratio 778 IF ( lwp ) WRITE(numout,*) 779 ! 780 !---------------------------------------------------------------------- 781 ! iron 782 z3d(:,:,:) = ((trn(:,:,:,jpphn) + trn(:,:,:,jpphd) + trn(:,:,:,jpzmi) + & 783 trn(:,:,:,jpzme) + trn(:,:,:,jpdet)) * xrfn) + trn(:,:,:,jpfer) 784 z2d(:,:) = zn_sed_fe(:,:) 785 zsum3d = glob_sum( z3d(:,:,:) * zvol(:,:,:) ) 786 zsum2d = glob_sum( z2d(:,:) * zarea(:,:) ) 787 ! total tracer, and delta 788 zinvt = zsum3d + zsum2d 789 zdelta = zinvt - cycletot(3) 790 zratio = 1.0e2 * zdelta / cycletot(3) 791 ! 792 IF ( lwp ) WRITE(numout,9010) 'iron', zsum3d, zsum2d, zinvt, & 793 cycletot(3), zdelta, zratio 794 IF ( lwp ) WRITE(numout,*) 795 ! 796 !---------------------------------------------------------------------- 797 ! carbon 798 z3d(:,:,:) = (trn(:,:,:,jpphn) * xthetapn) + (trn(:,:,:,jpphd) * xthetapd) + & 799 (trn(:,:,:,jpzmi) * xthetazmi) + (trn(:,:,:,jpzme) * xthetazme) + & 800 trn(:,:,:,jpdtc) + trn(:,:,:,jpdic) 801 z2d(:,:) = zn_sed_c(:,:) + zn_sed_ca(:,:) 802 zsum3d = glob_sum( z3d(:,:,:) * zvol(:,:,:) ) 803 zsum2d = glob_sum( z2d(:,:) * zarea(:,:) ) 804 ! total tracer, and delta 805 zinvt = zsum3d + zsum2d 806 zdelta = zinvt - cycletot(4) 807 zratio = 1.0e2 * zdelta / cycletot(4) 808 ! 809 IF ( lwp ) WRITE(numout,9010) 'carbon', zsum3d, zsum2d, zinvt, & 810 cycletot(4), zdelta, zratio 811 IF ( lwp ) WRITE(numout,*) 812 ! 813 !---------------------------------------------------------------------- 814 ! alkalinity 815 z3d(:,:,:) = trn(:,:,:,jpalk) 816 z2d(:,:) = zn_sed_ca(:,:) * 2.0 817 zsum3d = glob_sum( z3d(:,:,:) * zvol(:,:,:) ) 818 zsum2d = glob_sum( z2d(:,:) * zarea(:,:) ) 819 ! total tracer, and delta 820 zinvt = zsum3d + zsum2d 821 zdelta = zinvt - cycletot(5) 822 zratio = 1.0e2 * zdelta / cycletot(5) 823 ! 824 IF ( lwp ) WRITE(numout,9010) 'alkalinity', zsum3d, zsum2d, zinvt, & 825 cycletot(5), zdelta, zratio 826 IF ( lwp ) WRITE(numout,*) 827 ! 828 !---------------------------------------------------------------------- 829 ! oxygen 830 z3d(:,:,:) = trn(:,:,:,jpoxy) 831 z2d(:,:) = 0.0 832 zsum3d = glob_sum( z3d(:,:,:) * zvol(:,:,:) ) 833 zsum2d = glob_sum( z2d(:,:) * zarea(:,:) ) 834 ! total tracer, and delta 835 zinvt = zsum3d + zsum2d 836 zdelta = zinvt - cycletot(6) 837 zratio = 1.0e2 * zdelta / cycletot(6) 838 ! 839 IF ( lwp ) WRITE(numout,9010) 'oxygen', zsum3d, zsum2d, zinvt, & 840 cycletot(6), zdelta, zratio 841 ! 842 !---------------------------------------------------------------------- 843 ! Check 844 zsum3d = glob_sum( zvol(:,:,:) ) 845 zsum2d = glob_sum( zarea(:,:) ) 846 IF ( lwp ) THEN 847 WRITE(numout,*) 848 WRITE(numout,*) ' check : cvol : ', zsum3d 849 WRITE(numout,*) ' check : carea : ', zsum2d 850 WRITE(numout,*) 851 ENDIF 852 ! 853 9010 FORMAT(' element:',a10, & 854 ' 3d sum:',e18.10,' 2d sum:',e18.10, & 855 ' total:',e18.10,' initial:',e18.10, & 856 ' delta:',e18.10,' %:',e18.10) 857 ! 858 END SUBROUTINE trc_rst_conserve 859 # endif 860 861 707 862 #else 708 863 !!----------------------------------------------------------------------
Note: See TracChangeset
for help on using the changeset viewer.