Changeset 945 for trunk/NEMO/TOP_SRC/initrc.F90
- Timestamp:
- 2008-05-14T18:14:53+02:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/NEMO/TOP_SRC/initrc.F90
r793 r945 1 1 MODULE initrc 2 !!================================================ 3 !! 4 !! *** MODULE initrc *** 5 !! Initialisation the tracer model 6 !!================================================ 7 8 #if defined key_passivetrc 9 10 !!------------------------------------------------------- 11 !! TOP 1.0, LOCEAN-IPSL (2005) 12 !! $Header$ 13 !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt 14 !!------------------------------------------------------- 15 16 !!-------------------------------------------------------------- 17 !! * Modules used 18 !! ============== 2 !!====================================================================== 3 !! *** MODULE initrc *** 4 !! TOP : Initialisation of passive tracers 5 !!====================================================================== 6 !! History : - ! 1991-03 () original code 7 !! 1.0 ! 2005-03 (O. Aumont, A. El Moussaoui) F90 8 !! - ! 2005-10 (C. Ethe) print control 9 !! 2.0 ! 2005-10 (C. Ethe, G. Madec) revised architecture 10 !!---------------------------------------------------------------------- 11 #if defined key_top 12 !!---------------------------------------------------------------------- 13 !! 'key_top' TOP models 14 !!---------------------------------------------------------------------- 15 !! ini_trc : initialisation of passive tracers 16 !!---------------------------------------------------------------------- 19 17 USE oce_trc 20 18 USE trc … … 25 23 USE trcini 26 24 USE prtctl_trc ! Print control passive tracers (prt_ctl_trc_init routine) 27 USE lib_mpp ! distributed memory computing28 25 29 26 IMPLICIT NONE 30 27 PRIVATE 31 28 32 33 !! * Accessibility 34 PUBLIC ini_trc 29 PUBLIC ini_trc ! called by ??? 35 30 36 31 !! * Substitutions 37 32 # include "domzgr_substitute.h90" 33 !!---------------------------------------------------------------------- 34 !! NEMO/TOP 1.0 , LOCEAN-IPSL (2005) 35 !! $Id$ 36 !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 37 !!---------------------------------------------------------------------- 38 38 39 39 CONTAINS … … 41 41 SUBROUTINE ini_trc 42 42 !!--------------------------------------------------------------------- 43 !! *** ROUTINE ini_trc *** 43 44 !! 44 !! ROUTINE ini_trc 45 !! ****************** 45 !! ** Purpose : Initialization of the passive tracer fields 46 46 !! 47 !! PURPOSE : 48 !! --------- 49 !! initialize the tracer model 50 !! 51 !! METHOD : 52 !! ------- 53 !! 54 !! 55 !! History: 56 !! ------- 57 !! original : 91-03 () 58 !! additions : 92-01 (C. Levy) 59 !! 05-03 (O. Aumont and A. El Moussaoui) F90 60 !! 05-10 (C. Ethe ) print control initialization 61 !!---------------------------------------------------------------------- 47 !! ** Method : - read namelist 48 !! - control the consistancy 49 !! - compute specific initialisations 50 !! - set initial tracer fields (either read restart 51 !! or read data or analytical formulation 52 !!--------------------------------------------------------------------- 53 INTEGER :: jk, jn ! dummy loop indices 54 REAL(wp), DIMENSION(jpi,jpj,jpk) :: zbt ! workspace: masked grid volume 55 CHARACTER (len=25) :: charout 62 56 63 57 !!--------------------------------------------------------------------- 64 !! OPA.9, 03-200565 !!---------------------------------------------------------------------66 INTEGER :: ji, jj, jk, jn !: dummy loop indices67 58 68 !! 0.b PRINT the number of tracer 69 !! ------------------------------ 59 IF(lwp) WRITE(numout,*) 60 IF(lwp) WRITE(numout,*) 'ini_trc : initial set up of the passive tracers' 61 IF(lwp) WRITE(numout,*) '~~~~~~~' 70 62 71 IF(lwp) WRITE(numout,*) ' ' 72 IF(lwp) WRITE(numout,*) ' *** number of passive tracer jptra = ',jptra 73 IF(lwp) WRITE(numout,*) ' ' 63 ! ! masked grid volume 64 DO jk = 1, jpk 65 zbt(:,:,jk) = e1t(:,:) * e2t(:,:) * fse3t(:,:,jk) * tmask(:,:,jk) * tmask_i(:,:) 66 END DO 67 #if defined key_off_degrad 68 DO jk = 1, jpk 69 zbt(:,:,:) = zbt(:,:,:) * facvol(:,:,jk) ! degrad option: reduction by facvol 70 ENDDO 71 #endif 74 72 75 ! 1. READ passive tracers namelists 76 ! --------------------------------- 73 ! ! total volume of the ocean 74 areatot = SUM( zbt(:,:,:) ) 75 IF( lk_mpp ) CALL mpp_sum( areatot ) ! sum over the global domain 77 76 78 CALL trc_lec 77 CALL trc_lec ! READ passive tracers namelists 79 78 80 ! 2. control consistency between parameters, cpp key and namelists 81 ! ---------------------------------------------------------------- 79 CALL trc_ctl ! control consistency between parameters, cpp key and namelists 82 80 83 CALL trc_ ctl81 CALL trc_ini ! computes some initializations 84 82 85 ! 3. computes some initializations 86 ! -------------------------------- 87 88 CALL trc_ini 89 90 91 ! 4. total volume of the ocean 92 !----------------------------- 93 94 areatot = 0. 95 DO jk = 1, jpk 96 DO jj = 1, jpj 97 DO ji = 1, jpi 98 areatot = areatot + tmask(ji,jj,jk) * tmask_i(ji,jj) & 99 #if defined key_off_degrad 100 & * facvol(ji,jj,jk) & 101 #endif 102 & * e1t(ji,jj) * e2t(ji,jj) * fse3t(ji,jj,jk) 103 END DO 104 END DO 105 END DO 106 IF( lk_mpp ) THEN 107 CALL mpp_sum(areatot) ! sum over the global domain 108 END IF 109 110 IF(lwp) WRITE(numout,*) ' ' 111 IF (lwp) WRITE(numout,*) 'Total volume of ocean =',areatot 112 IF(lwp) WRITE(numout,*) ' ' 113 114 ! 5. Initialization of tracers 115 ! ----------------------------- 116 117 IF( lrsttr ) THEN 118 119 ! 5.1 restart from a file 120 !------------------------ 121 CALL trc_rst_read 122 123 ELSE 124 125 ! 5.2 analytical formulation or global data 126 !------------------------------------- 127 CALL trc_dtr 128 83 ! ! set initial tracer values 84 IF( lrsttr ) THEN ; CALL trc_rst_read ! restart from a file 85 ELSE ; CALL trc_dtr ! analytical formulation or from data 129 86 ENDIF 130 87 88 ! ! Computation content of all tracers 89 trai = 0.e0 90 DO jn = 1, jptra 91 trai = trai + SUM( trn(:,:,:,jn) * zbt(:,:,:) ) 92 END DO 93 IF( lk_mpp ) CALL mpp_sum( trai ) ! sum over the global domain 131 94 132 ! 6. Computation integral of all tracers133 !------------------134 95 135 trai = 0. 136 DO jn = 1, jptra 137 DO jk = 1, jpk 138 DO jj = 1, jpj 139 DO ji = 1, jpi 140 trai = trai + trn(ji,jj,jk,jn) * tmask(ji,jj,jk) * tmask_i(ji,jj) & 141 #if defined key_off_degrad 142 & * facvol(ji,jj,jk) & 143 #endif 96 ! ! control print 97 IF(lwp) WRITE(numout,*) ' *** Total number of passive tracer jptra = ', jptra 98 IF(lwp) WRITE(numout,*) ' *** Total volume of ocean = ', areatot 99 IF(lwp) WRITE(numout,*) ' *** Total inital content of all tracers = ', trai 100 IF(lwp) WRITE(numout,*) 144 101 145 & * e1t(ji,jj) * e2t(ji,jj) * fse3t(ji,jj,jk) 146 END DO 147 END DO 148 END DO 149 ENDDO 150 151 IF( lk_mpp ) THEN 152 CALL mpp_sum(trai) ! sum over the global domain 153 END IF 102 IF( ln_ctl ) CALL prt_ctl_trc_init ! control print 103 ! 154 104 155 IF(lwp) WRITE(numout,*) ' ' 156 IF(lwp) WRITE(numout,*) 'Integral of all tracers over the full domain at initial time =',trai 157 IF(lwp) WRITE(numout,*) ' ' 158 159 ! 6. Print control 160 !------------------ 161 162 IF( ln_ctl ) CALL prt_ctl_trc_init 105 IF(ln_ctl) THEN ! print mean trends (used for debugging) 106 WRITE(charout, FMT="('ini ')") 107 CALL prt_ctl_trc_info( charout ) 108 CALL prt_ctl_trc( tab4d=trn, mask=tmask, clinfo=ctrcnm ) 109 ENDIF 163 110 164 111 END SUBROUTINE ini_trc 165 112 166 167 113 #else 168 !! ======================================================================169 !! Empty module : No passive tracer170 !! ======================================================================114 !!---------------------------------------------------------------------- 115 !! Empty module : No passive tracer 116 !!---------------------------------------------------------------------- 171 117 CONTAINS 172 SUBROUTINE ini_trc 118 SUBROUTINE ini_trc ! Dummy routine 173 119 END SUBROUTINE ini_trc 174 120 #endif 175 121 122 !!====================================================================== 176 123 END MODULE initrc
Note: See TracChangeset
for help on using the changeset viewer.