[2038] | 1 | MODULE trcnam |
---|
| 2 | !!====================================================================== |
---|
| 3 | !! *** MODULE trcnam *** |
---|
| 4 | !! TOP : Read and print options for the passive tracer run (namelist) |
---|
| 5 | !!====================================================================== |
---|
| 6 | !! History : - ! 1996-11 (M.A. Foujols, M. Levy) original code |
---|
| 7 | !! - ! 1998-04 (M.A Foujols, L. Bopp) ahtrb0 for isopycnal mixing |
---|
| 8 | !! - ! 1999-10 (M.A. Foujols, M. Levy) separation of sms |
---|
| 9 | !! - ! 2000-07 (A. Estublier) add TVD and MUSCL : Tests on ndttrc |
---|
| 10 | !! - ! 2000-11 (M.A Foujols, E Kestenare) trcrat, ahtrc0 and aeivtr0 |
---|
| 11 | !! - ! 2001-01 (E Kestenare) suppress ndttrc=1 for CEN2 and TVD schemes |
---|
| 12 | !! 1.0 ! 2005-03 (O. Aumont, A. El Moussaoui) F90 |
---|
[8280] | 13 | !! - ! 2014-06 (A. Yool, J. Palmieri) adding MEDUSA-2 |
---|
[2038] | 14 | !!---------------------------------------------------------------------- |
---|
| 15 | #if defined key_top |
---|
| 16 | !!---------------------------------------------------------------------- |
---|
| 17 | !! 'key_top' TOP models |
---|
| 18 | !!---------------------------------------------------------------------- |
---|
| 19 | !! trc_nam : Read and print options for the passive tracer run (namelist) |
---|
| 20 | !!---------------------------------------------------------------------- |
---|
[3294] | 21 | USE oce_trc ! shared variables between ocean and passive tracers |
---|
| 22 | USE trc ! passive tracers common variables |
---|
[2038] | 23 | USE trcnam_trp ! Transport namelist |
---|
| 24 | USE trcnam_pisces ! PISCES namelist |
---|
| 25 | USE trcnam_cfc ! CFC SMS namelist |
---|
| 26 | USE trcnam_c14b ! C14 SMS namelist |
---|
[8442] | 27 | USE trcnam_age ! AGE SMS namelist |
---|
[2038] | 28 | USE trcnam_my_trc ! MY_TRC SMS namelist |
---|
[8442] | 29 | USE trcnam_idtra ! Idealise tracer namelist |
---|
[8280] | 30 | USE trcnam_medusa ! MEDUSA namelist |
---|
[4990] | 31 | USE trd_oce |
---|
| 32 | USE trdtrc_oce |
---|
[3294] | 33 | USE iom ! I/O manager |
---|
[2038] | 34 | |
---|
| 35 | IMPLICIT NONE |
---|
| 36 | PRIVATE |
---|
| 37 | |
---|
[4152] | 38 | PUBLIC trc_nam_run ! called in trcini |
---|
[2038] | 39 | PUBLIC trc_nam ! called in trcini |
---|
| 40 | |
---|
| 41 | !! * Substitutions |
---|
| 42 | # include "top_substitute.h90" |
---|
| 43 | !!---------------------------------------------------------------------- |
---|
[2287] | 44 | !! NEMO/TOP 3.3 , NEMO Consortium (2010) |
---|
[5341] | 45 | !! $Id$ |
---|
[2287] | 46 | !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) |
---|
[2038] | 47 | !!---------------------------------------------------------------------- |
---|
| 48 | |
---|
| 49 | CONTAINS |
---|
| 50 | |
---|
[4152] | 51 | |
---|
[2038] | 52 | SUBROUTINE trc_nam |
---|
| 53 | !!--------------------------------------------------------------------- |
---|
| 54 | !! *** ROUTINE trc_nam *** |
---|
| 55 | !! |
---|
| 56 | !! ** Purpose : READ and PRINT options for the passive tracer run (namelist) |
---|
| 57 | !! |
---|
| 58 | !! ** Method : - read passive tracer namelist |
---|
| 59 | !! - read namelist of each defined SMS model |
---|
[8280] | 60 | !! ( (PISCES, CFC, MY_TRC, MEDUSA, IDTRA, Age ) |
---|
[2038] | 61 | !!--------------------------------------------------------------------- |
---|
[9163] | 62 | INTEGER :: ierr |
---|
| 63 | #if defined key_trdmxl_trc || defined key_trdtrc |
---|
| 64 | NAMELIST/namtrc_trd/ nn_trd_trc, nn_ctls_trc, rn_ucf_trc, & |
---|
| 65 | & ln_trdmxl_trc_restart, ln_trdmxl_trc_instant, & |
---|
| 66 | & cn_trdrst_trc_in, cn_trdrst_trc_out, ln_trdtrc |
---|
| 67 | #endif |
---|
| 68 | |
---|
| 69 | INTEGER :: jn, jk ! dummy loop indice |
---|
| 70 | INTEGER :: ios ! Local integer output status for namelist read |
---|
| 71 | !!--------------------------------------------------------------------- |
---|
| 72 | |
---|
| 73 | |
---|
[4152] | 74 | ! ! Parameters of the run |
---|
| 75 | IF( .NOT. lk_offline ) CALL trc_nam_run |
---|
| 76 | |
---|
| 77 | ! ! passive tracer informations |
---|
| 78 | CALL trc_nam_trc |
---|
| 79 | |
---|
| 80 | ! ! Parameters of additional diagnostics |
---|
[9163] | 81 | IF( .NOT. lk_iomput ) CALL trc_nam_dia |
---|
[2038] | 82 | |
---|
[4152] | 83 | ! ! namelist of transport |
---|
| 84 | CALL trc_nam_trp |
---|
[2038] | 85 | |
---|
| 86 | |
---|
[4152] | 87 | IF( ln_rsttr ) ln_trcdta = .FALSE. ! restart : no need of clim data |
---|
| 88 | ! |
---|
| 89 | IF( ln_trcdmp .OR. ln_trcdmp_clo ) ln_trcdta = .TRUE. ! damping : need to have clim data |
---|
| 90 | ! |
---|
| 91 | IF( .NOT.ln_trcdta ) THEN |
---|
| 92 | ln_trc_ini(:) = .FALSE. |
---|
| 93 | ENDIF |
---|
[2038] | 94 | |
---|
[4152] | 95 | IF(lwp) THEN ! control print |
---|
[2038] | 96 | WRITE(numout,*) |
---|
| 97 | WRITE(numout,*) ' Namelist : namtrc' |
---|
[3319] | 98 | WRITE(numout,*) ' Read inputs data from file (y/n) ln_trcdta = ', ln_trcdta |
---|
| 99 | WRITE(numout,*) ' Damping of passive tracer (y/n) ln_trcdmp = ', ln_trcdmp |
---|
[4148] | 100 | WRITE(numout,*) ' Restoring of tracer on closed seas ln_trcdmp_clo = ', ln_trcdmp_clo |
---|
[2038] | 101 | WRITE(numout,*) ' ' |
---|
| 102 | DO jn = 1, jptra |
---|
[3294] | 103 | WRITE(numout,*) ' tracer nb : ', jn, ' short name : ', ctrcnm(jn) |
---|
[2038] | 104 | END DO |
---|
[3294] | 105 | WRITE(numout,*) ' ' |
---|
[2038] | 106 | ENDIF |
---|
| 107 | |
---|
[3294] | 108 | IF(lwp) THEN ! control print |
---|
| 109 | IF( ln_rsttr ) THEN |
---|
| 110 | WRITE(numout,*) |
---|
[4148] | 111 | WRITE(numout,*) ' Read a restart file for passive tracer : ', TRIM( cn_trcrst_in ) |
---|
[3294] | 112 | WRITE(numout,*) |
---|
| 113 | ENDIF |
---|
[4148] | 114 | IF( ln_trcdta .AND. .NOT.ln_rsttr ) THEN |
---|
| 115 | WRITE(numout,*) |
---|
| 116 | WRITE(numout,*) ' Some of the passive tracers are initialised from climatologies ' |
---|
| 117 | WRITE(numout,*) |
---|
| 118 | ENDIF |
---|
| 119 | IF( .NOT.ln_trcdta ) THEN |
---|
| 120 | WRITE(numout,*) |
---|
| 121 | WRITE(numout,*) ' All the passive tracers are initialised with constant values ' |
---|
| 122 | WRITE(numout,*) |
---|
| 123 | ENDIF |
---|
[3294] | 124 | ENDIF |
---|
| 125 | |
---|
[8280] | 126 | # if defined key_debug_medusa |
---|
| 127 | DO jk = 1, jpk |
---|
| 128 | WRITE(numout,*) ' level number: ', jk, 'rdttrc: ',rdttrc(jk),'rdttra: ', rdttra(jk),'nn_dttrc: ', nn_dttrc |
---|
| 129 | END DO |
---|
| 130 | CALL flush(numout) |
---|
| 131 | # endif |
---|
[4152] | 132 | |
---|
| 133 | rdttrc(:) = rdttra(:) * FLOAT( nn_dttrc ) ! vertical profile of passive tracer time-step |
---|
| 134 | |
---|
| 135 | IF(lwp) THEN ! control print |
---|
| 136 | WRITE(numout,*) |
---|
| 137 | WRITE(numout,*) ' Passive Tracer time step rdttrc = ', rdttrc(1) |
---|
| 138 | WRITE(numout,*) |
---|
| 139 | ENDIF |
---|
[3294] | 140 | |
---|
[4152] | 141 | |
---|
[4990] | 142 | #if defined key_trdmxl_trc || defined key_trdtrc |
---|
[3294] | 143 | |
---|
[4147] | 144 | REWIND( numnat_ref ) ! Namelist namtrc_trd in reference namelist : Passive tracer trends |
---|
| 145 | READ ( numnat_ref, namtrc_trd, IOSTAT = ios, ERR = 905) |
---|
| 146 | 905 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc_trd in reference namelist', lwp ) |
---|
[3294] | 147 | |
---|
[4147] | 148 | REWIND( numnat_cfg ) ! Namelist namtrc_trd in configuration namelist : Passive tracer trends |
---|
| 149 | READ ( numnat_cfg, namtrc_trd, IOSTAT = ios, ERR = 906 ) |
---|
| 150 | 906 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc_trd in configuration namelist', lwp ) |
---|
[4624] | 151 | IF(lwm) WRITE ( numont, namtrc_trd ) |
---|
[4147] | 152 | |
---|
[3294] | 153 | IF(lwp) THEN |
---|
| 154 | WRITE(numout,*) |
---|
[4990] | 155 | WRITE(numout,*) ' trd_mxl_trc_init : read namelist namtrc_trd ' |
---|
[3294] | 156 | WRITE(numout,*) ' ~~~~~~~~~~~~~~~~ ' |
---|
| 157 | WRITE(numout,*) ' * frequency of trends diagnostics nn_trd_trc = ', nn_trd_trc |
---|
| 158 | WRITE(numout,*) ' * control surface type nn_ctls_trc = ', nn_ctls_trc |
---|
[4990] | 159 | WRITE(numout,*) ' * restart for ML diagnostics ln_trdmxl_trc_restart = ', ln_trdmxl_trc_restart |
---|
[3294] | 160 | WRITE(numout,*) ' * flag to diagnose trends of ' |
---|
[4990] | 161 | WRITE(numout,*) ' instantantaneous or mean ML T/S ln_trdmxl_trc_instant = ', ln_trdmxl_trc_instant |
---|
[3294] | 162 | WRITE(numout,*) ' * unit conversion factor rn_ucf_trc = ', rn_ucf_trc |
---|
| 163 | DO jn = 1, jptra |
---|
| 164 | IF( ln_trdtrc(jn) ) WRITE(numout,*) ' compute ML trends for tracer number :', jn |
---|
| 165 | END DO |
---|
| 166 | ENDIF |
---|
| 167 | #endif |
---|
| 168 | |
---|
| 169 | |
---|
[5385] | 170 | ! Call the ice module for tracers |
---|
| 171 | ! ------------------------------- |
---|
| 172 | CALL trc_nam_ice |
---|
| 173 | |
---|
[2038] | 174 | ! namelist of SMS |
---|
| 175 | ! --------------- |
---|
| 176 | IF( lk_pisces ) THEN ; CALL trc_nam_pisces ! PISCES bio-model |
---|
| 177 | ELSE ; IF(lwp) WRITE(numout,*) ' PISCES not used' |
---|
| 178 | ENDIF |
---|
[8442] | 179 | |
---|
[2038] | 180 | IF( lk_cfc ) THEN ; CALL trc_nam_cfc ! CFC tracers |
---|
| 181 | ELSE ; IF(lwp) WRITE(numout,*) ' CFC not used' |
---|
| 182 | ENDIF |
---|
[8442] | 183 | |
---|
[9163] | 184 | IF( lk_c14b ) THEN ; CALL trc_nam_c14b ! C14 bomb tracers |
---|
| 185 | ELSE ; IF(lwp) WRITE(numout,*) ' C14 not used' |
---|
[2038] | 186 | ENDIF |
---|
[8442] | 187 | |
---|
[8280] | 188 | IF( lk_age ) THEN ; CALL trc_nam_age ! AGE tracer |
---|
| 189 | ELSE ; IF(lwp) WRITE(numout,*) ' AGE not used' |
---|
| 190 | ENDIF |
---|
[8442] | 191 | |
---|
[7203] | 192 | IF( lk_my_trc ) THEN ; CALL trc_nam_my_trc ! MY_TRC tracers |
---|
| 193 | ELSE ; IF(lwp) WRITE(numout,*) ' MY_TRC not used' |
---|
[2038] | 194 | ENDIF |
---|
[8442] | 195 | |
---|
| 196 | IF( lk_idtra ) THEN ; CALL trc_nam_idtra ! Idealize tracers |
---|
| 197 | ELSE ; IF(lwp) WRITE(numout,*) ' Idealize tracers not used' |
---|
| 198 | ENDIF |
---|
| 199 | |
---|
| 200 | IF( lk_medusa ) THEN ; CALL trc_nam_medusa ! MEDUSA tracers |
---|
| 201 | ELSE ; IF(lwp) WRITE(numout,*) ' MEDUSA not used' |
---|
| 202 | ENDIF |
---|
| 203 | ! |
---|
[2038] | 204 | END SUBROUTINE trc_nam |
---|
| 205 | |
---|
[4152] | 206 | SUBROUTINE trc_nam_run |
---|
| 207 | !!--------------------------------------------------------------------- |
---|
| 208 | !! *** ROUTINE trc_nam *** |
---|
| 209 | !! |
---|
| 210 | !! ** Purpose : read options for the passive tracer run (namelist) |
---|
| 211 | !! |
---|
| 212 | !!--------------------------------------------------------------------- |
---|
| 213 | NAMELIST/namtrc_run/ nn_dttrc, nn_writetrc, ln_rsttr, nn_rsttr, ln_top_euler, & |
---|
[5341] | 214 | & cn_trcrst_indir, cn_trcrst_outdir, cn_trcrst_in, cn_trcrst_out |
---|
[4152] | 215 | |
---|
[5341] | 216 | |
---|
[4154] | 217 | INTEGER :: ios ! Local integer output status for namelist read |
---|
| 218 | |
---|
[4152] | 219 | !!--------------------------------------------------------------------- |
---|
| 220 | |
---|
| 221 | |
---|
| 222 | IF(lwp) WRITE(numout,*) 'trc_nam : read the passive tracer namelists' |
---|
| 223 | IF(lwp) WRITE(numout,*) '~~~~~~~' |
---|
| 224 | |
---|
[4290] | 225 | CALL ctl_opn( numnat_ref, 'namelist_top_ref' , 'OLD' , 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. ) |
---|
| 226 | CALL ctl_opn( numnat_cfg, 'namelist_top_cfg' , 'OLD' , 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. ) |
---|
[4624] | 227 | IF(lwm) CALL ctl_opn( numont, 'output.namelist.top', 'UNKNOWN', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE., 1 ) |
---|
[4152] | 228 | |
---|
| 229 | REWIND( numnat_ref ) ! Namelist namtrc in reference namelist : Passive tracer variables |
---|
| 230 | READ ( numnat_ref, namtrc_run, IOSTAT = ios, ERR = 901) |
---|
| 231 | 901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc in reference namelist', lwp ) |
---|
| 232 | |
---|
| 233 | REWIND( numnat_cfg ) ! Namelist namtrc in configuration namelist : Passive tracer variables |
---|
| 234 | READ ( numnat_cfg, namtrc_run, IOSTAT = ios, ERR = 902 ) |
---|
| 235 | 902 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc in configuration namelist', lwp ) |
---|
[4624] | 236 | IF(lwm) WRITE ( numont, namtrc_run ) |
---|
[4152] | 237 | |
---|
| 238 | ! computes the first time step of tracer model |
---|
| 239 | nittrc000 = nit000 + nn_dttrc - 1 |
---|
| 240 | |
---|
| 241 | IF(lwp) THEN ! control print |
---|
| 242 | WRITE(numout,*) |
---|
[4159] | 243 | WRITE(numout,*) ' Namelist : namtrc_run' |
---|
[4152] | 244 | WRITE(numout,*) ' time step freq. for passive tracer nn_dttrc = ', nn_dttrc |
---|
| 245 | WRITE(numout,*) ' restart for passive tracer ln_rsttr = ', ln_rsttr |
---|
| 246 | WRITE(numout,*) ' control of time step for passive tracer nn_rsttr = ', nn_rsttr |
---|
| 247 | WRITE(numout,*) ' first time step for pass. trac. nittrc000 = ', nittrc000 |
---|
[4159] | 248 | WRITE(numout,*) ' frequency of outputs for passive tracers nn_writetrc = ', nn_writetrc |
---|
| 249 | WRITE(numout,*) ' Use euler integration for TRC (y/n) ln_top_euler = ', ln_top_euler |
---|
[4152] | 250 | WRITE(numout,*) ' ' |
---|
[8280] | 251 | CALL flush(numout) |
---|
[4152] | 252 | ENDIF |
---|
| 253 | ! |
---|
| 254 | END SUBROUTINE trc_nam_run |
---|
| 255 | |
---|
[5385] | 256 | SUBROUTINE trc_nam_ice |
---|
| 257 | !!--------------------------------------------------------------------- |
---|
| 258 | !! *** ROUTINE trc_nam_ice *** |
---|
| 259 | !! |
---|
| 260 | !! ** Purpose : Read the namelist for the ice effect on tracers |
---|
| 261 | !! |
---|
| 262 | !! ** Method : - |
---|
| 263 | !! |
---|
| 264 | !!--------------------------------------------------------------------- |
---|
| 265 | ! --- Variable declarations --- ! |
---|
| 266 | INTEGER :: jn ! dummy loop indices |
---|
| 267 | INTEGER :: ios ! Local integer output status for namelist read |
---|
[4152] | 268 | |
---|
[5385] | 269 | ! --- Namelist declarations --- ! |
---|
| 270 | TYPE(TRC_I_NML), DIMENSION(jptra) :: sn_tri_tracer |
---|
| 271 | NAMELIST/namtrc_ice/ nn_ice_tr, sn_tri_tracer |
---|
| 272 | |
---|
| 273 | IF(lwp) THEN |
---|
| 274 | WRITE(numout,*) |
---|
| 275 | WRITE(numout,*) 'trc_nam_ice : Read the namelist for trc_ice' |
---|
| 276 | WRITE(numout,*) '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~' |
---|
| 277 | ENDIF |
---|
| 278 | |
---|
| 279 | IF( nn_timing == 1 ) CALL timing_start('trc_nam_ice') |
---|
| 280 | |
---|
| 281 | ! |
---|
| 282 | REWIND( numnat_ref ) ! Namelist namtrc_ice in reference namelist : Passive tracer input data |
---|
| 283 | READ ( numnat_ref, namtrc_ice, IOSTAT = ios, ERR = 901) |
---|
| 284 | 901 IF( ios /= 0 ) CALL ctl_nam ( ios , ' namtrc_ice in reference namelist ', lwp ) |
---|
| 285 | |
---|
| 286 | REWIND( numnat_cfg ) ! Namelist namtrc_ice in configuration namelist : Pisces external sources of nutrients |
---|
| 287 | READ ( numnat_cfg, namtrc_ice, IOSTAT = ios, ERR = 902 ) |
---|
| 288 | 902 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc_ice in configuration namelist', lwp ) |
---|
| 289 | |
---|
[5411] | 290 | IF( lwp ) THEN |
---|
| 291 | WRITE(numout,*) ' ' |
---|
| 292 | WRITE(numout,*) ' Sea ice tracers option (nn_ice_tr) : ', nn_ice_tr |
---|
| 293 | WRITE(numout,*) ' ' |
---|
| 294 | ENDIF |
---|
[5385] | 295 | |
---|
| 296 | ! Assign namelist stuff |
---|
| 297 | DO jn = 1, jptra |
---|
| 298 | trc_ice_ratio(jn) = sn_tri_tracer(jn)%trc_ratio |
---|
| 299 | trc_ice_prescr(jn) = sn_tri_tracer(jn)%trc_prescr |
---|
| 300 | cn_trc_o (jn) = sn_tri_tracer(jn)%ctrc_o |
---|
| 301 | END DO |
---|
| 302 | |
---|
| 303 | IF( nn_timing == 1 ) CALL timing_stop('trc_nam_ice') |
---|
| 304 | ! |
---|
| 305 | END SUBROUTINE trc_nam_ice |
---|
| 306 | |
---|
[4152] | 307 | SUBROUTINE trc_nam_trc |
---|
| 308 | !!--------------------------------------------------------------------- |
---|
| 309 | !! *** ROUTINE trc_nam *** |
---|
| 310 | !! |
---|
| 311 | !! ** Purpose : read options for the passive tracer run (namelist) |
---|
| 312 | !! |
---|
| 313 | !!--------------------------------------------------------------------- |
---|
| 314 | TYPE(PTRACER), DIMENSION(jptra) :: sn_tracer ! type of tracer for saving if not key_iomput |
---|
| 315 | !! |
---|
| 316 | NAMELIST/namtrc/ sn_tracer, ln_trcdta,ln_trcdmp, ln_trcdmp_clo |
---|
[4154] | 317 | |
---|
| 318 | INTEGER :: ios ! Local integer output status for namelist read |
---|
| 319 | INTEGER :: jn ! dummy loop indice |
---|
[4152] | 320 | !!--------------------------------------------------------------------- |
---|
| 321 | IF(lwp) WRITE(numout,*) |
---|
| 322 | IF(lwp) WRITE(numout,*) 'trc_nam : read the passive tracer namelists' |
---|
| 323 | IF(lwp) WRITE(numout,*) '~~~~~~~' |
---|
| 324 | |
---|
| 325 | |
---|
| 326 | REWIND( numnat_ref ) ! Namelist namtrc in reference namelist : Passive tracer variables |
---|
| 327 | READ ( numnat_ref, namtrc, IOSTAT = ios, ERR = 901) |
---|
| 328 | 901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc in reference namelist', lwp ) |
---|
| 329 | |
---|
| 330 | REWIND( numnat_cfg ) ! Namelist namtrc in configuration namelist : Passive tracer variables |
---|
| 331 | READ ( numnat_cfg, namtrc, IOSTAT = ios, ERR = 902 ) |
---|
| 332 | 902 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc in configuration namelist', lwp ) |
---|
[4624] | 333 | IF(lwm) WRITE ( numont, namtrc ) |
---|
[4152] | 334 | |
---|
| 335 | DO jn = 1, jptra |
---|
| 336 | ctrcnm (jn) = TRIM( sn_tracer(jn)%clsname ) |
---|
| 337 | ctrcln (jn) = TRIM( sn_tracer(jn)%cllname ) |
---|
| 338 | ctrcun (jn) = TRIM( sn_tracer(jn)%clunit ) |
---|
| 339 | ln_trc_ini(jn) = sn_tracer(jn)%llinit |
---|
| 340 | ln_trc_wri(jn) = sn_tracer(jn)%llsave |
---|
| 341 | END DO |
---|
[8442] | 342 | |
---|
[4152] | 343 | END SUBROUTINE trc_nam_trc |
---|
| 344 | |
---|
| 345 | |
---|
| 346 | SUBROUTINE trc_nam_dia |
---|
| 347 | !!--------------------------------------------------------------------- |
---|
| 348 | !! *** ROUTINE trc_nam_dia *** |
---|
| 349 | !! |
---|
| 350 | !! ** Purpose : read options for the passive tracer diagnostics |
---|
| 351 | !! |
---|
| 352 | !! ** Method : - read passive tracer namelist |
---|
| 353 | !! - read namelist of each defined SMS model |
---|
| 354 | !! ( (PISCES, CFC, MY_TRC ) |
---|
| 355 | !!--------------------------------------------------------------------- |
---|
| 356 | INTEGER :: ierr |
---|
[4990] | 357 | #if defined key_trdmxl_trc || defined key_trdtrc |
---|
[4152] | 358 | NAMELIST/namtrc_trd/ nn_trd_trc, nn_ctls_trc, rn_ucf_trc, & |
---|
[4990] | 359 | & ln_trdmxl_trc_restart, ln_trdmxl_trc_instant, & |
---|
[4152] | 360 | & cn_trdrst_trc_in, cn_trdrst_trc_out, ln_trdtrc |
---|
| 361 | #endif |
---|
| 362 | NAMELIST/namtrc_dia/ ln_diatrc, ln_diabio, nn_writedia, nn_writebio |
---|
| 363 | |
---|
[4154] | 364 | INTEGER :: ios ! Local integer output status for namelist read |
---|
[4152] | 365 | !!--------------------------------------------------------------------- |
---|
| 366 | |
---|
| 367 | IF(lwp) WRITE(numout,*) |
---|
| 368 | IF(lwp) WRITE(numout,*) 'trc_nam_dia : read the passive tracer diagnostics options' |
---|
| 369 | IF(lwp) WRITE(numout,*) '~~~~~~~' |
---|
| 370 | |
---|
| 371 | IF(lwp) WRITE(numout,*) |
---|
| 372 | IF(lwp) WRITE(numout,*) 'trc_nam_dia : read the passive tracer diagnostics options' |
---|
| 373 | IF(lwp) WRITE(numout,*) '~~~~~~~' |
---|
| 374 | |
---|
| 375 | REWIND( numnat_ref ) ! Namelist namtrc_dia in reference namelist : Passive tracer diagnostics |
---|
| 376 | READ ( numnat_ref, namtrc_dia, IOSTAT = ios, ERR = 903) |
---|
| 377 | 903 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc_dia in reference namelist', lwp ) |
---|
| 378 | |
---|
| 379 | REWIND( numnat_cfg ) ! Namelist namtrc_dia in configuration namelist : Passive tracer diagnostics |
---|
| 380 | READ ( numnat_cfg, namtrc_dia, IOSTAT = ios, ERR = 904 ) |
---|
| 381 | 904 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc_dia in configuration namelist', lwp ) |
---|
[4624] | 382 | IF(lwm) WRITE ( numont, namtrc_dia ) |
---|
[4152] | 383 | |
---|
| 384 | IF(lwp) THEN |
---|
| 385 | WRITE(numout,*) |
---|
| 386 | WRITE(numout,*) |
---|
| 387 | WRITE(numout,*) ' Namelist : namtrc_dia' |
---|
| 388 | WRITE(numout,*) ' save additionnal diagnostics arrays ln_diatrc = ', ln_diatrc |
---|
| 389 | WRITE(numout,*) ' save additionnal biology diagnostics arrays ln_diabio = ', ln_diabio |
---|
| 390 | WRITE(numout,*) ' frequency of outputs for additional arrays nn_writedia = ', nn_writedia |
---|
| 391 | WRITE(numout,*) ' frequency of outputs for biological trends nn_writebio = ', nn_writebio |
---|
| 392 | WRITE(numout,*) ' ' |
---|
[8280] | 393 | CALL flush(numout) |
---|
[4152] | 394 | ENDIF |
---|
[8442] | 395 | |
---|
[8280] | 396 | IF( ( ln_diatrc .AND. .NOT. lk_iomput ) .OR. ( ln_diatrc .AND. lk_medusa ) ) THEN |
---|
[4152] | 397 | ALLOCATE( trc2d(jpi,jpj,jpdia2d), trc3d(jpi,jpj,jpk,jpdia3d), & |
---|
| 398 | & ctrc2d(jpdia2d), ctrc2l(jpdia2d), ctrc2u(jpdia2d) , & |
---|
| 399 | & ctrc3d(jpdia3d), ctrc3l(jpdia3d), ctrc3u(jpdia3d) , STAT = ierr ) |
---|
| 400 | IF( ierr > 0 ) CALL ctl_stop( 'STOP', 'trcnam: unable to allocate add. diag. array' ) |
---|
| 401 | ! |
---|
| 402 | trc2d(:,:,: ) = 0._wp ; ctrc2d(:) = ' ' ; ctrc2l(:) = ' ' ; ctrc2u(:) = ' ' |
---|
| 403 | trc3d(:,:,:,:) = 0._wp ; ctrc3d(:) = ' ' ; ctrc3l(:) = ' ' ; ctrc3u(:) = ' ' |
---|
| 404 | ! |
---|
| 405 | ENDIF |
---|
| 406 | |
---|
| 407 | IF( ( ln_diabio .AND. .NOT. lk_iomput ) .OR. l_trdtrc ) THEN |
---|
| 408 | ALLOCATE( trbio (jpi,jpj,jpk,jpdiabio) , & |
---|
| 409 | & ctrbio(jpdiabio), ctrbil(jpdiabio), ctrbiu(jpdiabio), STAT = ierr ) |
---|
| 410 | IF( ierr > 0 ) CALL ctl_stop( 'STOP', 'trcnam: unable to allocate bio. diag. array' ) |
---|
| 411 | ! |
---|
| 412 | trbio(:,:,:,:) = 0._wp ; ctrbio(:) = ' ' ; ctrbil(:) = ' ' ; ctrbiu(:) = ' ' |
---|
| 413 | ! |
---|
| 414 | ENDIF |
---|
| 415 | ! |
---|
| 416 | END SUBROUTINE trc_nam_dia |
---|
| 417 | |
---|
[2038] | 418 | #else |
---|
| 419 | !!---------------------------------------------------------------------- |
---|
| 420 | !! Dummy module : No passive tracer |
---|
| 421 | !!---------------------------------------------------------------------- |
---|
| 422 | CONTAINS |
---|
| 423 | SUBROUTINE trc_nam ! Empty routine |
---|
| 424 | END SUBROUTINE trc_nam |
---|
[4152] | 425 | SUBROUTINE trc_nam_run ! Empty routine |
---|
| 426 | END SUBROUTINE trc_nam_run |
---|
[2038] | 427 | #endif |
---|
| 428 | |
---|
[2104] | 429 | !!---------------------------------------------------------------------- |
---|
[2287] | 430 | !! NEMO/TOP 3.3 , NEMO Consortium (2010) |
---|
[5341] | 431 | !! $Id$ |
---|
[2287] | 432 | !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) |
---|
[2038] | 433 | !!====================================================================== |
---|
[6487] | 434 | END MODULE trcnam |
---|