Changeset 8338 for branches/UKMO
- Timestamp:
- 2017-07-14T16:25:28+02:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/UKMO/dev_r5518_GO6_allow_trends/NEMOGCM/NEMO/TOP_SRC/trcnam.F90
r8280 r8338 11 11 !! - ! 2001-01 (E Kestenare) suppress ndttrc=1 for CEN2 and TVD schemes 12 12 !! 1.0 ! 2005-03 (O. Aumont, A. El Moussaoui) F90 13 !! - ! 2014-06 (A. Yool, J. Palmieri) adding MEDUSA-214 13 !!---------------------------------------------------------------------- 15 14 #if defined key_top … … 25 24 USE trcnam_cfc ! CFC SMS namelist 26 25 USE trcnam_c14b ! C14 SMS namelist 26 USE trcnam_age ! AGE SMS namelist 27 27 USE trcnam_my_trc ! MY_TRC SMS namelist 28 USE trcnam_medusa ! MEDUSA namelist29 USE trcnam_idtra ! Idealise tracer namelist30 USE trcnam_age ! AGE SMS namelist31 28 USE trd_oce 32 29 USE trdtrc_oce … … 43 40 !!---------------------------------------------------------------------- 44 41 !! NEMO/TOP 3.3 , NEMO Consortium (2010) 45 !! $Id $42 !! $Id: trcnam.F90 7873 2017-04-05 09:24:00Z cetlod $ 46 43 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 47 44 !!---------------------------------------------------------------------- … … 58 55 !! ** Method : - read passive tracer namelist 59 56 !! - read namelist of each defined SMS model 60 !! ( (PISCES, CFC, MY_TRC , MEDUSA, IDTRA, Age)61 !!--------------------------------------------------------------------- 62 INTEGER :: jn , jk! dummy loop indice57 !! ( (PISCES, CFC, MY_TRC ) 58 !!--------------------------------------------------------------------- 59 INTEGER :: jn ! dummy loop indice 63 60 ! ! Parameters of the run 64 61 IF( .NOT. lk_offline ) CALL trc_nam_run 65 62 66 63 ! ! passive tracer informations 67 # if defined key_debug_medusa 68 CALL flush(numout) 69 IF (lwp) write (numout,*) '------------------------------' 70 IF (lwp) write (numout,*) 'Jpalm - debug' 71 IF (lwp) write (numout,*) 'in trc_nam - just before CALL trc_nam_trc' 72 IF (lwp) write (numout,*) ' ' 73 # endif 74 ! 75 CALL trc_nam_trc 64 CALL trc_nam_trc 76 65 77 66 ! ! Parameters of additional diagnostics 78 # if defined key_debug_medusa 79 CALL flush(numout) 80 IF (lwp) write (numout,*) '------------------------------' 81 IF (lwp) write (numout,*) 'Jpalm - debug' 82 IF (lwp) write (numout,*) 'CALL trc_nam_trc -- OK' 83 IF (lwp) write (numout,*) 'in trc_nam - just before CALL trc_nam_dia' 84 IF (lwp) write (numout,*) ' ' 85 # endif 86 ! 87 88 CALL trc_nam_dia 67 IF( .NOT. lk_iomput) CALL trc_nam_dia 89 68 90 69 ! ! namelist of transport 91 # if defined key_debug_medusa 92 CALL flush(numout) 93 IF (lwp) write (numout,*) '------------------------------' 94 IF (lwp) write (numout,*) 'Jpalm - debug' 95 IF (lwp) write (numout,*) 'CALL trc_nam_dia -- OK' 96 IF (lwp) write (numout,*) 'in trc_nam - just before CALL trc_nam_trp' 97 IF (lwp) write (numout,*) ' ' 98 # endif 99 ! 100 CALL trc_nam_trp 101 ! 102 # if defined key_debug_medusa 103 CALL flush(numout) 104 IF (lwp) write (numout,*) '------------------------------' 105 IF (lwp) write (numout,*) 'Jpalm - debug' 106 IF (lwp) write (numout,*) 'CALL trc_nam_trp -- OK' 107 IF (lwp) write (numout,*) 'continue trc_nam ' 108 IF (lwp) write (numout,*) ' ' 109 CALL flush(numout) 110 # endif 111 ! 70 CALL trc_nam_trp 112 71 113 72 … … 131 90 END DO 132 91 WRITE(numout,*) ' ' 133 # if defined key_debug_medusa134 CALL flush(numout)135 # endif136 92 ENDIF 137 93 … … 152 108 WRITE(numout,*) 153 109 ENDIF 154 # if defined key_debug_medusa 155 CALL flush(numout) 156 # endif 157 ENDIF 158 159 # if defined key_debug_medusa 160 DO jk = 1, jpk 161 WRITE(numout,*) ' level number: ', jk, 'rdttrc: ',rdttrc(jk),'rdttra: ', rdttra(jk),'nn_dttrc: ', nn_dttrc 162 END DO 163 CALL flush(numout) 164 # endif 110 ENDIF 111 165 112 166 113 rdttrc(:) = rdttra(:) * FLOAT( nn_dttrc ) ! vertical profile of passive tracer time-step … … 170 117 WRITE(numout,*) ' Passive Tracer time step rdttrc = ', rdttrc(1) 171 118 WRITE(numout,*) 172 # if defined key_debug_medusa 173 CALL flush(numout) 174 # endif 175 ENDIF 176 119 ENDIF 120 121 122 ! Call the ice module for tracers 123 ! ------------------------------- 124 CALL trc_nam_ice 125 126 ! namelist of SMS 127 ! --------------- 128 IF( lk_pisces ) THEN ; CALL trc_nam_pisces ! PISCES bio-model 129 ELSE ; IF(lwp) WRITE(numout,*) ' PISCES not used' 130 ENDIF 131 132 IF( lk_cfc ) THEN ; CALL trc_nam_cfc ! CFC tracers 133 ELSE ; IF(lwp) WRITE(numout,*) ' CFC not used' 134 ENDIF 135 136 IF( lk_c14b ) THEN ; CALL trc_nam_c14b ! C14 bomb tracers 137 ELSE ; IF(lwp) WRITE(numout,*) ' C14 not used' 138 ENDIF 139 140 IF( lk_age ) THEN ; CALL trc_nam_age ! AGE tracer 141 ELSE ; IF(lwp) WRITE(numout,*) ' AGE not used' 142 ENDIF 143 144 IF( lk_my_trc ) THEN ; CALL trc_nam_my_trc ! MY_TRC tracers 145 ELSE ; IF(lwp) WRITE(numout,*) ' MY_TRC not used' 146 ENDIF 147 ! 148 END SUBROUTINE trc_nam 149 150 SUBROUTINE trc_nam_run 151 !!--------------------------------------------------------------------- 152 !! *** ROUTINE trc_nam *** 153 !! 154 !! ** Purpose : read options for the passive tracer run (namelist) 155 !! 156 !!--------------------------------------------------------------------- 157 NAMELIST/namtrc_run/ nn_dttrc, nn_writetrc, ln_rsttr, nn_rsttr, ln_top_euler, & 158 & cn_trcrst_indir, cn_trcrst_outdir, cn_trcrst_in, cn_trcrst_out 159 160 161 INTEGER :: ios ! Local integer output status for namelist read 162 163 !!--------------------------------------------------------------------- 164 165 166 IF(lwp) WRITE(numout,*) 'trc_nam : read the passive tracer namelists' 167 IF(lwp) WRITE(numout,*) '~~~~~~~' 168 169 CALL ctl_opn( numnat_ref, 'namelist_top_ref' , 'OLD' , 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. ) 170 CALL ctl_opn( numnat_cfg, 'namelist_top_cfg' , 'OLD' , 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. ) 171 IF(lwm) CALL ctl_opn( numont, 'output.namelist.top', 'UNKNOWN', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE., 1 ) 172 173 REWIND( numnat_ref ) ! Namelist namtrc in reference namelist : Passive tracer variables 174 READ ( numnat_ref, namtrc_run, IOSTAT = ios, ERR = 901) 175 901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc in reference namelist', lwp ) 176 177 REWIND( numnat_cfg ) ! Namelist namtrc in configuration namelist : Passive tracer variables 178 READ ( numnat_cfg, namtrc_run, IOSTAT = ios, ERR = 902 ) 179 902 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc in configuration namelist', lwp ) 180 IF(lwm) WRITE ( numont, namtrc_run ) 181 182 ! computes the first time step of tracer model 183 nittrc000 = nit000 + nn_dttrc - 1 184 185 IF(lwp) THEN ! control print 186 WRITE(numout,*) 187 WRITE(numout,*) ' Namelist : namtrc_run' 188 WRITE(numout,*) ' time step freq. for passive tracer nn_dttrc = ', nn_dttrc 189 WRITE(numout,*) ' restart for passive tracer ln_rsttr = ', ln_rsttr 190 WRITE(numout,*) ' control of time step for passive tracer nn_rsttr = ', nn_rsttr 191 WRITE(numout,*) ' first time step for pass. trac. nittrc000 = ', nittrc000 192 WRITE(numout,*) ' frequency of outputs for passive tracers nn_writetrc = ', nn_writetrc 193 WRITE(numout,*) ' Use euler integration for TRC (y/n) ln_top_euler = ', ln_top_euler 194 WRITE(numout,*) ' ' 195 ENDIF 196 ! 197 END SUBROUTINE trc_nam_run 198 199 SUBROUTINE trc_nam_ice 200 !!--------------------------------------------------------------------- 201 !! *** ROUTINE trc_nam_ice *** 202 !! 203 !! ** Purpose : Read the namelist for the ice effect on tracers 204 !! 205 !! ** Method : - 206 !! 207 !!--------------------------------------------------------------------- 208 ! --- Variable declarations --- ! 209 INTEGER :: jn ! dummy loop indices 210 INTEGER :: ios ! Local integer output status for namelist read 211 212 ! --- Namelist declarations --- ! 213 TYPE(TRC_I_NML), DIMENSION(jptra) :: sn_tri_tracer 214 NAMELIST/namtrc_ice/ nn_ice_tr, sn_tri_tracer 215 216 IF(lwp) THEN 217 WRITE(numout,*) 218 WRITE(numout,*) 'trc_nam_ice : Read the namelist for trc_ice' 219 WRITE(numout,*) '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~' 220 ENDIF 221 222 IF( nn_timing == 1 ) CALL timing_start('trc_nam_ice') 223 224 ! 225 REWIND( numnat_ref ) ! Namelist namtrc_ice in reference namelist : Passive tracer input data 226 READ ( numnat_ref, namtrc_ice, IOSTAT = ios, ERR = 901) 227 901 IF( ios /= 0 ) CALL ctl_nam ( ios , ' namtrc_ice in reference namelist ', lwp ) 228 229 REWIND( numnat_cfg ) ! Namelist namtrc_ice in configuration namelist : Pisces external sources of nutrients 230 READ ( numnat_cfg, namtrc_ice, IOSTAT = ios, ERR = 902 ) 231 902 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc_ice in configuration namelist', lwp ) 232 233 IF( lwp ) THEN 234 WRITE(numout,*) ' ' 235 WRITE(numout,*) ' Sea ice tracers option (nn_ice_tr) : ', nn_ice_tr 236 WRITE(numout,*) ' ' 237 ENDIF 238 239 ! Assign namelist stuff 240 DO jn = 1, jptra 241 trc_ice_ratio(jn) = sn_tri_tracer(jn)%trc_ratio 242 trc_ice_prescr(jn) = sn_tri_tracer(jn)%trc_prescr 243 cn_trc_o (jn) = sn_tri_tracer(jn)%ctrc_o 244 END DO 245 246 IF( nn_timing == 1 ) CALL timing_stop('trc_nam_ice') 247 ! 248 END SUBROUTINE trc_nam_ice 249 250 SUBROUTINE trc_nam_trc 251 !!--------------------------------------------------------------------- 252 !! *** ROUTINE trc_nam *** 253 !! 254 !! ** Purpose : read options for the passive tracer run (namelist) 255 !! 256 !!--------------------------------------------------------------------- 257 TYPE(PTRACER), DIMENSION(jptra) :: sn_tracer ! type of tracer for saving if not key_iomput 258 !! 259 NAMELIST/namtrc/ sn_tracer, ln_trcdta,ln_trcdmp, ln_trcdmp_clo 260 261 INTEGER :: ios ! Local integer output status for namelist read 262 INTEGER :: jn ! dummy loop indice 263 !!--------------------------------------------------------------------- 264 IF(lwp) WRITE(numout,*) 265 IF(lwp) WRITE(numout,*) 'trc_nam : read the passive tracer namelists' 266 IF(lwp) WRITE(numout,*) '~~~~~~~' 267 268 269 REWIND( numnat_ref ) ! Namelist namtrc in reference namelist : Passive tracer variables 270 READ ( numnat_ref, namtrc, IOSTAT = ios, ERR = 901) 271 901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc in reference namelist', lwp ) 272 273 REWIND( numnat_cfg ) ! Namelist namtrc in configuration namelist : Passive tracer variables 274 READ ( numnat_cfg, namtrc, IOSTAT = ios, ERR = 902 ) 275 902 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc in configuration namelist', lwp ) 276 IF(lwm) WRITE ( numont, namtrc ) 277 278 DO jn = 1, jptra 279 ctrcnm (jn) = TRIM( sn_tracer(jn)%clsname ) 280 ctrcln (jn) = TRIM( sn_tracer(jn)%cllname ) 281 ctrcun (jn) = TRIM( sn_tracer(jn)%clunit ) 282 ln_trc_ini(jn) = sn_tracer(jn)%llinit 283 ln_trc_wri(jn) = sn_tracer(jn)%llsave 284 END DO 285 286 END SUBROUTINE trc_nam_trc 287 288 289 SUBROUTINE trc_nam_dia 290 !!--------------------------------------------------------------------- 291 !! *** ROUTINE trc_nam_dia *** 292 !! 293 !! ** Purpose : read options for the passive tracer diagnostics 294 !! 295 !! ** Method : - read passive tracer namelist 296 !! - read namelist of each defined SMS model 297 !! ( (PISCES, CFC, MY_TRC ) 298 !!--------------------------------------------------------------------- 299 INTEGER :: ierr 300 #if defined key_trdmxl_trc || defined key_trdtrc 301 NAMELIST/namtrc_trd/ nn_trd_trc, nn_ctls_trc, rn_ucf_trc, & 302 & ln_trdmxl_trc_restart, ln_trdmxl_trc_instant, & 303 & cn_trdrst_trc_in, cn_trdrst_trc_out, ln_trdtrc 304 #endif 305 NAMELIST/namtrc_dia/ ln_diatrc, ln_diabio, nn_writedia, nn_writebio 306 307 INTEGER :: jn 308 INTEGER :: ios ! Local integer output status for namelist read 309 !!--------------------------------------------------------------------- 310 311 IF(lwp) WRITE(numout,*) 312 IF(lwp) WRITE(numout,*) 'trc_nam_dia : read the passive tracer diagnostics options' 313 IF(lwp) WRITE(numout,*) '~~~~~~~' 314 315 IF(lwp) WRITE(numout,*) 316 IF(lwp) WRITE(numout,*) 'trc_nam_dia : read the passive tracer diagnostics options' 317 IF(lwp) WRITE(numout,*) '~~~~~~~' 318 319 REWIND( numnat_ref ) ! Namelist namtrc_dia in reference namelist : Passive tracer diagnostics 320 READ ( numnat_ref, namtrc_dia, IOSTAT = ios, ERR = 903) 321 903 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc_dia in reference namelist', lwp ) 322 323 REWIND( numnat_cfg ) ! Namelist namtrc_dia in configuration namelist : Passive tracer diagnostics 324 READ ( numnat_cfg, namtrc_dia, IOSTAT = ios, ERR = 904 ) 325 904 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc_dia in configuration namelist', lwp ) 326 IF(lwm) WRITE ( numont, namtrc_dia ) 327 328 IF(lwp) THEN 329 WRITE(numout,*) 330 WRITE(numout,*) 331 WRITE(numout,*) ' Namelist : namtrc_dia' 332 WRITE(numout,*) ' save additionnal diagnostics arrays ln_diatrc = ', ln_diatrc 333 WRITE(numout,*) ' save additionnal biology diagnostics arrays ln_diabio = ', ln_diabio 334 WRITE(numout,*) ' frequency of outputs for additional arrays nn_writedia = ', nn_writedia 335 WRITE(numout,*) ' frequency of outputs for biological trends nn_writebio = ', nn_writebio 336 WRITE(numout,*) ' ' 337 ENDIF 338 339 IF( ln_diatrc ) THEN 340 ALLOCATE( trc2d(jpi,jpj,jpdia2d), trc3d(jpi,jpj,jpk,jpdia3d), & 341 & ctrc2d(jpdia2d), ctrc2l(jpdia2d), ctrc2u(jpdia2d) , & 342 & ctrc3d(jpdia3d), ctrc3l(jpdia3d), ctrc3u(jpdia3d) , STAT = ierr ) 343 IF( ierr > 0 ) CALL ctl_stop( 'STOP', 'trcnam: unable to allocate add. diag. array' ) 344 ! 345 trc2d(:,:,: ) = 0._wp ; ctrc2d(:) = ' ' ; ctrc2l(:) = ' ' ; ctrc2u(:) = ' ' 346 trc3d(:,:,:,:) = 0._wp ; ctrc3d(:) = ' ' ; ctrc3l(:) = ' ' ; ctrc3u(:) = ' ' 347 ! 348 ENDIF 349 350 IF( ln_diabio .OR. l_trdtrc ) THEN 351 ALLOCATE( trbio (jpi,jpj,jpk,jpdiabio) , & 352 & ctrbio(jpdiabio), ctrbil(jpdiabio), ctrbiu(jpdiabio), STAT = ierr ) 353 IF( ierr > 0 ) CALL ctl_stop( 'STOP', 'trcnam: unable to allocate bio. diag. array' ) 354 ! 355 trbio(:,:,:,:) = 0._wp ; ctrbio(:) = ' ' ; ctrbil(:) = ' ' ; ctrbiu(:) = ' ' 356 ! 357 ENDIF 177 358 178 359 #if defined key_trdmxl_trc || defined key_trdtrc … … 200 381 IF( ln_trdtrc(jn) ) WRITE(numout,*) ' compute ML trends for tracer number :', jn 201 382 END DO 202 WRITE(numout,*) ' '203 CALL flush(numout)204 383 ENDIF 205 384 #endif 206 207 # if defined key_debug_medusa208 CALL flush(numout)209 IF (lwp) write (numout,*) '------------------------------'210 IF (lwp) write (numout,*) 'Jpalm - debug'211 IF (lwp) write (numout,*) 'just before ice module for tracers call : '212 IF (lwp) write (numout,*) ' '213 # endif214 !215 216 ! Call the ice module for tracers217 ! -------------------------------218 CALL trc_nam_ice219 220 # if defined key_debug_medusa221 CALL flush(numout)222 IF (lwp) write (numout,*) '------------------------------'223 IF (lwp) write (numout,*) 'Jpalm - debug'224 IF (lwp) write (numout,*) 'Will now read SMS namelists : '225 IF (lwp) write (numout,*) ' '226 # endif227 !228 229 ! namelist of SMS230 ! ---------------231 IF( lk_pisces ) THEN ; CALL trc_nam_pisces ! PISCES bio-model232 ELSE ; IF(lwp) WRITE(numout,*) ' PISCES not used'233 ENDIF234 !235 # if defined key_debug_medusa236 CALL flush(numout)237 IF (lwp) write (numout,*) '------------------------------'238 IF (lwp) write (numout,*) 'Jpalm - debug'239 IF (lwp) write (numout,*) 'CALL trc_nam_pisces -- OK'240 IF (lwp) write (numout,*) 'in trc_nam - just before CALL trc_nam_medusa'241 IF (lwp) write (numout,*) ' '242 # endif243 !244 IF( lk_medusa ) THEN ; CALL trc_nam_medusa ! MEDUSA tracers245 ELSE ; IF(lwp) WRITE(numout,*) ' MEDUSA not used'246 ENDIF247 !248 # if defined key_debug_medusa249 CALL flush(numout)250 IF (lwp) write (numout,*) '------------------------------'251 IF (lwp) write (numout,*) 'Jpalm - debug'252 IF (lwp) write (numout,*) 'CALL trc_nam_medusa -- OK'253 IF (lwp) write (numout,*) 'in trc_nam - just before CALL trc_nam_idtra'254 IF (lwp) write (numout,*) ' '255 # endif256 !257 IF( lk_idtra ) THEN ; CALL trc_nam_idtra ! Idealize tracers258 ELSE ; IF(lwp) WRITE(numout,*) ' Idealize tracers not used'259 ENDIF260 !261 # if defined key_debug_medusa262 CALL flush(numout)263 IF (lwp) write (numout,*) '------------------------------'264 IF (lwp) write (numout,*) 'Jpalm - debug'265 IF (lwp) write (numout,*) 'CALL trc_nam_idtra -- OK'266 IF (lwp) write (numout,*) 'in trc_nam - just before CALL trc_nam_cfc'267 IF (lwp) write (numout,*) ' '268 # endif269 !270 IF( lk_cfc ) THEN ; CALL trc_nam_cfc ! CFC tracers271 ELSE ; IF(lwp) WRITE(numout,*) ' CFC not used'272 ENDIF273 !274 # if defined key_debug_medusa275 CALL flush(numout)276 IF (lwp) write (numout,*) '------------------------------'277 IF (lwp) write (numout,*) 'Jpalm - debug'278 IF (lwp) write (numout,*) 'CALL trc_nam_cfc -- OK'279 IF (lwp) write (numout,*) 'in trc_nam - just before CALL trc_nam_c14'280 IF (lwp) write (numout,*) ' '281 # endif282 !283 IF( lk_c14b ) THEN ; CALL trc_nam_c14b ! C14 bomb tracers284 ELSE ; IF(lwp) WRITE(numout,*) ' C14 not used'285 ENDIF286 !287 # if defined key_debug_medusa288 CALL flush(numout)289 IF (lwp) write (numout,*) '------------------------------'290 IF (lwp) write (numout,*) 'Jpalm - debug'291 IF (lwp) write (numout,*) 'CALL trc_nam_c14 -- OK'292 IF (lwp) write (numout,*) 'in trc_nam - just before CALL trc_nam_age'293 IF (lwp) write (numout,*) ' '294 # endif295 !296 IF( lk_age ) THEN ; CALL trc_nam_age ! AGE tracer297 ELSE ; IF(lwp) WRITE(numout,*) ' AGE not used'298 ENDIF299 !300 # if defined key_debug_medusa301 CALL flush(numout)302 IF (lwp) write (numout,*) '------------------------------'303 IF (lwp) write (numout,*) 'Jpalm - debug'304 IF (lwp) write (numout,*) 'CALL trc_nam_age -- OK'305 IF (lwp) write (numout,*) 'in trc_nam - CALL trc_nam -- OK'306 IF (lwp) write (numout,*) ' '307 # endif308 !309 IF( lk_my_trc ) THEN ; CALL trc_nam_my_trc ! MY_TRC tracers310 ELSE ; IF(lwp) WRITE(numout,*) ' MY_TRC not used'311 ENDIF312 313 IF(lwp) CALL flush(numout)314 END SUBROUTINE trc_nam315 316 SUBROUTINE trc_nam_run317 !!---------------------------------------------------------------------318 !! *** ROUTINE trc_nam ***319 !!320 !! ** Purpose : read options for the passive tracer run (namelist)321 !!322 !!---------------------------------------------------------------------323 NAMELIST/namtrc_run/ nn_dttrc, nn_writetrc, ln_rsttr, nn_rsttr, ln_top_euler, &324 & cn_trcrst_indir, cn_trcrst_outdir, cn_trcrst_in, cn_trcrst_out325 326 327 INTEGER :: ios ! Local integer output status for namelist read328 329 !!---------------------------------------------------------------------330 331 332 IF(lwp) WRITE(numout,*) 'trc_nam : read the passive tracer namelists'333 IF(lwp) WRITE(numout,*) '~~~~~~~'334 335 CALL ctl_opn( numnat_ref, 'namelist_top_ref' , 'OLD' , 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. )336 CALL ctl_opn( numnat_cfg, 'namelist_top_cfg' , 'OLD' , 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. )337 IF(lwm) CALL ctl_opn( numont, 'output.namelist.top', 'UNKNOWN', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE., 1 )338 339 REWIND( numnat_ref ) ! Namelist namtrc in reference namelist : Passive tracer variables340 READ ( numnat_ref, namtrc_run, IOSTAT = ios, ERR = 901)341 901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc in reference namelist', lwp )342 343 REWIND( numnat_cfg ) ! Namelist namtrc in configuration namelist : Passive tracer variables344 READ ( numnat_cfg, namtrc_run, IOSTAT = ios, ERR = 902 )345 902 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc in configuration namelist', lwp )346 IF(lwm) WRITE ( numont, namtrc_run )347 348 ! computes the first time step of tracer model349 nittrc000 = nit000 + nn_dttrc - 1350 351 IF(lwp) THEN ! control print352 WRITE(numout,*)353 WRITE(numout,*) ' Namelist : namtrc_run'354 WRITE(numout,*) ' time step freq. for passive tracer nn_dttrc = ', nn_dttrc355 WRITE(numout,*) ' restart for passive tracer ln_rsttr = ', ln_rsttr356 WRITE(numout,*) ' control of time step for passive tracer nn_rsttr = ', nn_rsttr357 WRITE(numout,*) ' first time step for pass. trac. nittrc000 = ', nittrc000358 WRITE(numout,*) ' frequency of outputs for passive tracers nn_writetrc = ', nn_writetrc359 WRITE(numout,*) ' Use euler integration for TRC (y/n) ln_top_euler = ', ln_top_euler360 WRITE(numout,*) ' '361 CALL flush(numout)362 ENDIF363 !364 END SUBROUTINE trc_nam_run365 366 SUBROUTINE trc_nam_ice367 !!---------------------------------------------------------------------368 !! *** ROUTINE trc_nam_ice ***369 !!370 !! ** Purpose : Read the namelist for the ice effect on tracers371 !!372 !! ** Method : -373 !!374 !!---------------------------------------------------------------------375 ! --- Variable declarations --- !376 INTEGER :: jn ! dummy loop indices377 INTEGER :: ios ! Local integer output status for namelist read378 379 ! --- Namelist declarations --- !380 TYPE(TRC_I_NML), DIMENSION(jptra) :: sn_tri_tracer381 NAMELIST/namtrc_ice/ nn_ice_tr, sn_tri_tracer382 383 IF(lwp) THEN384 WRITE(numout,*)385 WRITE(numout,*) 'trc_nam_ice : Read the namelist for trc_ice'386 WRITE(numout,*) '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'387 ENDIF388 389 IF( nn_timing == 1 ) CALL timing_start('trc_nam_ice')390 391 !392 REWIND( numnat_ref ) ! Namelist namtrc_ice in reference namelist : Passive tracer input data393 READ ( numnat_ref, namtrc_ice, IOSTAT = ios, ERR = 901)394 901 IF( ios /= 0 ) CALL ctl_nam ( ios , ' namtrc_ice in reference namelist ', lwp )395 396 REWIND( numnat_cfg ) ! Namelist namtrc_ice in configuration namelist : Pisces external sources of nutrients397 READ ( numnat_cfg, namtrc_ice, IOSTAT = ios, ERR = 902 )398 902 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc_ice in configuration namelist', lwp )399 400 IF( lwp ) THEN401 WRITE(numout,*) ' '402 WRITE(numout,*) ' Sea ice tracers option (nn_ice_tr) : ', nn_ice_tr403 WRITE(numout,*) ' '404 ENDIF405 406 ! Assign namelist stuff407 DO jn = 1, jptra408 trc_ice_ratio(jn) = sn_tri_tracer(jn)%trc_ratio409 trc_ice_prescr(jn) = sn_tri_tracer(jn)%trc_prescr410 cn_trc_o (jn) = sn_tri_tracer(jn)%ctrc_o411 END DO412 413 IF( nn_timing == 1 ) CALL timing_stop('trc_nam_ice')414 !415 END SUBROUTINE trc_nam_ice416 417 SUBROUTINE trc_nam_trc418 !!---------------------------------------------------------------------419 !! *** ROUTINE trc_nam ***420 !!421 !! ** Purpose : read options for the passive tracer run (namelist)422 !!423 !!---------------------------------------------------------------------424 TYPE(PTRACER), DIMENSION(jptra) :: sn_tracer ! type of tracer for saving if not key_iomput425 !!426 NAMELIST/namtrc/ sn_tracer, ln_trcdta,ln_trcdmp, ln_trcdmp_clo427 428 INTEGER :: ios ! Local integer output status for namelist read429 INTEGER :: jn ! dummy loop indice430 !!---------------------------------------------------------------------431 IF(lwp) WRITE(numout,*)432 IF(lwp) WRITE(numout,*) 'trc_nam : read the passive tracer namelists'433 IF(lwp) WRITE(numout,*) '~~~~~~~'434 435 436 REWIND( numnat_ref ) ! Namelist namtrc in reference namelist : Passive tracer variables437 READ ( numnat_ref, namtrc, IOSTAT = ios, ERR = 901)438 901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc in reference namelist', lwp )439 440 REWIND( numnat_cfg ) ! Namelist namtrc in configuration namelist : Passive tracer variables441 READ ( numnat_cfg, namtrc, IOSTAT = ios, ERR = 902 )442 902 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc in configuration namelist', lwp )443 IF(lwm) WRITE ( numont, namtrc )444 445 DO jn = 1, jptra446 ctrcnm (jn) = TRIM( sn_tracer(jn)%clsname )447 ctrcln (jn) = TRIM( sn_tracer(jn)%cllname )448 ctrcun (jn) = TRIM( sn_tracer(jn)%clunit )449 ln_trc_ini(jn) = sn_tracer(jn)%llinit450 ln_trc_wri(jn) = sn_tracer(jn)%llsave451 END DO452 IF(lwp) CALL flush(numout)453 454 END SUBROUTINE trc_nam_trc455 456 457 SUBROUTINE trc_nam_dia458 !!---------------------------------------------------------------------459 !! *** ROUTINE trc_nam_dia ***460 !!461 !! ** Purpose : read options for the passive tracer diagnostics462 !!463 !! ** Method : - read passive tracer namelist464 !! - read namelist of each defined SMS model465 !! ( (PISCES, CFC, MY_TRC )466 !!---------------------------------------------------------------------467 INTEGER :: ierr468 #if defined key_trdmxl_trc || defined key_trdtrc469 NAMELIST/namtrc_trd/ nn_trd_trc, nn_ctls_trc, rn_ucf_trc, &470 & ln_trdmxl_trc_restart, ln_trdmxl_trc_instant, &471 & cn_trdrst_trc_in, cn_trdrst_trc_out, ln_trdtrc472 #endif473 NAMELIST/namtrc_dia/ ln_diatrc, ln_diabio, nn_writedia, nn_writebio474 475 INTEGER :: ios ! Local integer output status for namelist read476 !!---------------------------------------------------------------------477 478 IF(lwp) WRITE(numout,*)479 IF(lwp) WRITE(numout,*) 'trc_nam_dia : read the passive tracer diagnostics options'480 IF(lwp) WRITE(numout,*) '~~~~~~~'481 482 IF(lwp) WRITE(numout,*)483 IF(lwp) WRITE(numout,*) 'trc_nam_dia : read the passive tracer diagnostics options'484 IF(lwp) WRITE(numout,*) '~~~~~~~'485 486 REWIND( numnat_ref ) ! Namelist namtrc_dia in reference namelist : Passive tracer diagnostics487 READ ( numnat_ref, namtrc_dia, IOSTAT = ios, ERR = 903)488 903 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc_dia in reference namelist', lwp )489 490 REWIND( numnat_cfg ) ! Namelist namtrc_dia in configuration namelist : Passive tracer diagnostics491 READ ( numnat_cfg, namtrc_dia, IOSTAT = ios, ERR = 904 )492 904 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc_dia in configuration namelist', lwp )493 IF(lwm) WRITE ( numont, namtrc_dia )494 495 IF(lwp) THEN496 WRITE(numout,*)497 WRITE(numout,*)498 WRITE(numout,*) ' Namelist : namtrc_dia'499 WRITE(numout,*) ' save additionnal diagnostics arrays ln_diatrc = ', ln_diatrc500 WRITE(numout,*) ' save additionnal biology diagnostics arrays ln_diabio = ', ln_diabio501 WRITE(numout,*) ' frequency of outputs for additional arrays nn_writedia = ', nn_writedia502 WRITE(numout,*) ' frequency of outputs for biological trends nn_writebio = ', nn_writebio503 WRITE(numout,*) ' '504 CALL flush(numout)505 ENDIF506 !!507 !! JPALM -- 17-07-2015 --508 !! MEDUSA is not yet up-to-date with the iom server.509 !! we use it for the main tracer, but not fully with diagnostics.510 !! will have to adapt it properly when visiting Christian Ethee511 !! for now, we change512 !! IF( ln_diatrc .AND. .NOT. lk_iomput ) THEN513 !! to :514 !!515 IF( ( ln_diatrc .AND. .NOT. lk_iomput ) .OR. ( ln_diatrc .AND. lk_medusa ) ) THEN516 ALLOCATE( trc2d(jpi,jpj,jpdia2d), trc3d(jpi,jpj,jpk,jpdia3d), &517 & ctrc2d(jpdia2d), ctrc2l(jpdia2d), ctrc2u(jpdia2d) , &518 & ctrc3d(jpdia3d), ctrc3l(jpdia3d), ctrc3u(jpdia3d) , STAT = ierr )519 IF( ierr > 0 ) CALL ctl_stop( 'STOP', 'trcnam: unable to allocate add. diag. array' )520 !521 trc2d(:,:,: ) = 0._wp ; ctrc2d(:) = ' ' ; ctrc2l(:) = ' ' ; ctrc2u(:) = ' '522 trc3d(:,:,:,:) = 0._wp ; ctrc3d(:) = ' ' ; ctrc3l(:) = ' ' ; ctrc3u(:) = ' '523 !524 !! ELSE IF ( lk_iomput .AND. lk_medusa .AND. .NOT. ln_diatrc) THEN525 !! CALL trc_nam_iom_medusa526 ENDIF527 528 IF( ( ln_diabio .AND. .NOT. lk_iomput ) .OR. l_trdtrc ) THEN529 ALLOCATE( trbio (jpi,jpj,jpk,jpdiabio) , &530 & ctrbio(jpdiabio), ctrbil(jpdiabio), ctrbiu(jpdiabio), STAT = ierr )531 IF( ierr > 0 ) CALL ctl_stop( 'STOP', 'trcnam: unable to allocate bio. diag. array' )532 !533 trbio(:,:,:,:) = 0._wp ; ctrbio(:) = ' ' ; ctrbil(:) = ' ' ; ctrbiu(:) = ' '534 !535 ENDIF536 385 ! 537 386 END SUBROUTINE trc_nam_dia … … 550 399 !!---------------------------------------------------------------------- 551 400 !! NEMO/TOP 3.3 , NEMO Consortium (2010) 552 !! $Id $401 !! $Id: trcnam.F90 7873 2017-04-05 09:24:00Z cetlod $ 553 402 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 554 403 !!======================================================================
Note: See TracChangeset
for help on using the changeset viewer.