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