[933] | 1 | MODULE trcini_cfc |
---|
| 2 | !!====================================================================== |
---|
| 3 | !! *** MODULE trcini_cfc *** |
---|
| 4 | !! TOP : initialisation of the CFC tracers |
---|
| 5 | !!====================================================================== |
---|
[3294] | 6 | !! History : 2.0 ! 2007-12 (C. Ethe, G. Madec) |
---|
[933] | 7 | !!---------------------------------------------------------------------- |
---|
| 8 | !!---------------------------------------------------------------------- |
---|
| 9 | !! trc_ini_cfc : CFC model initialisation |
---|
| 10 | !!---------------------------------------------------------------------- |
---|
| 11 | USE oce_trc ! Ocean variables |
---|
| 12 | USE par_trc ! TOP parameters |
---|
| 13 | USE trc ! TOP variables |
---|
[7646] | 14 | USE trcnam_cfc ! CFC SMS namelist |
---|
[2715] | 15 | USE trcsms_cfc ! CFC sms trends |
---|
[933] | 16 | |
---|
| 17 | IMPLICIT NONE |
---|
| 18 | PRIVATE |
---|
| 19 | |
---|
| 20 | PUBLIC trc_ini_cfc ! called by trcini.F90 module |
---|
| 21 | |
---|
| 22 | INTEGER :: inum ! unit number |
---|
| 23 | REAL(wp) :: ylats = -10. ! 10 degrees south |
---|
| 24 | REAL(wp) :: ylatn = 10. ! 10 degrees north |
---|
| 25 | |
---|
| 26 | !!---------------------------------------------------------------------- |
---|
[10067] | 27 | !! NEMO/TOP 4.0 , NEMO Consortium (2018) |
---|
[1146] | 28 | !! $Id$ |
---|
[10068] | 29 | !! Software governed by the CeCILL license (see ./LICENSE) |
---|
[933] | 30 | !!---------------------------------------------------------------------- |
---|
| 31 | CONTAINS |
---|
| 32 | |
---|
[10975] | 33 | SUBROUTINE trc_ini_cfc( Kmm ) |
---|
[933] | 34 | !!---------------------------------------------------------------------- |
---|
| 35 | !! *** trc_ini_cfc *** |
---|
| 36 | !! |
---|
| 37 | !! ** Purpose : initialization for cfc model |
---|
| 38 | !! |
---|
| 39 | !! ** Method : - Read the namcfc namelist and check the parameter values |
---|
| 40 | !!---------------------------------------------------------------------- |
---|
[10975] | 41 | INTEGER, INTENT(in) :: Kmm ! time level indices |
---|
[3294] | 42 | INTEGER :: ji, jj, jn, jl, jm, js, io, ierr |
---|
[10975] | 43 | INTEGER :: iskip = 6 ! number of 1st descriptor lines |
---|
[2715] | 44 | REAL(wp) :: zyy, zyd |
---|
[7646] | 45 | CHARACTER(len = 20) :: cltra |
---|
[933] | 46 | !!---------------------------------------------------------------------- |
---|
[7646] | 47 | ! |
---|
| 48 | CALL trc_nam_cfc |
---|
| 49 | ! |
---|
[933] | 50 | IF(lwp) WRITE(numout,*) |
---|
| 51 | IF(lwp) WRITE(numout,*) ' trc_ini_cfc: initialisation of CFC chemical model' |
---|
| 52 | IF(lwp) WRITE(numout,*) ' ~~~~~~~~~~~' |
---|
[7646] | 53 | ! |
---|
| 54 | IF(lwp) WRITE(numout,*) 'Read annual atmospheric concentratioins from formatted file : ' // TRIM(clname) |
---|
[3294] | 55 | |
---|
| 56 | CALL ctl_opn( inum, clname, 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. ) |
---|
| 57 | REWIND(inum) |
---|
| 58 | |
---|
| 59 | ! compute the number of year in the file |
---|
| 60 | ! file starts in 1931 do jn represent the year in the century |
---|
| 61 | jn = 31 |
---|
| 62 | DO |
---|
| 63 | READ(inum,'(1x)',END=100) |
---|
| 64 | jn = jn + 1 |
---|
| 65 | END DO |
---|
| 66 | 100 jpyear = jn - 1 - iskip |
---|
[7646] | 67 | IF ( lwp) WRITE(numout,*) ' ---> ', jpyear ,' years read' |
---|
[2715] | 68 | ! ! Allocate CFC arrays |
---|
[3294] | 69 | |
---|
[7646] | 70 | ALLOCATE( p_cfc(jpyear,jphem,3), STAT=ierr ) |
---|
[3294] | 71 | IF( ierr > 0 ) THEN |
---|
| 72 | CALL ctl_stop( 'trc_ini_cfc: unable to allocate p_cfc array' ) ; RETURN |
---|
| 73 | ENDIF |
---|
[2715] | 74 | IF( trc_sms_cfc_alloc() /= 0 ) CALL ctl_stop( 'STOP', 'trc_ini_cfc: unable to allocate CFC arrays' ) |
---|
[1004] | 75 | |
---|
[2715] | 76 | |
---|
[933] | 77 | ! Initialization of boundaries conditions |
---|
| 78 | ! --------------------------------------- |
---|
[2715] | 79 | xphem (:,:) = 0._wp |
---|
| 80 | p_cfc(:,:,:) = 0._wp |
---|
[933] | 81 | |
---|
| 82 | ! Initialization of qint in case of no restart |
---|
| 83 | !---------------------------------------------- |
---|
[2715] | 84 | qtr_cfc(:,:,:) = 0._wp |
---|
[1542] | 85 | IF( .NOT. ln_rsttr ) THEN |
---|
[933] | 86 | IF(lwp) THEN |
---|
| 87 | WRITE(numout,*) |
---|
[7646] | 88 | WRITE(numout,*) 'Initialisation of qint ; No restart : qint equal zero ' |
---|
[933] | 89 | ENDIF |
---|
[2715] | 90 | qint_cfc(:,:,:) = 0._wp |
---|
[1255] | 91 | DO jl = 1, jp_cfc |
---|
| 92 | jn = jp_cfc0 + jl - 1 |
---|
[10975] | 93 | tr(:,:,:,jn,Kmm) = 0._wp |
---|
[933] | 94 | END DO |
---|
| 95 | ENDIF |
---|
| 96 | |
---|
| 97 | REWIND(inum) |
---|
| 98 | |
---|
[3294] | 99 | DO jm = 1, iskip ! Skip over 1st six descriptor lines |
---|
[933] | 100 | READ(inum,'(1x)') |
---|
| 101 | END DO |
---|
[2047] | 102 | ! file starts in 1931 do jn represent the year in the century.jhh |
---|
| 103 | ! Read file till the end |
---|
| 104 | jn = 31 |
---|
[3294] | 105 | DO |
---|
[7646] | 106 | READ(inum,*, IOSTAT=io) zyy, p_cfc(jn,1:2,1), p_cfc(jn,1:2,2), p_cfc(jn,1:2,3) |
---|
[3294] | 107 | IF( io < 0 ) exit |
---|
| 108 | jn = jn + 1 |
---|
[933] | 109 | END DO |
---|
| 110 | |
---|
[7646] | 111 | !p_cfc(32,1:2,1) = 5.e-4 ! modify the values of the first years |
---|
| 112 | !p_cfc(33,1:2,1) = 8.e-4 |
---|
| 113 | !p_cfc(34,1:2,1) = 1.e-6 |
---|
| 114 | !p_cfc(35,1:2,1) = 2.e-3 |
---|
| 115 | !p_cfc(36,1:2,1) = 4.e-3 |
---|
| 116 | !p_cfc(37,1:2,1) = 6.e-3 |
---|
| 117 | !p_cfc(38,1:2,1) = 8.e-3 |
---|
| 118 | !p_cfc(39,1:2,1) = 1.e-2 |
---|
[933] | 119 | IF(lwp) THEN ! Control print |
---|
| 120 | WRITE(numout,*) |
---|
[7646] | 121 | WRITE(numout,*) ' Year c11NH c11SH c12NH c12SH SF6NH SF6SH' |
---|
[3294] | 122 | DO jn = 30, jpyear |
---|
[7646] | 123 | WRITE(numout, '( 1I4, 6F10.4)') jn, p_cfc(jn,1:2,1), p_cfc(jn,1:2,2), p_cfc(jn,1:2,3) |
---|
[933] | 124 | END DO |
---|
| 125 | ENDIF |
---|
| 126 | |
---|
| 127 | |
---|
| 128 | ! Interpolation factor of atmospheric partial pressure |
---|
| 129 | ! Linear interpolation between 2 hemispheric function of latitud between ylats and ylatn |
---|
| 130 | !--------------------------------------------------------------------------------------- |
---|
| 131 | zyd = ylatn - ylats |
---|
| 132 | DO jj = 1 , jpj |
---|
| 133 | DO ji = 1 , jpi |
---|
| 134 | IF( gphit(ji,jj) >= ylatn ) THEN ; xphem(ji,jj) = 1.e0 |
---|
| 135 | ELSEIF( gphit(ji,jj) <= ylats ) THEN ; xphem(ji,jj) = 0.e0 |
---|
| 136 | ELSE ; xphem(ji,jj) = ( gphit(ji,jj) - ylats) / zyd |
---|
| 137 | ENDIF |
---|
| 138 | END DO |
---|
| 139 | END DO |
---|
| 140 | ! |
---|
[1004] | 141 | IF(lwp) WRITE(numout,*) 'Initialization of CFC tracers done' |
---|
| 142 | IF(lwp) WRITE(numout,*) ' ' |
---|
[2715] | 143 | ! |
---|
[933] | 144 | END SUBROUTINE trc_ini_cfc |
---|
| 145 | |
---|
| 146 | !!====================================================================== |
---|
| 147 | END MODULE trcini_cfc |
---|