| 278 | Christian's comments |
| 279 | |
| 280 | The NEMO architecture ( with the use of FCM to build dependancies ), allow to rewrite a routine without needing to change anything. In that case, we can use the MY_TRC framework to manage every type of biogeochemical model. |
| 281 | |
| 282 | In fact, when compiling with makenemo ( for example : ./makenemo -n ORCA2_LIM_MY_TRC -r ORCA2_LIM_PISCES del_key "key_iomput key_pisces" add_key "key_my_trc"), a sub-directory where we can copy and modify all the routines we need is created : NEMOGCM/CONFIG/ORCA2_LIM_MY_TRC/MY_SRC |
| 283 | |
| 284 | * trcini.F90 |
| 285 | * trcstp.F90 |
| 286 | * trcdia.F90 |
| 287 | * trctrp.F90 |
| 288 | * MY_TRC/* |
| 289 | |
| 290 | To go a little further we can add a new namelits parameter ln_nemo_io which is true if we want to use NEMO I/O manager and false if not. So we can modify the 2 modules trcini.F90 and trcstp.F90 as follow : |
| 291 | |
| 292 | trcini.F90 |
| 293 | {{ |
| 294 | IF( lk_lobster ) THEN ; CALL trc_ini_lobster ! LOBSTER bio-model |
| 295 | ELSE ; IF(lwp) WRITE(numout,*) ' LOBSTER not used' |
| 296 | ENDIF |
| 297 | |
| 298 | IF( lk_pisces ) THEN ; CALL trc_ini_pisces ! PISCES bio-model |
| 299 | ELSE ; IF(lwp) WRITE(numout,*) ' PISCES not used' |
| 300 | ENDIF |
| 301 | |
| 302 | IF( lk_cfc ) THEN ; CALL trc_ini_cfc ! CFC tracers |
| 303 | ELSE ; IF(lwp) WRITE(numout,*) ' CFC not used' |
| 304 | ENDIF |
| 305 | |
| 306 | IF( lk_c14b ) THEN ; CALL trc_ini_c14b ! C14 bomb tracer |
| 307 | ELSE ; IF(lwp) WRITE(numout,*) ' C14 not used' |
| 308 | ENDIF |
| 309 | |
| 310 | IF( lk_my_trc ) THEN ; CALL trc_ini_my_trc ! MY_TRC tracers |
| 311 | ELSE ; IF(lwp) WRITE(numout,*) ' MY_TRC not used' |
| 312 | ENDIF |
| 313 | |
| 314 | IF( ln_nemo_io ) THEN ! Uses NEMO I/O and restart manager |
| 315 | ! |
| 316 | IF( ln_rsttr ) THEN |
| 317 | ! |
| 318 | IF( lk_offline ) neuler = 1 ! Set time-step indicator at nit000 (leap-frog) |
| 319 | CALL trc_rst_read ! restart from a file |
| 320 | ! |
| 321 | ELSE |
| 322 | IF( lk_offline ) THEN |
| 323 | neuler = 0 ! Set time-step indicator at nit000 (euler) |
| 324 | CALL day_init ! set calendar |
| 325 | ENDIF |
| 326 | #if defined key_dtatrc |
| 327 | CALL trc_dta( nit000 ) ! Initialization of tracer from a file that may also be used for damping |
| 328 | DO jn = 1, jptra |
| 329 | IF( lutini(jn) ) trn(:,:,:,jn) = trdta(:,:,:,jn) * tmask(:,:,:) ! initialisation from file if required |
| 330 | END DO |
| 331 | #endif |
| 332 | trb(:,:,:,:) = trn(:,:,:,:) |
| 333 | ! |
| 334 | ENDIF |
| 335 | ! |
| 336 | ENDIF |
| 337 | |
| 338 | tra(:,:,:,:) = 0._wp |
| 339 | |
| 340 | |
| 341 | }} |
| 342 | |
| 343 | trcstp.F90 |
| 344 | |
| 345 | {{ |
| 346 | IF( MOD( kt - 1 , nn_dttrc ) == 0 ) THEN ! only every nn_dttrc time step |
| 347 | ! |
| 348 | IF(ln_ctl) THEN |
| 349 | WRITE(charout,FMT="('kt =', I4,' d/m/y =',I2,I2,I4)") kt, nday, nmonth, nyear |
| 350 | CALL prt_ctl_trc_info(charout) |
| 351 | ENDIF |
| 352 | ! |
| 353 | tra(:,:,:,:) = 0.e0 |
| 354 | ! |
| 355 | IF( ln_nemo_io ) THEN ! Uses NEMO I/O and restart manager |
| 356 | ! |
| 357 | IF( kt == nit000 .AND. lk_trdmld_trc ) & |
| 358 | & CALL trd_mld_trc_init ! trends: Mixed-layer |
| 359 | CALL trc_rst_opn( kt ) ! Open tracer restart file |
| 360 | ENDIF |
| 361 | IF( lk_iomput ) THEN ; CALL trc_wri( kt ) ! output of passive tracers |
| 362 | ELSE ; CALL trc_dia( kt ) |
| 363 | ENDIF |
| 364 | CALL trc_sms( kt ) ! tracers: sink and source |
| 365 | CALL trc_trp( kt ) ! transport of passive tracers |
| 366 | |
| 367 | IF( ln_nemo_io ) THEN ! Uses NEMO I/O and restart manager |
| 368 | IF( kt == nit000 ) CALL iom_close( numrtr ) ! close input passive tracers restart file |
| 369 | IF( lrst_trc ) CALL trc_rst_wri( kt ) ! write tracer restart file |
| 370 | IF( lk_trdmld_trc ) CALL trd_mld_trc( kt ) ! trends: Mixed-layer |
| 371 | ENDIF |
| 372 | ! |
| 373 | ENDIF |
| 374 | }} |