Changeset 8467 for branches/NERC
- Timestamp:
- 2017-08-25T18:56:36+02:00 (7 years ago)
- Location:
- branches/NERC/dev_r5518_GO6_package_trdtrc/NEMOGCM/NEMO/TOP_SRC
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/NERC/dev_r5518_GO6_package_trdtrc/NEMOGCM/NEMO/TOP_SRC/TRP/trctrp.F90
r8442 r8467 28 28 USE zpshde ! partial step: hor. derivative (zps_hde routine) 29 29 # if defined key_debug_medusa 30 USE trc rst30 USE trcstat 31 31 # endif 32 32 -
branches/NERC/dev_r5518_GO6_package_trdtrc/NEMOGCM/NEMO/TOP_SRC/TRP/trdtrc.F90
r8453 r8467 19 19 USE trdmxl_trc ! Mixed layer trends diag. 20 20 USE iom ! I/O library 21 # if defined key_debug_medusa 22 USE trcstat, ONLY: trc_rst_dia_stat 23 # endif 21 24 22 25 IMPLICIT NONE … … 100 103 CASE( jptra_tot ) ; WRITE (cltra,'("TOT_",4a)') 101 104 cltra = TRIM(cltra)//TRIM(ctrcnm(kjn)) 102 IF (iom_use(cltra)) CALL iom_put( cltra, ptrtrd(:,:,:))105 CALL trd_trc_iomput( cltra, ptrtrd, kjn, kt ) 103 106 END SELECT 104 107 ! … … 107 110 CASE( jptra_xad ) ; WRITE (cltra,'("XAD_",4a)') 108 111 cltra = TRIM(cltra)//TRIM(ctrcnm(kjn)) 109 IF (iom_use(cltra)) CALL iom_put( cltra, ptrtrd(:,:,:))112 CALL trd_trc_iomput( cltra, ptrtrd, kjn, kt ) 110 113 CASE( jptra_yad ) ; WRITE (cltra,'("YAD_",4a)') 111 114 cltra = TRIM(cltra)//TRIM(ctrcnm(kjn)) 112 IF (iom_use(cltra)) CALL iom_put( cltra, ptrtrd(:,:,:))115 CALL trd_trc_iomput( cltra, ptrtrd, kjn, kt ) 113 116 CASE( jptra_zad ) ; WRITE (cltra,'("ZAD_",4a)') !! care vvl case 114 117 cltra = TRIM(cltra)//TRIM(ctrcnm(kjn)) 115 IF (iom_use(cltra)) CALL iom_put( cltra, ptrtrd(:,:,:))118 CALL trd_trc_iomput( cltra, ptrtrd, kjn, kt ) 116 119 CASE( jptra_totad ) ; WRITE (cltra,'("TAD_",4a)') !! total adv 117 120 cltra = TRIM(cltra)//TRIM(ctrcnm(kjn)) 118 IF (iom_use(cltra)) CALL iom_put( cltra, ptrtrd(:,:,:))121 CALL trd_trc_iomput( cltra, ptrtrd, kjn, kt ) 119 122 CASE( jptra_ldf ) ; WRITE (cltra,'("LDF_",4a)') 120 123 cltra = TRIM(cltra)//TRIM(ctrcnm(kjn)) 121 IF (iom_use(cltra)) CALL iom_put( cltra, ptrtrd(:,:,:))124 CALL trd_trc_iomput( cltra, ptrtrd, kjn, kt ) 122 125 CASE( jptra_bbl ) ; WRITE (cltra,'("BBL_",4a)') 123 126 cltra = TRIM(cltra)//TRIM(ctrcnm(kjn)) 124 IF (iom_use(cltra)) CALL iom_put( cltra, ptrtrd(:,:,:))127 CALL trd_trc_iomput( cltra, ptrtrd, kjn, kt ) 125 128 CASE( jptra_nsr ) ; WRITE (cltra,'("FOR_",4a)') 126 129 cltra = TRIM(cltra)//TRIM(ctrcnm(kjn)) 127 IF (iom_use(cltra)) CALL iom_put( cltra, ptrtrd(:,:,:))130 CALL trd_trc_iomput( cltra, ptrtrd, kjn, kt ) 128 131 CASE( jptra_zdf ) ; WRITE (cltra,'("ZDF_",4a)') 129 132 cltra = TRIM(cltra)//TRIM(ctrcnm(kjn)) 130 IF (iom_use(cltra)) CALL iom_put( cltra, ptrtrd(:,:,:))133 CALL trd_trc_iomput( cltra, ptrtrd, kjn, kt ) 131 134 CASE( jptra_zdfp ) ; WRITE (cltra,'("ZDP_",4a)') 132 135 cltra = TRIM(cltra)//TRIM(ctrcnm(kjn)) 133 IF (iom_use(cltra)) CALL iom_put( cltra, ptrtrd(:,:,:))136 CALL trd_trc_iomput( cltra, ptrtrd, kjn, kt ) 134 137 CASE( jptra_dmp ) ; WRITE (cltra,'("DMP_",4a)') 135 138 cltra = TRIM(cltra)//TRIM(ctrcnm(kjn)) 136 IF (iom_use(cltra)) CALL iom_put( cltra, ptrtrd(:,:,:))139 CALL trd_trc_iomput( cltra, ptrtrd, kjn, kt ) 137 140 CASE( jptra_sms ) ; WRITE (cltra,'("SMS_",4a)') 138 141 cltra = TRIM(cltra)//TRIM(ctrcnm(kjn)) 139 IF (iom_use(cltra)) CALL iom_put( cltra, ptrtrd(:,:,:))142 CALL trd_trc_iomput( cltra, ptrtrd, kjn, kt ) 140 143 CASE( jptra_radb ) ; WRITE (cltra,'("RDB_",4a)') 141 144 cltra = TRIM(cltra)//TRIM(ctrcnm(kjn)) 142 IF (iom_use(cltra)) CALL iom_put( cltra, ptrtrd(:,:,:))145 CALL trd_trc_iomput( cltra, ptrtrd, kjn, kt ) 143 146 CASE( jptra_radn ) ; WRITE (cltra,'("RDN_",4a)') 144 147 cltra = TRIM(cltra)//TRIM(ctrcnm(kjn)) 145 IF (iom_use(cltra)) CALL iom_put( cltra, ptrtrd(:,:,:))148 CALL trd_trc_iomput( cltra, ptrtrd, kjn, kt ) 146 149 END SELECT 147 150 ELSE IF( MOD( kt, 2 ) == 1 ) THEN … … 149 152 CASE( jptra_atf ) ; WRITE (cltra,'("ATF_",4a)') 150 153 cltra = TRIM(cltra)//TRIM(ctrcnm(kjn)) 151 IF (iom_use(cltra)) CALL iom_put( cltra, ptrtrd(:,:,:))154 CALL trd_trc_iomput( cltra, ptrtrd, kjn, kt ) 152 155 END SELECT 153 156 END IF … … 172 175 173 176 END SUBROUTINE trd_trc_bio 177 178 SUBROUTINE trd_trc_iomput( cltra, ptrtrd, kjn, kt ) 179 !!---------------------------------------------------------------------- 180 !! *** ROUTINE trd_trc_iomput *** 181 !!---------------------------------------------------------------------- 182 INTEGER, INTENT( in ) :: kt ! timestep 183 INTEGER, INTENT( in ) :: kjn ! biotrend index 184 REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT( inout ) :: ptrtrd ! var trend 185 CHARACTER (len=*),INTENT( in ) :: cltra ! trend name 186 !!---------------------------------------------------------------------- 187 188 189 IF (iom_use(cltra)) THEN 190 # if defined key_debug_medusa 191 IF(lwp) WRITE(numout,*) ' TREND stats (min, max,sum) kt = ',kt ,' jn = ',kjn 192 CALL trc_rst_dia_stat( ptrtrd(:,:,1), cltra) 193 # endif 194 CALL iom_put( cltra, ptrtrd(:,:,:) ) 195 # if defined key_debug_medusa 196 ELSE 197 IF(lwp) WRITE(numout,*) & 198 ' TREND -- No output asked for ',cltra,' kt = ',kt,' jn = ',kjn 199 CALL trc_rst_dia_stat( ptrtrd(:,:,1), cltra) 200 # endif 201 ENDIF 202 203 END SUBROUTINE trd_trc_iomput 204 205 174 206 #else 175 207 !!---------------------------------------------------------------------- -
branches/NERC/dev_r5518_GO6_package_trdtrc/NEMOGCM/NEMO/TOP_SRC/trcrst.F90
r8427 r8467 43 43 USE sbc_oce, ONLY: lk_oasis 44 44 USE oce, ONLY: CO2Flux_out_cpl, DMS_out_cpl, chloro_out_cpl !! Coupling variable 45 USE trcstat 45 46 46 47 IMPLICIT NONE … … 52 53 PUBLIC trc_rst_cal 53 54 PUBLIC trc_rst_stat 54 PUBLIC trc_rst_dia_stat55 PUBLIC trc_rst_tra_stat56 55 57 56 !! * Substitutions … … 697 696 698 697 699 SUBROUTINE trc_rst_tra_stat700 !!----------------------------------------------------------------------701 !! *** trc_rst_tra_stat ***702 !!703 !! ** purpose : Compute tracers statistics - check where crazy values appears704 !!----------------------------------------------------------------------705 INTEGER :: jk, jn706 REAL(wp) :: ztraf, zmin, zmax, zmean, zdrift, areasf707 REAL(wp), DIMENSION(jpi,jpj) :: zvol708 !!----------------------------------------------------------------------709 710 IF( lwp ) THEN711 WRITE(numout,*)712 WRITE(numout,*) ' ----SURFACE TRA STAT---- '713 WRITE(numout,*)714 ENDIF715 !716 zvol(:,:) = e1e2t(:,:) * fse3t_a(:,:,1) * tmask(:,:,1)717 areasf = glob_sum(zvol(:,:))718 DO jn = 1, jptra719 ztraf = glob_sum( tra(:,:,1,jn) * zvol(:,:) )720 zmin = MINVAL( tra(:,:,1,jn), mask= ((tmask(:,:,1).NE.0.)) )721 zmax = MAXVAL( tra(:,:,1,jn), mask= ((tmask(:,:,1).NE.0.)) )722 IF( lk_mpp ) THEN723 CALL mpp_min( zmin ) ! min over the global domain724 CALL mpp_max( zmax ) ! max over the global domain725 END IF726 zmean = ztraf / areasf727 IF(lwp) WRITE(numout,9001) jn, TRIM( ctrcnm(jn) ), zmean, zmin, zmax728 END DO729 IF(lwp) WRITE(numout,*)730 9001 FORMAT(' tracer nb :',i2,' name :',a10,' mean :',e18.10,' min :',e18.10, &731 & ' max :',e18.10)732 !733 END SUBROUTINE trc_rst_tra_stat734 735 736 737 SUBROUTINE trc_rst_dia_stat( dgtr, names)738 !!----------------------------------------------------------------------739 !! *** trc_rst_dia_stat ***740 !!741 !! ** purpose : Compute tracers statistics742 !!----------------------------------------------------------------------743 REAL(wp), DIMENSION(jpi,jpj) , INTENT(in) :: dgtr ! 2D diag var744 CHARACTER(len=*) , INTENT(in) :: names ! 2D diag name745 !!---------------------------------------------------------------------746 INTEGER :: jk, jn747 CHARACTER (LEN=18) :: text_zmean748 REAL(wp) :: ztraf, zmin, zmax, zmean, areasf749 REAL(wp), DIMENSION(jpi,jpj) :: zvol750 !!----------------------------------------------------------------------751 752 IF( lwp ) WRITE(numout,*) 'STAT- ', names753 754 ! fse3t_a will be undefined at the start of a run, but this routine755 ! may be called at any stage! Hence we MUST make sure it is756 ! initialised to zero when allocated to enable us to test for757 ! zero content here and avoid potentially dangerous and non-portable758 ! operations (e.g. divide by zero, global sums of junk values etc.)759 zvol(:,:) = e1e2t(:,:) * fse3t_a(:,:,1) * tmask(:,:,1)760 ztraf = glob_sum( dgtr(:,:) * zvol(:,:) )761 !! areasf = glob_sum(e1e2t(:,:) * tmask(:,:,1) )762 areasf = glob_sum(zvol(:,:))763 zmin = MINVAL( dgtr(:,:), mask= ((tmask(:,:,1).NE.0.)) )764 zmax = MAXVAL( dgtr(:,:), mask= ((tmask(:,:,1).NE.0.)) )765 IF( lk_mpp ) THEN766 CALL mpp_min( zmin ) ! min over the global domain767 CALL mpp_max( zmax ) ! max over the global domain768 END IF769 770 text_zmean = "N/A"771 ! Avoid divide by zero. areasf must be positive.772 IF (areasf > 0.0) THEN773 zmean = ztraf / areasf774 WRITE(text_zmean,'(e18.10)') zmean775 ENDIF776 777 IF(lwp) WRITE(numout,9002) TRIM( names ), text_zmean, zmin, zmax778 779 9002 FORMAT(' tracer name :',A,' mean :',A,' min :',e18.10, &780 & ' max :',e18.10 )781 !782 END SUBROUTINE trc_rst_dia_stat783 784 785 698 #else 786 699 !!---------------------------------------------------------------------- -
branches/NERC/dev_r5518_GO6_package_trdtrc/NEMOGCM/NEMO/TOP_SRC/trcstp.F90
r8442 r8467 19 19 USE trcwri 20 20 USE trcrst 21 USE trcstat 21 22 USE trdtrc_oce 22 23 USE trdmxl_trc
Note: See TracChangeset
for help on using the changeset viewer.