Changeset 9128
 Timestamp:
 20171219T12:47:21+01:00 (3 years ago)
 Location:
 branches/NERC/dev_r5518_GO6_conserv_Check/NEMOGCM/NEMO/TOP_SRC
 Files:

 2 edited
Legend:
 Unmodified
 Added
 Removed

branches/NERC/dev_r5518_GO6_conserv_Check/NEMOGCM/NEMO/TOP_SRC/trcini.F90
r8926 r9128 280 280 IF ( lwp ) CALL flush(numout) 281 281 ! 282 ! This second check dodges around the halo points in the grid283 ! to check that glob_sum is doing what it's supposed to be284 ! doing; note that the loop ordering here is the "correct" way285 ! (according to Dr. Google)286 !287 IF ( lwp ) WRITE(numout,*)288 IF ( lwp ) WRITE(numout,*) ' Elemental cycle totals (check): '289 ! ocean cells290 loc_cycletot3(:) = 0._wp291 loc_vol = 0._wp292 DO jk = 1, jpk293 DO jj = nldj,nlej294 DO ji = nldi,nlei295 loc_vol = loc_vol + cvol(ji,jj,jk)296 ! nitrogen297 zq1 = trn(ji,jj,jk,jpphn) + trn(ji,jj,jk,jpphd) + trn(ji,jj,jk,jpzmi) + &298 trn(ji,jj,jk,jpzme) + trn(ji,jj,jk,jpdet) + trn(ji,jj,jk,jpdin)299 loc_cycletot3(1) = loc_cycletot3(1) + ( zq1 * cvol(ji,jj,jk) )300 ! silicon301 zq1 = trn(ji,jj,jk,jppds) + trn(ji,jj,jk,jpsil)302 loc_cycletot3(2) = loc_cycletot3(2) + ( zq1 * cvol(ji,jj,jk) )303 ! iron304 zq1 = ((trn(ji,jj,jk,jpphn) + trn(ji,jj,jk,jpphd) + trn(ji,jj,jk,jpzmi) + &305 trn(ji,jj,jk,jpzme) + trn(ji,jj,jk,jpdet)) * xrfn) + trn(ji,jj,jk,jpfer)306 loc_cycletot3(3) = loc_cycletot3(3) + ( zq1 * cvol(ji,jj,jk) )307 ! carbon308 zq1 = (trn(ji,jj,jk,jpphn) * xthetapn) + (trn(ji,jj,jk,jpphd) * xthetapd) + &309 (trn(ji,jj,jk,jpzmi) * xthetazmi) + (trn(ji,jj,jk,jpzme) * xthetazme) + &310 trn(ji,jj,jk,jpdtc) + trn(ji,jj,jk,jpdic)311 loc_cycletot3(4) = loc_cycletot3(4) + ( zq1 * cvol(ji,jj,jk) )312 ! alkalinity313 zq1 = trn(ji,jj,jk,jpalk)314 loc_cycletot3(5) = loc_cycletot3(5) + ( zq1 * cvol(ji,jj,jk) )315 ! oxygen316 zq1 = trn(ji,jj,jk,jpoxy)317 loc_cycletot3(6) = loc_cycletot3(6) + ( zq1 * cvol(ji,jj,jk) )318 ENDDO319 ENDDO320 ENDDO321 !322 ! sediment cells323 loc_cycletot2(:) = 0._wp324 loc_area = 0._wp325 jk = 1326 DO jj = nldj,nlej327 DO ji = nldi,nlei328 loc_area = loc_area + (e1e2t(ji,jj) * tmask(ji,jj,jk))329 ! nitrogen330 zq1 = zn_sed_n(ji,jj)331 loc_cycletot2(1) = loc_cycletot2(1) + (zq1 * e1e2t(ji,jj) * tmask(ji,jj,jk))332 ! silicon333 zq1 = zn_sed_si(ji,jj)334 loc_cycletot2(2) = loc_cycletot2(2) + (zq1 * e1e2t(ji,jj) * tmask(ji,jj,jk))335 ! iron336 zq1 = zn_sed_fe(ji,jj)337 loc_cycletot2(3) = loc_cycletot2(3) + (zq1 * e1e2t(ji,jj) * tmask(ji,jj,jk))338 ! carbon339 zq1 = zn_sed_c(ji,jj) + zn_sed_ca(ji,jj)340 loc_cycletot2(4) = loc_cycletot2(4) + (zq1 * e1e2t(ji,jj) * tmask(ji,jj,jk))341 ! alkalinity342 zq1 = zn_sed_ca(ji,jj) * 2._wp343 loc_cycletot2(5) = loc_cycletot2(5) + (zq1 * e1e2t(ji,jj) * tmask(ji,jj,jk))344 ! skip oxygen345 ENDDO346 ENDDO347 !348 ! report back349 zq1 = loc_cycletot3(1)350 zq2 = loc_cycletot2(1)351 IF( lk_mpp ) CALL mpp_sum( zq1 )352 IF( lk_mpp ) CALL mpp_sum( zq2 )353 cycletot2(1) = zq1 + zq2354 IF ( lwp ) WRITE(numout,9010) 'nitrogen', zq1, zq2, cycletot2(1)355 zq1 = loc_cycletot3(2)356 zq2 = loc_cycletot2(2)357 IF( lk_mpp ) CALL mpp_sum( zq1 )358 IF( lk_mpp ) CALL mpp_sum( zq2 )359 cycletot2(2) = zq1 + zq2360 IF ( lwp ) WRITE(numout,9010) 'silicon', zq1, zq2, cycletot2(2)361 zq1 = loc_cycletot3(3)362 zq2 = loc_cycletot2(3)363 IF( lk_mpp ) CALL mpp_sum( zq1 )364 IF( lk_mpp ) CALL mpp_sum( zq2 )365 cycletot2(3) = zq1 + zq2366 IF ( lwp ) WRITE(numout,9010) 'iron', zq1, zq2, cycletot2(3)367 zq1 = loc_cycletot3(4)368 zq2 = loc_cycletot2(4)369 IF( lk_mpp ) CALL mpp_sum( zq1 )370 IF( lk_mpp ) CALL mpp_sum( zq2 )371 cycletot2(4) = zq1 + zq2372 IF ( lwp ) WRITE(numout,9010) 'carbon', zq1, zq2, cycletot2(4)373 zq1 = loc_cycletot3(5)374 zq2 = loc_cycletot2(5)375 IF( lk_mpp ) CALL mpp_sum( zq1 )376 IF( lk_mpp ) CALL mpp_sum( zq2 )377 cycletot2(5) = zq1 + zq2378 IF ( lwp ) WRITE(numout,9010) 'alkalinity', zq1, zq2, cycletot2(5)379 zq1 = loc_cycletot3(6)380 zq2 = loc_cycletot2(6)381 IF( lk_mpp ) CALL mpp_sum( zq1 )382 IF( lk_mpp ) CALL mpp_sum( zq2 )383 cycletot2(6) = zq1 + zq2384 IF ( lwp ) WRITE(numout,9010) 'oxygen', zq1, zq2, cycletot2(6)385 zq1 = loc_vol386 zq2 = loc_area387 IF( lk_mpp ) CALL mpp_sum( zq1 )388 IF( lk_mpp ) CALL mpp_sum( zq2 )389 IF ( lwp ) WRITE(numout,*)390 IF ( lwp ) WRITE(numout,*) ' check : cvol : ', zq1391 IF ( lwp ) WRITE(numout,*) ' check : carea : ', zq2392 IF ( lwp ) WRITE(numout,*)393 IF ( lwp ) CALL flush(numout)394 !395 ! report back396 ! nitrogen397 ztot3d(:,:,:) = trn(:,:,:,jpphn) + trn(:,:,:,jpphd) + trn(:,:,:,jpzmi) + &398 trn(:,:,:,jpzme) + trn(:,:,:,jpdet) + trn(:,:,:,jpdin)399 ztot2d(:,:) = zn_sed_n(:,:)400 zsum3d = glob_sum( ztot3d(nldi:nlei,nldj:nlej,:) * cvol(nldi:nlei,nldj:nlej,:) )401 zsum2d = glob_sum( ztot2d(nldi:nlei,nldj:nlej) * carea(nldi:nlei,nldj:nlej) )402 cycletot(1) = zsum3d + zsum2d403 IF ( lwp ) WRITE(numout,9010) 'nitrogen', zsum3d, zsum2d, cycletot(1)404 IF ( lwp ) CALL flush(numout)405 406 !407 408 282 # endif 409 283 
branches/NERC/dev_r5518_GO6_conserv_Check/NEMOGCM/NEMO/TOP_SRC/trcrst.F90
r8926 r9128 842 842 IF ( lwp ) CALL flush(numout) 843 843 ! 844 !845 ! Excluding Halo version:846 !847 ! This second check dodges around the halo points in the grid848 ! to check that glob_sum is doing what it's supposed to be849 ! doing; note that the loop ordering here is the "correct" way850 ! (according to Dr. Google)851 !852 IF ( lwp ) WRITE(numout,*)853 IF ( lwp ) WRITE(numout,*) ' Elemental cycle totals (check): '854 ! ocean cells855 loc_cycletot3(:) = 0._wp856 loc_vol = 0._wp857 DO jk = 1, jpk858 DO jj = nldj,nlej859 DO ji = nldi,nlei860 loc_vol = loc_vol + cvol(ji,jj,jk)861 ! nitrogen862 zq1 = trn(ji,jj,jk,jpphn) + trn(ji,jj,jk,jpphd) + trn(ji,jj,jk,jpzmi) + &863 trn(ji,jj,jk,jpzme) + trn(ji,jj,jk,jpdet) + trn(ji,jj,jk,jpdin)864 loc_cycletot3(1) = loc_cycletot3(1) + ( zq1 * cvol(ji,jj,jk) )865 ! silicon866 zq1 = trn(ji,jj,jk,jppds) + trn(ji,jj,jk,jpsil)867 loc_cycletot3(2) = loc_cycletot3(2) + ( zq1 * cvol(ji,jj,jk) )868 ! iron869 zq1 = ((trn(ji,jj,jk,jpphn) + trn(ji,jj,jk,jpphd) + trn(ji,jj,jk,jpzmi) + &870 trn(ji,jj,jk,jpzme) + trn(ji,jj,jk,jpdet)) * xrfn) + trn(ji,jj,jk,jpfer)871 loc_cycletot3(3) = loc_cycletot3(3) + ( zq1 * cvol(ji,jj,jk) )872 ! carbon873 zq1 = (trn(ji,jj,jk,jpphn) * xthetapn) + (trn(ji,jj,jk,jpphd) * xthetapd) + &874 (trn(ji,jj,jk,jpzmi) * xthetazmi) + (trn(ji,jj,jk,jpzme) * xthetazme) + &875 trn(ji,jj,jk,jpdtc) + trn(ji,jj,jk,jpdic)876 loc_cycletot3(4) = loc_cycletot3(4) + ( zq1 * cvol(ji,jj,jk) )877 ! alkalinity878 zq1 = trn(ji,jj,jk,jpalk)879 loc_cycletot3(5) = loc_cycletot3(5) + ( zq1 * cvol(ji,jj,jk) )880 ! oxygen881 zq1 = trn(ji,jj,jk,jpoxy)882 loc_cycletot3(6) = loc_cycletot3(6) + ( zq1 * cvol(ji,jj,jk) )883 ENDDO884 ENDDO885 ENDDO886 !887 ! sediment cells888 loc_cycletot2(:) = 0._wp889 loc_area = 0._wp890 jk = 1891 DO jj = nldj,nlej892 DO ji = nldi,nlei893 loc_area = loc_area + (e1e2t(ji,jj) * tmask(ji,jj,jk))894 ! nitrogen895 zq1 = zn_sed_n(ji,jj)896 loc_cycletot2(1) = loc_cycletot2(1) + (zq1 * e1e2t(ji,jj) * tmask(ji,jj,jk))897 ! silicon898 zq1 = zn_sed_si(ji,jj)899 loc_cycletot2(2) = loc_cycletot2(2) + (zq1 * e1e2t(ji,jj) * tmask(ji,jj,jk))900 ! iron901 zq1 = zn_sed_fe(ji,jj)902 loc_cycletot2(3) = loc_cycletot2(3) + (zq1 * e1e2t(ji,jj) * tmask(ji,jj,jk))903 ! carbon904 zq1 = zn_sed_c(ji,jj) + zn_sed_ca(ji,jj)905 loc_cycletot2(4) = loc_cycletot2(4) + (zq1 * e1e2t(ji,jj) * tmask(ji,jj,jk))906 ! alkalinity907 zq1 = zn_sed_ca(ji,jj) * 2._wp908 loc_cycletot2(5) = loc_cycletot2(5) + (zq1 * e1e2t(ji,jj) * tmask(ji,jj,jk))909 ! skip oxygen910 ENDDO911 ENDDO912 IF ( lwp ) WRITE(numout,*) ' New Check '913 !914 !915 ! nitrogen916 ! total tracer, and delta917 zq1 = loc_cycletot3(1)918 zq2 = loc_cycletot2(1)919 IF( lk_mpp ) CALL mpp_sum( zq1 )920 IF( lk_mpp ) CALL mpp_sum( zq2 )921 zinvt = zq1 + zq2922 zdelta = zinvt  cycletot2(1)923 zratio = 1.0e2 * zdelta / cycletot2(1)924 !925 IF ( lwp ) WRITE(numout,9010) 'nitrogen', zq1, zq2, zinvt, &926 cycletot2(1), zdelta, zratio927 IF ( lwp ) WRITE(numout,*)928 !929 !930 ! silicon931 zq1 = loc_cycletot3(2)932 zq2 = loc_cycletot2(2)933 IF( lk_mpp ) CALL mpp_sum( zq1 )934 IF( lk_mpp ) CALL mpp_sum( zq2 )935 zinvt = zq1 + zq2936 zdelta = zinvt  cycletot2(2)937 zratio = 1.0e2 * zdelta / cycletot2(2)938 !939 IF ( lwp ) WRITE(numout,9010) 'silicon', zq1, zq2, zinvt, &940 cycletot2(2), zdelta, zratio941 IF ( lwp ) WRITE(numout,*)942 !943 !944 ! iron945 zq1 = loc_cycletot3(3)946 zq2 = loc_cycletot2(3)947 IF( lk_mpp ) CALL mpp_sum( zq1 )948 IF( lk_mpp ) CALL mpp_sum( zq2 )949 zinvt = zq1 + zq2950 zdelta = zinvt  cycletot2(3)951 zratio = 1.0e2 * zdelta / cycletot2(3)952 !953 IF ( lwp ) WRITE(numout,9010) 'iron', zq1, zq2, zinvt, &954 cycletot2(3), zdelta, zratio955 IF ( lwp ) WRITE(numout,*)956 !957 !958 ! carbon959 zq1 = loc_cycletot3(4)960 zq2 = loc_cycletot2(4)961 IF( lk_mpp ) CALL mpp_sum( zq1 )962 IF( lk_mpp ) CALL mpp_sum( zq2 )963 zinvt = zq1 + zq2964 zdelta = zinvt  cycletot2(4)965 zratio = 1.0e2 * zdelta / cycletot2(4)966 !967 IF ( lwp ) WRITE(numout,9010) 'carbon', zq1, zq2, zinvt, &968 cycletot2(4), zdelta, zratio969 IF ( lwp ) WRITE(numout,*)970 !971 !972 ! alkalinity973 zq1 = loc_cycletot3(5)974 zq2 = loc_cycletot2(5)975 IF( lk_mpp ) CALL mpp_sum( zq1 )976 IF( lk_mpp ) CALL mpp_sum( zq2 )977 zinvt = zq1 + zq2978 zdelta = zinvt  cycletot2(5)979 zratio = 1.0e2 * zdelta / cycletot2(5)980 !981 IF ( lwp ) WRITE(numout,9010) 'alkalinity', zq1, zq2, zinvt, &982 cycletot2(5), zdelta, zratio983 IF ( lwp ) WRITE(numout,*)984 !985 !986 ! oxygen987 zq1 = loc_cycletot3(6)988 zq2 = loc_cycletot2(6)989 IF( lk_mpp ) CALL mpp_sum( zq1 )990 IF( lk_mpp ) CALL mpp_sum( zq2 )991 zinvt = zq1 + zq2992 zdelta = zinvt  cycletot2(6)993 zratio = 1.0e2 * zdelta / cycletot2(6)994 !995 IF ( lwp ) WRITE(numout,9010) 'oxygen', zq1, zq2, zinvt, &996 cycletot2(6), zdelta, zratio997 IF ( lwp ) WRITE(numout,*)998 !999 !1000 zq1 = loc_vol1001 zq2 = loc_area1002 IF( lk_mpp ) CALL mpp_sum( zq1 )1003 IF( lk_mpp ) CALL mpp_sum( zq2 )1004 IF ( lwp ) WRITE(numout,*)1005 IF ( lwp ) WRITE(numout,*) ' check : cvol : ', zq11006 IF ( lwp ) WRITE(numout,*) ' check : carea : ', zq21007 IF ( lwp ) WRITE(numout,*)1008 IF ( lwp ) CALL flush(numout)1009 1010 !!1011 !!1012 844 9010 FORMAT(' element:',a10, & 1013 845 ' 3d sum:',e18.10,' 2d sum:',e18.10, &
Note: See TracChangeset
for help on using the changeset viewer.