Changeset 3294 for trunk/NEMOGCM/NEMO/TOP_SRC
- Timestamp:
- 2012-01-28T17:44:18+01:00 (12 years ago)
- Location:
- trunk/NEMOGCM/NEMO/TOP_SRC
- Files:
-
- 62 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/NEMOGCM/NEMO/TOP_SRC/C14b/trcini_c14b.F90
r2715 r3294 181 181 IF( ctrcnm(jpc14) /= 'C14B' ) THEN 182 182 ctrcnm(jpc14) = 'C14B' 183 ctrc nl(jpc14) = 'Bomb C14 concentration'183 ctrcln(jpc14) = 'Bomb C14 concentration' 184 184 ENDIF 185 185 186 186 IF(lwp) THEN 187 187 CALL ctl_warn( ' we force tracer names' ) 188 WRITE(numout,*) ' tracer nb: ',jpc14,' name = ',ctrcnm(jpc14), ctrc nl(jpc14)188 WRITE(numout,*) ' tracer nb: ',jpc14,' name = ',ctrcnm(jpc14), ctrcln(jpc14) 189 189 WRITE(numout,*) ' ' 190 190 ENDIF -
trunk/NEMOGCM/NEMO/TOP_SRC/C14b/trcnam_c14b.F90
r2715 r3294 16 16 USE trc ! TOP variables 17 17 USE trcsms_c14b ! C14b specific variable 18 USE iom ! I/O manager 18 19 19 20 IMPLICIT NONE … … 37 38 !! 38 39 !! ** Method : Read the namc14 namelist and check the parameter 39 !! values called at the first timestep (nit 000)40 !! values called at the first timestep (nittrc000) 40 41 !! 41 42 !! ** input : Namelist namelist_c14b … … 43 44 INTEGER :: numnatb 44 45 45 #if defined key_diatrc && ! defined key_iomput46 46 ! definition of additional diagnostic as a structure 47 INTEGER :: jl, jn 48 TYPE DIAG 49 CHARACTER(len = 20) :: snamedia !: short name 50 CHARACTER(len = 80 ) :: lnamedia !: long name 51 CHARACTER(len = 20 ) :: unitdia !: unit 52 END TYPE DIAG 53 54 TYPE(DIAG) , DIMENSION(jp_c14b_2d) :: c14dia2d 55 TYPE(DIAG) , DIMENSION(jp_c14b_3d) :: c14dia3d 56 #endif 47 INTEGER :: jl, jn 48 TYPE(DIAG), DIMENSION(jp_c14b_2d) :: c14dia2d 49 TYPE(DIAG), DIMENSION(jp_c14b_3d) :: c14dia3d 57 50 !! 58 51 NAMELIST/namc14date/ ndate_beg_b, nyear_res_b 59 #if defined key_diatrc && ! defined key_iomput 60 NAMELIST/namc14dia/nn_writedia, c14dia2d, c14dia3d ! additional diagnostics 61 #endif 52 NAMELIST/namc14dia/ c14dia2d, c14dia3d ! additional diagnostics 62 53 !!------------------------------------------------------------------- 63 54 … … 80 71 IF(lwp) WRITE(numout,*) ' initial year (aa) nyear_beg_b = ', nyear_beg_b 81 72 ! 82 #if defined key_diatrc && ! defined key_iomput 73 IF( .NOT.lk_iomput .AND. ln_diatrc ) THEN 74 ! 75 ! Namelist namc14dia 76 ! ------------------- 77 DO jl = 1, jp_c14b_2d 78 WRITE(c14dia2d(jl)%sname,'("2D_",I1)') jl ! short name 79 WRITE(c14dia2d(jl)%lname,'("2D DIAGNOSTIC NUMBER ",I2)') jl ! long name 80 c14dia2d(jl)%units = ' ' ! units 81 END DO 82 ! ! 3D output arrays 83 DO jl = 1, jp_c14b_3d 84 WRITE(c14dia3d(jl)%sname,'("3D_",I1)') jl ! short name 85 WRITE(c14dia3d(jl)%lname,'("3D DIAGNOSTIC NUMBER ",I2)') jl ! long name 86 c14dia3d(jl)%units = ' ' ! units 87 END DO 83 88 84 ! Namelist namc14dia 85 ! ------------------- 86 nn_writedia = 10 ! default values 87 88 DO jl = 1, jp_c14b_2d 89 jn = jp_c14b0_2d + jl - 1 90 WRITE(ctrc2d(jn),'("2D_",I1)') jn ! short name 91 WRITE(ctrc2l(jn),'("2D DIAGNOSTIC NUMBER ",I2)') jn ! long name 92 ctrc2u(jn) = ' ' ! units 93 END DO 94 ! ! 3D output arrays 95 DO jl = 1, jp_c14b_3d 96 jn = jp_c14b0_3d + jl - 1 97 WRITE(ctrc3d(jn),'("3D_",I1)') jn ! short name 98 WRITE(ctrc3l(jn),'("3D DIAGNOSTIC NUMBER ",I2)') jn ! long name 99 ctrc3u(jn) = ' ' ! units 100 END DO 101 102 REWIND( numnatb ) ! read natrtd 103 READ ( numnatb, namc14dia ) 104 105 DO jl = 1, jp_c14b_2d 106 jn = jp_c14b0_2d + jl - 1 107 ctrc2d(jn) = c14dia2d(jl)%snamedia 108 ctrc2l(jn) = c14dia2d(jl)%lnamedia 109 ctrc2u(jn) = c14dia2d(jl)%unitdia 110 END DO 111 112 DO jl = 1, jp_c14b_3d 113 jn = jp_c14b0_3d + jl - 1 114 ctrc3d(jn) = c14dia3d(jl)%snamedia 115 ctrc3l(jn) = c14dia3d(jl)%lnamedia 116 ctrc3u(jn) = c14dia3d(jl)%unitdia 117 END DO 118 119 IF(lwp) THEN ! control print 120 WRITE(numout,*) 121 WRITE(numout,*) ' Namelist : natadd' 122 WRITE(numout,*) ' frequency of outputs for additional arrays nn_writedia = ', nn_writedia 123 DO jl = 1, jp_c14b_3d 124 jn = jp_c14b0_3d + jl - 1 125 WRITE(numout,*) ' 3d output field No : ',jn 126 WRITE(numout,*) ' short name : ', TRIM(ctrc3d(jn)) 127 WRITE(numout,*) ' long name : ', TRIM(ctrc3l(jn)) 128 WRITE(numout,*) ' unit : ', TRIM(ctrc3u(jn)) 129 WRITE(numout,*) ' ' 130 END DO 89 REWIND( numnatb ) ! 90 READ ( numnatb, namc14dia ) 131 91 132 92 DO jl = 1, jp_c14b_2d 133 93 jn = jp_c14b0_2d + jl - 1 134 WRITE(numout,*) ' 2d output field No : ',jn 135 WRITE(numout,*) ' short name : ', TRIM(ctrc2d(jn)) 136 WRITE(numout,*) ' long name : ', TRIM(ctrc2l(jn)) 137 WRITE(numout,*) ' unit : ', TRIM(ctrc2u(jn)) 94 ctrc2d(jn) = c14dia2d(jl)%sname 95 ctrc2l(jn) = c14dia2d(jl)%lname 96 ctrc2u(jn) = c14dia2d(jl)%units 97 END DO 98 99 DO jl = 1, jp_c14b_3d 100 jn = jp_c14b0_3d + jl - 1 101 ctrc3d(jn) = c14dia3d(jl)%sname 102 ctrc3l(jn) = c14dia3d(jl)%lname 103 ctrc3u(jn) = c14dia3d(jl)%units 104 END DO 105 106 IF(lwp) THEN ! control print 107 WRITE(numout,*) 108 WRITE(numout,*) ' Namelist : natadd' 109 DO jl = 1, jp_c14b_3d 110 jn = jp_c14b0_3d + jl - 1 111 WRITE(numout,*) ' 3d diag nb : ', jn, ' short name : ', ctrc3d(jn), & 112 & ' long name : ', ctrc3l(jn), ' unit : ', ctrc3u(jn) 113 END DO 138 114 WRITE(numout,*) ' ' 139 END DO 115 116 DO jl = 1, jp_c14b_2d 117 jn = jp_c14b0_2d + jl - 1 118 WRITE(numout,*) ' 2d diag nb : ', jn, ' short name : ', ctrc2d(jn), & 119 & ' long name : ', ctrc2l(jn), ' unit : ', ctrc2u(jn) 120 END DO 121 WRITE(numout,*) ' ' 122 ENDIF 123 ! 140 124 ENDIF 141 142 #endif143 125 144 126 END SUBROUTINE trc_nam_c14b -
trunk/NEMOGCM/NEMO/TOP_SRC/C14b/trcsms_c14b.F90
r2715 r3294 94 94 !! 95 95 !!---------------------------------------------------------------------- 96 USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released97 USE wrk_nemo, ONLY: zatmbc14 => wrk_2d_198 USE wrk_nemo, ONLY: zw3d => wrk_3d_199 96 ! 100 97 INTEGER, INTENT(in) :: kt ! ocean time-step index … … 113 110 REAL(wp) :: zpv ! piston velocity 114 111 REAL(wp) :: zdemi, ztra 115 !!---------------------------------------------------------------------- 116 117 IF( wrk_in_use(2, 1) .OR. wrk_in_use(3, 1) ) THEN 118 CALL ctl_stop('trc_sms_c14b : requested workspace arrays unavailable') ; RETURN 119 ENDIF 120 121 IF( kt == nit000 ) THEN ! Computation of decay coeffcient 112 REAL(wp), POINTER, DIMENSION(:,: ) :: zatmbc14 113 REAL(wp), POINTER, DIMENSION(:,:,:) :: zdecay 114 !!--------------------------------------------------------------------- 115 ! 116 IF( nn_timing == 1 ) CALL timing_start('trc_sms_c14b') 117 ! 118 ! Allocate temporary workspace 119 CALL wrk_alloc( jpi, jpj, zatmbc14 ) 120 CALL wrk_alloc( jpi, jpj, jpk, zdecay ) 121 122 IF( kt == nittrc000 ) THEN ! Computation of decay coeffcient 122 123 zdemi = 5730._wp 123 124 xlambda = LOG(2.) / zdemi / ( nyear_len(1) * rday ) … … 246 247 #endif 247 248 & * tmask(ji,jj,1) * ( 1. - fr_i(ji,jj) ) / 2. 248 249 249 ! Add the surface flux to the trend 250 250 tra(ji,jj,1,jpc14) = tra(ji,jj,1,jpc14) + qtr_c14(ji,jj) / fse3t(ji,jj,1) … … 252 252 ! cumulation of surface flux at each time step 253 253 qint_c14(ji,jj) = qint_c14(ji,jj) + qtr_c14(ji,jj) * rdt 254 255 # if defined key_diatrc && ! defined key_iomput 256 ! Save 2D diagnostics 257 trc2d(ji,jj,jp_c14b0_2d ) = qtr_c14 (ji,jj) 258 trc2d(ji,jj,jp_c14b0_2d + 1) = qint_c14(ji,jj) 259 # endif 254 ! 260 255 END DO 261 256 END DO … … 265 260 DO jj = 1, jpj 266 261 DO ji = 1, jpi 267 #if !defined key_degrad268 z tra = trn(ji,jj,jk,jpc14) * xaccum262 #if defined key_degrad 263 zdecay(ji,jj,jk) = trn(ji,jj,jk,jpc14) * ( 1. - EXP( -xlambda * rdt * facvol(ji,jj,jk) ) ) 269 264 #else 270 z tra = trn(ji,jj,jk,jpc14) * ( 1. - EXP( -xlambda * rdt * facvol(ji,jj,jk) ) )265 zdecay(ji,jj,jk) = trn(ji,jj,jk,jpc14) * xaccum 271 266 #endif 272 tra(ji,jj,jk,jpc14) = tra(ji,jj,jk,jpc14) - ztra / rdt 273 #if defined key_diatrc 274 ! Save 3D diagnostics 275 # if ! defined key_iomput 276 trc3d(ji,jj,jk,jp_c14b0_3d ) = ztra ! radioactive decay 277 # else 278 zw3d(ji,jj,jk) = ztra ! radioactive decay 279 # endif 280 #endif 267 tra(ji,jj,jk,jpc14) = tra(ji,jj,jk,jpc14) - zdecay(ji,jj,jk) / rdt 268 ! 281 269 END DO 282 270 END DO 283 271 END DO 284 272 285 #if defined key_diatrc && defined key_iomput 286 CALL iom_put( "qtrC14b" , qtr_c14 ) 287 CALL iom_put( "qintC14b" , qint_c14 ) 288 #endif 289 #if defined key_diatrc && defined key_iomput 290 CALL iom_put( "fdecay" , zw3d ) 291 #endif 292 IF( l_trdtrc ) CALL trd_mod_trc( tra(:,:,:,jpc14), jpc14, jptra_trd_sms, kt ) ! save trends 293 294 IF( wrk_not_released(2, 1) .OR. & 295 wrk_not_released(3, 1) ) CALL ctl_stop('trc_sms_c14b : failed to release workspace arrays') 273 IF( ln_diatrc ) THEN 274 IF( lk_iomput ) THEN 275 CALL iom_put( "qtrC14b" , qtr_c14 ) 276 CALL iom_put( "qintC14b" , qint_c14 ) 277 CALL iom_put( "fdecay" , zdecay ) 278 ELSE 279 trc2d(:,: ,jp_c14b0_2d ) = qtr_c14 (:,:) 280 trc2d(:,: ,jp_c14b0_2d + 1 ) = qint_c14(:,:) 281 trc3d(:,:,:,jp_c14b0_3d ) = zdecay (:,:,:) 282 ENDIF 283 ENDIF 284 285 IF( l_trdtrc ) CALL trd_mod_trc( tra(:,:,:,jpc14), jpc14, jptra_trd_sms, kt ) ! save trends 286 287 CALL wrk_dealloc( jpi, jpj, zatmbc14 ) 288 CALL wrk_dealloc( jpi, jpj, jpk, zdecay ) 289 ! 290 IF( nn_timing == 1 ) CALL timing_stop('trc_sms_c14b') 296 291 ! 297 292 END SUBROUTINE trc_sms_c14b -
trunk/NEMOGCM/NEMO/TOP_SRC/CFC/par_cfc.F90
r2528 r3294 32 32 !!--------------------------------------------------------------------- 33 33 LOGICAL, PUBLIC, PARAMETER :: lk_cfc = .TRUE. !: CFC flag 34 INTEGER, PUBLIC, PARAMETER :: jp_cfc = 2!: number of passive tracers34 INTEGER, PUBLIC, PARAMETER :: jp_cfc = 1 !: number of passive tracers 35 35 INTEGER, PUBLIC, PARAMETER :: jp_cfc_2d = 2 !: additional 2d output arrays ('key_trc_diaadd') 36 36 INTEGER, PUBLIC, PARAMETER :: jp_cfc_3d = 0 !: additional 3d output arrays ('key_trc_diaadd') -
trunk/NEMOGCM/NEMO/TOP_SRC/CFC/trcini_cfc.F90
r2715 r3294 4 4 !! TOP : initialisation of the CFC tracers 5 5 !!====================================================================== 6 !! History : 2.0 ! 2007-12 (C. Ethe, G. Madec) from trcini.cfc.h906 !! History : 2.0 ! 2007-12 (C. Ethe, G. Madec) 7 7 !!---------------------------------------------------------------------- 8 8 #if defined key_cfc … … 43 43 !! ** Method : - Read the namcfc namelist and check the parameter values 44 44 !!---------------------------------------------------------------------- 45 INTEGER :: ji, jj, jn, jl, jm, js 45 INTEGER :: ji, jj, jn, jl, jm, js, io, ierr 46 INTEGER :: iskip = 6 ! number of 1st descriptor lines 46 47 REAL(wp) :: zyy, zyd 47 48 !!---------------------------------------------------------------------- … … 51 52 IF(lwp) WRITE(numout,*) ' ~~~~~~~~~~~' 52 53 54 55 IF(lwp) WRITE(numout,*) 'read of formatted file cfc1112atm' 56 57 CALL ctl_opn( inum, clname, 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. ) 58 REWIND(inum) 59 60 ! compute the number of year in the file 61 ! file starts in 1931 do jn represent the year in the century 62 jn = 31 63 DO 64 READ(inum,'(1x)',END=100) 65 jn = jn + 1 66 END DO 67 100 jpyear = jn - 1 - iskip 68 IF ( lwp) WRITE(numout,*) ' ', jpyear ,' years read' 53 69 ! ! Allocate CFC arrays 70 71 ALLOCATE( p_cfc(jpyear,jphem,2), STAT=ierr ) 72 IF( ierr > 0 ) THEN 73 CALL ctl_stop( 'trc_ini_cfc: unable to allocate p_cfc array' ) ; RETURN 74 ENDIF 54 75 IF( trc_sms_cfc_alloc() /= 0 ) CALL ctl_stop( 'STOP', 'trc_ini_cfc: unable to allocate CFC arrays' ) 55 76 … … 75 96 ENDIF 76 97 77 78 ! READ CFC partial pressure atmospheric value :79 ! p11(year,nt) = PCFC11 in northern (1) and southern (2) hemisphere80 ! p12(year,nt) = PCFC12 in northern (1) and southern (2) hemisphere81 !--------------------------------------------------------------------82 83 IF(lwp) WRITE(numout,*) 'read of formatted file cfc1112atm'84 85 CALL ctl_opn( inum, clname, 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. )86 98 REWIND(inum) 87 99 88 DO jm = 1, 6! Skip over 1st six descriptor lines100 DO jm = 1, iskip ! Skip over 1st six descriptor lines 89 101 READ(inum,'(1x)') 90 102 END DO 91 92 103 ! file starts in 1931 do jn represent the year in the century.jhh 93 104 ! Read file till the end 94 105 jn = 31 95 DO WHILE ( 1 /= 2 ) 96 READ(inum,*,END=100) zyy, p_cfc(jn,1,1), p_cfc(jn,1,2), p_cfc(jn,2,1), p_cfc(jn,2,2) 97 IF ( lwp) THEN 98 WRITE(numout,'(f7.2, 4f8.2)' ) & 99 & zyy, p_cfc(jn,1,1), p_cfc(jn,1,2), p_cfc(jn,2,1), p_cfc(jn,2,2) 100 ENDIF 101 jn = jn + 1 106 DO 107 READ(inum,*, IOSTAT=io) zyy, p_cfc(jn,1,1), p_cfc(jn,1,2), p_cfc(jn,2,1), p_cfc(jn,2,2) 108 IF( io < 0 ) exit 109 jn = jn + 1 102 110 END DO 103 100 npyear = jn - 1104 IF ( lwp) WRITE(numout,*) ' ', npyear ,' years read'105 111 106 112 p_cfc(32,1:2,1) = 5.e-4 ! modify the values of the first years … … 116 122 WRITE(numout,*) 117 123 WRITE(numout,*) ' Year p11HN p11HS p12HN p12HS ' 118 DO jn = 30, 100124 DO jn = 30, jpyear 119 125 WRITE(numout, '( 1I4, 4F9.2)') jn, p_cfc(jn,1,1), p_cfc(jn,2,1), p_cfc(jn,1,2), p_cfc(jn,2,2) 120 126 END DO -
trunk/NEMOGCM/NEMO/TOP_SRC/CFC/trcnam_cfc.F90
r2715 r3294 16 16 USE trc ! TOP variables 17 17 USE trcsms_cfc ! CFC specific variable 18 USE iom ! I/O manager 18 19 19 20 IMPLICIT NONE … … 37 38 !! 38 39 !! ** Method : Read the namcfc namelist and check the parameter 39 !! values called at the first timestep (nit 000)40 !! values called at the first timestep (nittrc000) 40 41 !! 41 42 !! ** input : Namelist namcfc 42 43 !!---------------------------------------------------------------------- 43 INTEGER :: numnatc 44 #if defined key_diatrc && ! defined key_iomput 45 ! definition of additional diagnostic as a structure 44 INTEGER :: numnatc 46 45 INTEGER :: jl, jn 47 TYPE DIAG 48 CHARACTER(len = 20) :: snamedia !: short name 49 CHARACTER(len = 80 ) :: lnamedia !: long name 50 CHARACTER(len = 20 ) :: unitdia !: unit 51 END TYPE DIAG 52 53 TYPE(DIAG) , DIMENSION(jp_cfc_2d) :: cfcdia2d 54 #endif 46 TYPE(DIAG), DIMENSION(jp_cfc_2d) :: cfcdia2d 55 47 !! 56 48 NAMELIST/namcfcdate/ ndate_beg, nyear_res 57 #if defined key_diatrc && ! defined key_iomput 58 NAMELIST/namcfcdia/nn_writedia, cfcdia2d ! additional diagnostics 59 #endif 49 NAMELIST/namcfcdia/ cfcdia2d ! additional diagnostics 60 50 !!------------------------------------------------------------------- 61 51 … … 78 68 IF(lwp) WRITE(numout,*) ' initial year (aa) nyear_beg = ', nyear_beg 79 69 ! 80 #if defined key_diatrc && ! defined key_iomput81 70 82 ! Namelist namcfcdia 83 ! ------------------- 84 nn_writedia = 10 ! default values 71 IF( .NOT.lk_iomput .AND. ln_diatrc ) THEN 72 ! 73 ! Namelist namcfcdia 74 ! ------------------- 75 DO jl = 1, jp_cfc_2d 76 WRITE(cfcdia2d(jl)%sname,'("2D_",I1)') jl ! short name 77 WRITE(cfcdia2d(jl)%lname,'("2D DIAGNOSTIC NUMBER ",I2)') jl ! long name 78 cfcdia2d(jl)%units = ' ' ! units 79 END DO 85 80 86 DO jl = 1, jp_cfc_2d 87 jn = jp_cfc0_2d + jl - 1 88 WRITE(ctrc2d(jn),'("2D_",I1)') jn ! short name 89 WRITE(ctrc2l(jn),'("2D DIAGNOSTIC NUMBER ",I2)') jn ! long name 90 ctrc2u(jn) = ' ' ! units 91 END DO 81 REWIND( numnatc ) ! read natrtd 82 READ ( numnatc, namcfcdia ) 92 83 93 REWIND( numnatc ) ! read natrtd94 READ ( numnatc, namcfcdia )95 96 DO jl = 1, jp_cfc_2d97 jn = jp_cfc0_2d + jl - 198 ctrc2d(jn) = cfcdia2d(jl)%snamedia99 ctrc2l(jn) = cfcdia2d(jl)%lnamedia100 ctrc2u(jn) = cfcdia2d(jl)%unitdia101 END DO102 103 104 IF(lwp) THEN ! control print105 WRITE(numout,*)106 WRITE(numout,*) ' Namelist : natadd'107 WRITE(numout,*) ' frequency of outputs for additional arrays nn_writedia = ', nn_writedia108 84 DO jl = 1, jp_cfc_2d 109 85 jn = jp_cfc0_2d + jl - 1 110 WRITE(numout,*) ' 2d output field No : ',jn 111 WRITE(numout,*) ' short name : ', TRIM(ctrc2d(jn)) 112 WRITE(numout,*) ' long name : ', TRIM(ctrc2l(jn)) 113 WRITE(numout,*) ' unit : ', TRIM(ctrc2u(jn)) 86 ctrc2d(jn) = TRIM( cfcdia2d(jl)%sname ) 87 ctrc2l(jn) = TRIM( cfcdia2d(jl)%lname ) 88 ctrc2u(jn) = TRIM( cfcdia2d(jl)%units ) 89 END DO 90 91 IF(lwp) THEN ! control print 92 WRITE(numout,*) 93 WRITE(numout,*) ' Namelist : natadd' 94 DO jl = 1, jp_cfc_2d 95 jn = jp_cfc0_2d + jl - 1 96 WRITE(numout,*) ' 2d diag nb : ', jn, ' short name : ', ctrc2d(jn), & 97 & ' long name : ', ctrc2l(jn), ' unit : ', ctrc2u(jn) 98 END DO 114 99 WRITE(numout,*) ' ' 115 END DO 100 ENDIF 101 ! 116 102 ENDIF 117 #endif118 103 119 104 END SUBROUTINE trc_nam_cfc -
trunk/NEMOGCM/NEMO/TOP_SRC/CFC/trcsms_cfc.F90
r2715 r3294 28 28 PUBLIC trc_sms_cfc_alloc ! called in trcini_cfc.F90 29 29 30 INTEGER , PUBLIC, PARAMETER :: jpyear = 150 ! temporal parameter31 30 INTEGER , PUBLIC, PARAMETER :: jphem = 2 ! parameter for the 2 hemispheres 32 INTEGER , PUBLIC :: ndate_beg ! initial calendar date (aammjj) for CFC33 INTEGER , PUBLIC :: nyear_res ! restoring time constant (year)34 INTEGER , PUBLIC :: nyear_beg ! initial year (aa)35 INTEGER , PUBLIC :: npyear ! Number of years read in CFC1112 file31 INTEGER , PUBLIC :: jpyear ! Number of years read in CFC1112 file 32 INTEGER , PUBLIC :: ndate_beg ! initial calendar date (aammjj) for CFC 33 INTEGER , PUBLIC :: nyear_res ! restoring time constant (year) 34 INTEGER , PUBLIC :: nyear_beg ! initial year (aa) 36 35 37 REAL(wp), PUBLIC, DIMENSION(jpyear,jphem, 2 ):: p_cfc ! partial hemispheric pressure for CFC36 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: p_cfc ! partial hemispheric pressure for CFC 38 37 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: xphem ! spatial interpolation factor for patm 39 38 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: qtr_cfc ! flux at surface 40 39 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: qint_cfc ! cumulative flux 40 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: patm ! atmospheric function 41 41 42 42 REAL(wp), DIMENSION(4,2) :: soa ! coefficient for solubility of CFC [mol/l/atm] … … 75 75 !! CFC concentration in pico-mol/m3 76 76 !!---------------------------------------------------------------------- 77 USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released78 USE wrk_nemo, ONLY: ztrcfc => wrk_3d_1 ! use for CFC sms trend79 77 ! 80 78 INTEGER, INTENT(in) :: kt ! ocean time-step index … … 82 80 INTEGER :: ji, jj, jn, jl, jm, js 83 81 INTEGER :: iyear_beg, iyear_end 84 INTEGER :: im1, im2 82 INTEGER :: im1, im2, ierr 85 83 REAL(wp) :: ztap, zdtap 86 84 REAL(wp) :: zt1, zt2, zt3, zv2 … … 90 88 REAL(wp) :: zca_cfc ! concentration at equilibrium 91 89 REAL(wp) :: zak_cfc ! transfert coefficients 92 REAL(wp), DIMENSION(jphem,jp_cfc) :: zpatm ! atmospheric function 93 !!---------------------------------------------------------------------- 94 ! 95 IF( wrk_in_use(3, 1) ) THEN 96 CALL ctl_stop('trc_sms_cfc: requested workspace array unavailable') ; RETURN 90 REAL(wp), ALLOCATABLE, DIMENSION(:,:) :: zpatm ! atmospheric function 91 !!---------------------------------------------------------------------- 92 ! 93 ! 94 IF( nn_timing == 1 ) CALL timing_start('trc_sms_cfc') 95 ! 96 ALLOCATE( zpatm(jphem,jp_cfc), STAT=ierr ) 97 IF( ierr > 0 ) THEN 98 CALL ctl_stop( 'trc_sms_cfc: unable to allocate zpatm array' ) ; RETURN 97 99 ENDIF 98 100 99 IF( kt == nit 000 ) CALL trc_cfc_cst101 IF( kt == nittrc000 ) CALL trc_cfc_cst 100 102 101 103 ! Temporal interpolation … … 158 160 159 161 ! Input function : speed *( conc. at equil - concen at surface ) 160 ! trn in pico-mol/l idem qtr; ak in en m/ s162 ! trn in pico-mol/l idem qtr; ak in en m/a 161 163 qtr_cfc(ji,jj,jl) = -zak_cfc * ( trb(ji,jj,1,jn) - zca_cfc ) & 162 164 #if defined key_degrad … … 164 166 #endif 165 167 & * tmask(ji,jj,1) * ( 1. - fr_i(ji,jj) ) 166 167 168 ! Add the surface flux to the trend 168 169 tra(ji,jj,1,jn) = tra(ji,jj,1,jn) + qtr_cfc(ji,jj,jl) / fse3t(ji,jj,1) … … 176 177 END DO ! end CFC loop ! 177 178 ! !----------------! 178 179 #if defined key_diatrc 180 ! Save diagnostics , just for CFC11181 # if defined key_iomput 182 CALL iom_put( "qtrCFC11" , qtr_cfc(:,:,1) )183 CALL iom_put( "qintCFC11" , qint_cfc(:,:,1) )184 # else 185 trc2d(:,:,jp_cfc0_2d ) = qtr_cfc(:,:,1)186 trc2d(:,:,jp_cfc0_2d + 1) = qint_cfc(:,:,1)187 # endif 188 #endif 189 179 IF( ln_diatrc ) THEN 180 ! 181 IF( lk_iomput ) THEN 182 CALL iom_put( "qtrCFC11" , qtr_cfc (:,:,1) ) 183 CALL iom_put( "qintCFC11" , qint_cfc(:,:,1) ) 184 ELSE 185 trc2d(:,:,jp_cfc0_2d ) = qtr_cfc (:,:,1) 186 trc2d(:,:,jp_cfc0_2d + 1) = qint_cfc(:,:,1) 187 END IF 188 ! 189 END IF 190 190 191 IF( l_trdtrc ) THEN 191 192 DO jn = jp_cfc0, jp_cfc1 192 ztrcfc(:,:,:) = tra(:,:,:,jn) 193 CALL trd_mod_trc( ztrcfc, jn, jptra_trd_sms, kt ) ! save trends 193 CALL trd_mod_trc( tra(:,:,:,jn), jn, jptra_trd_sms, kt ) ! save trends 194 194 END DO 195 195 END IF 196 196 ! 197 IF( wrk_not_released(3, 1) ) CALL ctl_stop('trc_sms_cfc: failed to release workspace array')197 IF( nn_timing == 1 ) CALL timing_stop('trc_sms_cfc') 198 198 ! 199 199 END SUBROUTINE trc_sms_cfc -
trunk/NEMOGCM/NEMO/TOP_SRC/LOBSTER/par_lobster.F90
r2528 r3294 19 19 LOGICAL, PUBLIC, PARAMETER :: lk_lobster = .TRUE. !: LOBSTER flag 20 20 INTEGER, PUBLIC, PARAMETER :: jp_lobster = 6 !: number of LOBSTER tracers 21 INTEGER, PUBLIC, PARAMETER :: jp_lobster_2d = 19 !: additional 2d output arrays ('key_diatrc')22 INTEGER, PUBLIC, PARAMETER :: jp_lobster_3d = 3 !: additional 3d output arrays ('key_diatrc')21 INTEGER, PUBLIC, PARAMETER :: jp_lobster_2d = 19 !: additional 2d output arrays 22 INTEGER, PUBLIC, PARAMETER :: jp_lobster_3d = 3 !: additional 3d output arrays 23 23 INTEGER, PUBLIC, PARAMETER :: jp_lobster_trd = 17 !: number of sms trends for LOBSTER 24 24 -
trunk/NEMOGCM/NEMO/TOP_SRC/LOBSTER/trcbio.F90
r2715 r3294 60 60 !! for passive tracers are saved for futher diagnostics. 61 61 !!--------------------------------------------------------------------- 62 USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released63 USE wrk_nemo, ONLY: wrk_3d_2, wrk_4d_164 62 !! 65 63 INTEGER, INTENT( in ) :: kt ! ocean time-step index … … 74 72 REAL(wp) :: zfilpz, zfildz, zphya, zzooa, zno3a 75 73 REAL(wp) :: znh4a, zdeta, zdoma, zzoobod, zboddet, zdomaju 76 #if defined key_diatrc77 74 REAL(wp) :: ze3t 78 #endif79 #if defined key_diatrc && defined key_iomput80 75 REAL(wp), POINTER, DIMENSION(:,:,:) :: zw2d 81 76 REAL(wp), POINTER, DIMENSION(:,:,:,:) :: zw3d 82 #endif83 REAL(wp), DIMENSION(:,:,:,:), ALLOCATABLE :: ztrbio84 77 CHARACTER (len=25) :: charout 85 78 !!--------------------------------------------------------------------- 86 87 #if defined key_diatrc && defined key_iomput 88 IF( ( wrk_in_use(3, 2) ) .OR. ( wrk_in_use(4, 1) ) ) THEN 89 CALL ctl_stop('trc_bio : requested workspace arrays unavailable.') 90 RETURN 91 END IF 92 ! Set-up pointers into sub-arrays of workspaces 93 zw2d => wrk_3d_2(:,:,1:17) 94 zw3d => wrk_4d_1(:,:,:,1:3) 95 #endif 96 97 IF( kt == nit000 ) THEN 79 ! 80 IF( nn_timing == 1 ) CALL timing_start('trc_bio') 81 ! 82 IF( ln_diatrc ) THEN 83 CALL wrk_alloc( jpi, jpj, 17, zw2d ) 84 CALL wrk_alloc( jpi, jpj, jpk, 3, zw3d ) 85 ENDIF 86 87 IF( kt == nittrc000 ) THEN 98 88 IF(lwp) WRITE(numout,*) 99 89 IF(lwp) WRITE(numout,*) ' trc_bio: LOBSTER bio-model' … … 102 92 103 93 fbod(:,:) = 0.e0 104 #if defined key_diatrc && ! defined key_iomput 105 # if defined key_iomput 106 zw2d (:,:,:) = 0.e0 107 zw3d(:,:,:,:) = 0.e0 108 # else 109 DO jl = jp_lob0_2d, jp_lob1_2d 110 trc2d(:,:,jl) = 0.e0 111 END DO 112 # endif 113 #endif 114 115 IF( l_trdtrc )THEN 116 ALLOCATE( ztrbio(jpi,jpj,jpk,jp_lobster_trd) ) 117 ztrbio(:,:,:,:) = 0. 94 IF( ln_diatrc ) THEN 95 zw2d (:,:,:) = 0.e0 96 zw3d(:,:,:,:) = 0.e0 118 97 ENDIF 119 98 … … 139 118 ! psinut,akno3,aknh4 added by asklod AS Kremeur 2005-03 140 119 zlno3 = zno3 * EXP( -psinut * znh4 ) / ( akno3 + zno3 ) 141 zlnh4 = znh4 / (znh4+aknh4) 120 zlnh4 = znh4 / (znh4+aknh4) 142 121 143 122 ! sinks and sources … … 149 128 zphydom = rgamma * (1 - fphylab) * (zno3phy + znh4phy) 150 129 zphynh4 = rgamma * fphylab * (zno3phy + znh4phy) 151 152 130 ! zooplankton production 153 131 ! preferences … … 157 135 zppdz = ( zpdz * zdet ) / ( ( zppz * zphy + zpdz * zdet ) + 1.e-13 ) 158 136 zfood = zpppz * zphy + zppdz * zdet 159 ! filtration 137 ! filtration 160 138 zfilpz = taus * zpppz / (aks + zfood) 161 139 zfildz = taus * zppdz / (aks + zfood) … … 166 144 ! fecal pellets production 167 145 zzoodet = rpnaz * zphyzoo + rdnaz * zdetzoo 168 146 169 147 ! zooplankton liquide excretion 170 zzoonh4 = tauzn * fzoolab * zzoo 148 zzoonh4 = tauzn * fzoolab * zzoo 171 149 zzoodom = tauzn * (1 - fzoolab) * zzoo 172 150 173 151 ! mortality 174 ! phytoplankton mortality 152 ! phytoplankton mortality 175 153 zphydet = tmminp * zphy 176 154 … … 183 161 ! detritus and dom breakdown 184 162 zdetnh4 = taudn * fdetlab * zdet 185 zdetdom = taudn * (1 - fdetlab) * zdet 163 zdetdom = taudn * (1 - fdetlab) * zdet 186 164 187 165 zdomnh4 = taudomn * zdom 188 166 189 ! flux added to express how the excess of nitrogen from 167 ! flux added to express how the excess of nitrogen from 190 168 ! PHY, ZOO and DET to DOM goes directly to NH4 (flux of ajustment) 191 169 zdomaju = (1 - redf/reddom) * (zphydom + zzoodom + zdetdom) 192 170 193 ! Nitrification 171 ! Nitrification 194 172 znh4no3 = taunn * znh4 195 173 … … 211 189 tra(ji,jj,jk,jp_lob_dom) = tra(ji,jj,jk,jp_lob_dom) + zdoma 212 190 213 #if defined key_diabio 214 trbio(ji,jj,jk,jp_lob0_trd ) = zno3phy 215 trbio(ji,jj,jk,jp_lob0_trd + 1) = znh4phy 216 trbio(ji,jj,jk,jp_lob0_trd + 2) = zphynh4 217 trbio(ji,jj,jk,jp_lob0_trd + 3) = zphydom 218 trbio(ji,jj,jk,jp_lob0_trd + 4) = zphyzoo 219 trbio(ji,jj,jk,jp_lob0_trd + 5) = zphydet 220 trbio(ji,jj,jk,jp_lob0_trd + 6) = zdetzoo 221 trbio(ji,jj,jk,jp_lob0_trd + 8) = zzoodet 222 trbio(ji,jj,jk,jp_lob0_trd + 9) = zzoobod 223 trbio(ji,jj,jk,jp_lob0_trd + 10) = zzoonh4 224 trbio(ji,jj,jk,jp_lob0_trd + 11) = zzoodom 225 trbio(ji,jj,jk,jp_lob0_trd + 12) = znh4no3 226 trbio(ji,jj,jk,jp_lob0_trd + 13) = zdomnh4 227 trbio(ji,jj,jk,jp_lob0_trd + 14) = zdetnh4 228 trbio(ji,jj,jk,jp_lob0_trd + 15) = zdetdom 229 #endif 230 IF( l_trdtrc ) THEN 231 ztrbio(ji,jj,jk,jp_lob0_trd ) = zno3phy 232 ztrbio(ji,jj,jk,jp_lob0_trd + 1) = znh4phy 233 ztrbio(ji,jj,jk,jp_lob0_trd + 2) = zphynh4 234 ztrbio(ji,jj,jk,jp_lob0_trd + 3) = zphydom 235 ztrbio(ji,jj,jk,jp_lob0_trd + 4) = zphyzoo 236 ztrbio(ji,jj,jk,jp_lob0_trd + 5) = zphydet 237 ztrbio(ji,jj,jk,jp_lob0_trd + 6) = zdetzoo 191 192 IF( ( ln_diabio .AND. .NOT. lk_iomput ) .OR. l_trdtrc ) THEN 193 trbio(ji,jj,jk,jp_lob0_trd ) = zno3phy 194 trbio(ji,jj,jk,jp_lob0_trd + 1) = znh4phy 195 trbio(ji,jj,jk,jp_lob0_trd + 2) = zphynh4 196 trbio(ji,jj,jk,jp_lob0_trd + 3) = zphydom 197 trbio(ji,jj,jk,jp_lob0_trd + 4) = zphyzoo 198 trbio(ji,jj,jk,jp_lob0_trd + 5) = zphydet 199 trbio(ji,jj,jk,jp_lob0_trd + 6) = zdetzoo 238 200 ! trend number 8 in trcsed 239 ztrbio(ji,jj,jk,jp_lob0_trd + 8) = zzoodet240 ztrbio(ji,jj,jk,jp_lob0_trd + 9) = zzoobod241 ztrbio(ji,jj,jk,jp_lob0_trd + 10) = zzoonh4242 ztrbio(ji,jj,jk,jp_lob0_trd + 11) = zzoodom243 ztrbio(ji,jj,jk,jp_lob0_trd + 12) = znh4no3244 ztrbio(ji,jj,jk,jp_lob0_trd + 13) = zdomnh4245 ztrbio(ji,jj,jk,jp_lob0_trd + 14) = zdetnh4246 ztrbio(ji,jj,jk,jp_lob0_trd + 15) = zdetdom201 trbio(ji,jj,jk,jp_lob0_trd + 8) = zzoodet 202 trbio(ji,jj,jk,jp_lob0_trd + 9) = zzoobod 203 trbio(ji,jj,jk,jp_lob0_trd + 10) = zzoonh4 204 trbio(ji,jj,jk,jp_lob0_trd + 11) = zzoodom 205 trbio(ji,jj,jk,jp_lob0_trd + 12) = znh4no3 206 trbio(ji,jj,jk,jp_lob0_trd + 13) = zdomnh4 207 trbio(ji,jj,jk,jp_lob0_trd + 14) = zdetnh4 208 trbio(ji,jj,jk,jp_lob0_trd + 15) = zdetdom 247 209 ! trend number 17 in trcexp 248 210 ENDIF 249 250 #if defined key_diatrc 251 ! convert fluxes in per day 252 ze3t = fse3t(ji,jj,jk) * 86400. 253 #if ! defined key_iomput 254 trc2d(ji,jj,jp_lob0_2d ) = trc2d(ji,jj, jp_lob0_2d ) + zno3phy * ze3t 255 trc2d(ji,jj,jp_lob0_2d + 1) = trc2d(ji,jj, jp_lob0_2d + 1) + znh4phy * ze3t 256 trc2d(ji,jj,jp_lob0_2d + 2) = trc2d(ji,jj, jp_lob0_2d + 2) + zphydom * ze3t 257 trc2d(ji,jj,jp_lob0_2d + 3) = trc2d(ji,jj, jp_lob0_2d + 3) + zphynh4 * ze3t 258 trc2d(ji,jj,jp_lob0_2d + 4) = trc2d(ji,jj, jp_lob0_2d + 4) + zphyzoo * ze3t 259 trc2d(ji,jj,jp_lob0_2d + 5) = trc2d(ji,jj, jp_lob0_2d + 5) + zphydet * ze3t 260 trc2d(ji,jj,jp_lob0_2d + 6) = trc2d(ji,jj, jp_lob0_2d + 6) + zdetzoo * ze3t 261 ! trend number 8 is in trcsed.F 262 trc2d(ji,jj,jp_lob0_2d + 8) = trc2d(ji,jj,jp_lob0_2d + 8) + zzoodet * ze3t 263 trc2d(ji,jj,jp_lob0_2d + 9) = trc2d(ji,jj,jp_lob0_2d + 9) + zzoobod * ze3t 264 trc2d(ji,jj,jp_lob0_2d + 10) = trc2d(ji,jj,jp_lob0_2d + 10) + zzoonh4 * ze3t 265 trc2d(ji,jj,jp_lob0_2d + 11) = trc2d(ji,jj,jp_lob0_2d + 11) + zzoodom * ze3t 266 trc2d(ji,jj,jp_lob0_2d + 12) = trc2d(ji,jj,jp_lob0_2d + 12) + znh4no3 * ze3t 267 trc2d(ji,jj,jp_lob0_2d + 13) = trc2d(ji,jj,jp_lob0_2d + 13) + zdomnh4 * ze3t 268 trc2d(ji,jj,jp_lob0_2d + 14) = trc2d(ji,jj,jp_lob0_2d + 14) + zdetnh4 * ze3t 269 trc2d(ji,jj,jp_lob0_2d + 15) = trc2d(ji,jj,jp_lob0_2d + 15) + ( zno3phy + znh4phy - zphynh4 & 270 & - zphydom - zphyzoo - zphydet ) * ze3t 271 trc2d(ji,jj,jp_lob0_2d + 16) = trc2d(ji,jj,jp_lob0_2d + 16) + ( zphyzoo + zdetzoo - zzoodet & 272 & - zzoobod - zzoonh4 - zzoodom ) * ze3t 273 trc2d(ji,jj,jp_lob0_2d + 17) = trc2d(ji,jj,jp_lob0_2d + 17) + zdetdom * ze3t 274 ! trend number 19 is in trcexp.F 275 #else 276 zw2d(ji,jj,1) = zw2d(ji,jj,1) + zno3phy * ze3t 277 zw2d(ji,jj,2) = zw2d(ji,jj,2) + znh4phy * ze3t 278 zw2d(ji,jj,3) = zw2d(ji,jj,3) + zphydom * ze3t 279 zw2d(ji,jj,4) = zw2d(ji,jj,4) + zphynh4 * ze3t 280 zw2d(ji,jj,5) = zw2d(ji,jj,5) + zphyzoo * ze3t 281 zw2d(ji,jj,6) = zw2d(ji,jj,6) + zphydet * ze3t 282 zw2d(ji,jj,7) = zw2d(ji,jj,7) + zdetzoo * ze3t 283 zw2d(ji,jj,8) = zw2d(ji,jj,8) + zzoodet * ze3t 284 zw2d(ji,jj,9) = zw2d(ji,jj,9) + zzoobod * ze3t 285 zw2d(ji,jj,10) = zw2d(ji,jj,10) + zzoonh4 * ze3t 286 zw2d(ji,jj,11) = zw2d(ji,jj,11) + zzoodom * ze3t 287 zw2d(ji,jj,12) = zw2d(ji,jj,12) + znh4no3 * ze3t 288 zw2d(ji,jj,13) = zw2d(ji,jj,13) + zdomnh4 * ze3t 289 zw2d(ji,jj,14) = zw2d(ji,jj,14) + zdetnh4 * ze3t 290 zw2d(ji,jj,15) = zw2d(ji,jj,15) + ( zno3phy + znh4phy - zphynh4 - zphydom - zphyzoo - zphydet ) * ze3t 291 zw2d(ji,jj,16) = zw2d(ji,jj,16) + ( zphyzoo + zdetzoo - zzoodet - zzoobod - zzoonh4 - zzoodom ) * ze3t 292 zw2d(ji,jj,17) = zw2d(ji,jj,17) + zdetdom * ze3t 293 #endif 294 #if defined key_diatrc 295 # if ! defined key_iomput 296 trc3d(ji,jj,jk,jp_lob0_3d ) = zno3phy * 86400 297 trc3d(ji,jj,jk,jp_lob0_3d + 1) = znh4phy * 86400 298 trc3d(ji,jj,jk,jp_lob0_3d + 2) = znh4no3 * 86400 299 # else 300 zw3d(ji,jj,jk,1) = zno3phy * 86400 301 zw3d(ji,jj,jk,2) = znh4phy * 86400 302 zw3d(ji,jj,jk,3) = znh4no3 * 86400 303 # endif 304 #endif 305 #endif 211 IF( ln_diatrc ) THEN 212 ! convert fluxes in per day 213 ze3t = fse3t(ji,jj,jk) * 86400. 214 zw2d(ji,jj,1) = zw2d(ji,jj,1) + zno3phy * ze3t 215 zw2d(ji,jj,2) = zw2d(ji,jj,2) + znh4phy * ze3t 216 zw2d(ji,jj,3) = zw2d(ji,jj,3) + zphydom * ze3t 217 zw2d(ji,jj,4) = zw2d(ji,jj,4) + zphynh4 * ze3t 218 zw2d(ji,jj,5) = zw2d(ji,jj,5) + zphyzoo * ze3t 219 zw2d(ji,jj,6) = zw2d(ji,jj,6) + zphydet * ze3t 220 zw2d(ji,jj,7) = zw2d(ji,jj,7) + zdetzoo * ze3t 221 zw2d(ji,jj,8) = zw2d(ji,jj,8) + zzoodet * ze3t 222 zw2d(ji,jj,9) = zw2d(ji,jj,9) + zzoobod * ze3t 223 zw2d(ji,jj,10) = zw2d(ji,jj,10) + zzoonh4 * ze3t 224 zw2d(ji,jj,11) = zw2d(ji,jj,11) + zzoodom * ze3t 225 zw2d(ji,jj,12) = zw2d(ji,jj,12) + znh4no3 * ze3t 226 zw2d(ji,jj,13) = zw2d(ji,jj,13) + zdomnh4 * ze3t 227 zw2d(ji,jj,14) = zw2d(ji,jj,14) + zdetnh4 * ze3t 228 zw2d(ji,jj,15) = zw2d(ji,jj,15) + ( zno3phy + znh4phy - zphynh4 - zphydom - zphyzoo - zphydet ) * ze3t 229 zw2d(ji,jj,16) = zw2d(ji,jj,16) + ( zphyzoo + zdetzoo - zzoodet - zzoobod - zzoonh4 - zzoodom ) * ze3t 230 zw2d(ji,jj,17) = zw2d(ji,jj,17) + zdetdom * ze3t 231 ! 232 zw3d(ji,jj,jk,1) = zno3phy * 86400 233 zw3d(ji,jj,jk,2) = znh4phy * 86400 234 zw3d(ji,jj,jk,3) = znh4no3 * 86400 235 ! 236 ENDIF 306 237 END DO 307 238 END DO … … 347 278 348 279 ! mortality 349 zphydet = tmminp * zphy ! phytoplankton mortality 280 zphydet = tmminp * zphy ! phytoplankton mortality 350 281 351 282 zzoobod = 0.e0 ! zooplankton mortality … … 354 285 ! detritus and dom breakdown 355 286 zdetnh4 = taudn * fdetlab * zdet 356 zdetdom = taudn * (1 - fdetlab) * zdet 287 zdetdom = taudn * (1 - fdetlab) * zdet 357 288 358 289 zdomnh4 = taudomn * zdom … … 367 298 zphya = zno3phy + znh4phy - zphynh4 - zphydom - zphyzoo - zphydet 368 299 zzooa = zphyzoo + zdetzoo - zzoodet - zzoodom - zzoonh4 - zzoobod 369 zno3a = - zno3phy + znh4no3 300 zno3a = - zno3phy + znh4no3 370 301 znh4a = - znh4phy - znh4no3 + zphynh4 + zzoonh4 + zdomnh4 + zdetnh4 + zdomaju 371 302 zdeta = zphydet + zzoodet - zdetzoo - zdetnh4 - zdetdom + zboddet … … 380 311 tra(ji,jj,jk,jp_lob_dom) = tra(ji,jj,jk,jp_lob_dom) + zdoma 381 312 ! 382 #if defined key_diabio 383 trbio(ji,jj,jk,jp_lob0_trd ) = zno3phy 384 trbio(ji,jj,jk,jp_lob0_trd + 1) = znh4phy 385 trbio(ji,jj,jk,jp_lob0_trd + 2) = zphynh4 386 trbio(ji,jj,jk,jp_lob0_trd + 3) = zphydom 387 trbio(ji,jj,jk,jp_lob0_trd + 4) = zphyzoo 388 trbio(ji,jj,jk,jp_lob0_trd + 5) = zphydet 389 trbio(ji,jj,jk,jp_lob0_trd + 6) = zdetzoo 390 trbio(ji,jj,jk,jp_lob0_trd + 8) = zzoodet 391 trbio(ji,jj,jk,jp_lob0_trd + 9) = zzoobod 392 trbio(ji,jj,jk,jp_lob0_trd + 10) = zzoonh4 393 trbio(ji,jj,jk,jp_lob0_trd + 11) = zzoodom 394 trbio(ji,jj,jk,jp_lob0_trd + 12) = znh4no3 395 trbio(ji,jj,jk,jp_lob0_trd + 13) = zdomnh4 396 trbio(ji,jj,jk,jp_lob0_trd + 14) = zdetnh4 397 trbio(ji,jj,jk,jp_lob0_trd + 15) = zdetdom 398 #endif 399 IF( l_trdtrc ) THEN 400 ztrbio(ji,jj,jk,jp_lob0_trd ) = zno3phy 401 ztrbio(ji,jj,jk,jp_lob0_trd + 1) = znh4phy 402 ztrbio(ji,jj,jk,jp_lob0_trd + 2) = zphynh4 403 ztrbio(ji,jj,jk,jp_lob0_trd + 3) = zphydom 404 ztrbio(ji,jj,jk,jp_lob0_trd + 4) = zphyzoo 405 ztrbio(ji,jj,jk,jp_lob0_trd + 5) = zphydet 406 ztrbio(ji,jj,jk,jp_lob0_trd + 6) = zdetzoo 313 IF( ( ln_diabio .AND. .NOT. lk_iomput ) .OR. l_trdtrc ) THEN 314 trbio(ji,jj,jk,jp_lob0_trd ) = zno3phy 315 trbio(ji,jj,jk,jp_lob0_trd + 1) = znh4phy 316 trbio(ji,jj,jk,jp_lob0_trd + 2) = zphynh4 317 trbio(ji,jj,jk,jp_lob0_trd + 3) = zphydom 318 trbio(ji,jj,jk,jp_lob0_trd + 4) = zphyzoo 319 trbio(ji,jj,jk,jp_lob0_trd + 5) = zphydet 320 trbio(ji,jj,jk,jp_lob0_trd + 6) = zdetzoo 407 321 ! trend number 8 in trcsed 408 ztrbio(ji,jj,jk,jp_lob0_trd + 8) = zzoodet409 ztrbio(ji,jj,jk,jp_lob0_trd + 9) = zzoobod410 ztrbio(ji,jj,jk,jp_lob0_trd + 10) = zzoonh4411 ztrbio(ji,jj,jk,jp_lob0_trd + 11) = zzoodom412 ztrbio(ji,jj,jk,jp_lob0_trd + 12) = znh4no3413 ztrbio(ji,jj,jk,jp_lob0_trd + 13) = zdomnh4414 ztrbio(ji,jj,jk,jp_lob0_trd + 14) = zdetnh4415 ztrbio(ji,jj,jk,jp_lob0_trd + 15) = zdetdom416 ! trend number 17 in trcexp 322 trbio(ji,jj,jk,jp_lob0_trd + 8) = zzoodet 323 trbio(ji,jj,jk,jp_lob0_trd + 9) = zzoobod 324 trbio(ji,jj,jk,jp_lob0_trd + 10) = zzoonh4 325 trbio(ji,jj,jk,jp_lob0_trd + 11) = zzoodom 326 trbio(ji,jj,jk,jp_lob0_trd + 12) = znh4no3 327 trbio(ji,jj,jk,jp_lob0_trd + 13) = zdomnh4 328 trbio(ji,jj,jk,jp_lob0_trd + 14) = zdetnh4 329 trbio(ji,jj,jk,jp_lob0_trd + 15) = zdetdom 330 ! trend number 17 in trcexp 417 331 ENDIF 418 #if defined key_diatrc 419 # if ! defined key_iomput 420 trc3d(ji,jj,jk,jp_lob0_3d ) = zno3phy * 86400 421 trc3d(ji,jj,jk,jp_lob0_3d + 1) = znh4phy * 86400 422 trc3d(ji,jj,jk,jp_lob0_3d + 2) = znh4no3 * 86400 423 # else 424 zw3d(ji,jj,jk,1) = zno3phy * 86400 425 zw3d(ji,jj,jk,2) = znh4phy * 86400 426 zw3d(ji,jj,jk,3) = znh4no3 * 86400 427 # endif 428 #endif 332 IF( ln_diatrc ) THEN 333 ! convert fluxes in per day 334 ze3t = fse3t(ji,jj,jk) * 86400. 335 zw2d(ji,jj,1) = zw2d(ji,jj,1) + zno3phy * ze3t 336 zw2d(ji,jj,2) = zw2d(ji,jj,2) + znh4phy * ze3t 337 zw2d(ji,jj,3) = zw2d(ji,jj,3) + zphydom * ze3t 338 zw2d(ji,jj,4) = zw2d(ji,jj,4) + zphynh4 * ze3t 339 zw2d(ji,jj,5) = zw2d(ji,jj,5) + zphyzoo * ze3t 340 zw2d(ji,jj,6) = zw2d(ji,jj,6) + zphydet * ze3t 341 zw2d(ji,jj,7) = zw2d(ji,jj,7) + zdetzoo * ze3t 342 zw2d(ji,jj,8) = zw2d(ji,jj,8) + zzoodet * ze3t 343 zw2d(ji,jj,9) = zw2d(ji,jj,9) + zzoobod * ze3t 344 zw2d(ji,jj,10) = zw2d(ji,jj,10) + zzoonh4 * ze3t 345 zw2d(ji,jj,11) = zw2d(ji,jj,11) + zzoodom * ze3t 346 zw2d(ji,jj,12) = zw2d(ji,jj,12) + znh4no3 * ze3t 347 zw2d(ji,jj,13) = zw2d(ji,jj,13) + zdomnh4 * ze3t 348 zw2d(ji,jj,14) = zw2d(ji,jj,14) + zdetnh4 * ze3t 349 zw2d(ji,jj,15) = zw2d(ji,jj,15) + ( zno3phy + znh4phy - zphynh4 - zphydom - zphyzoo - zphydet ) * ze3t 350 zw2d(ji,jj,16) = zw2d(ji,jj,16) + ( zphyzoo + zdetzoo - zzoodet - zzoobod - zzoonh4 - zzoodom ) * ze3t 351 zw2d(ji,jj,17) = zw2d(ji,jj,17) + zdetdom * ze3t 352 ! 353 zw3d(ji,jj,jk,1) = zno3phy * 86400 354 zw3d(ji,jj,jk,2) = znh4phy * 86400 355 zw3d(ji,jj,jk,3) = znh4no3 * 86400 356 ! 357 ENDIF 429 358 END DO 430 359 END DO 431 360 END DO 432 361 433 #if defined key_diatrc 434 ! Lateral boundary conditions 435 # if ! defined key_iomput 436 DO jl = jp_lob0_2d, jp_lob1_2d 437 CALL lbc_lnk( trc2d(:,:,jl),'T', 1. ) 438 END DO 439 # else 440 DO jl = 1, 17 441 CALL lbc_lnk( zw2d(:,:,jl),'T', 1. ) 442 END DO 443 ! Save diagnostics 444 CALL iom_put( "TNO3PHY", zw2d(:,:,1) ) 445 CALL iom_put( "TNH4PHY", zw2d(:,:,2) ) 446 CALL iom_put( "TPHYDOM", zw2d(:,:,3) ) 447 CALL iom_put( "TPHYNH4", zw2d(:,:,4) ) 448 CALL iom_put( "TPHYZOO", zw2d(:,:,5) ) 449 CALL iom_put( "TPHYDET", zw2d(:,:,6) ) 450 CALL iom_put( "TDETZOO", zw2d(:,:,7) ) 451 CALL iom_put( "TZOODET", zw2d(:,:,8) ) 452 CALL iom_put( "TZOOBOD", zw2d(:,:,9) ) 453 CALL iom_put( "TZOONH4", zw2d(:,:,10) ) 454 CALL iom_put( "TZOODOM", zw2d(:,:,11) ) 455 CALL iom_put( "TNH4NO3", zw2d(:,:,12) ) 456 CALL iom_put( "TDOMNH4", zw2d(:,:,13) ) 457 CALL iom_put( "TDETNH4", zw2d(:,:,14) ) 458 CALL iom_put( "TPHYTOT", zw2d(:,:,15) ) 459 CALL iom_put( "TZOOTOT", zw2d(:,:,16) ) 460 CALL iom_put( "TDETDOM", zw2d(:,:,17) ) 461 # endif 462 #endif 463 464 #if defined key_diatrc 465 ! Lateral boundary conditions 466 # if ! defined key_iomput 467 DO jl = jp_lob0_3d, jp_lob1_3d 468 CALL lbc_lnk( trc3d(:,:,1,jl),'T', 1. ) 469 END DO 470 # else 471 DO jl = 1, 3 472 CALL lbc_lnk( zw3d(:,:,:,jl),'T', 1. ) 473 END DO 474 ! save diagnostics 475 CALL iom_put( "FNO3PHY", zw3d(:,:,:,1) ) 476 CALL iom_put( "FNH4PHY", zw3d(:,:,:,2) ) 477 CALL iom_put( "FNH4NO3", zw3d(:,:,:,3) ) 478 # endif 479 #endif 480 481 #if defined key_diabio 482 ! Lateral boundary conditions on trcbio 483 DO jl = jp_lob0_trd, jp_lob1_trd 484 CALL lbc_lnk( trbio(:,:,1,jl),'T', 1. ) 485 END DO 486 #endif 362 IF( ln_diatrc ) THEN 363 ! 364 DO jl = 1, 17 365 CALL lbc_lnk( zw2d(:,:,jl),'T', 1. ) 366 END DO 367 DO jl = 1, 3 368 CALL lbc_lnk( zw3d(:,:,:,jl),'T', 1. ) 369 END DO 370 IF( lk_iomput ) THEN 371 ! Save diagnostics 372 CALL iom_put( "TNO3PHY", zw2d(:,:,1) ) 373 CALL iom_put( "TNH4PHY", zw2d(:,:,2) ) 374 CALL iom_put( "TPHYDOM", zw2d(:,:,3) ) 375 CALL iom_put( "TPHYNH4", zw2d(:,:,4) ) 376 CALL iom_put( "TPHYZOO", zw2d(:,:,5) ) 377 CALL iom_put( "TPHYDET", zw2d(:,:,6) ) 378 CALL iom_put( "TDETZOO", zw2d(:,:,7) ) 379 CALL iom_put( "TZOODET", zw2d(:,:,8) ) 380 CALL iom_put( "TZOOBOD", zw2d(:,:,9) ) 381 CALL iom_put( "TZOONH4", zw2d(:,:,10) ) 382 CALL iom_put( "TZOODOM", zw2d(:,:,11) ) 383 CALL iom_put( "TNH4NO3", zw2d(:,:,12) ) 384 CALL iom_put( "TDOMNH4", zw2d(:,:,13) ) 385 CALL iom_put( "TDETNH4", zw2d(:,:,14) ) 386 CALL iom_put( "TPHYTOT", zw2d(:,:,15) ) 387 CALL iom_put( "TZOOTOT", zw2d(:,:,16) ) 388 ! 389 CALL iom_put( "FNO3PHY", zw3d(:,:,:,1) ) 390 CALL iom_put( "FNH4PHY", zw3d(:,:,:,2) ) 391 CALL iom_put( "FNH4NO3", zw3d(:,:,:,3) ) 392 ! 393 ELSE 394 ! 395 trc2d(:,:,jp_lob0_2d ) = zw2d(:,:,1) 396 trc2d(:,:,jp_lob0_2d + 1) = zw2d(:,:,2) 397 trc2d(:,:,jp_lob0_2d + 2) = zw2d(:,:,3) 398 trc2d(:,:,jp_lob0_2d + 3) = zw2d(:,:,4) 399 trc2d(:,:,jp_lob0_2d + 4) = zw2d(:,:,5) 400 trc2d(:,:,jp_lob0_2d + 5) = zw2d(:,:,6) 401 trc2d(:,:,jp_lob0_2d + 6) = zw2d(:,:,7) 402 ! trend number 8 is in trcsed.F 403 trc2d(:,:,jp_lob0_2d + 8) = zw2d(:,:,8) 404 trc2d(:,:,jp_lob0_2d + 9) = zw2d(:,:,9) 405 trc2d(:,:,jp_lob0_2d + 10) = zw2d(:,:,10) 406 trc2d(:,:,jp_lob0_2d + 11) = zw2d(:,:,11) 407 trc2d(:,:,jp_lob0_2d + 12) = zw2d(:,:,12) 408 trc2d(:,:,jp_lob0_2d + 13) = zw2d(:,:,13) 409 trc2d(:,:,jp_lob0_2d + 14) = zw2d(:,:,14) 410 trc2d(:,:,jp_lob0_2d + 15) = zw2d(:,:,15) 411 trc2d(:,:,jp_lob0_2d + 16) = zw2d(:,:,16) 412 trc2d(:,:,jp_lob0_2d + 17) = zw2d(:,:,17) 413 ! trend number 19 is in trcexp.F 414 trc3d(:,:,:,jp_lob0_3d ) = zw3d(:,:,:,1) 415 trc3d(:,:,:,jp_lob0_3d + 1) = zw3d(:,:,:,2) 416 trc3d(:,:,:,jp_lob0_3d + 2) = zw3d(:,:,:,3) 417 ENDIF 418 ! 419 ENDIF 420 421 IF( ln_diabio .AND. .NOT. lk_iomput ) THEN 422 DO jl = jp_lob0_trd, jp_lob1_trd 423 CALL lbc_lnk( trbio(:,:,1,jl),'T', 1. ) 424 END DO 425 ENDIF 487 426 ! 488 427 IF( l_trdtrc ) THEN 489 428 DO jl = jp_lob0_trd, jp_lob1_trd 490 CALL trd_mod_trc( ztrbio(:,:,:,jl), jl, kt ) ! handle the trend429 CALL trd_mod_trc( trbio(:,:,:,jl), jl, kt ) ! handle the trend 491 430 END DO 492 431 ENDIF 493 494 IF( l_trdtrc ) DEALLOCATE( ztrbio )495 432 496 433 IF(ln_ctl) THEN ! print mean trends (used for debugging) … … 500 437 ENDIF 501 438 ! 502 #if defined key_diatrc && defined key_iomput 503 IF( ( wrk_not_released(3, 2) ) .OR. ( wrk_not_released(4, 1) ) ) & 504 & CALL ctl_stop('trc_bio : failed to release workspace arrays.') 505 #endif 439 IF( ln_diatrc ) THEN 440 CALL wrk_dealloc( jpi, jpj, 17, zw2d ) 441 CALL wrk_dealloc( jpi, jpj, jpk, 3, zw3d ) 442 ENDIF 443 ! 444 IF( nn_timing == 1 ) CALL timing_stop('trc_bio') 506 445 ! 507 446 END SUBROUTINE trc_bio -
trunk/NEMOGCM/NEMO/TOP_SRC/LOBSTER/trcexp.F90
r2715 r3294 53 53 !! COLUMN BELOW THE SURFACE LAYER. 54 54 !!--------------------------------------------------------------------- 55 !! 55 56 INTEGER, INTENT( in ) :: kt ! ocean time-step index 56 57 !! 57 INTEGER :: ji, jj, jk, jl, ikt 58 INTEGER :: ji, jj, jk, jl, ikt, ierr 58 59 REAL(wp) :: zgeolpoc, zfact, zwork, ze3t, zsedpocd 59 REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: 60 REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: ztrbio 60 61 CHARACTER (len=25) :: charout 61 62 !!--------------------------------------------------------------------- 62 63 IF( kt == nit000 ) THEN 63 ! 64 IF( nn_timing == 1 ) CALL timing_start('trc_exp') 65 ! 66 IF( kt == nittrc000 ) THEN 64 67 IF(lwp) WRITE(numout,*) 65 68 IF(lwp) WRITE(numout,*) ' trc_exp: LOBSTER export' 66 69 IF(lwp) WRITE(numout,*) ' ~~~~~~~' 70 ENDIF 71 72 IF( l_trdtrc ) THEN 73 ALLOCATE( ztrbio(jpi,jpj,jpk) , STAT = ierr ) ! temporary save of trends 74 IF( ierr > 0 ) THEN 75 CALL ctl_stop( 'trc_exp: unable to allocate ztrbio array' ) ; RETURN 76 ENDIF 77 ztrbio(:,:,:) = tra(:,:,:,jp_lob_no3) 67 78 ENDIF 68 79 … … 72 83 ! LAYERS IS DETERMINED BY DMIN3 DEFINED IN sms_lobster.F90 73 84 ! ---------------------------------------------------------------------- 74 75 IF( l_trdtrc )THEN76 ALLOCATE( ztrbio(jpi,jpj,jpk) )77 ztrbio(:,:,:) = tra(:,:,:,jp_lob_no3)78 ENDIF79 80 85 DO jk = 1, jpkm1 81 86 DO jj = 2, jpjm1 … … 114 119 115 120 ! Oa & Ek: diagnostics depending on jpdia2d ! left as example 116 #if defined key_diatrc 117 # if ! defined key_iomput 118 trc2d(:,:,jp_lob0_2d + 18) = sedpocn(:,:) 119 # else 120 CALL iom_put( "SEDPOC" , sedpocn ) 121 # endif 122 #endif 121 IF( ln_diatrc ) THEN 122 IF( lk_iomput ) THEN ; CALL iom_put( "SEDPOC" , sedpocn ) 123 ELSE ; trc2d(:,:,jp_lob0_2d + 18) = sedpocn(:,:) 124 ENDIF 125 ENDIF 123 126 124 127 125 128 ! Time filter and swap of arrays 126 129 ! ------------------------------ 127 IF( neuler == 0 .AND. kt == nit 000 ) THEN ! Euler time-stepping at first time-step130 IF( neuler == 0 .AND. kt == nittrc000 ) THEN ! Euler time-stepping at first time-step 128 131 ! ! (only swap) 129 132 sedpocn(:,:) = sedpoca(:,:) … … 146 149 jl = jp_lob0_trd + 16 147 150 CALL trd_mod_trc( ztrbio, jl, kt ) ! handle the trend 151 DEALLOCATE( ztrbio ) 148 152 ENDIF 149 150 IF( l_trdtrc ) DEALLOCATE( ztrbio )151 153 152 154 IF(ln_ctl) THEN ! print mean trends (used for debugging) … … 155 157 CALL prt_ctl_trc(tab4d=tra, mask=tmask, clinfo=ctrcnm) 156 158 ENDIF 157 159 ! 160 IF( nn_timing == 1 ) CALL timing_stop('trc_exp') 161 ! 158 162 END SUBROUTINE trc_exp 159 163 -
trunk/NEMOGCM/NEMO/TOP_SRC/LOBSTER/trcini_lobster.F90
r2715 r3294 40 40 !! ** purpose : specific initialisation for LOBSTER bio-model 41 41 !!---------------------------------------------------------------------- 42 USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released43 USE wrk_nemo, ONLY: zrro => wrk_2d_1 , zdm0 => wrk_3d_144 42 !! 45 43 INTEGER :: ji, jj, jk, jn 46 44 REAL(wp) :: ztest, zfluo, zfluu 47 !!---------------------------------------------------------------------- 48 ! 49 IF( wrk_in_use(2, 1) .OR. wrk_in_use(3, 1) ) THEN 50 CALL ctl_stop('trc_ini_lobster: requested workspace arrays unavailable') ; RETURN 51 ENDIF 45 REAL(wp), POINTER, DIMENSION(:,: ) :: zrro 46 REAL(wp), POINTER, DIMENSION(:,:,:) :: zdm0 47 !!--------------------------------------------------------------------- 48 49 ! Allocate temporary workspace 50 CALL wrk_alloc( jpi, jpj, zrro ) 51 CALL wrk_alloc( jpi, jpj, jpk, zdm0 ) 52 52 53 53 54 IF(lwp) WRITE(numout,*) … … 254 255 IF(lwp) WRITE(numout,*) 'Initialization of LOBSTER tracers done' 255 256 ! 256 IF( wrk_not_released(2, 1) .OR. &257 wrk_not_released(3, 1) ) CALL ctl_stop('trc_ini_lobster: failed to release workspace arrays')257 CALL wrk_dealloc( jpi, jpj, zrro ) 258 CALL wrk_dealloc( jpi, jpj, jpk, zdm0 ) 258 259 ! 259 260 END SUBROUTINE trc_ini_lobster -
trunk/NEMOGCM/NEMO/TOP_SRC/LOBSTER/trcnam_lobster.F90
r2715 r3294 12 12 !! trc_nam_lobster : LOBSTER model namelist read 13 13 !!---------------------------------------------------------------------- 14 USE oce_trc ! Ocean variables 15 USE par_trc ! TOP parameters 16 USE trc ! TOP variables 17 USE sms_lobster ! sms trends 14 USE oce_trc ! Ocean variables 15 USE par_trc ! TOP parameters 16 USE trc ! TOP variables 17 USE trdmod_trc_oce , ONLY : lk_trdmld_trc ! tracers trend flag 18 USE sms_lobster ! sms trends 19 USE iom ! I/O manager 18 20 19 21 IMPLICIT NONE … … 41 43 INTEGER :: numnatl 42 44 !! 43 #if defined key_diatrc && ! defined key_iomput44 45 INTEGER :: jl, jn 45 ! definition of additional diagnostic as a structure 46 TYPE DIAG 47 CHARACTER(len = 20) :: snamedia !: short name 48 CHARACTER(len = 80 ) :: lnamedia !: long name 49 CHARACTER(len = 20 ) :: unitdia !: unit 50 END TYPE DIAG 51 52 TYPE(DIAG) , DIMENSION(jp_lobster_2d) :: lobdia2d 53 TYPE(DIAG) , DIMENSION(jp_lobster_3d) :: lobdia3d 54 #endif 55 #if defined key_diabio || defined key_trdmld_trc 56 INTEGER :: js, jd 57 ! definition of additional diagnostic as a structure 58 TYPE DIABIO 59 CHARACTER(len = 20) :: snamebio !: short name 60 CHARACTER(len = 80 ) :: lnamebio !: long name 61 CHARACTER(len = 20 ) :: unitbio !: unit 62 END TYPE DIABIO 63 64 TYPE(DIABIO) , DIMENSION(jp_lobster_trd) :: lobdiabio 65 #endif 46 TYPE(DIAG), DIMENSION(jp_lobster_2d ) :: lobdia2d 47 TYPE(DIAG), DIMENSION(jp_lobster_3d ) :: lobdia3d 48 TYPE(DIAG), DIMENSION(jp_lobster_trd) :: lobdiabio 66 49 67 50 NAMELIST/namlobphy/ apmin, tmumax, rgamma, fphylab, tmmaxp, tmminp, & … … 77 60 78 61 NAMELIST/namlobopt/ xkg0, xkr0, xkgp, xkrp, xlg, xlr, rpig 79 #if defined key_diatrc && ! defined key_iomput 80 NAMELIST/namlobdia/nn_writedia, lobdia3d, lobdia2d ! additional diagnostics 81 #endif 82 #if defined key_diabio || defined key_trdmld_trc 83 NAMELIST/namlobdbi/nwritebio, lobdiabio 84 #endif 62 NAMELIST/namlobdia/ lobdia3d, lobdia2d ! additional diagnostics 63 NAMELIST/namlobdbi/ lobdiabio 85 64 !!---------------------------------------------------------------------- 86 65 … … 278 257 ENDIF 279 258 280 #if defined key_diatrc && ! defined key_iomput 281 282 ! Namelist namlobdia 283 ! ------------------- 284 nn_writedia = 10 ! default values 285 286 DO jl = 1, jp_lobster_2d 287 jn = jp_lob0_2d + jl - 1 288 WRITE(ctrc2d(jn),'("2D_",I1)') jn ! short name 289 WRITE(ctrc2l(jn),'("2D DIAGNOSTIC NUMBER ",I2)') jn ! long name 290 ctrc2u(jn) = ' ' ! units 291 END DO 292 ! ! 3D output arrays 293 DO jl = 1, jp_lobster_3d 294 jn = jp_lob0_3d + jl - 1 295 WRITE(ctrc3d(jn),'("3D_",I1)') jn ! short name 296 WRITE(ctrc3l(jn),'("3D DIAGNOSTIC NUMBER ",I2)') jn ! long name 297 ctrc3u(jn) = ' ' ! units 298 END DO 299 300 REWIND( numnatl ) ! read natrtd 301 READ ( numnatl, namlobdia ) 302 303 DO jl = 1, jp_lobster_2d 304 jn = jp_lob0_2d + jl - 1 305 ctrc2d(jn) = lobdia2d(jl)%snamedia 306 ctrc2l(jn) = lobdia2d(jl)%lnamedia 307 ctrc2u(jn) = lobdia2d(jl)%unitdia 308 END DO 309 310 DO jl = 1, jp_lobster_3d 311 jn = jp_lob0_3d + jl - 1 312 ctrc3d(jn) = lobdia3d(jl)%snamedia 313 ctrc3l(jn) = lobdia3d(jl)%lnamedia 314 ctrc3u(jn) = lobdia3d(jl)%unitdia 315 END DO 316 317 IF(lwp) THEN ! control print 318 WRITE(numout,*) 319 WRITE(numout,*) ' Namelist : natadd' 320 WRITE(numout,*) ' frequency of outputs for additional arrays nn_writedia = ', nn_writedia 259 ! 260 IF( .NOT.lk_iomput .AND. ln_diatrc ) THEN 261 ! 262 ! Namelist namlobdia 263 ! ------------------- 264 DO jl = 1, jp_lobster_2d 265 WRITE(lobdia2d(jl)%sname,'("2D_",I1)') jl ! short name 266 WRITE(lobdia2d(jl)%lname,'("2D DIAGNOSTIC NUMBER ",I2)') jl ! long name 267 lobdia2d(jl)%units = ' ' ! units 268 END DO 269 ! ! 3D output arrays 270 DO jl = 1, jp_lobster_3d 271 WRITE(lobdia3d(jl)%sname,'("3D_",I1)') jl ! short name 272 WRITE(lobdia3d(jl)%lname,'("3D DIAGNOSTIC NUMBER ",I2)') jl ! long name 273 lobdia3d(jl)%units = ' ' ! units 274 END DO 275 276 REWIND( numnatl ) ! read natrtd 277 READ ( numnatl, namlobdia ) 278 279 DO jl = 1, jp_lobster_2d 280 jn = jp_lob0_2d + jl - 1 281 ctrc2d(jn) = lobdia2d(jl)%sname 282 ctrc2l(jn) = lobdia2d(jl)%lname 283 ctrc2u(jn) = lobdia2d(jl)%units 284 END DO 285 321 286 DO jl = 1, jp_lobster_3d 322 287 jn = jp_lob0_3d + jl - 1 323 WRITE(numout,*) ' 3d output field No : ',jn 324 WRITE(numout,*) ' short name : ', TRIM(ctrc3d(jn)) 325 WRITE(numout,*) ' long name : ', TRIM(ctrc3l(jn)) 326 WRITE(numout,*) ' unit : ', TRIM(ctrc3u(jn)) 288 ctrc3d(jn) = lobdia3d(jl)%sname 289 ctrc3l(jn) = lobdia3d(jl)%lname 290 ctrc3u(jn) = lobdia3d(jl)%units 291 END DO 292 293 IF(lwp) THEN ! control print 294 WRITE(numout,*) 295 WRITE(numout,*) ' Namelist : natadd' 296 DO jl = 1, jp_lobster_3d 297 jn = jp_lob0_3d + jl - 1 298 WRITE(numout,*) ' 3d diag nb : ', jn, ' short name : ', ctrc3d(jn), & 299 & ' long name : ', ctrc3l(jn), ' unit : ', ctrc3u(jn) 300 END DO 327 301 WRITE(numout,*) ' ' 328 END DO 329 330 DO jl = 1, jp_lobster_2d 331 jn = jp_lob0_2d + jl - 1 332 WRITE(numout,*) ' 2d output field No : ',jn 333 WRITE(numout,*) ' short name : ', TRIM(ctrc2d(jn)) 334 WRITE(numout,*) ' long name : ', TRIM(ctrc2l(jn)) 335 WRITE(numout,*) ' unit : ', TRIM(ctrc2u(jn)) 302 303 DO jl = 1, jp_lobster_2d 304 jn = jp_lob0_2d + jl - 1 305 WRITE(numout,*) ' 2d diag nb : ', jn, ' short name : ', ctrc2d(jn), & 306 & ' long name : ', ctrc2l(jn), ' unit : ', ctrc2u(jn) 307 END DO 336 308 WRITE(numout,*) ' ' 337 END DO338 ENDIF339 #endif340 341 #if defined key_diabio || defined key_trdmld_trc342 ! namlobdbi : bio diagnostics343 nwritebio = 10 ! default values344 345 DO js = 1, jp_lobster_trd346 jd = jp_lob0_trd + js - 1347 IF( jd < 10 ) THEN ; WRITE (ctrbio(jd),'("BIO_",I1)') jd ! short name348 ELSEIF (jd < 100 ) THEN ; WRITE (ctrbio(jd),'("BIO_",I2)') jd349 ELSE ; WRITE (ctrbio(jd),'("BIO_",I3)') jd350 309 ENDIF 351 WRITE(ctrbil(jd),'("BIOLOGICAL TREND NUMBER ",I2)') jd ! long name 352 ctrbiu(jd) = 'mmoleN/m3/s ' ! units 353 END DO 354 355 REWIND( numnatl ) 356 READ ( numnatl, namlobdbi ) 310 ! 311 ENDIF 312 313 IF( ( .NOT.lk_iomput .AND. ln_diabio ) .OR. lk_trdmld_trc ) THEN 314 ! 315 ! Namelist namlobdbi 316 ! ------------------- 317 DO jl = 1, jp_lobster_trd 318 IF( jl < 10 ) THEN ; WRITE (lobdiabio(jl)%sname,'("BIO_",I1)') jl ! short name 319 ELSEIF (jl < 100 ) THEN ; WRITE (lobdiabio(jl)%sname,'("BIO_",I2)') jl 320 ELSE ; WRITE (lobdiabio(jl)%sname,'("BIO_",I3)') jl 321 ENDIF 322 WRITE(lobdiabio(jl)%lname,'("BIOLOGICAL TREND NUMBER ",I2)') jl ! long name 323 lobdiabio(jl)%units = 'mmoleN/m3/s ' ! units 324 END DO 325 326 REWIND( numnatl ) 327 READ ( numnatl, namlobdbi ) 357 328 358 DO js = 1, jp_lobster_trd 359 jd = jp_lob0_trd + js - 1 360 ctrbio(jd) = lobdiabio(js)%snamebio 361 ctrbil(jd) = lobdiabio(js)%lnamebio 362 ctrbiu(jd) = lobdiabio(js)%unitbio 363 END DO 364 365 IF(lwp) THEN ! control print 366 WRITE(numout,*) 367 WRITE(numout,*) ' Namelist : namlobdbi' 368 WRITE(numout,*) ' frequency of outputs for biological trends nwritebio = ', nwritebio 369 DO js = 1, jp_lobster_trd 370 jd = jp_lob0_trd + js - 1 371 WRITE(numout,*) ' biological trend No : ',jd 372 WRITE(numout,*) ' short name : ', TRIM(ctrbio(jd)) 373 WRITE(numout,*) ' long name : ', TRIM(ctrbil(jd)) 374 WRITE(numout,*) ' unit : ', TRIM(ctrbiu(jd)) 329 DO jl = 1, jp_lobster_trd 330 jn = jp_lob0_trd + jl - 1 331 ctrbio(jl) = lobdiabio(jl)%sname 332 ctrbil(jl) = lobdiabio(jl)%lname 333 ctrbiu(jl) = lobdiabio(jl)%units 334 END DO 335 336 IF(lwp) THEN ! control print 337 WRITE(numout,*) 338 WRITE(numout,*) ' Namelist : namlobdbi' 339 DO jl = 1, jp_lobster_trd 340 jn = jp_lob0_trd + jl - 1 341 WRITE(numout,*) ' biological trend No : ', jn, ' short name : ', ctrbio(jn), & 342 & ' long name : ', ctrbio(jn), ' unit : ', ctrbio(jn) 343 END DO 375 344 WRITE(numout,*) ' ' 376 END DO 345 END IF 346 ! 377 347 END IF 378 #endif379 348 ! 380 349 END SUBROUTINE trc_nam_lobster -
trunk/NEMOGCM/NEMO/TOP_SRC/LOBSTER/trcopt.F90
r2715 r3294 52 52 !! xze ??? 53 53 !!--------------------------------------------------------------------- 54 USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released55 USE wrk_nemo, ONLY: zpar100 => wrk_2d_1, & ! irradiance at euphotic layer depth56 zpar0m => wrk_2d_2 ! irradiance just below the surface57 USE wrk_nemo, ONLY: zparr => wrk_3d_2, & ! red and green compound of par58 zparg => wrk_3d_359 54 !! 60 55 INTEGER, INTENT( in ) :: kt ! index of the time stepping … … 65 60 REAL(wp) :: zkr, zkg ! total absorption coefficient in red and green 66 61 REAL(wp) :: zcoef ! temporary scalar 62 REAL(wp), POINTER, DIMENSION(:,: ) :: zpar100, zpar0m 63 REAL(wp), POINTER, DIMENSION(:,:,:) :: zparr, zparg 64 !!--------------------------------------------------------------------- 65 ! 66 IF( nn_timing == 1 ) CALL timing_start('trc_opt') 67 ! 68 ! Allocate temporary workspace 69 CALL wrk_alloc( jpi, jpj, zpar100, zpar0m ) 70 CALL wrk_alloc( jpi, jpj, jpk, zparr, zparg ) 67 71 68 !!--------------------------------------------------------------------- 69 70 IF( ( wrk_in_use(2, 1,2)) .OR. ( wrk_in_use(3, 2,3)) )THEN 71 CALL ctl_stop('trc_opt : requested workspace arrays unavailable') ; RETURN 72 END IF 73 74 IF( kt == nit000 ) THEN 72 IF( kt == nittrc000 ) THEN 75 73 IF(lwp) WRITE(numout,*) 76 74 IF(lwp) WRITE(numout,*) ' trc_opt : LOBSTER optic-model' … … 137 135 ENDIF 138 136 ! 139 IF( wrk_not_released(2, 1,2) .OR. wrk_not_released(3, 2,3) ) & 140 CALL ctl_stop('trc_opt : failed to release workspace arrays') 137 CALL wrk_dealloc( jpi, jpj, zpar100, zpar0m ) 138 CALL wrk_dealloc( jpi, jpj, jpk, zparr, zparg ) 139 ! 140 IF( nn_timing == 1 ) CALL timing_stop('trc_opt') 141 141 ! 142 142 END SUBROUTINE trc_opt -
trunk/NEMOGCM/NEMO/TOP_SRC/LOBSTER/trcsed.F90
r2715 r3294 56 56 !! trend of passive tracers is saved for futher diagnostics. 57 57 !!--------------------------------------------------------------------- 58 USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released59 USE wrk_nemo, ONLY: zwork => wrk_3d_260 USE wrk_nemo, ONLY: zw2d => wrk_2d_1 ! only used (if defined61 ! key_diatrc && defined key_iomput)62 58 !! 63 59 INTEGER, INTENT( in ) :: kt ! ocean time-step index 64 60 !! 65 INTEGER :: ji, jj, jk, jl 66 REAL(wp) :: ztra 67 REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: ztrbio 61 INTEGER :: ji, jj, jk, jl, ierr 68 62 CHARACTER (len=25) :: charout 63 REAL(wp), POINTER, DIMENSION(:,: ) :: zw2d 64 REAL(wp), POINTER, DIMENSION(:,:,:) :: zwork, ztra, ztrbio 69 65 !!--------------------------------------------------------------------- 70 71 IF( ( wrk_in_use(3,2)) .OR. ( wrk_in_use(2,1)) ) THEN 72 CALL ctl_stop('trc_sed : requested workspace arrays unavailable.') 73 RETURN 74 END IF 75 76 IF( kt == nit000 ) THEN 66 ! 67 IF( nn_timing == 1 ) CALL timing_start('trc_sed') 68 ! 69 IF( kt == nittrc000 ) THEN 77 70 IF(lwp) WRITE(numout,*) 78 71 IF(lwp) WRITE(numout,*) ' trc_sed: LOBSTER sedimentation' 79 72 IF(lwp) WRITE(numout,*) ' ~~~~~~~' 73 ENDIF 74 75 ! Allocate temporary workspace 76 CALL wrk_alloc( jpi, jpj, jpk, zwork, ztra ) 77 78 IF( ln_diatrc ) THEN 79 CALL wrk_alloc( jpi, jpj, zw2d ) 80 ENDIF 81 82 IF( l_trdtrc ) THEN 83 CALL wrk_alloc( jpi, jpj, jpk, ztrbio ) 84 ztrbio(:,:,:) = tra(:,:,:,jp_lob_det) 80 85 ENDIF 81 86 … … 87 92 zwork(:,:,jpk) = 0.e0 ! bottom value set to zero 88 93 89 #if defined key_diatrc && defined key_iomput90 zw2d(:,:) = 0.91 # endif92 93 IF( l_trdtrc )THEN94 ALLOCATE( ztrbio(jpi,jpj,jpk) )95 ztrbio(:,:,:) = tra(:,:,:,jp_lob_det)96 ENDIF97 98 94 ! tracer flux at w-point: we use -vsed (downward flux) with simplification : no e1*e2 99 95 DO jk = 2, jpkm1 … … 104 100 DO jk = 1, jpkm1 105 101 DO jj = 1, jpj 106 DO ji = 1,jpi 107 ztra = - ( zwork(ji,jj,jk) - zwork(ji,jj,jk+1) ) / fse3t(ji,jj,jk) 108 tra(ji,jj,jk,jp_lob_det) = tra(ji,jj,jk,jp_lob_det) + ztra 109 #if defined key_diabio 110 trbio(ji,jj,jk,jp_lob0_trd + 7) = ztra 111 #endif 112 #if defined key_diatrc 113 # if ! defined key_iomput 114 trc2d(ji,jj,jp_lob0_2d + 7) = trc2d(ji,jj,jp_lob0_2d + 7) + ztra * fse3t(ji,jj,jk) * 86400. 115 # else 116 zw2d(ji,jj) = zw2d(ji,jj) + ztra * fse3t(ji,jj,jk) * 86400. 117 # endif 118 #endif 102 DO ji = 1, jpi 103 ztra(ji,jj,jk) = - ( zwork(ji,jj,jk) - zwork(ji,jj,jk+1) ) / fse3t(ji,jj,jk) 104 tra(ji,jj,jk,jp_lob_det) = tra(ji,jj,jk,jp_lob_det) + ztra(ji,jj,jk) 119 105 END DO 120 106 END DO 121 107 END DO 122 108 123 #if defined key_diabio 124 jl = jp_lob0_trd + 7 125 CALL lbc_lnk (trbio(:,:,1,jl), 'T', 1. ) ! Lateral boundary conditions on trcbio 126 #endif 127 #if defined key_diatrc 128 # if ! defined key_iomput 129 jl = jp_lob0_2d + 7 130 CALL lbc_lnk( trc2d(:,:,jl), 'T', 1. ) ! Lateral boundary conditions on trc2d 131 # else 132 CALL lbc_lnk( zw2d(:,:), 'T', 1. ) ! Lateral boundary conditions on zw2d 133 CALL iom_put( "TDETSED", zw2d ) 134 # endif 135 #endif 109 IF( ln_diatrc ) THEN 110 DO jk = 1, jpkm1 111 DO jj = 1, jpj 112 DO ji = 1, jpi 113 zw2d(ji,jj) = zw2d(ji,jj) + ztra(ji,jj,jk) * fse3t(ji,jj,jk) * 86400. 114 END DO 115 END DO 116 END DO 117 IF( lk_iomput ) THEN 118 CALL iom_put( "TDETSED", zw2d ) 119 ELSE 120 trc2d(:,:,jp_lob0_2d + 7) = zw2d(:,:) 121 ENDIF 122 CALL wrk_dealloc( jpi, jpj, zw2d ) 123 ENDIF 136 124 ! 137 125 IF( ln_diabio ) trbio(:,:,:,jp_lob0_trd + 7) = ztra(:,:,:) 126 CALL wrk_dealloc( jpi, jpj, jpk, zwork, ztra ) 127 ! 138 128 IF( l_trdtrc ) THEN 139 129 ztrbio(:,:,:) = tra(:,:,:,jp_lob_det) - ztrbio(:,:,:) 140 130 jl = jp_lob0_trd + 7 141 131 CALL trd_mod_trc( ztrbio, jl, kt ) ! handle the trend 132 CALL wrk_dealloc( jpi, jpj, jpk, ztrbio ) 142 133 ENDIF 143 144 IF( l_trdtrc ) DEALLOCATE( ztrbio )145 134 146 135 IF(ln_ctl) THEN ! print mean trends (used for debugging) … … 149 138 CALL prt_ctl_trc(tab4d=tra, mask=tmask, clinfo=ctrcnm) 150 139 ENDIF 151 152 IF( ( wrk_not_released(3, 2) ) .OR. ( wrk_not_released(2, 1) ) ) & 153 & CALL ctl_stop('trc_sed : failed to release workspace arrays.') 154 140 ! 141 IF( nn_timing == 1 ) CALL timing_stop('trc_sed') 142 ! 155 143 END SUBROUTINE trc_sed 156 144 -
trunk/NEMOGCM/NEMO/TOP_SRC/LOBSTER/trcsms_lobster.F90
r2715 r3294 45 45 !! ** Method : - ??? 46 46 !! -------------------------------------------------------------------- 47 USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released48 USE wrk_nemo, ONLY: ztrlob => wrk_3d_1 ! used for lobster sms trends49 47 !! 50 48 INTEGER, INTENT( in ) :: kt ! ocean time-step index 49 ! 51 50 INTEGER :: jn 52 51 !! -------------------------------------------------------------------- 53 54 IF( wrk_in_use(3, 1) ) THEN 55 CALL ctl_stop('trc_sms_lobster : requested workspace array unavailable') ; RETURN 56 ENDIF 57 52 ! 53 IF( nn_timing == 1 ) CALL timing_start('trc_sms_lobster') 54 ! 58 55 CALL trc_opt( kt ) ! optical model 59 56 CALL trc_bio( kt ) ! biological model … … 62 59 63 60 IF( l_trdtrc ) THEN 64 DO jn = jp_lob0, jp_lob1 65 ztrlob(:,:,:) = tra(:,:,:,jn) 66 CALL trd_mod_trc( ztrlob, jn, jptra_trd_sms, kt ) ! save trends 67 END DO 61 DO jn = jp_lob0, jp_lob1 62 CALL trd_mod_trc( tra(:,:,:,jn), jn, jptra_trd_sms, kt ) ! save trends 63 END DO 68 64 END IF 69 65 70 66 IF( lk_trdmld_trc ) CALL trd_mld_bio( kt ) ! trends: Mixed-layer 71 72 IF( wrk_not_released(3, 1) ) CALL ctl_stop('trc_sms_lobster : failed to release workspace array.')67 ! 68 IF( nn_timing == 1 ) CALL timing_stop('trc_sms_lobster') 73 69 ! 74 70 END SUBROUTINE trc_sms_lobster -
trunk/NEMOGCM/NEMO/TOP_SRC/MY_TRC/trcsms_my_trc.F90
r2715 r3294 10 10 !! 'key_my_trc' CFC tracers 11 11 !!---------------------------------------------------------------------- 12 !! trc_sms_my_trc : MY_TRC model main routine 12 !! trc_sms_my_trc : MY_TRC model main routine 13 13 !! trc_sms_my_trc_alloc : allocate arrays specific to MY_TRC sms 14 14 !!---------------------------------------------------------------------- … … 26 26 27 27 ! Defined HERE the arrays specific to MY_TRC sms and ALLOCATE them in trc_sms_my_trc_alloc 28 28 29 29 !!---------------------------------------------------------------------- 30 30 !! NEMO/TOP 3.3 , NEMO Consortium (2010) 31 !! $Id$ 31 !! $Id$ 32 32 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 33 33 !!---------------------------------------------------------------------- … … 36 36 SUBROUTINE trc_sms_my_trc( kt ) 37 37 !!---------------------------------------------------------------------- 38 !! *** trc_sms_my_trc *** 38 !! *** trc_sms_my_trc *** 39 39 !! 40 40 !! ** Purpose : main routine of MY_TRC model 41 41 !! 42 !! ** Method : - 42 !! ** Method : - 43 43 !!---------------------------------------------------------------------- 44 USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released45 USE wrk_nemo, ONLY: ztrmyt => wrk_3d_1 ! used for lobster sms trends46 44 ! 47 45 INTEGER, INTENT(in) :: kt ! ocean time-step index 48 46 INTEGER :: jn ! dummy loop index 49 !!---------------------------------------------------------------------- 50 47 REAL(wp), POINTER, DIMENSION(:,:,:) :: ztrmyt 48 !!---------------------------------------------------------------------- 49 ! 50 IF( nn_timing == 1 ) CALL timing_start('trc_sms_my_trc') 51 ! 51 52 IF(lwp) WRITE(numout,*) 52 53 IF(lwp) WRITE(numout,*) ' trc_sms_my_trc: MY_TRC model' 53 54 IF(lwp) WRITE(numout,*) ' ~~~~~~~~~~~~~~' 55 56 IF( l_trdtrc ) CALL wrk_alloc( jpi, jpj, jpk, ztrmyt ) 54 57 55 58 WHERE( (glamt <= 170) .AND. (glamt >= 160) .AND. (gphit <= -74) .AND. (gphit >=-75.6) ) … … 59 62 END WHERE 60 63 61 WHERE( ((glamt <= -165) .OR. (glamt >= 160)) .AND. (gphit <= -76) .AND. (gphit >=-80)) 64 WHERE( ((glamt <= -165) .OR. (glamt >= 160)) .AND. (gphit <= -76) .AND. (gphit >=-80)) 62 65 trn(:,:,1,jpmyt2) = 1._wp 63 66 trb(:,:,1,jpmyt2) = 1._wp … … 70 73 CALL trd_mod_trc( ztrmyt, jn, jptra_trd_sms, kt ) ! save trends 71 74 END DO 75 CALL wrk_dealloc( jpi, jpj, jpk, ztrmyt ) 72 76 END IF 77 ! 78 IF( nn_timing == 1 ) CALL timing_stop('trc_sms_my_trc') 73 79 ! 74 80 END SUBROUTINE trc_sms_my_trc -
trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zbio.F90
r2715 r3294 14 14 !! compartments of PISCES 15 15 !!---------------------------------------------------------------------- 16 USE oce_trc ! 17 USE trc !18 USE sms_pisces ! 19 USE p4zsink ! 20 USE p4zopt ! 21 USE p4zlim ! 22 USE p4zprod ! 23 USE p4zmort ! 24 USE p4zmicro ! 25 USE p4zmeso ! 26 USE p4zrem ! 27 USE prtctl_trc 28 USE iom 16 USE oce_trc ! shared variables between ocean and passive tracers 17 USE trc ! passive tracers common variables 18 USE sms_pisces ! PISCES Source Minus Sink variables 19 USE p4zsink ! vertical flux of particulate matter due to sinking 20 USE p4zopt ! optical model 21 USE p4zlim ! Co-limitations of differents nutrients 22 USE p4zprod ! Growth rate of the 2 phyto groups 23 USE p4zmort ! Mortality terms for phytoplankton 24 USE p4zmicro ! Sources and sinks of microzooplankton 25 USE p4zmeso ! Sources and sinks of mesozooplankton 26 USE p4zrem ! Remineralisation of organic matter 27 USE prtctl_trc ! print control for debugging 28 USE iom ! I/O manager 29 29 30 30 IMPLICIT NONE … … 62 62 63 63 !!--------------------------------------------------------------------- 64 64 ! 65 IF( nn_timing == 1 ) CALL timing_start('p4z_bio') 66 ! 65 67 ! ASSIGN THE SHEAR RATE THAT IS USED FOR AGGREGATION 66 68 ! OF PHYTOPLANKTON AND DETRITUS … … 129 131 ENDIF 130 132 ! 133 IF( nn_timing == 1 ) CALL timing_stop('p4z_bio') 134 ! 131 135 END SUBROUTINE p4z_bio 132 136 -
trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zche.F90
r2715 r3294 10 10 !! - ! 2006 (R. Gangsto) modification 11 11 !! 2.0 ! 2007-12 (C. Ethe, G. Madec) F90 12 !! ! 2011-02 (J. Simeon, J.Orr ) update O2 solubility constants 12 13 !!---------------------------------------------------------------------- 13 14 #if defined key_pisces … … 17 18 !! p4z_che : Sea water chemistry computed following OCMIP protocol 18 19 !!---------------------------------------------------------------------- 19 USE oce_trc ! 20 USE trc ! 21 USE sms_pisces ! 22 USE lib_mpp ! MPP library20 USE oce_trc ! shared variables between ocean and passive tracers 21 USE trc ! passive tracers common variables 22 USE sms_pisces ! PISCES Source Minus Sink variables 23 USE lib_mpp ! MPP library 23 24 24 25 IMPLICIT NONE … … 32 33 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: chemc ! Solubilities of O2 and CO2 33 34 34 REAL(wp) :: salchl = 1._wp / 1.80655_wp ! conversion factor for salinity --> chlorinity (Wooster et al. 1969) 35 36 REAL(wp) :: akcc1 = -171.9065_wp ! coeff. for apparent solubility equilibrium 37 REAL(wp) :: akcc2 = -0.077993_wp ! Millero et al. 1995 from Mucci 1983 38 REAL(wp) :: akcc3 = 2839.319_wp ! 39 REAL(wp) :: akcc4 = 71.595_wp ! 40 REAL(wp) :: akcc5 = -0.77712_wp ! 41 REAL(wp) :: akcc6 = 0.0028426_wp ! 42 REAL(wp) :: akcc7 = 178.34_wp ! 43 REAL(wp) :: akcc8 = -0.07711_wp ! 44 REAL(wp) :: akcc9 = 0.0041249_wp ! 45 46 REAL(wp) :: rgas = 83.143_wp ! universal gas constants 47 REAL(wp) :: oxyco = 1._wp / 22.4144_wp 48 49 REAL(wp) :: bor1 = 0.00023_wp ! borat constants 50 REAL(wp) :: bor2 = 1._wp / 10.82_wp 51 52 REAL(wp) :: ca0 = -162.8301_wp 53 REAL(wp) :: ca1 = 218.2968_wp 54 REAL(wp) :: ca2 = 90.9241_wp 55 REAL(wp) :: ca3 = -1.47696_wp 56 REAL(wp) :: ca4 = 0.025695_wp 57 REAL(wp) :: ca5 = -0.025225_wp 58 REAL(wp) :: ca6 = 0.0049867_wp 59 60 REAL(wp) :: c10 = -3670.7_wp ! coeff. for 1. dissoc. of carbonic acid (Edmond and Gieskes, 1970) 61 REAL(wp) :: c11 = 62.008_wp 62 REAL(wp) :: c12 = -9.7944_wp 63 REAL(wp) :: c13 = 0.0118_wp 64 REAL(wp) :: c14 = -0.000116_wp 65 66 REAL(wp) :: & ! coeff. for 2. dissoc. of carbonic acid (Millero, 1995) 67 c20 = -1394.7 , & 68 c21 = -4.777 , & 69 c22 = 0.0184 , & 70 c23 = -0.000118 71 72 REAL(wp) :: & ! constants for calculate concentrations 73 st1 = 0.14 , & ! for sulfate (Morris & Riley 1966) 74 st2 = 1./96.062, & 75 ks0 = 141.328 , & 76 ks1 = -4276.1 , & 77 ks2 = -23.093 , & 78 ks3 = -13856. , & 79 ks4 = 324.57 , & 80 ks5 = -47.986 , & 81 ks6 = 35474. , & 82 ks7 = -771.54 , & 83 ks8 = 114.723 , & 84 ks9 = -2698. , & 85 ks10 = 1776. , & 86 ks11 = 1. , & 87 ks12 = -0.001005 88 89 REAL(wp) :: & ! constants for calculate concentrations 90 ft1 = 0.000067 , & ! fluorides (Dickson & Riley 1979 ) 91 ft2 = 1./18.9984 , & 92 kf0 = -12.641 , & 93 kf1 = 1590.2 , & 94 kf2 = 1.525 , & 95 kf3 = 1.0 , & 96 kf4 =-0.001005 97 98 REAL(wp) :: & ! coeff. for 1. dissoc. of boric acid (Dickson and Goyet, 1994) 99 cb0 = -8966.90, & 100 cb1 = -2890.53, & 101 cb2 = -77.942 , & 102 cb3 = 1.728 , & 103 cb4 = -0.0996 , & 104 cb5 = 148.0248, & 105 cb6 = 137.1942, & 106 cb7 = 1.62142 , & 107 cb8 = -24.4344, & 108 cb9 = -25.085 , & 109 cb10 = -0.2474 , & 110 cb11 = 0.053105 111 112 REAL(wp) :: & ! coeff. for dissoc. of water (Dickson and Riley, 1979 ) 113 cw0 = -13847.26 , & 114 cw1 = 148.9652 , & 115 cw2 = -23.6521 , & 116 cw3 = 118.67 , & 117 cw4 = -5.977 , & 118 cw5 = 1.0495 , & 119 cw6 = -0.01615 120 121 REAL(wp) :: & ! volumetric solubility constants for o2 in ml/l (Weiss, 1974) 122 ox0 = -58.3877 , & 123 ox1 = 85.8079 , & 124 ox2 = 23.8439 , & 125 ox3 = -0.034892 , & 126 ox4 = 0.015568 , & 127 ox5 = -0.0019387 128 129 REAL(wp), DIMENSION(5) :: & ! coeff. for seawater pressure correction 130 devk1, devk2, devk3, & ! (millero 95) 131 devk4, devk5 132 35 REAL(wp), PUBLIC :: atcox = 0.20946 ! units atm 36 37 REAL(wp) :: salchl = 1. / 1.80655 ! conversion factor for salinity --> chlorinity (Wooster et al. 1969) 38 REAL(wp) :: o2atm = 1. / ( 1000. * 0.20946 ) 39 40 REAL(wp) :: akcc1 = -171.9065 ! coeff. for apparent solubility equilibrium 41 REAL(wp) :: akcc2 = -0.077993 ! Millero et al. 1995 from Mucci 1983 42 REAL(wp) :: akcc3 = 2839.319 43 REAL(wp) :: akcc4 = 71.595 44 REAL(wp) :: akcc5 = -0.77712 45 REAL(wp) :: akcc6 = 0.00284263 46 REAL(wp) :: akcc7 = 178.34 47 REAL(wp) :: akcc8 = -0.07711 48 REAL(wp) :: akcc9 = 0.0041249 49 50 REAL(wp) :: rgas = 83.143 ! universal gas constants 51 REAL(wp) :: oxyco = 1. / 22.4144 ! converts from liters of an ideal gas to moles 52 53 REAL(wp) :: bor1 = 0.00023 ! borat constants 54 REAL(wp) :: bor2 = 1. / 10.82 55 56 REAL(wp) :: ca0 = -162.8301 ! WEISS & PRICE 1980, units mol/(kg atm) 57 REAL(wp) :: ca1 = 218.2968 58 REAL(wp) :: ca2 = 90.9241 59 REAL(wp) :: ca3 = -1.47696 60 REAL(wp) :: ca4 = 0.025695 61 REAL(wp) :: ca5 = -0.025225 62 REAL(wp) :: ca6 = 0.0049867 63 64 REAL(wp) :: c10 = -3670.7 ! Coeff. for 1. dissoc. of carbonic acid (Edmond and Gieskes, 1970) 65 REAL(wp) :: c11 = 62.008 66 REAL(wp) :: c12 = -9.7944 67 REAL(wp) :: c13 = 0.0118 68 REAL(wp) :: c14 = -0.000116 69 70 REAL(wp) :: c20 = -1394.7 ! coeff. for 2. dissoc. of carbonic acid (Millero, 1995) 71 REAL(wp) :: c21 = -4.777 72 REAL(wp) :: c22 = 0.0184 73 REAL(wp) :: c23 = -0.000118 74 75 REAL(wp) :: st1 = 0.14 ! constants for calculate concentrations for sulfate 76 REAL(wp) :: st2 = 1./96.062 ! (Morris & Riley 1966) 77 REAL(wp) :: ks0 = 141.328 78 REAL(wp) :: ks1 = -4276.1 79 REAL(wp) :: ks2 = -23.093 80 REAL(wp) :: ks3 = -13856. 81 REAL(wp) :: ks4 = 324.57 82 REAL(wp) :: ks5 = -47.986 83 REAL(wp) :: ks6 = 35474. 84 REAL(wp) :: ks7 = -771.54 85 REAL(wp) :: ks8 = 114.723 86 REAL(wp) :: ks9 = -2698. 87 REAL(wp) :: ks10 = 1776. 88 REAL(wp) :: ks11 = 1. 89 REAL(wp) :: ks12 = -0.001005 90 91 REAL(wp) :: ft1 = 0.000067 ! constants for calculate concentrations for fluorides 92 REAL(wp) :: ft2 = 1./18.9984 ! (Dickson & Riley 1979 ) 93 REAL(wp) :: kf0 = -12.641 94 REAL(wp) :: kf1 = 1590.2 95 REAL(wp) :: kf2 = 1.525 96 REAL(wp) :: kf3 = 1.0 97 REAL(wp) :: kf4 = -0.001005 98 99 REAL(wp) :: cb0 = -8966.90 ! Coeff. for 1. dissoc. of boric acid 100 REAL(wp) :: cb1 = -2890.53 ! (Dickson and Goyet, 1994) 101 REAL(wp) :: cb2 = -77.942 102 REAL(wp) :: cb3 = 1.728 103 REAL(wp) :: cb4 = -0.0996 104 REAL(wp) :: cb5 = 148.0248 105 REAL(wp) :: cb6 = 137.1942 106 REAL(wp) :: cb7 = 1.62142 107 REAL(wp) :: cb8 = -24.4344 108 REAL(wp) :: cb9 = -25.085 109 REAL(wp) :: cb10 = -0.2474 110 REAL(wp) :: cb11 = 0.053105 111 112 REAL(wp) :: cw0 = -13847.26 ! Coeff. for dissoc. of water (Dickson and Riley, 1979 ) 113 REAL(wp) :: cw1 = 148.9652 114 REAL(wp) :: cw2 = -23.6521 115 REAL(wp) :: cw3 = 118.67 116 REAL(wp) :: cw4 = -5.977 117 REAL(wp) :: cw5 = 1.0495 118 REAL(wp) :: cw6 = -0.01615 119 120 ! ! volumetric solubility constants for o2 in ml/L 121 REAL(wp) :: ox0 = 2.00856 ! from Table 1 for Eq 8 of Garcia and Gordon, 1992. 122 REAL(wp) :: ox1 = 3.22400 ! corrects for moisture and fugacity, but not total atmospheric pressure 123 REAL(wp) :: ox2 = 3.99063 ! Original PISCES code noted this was a solubility, but 124 REAL(wp) :: ox3 = 4.80299 ! was in fact a bunsen coefficient with units L-O2/(Lsw atm-O2) 125 REAL(wp) :: ox4 = 9.78188e-1 ! Hence, need to divide EXP( zoxy ) by 1000, ml-O2 => L-O2 126 REAL(wp) :: ox5 = 1.71069 ! and atcox = 0.20946 to add the 1/atm dimension. 127 REAL(wp) :: ox6 = -6.24097e-3 128 REAL(wp) :: ox7 = -6.93498e-3 129 REAL(wp) :: ox8 = -6.90358e-3 130 REAL(wp) :: ox9 = -4.29155e-3 131 REAL(wp) :: ox10 = -3.11680e-7 132 133 REAL(wp), DIMENSION(5) :: devk1, devk2, devk3, devk4, devk5 ! coeff. for seawater pressure correction 134 ! ! (millero 95) 133 135 DATA devk1 / -25.5 , -15.82 , -29.48 , -25.60 , -48.76 / 134 136 DATA devk2 / 0.1271 , -0.0219 , 0.1622 , 0.2324 , 0.5304 / … … 155 157 !!--------------------------------------------------------------------- 156 158 INTEGER :: ji, jj, jk 157 REAL(wp) :: ztkel, zsal , zqtt , zbuf1 , zbuf2 159 REAL(wp) :: ztkel, zt , zt2 , zsal , zsal2 , zbuf1 , zbuf2 160 REAL(wp) :: ztgg , ztgg2, ztgg3 , ztgg4 , ztgg5 158 161 REAL(wp) :: zpres, ztc , zcl , zcpexp, zoxy , zcpexp2 159 162 REAL(wp) :: zsqrt, ztr , zlogt , zcek1 160 REAL(wp) :: z lqtt, zqtt2, zsal15, zis , zis2, zisqrt163 REAL(wp) :: zis , zis2 , zsal15, zisqrt 161 164 REAL(wp) :: zckb , zck1 , zck2 , zckw , zak1 , zak2 , zakb , zaksp0, zakw 162 165 REAL(wp) :: zst , zft , zcks , zckf , zaksp1 163 166 !!--------------------------------------------------------------------- 164 167 ! 168 IF( nn_timing == 1 ) CALL timing_start('p4z_che') 169 ! 165 170 ! CHEMICAL CONSTANTS - SURFACE LAYER 166 171 ! ---------------------------------- … … 171 176 ! ! SET ABSOLUTE TEMPERATURE 172 177 ztkel = tsn(ji,jj,1,jp_tem) + 273.16 173 z qtt= ztkel * 0.01174 z qtt2 = zqtt * zqtt175 zsal = tsn(ji,jj,1,jp_sal) + ( 1.- tmask(ji,jj,1) ) * 35.176 z lqtt = LOG( zqtt )177 178 zt = ztkel * 0.01 179 zt2 = zt * zt 180 zsal = tsn(ji,jj,1,jp_sal) + ( 1.- tmask(ji,jj,1) ) * 35. 181 zsal2 = zsal * zsal 182 zlogt = LOG( zt ) 178 183 ! ! LN(K0) OF SOLUBILITY OF CO2 (EQ. 12, WEISS, 1980) 179 184 ! ! AND FOR THE ATMOSPHERE FOR NON IDEAL GAS 180 zcek1 = ca0 + ca1 / zqtt + ca2 * zlqtt + ca3 * zqtt2 + zsal*( ca4 + ca5 * zqtt + ca6 * zqtt2 ) 181 182 ! ! LN(K0) OF SOLUBILITY OF O2 and N2 (EQ. 4, WEISS, 1970) 183 zoxy = ox0 + ox1 / zqtt + ox2 * zlqtt + zsal * ( ox3 + ox4 * zqtt + ox5 * zqtt2 ) 184 185 ! ! SET SOLUBILITIES OF O2 AND CO2 186 chemc(ji,jj,1) = EXP( zcek1 ) * 1.e-6 * rhop(ji,jj,1) / 1000. 187 chemc(ji,jj,2) = EXP( zoxy ) * oxyco 188 185 zcek1 = ca0 + ca1 / zt + ca2 * zlogt + ca3 * zt2 + zsal * ( ca4 + ca5 * zt + ca6 * zt2 ) 186 ! ! LN(K0) OF SOLUBILITY OF O2 and N2 in ml/L (EQ. 8, GARCIA AND GORDON, 1992) 187 ztgg = LOG( ( 298.15 - tsn(ji,jj,1,jp_tem) ) / ztkel ) ! Set the GORDON & GARCIA scaled temperature 188 ztgg2 = ztgg * ztgg 189 ztgg3 = ztgg2 * ztgg 190 ztgg4 = ztgg3 * ztgg 191 ztgg5 = ztgg4 * ztgg 192 zoxy = ox0 + ox1 * ztgg + ox2 * ztgg2 + ox3 * ztgg3 + ox4 * ztgg4 + ox5 * ztgg5 & 193 + zsal * ( ox6 + ox7 * ztgg + ox8 * ztgg2 + ox9 * ztgg3 ) + ox10 * zsal2 194 195 ! ! SET SOLUBILITIES OF O2 AND CO2 196 chemc(ji,jj,1) = EXP( zcek1 ) * 1.e-6 * rhop(ji,jj,1) / 1000. ! mol/(L uatm) 197 chemc(ji,jj,2) = ( EXP( zoxy ) * o2atm ) * oxyco ! mol/(L atm) 198 ! 189 199 END DO 190 200 END DO … … 204 214 ! SET ABSOLUTE TEMPERATURE 205 215 ztkel = tsn(ji,jj,jk,jp_tem) + 273.16 206 zqtt = ztkel * 0.01207 216 zsal = tsn(ji,jj,jk,jp_sal) + ( 1.-tmask(ji,jj,jk) ) * 35. 208 217 zsqrt = SQRT( zsal ) … … 311 320 END DO 312 321 ! 322 IF( nn_timing == 1 ) CALL timing_stop('p4z_che') 323 ! 313 324 END SUBROUTINE p4z_che 314 325 -
trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zflx.F90
r2715 r3294 9 9 !! 1.0 ! 2004 (O. Aumont) modifications 10 10 !! 2.0 ! 2007-12 (C. Ethe, G. Madec) F90 11 !! ! 2011-02 (J. Simeon, J. Orr) Include total atm P correction 11 12 !!---------------------------------------------------------------------- 12 13 #if defined key_pisces … … 16 17 !! p4z_flx : CALCULATES GAS EXCHANGE AND CHEMISTRY AT SEA SURFACE 17 18 !! p4z_flx_init : Read the namelist 18 !!---------------------------------------------------------------------- 19 USE trc 20 USE oce_trc ! 21 USE trc 22 USE sms_pisces 23 USE prtctl_trc 24 USE p4zche 25 USE iom 19 !! p4z_patm : Read sfc atm pressure [atm] for each grid cell 20 !!---------------------------------------------------------------------- 21 USE oce_trc ! shared variables between ocean and passive tracers 22 USE trc ! passive tracers common variables 23 USE sms_pisces ! PISCES Source Minus Sink variables 24 USE p4zche ! Chemical model 25 USE prtctl_trc ! print control for debugging 26 USE iom ! I/O manager 27 USE fldread ! read input fields 26 28 #if defined key_cpl_carbon_cycle 27 USE sbc_oce , ONLY : atm_co229 USE sbc_oce, ONLY : atm_co2 ! atmospheric pCO2 28 30 #endif 29 31 … … 35 37 PUBLIC p4z_flx_alloc 36 38 39 ! !!** Namelist nampisext ** 40 REAL(wp) :: atcco2 = 278._wp !: pre-industrial atmospheric [co2] (ppm) 41 LOGICAL :: ln_co2int = .FALSE. !: flag to read in a file and interpolate atmospheric pco2 or not 42 CHARACTER(len=34) :: clname = 'atcco2.txt' !: filename of pco2 values 43 INTEGER :: nn_offset = 0 !: Offset model-data start year (default = 0) 44 45 !! Variables related to reading atmospheric CO2 time history 46 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:) :: atcco2h, years 47 INTEGER :: nmaxrec, numco2 48 49 ! !!* nampisatm namelist (Atmospheric PRessure) * 50 LOGICAL, PUBLIC :: ln_presatm = .true. !: ref. pressure: global mean Patm (F) or a constant (F) 51 52 REAL(wp) , ALLOCATABLE, SAVE, DIMENSION(:,:) :: patm ! atmospheric pressure at kt [N/m2] 53 TYPE(FLD), ALLOCATABLE, DIMENSION(:) :: sf_patm ! structure of input fields (file informations, fields read) 54 55 37 56 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: oce_co2 !: ocean carbon flux 38 57 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: satmco2 !: atmospheric pco2 … … 41 60 REAL(wp) :: t_atm_co2_flx !: global mean of atmospheric pco2 42 61 REAL(wp) :: area !: ocean surface 43 REAL(wp) :: atcco2 = 278._wp !: pre-industrial atmospheric [co2] (ppm)44 REAL(wp) :: atcox = 0.20946_wp !:45 62 REAL(wp) :: xconv = 0.01_wp / 3600._wp !: coefficients for conversion 46 63 … … 60 77 !! ** Purpose : CALCULATES GAS EXCHANGE AND CHEMISTRY AT SEA SURFACE 61 78 !! 62 !! ** Method : - ??? 79 !! ** Method : 80 !! - Include total atm P correction via Esbensen & Kushnir (1981) 81 !! - Pressure correction NOT done for key_cpl_carbon_cycle 82 !! - Remove Wanninkhof chemical enhancement; 83 !! - Add option for time-interpolation of atcco2.txt 63 84 !!--------------------------------------------------------------------- 64 USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released65 USE wrk_nemo, ONLY: zkgco2 => wrk_2d_1 , zkgo2 => wrk_2d_2 , zh2co3 => wrk_2d_366 USE wrk_nemo, ONLY: zoflx => wrk_2d_4 , zkg => wrk_2d_567 USE wrk_nemo, ONLY: zdpco2 => wrk_2d_6 , zdpo2 => wrk_2d_768 85 ! 69 86 INTEGER, INTENT(in) :: kt ! 70 87 ! 71 INTEGER :: ji, jj, j rorr88 INTEGER :: ji, jj, jm, iind, iindm1 72 89 REAL(wp) :: ztc, ztc2, ztc3, zws, zkgwan 73 90 REAL(wp) :: zfld, zflu, zfld16, zflu16, zfact 74 91 REAL(wp) :: zph, zah2, zbot, zdic, zalk, zsch_o2, zalka, zsch_co2 92 REAL(wp) :: zyr_dec, zdco2dt 75 93 CHARACTER (len=25) :: charout 94 REAL(wp), POINTER, DIMENSION(:,:) :: zkgco2, zkgo2, zh2co3, zoflx 76 95 !!--------------------------------------------------------------------- 77 78 IF( wrk_in_use(2, 1,2,3,4,5,6,7) ) THEN 79 CALL ctl_stop('p4z_flx: requested workspace arrays unavailable') ; RETURN 80 ENDIF 96 ! 97 IF( nn_timing == 1 ) CALL timing_start('p4z_flx') 98 ! 99 CALL wrk_alloc( jpi, jpj, zkgco2, zkgo2, zh2co3, zoflx ) 100 ! 81 101 82 102 ! SURFACE CHEMISTRY (PCO2 AND [H+] IN … … 84 104 ! IS USED TO COMPUTE AIR-SEA FLUX OF CO2 85 105 106 IF( kt /= nit000 ) CALL p4z_patm( kt ) ! Get sea-level pressure (E&K [1981] climatology) for use in flux calcs 107 108 IF( ln_co2int ) THEN 109 ! Linear temporal interpolation of atmospheric pco2. atcco2.txt has annual values. 110 ! Caveats: First column of .txt must be in years, decimal years preferably. 111 ! For nn_offset, if your model year is iyy, nn_offset=(years(1)-iyy) 112 ! then the first atmospheric CO2 record read is at years(1) 113 zyr_dec = REAL( nyear + nn_offset, wp ) + REAL( nday_year, wp ) / REAL( nyear_len(1), wp ) 114 jm = 2 115 DO WHILE( jm <= nmaxrec .AND. years(jm-1) < zyr_dec .AND. years(jm) >= zyr_dec ) ; jm = jm + 1 ; END DO 116 iind = jm ; iindm1 = jm - 1 117 zdco2dt = ( atcco2h(iind) - atcco2h(iindm1) ) / ( years(iind) - years(iindm1) + rtrn ) 118 atcco2 = zdco2dt * ( zyr_dec - years(iindm1) ) + atcco2h(iindm1) 119 satmco2(:,:) = atcco2 120 ENDIF 121 86 122 #if defined key_cpl_carbon_cycle 87 123 satmco2(:,:) = atm_co2(:,:) 88 124 #endif 89 125 90 DO jrorr = 1, 10 91 126 DO jm = 1, 10 92 127 !CDIR NOVERRCHK 93 128 DO jj = 1, jpj … … 137 172 ! Compute the piston velocity for O2 and CO2 138 173 zkgwan = 0.3 * zws + 2.5 * ( 0.5246 + 0.016256 * ztc + 0.00049946 * ztc2 ) 174 zkgwan = zkgwan * xconv * ( 1.- fr_i(ji,jj) ) * tmask(ji,jj,1) 139 175 # if defined key_degrad 140 zkgwan = zkgwan * xconv * ( 1.- fr_i(ji,jj) ) * tmask(ji,jj,1) * facvol(ji,jj,1) 141 #else 142 zkgwan = zkgwan * xconv * ( 1.- fr_i(ji,jj) ) * tmask(ji,jj,1) 176 zkgwan = zkgwan * facvol(ji,jj,1) 143 177 #endif 144 178 ! compute gas exchange for CO2 and O2 … … 151 185 DO ji = 1, jpi 152 186 ! Compute CO2 flux for the sea and air 153 zfld = satmco2(ji,jj) * tmask(ji,jj,1) * chemc(ji,jj,1) * zkgco2(ji,jj)154 zflu = zh2co3(ji,jj) * tmask(ji,jj,1) * zkgco2(ji,jj) 187 zfld = satmco2(ji,jj) * patm(ji,jj) * tmask(ji,jj,1) * chemc(ji,jj,1) * zkgco2(ji,jj) ! (mol/L) * (m/s) 188 zflu = zh2co3(ji,jj) * tmask(ji,jj,1) * zkgco2(ji,jj) ! (mol/L) (m/s) ? 155 189 oce_co2(ji,jj) = ( zfld - zflu ) * rfact * e1e2t(ji,jj) * tmask(ji,jj,1) * 1000. 156 190 ! compute the trend … … 158 192 159 193 ! Compute O2 flux 160 zfld16 = atcox * chemc(ji,jj,2) * tmask(ji,jj,1) * zkgo2(ji,jj)194 zfld16 = atcox * patm(ji,jj) * chemc(ji,jj,2) * tmask(ji,jj,1) * zkgo2(ji,jj) ! (mol/L) * (m/s) 161 195 zflu16 = trn(ji,jj,1,jpoxy) * tmask(ji,jj,1) * zkgo2(ji,jj) 162 tra(ji,jj,1,jpoxy) = tra(ji,jj,1,jpoxy) + ( zfld16 - zflu16 ) / fse3t(ji,jj,1) 163 164 #if defined key_diatrc 165 ! Save diagnostics 166 # if ! defined key_iomput 167 zfact = 1. / e1e2t(ji,jj) / rfact 168 trc2d(ji,jj,jp_pcs0_2d ) = oce_co2(ji,jj) * zfact 169 trc2d(ji,jj,jp_pcs0_2d + 1) = ( zfld16 - zflu16 ) * 1000. * tmask(ji,jj,1) 170 trc2d(ji,jj,jp_pcs0_2d + 2) = zkgco2(ji,jj) * tmask(ji,jj,1) 171 trc2d(ji,jj,jp_pcs0_2d + 3) = ( satmco2(ji,jj) - zh2co3(ji,jj) / ( chemc(ji,jj,1) + rtrn ) ) & 172 & * tmask(ji,jj,1) 173 # else 174 zoflx(ji,jj) = ( zfld16 - zflu16 ) * 1000. * tmask(ji,jj,1) 175 zkg (ji,jj) = zkgco2(ji,jj) * tmask(ji,jj,1) 176 zdpco2(ji,jj) = ( satmco2(ji,jj) - zh2co3(ji,jj) / ( chemc(ji,jj,1) + rtrn ) ) * tmask(ji,jj,1) 177 zdpo2 (ji,jj) = ( atcox - trn(ji,jj,1,jpoxy) / ( chemc(ji,jj,2) + rtrn ) ) * tmask(ji,jj,1) 178 # endif 179 #endif 196 zoflx(ji,jj) = zfld16 - zflu16 197 tra(ji,jj,1,jpoxy) = tra(ji,jj,1,jpoxy) + zoflx(ji,jj) / fse3t(ji,jj,1) 180 198 END DO 181 199 END DO 182 200 183 t_oce_co2_flx = t_oce_co2_flx + glob_sum( oce_co2(:,:) ) 201 t_oce_co2_flx = t_oce_co2_flx + glob_sum( oce_co2(:,:) ) ! Cumulative Total Flux of Carbon 184 202 IF( kt == nitend ) THEN 185 t_atm_co2_flx = glob_sum( satmco2(:,:) * e1e2t(:,:) ) ! Total atmospheric pCO2186 ! 187 t_oce_co2_flx = (-1.) * t_oce_co2_flx * 12. / 1.e15 188 t_atm_co2_flx = t_atm_co2_flx / area 203 t_atm_co2_flx = glob_sum( satmco2(:,:) * patm(:,:) * e1e2t(:,:) ) ! Total atmospheric pCO2 204 ! 205 t_oce_co2_flx = (-1.) * t_oce_co2_flx * 12. / 1.e15 ! Conversion in PgC ; negative for out of the ocean 206 t_atm_co2_flx = t_atm_co2_flx / area ! global mean of atmospheric pCO2 189 207 ! 190 208 IF( lwp) THEN … … 205 223 ENDIF 206 224 207 # if defined key_diatrc && defined key_iomput 208 CALL iom_put( "Cflx" , oce_co2(:,:) / e1e2t(:,:) / rfact ) 209 CALL iom_put( "Oflx" , zoflx ) 210 CALL iom_put( "Kg" , zkg ) 211 CALL iom_put( "Dpco2", zdpco2 ) 212 CALL iom_put( "Dpo2" , zdpo2 ) 213 #endif 214 ! 215 IF( wrk_not_released(2, 1,2,3,4,5,6,7) ) CALL ctl_stop('p4z_flx: failed to release workspace arrays') 225 IF( ln_diatrc ) THEN 226 IF( lk_iomput ) THEN 227 CALL iom_put( "Cflx" , oce_co2(:,:) / e1e2t(:,:) / rfact ) 228 CALL iom_put( "Oflx" , zoflx(:,:) * 1000 * tmask(:,:,1) ) 229 CALL iom_put( "Kg" , zkgco2(:,:) * tmask(:,:,1) ) 230 CALL iom_put( "Dpco2", ( satmco2(:,:) * patm(:,:) - zh2co3(:,:) / ( chemc(:,:,1) + rtrn ) ) * tmask(:,:,1) ) 231 CALL iom_put( "Dpo2" , ( atcox * patm(:,:) - trn(:,:,1,jpoxy) / ( chemc(:,:,2) + rtrn ) ) * tmask(:,:,1) ) 232 ELSE 233 trc2d(:,:,jp_pcs0_2d ) = oce_co2(:,:) / e1e2t(:,:) / rfact 234 trc2d(:,:,jp_pcs0_2d + 1) = zoflx(:,:) * 1000 * tmask(:,:,1) 235 trc2d(:,:,jp_pcs0_2d + 2) = zkgco2(:,:) * tmask(:,:,1) 236 trc2d(:,:,jp_pcs0_2d + 3) = ( satmco2(:,:) * patm(:,:) - zh2co3(:,:) / ( chemc(:,:,1) + rtrn ) ) * tmask(:,:,1) 237 ENDIF 238 ENDIF 239 ! 240 CALL wrk_dealloc( jpi, jpj, zkgco2, zkgo2, zh2co3, zoflx ) 241 ! 242 IF( nn_timing == 1 ) CALL timing_stop('p4z_flx') 216 243 ! 217 244 END SUBROUTINE p4z_flx … … 225 252 !! 226 253 !! ** Method : Read the nampisext namelist and check the parameters 227 !! called at the first timestep (nit 000)254 !! called at the first timestep (nittrc000) 228 255 !! ** input : Namelist nampisext 229 256 !!---------------------------------------------------------------------- 230 NAMELIST/nampisext/ atcco2 231 !!---------------------------------------------------------------------- 232 ! 233 REWIND( numnat ) ! read numnat 234 READ ( numnat, nampisext ) 257 NAMELIST/nampisext/ln_co2int, atcco2, clname, nn_offset 258 INTEGER :: jm 259 !!---------------------------------------------------------------------- 260 ! 261 REWIND( numnatp ) ! read numnatp 262 READ ( numnatp, nampisext ) 235 263 ! 236 264 IF(lwp) THEN ! control print … … 238 266 WRITE(numout,*) ' Namelist parameters for air-sea exchange, nampisext' 239 267 WRITE(numout,*) ' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~' 240 WRITE(numout,*) ' Atmospheric pCO2 atcco2 =', atcco2 268 WRITE(numout,*) ' Choice for reading in the atm pCO2 file or constant value, ln_co2int =', ln_co2int 269 WRITE(numout,*) ' ' 270 ENDIF 271 IF( .NOT.ln_co2int ) THEN 272 IF(lwp) THEN ! control print 273 WRITE(numout,*) ' Constant Atmospheric pCO2 value atcco2 =', atcco2 274 WRITE(numout,*) ' ' 275 ENDIF 276 satmco2(:,:) = atcco2 ! Initialisation of atmospheric pco2 277 ELSE 278 IF(lwp) THEN 279 WRITE(numout,*) ' Atmospheric pCO2 value from file clname =', TRIM( clname ) 280 WRITE(numout,*) ' Offset model-data start year nn_offset =', nn_offset 281 WRITE(numout,*) ' ' 282 ENDIF 283 CALL ctl_opn( numco2, TRIM( clname) , 'OLD', 'FORMATTED', 'SEQUENTIAL', -1 , numout, lwp ) 284 jm = 0 ! Count the number of record in co2 file 285 DO 286 READ(numco2,*,END=100) 287 jm = jm + 1 288 END DO 289 100 nmaxrec = jm - 1 290 ALLOCATE( years (nmaxrec) ) ; years (:) = 0._wp 291 ALLOCATE( atcco2h(nmaxrec) ) ; atcco2h(:) = 0._wp 292 293 REWIND(numco2) 294 DO jm = 1, nmaxrec ! get xCO2 data 295 READ(numco2, *) years(jm), atcco2h(jm) 296 IF(lwp) WRITE(numout, '(f6.0,f7.2)') years(jm), atcco2h(jm) 297 END DO 298 CLOSE(numco2) 241 299 ENDIF 242 300 ! … … 245 303 oce_co2(:,:) = 0._wp ! Initialization of Flux of Carbon 246 304 t_atm_co2_flx = 0._wp 247 !248 satmco2(:,:) = atcco2 ! Initialisation of atmospheric pco2249 305 t_oce_co2_flx = 0._wp 250 306 ! 307 CALL p4z_patm( nit000 ) 308 ! 251 309 END SUBROUTINE p4z_flx_init 252 310 311 SUBROUTINE p4z_patm( kt ) 312 313 !!---------------------------------------------------------------------- 314 !! *** ROUTINE p4z_atm *** 315 !! 316 !! ** Purpose : Read and interpolate the external atmospheric sea-levl pressure 317 !! ** Method : Read the files and interpolate the appropriate variables 318 !! 319 !!---------------------------------------------------------------------- 320 !! * arguments 321 INTEGER, INTENT( in ) :: kt ! ocean time step 322 ! 323 INTEGER :: ierr 324 CHARACTER(len=100) :: cn_dir ! Root directory for location of ssr files 325 TYPE(FLD_N) :: sn_patm ! informations about the fields to be read 326 !! 327 NAMELIST/nampisatm/ ln_presatm, sn_patm, cn_dir 328 329 ! ! -------------------- ! 330 IF( kt == nit000 ) THEN ! First call kt=nittrc000 ! 331 ! ! -------------------- ! 332 ! !* set file information (default values) 333 ! ... default values (NB: frequency positive => hours, negative => months) 334 ! ! file ! frequency ! variable ! time intep ! clim ! 'yearly' or ! weights ! rotation ! 335 ! ! name ! (hours) ! name ! (T/F) ! (T/F) ! 'monthly' ! filename ! pairs ! 336 sn_patm = FLD_N( 'pres' , 24 , 'patm' , .false. , .true. , 'yearly' , '' , '' ) 337 cn_dir = './' ! directory in which the Patm data are 338 339 REWIND( numnatp ) !* read in namlist nampisatm 340 READ ( numnatp, nampisatm ) 341 ! 342 ! 343 IF(lwp) THEN !* control print 344 WRITE(numout,*) 345 WRITE(numout,*) ' Namelist nampisatm : Atmospheric Pressure as external forcing' 346 WRITE(numout,*) ' constant atmopsheric pressure (F) or from a file (T) ln_presatm = ', ln_presatm 347 WRITE(numout,*) 348 ENDIF 349 ! 350 IF( ln_presatm ) THEN 351 ALLOCATE( sf_patm(1), STAT=ierr ) !* allocate and fill sf_patm (forcing structure) with sn_patm 352 IF( ierr > 0 ) CALL ctl_stop( 'STOP', 'p4z_flx: unable to allocate sf_patm structure' ) 353 ! 354 CALL fld_fill( sf_patm, (/ sn_patm /), cn_dir, 'p4z_flx', 'Atmospheric pressure ', 'nampisatm' ) 355 ALLOCATE( sf_patm(1)%fnow(jpi,jpj,1) ) 356 IF( sn_patm%ln_tint ) ALLOCATE( sf_patm(1)%fdta(jpi,jpj,1,2) ) 357 ENDIF 358 ! 359 IF( .NOT.ln_presatm ) patm(:,:) = 1.e0 ! Initialize patm if no reading from a file 360 ! 361 ENDIF 362 ! 363 IF( ln_presatm ) THEN 364 CALL fld_read( kt, 1, sf_patm ) !* input Patm provided at kt + 1/2 365 patm(:,:) = sf_patm(1)%fnow(:,:,1) ! atmospheric pressure 366 ENDIF 367 ! 368 END SUBROUTINE p4z_patm 253 369 254 370 INTEGER FUNCTION p4z_flx_alloc() … … 256 372 !! *** ROUTINE p4z_flx_alloc *** 257 373 !!---------------------------------------------------------------------- 258 ALLOCATE( oce_co2(jpi,jpj), satmco2(jpi,jpj), STAT=p4z_flx_alloc )374 ALLOCATE( oce_co2(jpi,jpj), satmco2(jpi,jpj), patm(jpi,jpj), STAT=p4z_flx_alloc ) 259 375 ! 260 376 IF( p4z_flx_alloc /= 0 ) CALL ctl_warn('p4z_flx_alloc : failed to allocate arrays') -
trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zint.F90
r2715 r3294 13 13 !! p4z_int : interpolation and computation of various accessory fields 14 14 !!---------------------------------------------------------------------- 15 USE oce_trc ! 16 USE trc 17 USE sms_pisces 15 USE oce_trc ! shared variables between ocean and passive tracers 16 USE trc ! passive tracers common variables 17 USE sms_pisces ! PISCES Source Minus Sink variables 18 18 19 19 IMPLICIT NONE … … 21 21 22 22 PUBLIC p4z_int 23 PUBLIC p4z_int_alloc24 25 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: tgfunc !: Temp. dependancy of various biological rates26 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: tgfunc2 !: Temp. dependancy of mesozooplankton rates27 28 23 REAL(wp) :: xksilim = 16.5e-6_wp ! Half-saturation constant for the Si half-saturation constant computation 29 24 … … 41 36 !! ** Purpose : interpolation and computation of various accessory fields 42 37 !! 43 !! ** Method : - ???44 38 !!--------------------------------------------------------------------- 45 INTEGER :: ji, jj 46 REAL(wp) :: z dum39 INTEGER :: ji, jj ! dummy loop indices 40 REAL(wp) :: zvar ! local variable 47 41 !!--------------------------------------------------------------------- 48 42 ! 43 IF( nn_timing == 1 ) CALL timing_start('p4z_int') 44 ! 49 45 ! Computation of phyto and zoo metabolic rate 50 46 ! ------------------------------------------- … … 57 53 DO ji = 1, jpi 58 54 DO jj = 1, jpj 59 z dum= trn(ji,jj,1,jpsil) * trn(ji,jj,1,jpsil)60 xksimax(ji,jj) = MAX( xksimax(ji,jj), ( 1.+ 7.* z dum / ( xksilim * xksilim + zdum) ) * 1e-6 )55 zvar = trn(ji,jj,1,jpsil) * trn(ji,jj,1,jpsil) 56 xksimax(ji,jj) = MAX( xksimax(ji,jj), ( 1.+ 7.* zvar / ( xksilim * xksilim + zvar ) ) * 1e-6 ) 61 57 END DO 62 58 END DO … … 67 63 ENDIF 68 64 ! 65 IF( nn_timing == 1 ) CALL timing_stop('p4z_int') 66 ! 69 67 END SUBROUTINE p4z_int 70 71 72 INTEGER FUNCTION p4z_int_alloc()73 !!----------------------------------------------------------------------74 !! *** ROUTINE p4z_int_alloc ***75 !!----------------------------------------------------------------------76 ALLOCATE( tgfunc(jpi,jpj,jpk), tgfunc2(jpi,jpj,jpk), STAT=p4z_int_alloc )77 !78 IF( p4z_int_alloc /= 0 ) CALL ctl_warn('p4z_int_alloc : failed to allocate arrays.')79 !80 END FUNCTION p4z_int_alloc81 68 82 69 #else -
trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zlim.F90
r2528 r3294 6 6 !! History : 1.0 ! 2004 (O. Aumont) Original code 7 7 !! 2.0 ! 2007-12 (C. Ethe, G. Madec) F90 8 !! 3.4 ! 2011-04 (O. Aumont, C. Ethe) Limitation for iron modelled in quota 8 9 !!---------------------------------------------------------------------- 9 10 #if defined key_pisces … … 14 15 !! p4z_lim_init : Read the namelist 15 16 !!---------------------------------------------------------------------- 16 USE trc17 USE oce_trc !18 USE trc !19 USE sms_pisces !17 USE oce_trc ! Shared ocean-passive tracers variables 18 USE trc ! Tracers defined 19 USE sms_pisces ! PISCES variables 20 USE p4zopt ! Optical 20 21 21 22 IMPLICIT NONE … … 26 27 27 28 !! * Shared module variables 28 REAL(wp), PUBLIC :: & 29 conc0 = 2.e-6_wp , & !: 30 conc1 = 10.e-6_wp , & !: 31 conc2 = 2.e-11_wp , & !: 32 conc2m = 8.E-11_wp , & !: 33 conc3 = 1.e-10_wp , & !: 34 conc3m = 4.e-10_wp , & !: 35 concnnh4 = 1.e-7_wp , & !: 36 concdnh4 = 5.e-7_wp , & !: 37 xksi1 = 2.E-6_wp , & !: 38 xksi2 = 3.33E-6_wp , & !: 39 xkdoc = 417.E-6_wp , & !: 40 caco3r = 0.3_wp !: 41 42 29 REAL(wp), PUBLIC :: conc0 = 2.e-6_wp !: NO3, PO4 half saturation 30 REAL(wp), PUBLIC :: conc1 = 8.e-6_wp !: Phosphate half saturation for diatoms 31 REAL(wp), PUBLIC :: conc2 = 1.e-9_wp !: Iron half saturation for nanophyto 32 REAL(wp), PUBLIC :: conc2m = 3.e-9_wp !: Max iron half saturation for nanophyto 33 REAL(wp), PUBLIC :: conc3 = 2.e-9_wp !: Iron half saturation for diatoms 34 REAL(wp), PUBLIC :: conc3m = 8.e-9_wp !: Max iron half saturation for diatoms 35 REAL(wp), PUBLIC :: xsizedia = 5.e-7_wp !: Minimum size criteria for diatoms 36 REAL(wp), PUBLIC :: xsizephy = 1.e-6_wp !: Minimum size criteria for nanophyto 37 REAL(wp), PUBLIC :: concnnh4 = 1.e-7_wp !: NH4 half saturation for phyto 38 REAL(wp), PUBLIC :: concdnh4 = 4.e-7_wp !: NH4 half saturation for diatoms 39 REAL(wp), PUBLIC :: xksi1 = 2.E-6_wp !: half saturation constant for Si uptake 40 REAL(wp), PUBLIC :: xksi2 = 3.33e-6_wp !: half saturation constant for Si/C 41 REAL(wp), PUBLIC :: xkdoc = 417.e-6_wp !: 2nd half-sat. of DOC remineralization 42 REAL(wp), PUBLIC :: concfebac = 1.E-11_wp !: Fe half saturation for bacteria 43 REAL(wp), PUBLIC :: qnfelim = 7.E-6_wp !: optimal Fe quota for nanophyto 44 REAL(wp), PUBLIC :: qdfelim = 7.E-6_wp !: optimal Fe quota for diatoms 45 REAL(wp), PUBLIC :: caco3r = 0.16_wp !: mean rainratio 46 47 ! Coefficient for iron limitation 48 REAL(wp) :: xcoef1 = 0.0016 / 55.85 49 REAL(wp) :: xcoef2 = 1.21E-5 * 14. / 55.85 / 7.625 * 0.5 * 1.5 50 REAL(wp) :: xcoef3 = 1.15E-4 * 14. / 55.85 / 7.625 * 0.5 43 51 !!* Substitution 44 52 # include "top_substitute.h90" … … 60 68 !! ** Method : - ??? 61 69 !!--------------------------------------------------------------------- 70 ! 62 71 INTEGER, INTENT(in) :: kt 72 ! 63 73 INTEGER :: ji, jj, jk 64 74 REAL(wp) :: zlim1, zlim2, zlim3, zlim4, zno3, zferlim 65 REAL(wp) :: zconctemp, zconctemp2, zconctempn, zconctempn2 66 REAL(wp) :: ztemp, zdenom 75 REAL(wp) :: zconcd, zconcd2, zconcn, zconcn2 76 REAL(wp) :: z1_trndia, z1_trnphy, ztem1, ztem2, zetot1, zetot2 77 REAL(wp) :: zdenom, zratio, zironmin 78 REAL(wp) :: zconc1d, zconc1dnh4, zconc0n, zconc0nnh4 67 79 !!--------------------------------------------------------------------- 68 69 70 ! Tuning of the iron concentration to a minimum 71 ! level that is set to the detection limit 72 ! ------------------------------------- 73 80 ! 81 IF( nn_timing == 1 ) CALL timing_start('p4z_lim') 82 ! 74 83 DO jk = 1, jpkm1 75 84 DO jj = 1, jpj 76 85 DO ji = 1, jpi 77 zno3=trn(ji,jj,jk,jpno3) 78 zferlim = MAX( 1.5e-11*(zno3/40E-6)**2, 3e-12 ) 79 zferlim = MIN( zferlim, 1.5e-11 ) 86 87 ! Tuning of the iron concentration to a minimum level that is set to the detection limit 88 !------------------------------------- 89 zno3 = trn(ji,jj,jk,jpno3) / 40.e-6 90 zferlim = MAX( 2e-11 * zno3 * zno3, 5e-12 ) 91 zferlim = MIN( zferlim, 3e-11 ) 80 92 trn(ji,jj,jk,jpfer) = MAX( trn(ji,jj,jk,jpfer), zferlim ) 93 94 ! Computation of a variable Ks for iron on diatoms taking into account 95 ! that increasing biomass is made of generally bigger cells 96 !------------------------------------------------ 97 zconcd = MAX( 0.e0 , trn(ji,jj,jk,jpdia) - xsizedia ) 98 zconcd2 = trn(ji,jj,jk,jpdia) - zconcd 99 zconcn = MAX( 0.e0 , trn(ji,jj,jk,jpphy) - xsizephy ) 100 zconcn2 = trn(ji,jj,jk,jpphy) - zconcn 101 z1_trnphy = 1. / ( trn(ji,jj,jk,jpphy) + rtrn ) 102 z1_trndia = 1. / ( trn(ji,jj,jk,jpdia) + rtrn ) 103 104 concdfe(ji,jj,jk) = MAX( conc3 , ( zconcd2 * conc3 + conc3m * zconcd ) * z1_trndia ) 105 zconc1d = MAX( 2.* conc0 , ( zconcd2 * 2. * conc0 + conc1 * zconcd ) * z1_trndia ) 106 zconc1dnh4 = MAX( 2.* concnnh4, ( zconcd2 * 2. * concnnh4 + concdnh4 * zconcd ) * z1_trndia ) 107 108 concnfe(ji,jj,jk) = MAX( conc2 , ( zconcn2 * conc2 + conc2m * zconcn ) * z1_trnphy ) 109 zconc0n = MAX( conc0 , ( zconcn2 * conc0 + 2. * conc0 * zconcn ) * z1_trnphy ) 110 zconc0nnh4 = MAX( concnnh4 , ( zconcn2 * concnnh4 + 2. * concnnh4 * zconcn ) * z1_trnphy ) 111 112 ! Michaelis-Menten Limitation term for nutrients Small flagellates 113 ! ----------------------------------------------- 114 zdenom = 1. / ( zconc0n * zconc0nnh4 + zconc0nnh4 * trn(ji,jj,jk,jpno3) + zconc0n * trn(ji,jj,jk,jpnh4) ) 115 xnanono3(ji,jj,jk) = trn(ji,jj,jk,jpno3) * zconc0nnh4 * zdenom 116 xnanonh4(ji,jj,jk) = trn(ji,jj,jk,jpnh4) * zconc0n * zdenom 117 ! 118 zlim1 = xnanono3(ji,jj,jk) + xnanonh4(ji,jj,jk) 119 zlim2 = trn(ji,jj,jk,jppo4) / ( trn(ji,jj,jk,jppo4) + zconc0nnh4 ) 120 zratio = trn(ji,jj,jk,jpnfe) * z1_trnphy 121 zironmin = xcoef1 * trn(ji,jj,jk,jpnch) * z1_trnphy + xcoef2 * zlim1 + xcoef3 * xnanono3(ji,jj,jk) 122 zlim3 = MAX( 0.,( zratio - zironmin ) / qnfelim ) 123 xlimnfe(ji,jj,jk) = MIN( 1., zlim3 ) 124 xlimphy(ji,jj,jk) = MIN( zlim1, zlim2, zlim3 ) 125 ! 126 zlim1 = trn(ji,jj,jk,jpnh4) / ( concnnh4 + trn(ji,jj,jk,jpnh4) ) 127 zlim3 = trn(ji,jj,jk,jpfer) / ( concfebac+ trn(ji,jj,jk,jpfer) ) 128 zlim4 = trn(ji,jj,jk,jpdoc) / ( xkdoc + trn(ji,jj,jk,jpdoc) ) 129 xlimbac(ji,jj,jk) = MIN( zlim1, zlim2, zlim3 ) * zlim4 130 131 ! Michaelis-Menten Limitation term for nutrients Diatoms 132 ! ---------------------------------------------- 133 zdenom = 1. / ( zconc1d * zconc1dnh4 + zconc1dnh4 * trn(ji,jj,jk,jpno3) + zconc1d * trn(ji,jj,jk,jpnh4) ) 134 xdiatno3(ji,jj,jk) = trn(ji,jj,jk,jpno3) * zconc1dnh4 * zdenom 135 xdiatnh4(ji,jj,jk) = trn(ji,jj,jk,jpnh4) * zconc1d * zdenom 136 ! 137 zlim1 = xdiatno3(ji,jj,jk) + xdiatnh4(ji,jj,jk) 138 zlim2 = trn(ji,jj,jk,jppo4) / ( trn(ji,jj,jk,jppo4) + zconc1dnh4 ) 139 zlim3 = trn(ji,jj,jk,jpsil) / ( trn(ji,jj,jk,jpsil) + xksi(ji,jj) ) 140 zratio = trn(ji,jj,jk,jpdfe)/(trn(ji,jj,jk,jpdia)+rtrn) 141 zironmin = xcoef1 * trn(ji,jj,jk,jpdch) * z1_trndia + xcoef2 * zlim1 + xcoef3 * xdiatno3(ji,jj,jk) 142 zlim4 = MAX( 0., ( zratio - zironmin ) / qdfelim ) 143 xlimdfe(ji,jj,jk) = MIN( 1., zlim4 ) 144 xlimdia(ji,jj,jk) = MIN( zlim1, zlim2, zlim3, zlim4 ) 145 xlimsi(ji,jj,jk) = MIN( zlim1, zlim2, zlim4 ) 146 END DO 147 END DO 148 END DO 149 150 ! Compute the fraction of nanophytoplankton that is made of calcifiers 151 ! -------------------------------------------------------------------- 152 DO jk = 1, jpkm1 153 DO jj = 1, jpj 154 DO ji = 1, jpi 155 zlim1 = ( trn(ji,jj,jk,jpno3) * concnnh4 + trn(ji,jj,jk,jpnh4) * conc0 ) & 156 & / ( conc0 * concnnh4 + concnnh4 * trn(ji,jj,jk,jpno3) + conc0 * trn(ji,jj,jk,jpnh4) ) 157 zlim2 = trn(ji,jj,jk,jppo4) / ( trn(ji,jj,jk,jppo4) + concnnh4 ) 158 zlim3 = trn(ji,jj,jk,jpfer) / ( trn(ji,jj,jk,jpfer) + concfebac ) 159 ztem1 = MAX( 0., tsn(ji,jj,jk,jp_tem) ) 160 ztem2 = tsn(ji,jj,jk,jp_tem) - 10. 161 zetot1 = MAX( 0., etot(ji,jj,jk) - 1.) / ( 4. + etot(ji,jj,jk) ) 162 zetot2 = 1. / ( 30. + etot(ji,jj,jk) ) 163 164 xfracal(ji,jj,jk) = caco3r * MIN( zlim1, zlim2, zlim3 ) & 165 & * ztem1 / ( 0.1 + ztem1 ) & 166 & * MAX( 1., trn(ji,jj,jk,jpphy) * 1.e6 / 2. ) & 167 & * 2.325 * zetot1 * 30. * zetot2 & 168 & * ( 1. + EXP(-ztem2 * ztem2 / 25. ) ) & 169 & * MIN( 1., 50. / ( hmld(ji,jj) + rtrn ) ) 170 xfracal(ji,jj,jk) = MIN( 0.8 , xfracal(ji,jj,jk) ) 171 xfracal(ji,jj,jk) = MAX( 0.02, xfracal(ji,jj,jk) ) 81 172 END DO 82 173 END DO 83 174 END DO 84 85 ! Computation of a variable Ks for iron on diatoms taking into account 86 ! that increasing biomass is made of generally bigger cells 87 ! ------------------------------------------------ 88 89 DO jk = 1, jpkm1 90 DO jj = 1, jpj 91 DO ji = 1, jpi 92 zconctemp = MAX( 0.e0 , trn(ji,jj,jk,jpdia)-5e-7 ) 93 zconctemp2 = trn(ji,jj,jk,jpdia) - zconctemp 94 zconctempn = MAX( 0.e0 , trn(ji,jj,jk,jpphy)-1e-6 ) 95 zconctempn2 = trn(ji,jj,jk,jpphy) - zconctempn 96 concdfe(ji,jj,jk) = ( zconctemp2 * conc3 + conc3m * zconctemp) & 97 & / ( trn(ji,jj,jk,jpdia) + rtrn ) 98 concdfe(ji,jj,jk) = MAX( conc3, concdfe(ji,jj,jk) ) 99 concnfe(ji,jj,jk) = ( zconctempn2 * conc2 + conc2m * zconctempn) & 100 & / ( trn(ji,jj,jk,jpphy) + rtrn ) 101 concnfe(ji,jj,jk) = MAX( conc2, concnfe(ji,jj,jk) ) 102 END DO 103 END DO 104 END DO 105 106 ! Michaelis-Menten Limitation term for nutrients Small flagellates 107 ! ----------------------------------------------- 108 DO jk = 1, jpkm1 109 DO jj = 1, jpj 110 DO ji = 1, jpi 111 zdenom = 1. / & 112 & ( conc0 * concnnh4 + concnnh4 * trn(ji,jj,jk,jpno3) + conc0 * trn(ji,jj,jk,jpnh4) ) 113 xnanono3(ji,jj,jk) = trn(ji,jj,jk,jpno3) * concnnh4 * zdenom 114 xnanonh4(ji,jj,jk) = trn(ji,jj,jk,jpnh4) * conc0 * zdenom 115 116 zlim1 = xnanono3(ji,jj,jk) + xnanonh4(ji,jj,jk) 117 zlim2 = trn(ji,jj,jk,jppo4) / ( trn(ji,jj,jk,jppo4) + concnnh4 ) 118 zlim3 = trn(ji,jj,jk,jpfer) / ( trn(ji,jj,jk,jpfer) + concnfe(ji,jj,jk) ) 119 xlimphy(ji,jj,jk) = MIN( zlim1, zlim2, zlim3 ) 120 zlim1 = trn(ji,jj,jk,jpnh4) / ( concnnh4 + trn(ji,jj,jk,jpnh4) ) 121 zlim3 = trn(ji,jj,jk,jpfer) / ( conc2 + trn(ji,jj,jk,jpfer) ) 122 zlim4 = trn(ji,jj,jk,jpdoc) / ( xkdoc + trn(ji,jj,jk,jpdoc) ) 123 xlimbac(ji,jj,jk) = MIN( zlim1, zlim2, zlim3 ) * zlim4 124 125 END DO 126 END DO 127 END DO 128 129 ! Michaelis-Menten Limitation term for nutrients Diatoms 130 ! ---------------------------------------------- 131 DO jk = 1, jpkm1 132 DO jj = 1, jpj 133 DO ji = 1, jpi 134 zdenom = 1. / & 135 & ( conc1 * concdnh4 + concdnh4 * trn(ji,jj,jk,jpno3) + conc1 * trn(ji,jj,jk,jpnh4) ) 136 137 xdiatno3(ji,jj,jk) = trn(ji,jj,jk,jpno3) * concdnh4 * zdenom 138 xdiatnh4(ji,jj,jk) = trn(ji,jj,jk,jpnh4) * conc1 * zdenom 139 140 zlim1 = xdiatno3(ji,jj,jk) + xdiatnh4(ji,jj,jk) 141 zlim2 = trn(ji,jj,jk,jppo4) / ( trn(ji,jj,jk,jppo4) + concdnh4 ) 142 zlim3 = trn(ji,jj,jk,jpsil) / ( trn(ji,jj,jk,jpsil) + xksi (ji,jj) ) 143 zlim4 = trn(ji,jj,jk,jpfer) / ( trn(ji,jj,jk,jpfer) + concdfe(ji,jj,jk) ) 144 xlimdia(ji,jj,jk) = MIN( zlim1, zlim2, zlim3, zlim4 ) 145 146 END DO 147 END DO 148 END DO 149 150 151 ! Compute the fraction of nanophytoplankton that is made of calcifiers 152 ! -------------------------------------------------------------------- 153 154 DO jk = 1, jpkm1 155 DO jj = 1, jpj 156 DO ji = 1, jpi 157 ztemp = MAX( 0., tsn(ji,jj,jk,jp_tem) ) 158 xfracal(ji,jj,jk) = caco3r * xlimphy(ji,jj,jk) & 159 & * MAX( 0.0001, ztemp / ( 2.+ ztemp ) ) & 160 & * MAX( 1., trn(ji,jj,jk,jpphy) * 1.e6 / 2. ) 161 xfracal(ji,jj,jk) = MIN( 0.8 , xfracal(ji,jj,jk) ) 162 xfracal(ji,jj,jk) = MAX( 0.01, xfracal(ji,jj,jk) ) 163 END DO 164 END DO 165 END DO 175 ! 176 IF( nn_timing == 1 ) CALL timing_stop('p4z_lim') 166 177 ! 167 178 END SUBROUTINE p4z_lim … … 175 186 !! 176 187 !! ** Method : Read the nampislim namelist and check the parameters 177 !! called at the first timestep (nit 000)188 !! called at the first timestep (nittrc000) 178 189 !! 179 190 !! ** input : Namelist nampislim … … 182 193 183 194 NAMELIST/nampislim/ conc0, conc1, conc2, conc2m, conc3, conc3m, & 184 & concnnh4, concdnh4, xksi1, xksi2, xkdoc, caco3r 185 186 REWIND( numnat ) ! read numnat 187 READ ( numnat, nampislim ) 195 & xsizedia, xsizephy, concnnh4, concdnh4, & 196 & xksi1, xksi2, xkdoc, concfebac, qnfelim, qdfelim, caco3r 197 198 REWIND( numnatp ) ! read numnat 199 READ ( numnatp, nampislim ) 188 200 189 201 IF(lwp) THEN ! control print … … 191 203 WRITE(numout,*) ' Namelist parameters for nutrient limitations, nampislim' 192 204 WRITE(numout,*) ' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~' 193 WRITE(numout,*) ' mean rainratio caco3r =', caco3r 194 WRITE(numout,*) ' NO3, PO4 half saturation conc0 =', conc0 195 WRITE(numout,*) ' half saturation constant for Si uptake xksi1 =', xksi1 196 WRITE(numout,*) ' half saturation constant for Si/C xksi2 =', xksi2 197 WRITE(numout,*) ' 2nd half-sat. of DOC remineralization xkdoc =', xkdoc 198 WRITE(numout,*) ' Phosphate half saturation for diatoms conc1 =', conc1 199 WRITE(numout,*) ' Iron half saturation for phyto conc2 =', conc2 200 WRITE(numout,*) ' Max iron half saturation for phyto conc2m =', conc2m 201 WRITE(numout,*) ' Iron half saturation for diatoms conc3 =', conc3 202 WRITE(numout,*) ' Maxi iron half saturation for diatoms conc3m =', conc3m 203 WRITE(numout,*) ' NH4 half saturation for phyto concnnh4 =', concnnh4 204 WRITE(numout,*) ' NH4 half saturation for diatoms concdnh4 =', concdnh4 205 WRITE(numout,*) ' mean rainratio caco3r = ', caco3r 206 WRITE(numout,*) ' NO3, PO4 half saturation conc0 = ', conc0 207 WRITE(numout,*) ' half saturation constant for Si uptake xksi1 = ', xksi1 208 WRITE(numout,*) ' half saturation constant for Si/C xksi2 = ', xksi2 209 WRITE(numout,*) ' 2nd half-sat. of DOC remineralization xkdoc = ', xkdoc 210 WRITE(numout,*) ' Phosphate half saturation for diatoms conc1 = ', conc1 211 WRITE(numout,*) ' Iron half saturation for phyto conc2 = ', conc2 212 WRITE(numout,*) ' Max iron half saturation for phyto conc2m = ', conc2m 213 WRITE(numout,*) ' Iron half saturation for diatoms conc3 = ', conc3 214 WRITE(numout,*) ' Maxi iron half saturation for diatoms conc3m = ', conc3m 215 WRITE(numout,*) ' Minimum size criteria for diatoms xsizedia = ', xsizedia 216 WRITE(numout,*) ' Minimum size criteria for nanophyto xsizephy = ', xsizephy 217 WRITE(numout,*) ' NH4 half saturation for phyto concnnh4 = ', concnnh4 218 WRITE(numout,*) ' NH4 half saturation for diatoms concdnh4 = ', concdnh4 219 WRITE(numout,*) ' Fe half saturation for bacteria concfebac = ', concfebac 220 WRITE(numout,*) ' optimal Fe quota for nano. qnfelim = ', qnfelim 221 WRITE(numout,*) ' Optimal Fe quota for diatoms qdfelim = ', qdfelim 205 222 ENDIF 206 223 -
trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zlys.F90
r2715 r3294 9 9 !! 1.0 ! 2004 (O. Aumont) modifications 10 10 !! 2.0 ! 2007-12 (C. Ethe, G. Madec) F90 11 !! ! 2011-02 (J. Simeon, J. Orr) Calcon salinity dependence 12 !! 3.4 ! 2011-06 (O. Aumont, C. Ethe) Improvment of calcite dissolution 11 13 !!---------------------------------------------------------------------- 12 14 #if defined key_pisces … … 17 19 !! p4z_lys_init : Read the namelist parameters 18 20 !!---------------------------------------------------------------------- 19 USE trc 20 USE oce_trc ! 21 USE trc 22 USE sms_pisces 23 USE prtctl_trc 24 USE iom 21 USE oce_trc ! shared variables between ocean and passive tracers 22 USE trc ! passive tracers common variables 23 USE sms_pisces ! PISCES Source Minus Sink variables 24 USE prtctl_trc ! print control for debugging 25 USE iom ! I/O manager 25 26 26 27 IMPLICIT NONE … … 57 58 !! ** Method : - ??? 58 59 !!--------------------------------------------------------------------- 59 USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released60 USE wrk_nemo, ONLY: zco3 => wrk_3d_2, zcaldiss => wrk_3d_361 60 ! 62 61 INTEGER, INTENT(in) :: kt ! ocean time step 63 62 INTEGER :: ji, jj, jk, jn 64 REAL(wp) :: z bot, zalk, zdic, zph, zremco3, zah265 REAL(wp) :: zdispot, zfact, z alka63 REAL(wp) :: zalk, zdic, zph, zah2 64 REAL(wp) :: zdispot, zfact, zcalcon, zalka, zaldi 66 65 REAL(wp) :: zomegaca, zexcess, zexcess0 67 #if defined key_diatrc && defined key_iomput68 66 REAL(wp) :: zrfact2 69 #endif70 67 CHARACTER (len=25) :: charout 68 REAL(wp), POINTER, DIMENSION(:,:,:) :: zco3, zcaldiss 71 69 !!--------------------------------------------------------------------- 72 73 IF( wrk_in_use(3, 2,3) ) THEN 74 CALL ctl_stop('p4z_lys: requested workspace arrays unavailable') ; RETURN 75 END IF 76 77 zco3(:,:,:) = 0. 78 # if defined key_diatrc && defined key_iomput 70 ! 71 IF( nn_timing == 1 ) CALL timing_start('p4z_lys') 72 ! 73 CALL wrk_alloc( jpi, jpj, jpk, zco3, zcaldiss ) 74 ! 75 zco3 (:,:,:) = 0. 79 76 zcaldiss(:,:,:) = 0. 80 # endif81 77 ! ------------------------------------------- 82 78 ! COMPUTE [CO3--] and [H+] CONCENTRATIONS … … 91 87 !CDIR NOVERRCHK 92 88 DO ji = 1, jpi 93 94 ! SET DUMMY VARIABLE FOR TOTAL BORATE 95 zbot = borat(ji,jj,jk) 96 97 ! SET DUMMY VARIABLE FOR TOTAL BORATE 98 zbot = borat(ji,jj,jk) 99 zfact = rhop (ji,jj,jk) / 1000. + rtrn 100 101 ! SET DUMMY VARIABLE FOR [H+] 102 zph = hi(ji,jj,jk) * tmask(ji,jj,jk) / zfact + ( 1.-tmask(ji,jj,jk) ) * 1.e-9 103 104 ! SET DUMMY VARIABLE FOR [SUM(CO2)]GIVEN 89 zfact = rhop(ji,jj,jk) / 1000. + rtrn 90 zph = hi(ji,jj,jk) * tmask(ji,jj,jk) / zfact + ( 1.-tmask(ji,jj,jk) ) * 1.e-9 ! [H+] 105 91 zdic = trn(ji,jj,jk,jpdic) / zfact 106 92 zalka = trn(ji,jj,jk,jptal) / zfact 107 108 93 ! CALCULATE [ALK]([CO3--], [HCO3-]) 109 zalk = zalka - ( akw3(ji,jj,jk) / zph - zph & 110 & + zbot / (1.+ zph / akb3(ji,jj,jk) ) ) 111 94 zalk = zalka - ( akw3(ji,jj,jk) / zph - zph + borat(ji,jj,jk) / ( 1. + zph / akb3(ji,jj,jk) ) ) 112 95 ! CALCULATE [H+] and [CO3--] 113 zah2 = SQRT( (zdic-zalk)*(zdic-zalk)+ & 114 & 4.*(zalk*ak23(ji,jj,jk)/ak13(ji,jj,jk)) & 115 & *(2*zdic-zalk)) 116 117 zah2=0.5*ak13(ji,jj,jk)/zalk*((zdic-zalk)+zah2) 118 zco3(ji,jj,jk) = zalk/(2.+zah2/ak23(ji,jj,jk))*zfact 119 120 hi(ji,jj,jk) = zah2*zfact 121 96 zaldi = zdic - zalk 97 zah2 = SQRT( zaldi * zaldi + 4.* ( zalk * ak23(ji,jj,jk) / ak13(ji,jj,jk) ) * ( zdic + zaldi ) ) 98 zah2 = 0.5 * ak13(ji,jj,jk) / zalk * ( zaldi + zah2 ) 99 ! 100 zco3(ji,jj,jk) = zalk / ( 2. + zah2 / ak23(ji,jj,jk) ) * zfact 101 hi(ji,jj,jk) = zah2 * zfact 122 102 END DO 123 103 END DO … … 137 117 138 118 ! DEVIATION OF [CO3--] FROM SATURATION VALUE 139 zomegaca = ( calcon * zco3(ji,jj,jk) ) / aksp(ji,jj,jk) 119 ! Salinity dependance in zomegaca and divide by rhop/1000 to have good units 120 zcalcon = calcon * ( tsn(ji,jj,jk,jp_sal) / 35._wp ) 121 zfact = rhop(ji,jj,jk) / 1000._wp 122 zomegaca = ( zcalcon * zco3(ji,jj,jk) * zfact ) / aksp(ji,jj,jk) 140 123 141 124 ! SET DEGREE OF UNDER-/SUPERSATURATION 142 zexcess0 = MAX( 0., ( 1.- zomegaca ) ) 125 excess(ji,jj,jk) = 1._wp - zomegaca 126 zexcess0 = MAX( 0., excess(ji,jj,jk) ) 143 127 zexcess = zexcess0**nca 144 128 … … 146 130 ! (ACCORDING TO THIS FORMULATION ALSO SOME PARTICULATE 147 131 ! CACO3 GETS DISSOLVED EVEN IN THE CASE OF OVERSATURATION) 132 zdispot = kdca * zexcess * trn(ji,jj,jk,jpcal) 148 133 # if defined key_degrad 149 zdispot = kdca * zexcess * trn(ji,jj,jk,jpcal) * facvol(ji,jj,jk) 150 # else 151 zdispot = kdca * zexcess * trn(ji,jj,jk,jpcal) 134 zdispot = zdispot * facvol(ji,jj,jk) 152 135 # endif 153 154 136 ! CHANGE OF [CO3--] , [ALK], PARTICULATE [CACO3], 155 137 ! AND [SUM(CO2)] DUE TO CACO3 DISSOLUTION/PRECIPITATION 156 zremco3 = zdispot / rmtss 157 zco3(ji,jj,jk) = zco3(ji,jj,jk) + zremco3 * rfact 158 tra(ji,jj,jk,jptal) = tra(ji,jj,jk,jptal) + 2. * zremco3 159 tra(ji,jj,jk,jpcal) = tra(ji,jj,jk,jpcal) - zremco3 160 tra(ji,jj,jk,jpdic) = tra(ji,jj,jk,jpdic) + zremco3 161 162 # if defined key_diatrc && defined key_iomput 163 zcaldiss(ji,jj,jk) = zremco3 ! calcite dissolution 164 # endif 138 zcaldiss(ji,jj,jk) = zdispot / rmtss ! calcite dissolution 139 zco3(ji,jj,jk) = zco3(ji,jj,jk) + zcaldiss(ji,jj,jk) * rfact 140 ! 141 tra(ji,jj,jk,jptal) = tra(ji,jj,jk,jptal) + 2. * zcaldiss(ji,jj,jk) 142 tra(ji,jj,jk,jpcal) = tra(ji,jj,jk,jpcal) - zcaldiss(ji,jj,jk) 143 tra(ji,jj,jk,jpdic) = tra(ji,jj,jk,jpdic) + zcaldiss(ji,jj,jk) 165 144 END DO 166 145 END DO 167 146 END DO 168 169 # if defined key_diatrc 170 # if ! defined key_iomput 171 trc3d(:,:,:,jp_pcs0_3d ) = hi (:,:,:) * tmask(:,:,:) 172 trc3d(:,:,:,jp_pcs0_3d + 1) = zco3(:,:,:) * tmask(:,:,:) 173 trc3d(:,:,:,jp_pcs0_3d + 2) = aksp(:,:,:) / calcon * tmask(:,:,:) 174 # else 175 zrfact2 = 1.e3 * rfact2r 176 CALL iom_put( "PH" , hi (:,:,:) * tmask(:,:,:) ) 177 CALL iom_put( "CO3" , zco3 (:,:,:) * tmask(:,:,:) ) 178 CALL iom_put( "CO3sat", aksp (:,:,:) / calcon * tmask(:,:,:) ) 179 CALL iom_put( "DCAL" , zcaldiss(:,:,:) * zrfact2 * tmask(:,:,:) ) 180 # endif 181 # endif 182 ! 183 IF(ln_ctl) THEN ! print mean trends (used for debugging) 184 WRITE(charout, FMT="('lys ')") 185 CALL prt_ctl_trc_info(charout) 186 CALL prt_ctl_trc(tab4d=tra, mask=tmask, clinfo=ctrcnm) 187 ENDIF 188 189 IF( wrk_not_released(3, 2,3) ) CALL ctl_stop('p4z_lys: failed to release workspace arrays') 147 ! 148 IF( ln_diatrc ) THEN 149 ! 150 IF( lk_iomput ) THEN 151 zrfact2 = 1.e3 * rfact2r 152 CALL iom_put( "PH" , hi (:,:,:) * tmask(:,:,:) ) 153 CALL iom_put( "CO3" , zco3 (:,:,:) * tmask(:,:,:) ) 154 CALL iom_put( "CO3sat", aksp (:,:,:) / calcon * tmask(:,:,:) ) 155 CALL iom_put( "DCAL" , zcaldiss(:,:,:) * zrfact2 * tmask(:,:,:) ) 156 ELSE 157 trc3d(:,:,:,jp_pcs0_3d ) = hi (:,:,:) * tmask(:,:,:) 158 trc3d(:,:,:,jp_pcs0_3d + 1) = zco3(:,:,:) * tmask(:,:,:) 159 trc3d(:,:,:,jp_pcs0_3d + 2) = aksp(:,:,:) / calcon * tmask(:,:,:) 160 ENDIF 161 ! 162 ENDIF 163 ! 164 IF(ln_ctl) THEN ! print mean trends (used for debugging) 165 WRITE(charout, FMT="('lys ')") 166 CALL prt_ctl_trc_info(charout) 167 CALL prt_ctl_trc(tab4d=tra, mask=tmask, clinfo=ctrcnm) 168 ENDIF 169 ! 170 CALL wrk_dealloc( jpi, jpj, jpk, zco3, zcaldiss ) 171 ! 172 IF( nn_timing == 1 ) CALL timing_stop('p4z_lys') 190 173 ! 191 174 END SUBROUTINE p4z_lys … … 199 182 !! 200 183 !! ** Method : Read the nampiscal namelist and check the parameters 201 !! called at the first timestep (nit 000)184 !! called at the first timestep (nittrc000) 202 185 !! 203 186 !! ** input : Namelist nampiscal … … 207 190 NAMELIST/nampiscal/ kdca, nca 208 191 209 REWIND( numnat ) ! read numnat210 READ ( numnat , nampiscal )192 REWIND( numnatp ) ! read numnatp 193 READ ( numnatp, nampiscal ) 211 194 212 195 IF(lwp) THEN ! control print -
trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zmeso.F90
r2528 r3294 6 6 !! History : 1.0 ! 2002 (O. Aumont) Original code 7 7 !! 2.0 ! 2007-12 (C. Ethe, G. Madec) F90 8 !! 3.4 ! 2011-06 (O. Aumont, C. Ethe) Quota model for iron 8 9 !!---------------------------------------------------------------------- 9 10 #if defined key_pisces … … 14 15 !! p4z_meso_init : Initialization of the parameters for mesozooplankton 15 16 !!---------------------------------------------------------------------- 16 USE trc17 USE oce_trc !18 USE trc !19 USE sms_pisces !20 USE p rtctl_trc21 USE p4z int22 USE p 4zsink23 USE iom 17 USE oce_trc ! shared variables between ocean and passive tracers 18 USE trc ! passive tracers common variables 19 USE sms_pisces ! PISCES Source Minus Sink variables 20 USE p4zsink ! vertical flux of particulate matter due to sinking 21 USE p4zint ! interpolation and computation of various fields 22 USE p4zprod ! production 23 USE prtctl_trc ! print control for debugging 24 USE iom ! I/O manager 24 25 25 26 IMPLICIT NONE … … 30 31 31 32 !! * Shared module variables 32 REAL(wp), PUBLIC :: & 33 xprefc = 1.0_wp , & !: 34 xprefp = 0.2_wp , & !: 35 xprefz = 1.0_wp , & !: 36 xprefpoc = 0.0_wp , & !: 37 resrat2 = 0.005_wp , & !: 38 mzrat2 = 0.03_wp , & !: 39 grazrat2 = 0.7_wp , & !: 40 xkgraz2 = 20E-6_wp , & !: 41 unass2 = 0.3_wp , & !: 42 sigma2 = 0.6_wp , & !: 43 epsher2 = 0.33_wp , & !: 44 grazflux = 5.E3_wp 45 33 REAL(wp), PUBLIC :: part2 = 0.5_wp !: part of calcite not dissolved in mesozoo guts 34 REAL(wp), PUBLIC :: xprefc = 1.0_wp !: mesozoo preference for POC 35 REAL(wp), PUBLIC :: xprefp = 0.3_wp !: mesozoo preference for nanophyto 36 REAL(wp), PUBLIC :: xprefz = 1.0_wp !: mesozoo preference for diatoms 37 REAL(wp), PUBLIC :: xprefpoc = 0.3_wp !: mesozoo preference for POC 38 REAL(wp), PUBLIC :: xthresh2zoo = 1E-8_wp !: zoo feeding threshold for mesozooplankton 39 REAL(wp), PUBLIC :: xthresh2dia = 1E-8_wp !: diatoms feeding threshold for mesozooplankton 40 REAL(wp), PUBLIC :: xthresh2phy = 2E-7_wp !: nanophyto feeding threshold for mesozooplankton 41 REAL(wp), PUBLIC :: xthresh2poc = 1E-8_wp !: poc feeding threshold for mesozooplankton 42 REAL(wp), PUBLIC :: xthresh2 = 0._wp !: feeding threshold for mesozooplankton 43 REAL(wp), PUBLIC :: resrat2 = 0.005_wp !: exsudation rate of mesozooplankton 44 REAL(wp), PUBLIC :: mzrat2 = 0.04_wp !: microzooplankton mortality rate 45 REAL(wp), PUBLIC :: grazrat2 = 0.9_wp !: maximal mesozoo grazing rate 46 REAL(wp), PUBLIC :: xkgraz2 = 20E-6_wp !: non assimilated fraction of P by mesozoo 47 REAL(wp), PUBLIC :: unass2 = 0.3_wp !: Efficicency of mesozoo growth 48 REAL(wp), PUBLIC :: sigma2 = 0.6_wp !: Fraction of mesozoo excretion as DOM 49 REAL(wp), PUBLIC :: epsher2 = 0.3_wp !: half sturation constant for grazing 2 50 REAL(wp), PUBLIC :: grazflux = 3.E3_wp !: mesozoo flux feeding rate 46 51 47 52 !!* Substitution … … 65 70 INTEGER, INTENT(in) :: kt, jnt ! ocean time step 66 71 INTEGER :: ji, jj, jk 67 REAL(wp) :: zcompadi, zcompaph, zcompapoc, zcompaz 68 REAL(wp) :: zfact, zcompam, zdenom, zgraze2, zstep 69 REAL(wp) :: zgrarem2, zgrafer2, zgrapoc2, zprcaca, zmortz2 72 REAL(wp) :: zcompadi, zcompaph, zcompapoc, zcompaz, zcompam 73 REAL(wp) :: zgraze2 , zdenom, zdenom2, zncratio 74 REAL(wp) :: zfact , zstep, zfood, zfoodlim 75 REAL(wp) :: zepshert, zepsherv, zgrarsig, zgraztot, zgraztotf 76 REAL(wp) :: zgrarem2, zgrafer2, zgrapoc2, zprcaca, zmortz2, zgrasrat 70 77 #if defined key_kriest 71 78 REAL znumpoc 72 79 #endif 73 REAL(wp) :: zrespz2, ztortz2,zgrazd,zgrazz,zgrazpof74 REAL(wp) :: zgrazn, zgrazpoc,zgraznf,zgrazf75 REAL(wp) :: zgrazfff, zgrazffe80 REAL(wp) :: zrespz2, ztortz2, zgrazd, zgrazz, zgrazpof 81 REAL(wp) :: zgrazn, zgrazpoc, zgraznf, zgrazf 82 REAL(wp) :: zgrazfff, zgrazffe 76 83 CHARACTER (len=25) :: charout 77 #if defined key_diatrc && defined key_iomput78 84 REAL(wp) :: zrfact2 79 #endif80 81 85 !!--------------------------------------------------------------------- 86 ! 87 IF( nn_timing == 1 ) CALL timing_start('p4z_meso') 88 ! 82 89 83 90 DO jk = 1, jpkm1 84 91 DO jj = 1, jpj 85 92 DO ji = 1, jpi 86 87 zcompam = MAX( ( trn(ji,jj,jk,jpmes) - 1.e-9 ), 0.e0 ) 93 zcompam = MAX( ( trn(ji,jj,jk,jpmes) - 1.e-8 ), 0.e0 ) 88 94 # if defined key_degrad 89 zstep = xstep * facvol(ji,jj,jk)95 zstep = xstep * facvol(ji,jj,jk) 90 96 # else 91 zstep = xstep97 zstep = xstep 92 98 # endif 93 zfact = zstep * tgfunc(ji,jj,jk) * zcompam99 zfact = zstep * tgfunc(ji,jj,jk) * zcompam 94 100 95 101 ! Respiration rates of both zooplankton 96 102 ! ------------------------------------- 97 zrespz2 = resrat2 * zfact * ( 1. + 3. * nitrfac(ji,jj,jk) )&98 & * trn(ji,jj,jk,jpmes) / ( xkmort + trn(ji,jj,jk,jpmes))103 zrespz2 = resrat2 * zfact * trn(ji,jj,jk,jpmes) / ( xkmort + trn(ji,jj,jk,jpmes) ) & 104 & + resrat2 * zfact * 3. * nitrfac(ji,jj,jk) 99 105 100 106 ! Zooplankton mortality. A square function has been selected with 101 107 ! no real reason except that it seems to be more stable and may mimic predation 102 108 ! --------------------------------------------------------------- 103 ztortz2 = mzrat2 * 1.e6 * zfact * trn(ji,jj,jk,jpmes)109 ztortz2 = mzrat2 * 1.e6 * zfact * trn(ji,jj,jk,jpmes) 104 110 ! 105 111 106 zcompadi = MAX( ( trn(ji,jj,jk,jpdia) - 1.e-8 ), 0.e0 ) 107 zcompaz = MAX( ( trn(ji,jj,jk,jpzoo) - 1.e-8 ), 0.e0 ) 108 zcompaph = MAX( ( trn(ji,jj,jk,jpphy) - 2.e-7 ), 0.e0 ) 109 zcompapoc = MAX( ( trn(ji,jj,jk,jppoc) - 1.e-8 ), 0.e0 ) 110 111 ! Microzooplankton grazing 112 ! ------------------------ 113 zdenom = 1. / ( xkgraz2 + xprefc * trn(ji,jj,jk,jpdia) & 114 & + xprefz * trn(ji,jj,jk,jpzoo) & 115 & + xprefp * trn(ji,jj,jk,jpphy) & 116 & + xprefpoc * trn(ji,jj,jk,jppoc) ) 117 118 zgraze2 = grazrat2 * zstep * Tgfunc2(ji,jj,jk) * zdenom * trn(ji,jj,jk,jpmes) 119 120 zgrazd = zgraze2 * xprefc * zcompadi 121 zgrazz = zgraze2 * xprefz * zcompaz 122 zgrazn = zgraze2 * xprefp * zcompaph 123 zgrazpoc = zgraze2 * xprefpoc * zcompapoc 124 125 zgraznf = zgrazn * trn(ji,jj,jk,jpnfe) / (trn(ji,jj,jk,jpphy) + rtrn) 126 zgrazf = zgrazd * trn(ji,jj,jk,jpdfe) / (trn(ji,jj,jk,jpdia) + rtrn) 127 zgrazpof = zgrazpoc * trn(ji,jj,jk,jpsfe) / (trn(ji,jj,jk,jppoc) + rtrn) 128 112 zcompadi = MAX( ( trn(ji,jj,jk,jpdia) - xthresh2dia ), 0.e0 ) 113 zcompaz = MAX( ( trn(ji,jj,jk,jpzoo) - xthresh2zoo ), 0.e0 ) 114 zcompaph = MAX( ( trn(ji,jj,jk,jpphy) - xthresh2phy ), 0.e0 ) 115 zcompapoc = MAX( ( trn(ji,jj,jk,jppoc) - xthresh2poc ), 0.e0 ) 116 117 zfood = xprefc * zcompadi + xprefz * zcompaz + xprefp * zcompaph + xprefpoc * zcompapoc 118 zfoodlim = MAX( 0., zfood - xthresh2 ) 119 zdenom = zfoodlim / ( xkgraz2 + zfoodlim ) 120 zdenom2 = zdenom / ( zfood + rtrn ) 121 zgraze2 = grazrat2 * zstep * tgfunc2(ji,jj,jk) * trn(ji,jj,jk,jpmes) 122 123 zgrazd = zgraze2 * xprefc * zcompadi * zdenom2 124 zgrazz = zgraze2 * xprefz * zcompaz * zdenom2 125 zgrazn = zgraze2 * xprefp * zcompaph * zdenom2 126 zgrazpoc = zgraze2 * xprefpoc * zcompapoc * zdenom2 127 128 zgraznf = zgrazn * trn(ji,jj,jk,jpnfe) / ( trn(ji,jj,jk,jpphy) + rtrn) 129 zgrazf = zgrazd * trn(ji,jj,jk,jpdfe) / ( trn(ji,jj,jk,jpdia) + rtrn) 130 zgrazpof = zgrazpoc * trn(ji,jj,jk,jpsfe) / ( trn(ji,jj,jk,jppoc) + rtrn) 131 129 132 ! Mesozooplankton flux feeding on GOC 130 133 ! ---------------------------------- 131 134 # if ! defined key_kriest 132 zgrazffe = grazflux * zstep * wsbio4(ji,jj,jk) &133 134 zgrazfff = zgrazffe * trn(ji,jj,jk,jpbfe) / (trn(ji,jj,jk,jpgoc) + rtrn)135 zgrazffe = grazflux * zstep * wsbio4(ji,jj,jk) & 136 & * tgfunc2(ji,jj,jk) * trn(ji,jj,jk,jpgoc) * trn(ji,jj,jk,jpmes) 137 zgrazfff = zgrazffe * trn(ji,jj,jk,jpbfe) / (trn(ji,jj,jk,jpgoc) + rtrn) 135 138 # else 136 !!--------------------------- KRIEST3 ------------------------------------------- 137 !! zgrazffe = 0.5 * 1.3e-2 / 5.5e-7 * 0.3 * zstep * wsbio3(ji,jj,jk) & 138 !! & * tgfunc(ji,jj,jk) * trn(ji,jj,jk,jppoc) * trn(ji,jj,jk,jpmes) & 139 !! # if defined key_degrad 140 !! & * facvol(ji,jj,jk) & 141 !! # endif 142 !! & / (trn(ji,jj,jk,jppoc) * 1.e7 + 0.1) 143 !!--------------------------- KRIEST3 ------------------------------------------- 144 145 zgrazffe = grazflux * zstep * wsbio3(ji,jj,jk) & 146 & * tgfunc2(ji,jj,jk) * trn(ji,jj,jk,jppoc) * trn(ji,jj,jk,jpmes) 147 zgrazfff = zgrazffe * trn(ji,jj,jk,jpsfe) / (trn(ji,jj,jk,jppoc) + rtrn) 139 zgrazffe = grazflux * zstep * wsbio3(ji,jj,jk) & 140 zgrazfff = zgrazffe * trn(ji,jj,jk,jpsfe) / (trn(ji,jj,jk,jppoc) + rtrn) 148 141 # endif 149 150 #if defined key_diatrc 151 ! Total grazing ( grazing by microzoo is already computed in p4zmicro )152 grazing(ji,jj,jk) = grazing(ji,jj,jk) + ( zgrazd + zgrazz + zgrazn + zgrazpoc + zgrazffe ) 153 #endif 154 142 ! 143 zgraztot = zgrazd + zgrazz + zgrazn + zgrazpoc + zgrazffe 144 zgraztotf = zgrazf + zgraznf + zgrazz * ferat3 + zgrazpof + zgrazfff 145 146 ! Total grazing ( grazing by microzoo is already computed in p4zmicro ) 147 grazing(ji,jj,jk) = grazing(ji,jj,jk) + zgraztot 155 148 ! Mesozooplankton efficiency 156 149 ! -------------------------- 157 zgrarem2 = ( zgrazd + zgrazz + zgrazn + zgrazpoc + zgrazffe ) * ( 1. - epsher2 - unass2 ) 158 #if ! defined key_kriest 159 zgrafer2 = ( zgrazf + zgraznf + zgrazz * ferat3 + zgrazpof + zgrazfff ) * ( 1.- epsher2 - unass2 ) & 160 & + epsher2 * ( zgrazd * MAX((trn(ji,jj,jk,jpdfe) / (trn(ji,jj,jk,jpdia) + rtrn)-ferat3),0.) & 161 & + zgrazn * MAX((trn(ji,jj,jk,jpnfe) / (trn(ji,jj,jk,jpphy) + rtrn)-ferat3),0.) & 162 & + zgrazpoc * MAX((trn(ji,jj,jk,jpsfe) / (trn(ji,jj,jk,jppoc) + rtrn)-ferat3),0.) & 163 & + zgrazffe * MAX((trn(ji,jj,jk,jpbfe) / (trn(ji,jj,jk,jpgoc) + rtrn)-ferat3),0.) ) 150 zgrasrat = zgraztotf / ( zgraztot + rtrn ) 151 zncratio = ( xprefc * zcompadi * quotad(ji,jj,jk) & 152 & + xprefp * zcompaph * quotan(ji,jj,jk) & 153 & + xprefz * zcompaz & 154 & + xprefpoc * zcompapoc ) / ( zfood + rtrn ) 155 zepshert = epsher2 * MIN( 1., zncratio ) 156 zepsherv = zepshert * MIN( 1., zgrasrat / ferat3 ) 157 zgrarem2 = zgraztot * ( 1. - zepsherv - unass2 ) 158 zgrafer2 = zgraztot * MAX( 0. , ( 1. - unass2 ) * zgrasrat - ferat3 * zepshert ) 159 zgrapoc2 = zgraztot * unass2 160 161 ! Update the arrays TRA which contain the biological sources and sinks 162 zgrarsig = zgrarem2 * sigma2 163 tra(ji,jj,jk,jppo4) = tra(ji,jj,jk,jppo4) + zgrarsig 164 tra(ji,jj,jk,jpnh4) = tra(ji,jj,jk,jpnh4) + zgrarsig 165 tra(ji,jj,jk,jpdoc) = tra(ji,jj,jk,jpdoc) + zgrarem2 - zgrarsig 166 tra(ji,jj,jk,jpoxy) = tra(ji,jj,jk,jpoxy) - o2ut * zgrarsig 167 tra(ji,jj,jk,jpfer) = tra(ji,jj,jk,jpfer) + zgrafer2 168 tra(ji,jj,jk,jpdic) = tra(ji,jj,jk,jpdic) + zgrarsig 169 tra(ji,jj,jk,jptal) = tra(ji,jj,jk,jptal) + rno3 * zgrarsig 170 #if defined key_kriest 171 tra(ji,jj,jk,jppoc) = tra(ji,jj,jk,jppoc) + zgrapoc2 172 tra(ji,jj,jk,jpnum) = tra(ji,jj,jk,jpnum) + zgrapoc2 * xkr_dmeso 173 tra(ji,jj,jk,jpsfe) = tra(ji,jj,jk,jpsfe) + zgraztotf * unass2 164 174 #else 165 zgrafer2 = ( zgrazf + zgraznf + zgrazz * ferat3 + zgrazpof + zgrazfff ) * ( 1. - epsher2 - unass2 ) & 166 & + epsher2 * ( zgrazd * MAX((trn(ji,jj,jk,jpdfe) / (trn(ji,jj,jk,jpdia) + rtrn)-ferat3),0.) & 167 & + zgrazn * MAX((trn(ji,jj,jk,jpnfe) / (trn(ji,jj,jk,jpphy) + rtrn)-ferat3),0.) & 168 & + zgrazpoc * MAX((trn(ji,jj,jk,jpsfe) / (trn(ji,jj,jk,jppoc) + rtrn)-ferat3),0.) & 169 & + zgrazffe * MAX((trn(ji,jj,jk,jpsfe) / (trn(ji,jj,jk,jppoc) + rtrn)-ferat3),0.) ) 170 171 #endif 172 ! Update the arrays TRA which contain the biological sources and sinks 173 174 zgrapoc2 = zgrazd + zgrazz + zgrazn + zgrazpoc + zgrazffe 175 176 tra(ji,jj,jk,jppo4) = tra(ji,jj,jk,jppo4) + zgrarem2 * sigma2 177 tra(ji,jj,jk,jpnh4) = tra(ji,jj,jk,jpnh4) + zgrarem2 * sigma2 178 tra(ji,jj,jk,jpdoc) = tra(ji,jj,jk,jpdoc) + zgrarem2 * ( 1. - sigma2 ) 179 tra(ji,jj,jk,jpoxy) = tra(ji,jj,jk,jpoxy) - o2ut * zgrarem2 * sigma2 180 tra(ji,jj,jk,jpfer) = tra(ji,jj,jk,jpfer) + zgrafer2 181 tra(ji,jj,jk,jpdic) = tra(ji,jj,jk,jpdic) + zgrarem2 * sigma2 182 183 #if defined key_kriest 184 tra(ji,jj,jk,jppoc) = tra(ji,jj,jk,jppoc) + zgrapoc2 * unass2 185 tra(ji,jj,jk,jpnum) = tra(ji,jj,jk,jpnum) + zgrapoc2 * unass2 * xkr_dmeso 186 #else 187 tra(ji,jj,jk,jpgoc) = tra(ji,jj,jk,jpgoc) + zgrapoc2 * unass2 175 tra(ji,jj,jk,jpgoc) = tra(ji,jj,jk,jpgoc) + zgrapoc2 176 tra(ji,jj,jk,jpbfe) = tra(ji,jj,jk,jpbfe) + zgraztotf * unass2 188 177 #endif 189 178 zmortz2 = ztortz2 + zrespz2 190 tra(ji,jj,jk,jpmes) = tra(ji,jj,jk,jpmes) - zmortz2 + epsher2 * zgrapoc2179 tra(ji,jj,jk,jpmes) = tra(ji,jj,jk,jpmes) - zmortz2 + zepsherv * zgraztot 191 180 tra(ji,jj,jk,jpdia) = tra(ji,jj,jk,jpdia) - zgrazd 192 181 tra(ji,jj,jk,jpzoo) = tra(ji,jj,jk,jpzoo) - zgrazz … … 199 188 tra(ji,jj,jk,jpdfe) = tra(ji,jj,jk,jpdfe) - zgrazf 200 189 201 zprcaca = xfracal(ji,jj,jk) * unass2 *zgrazn202 #if defined key_diatrc 190 zprcaca = xfracal(ji,jj,jk) * zgrazn 191 ! calcite production 203 192 prodcal(ji,jj,jk) = prodcal(ji,jj,jk) + zprcaca ! prodcal=prodcal(nanophy)+prodcal(microzoo)+prodcal(mesozoo) 204 #endif 205 zprcaca = part * zprcaca193 ! 194 zprcaca = part2 * zprcaca 206 195 tra(ji,jj,jk,jpdic) = tra(ji,jj,jk,jpdic) - zprcaca 207 196 tra(ji,jj,jk,jptal) = tra(ji,jj,jk,jptal) - 2. * zprcaca … … 212 201 tra(ji,jj,jk,jpnum) = tra(ji,jj,jk,jpnum) - zgrazpoc * znumpoc & 213 202 & + zmortz2 * xkr_dmeso - zgrazffe * znumpoc * wsbio4(ji,jj,jk) / ( wsbio3(ji,jj,jk) + rtrn ) 214 tra(ji,jj,jk,jpsfe) = tra(ji,jj,jk,jpsfe) + ferat3 * zmortz2 & 215 & + unass2 * ( ferat3 * zgrazz + zgraznf + zgrazf + zgrazpof + zgrazfff ) - zgrazfff - zgrazpof 203 tra(ji,jj,jk,jpsfe) = tra(ji,jj,jk,jpsfe) + ferat3 * zmortz2 - zgrazfff - zgrazpof 216 204 #else 217 205 tra(ji,jj,jk,jppoc) = tra(ji,jj,jk,jppoc) - zgrazpoc 218 206 tra(ji,jj,jk,jpgoc) = tra(ji,jj,jk,jpgoc) + zmortz2 - zgrazffe 219 207 tra(ji,jj,jk,jpsfe) = tra(ji,jj,jk,jpsfe) - zgrazpof 220 tra(ji,jj,jk,jpbfe) = tra(ji,jj,jk,jpbfe) + ferat3 * zmortz2 & 221 & + unass2 * ( ferat3 * zgrazz + zgraznf + zgrazf + zgrazpof + zgrazfff ) - zgrazfff 208 tra(ji,jj,jk,jpbfe) = tra(ji,jj,jk,jpbfe) + ferat3 * zmortz2 - zgrazfff 222 209 #endif 223 210 … … 226 213 END DO 227 214 ! 228 #if defined key_diatrc && defined key_iomput 229 zrfact2 = 1.e3 * rfact2r 230 ! Total grazing of phyto by zoo 231 grazing(:,:,:) = grazing(:,:,:) * zrfact2 * tmask(:,:,:) 232 ! Calcite production 233 prodcal(:,:,:) = prodcal(:,:,:) * zrfact2 * tmask(:,:,:) 234 IF( jnt == nrdttrc ) then 235 CALL iom_put( "GRAZ" , grazing ) ! Total grazing of phyto by zooplankton 236 CALL iom_put( "PCAL" , prodcal ) ! Calcite production 215 IF( ln_diatrc .AND. lk_iomput ) THEN 216 zrfact2 = 1.e3 * rfact2r 217 grazing(:,:,:) = grazing(:,:,:) * zrfact2 * tmask(:,:,:) ! Total grazing of phyto by zoo 218 prodcal(:,:,:) = prodcal(:,:,:) * zrfact2 * tmask(:,:,:) ! Calcite production 219 IF( jnt == nrdttrc ) THEN 220 CALL iom_put( "GRAZ" , grazing ) ! Total grazing of phyto by zooplankton 221 CALL iom_put( "PCAL" , prodcal ) ! Calcite production 222 ENDIF 237 223 ENDIF 238 #endif 239 240 IF(ln_ctl) THEN ! print mean trends (used for debugging) 241 WRITE(charout, FMT="('meso')") 242 CALL prt_ctl_trc_info(charout) 243 CALL prt_ctl_trc(tab4d=tra, mask=tmask, clinfo=ctrcnm) 244 ENDIF 245 224 ! 225 IF(ln_ctl) THEN ! print mean trends (used for debugging) 226 WRITE(charout, FMT="('meso')") 227 CALL prt_ctl_trc_info(charout) 228 CALL prt_ctl_trc(tab4d=tra, mask=tmask, clinfo=ctrcnm) 229 ENDIF 230 ! 231 IF( nn_timing == 1 ) CALL timing_stop('p4z_meso') 232 ! 246 233 END SUBROUTINE p4z_meso 247 234 … … 254 241 !! 255 242 !! ** Method : Read the nampismes namelist and check the parameters 256 !! called at the first timestep (nit 000)243 !! called at the first timestep (nittrc000) 257 244 !! 258 245 !! ** input : Namelist nampismes … … 260 247 !!---------------------------------------------------------------------- 261 248 262 NAMELIST/nampismes/ grazrat2,resrat2,mzrat2,xprefc, xprefp, & 263 & xprefz, xprefpoc, xkgraz2, epsher2, sigma2, unass2, grazflux 264 265 REWIND( numnat ) ! read numnat 266 READ ( numnat, nampismes ) 249 NAMELIST/nampismes/ part2, grazrat2, resrat2, mzrat2, xprefc, xprefp, xprefz, & 250 & xprefpoc, xthresh2dia, xthresh2phy, xthresh2zoo, xthresh2poc, & 251 & xthresh2, xkgraz2, epsher2, sigma2, unass2, grazflux 252 253 REWIND( numnatp ) ! read numnatp 254 READ ( numnatp, nampismes ) 267 255 268 256 … … 271 259 WRITE(numout,*) ' Namelist parameters for mesozooplankton, nampismes' 272 260 WRITE(numout,*) ' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~' 273 WRITE(numout,*) ' zoo preference for phyto xprefc =', xprefc 274 WRITE(numout,*) ' zoo preference for POC xprefp =', xprefp 275 WRITE(numout,*) ' zoo preference for zoo xprefz =', xprefz 276 WRITE(numout,*) ' zoo preference for poc xprefpoc =', xprefpoc 277 WRITE(numout,*) ' exsudation rate of mesozooplankton resrat2 =', resrat2 278 WRITE(numout,*) ' mesozooplankton mortality rate mzrat2 =', mzrat2 279 WRITE(numout,*) ' maximal mesozoo grazing rate grazrat2 =', grazrat2 280 WRITE(numout,*) ' mesozoo flux feeding rate grazflux =', grazflux 281 WRITE(numout,*) ' non assimilated fraction of P by mesozoo unass2 =', unass2 282 WRITE(numout,*) ' Efficicency of Mesozoo growth epsher2 =', epsher2 283 WRITE(numout,*) ' Fraction of mesozoo excretion as DOM sigma2 =', sigma2 284 WRITE(numout,*) ' half sturation constant for grazing 2 xkgraz2 =', xkgraz2 261 WRITE(numout,*) ' part of calcite not dissolved in mesozoo guts part2 =', part2 262 WRITE(numout,*) ' mesozoo preference for phyto xprefc =', xprefc 263 WRITE(numout,*) ' mesozoo preference for POC xprefp =', xprefp 264 WRITE(numout,*) ' mesozoo preference for zoo xprefz =', xprefz 265 WRITE(numout,*) ' mesozoo preference for poc xprefpoc =', xprefpoc 266 WRITE(numout,*) ' microzoo feeding threshold for mesozoo xthresh2zoo =', xthresh2zoo 267 WRITE(numout,*) ' diatoms feeding threshold for mesozoo xthresh2dia =', xthresh2dia 268 WRITE(numout,*) ' nanophyto feeding threshold for mesozoo xthresh2phy =', xthresh2phy 269 WRITE(numout,*) ' poc feeding threshold for mesozoo xthresh2poc =', xthresh2poc 270 WRITE(numout,*) ' feeding threshold for mesozooplankton xthresh2 =', xthresh2 271 WRITE(numout,*) ' exsudation rate of mesozooplankton resrat2 =', resrat2 272 WRITE(numout,*) ' mesozooplankton mortality rate mzrat2 =', mzrat2 273 WRITE(numout,*) ' maximal mesozoo grazing rate grazrat2 =', grazrat2 274 WRITE(numout,*) ' mesozoo flux feeding rate grazflux =', grazflux 275 WRITE(numout,*) ' non assimilated fraction of P by mesozoo unass2 =', unass2 276 WRITE(numout,*) ' Efficicency of Mesozoo growth epsher2 =', epsher2 277 WRITE(numout,*) ' Fraction of mesozoo excretion as DOM sigma2 =', sigma2 278 WRITE(numout,*) ' half sturation constant for grazing 2 xkgraz2 =', xkgraz2 285 279 ENDIF 286 280 -
trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zmicro.F90
r2528 r3294 6 6 !! History : 1.0 ! 2004 (O. Aumont) Original code 7 7 !! 2.0 ! 2007-12 (C. Ethe, G. Madec) F90 8 !! 3.4 ! 2011-06 (O. Aumont, C. Ethe) Quota model for iron 8 9 !!---------------------------------------------------------------------- 9 10 #if defined key_pisces … … 14 15 !! p4z_micro_init : Initialize and read the appropriate namelist 15 16 !!---------------------------------------------------------------------- 16 USE trc17 USE oce_trc !18 USE trc !19 USE sms_pisces !20 USE p rtctl_trc21 USE p4zint 22 USE p4z sink23 USE iom17 USE oce_trc ! shared variables between ocean and passive tracers 18 USE trc ! passive tracers common variables 19 USE sms_pisces ! PISCES Source Minus Sink variables 20 USE p4zlim ! Co-limitations 21 USE p4zsink ! vertical flux of particulate matter due to sinking 22 USE p4zint ! interpolation and computation of various fields 23 USE p4zprod ! production 24 USE prtctl_trc ! print control for debugging 24 25 25 26 IMPLICIT NONE … … 28 29 PUBLIC p4z_micro ! called in p4zbio.F90 29 30 PUBLIC p4z_micro_init ! called in trcsms_pisces.F90 31 PUBLIC p4z_micro_alloc ! called in trcsms_pisces.F90 30 32 31 33 !! * Shared module variables 32 REAL(wp), PUBLIC :: & 33 xpref2c = 0.0_wp , & !: 34 xpref2p = 0.5_wp , & !: 35 xpref2d = 0.5_wp , & !: 36 resrat = 0.03_wp , & !: 37 mzrat = 0.0_wp , & !: 38 grazrat = 4.0_wp , & !: 39 xkgraz = 20E-6_wp , & !: 40 unass = 0.3_wp , & !: 41 sigma1 = 0.6_wp , & !: 42 epsher = 0.33_wp 34 REAL(wp), PUBLIC :: part = 0.5_wp !: part of calcite not dissolved in microzoo guts 35 REAL(wp), PUBLIC :: xpref2c = 0.2_wp !: microzoo preference for POC 36 REAL(wp), PUBLIC :: xpref2p = 1.0_wp !: microzoo preference for nanophyto 37 REAL(wp), PUBLIC :: xpref2d = 0.6_wp !: microzoo preference for diatoms 38 REAL(wp), PUBLIC :: xthreshdia = 1E-8_wp !: diatoms feeding threshold for microzooplankton 39 REAL(wp), PUBLIC :: xthreshphy = 2E-7_wp !: nanophyto threshold for microzooplankton 40 REAL(wp), PUBLIC :: xthreshpoc = 1E-8_wp !: poc threshold for microzooplankton 41 REAL(wp), PUBLIC :: xthresh = 0._wp !: feeding threshold for microzooplankton 42 REAL(wp), PUBLIC :: resrat = 0.03_wp !: exsudation rate of microzooplankton 43 REAL(wp), PUBLIC :: mzrat = 0.0_wp !: microzooplankton mortality rate 44 REAL(wp), PUBLIC :: grazrat = 3.0_wp !: maximal microzoo grazing rate 45 REAL(wp), PUBLIC :: xkgraz = 20E-6_wp !: non assimilated fraction of P by microzoo 46 REAL(wp), PUBLIC :: unass = 0.3_wp !: Efficicency of microzoo growth 47 REAL(wp), PUBLIC :: sigma1 = 0.6_wp !: Fraction of microzoo excretion as DOM 48 REAL(wp), PUBLIC :: epsher = 0.3_wp !: half sturation constant for grazing 1 43 49 44 50 … … 63 69 INTEGER, INTENT(in) :: kt ! ocean time step 64 70 INTEGER :: ji, jj, jk 65 REAL(wp) :: zcompadi, zcompadi2, zcompaz , zcompaph, zcompapoc 66 REAL(wp) :: zgraze , zdenom , zdenom2, zstep 67 REAL(wp) :: zfact , zinano , zidiat, zipoc 71 REAL(wp) :: zcompadi, zcompaz , zcompaph, zcompapoc 72 REAL(wp) :: zgraze , zdenom, zdenom2, zncratio 73 REAL(wp) :: zfact , zstep, zfood, zfoodlim 74 REAL(wp) :: zepshert, zepsherv, zgrarsig, zgraztot, zgraztotf 68 75 REAL(wp) :: zgrarem, zgrafer, zgrapoc, zprcaca, zmortz 69 REAL(wp) :: zrespz, ztortz 76 REAL(wp) :: zrespz, ztortz, zgrasrat 70 77 REAL(wp) :: zgrazp, zgrazm, zgrazsd 71 78 REAL(wp) :: zgrazmf, zgrazsf, zgrazpf 72 79 CHARACTER (len=25) :: charout 73 74 80 !!--------------------------------------------------------------------- 75 76 77 #if defined key_diatrc 78 grazing(:,:,:) = 0. !: Initialisation of grazing 79 #endif 80 81 zstep = rfact2 / rday ! Time step duration for biology 82 81 ! 82 IF( nn_timing == 1 ) CALL timing_start('p4z_micro') 83 ! 84 grazing(:,:,:) = 0. !: grazing set to zero 83 85 DO jk = 1, jpkm1 84 86 DO jj = 1, jpj 85 87 DO ji = 1, jpi 86 zcompaz = MAX( ( trn(ji,jj,jk,jpzoo) - 1.e-9 ), 0.e0 ) 88 zcompaz = MAX( ( trn(ji,jj,jk,jpzoo) - 1.e-8 ), 0.e0 ) 89 zstep = xstep 87 90 # if defined key_degrad 88 zstep = xstep * facvol(ji,jj,jk) 89 # else 90 zstep = xstep 91 zstep = zstep * facvol(ji,jj,jk) 91 92 # endif 92 zfact = zstep * tgfunc (ji,jj,jk) * zcompaz93 zfact = zstep * tgfunc2(ji,jj,jk) * zcompaz 93 94 94 95 ! Respiration rates of both zooplankton 95 96 ! ------------------------------------- 96 zrespz = resrat * zfact * ( 1.+ 3.* nitrfac(ji,jj,jk) )&97 & * trn(ji,jj,jk,jpzoo) / ( xkmort + trn(ji,jj,jk,jpzoo))97 zrespz = resrat * zfact * trn(ji,jj,jk,jpzoo) / ( 2. * xkmort + trn(ji,jj,jk,jpzoo) ) & 98 & + resrat * zfact * 3. * nitrfac(ji,jj,jk) 98 99 99 100 ! Zooplankton mortality. A square function has been selected with … … 102 103 ztortz = mzrat * 1.e6 * zfact * trn(ji,jj,jk,jpzoo) 103 104 104 zcompadi = MAX( ( trn(ji,jj,jk,jpdia) - 1.e-8 ), 0.e0 ) 105 zcompadi2 = MIN( zcompadi, 5.e-7 ) 106 zcompaph = MAX( ( trn(ji,jj,jk,jpphy) - 2.e-7 ), 0.e0 ) 107 zcompapoc = MAX( ( trn(ji,jj,jk,jppoc) - 1.e-8 ), 0.e0 ) 105 zcompadi = MIN( MAX( ( trn(ji,jj,jk,jpdia) - xthreshdia ), 0.e0 ), xsizedia ) 106 zcompaph = MAX( ( trn(ji,jj,jk,jpphy) - xthreshphy ), 0.e0 ) 107 zcompapoc = MAX( ( trn(ji,jj,jk,jppoc) - xthreshpoc ), 0.e0 ) 108 108 109 109 ! Microzooplankton grazing 110 110 ! ------------------------ 111 zdenom2 = 1./ ( xpref2p * zcompaph + xpref2c * zcompapoc + xpref2d * zcompadi2 + rtrn ) 112 113 zgraze = grazrat * zstep * tgfunc(ji,jj,jk) * trn(ji,jj,jk,jpzoo) 114 115 zinano = xpref2p * zcompaph * zdenom2 116 zipoc = xpref2c * zcompapoc * zdenom2 117 zidiat = xpref2d * zcompadi2 * zdenom2 118 119 zdenom = 1./ ( xkgraz + zinano * zcompaph + zipoc * zcompapoc + zidiat * zcompadi2 ) 120 121 zgrazp = zgraze * zinano * zcompaph * zdenom 122 zgrazm = zgraze * zipoc * zcompapoc * zdenom 123 zgrazsd = zgraze * zidiat * zcompadi2 * zdenom 124 125 zgrazpf = zgrazp * trn(ji,jj,jk,jpnfe) / (trn(ji,jj,jk,jpphy) + rtrn) 126 zgrazmf = zgrazm * trn(ji,jj,jk,jpsfe) / (trn(ji,jj,jk,jppoc) + rtrn) 127 zgrazsf = zgrazsd * trn(ji,jj,jk,jpdfe) / (trn(ji,jj,jk,jpdia) + rtrn) 128 #if defined key_diatrc 111 zfood = xpref2p * zcompaph + xpref2c * zcompapoc + xpref2d * zcompadi 112 zfoodlim = MAX( 0. , zfood - xthresh ) 113 zdenom = zfoodlim / ( xkgraz + zfoodlim ) 114 zdenom2 = zdenom / ( zfood + rtrn ) 115 zgraze = grazrat * zstep * tgfunc2(ji,jj,jk) * trn(ji,jj,jk,jpzoo) 116 117 zgrazp = zgraze * xpref2p * zcompaph * zdenom2 118 zgrazm = zgraze * xpref2c * zcompapoc * zdenom2 119 zgrazsd = zgraze * xpref2d * zcompadi * zdenom2 120 121 zgrazpf = zgrazp * trn(ji,jj,jk,jpnfe) / (trn(ji,jj,jk,jpphy) + rtrn) 122 zgrazmf = zgrazm * trn(ji,jj,jk,jpsfe) / (trn(ji,jj,jk,jppoc) + rtrn) 123 zgrazsf = zgrazsd * trn(ji,jj,jk,jpdfe) / (trn(ji,jj,jk,jpdia) + rtrn) 124 ! 125 zgraztot = zgrazp + zgrazm + zgrazsd 126 zgraztotf = zgrazpf + zgrazsf + zgrazmf 127 129 128 ! Grazing by microzooplankton 130 grazing(ji,jj,jk) = grazing(ji,jj,jk) + zgrazp + zgrazm + zgrazsd 131 #endif 129 grazing(ji,jj,jk) = grazing(ji,jj,jk) + zgraztot 132 130 133 131 ! Various remineralization and excretion terms 134 132 ! -------------------------------------------- 135 zgrarem = ( zgrazp + zgrazm + zgrazsd ) * ( 1.- epsher - unass ) 136 zgrafer = ( zgrazpf + zgrazsf + zgrazmf ) * ( 1.- epsher - unass ) & 137 & + epsher * ( zgrazm * MAX((trn(ji,jj,jk,jpsfe) / (trn(ji,jj,jk,jppoc)+ rtrn)-ferat3),0.e0) & 138 & + zgrazp * MAX((trn(ji,jj,jk,jpnfe) / (trn(ji,jj,jk,jpphy)+ rtrn)-ferat3),0.e0) & 139 & + zgrazsd * MAX((trn(ji,jj,jk,jpdfe) / (trn(ji,jj,jk,jpdia)+ rtrn)-ferat3),0.e0 ) ) 140 141 zgrapoc = ( zgrazp + zgrazm + zgrazsd ) 133 zgrasrat = zgraztotf / ( zgraztot + rtrn ) 134 zncratio = ( xpref2p * zcompaph * quotan(ji,jj,jk) & 135 & + xpref2d * zcompadi * quotad(ji,jj,jk) + xpref2c * zcompapoc ) / ( zfood + rtrn ) 136 zepshert = epsher * MIN( 1., zncratio ) 137 zepsherv = zepshert * MIN( 1., zgrasrat / ferat3 ) 138 zgrafer = zgraztot * MAX( 0. , ( 1. - unass ) * zgrasrat - ferat3 * zepshert ) 139 zgrarem = zgraztot * ( 1. - zepsherv - unass ) 140 zgrapoc = zgraztot * unass 142 141 143 142 ! Update of the TRA arrays 144 143 ! ------------------------ 145 146 tra(ji,jj,jk,jppo4) = tra(ji,jj,jk,jppo4) + zgrar em * sigma1147 tra(ji,jj,jk,jpnh4) = tra(ji,jj,jk,jpnh4) + zgrar em * sigma1148 tra(ji,jj,jk,jpdoc) = tra(ji,jj,jk,jpdoc) + zgrarem * (1.-sigma1)149 tra(ji,jj,jk,jpoxy) = tra(ji,jj,jk,jpoxy) - o2ut * zgrar em * sigma1144 zgrarsig = zgrarem * sigma1 145 tra(ji,jj,jk,jppo4) = tra(ji,jj,jk,jppo4) + zgrarsig 146 tra(ji,jj,jk,jpnh4) = tra(ji,jj,jk,jpnh4) + zgrarsig 147 tra(ji,jj,jk,jpdoc) = tra(ji,jj,jk,jpdoc) + zgrarem - zgrarsig 148 tra(ji,jj,jk,jpoxy) = tra(ji,jj,jk,jpoxy) - o2ut * zgrarsig 150 149 tra(ji,jj,jk,jpfer) = tra(ji,jj,jk,jpfer) + zgrafer 151 tra(ji,jj,jk,jppoc) = tra(ji,jj,jk,jppoc) + zgrapoc * unass 152 tra(ji,jj,jk,jpdic) = tra(ji,jj,jk,jpdic) + zgrarem * sigma1 150 tra(ji,jj,jk,jppoc) = tra(ji,jj,jk,jppoc) + zgrapoc 151 tra(ji,jj,jk,jpsfe) = tra(ji,jj,jk,jpsfe) + zgraztotf * unass 152 tra(ji,jj,jk,jpdic) = tra(ji,jj,jk,jpdic) + zgrarsig 153 tra(ji,jj,jk,jptal) = tra(ji,jj,jk,jptal) + rno3 * zgrarsig 153 154 #if defined key_kriest 154 tra(ji,jj,jk,jpnum) = tra(ji,jj,jk,jpnum) + zgrapoc * unass *xkr_ddiat155 tra(ji,jj,jk,jpnum) = tra(ji,jj,jk,jpnum) + zgrapoc * xkr_ddiat 155 156 #endif 156 157 !158 157 ! Update the arrays TRA which contain the biological sources and sinks 159 158 ! -------------------------------------------------------------------- 160 161 159 zmortz = ztortz + zrespz 162 tra(ji,jj,jk,jpzoo) = tra(ji,jj,jk,jpzoo) - zmortz + epsher * zgrapoc160 tra(ji,jj,jk,jpzoo) = tra(ji,jj,jk,jpzoo) - zmortz + zepsherv * zgraztot 163 161 tra(ji,jj,jk,jpphy) = tra(ji,jj,jk,jpphy) - zgrazp 164 162 tra(ji,jj,jk,jpdia) = tra(ji,jj,jk,jpdia) - zgrazsd … … 170 168 tra(ji,jj,jk,jpdfe) = tra(ji,jj,jk,jpdfe) - zgrazsf 171 169 tra(ji,jj,jk,jppoc) = tra(ji,jj,jk,jppoc) + zmortz - zgrazm 172 tra(ji,jj,jk,jpsfe) = tra(ji,jj,jk,jpsfe) + ferat3 * zmortz + unass * ( zgrazpf + zgrazsf ) - (1.-unass) * zgrazmf 173 zprcaca = xfracal(ji,jj,jk) * unass * zgrazp 174 #if defined key_diatrc 170 tra(ji,jj,jk,jpsfe) = tra(ji,jj,jk,jpsfe) + ferat3 * zmortz - zgrazmf 171 zprcaca = xfracal(ji,jj,jk) * zgrazp 172 ! 173 ! calcite production 175 174 prodcal(ji,jj,jk) = prodcal(ji,jj,jk) + zprcaca ! prodcal=prodcal(nanophy)+prodcal(microzoo)+prodcal(mesozoo) 176 #endif 175 ! 177 176 zprcaca = part * zprcaca 178 177 tra(ji,jj,jk,jpdic) = tra(ji,jj,jk,jpdic) - zprcaca … … 191 190 CALL prt_ctl_trc(tab4d=tra, mask=tmask, clinfo=ctrcnm) 192 191 ENDIF 193 192 ! 193 IF( nn_timing == 1 ) CALL timing_stop('p4z_micro') 194 ! 194 195 END SUBROUTINE p4z_micro 195 196 … … 203 204 !! 204 205 !! ** Method : Read the nampiszoo namelist and check the parameters 205 !! called at the first timestep (nit000)206 !! called at the first timestep (nittrc000) 206 207 !! 207 208 !! ** input : Namelist nampiszoo … … 209 210 !!---------------------------------------------------------------------- 210 211 211 NAMELIST/nampiszoo/ grazrat,resrat,mzrat,xpref2c, xpref2p, & 212 & xpref2d, xkgraz, epsher, sigma1, unass 213 214 REWIND( numnat ) ! read numnat 215 READ ( numnat, nampiszoo ) 212 NAMELIST/nampiszoo/ part, grazrat, resrat, mzrat, xpref2c, xpref2p, & 213 & xpref2d, xthreshdia, xthreshphy, xthreshpoc, & 214 & xthresh, xkgraz, epsher, sigma1, unass 215 216 REWIND( numnatp ) ! read numnatp 217 READ ( numnatp, nampiszoo ) 216 218 217 219 IF(lwp) THEN ! control print … … 219 221 WRITE(numout,*) ' Namelist parameters for microzooplankton, nampiszoo' 220 222 WRITE(numout,*) ' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~' 221 WRITE(numout,*) ' zoo preference for POC xpref2c =', xpref2c 222 WRITE(numout,*) ' zoo preference for nano xpref2p =', xpref2p 223 WRITE(numout,*) ' zoo preference for diatoms xpref2d =', xpref2d 224 WRITE(numout,*) ' exsudation rate of microzooplankton resrat =', resrat 225 WRITE(numout,*) ' microzooplankton mortality rate mzrat =', mzrat 226 WRITE(numout,*) ' maximal microzoo grazing rate grazrat =', grazrat 227 WRITE(numout,*) ' non assimilated fraction of P by microzoo unass =', unass 228 WRITE(numout,*) ' Efficicency of microzoo growth epsher =', epsher 229 WRITE(numout,*) ' Fraction of microzoo excretion as DOM sigma1 =', sigma1 230 WRITE(numout,*) ' half sturation constant for grazing 1 xkgraz =', xkgraz 223 WRITE(numout,*) ' part of calcite not dissolved in microzoo guts part =', part 224 WRITE(numout,*) ' microzoo preference for POC xpref2c =', xpref2c 225 WRITE(numout,*) ' microzoo preference for nano xpref2p =', xpref2p 226 WRITE(numout,*) ' microzoo preference for diatoms xpref2d =', xpref2d 227 WRITE(numout,*) ' diatoms feeding threshold for microzoo xthreshdia =', xthreshdia 228 WRITE(numout,*) ' nanophyto feeding threshold for microzoo xthreshphy =', xthreshphy 229 WRITE(numout,*) ' poc feeding threshold for microzoo xthreshpoc =', xthreshpoc 230 WRITE(numout,*) ' feeding threshold for microzooplankton xthresh =', xthresh 231 WRITE(numout,*) ' exsudation rate of microzooplankton resrat =', resrat 232 WRITE(numout,*) ' microzooplankton mortality rate mzrat =', mzrat 233 WRITE(numout,*) ' maximal microzoo grazing rate grazrat =', grazrat 234 WRITE(numout,*) ' non assimilated fraction of P by microzoo unass =', unass 235 WRITE(numout,*) ' Efficicency of microzoo growth epsher =', epsher 236 WRITE(numout,*) ' Fraction of microzoo excretion as DOM sigma1 =', sigma1 237 WRITE(numout,*) ' half sturation constant for grazing 1 xkgraz =', xkgraz 231 238 ENDIF 232 239 233 240 END SUBROUTINE p4z_micro_init 241 242 INTEGER FUNCTION p4z_micro_alloc() 243 !!---------------------------------------------------------------------- 244 !! *** ROUTINE p4z_micro_alloc *** 245 !!---------------------------------------------------------------------- 246 ALLOCATE( grazing(jpi,jpj,jpk), STAT=p4z_micro_alloc ) 247 IF( p4z_micro_alloc /= 0 ) CALL ctl_warn('p4z_micro_alloc : failed to allocate arrays.') 248 249 END FUNCTION p4z_micro_alloc 234 250 235 251 #else -
trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zmort.F90
r2528 r3294 14 14 !! p4z_mort_init : Initialize the mortality params for phytoplankton 15 15 !!---------------------------------------------------------------------- 16 USE trc 17 USE oce_trc ! 18 USE trc ! 19 USE sms_pisces ! 20 USE p4zsink 21 USE prtctl_trc 16 USE oce_trc ! shared variables between ocean and passive tracers 17 USE trc ! passive tracers common variables 18 USE sms_pisces ! PISCES Source Minus Sink variables 19 USE p4zsink ! vertical flux of particulate matter due to sinking 20 USE prtctl_trc ! print control for debugging 22 21 23 22 IMPLICIT NONE … … 27 26 PUBLIC p4z_mort_init 28 27 29 30 28 !! * Shared module variables 31 REAL(wp), PUBLIC :: & 32 wchl = 0.001_wp , & !: 33 wchld = 0.02_wp , & !: 34 mprat = 0.01_wp , & !: 35 mprat2 = 0.01_wp , & !: 36 mpratm = 0.01_wp !: 29 REAL(wp), PUBLIC :: wchl = 0.001_wp !: 30 REAL(wp), PUBLIC :: wchld = 0.02_wp !: 31 REAL(wp), PUBLIC :: mprat = 0.01_wp !: 32 REAL(wp), PUBLIC :: mprat2 = 0.01_wp !: 33 REAL(wp), PUBLIC :: mpratm = 0.01_wp !: 37 34 38 35 … … 80 77 CHARACTER (len=25) :: charout 81 78 !!--------------------------------------------------------------------- 82 83 84 #if defined key_diatrc 85 prodcal(:,:,:) = 0. !: Initialisation of calcite production variable 86 #endif 87 79 ! 80 IF( nn_timing == 1 ) CALL timing_start('p4z_nano') 81 ! 82 prodcal(:,:,:) = 0. !: calcite production variable set to zero 88 83 DO jk = 1, jpkm1 89 84 DO jj = 1, jpj 90 85 DO ji = 1, jpi 91 92 86 zcompaph = MAX( ( trn(ji,jj,jk,jpphy) - 1e-8 ), 0.e0 ) 93 87 zstep = xstep 94 88 # if defined key_degrad 95 zstep = xstep * facvol(ji,jj,jk) 96 # else 97 zstep = xstep 89 zstep = zstep * facvol(ji,jj,jk) 98 90 # endif 99 91 ! Squared mortality of Phyto similar to a sedimentation term during … … 117 109 tra(ji,jj,jk,jpnfe) = tra(ji,jj,jk,jpnfe) - zmortp * zfactfe 118 110 zprcaca = xfracal(ji,jj,jk) * zmortp 119 #if defined key_diatrc 111 ! 120 112 prodcal(ji,jj,jk) = prodcal(ji,jj,jk) + zprcaca ! prodcal=prodcal(nanophy)+prodcal(microzoo)+prodcal(mesozoo) 121 #endif 113 ! 122 114 zfracal = 0.5 * xfracal(ji,jj,jk) 123 115 tra(ji,jj,jk,jpdic) = tra(ji,jj,jk,jpdic) - zprcaca … … 143 135 CALL prt_ctl_trc(tab4d=tra, mask=tmask, clinfo=ctrcnm) 144 136 ENDIF 145 137 ! 138 IF( nn_timing == 1 ) CALL timing_stop('p4z_nano') 139 ! 146 140 END SUBROUTINE p4z_nano 147 141 … … 158 152 REAL(wp) :: zrespp2, ztortp2, zmortp2, zstep 159 153 CHARACTER (len=25) :: charout 160 161 !!--------------------------------------------------------------------- 162 154 !!--------------------------------------------------------------------- 155 ! 156 IF( nn_timing == 1 ) CALL timing_start('p4z_diat') 157 ! 163 158 164 159 ! Aggregation term for diatoms is increased in case of nutrient … … 177 172 ! sticky and coagulate to sink quickly out of the euphotic zone 178 173 ! ------------------------------------------------------------ 179 174 zstep = xstep 180 175 # if defined key_degrad 181 zstep = xstep * facvol(ji,jj,jk) 182 # else 183 zstep = xstep 176 zstep = zstep * facvol(ji,jj,jk) 184 177 # endif 185 178 ! Phytoplankton respiration … … 219 212 END DO 220 213 ! 221 214 IF(ln_ctl) THEN ! print mean trends (used for debugging) 222 215 WRITE(charout, FMT="('diat')") 223 216 CALL prt_ctl_trc_info(charout) 224 217 CALL prt_ctl_trc(tab4d=tra, mask=tmask, clinfo=ctrcnm) 225 ENDIF 226 218 ENDIF 219 ! 220 IF( nn_timing == 1 ) CALL timing_stop('p4z_diat') 221 ! 227 222 END SUBROUTINE p4z_diat 228 223 … … 243 238 NAMELIST/nampismort/ wchl, wchld, mprat, mprat2, mpratm 244 239 245 REWIND( numnat ) ! read numnat246 READ ( numnat , nampismort )240 REWIND( numnatp ) ! read numnatp 241 READ ( numnatp, nampismort ) 247 242 248 243 IF(lwp) THEN ! control print -
trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zopt.F90
r2715 r3294 7 7 !! 2.0 ! 2007-12 (C. Ethe, G. Madec) F90 8 8 !! 3.2 ! 2009-04 (C. Ethe, G. Madec) optimisation 9 !! 3.4 ! 2011-06 (O. Aumont, C. Ethe) Improve light availability of nano & diat 9 10 !!---------------------------------------------------------------------- 10 11 #if defined key_pisces … … 17 18 USE oce_trc ! tracer-ocean share variables 18 19 USE sms_pisces ! Source Minus Sink of PISCES 19 USE iom 20 USE iom ! I/O manager 20 21 21 22 IMPLICIT NONE … … 52 53 !! ** Method : - ??? 53 54 !!--------------------------------------------------------------------- 54 USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released55 USE wrk_nemo, ONLY: zdepmoy => wrk_2d_1 , zetmp => wrk_2d_256 USE wrk_nemo, ONLY: zekg => wrk_3d_2 , zekr => wrk_3d_3 , zekb => wrk_3d_457 USE wrk_nemo, ONLY: ze0 => wrk_3d_5 , ze1 => wrk_3d_658 USE wrk_nemo, ONLY: ze2 => wrk_3d_7 , ze3 => wrk_3d_859 55 ! 60 56 INTEGER, INTENT(in) :: kt, jnt ! ocean time step … … 63 59 INTEGER :: irgb 64 60 REAL(wp) :: zchl, zxsi0r 65 REAL(wp) :: zc0 , zc1 , zc2, zc3 61 REAL(wp) :: zc0 , zc1 , zc2, zc3, z1_dep 62 REAL(wp), POINTER, DIMENSION(:,: ) :: zdepmoy, zetmp, zetmp1, zetmp2 63 REAL(wp), POINTER, DIMENSION(:,:,:) :: zekg, zekr, zekb, ze0, ze1, ze2, ze3 66 64 !!--------------------------------------------------------------------- 67 68 IF( wrk_in_use(2, 1,2) .OR. wrk_in_use(3, 2,3,4,5,6,7,8) ) THEN 69 CALL ctl_stop('p4z_opt: requested workspace arrays unavailable') ; RETURN 70 ENDIF 65 ! 66 IF( nn_timing == 1 ) CALL timing_start('p4z_opt') 67 ! 68 ! Allocate temporary workspace 69 CALL wrk_alloc( jpi, jpj, zdepmoy, zetmp, zetmp1, zetmp2 ) 70 CALL wrk_alloc( jpi, jpj, jpk, zekg, zekr, zekb, ze0, ze1, ze2, ze3 ) 71 71 72 72 ! Initialisation of variables used to compute PAR … … 83 83 DO ji = 1, jpi 84 84 zchl = ( trn(ji,jj,jk,jpnch) + trn(ji,jj,jk,jpdch) + rtrn ) * 1.e6 85 zchl = MIN( 10. , MAX( 0.0 3, zchl ) )85 zchl = MIN( 10. , MAX( 0.05, zchl ) ) 86 86 irgb = NINT( 41 + 20.* LOG10( zchl ) + rtrn ) 87 87 ! … … 92 92 END DO 93 93 END DO 94 95 !!gm Potential BUG must discuss with Olivier about this implementation....96 !!gm the questions are : - PAR at T-point or mean PAR over T-level....97 !!gm - shallow water: no penetration of light through the bottom....98 94 99 95 … … 145 141 etot3(:,:,1) = qsr(:,:) * tmask(:,:,1) 146 142 ! 147 DO jk = 2, nksrp +1143 DO jk = 2, nksrp + 1 148 144 !CDIR NOVERRCHK 149 145 DO jj = 1, jpj … … 188 184 zdepmoy(:,:) = 0.e0 ! ------------------------------- 189 185 zetmp (:,:) = 0.e0 190 emoy (:,:,:) = 0.e0 186 zetmp1 (:,:) = 0.e0 187 zetmp2 (:,:) = 0.e0 191 188 192 189 DO jk = 1, nksrp … … 196 193 DO ji = 1, jpi 197 194 IF( fsdepw(ji,jj,jk+1) <= hmld(ji,jj) ) THEN 198 zetmp (ji,jj) = zetmp (ji,jj) + etot(ji,jj,jk) * fse3t(ji,jj,jk) 195 zetmp (ji,jj) = zetmp (ji,jj) + etot (ji,jj,jk) * fse3t(ji,jj,jk) 196 zetmp1 (ji,jj) = zetmp1 (ji,jj) + enano(ji,jj,jk) * fse3t(ji,jj,jk) 197 zetmp2 (ji,jj) = zetmp2 (ji,jj) + ediat(ji,jj,jk) * fse3t(ji,jj,jk) 199 198 zdepmoy(ji,jj) = zdepmoy(ji,jj) + fse3t(ji,jj,jk) 200 199 ENDIF … … 210 209 !CDIR NOVERRCHK 211 210 DO ji = 1, jpi 212 IF( fsdepw(ji,jj,jk+1) <= hmld(ji,jj) ) emoy(ji,jj,jk) = zetmp(ji,jj) / ( zdepmoy(ji,jj) + rtrn ) 213 END DO 214 END DO 215 END DO 216 217 #if defined key_diatrc 218 # if ! defined key_iomput 219 ! save for outputs 220 trc2d(:,:, jp_pcs0_2d + 10) = heup(:,: ) * tmask(:,:,1) 221 trc3d(:,:,:,jp_pcs0_3d + 3) = etot(:,:,:) * tmask(:,:,:) 222 # else 223 ! write diagnostics 224 IF( jnt == nrdttrc ) then 225 CALL iom_put( "Heup", heup(:,: ) * tmask(:,:,1) ) ! euphotic layer deptht 226 CALL iom_put( "PAR" , etot(:,:,:) * tmask(:,:,:) ) ! Photosynthetically Available Radiation 211 IF( fsdepw(ji,jj,jk+1) <= hmld(ji,jj) ) THEN 212 z1_dep = 1. / ( zdepmoy(ji,jj) + rtrn ) 213 emoy (ji,jj,jk) = zetmp (ji,jj) * z1_dep 214 enano(ji,jj,jk) = zetmp1(ji,jj) * z1_dep 215 ediat(ji,jj,jk) = zetmp2(ji,jj) * z1_dep 216 ENDIF 217 END DO 218 END DO 219 END DO 220 221 IF( ln_diatrc ) THEN ! save output diagnostics 222 ! 223 IF( lk_iomput ) THEN 224 IF( jnt == nrdttrc ) THEN 225 CALL iom_put( "Heup", heup(:,: ) * tmask(:,:,1) ) ! euphotic layer deptht 226 CALL iom_put( "PAR" , etot(:,:,:) * tmask(:,:,:) ) ! Photosynthetically Available Radiation 227 ENDIF 228 ELSE 229 trc2d(:,:, jp_pcs0_2d + 10) = heup(:,: ) * tmask(:,:,1) 230 trc3d(:,:,:,jp_pcs0_3d + 3) = etot(:,:,:) * tmask(:,:,:) 231 ENDIF 232 ! 227 233 ENDIF 228 # endif 229 #endif 230 !231 IF( wrk_not_released(2, 1,2) .OR. &232 wrk_not_released(3, 2,3,4,5,6,7,8) ) CALL ctl_stop('p4z_opt: failed to release workspace arrays')234 ! 235 CALL wrk_dealloc( jpi, jpj, zdepmoy, zetmp, zetmp1, zetmp2 ) 236 CALL wrk_dealloc( jpi, jpj, jpk, zekg, zekr, zekb, ze0, ze1, ze2, ze3 ) 237 ! 238 IF( nn_timing == 1 ) CALL timing_stop('p4z_opt') 233 239 ! 234 240 END SUBROUTINE p4z_opt … … 241 247 !! ** Purpose : Initialization of tabulated attenuation coef 242 248 !!---------------------------------------------------------------------- 249 ! 250 IF( nn_timing == 1 ) CALL timing_start('p4z_opt_init') 243 251 ! 244 252 CALL trc_oce_rgb( xkrgb ) ! tabulated attenuation coefficients … … 252 260 IF( ln_qsr_bio ) etot3(:,:,:) = 0._wp 253 261 ! 262 IF( nn_timing == 1 ) CALL timing_stop('p4z_opt_init') 263 ! 254 264 END SUBROUTINE p4z_opt_init 255 265 -
trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zprod.F90
r2730 r3294 2 2 !!====================================================================== 3 3 !! *** MODULE p4zprod *** 4 !! TOP : PISCES4 !! TOP : Growth Rate of the two phytoplanktons groups 5 5 !!====================================================================== 6 6 !! History : 1.0 ! 2004 (O. Aumont) Original code 7 7 !! 2.0 ! 2007-12 (C. Ethe, G. Madec) F90 8 !! 3.4 ! 2011-05 (O. Aumont, C. Ethe) New parameterization of light limitation 8 9 !!---------------------------------------------------------------------- 9 10 #if defined key_pisces … … 11 12 !! 'key_pisces' PISCES bio-model 12 13 !!---------------------------------------------------------------------- 13 !! p4z_prod : 14 !! p4z_prod : Compute the growth Rate of the two phytoplanktons groups 15 !! p4z_prod_init : Initialization of the parameters for growth 16 !! p4z_prod_alloc : Allocate variables for growth 14 17 !!---------------------------------------------------------------------- 15 USE trc 16 USE oce_trc ! 17 USE sms_pisces ! 18 USE prtctl_trc 19 USE p4zopt 20 USE p4zint 21 USE p4zlim 22 USE iom 18 USE oce_trc ! shared variables between ocean and passive tracers 19 USE trc ! passive tracers common variables 20 USE sms_pisces ! PISCES Source Minus Sink variables 21 USE p4zopt ! optical model 22 USE p4zlim ! Co-limitations of differents nutrients 23 USE prtctl_trc ! print control for debugging 24 USE iom ! I/O manager 23 25 24 26 IMPLICIT NONE … … 29 31 PUBLIC p4z_prod_alloc 30 32 31 REAL(wp), PUBLIC :: & 32 pislope = 3.0_wp , & !: 33 pislope2 = 3.0_wp , & !: 34 excret = 10.e-5_wp , & !: 35 excret2 = 0.05_wp , & !: 36 chlcnm = 0.033_wp , & !: 37 chlcdm = 0.05_wp , & !: 38 fecnm = 10.E-6_wp , & !: 39 fecdm = 15.E-6_wp , & !: 40 grosip = 0.151_wp 41 42 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: prmax !: 33 !! * Shared module variables 34 LOGICAL , PUBLIC :: ln_newprod = .FALSE. 35 REAL(wp), PUBLIC :: pislope = 3.0_wp !: 36 REAL(wp), PUBLIC :: pislope2 = 3.0_wp !: 37 REAL(wp), PUBLIC :: excret = 10.e-5_wp !: 38 REAL(wp), PUBLIC :: excret2 = 0.05_wp !: 39 REAL(wp), PUBLIC :: bresp = 0.00333_wp !: 40 REAL(wp), PUBLIC :: chlcnm = 0.033_wp !: 41 REAL(wp), PUBLIC :: chlcdm = 0.05_wp !: 42 REAL(wp), PUBLIC :: chlcmin = 0.00333_wp !: 43 REAL(wp), PUBLIC :: fecnm = 10.E-6_wp !: 44 REAL(wp), PUBLIC :: fecdm = 15.E-6_wp !: 45 REAL(wp), PUBLIC :: grosip = 0.151_wp !: 46 47 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: prmax !: optimal production = f(temperature) 48 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: quotan !: proxy of N quota in Nanophyto 49 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: quotad !: proxy of N quota in diatomee 43 50 44 REAL(wp) :: &45 rday1 , & !: 0.6 / rday46 texcret , & !: 1 - excret47 texcret2 , & !: 1 - excret248 tpp !: Total primary production 51 REAL(wp) :: r1_rday !: 1 / rday 52 REAL(wp) :: texcret !: 1 - excret 53 REAL(wp) :: texcret2 !: 1 - excret2 54 REAL(wp) :: tpp !: Total primary production 55 49 56 50 57 !!* Substitution … … 66 73 !! ** Method : - ??? 67 74 !!--------------------------------------------------------------------- 68 USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released69 USE wrk_nemo, ONLY: zmixnano => wrk_2d_1 , zmixdiat => wrk_2d_2 , zstrn => wrk_2d_370 USE wrk_nemo, ONLY: zpislopead => wrk_3d_2 , zpislopead2 => wrk_3d_371 USE wrk_nemo, ONLY: zprdia => wrk_3d_4 , zprbio => wrk_3d_5 , zysopt => wrk_3d_672 USE wrk_nemo, ONLY: zprorca => wrk_3d_7 , zprorcad => wrk_3d_873 USE wrk_nemo, ONLY: zprofed => wrk_3d_9 , zprofen => wrk_3d_1074 USE wrk_nemo, ONLY: zprochln => wrk_3d_11 , zprochld => wrk_3d_1275 USE wrk_nemo, ONLY: zpronew => wrk_3d_13 , zpronewd => wrk_3d_1476 75 ! 77 76 INTEGER, INTENT(in) :: kt, jnt 78 77 ! 79 78 INTEGER :: ji, jj, jk 80 REAL(wp) :: zsilfac, zfact 81 REAL(wp) :: z prdiachl, zprbiochl, zsilim, ztn, zadap, zadap282 REAL(wp) :: zlim, zsilfac2, zsiborn, zprod, z etot2, zmax, zproreg, zproreg283 REAL(wp) :: zmxltst, zmxlday, z lim179 REAL(wp) :: zsilfac, zfact, znanotot, zdiattot, zconctemp, zconctemp2 80 REAL(wp) :: zratio, zmax, zsilim, ztn, zadap 81 REAL(wp) :: zlim, zsilfac2, zsiborn, zprod, zproreg, zproreg2 82 REAL(wp) :: zmxltst, zmxlday, zmaxday 84 83 REAL(wp) :: zpislopen , zpislope2n 85 REAL(wp) :: zrum, zcodel, zargu, zval, zvol 86 #if defined key_diatrc 84 REAL(wp) :: zrum, zcodel, zargu, zval 87 85 REAL(wp) :: zrfact2 88 #endif89 86 CHARACTER (len=25) :: charout 87 REAL(wp), POINTER, DIMENSION(:,: ) :: zmixnano, zmixdiat, zstrn 88 REAL(wp), POINTER, DIMENSION(:,:,:) :: zpislopead, zpislopead2, zprdia, zprbio, zprdch, zprnch, zysopt 89 REAL(wp), POINTER, DIMENSION(:,:,:) :: zprorca, zprorcad, zprofed, zprofen, zprochln, zprochld, zpronew, zpronewd 90 90 !!--------------------------------------------------------------------- 91 92 IF( wrk_in_use(2, 1,2,3) .OR. & 93 wrk_in_use(3, 2,3,4,5,6,7,8,9,10,11,12,13,14) ) THEN 94 CALL ctl_stop('p4z_prod: requested workspace arrays unavailable') ; RETURN 95 ENDIF 96 91 ! 92 IF( nn_timing == 1 ) CALL timing_start('p4z_prod') 93 ! 94 ! Allocate temporary workspace 95 CALL wrk_alloc( jpi, jpj, zmixnano, zmixdiat, zstrn ) 96 CALL wrk_alloc( jpi, jpj, jpk, zpislopead, zpislopead2, zprdia, zprbio, zprdch, zprnch, zysopt ) 97 CALL wrk_alloc( jpi, jpj, jpk, zprorca, zprorcad, zprofed, zprofen, zprochln, zprochld, zpronew, zpronewd ) 98 ! 97 99 zprorca (:,:,:) = 0._wp 98 100 zprorcad(:,:,:) = 0._wp … … 105 107 zprdia (:,:,:) = 0._wp 106 108 zprbio (:,:,:) = 0._wp 109 zprdch (:,:,:) = 0._wp 110 zprnch (:,:,:) = 0._wp 107 111 zysopt (:,:,:) = 0._wp 108 112 109 113 ! Computation of the optimal production 110 # if defined key_degrad 111 prmax(:,:,:) = rday1 * tgfunc(:,:,:) * facvol(:,:,:) 112 # else 113 prmax(:,:,:) = rday1 * tgfunc(:,:,:) 114 # endif 114 prmax(:,:,:) = 0.6_wp * r1_rday * tgfunc(:,:,:) 115 IF( lk_degrad ) prmax(:,:,:) = prmax(:,:,:) * facvol(:,:,:) 115 116 116 117 ! compute the day length depending on latitude and the day … … 119 120 120 121 ! day length in hours 121 zstrn(:,:) = 0. _wp122 zstrn(:,:) = 0. 122 123 DO jj = 1, jpj 123 124 DO ji = 1, jpi 124 125 zargu = TAN( zcodel ) * TAN( gphit(ji,jj) * rad ) 125 126 zargu = MAX( -1., MIN( 1., zargu ) ) 126 zval = MAX( 0.0, 24. - 2. * ACOS( zargu ) / rad / 15. ) 127 IF( zval < 1.e0 ) zval = 24. 128 zstrn(ji,jj) = 24. / zval 127 zstrn(ji,jj) = MAX( 0.0, 24. - 2. * ACOS( zargu ) / rad / 15. ) 129 128 END DO 130 129 END DO 131 130 132 131 IF( ln_newprod ) THEN 132 ! Impact of the day duration on phytoplankton growth 133 DO jk = 1, jpkm1 134 DO jj = 1 ,jpj 135 DO ji = 1, jpi 136 zval = MAX( 1., zstrn(ji,jj) ) 137 zval = 1.5 * zval / ( 12. + zval ) 138 zprbio(ji,jj,jk) = prmax(ji,jj,jk) * zval 139 zprdia(ji,jj,jk) = zprbio(ji,jj,jk) 140 END DO 141 END DO 142 END DO 143 ENDIF 144 145 ! Maximum light intensity 146 WHERE( zstrn(:,:) < 1.e0 ) zstrn(:,:) = 24. 147 zstrn(:,:) = 24. / zstrn(:,:) 148 149 IF( ln_newprod ) THEN 150 !CDIR NOVERRCHK 151 DO jk = 1, jpkm1 152 !CDIR NOVERRCHK 153 DO jj = 1, jpj 154 !CDIR NOVERRCHK 155 DO ji = 1, jpi 156 157 ! Computation of the P-I slope for nanos and diatoms 158 IF( etot(ji,jj,jk) > 1.E-3 ) THEN 159 ztn = MAX( 0., tsn(ji,jj,jk,jp_tem) - 15. ) 160 zadap = ztn / ( 2.+ ztn ) 161 162 zconctemp = MAX( 0.e0 , trn(ji,jj,jk,jpdia) - 5e-7 ) 163 zconctemp2 = trn(ji,jj,jk,jpdia) - zconctemp 164 165 znanotot = enano(ji,jj,jk) * zstrn(ji,jj) 166 zdiattot = ediat(ji,jj,jk) * zstrn(ji,jj) 167 168 zfact = EXP( -0.21 * znanotot ) 169 zpislopead (ji,jj,jk) = pislope * ( 1.+ zadap * zfact ) & 170 & * trn(ji,jj,jk,jpnch) /( trn(ji,jj,jk,jpphy) * 12. + rtrn) 171 172 zpislopead2(ji,jj,jk) = (pislope * zconctemp2 + pislope2 * zconctemp) / ( trn(ji,jj,jk,jpdia) + rtrn ) & 173 & * trn(ji,jj,jk,jpdch) /( trn(ji,jj,jk,jpdia) * 12. + rtrn) 174 175 ! Computation of production function for Carbon 176 ! --------------------------------------------- 177 zpislopen = zpislopead (ji,jj,jk) / ( ( r1_rday + bresp * r1_rday / chlcnm ) * rday + rtrn) 178 zpislope2n = zpislopead2(ji,jj,jk) / ( ( r1_rday + bresp * r1_rday / chlcdm ) * rday + rtrn) 179 zprbio(ji,jj,jk) = zprbio(ji,jj,jk) * ( 1.- EXP( -zpislopen * znanotot ) ) 180 zprdia(ji,jj,jk) = zprdia(ji,jj,jk) * ( 1.- EXP( -zpislope2n * zdiattot ) ) 181 182 ! Computation of production function for Chlorophyll 183 !-------------------------------------------------- 184 zmaxday = 1._wp / ( prmax(ji,jj,jk) * rday + rtrn ) 185 zprnch(ji,jj,jk) = prmax(ji,jj,jk) * ( 1.- EXP( -zpislopead (ji,jj,jk) * zmaxday * znanotot ) ) 186 zprdch(ji,jj,jk) = prmax(ji,jj,jk) * ( 1.- EXP( -zpislopead2(ji,jj,jk) * zmaxday * zdiattot ) ) 187 ENDIF 188 END DO 189 END DO 190 END DO 191 ELSE 192 !CDIR NOVERRCHK 193 DO jk = 1, jpkm1 194 !CDIR NOVERRCHK 195 DO jj = 1, jpj 196 !CDIR NOVERRCHK 197 DO ji = 1, jpi 198 199 ! Computation of the P-I slope for nanos and diatoms 200 IF( etot(ji,jj,jk) > 1.E-3 ) THEN 201 ztn = MAX( 0., tsn(ji,jj,jk,jp_tem) - 15. ) 202 zadap = ztn / ( 2.+ ztn ) 203 204 zfact = EXP( -0.21 * enano(ji,jj,jk) ) 205 zpislopead (ji,jj,jk) = pislope * ( 1.+ zadap * zfact ) 206 zpislopead2(ji,jj,jk) = pislope2 207 208 zpislopen = zpislopead(ji,jj,jk) * trn(ji,jj,jk,jpnch) & 209 & / ( trn(ji,jj,jk,jpphy) * 12. + rtrn ) & 210 & / ( prmax(ji,jj,jk) * rday * xlimphy(ji,jj,jk) + rtrn ) 211 212 zpislope2n = zpislopead2(ji,jj,jk) * trn(ji,jj,jk,jpdch) & 213 & / ( trn(ji,jj,jk,jpdia) * 12. + rtrn ) & 214 & / ( prmax(ji,jj,jk) * rday * xlimdia(ji,jj,jk) + rtrn ) 215 216 ! Computation of production function for Carbon 217 ! --------------------------------------------- 218 zprbio(ji,jj,jk) = prmax(ji,jj,jk) * ( 1.- EXP( -zpislopen * enano(ji,jj,jk) ) ) 219 zprdia(ji,jj,jk) = prmax(ji,jj,jk) * ( 1.- EXP( -zpislope2n * ediat(ji,jj,jk) ) ) 220 221 ! Computation of production function for Chlorophyll 222 !-------------------------------------------------- 223 zprnch(ji,jj,jk) = prmax(ji,jj,jk) * ( 1.- EXP( -zpislopen * enano(ji,jj,jk) * zstrn(ji,jj) ) ) 224 zprdch(ji,jj,jk) = prmax(ji,jj,jk) * ( 1.- EXP( -zpislope2n * ediat(ji,jj,jk) * zstrn(ji,jj) ) ) 225 ENDIF 226 END DO 227 END DO 228 END DO 229 ENDIF 230 231 ! Computation of a proxy of the N/C ratio 232 ! --------------------------------------- 133 233 !CDIR NOVERRCHK 134 234 DO jk = 1, jpkm1 … … 137 237 !CDIR NOVERRCHK 138 238 DO ji = 1, jpi 139 140 ! Computation of the P-I slope for nanos and diatoms 141 IF( etot(ji,jj,jk) > 1.E-3 ) THEN 142 ztn = MAX( 0., tsn(ji,jj,jk,jp_tem) - 15. ) 143 zadap = 0.+ 1.* ztn / ( 2.+ ztn ) 144 zadap2 = 0.e0 145 146 zfact = EXP( -0.21 * emoy(ji,jj,jk) ) 147 148 zpislopead (ji,jj,jk) = pislope * ( 1.+ zadap * zfact ) 149 zpislopead2(ji,jj,jk) = pislope2 * ( 1.+ zadap2 * zfact ) 150 151 zpislopen = zpislopead(ji,jj,jk) * trn(ji,jj,jk,jpnch) & 152 & / ( trn(ji,jj,jk,jpphy) * 12. + rtrn ) & 153 & / ( prmax(ji,jj,jk) * rday * xlimphy(ji,jj,jk) + rtrn ) 154 155 zpislope2n = zpislopead2(ji,jj,jk) * trn(ji,jj,jk,jpdch) & 156 & / ( trn(ji,jj,jk,jpdia) * 12. + rtrn ) & 157 & / ( prmax(ji,jj,jk) * rday * xlimdia(ji,jj,jk) + rtrn ) 158 159 ! Computation of production function 160 zprbio(ji,jj,jk) = prmax(ji,jj,jk) * & 161 & ( 1.- EXP( -zpislopen * enano(ji,jj,jk) ) ) 162 zprdia(ji,jj,jk) = prmax(ji,jj,jk) * & 163 & ( 1.- EXP( -zpislope2n * ediat(ji,jj,jk) ) ) 164 ENDIF 239 zval = ( xnanonh4(ji,jj,jk) + xnanono3(ji,jj,jk) ) * prmax(ji,jj,jk) / ( zprbio(ji,jj,jk) + rtrn ) 240 quotan(ji,jj,jk) = MIN( 1., 0.5 + 0.5 * zval ) 241 zval = ( xdiatnh4(ji,jj,jk) + xdiatno3(ji,jj,jk) ) * prmax(ji,jj,jk) / ( zprdia(ji,jj,jk) + rtrn ) 242 quotad(ji,jj,jk) = MIN( 1., 0.5 + 0.5 * zval ) 165 243 END DO 166 244 END DO … … 178 256 ! Si/C is arbitrariliy increased for very high Si concentrations 179 257 ! to mimic the very high ratios observed in the Southern Ocean (silpot2) 180 181 zlim1 = trn(ji,jj,jk,jpsil) / ( trn(ji,jj,jk,jpsil) + xksi1 ) 182 zlim = xdiatno3(ji,jj,jk) + xdiatnh4(ji,jj,jk) 183 184 zsilim = MIN( zprdia(ji,jj,jk) / ( rtrn + prmax(ji,jj,jk) ), & 185 & trn(ji,jj,jk,jpfer) / ( concdfe(ji,jj,jk) + trn(ji,jj,jk,jpfer) ), & 186 & trn(ji,jj,jk,jppo4) / ( concdnh4 + trn(ji,jj,jk,jppo4) ), & 187 & zlim ) 188 zsilfac = 5.4 * EXP( -4.23 * zsilim ) * MAX( 0.e0, MIN( 1., 2.2 * ( zlim1 - 0.5 ) ) ) + 1.e0 258 zlim = trn(ji,jj,jk,jpsil) / ( trn(ji,jj,jk,jpsil) + xksi1 ) 259 zsilim = MIN( zprdia(ji,jj,jk) / ( prmax(ji,jj,jk) + rtrn ), xlimsi(ji,jj,jk) ) 260 zsilfac = 4.4 * EXP( -4.23 * zsilim ) * MAX( 0.e0, MIN( 1., 2.2 * ( zlim - 0.5 ) ) ) + 1.e0 189 261 zsiborn = MAX( 0.e0, ( trn(ji,jj,jk,jpsil) - 15.e-6 ) ) 190 zsilfac2 = 1.+ 3.* zsiborn / ( zsiborn + xksi2 )191 zsilfac = MIN( 6.4,zsilfac * zsilfac2)192 zysopt(ji,jj,jk) = grosip * zlim 1* zsilfac262 zsilfac2 = 1.+ 2.* zsiborn / ( zsiborn + xksi2 ) 263 zsilfac = MIN( 5.4, zsilfac * zsilfac2) 264 zysopt(ji,jj,jk) = grosip * zlim * zsilfac 193 265 ENDIF 194 266 END DO … … 196 268 END DO 197 269 198 ! Computation of the limitation term due to 199 ! A mixed layer deeper than the euphotic depth 270 ! Computation of the limitation term due to a mixed layer deeper than the euphotic depth 200 271 DO jj = 1, jpj 201 272 DO ji = 1, jpi 202 273 zmxltst = MAX( 0.e0, hmld(ji,jj) - heup(ji,jj) ) 203 zmxlday = zmxltst **2 /rday204 zmixnano(ji,jj) = 1. - zmxlday / ( 1.+ zmxlday )205 zmixdiat(ji,jj) = 1. - zmxlday / ( 3.+ zmxlday )274 zmxlday = zmxltst * zmxltst * r1_rday 275 zmixnano(ji,jj) = 1. - zmxlday / ( 3. + zmxlday ) 276 zmixdiat(ji,jj) = 1. - zmxlday / ( 4. + zmxlday ) 206 277 END DO 207 278 END DO … … 219 290 END DO 220 291 221 222 !CDIR NOVERRCHK 223 DO jk = 1, jpkm1 224 !CDIR NOVERRCHK 225 DO jj = 1, jpj 226 !CDIR NOVERRCHK 227 DO ji = 1, jpi 228 229 IF( etot(ji,jj,jk) > 1.E-3 ) THEN 230 ! Computation of the various production terms for nanophyto. 231 zetot2 = enano(ji,jj,jk) * zstrn(ji,jj) 232 zmax = MAX( 0.1, xlimphy(ji,jj,jk) ) 233 zpislopen = zpislopead(ji,jj,jk) & 234 & * trn(ji,jj,jk,jpnch) / ( rtrn + trn(ji,jj,jk,jpphy) * 12.) & 235 & / ( prmax(ji,jj,jk) * rday * zmax + rtrn ) 236 237 zprbiochl = prmax(ji,jj,jk) * ( 1.- EXP( -zpislopen * zetot2 ) ) 238 239 zprorca(ji,jj,jk) = zprbio(ji,jj,jk) * xlimphy(ji,jj,jk) * trn(ji,jj,jk,jpphy) * rfact2 240 241 zpronew(ji,jj,jk) = zprorca(ji,jj,jk) * xnanono3(ji,jj,jk) & 242 & / ( xnanono3(ji,jj,jk) + xnanonh4(ji,jj,jk) + rtrn ) 243 zprod = rday * zprorca(ji,jj,jk) * zprbiochl * trn(ji,jj,jk,jpphy) *zmax 244 245 zprofen(ji,jj,jk) = (fecnm)**2 * zprod / chlcnm & 246 & / ( zpislopead(ji,jj,jk) * zetot2 * trn(ji,jj,jk,jpnfe) + rtrn ) 247 248 zprochln(ji,jj,jk) = chlcnm * 144. * zprod & 249 & / ( zpislopead(ji,jj,jk) * zetot2 * trn(ji,jj,jk,jpnch) + rtrn ) 250 ENDIF 251 END DO 252 END DO 253 END DO 254 292 ! Computation of the various production terms 255 293 !CDIR NOVERRCHK 256 294 DO jk = 1, jpkm1 … … 260 298 DO ji = 1, jpi 261 299 IF( etot(ji,jj,jk) > 1.E-3 ) THEN 262 ! Computation of the various production terms for diatoms 263 zetot2 = ediat(ji,jj,jk) * zstrn(ji,jj) 264 zmax = MAX( 0.1, xlimdia(ji,jj,jk) ) 265 zpislope2n = zpislopead2(ji,jj,jk) * trn(ji,jj,jk,jpdch) & 266 & / ( rtrn + trn(ji,jj,jk,jpdia) * 12.) & 267 & / ( prmax(ji,jj,jk) * rday * zmax + rtrn ) 268 269 zprdiachl = prmax(ji,jj,jk) * ( 1.- EXP( -zetot2 * zpislope2n ) ) 270 300 ! production terms for nanophyto. 301 zprorca(ji,jj,jk) = zprbio(ji,jj,jk) * xlimphy(ji,jj,jk) * trn(ji,jj,jk,jpphy) * rfact2 302 zpronew(ji,jj,jk) = zprorca(ji,jj,jk) * xnanono3(ji,jj,jk) / ( xnanono3(ji,jj,jk) + xnanonh4(ji,jj,jk) + rtrn ) 303 ! 304 zratio = trn(ji,jj,jk,jpnfe) / ( trn(ji,jj,jk,jpphy) + rtrn ) 305 zratio = zratio / fecnm 306 zmax = MAX( 0., ( 1. - zratio ) / ABS( 1.05 - zratio ) ) 307 zprofen(ji,jj,jk) = fecnm * prmax(ji,jj,jk) & 308 & * ( 4. - 4.5 * xlimnfe(ji,jj,jk) / ( xlimnfe(ji,jj,jk) + 0.5 ) ) & 309 & * trn(ji,jj,jk,jpfer) / ( trn(ji,jj,jk,jpfer) + concnfe(ji,jj,jk) ) & 310 & * zmax * trn(ji,jj,jk,jpphy) * rfact2 311 ! production terms for diatomees 271 312 zprorcad(ji,jj,jk) = zprdia(ji,jj,jk) * xlimdia(ji,jj,jk) * trn(ji,jj,jk,jpdia) * rfact2 272 273 zpronewd(ji,jj,jk) = zprorcad(ji,jj,jk) * xdiatno3(ji,jj,jk) & 274 & / ( xdiatno3(ji,jj,jk) + xdiatnh4(ji,jj,jk) + rtrn ) 275 276 zprod = rday * zprorcad(ji,jj,jk) * zprdiachl * trn(ji,jj,jk,jpdia) * zmax 277 278 zprofed(ji,jj,jk) = (fecdm)**2 * zprod / chlcdm & 279 & / ( zpislopead2(ji,jj,jk) * zetot2 * trn(ji,jj,jk,jpdfe) + rtrn ) 280 281 zprochld(ji,jj,jk) = chlcdm * 144. * zprod & 282 & / ( zpislopead2(ji,jj,jk) * zetot2 * trn(ji,jj,jk,jpdch) + rtrn ) 283 313 zpronewd(ji,jj,jk) = zprorcad(ji,jj,jk) * xdiatno3(ji,jj,jk) / ( xdiatno3(ji,jj,jk) + xdiatnh4(ji,jj,jk) + rtrn ) 314 ! 315 zratio = trn(ji,jj,jk,jpdfe) / ( trn(ji,jj,jk,jpdia) + rtrn ) 316 zratio = zratio / fecdm 317 zmax = MAX( 0., ( 1. - zratio ) / ABS( 1.05 - zratio ) ) 318 zprofed(ji,jj,jk) = fecdm * prmax(ji,jj,jk) & 319 & * ( 4. - 4.5 * xlimdfe(ji,jj,jk) / ( xlimdfe(ji,jj,jk) + 0.5 ) ) & 320 & * trn(ji,jj,jk,jpfer) / ( trn(ji,jj,jk,jpfer) + concdfe(ji,jj,jk) ) & 321 & * zmax * trn(ji,jj,jk,jpdia) * rfact2 284 322 ENDIF 285 323 END DO 286 324 END DO 287 325 END DO 288 ! 326 327 IF( ln_newprod ) THEN 328 !CDIR NOVERRCHK 329 DO jk = 1, jpkm1 330 !CDIR NOVERRCHK 331 DO jj = 1, jpj 332 !CDIR NOVERRCHK 333 DO ji = 1, jpi 334 IF( fsdepw(ji,jj,jk+1) <= hmld(ji,jj) ) THEN 335 zprnch(ji,jj,jk) = zprnch(ji,jj,jk) * zmixnano(ji,jj) 336 zprdch(ji,jj,jk) = zprdch(ji,jj,jk) * zmixdiat(ji,jj) 337 ENDIF 338 IF( etot(ji,jj,jk) > 1.E-3 ) THEN 339 ! production terms for nanophyto. ( chlorophyll ) 340 znanotot = enano(ji,jj,jk) * zstrn(ji,jj) 341 zprod = rday * zprorca(ji,jj,jk) * zprnch(ji,jj,jk) * xlimphy(ji,jj,jk) 342 zprochln(ji,jj,jk) = chlcmin * 12. * zprorca (ji,jj,jk) 343 zprochln(ji,jj,jk) = zprochln(ji,jj,jk) + chlcnm * 12. * zprod / ( zpislopead(ji,jj,jk) * znanotot +rtrn) 344 ! production terms for diatomees ( chlorophyll ) 345 zdiattot = ediat(ji,jj,jk) * zstrn(ji,jj) 346 zprod = rday * zprorcad(ji,jj,jk) * zprdch(ji,jj,jk) * xlimdia(ji,jj,jk) 347 zprochld(ji,jj,jk) = chlcmin * 12. * zprorcad(ji,jj,jk) 348 zprochld(ji,jj,jk) = zprochld(ji,jj,jk) + chlcdm * 12. * zprod / ( zpislopead2(ji,jj,jk) * zdiattot +rtrn ) 349 ENDIF 350 END DO 351 END DO 352 END DO 353 ELSE 354 !CDIR NOVERRCHK 355 DO jk = 1, jpkm1 356 !CDIR NOVERRCHK 357 DO jj = 1, jpj 358 !CDIR NOVERRCHK 359 DO ji = 1, jpi 360 IF( etot(ji,jj,jk) > 1.E-3 ) THEN 361 ! production terms for nanophyto. ( chlorophyll ) 362 znanotot = enano(ji,jj,jk) * zstrn(ji,jj) 363 zprod = rday * zprorca(ji,jj,jk) * zprnch(ji,jj,jk) * trn(ji,jj,jk,jpphy) * xlimphy(ji,jj,jk) 364 zprochln(ji,jj,jk) = chlcnm * 144. * zprod / ( zpislopead(ji,jj,jk) * trn(ji,jj,jk,jpnch) * znanotot +rtrn) 365 ! production terms for diatomees ( chlorophyll ) 366 zdiattot = ediat(ji,jj,jk) * zstrn(ji,jj) 367 zprod = rday * zprorcad(ji,jj,jk) * zprdch(ji,jj,jk) * trn(ji,jj,jk,jpdia) * xlimdia(ji,jj,jk) 368 zprochld(ji,jj,jk) = chlcdm * 144. * zprod / ( zpislopead2(ji,jj,jk) * trn(ji,jj,jk,jpdch) * zdiattot +rtrn ) 369 ENDIF 370 END DO 371 END DO 372 END DO 373 ENDIF 289 374 290 375 ! Update the arrays TRA which contain the biological sources and sinks … … 304 389 tra(ji,jj,jk,jpdfe) = tra(ji,jj,jk,jpdfe) + zprofed(ji,jj,jk) * texcret2 305 390 tra(ji,jj,jk,jpbsi) = tra(ji,jj,jk,jpbsi) + zprorcad(ji,jj,jk) * zysopt(ji,jj,jk) * texcret2 306 tra(ji,jj,jk,jpdoc) = tra(ji,jj,jk,jpdoc) + & 307 & excret2 * zprorcad(ji,jj,jk) + excret * zprorca(ji,jj,jk) 391 tra(ji,jj,jk,jpdoc) = tra(ji,jj,jk,jpdoc) + excret2 * zprorcad(ji,jj,jk) + excret * zprorca(ji,jj,jk) 308 392 tra(ji,jj,jk,jpoxy) = tra(ji,jj,jk,jpoxy) + o2ut * ( zproreg + zproreg2) & 309 & + ( o2ut + o2nit ) * ( zpronew(ji,jj,jk) + zpronewd(ji,jj,jk) ) 310 tra(ji,jj,jk,jpfer) = tra(ji,jj,jk,jpfer) & 311 & - texcret * zprofen(ji,jj,jk) - texcret2 * zprofed(ji,jj,jk) 312 tra(ji,jj,jk,jpsil) = tra(ji,jj,jk,jpsil) & 313 & - texcret2 * zprorcad(ji,jj,jk) * zysopt(ji,jj,jk) 393 & + ( o2ut + o2nit ) * ( zpronew(ji,jj,jk) + zpronewd(ji,jj,jk) ) 394 tra(ji,jj,jk,jpfer) = tra(ji,jj,jk,jpfer) - texcret * zprofen(ji,jj,jk) - texcret2 * zprofed(ji,jj,jk) 395 tra(ji,jj,jk,jpsil) = tra(ji,jj,jk,jpsil) - texcret2 * zprorcad(ji,jj,jk) * zysopt(ji,jj,jk) 314 396 tra(ji,jj,jk,jpdic) = tra(ji,jj,jk,jpdic) - zprorca(ji,jj,jk) - zprorcad(ji,jj,jk) 315 tra(ji,jj,jk,jptal) = tra(ji,jj,jk,jptal) &316 & + rno3 * ( zpronew(ji,jj,jk) + zpronewd(ji,jj,jk))397 tra(ji,jj,jk,jptal) = tra(ji,jj,jk,jptal) + rno3 * ( zpronew(ji,jj,jk) + zpronewd(ji,jj,jk) ) & 398 & - rno3 * ( zproreg + zproreg2 ) 317 399 END DO 318 400 END DO … … 320 402 321 403 ! Total primary production per year 322 323 #if defined key_degrad324 tpp = tpp + glob_sum( ( zprorca(:,:,:) + zprorcad(:,:,:) ) * cvol(:,:,:) * facvol(:,:,:) )325 #else326 404 tpp = tpp + glob_sum( ( zprorca(:,:,:) + zprorcad(:,:,:) ) * cvol(:,:,:) ) 327 #endif 328 329 IF( kt == nitend .AND. jnt == nrdttrc .AND. lwp ) THEN 405 406 IF( kt == nitend .AND. jnt == nrdttrc ) THEN 330 407 WRITE(numout,*) 'Total PP (Gtc) :' 331 408 WRITE(numout,*) '-------------------- : ',tpp * 12. / 1.E12 … … 333 410 ENDIF 334 411 335 #if defined key_diatrc && ! defined key_iomput 336 ! Supplementary diagnostics 337 zrfact2 = 1.e3 * rfact2r 338 trc3d(:,:,:,jp_pcs0_3d + 4) = zprorca (:,:,:) * zrfact2 * tmask(:,:,:) 339 trc3d(:,:,:,jp_pcs0_3d + 5) = zprorcad(:,:,:) * zrfact2 * tmask(:,:,:) 340 trc3d(:,:,:,jp_pcs0_3d + 6) = zpronew (:,:,:) * zrfact2 * tmask(:,:,:) 341 trc3d(:,:,:,jp_pcs0_3d + 7) = zpronewd(:,:,:) * zrfact2 * tmask(:,:,:) 342 trc3d(:,:,:,jp_pcs0_3d + 8) = zprorcad(:,:,:) * zrfact2 * tmask(:,:,:) * zysopt(:,:,:) 343 trc3d(:,:,:,jp_pcs0_3d + 9) = zprofed (:,:,:) * zrfact2 * tmask(:,:,:) 412 IF( ln_diatrc ) THEN 413 ! 414 zrfact2 = 1.e3 * rfact2r 415 IF( lk_iomput ) THEN 416 IF( jnt == nrdttrc ) THEN 417 CALL iom_put( "PPPHY" , zprorca (:,:,:) * zrfact2 * tmask(:,:,:) ) ! primary production by nanophyto 418 CALL iom_put( "PPPHY2", zprorcad(:,:,:) * zrfact2 * tmask(:,:,:) ) ! primary production by diatom 419 CALL iom_put( "PPNEWN", zpronew (:,:,:) * zrfact2 * tmask(:,:,:) ) ! new primary production by nanophyto 420 CALL iom_put( "PPNEWD", zpronewd(:,:,:) * zrfact2 * tmask(:,:,:) ) ! new primary production by diatom 421 CALL iom_put( "PBSi" , zprorcad(:,:,:) * zrfact2 * tmask(:,:,:) * zysopt(:,:,:) ) ! biogenic silica production 422 CALL iom_put( "PFeD" , zprofed (:,:,:) * zrfact2 * tmask(:,:,:) ) ! biogenic iron production by diatom 423 CALL iom_put( "PFeN" , zprofen (:,:,:) * zrfact2 * tmask(:,:,:) ) ! biogenic iron production by nanophyto 424 ENDIF 425 ELSE 426 trc3d(:,:,:,jp_pcs0_3d + 4) = zprorca (:,:,:) * zrfact2 * tmask(:,:,:) 427 trc3d(:,:,:,jp_pcs0_3d + 5) = zprorcad(:,:,:) * zrfact2 * tmask(:,:,:) 428 trc3d(:,:,:,jp_pcs0_3d + 6) = zpronew (:,:,:) * zrfact2 * tmask(:,:,:) 429 trc3d(:,:,:,jp_pcs0_3d + 7) = zpronewd(:,:,:) * zrfact2 * tmask(:,:,:) 430 trc3d(:,:,:,jp_pcs0_3d + 8) = zprorcad(:,:,:) * zrfact2 * tmask(:,:,:) * zysopt(:,:,:) 431 trc3d(:,:,:,jp_pcs0_3d + 9) = zprofed (:,:,:) * zrfact2 * tmask(:,:,:) 344 432 # if ! defined key_kriest 345 trc3d(:,:,:,jp_pcs0_3d + 10) = zprofen (:,:,:) * zrfact2 * tmask(:,:,:)433 trc3d(:,:,:,jp_pcs0_3d + 10) = zprofen (:,:,:) * zrfact2 * tmask(:,:,:) 346 434 # endif 347 #endif 348 349 #if defined key_diatrc && defined key_iomput 350 zrfact2 = 1.e3 * rfact2r 351 IF ( jnt == nrdttrc ) then 352 CALL iom_put( "PPPHY" , zprorca (:,:,:) * zrfact2 * tmask(:,:,:) ) ! primary production by nanophyto 353 CALL iom_put( "PPPHY2", zprorcad(:,:,:) * zrfact2 * tmask(:,:,:) ) ! primary production by diatom 354 CALL iom_put( "PPNEWN", zpronew (:,:,:) * zrfact2 * tmask(:,:,:) ) ! new primary production by nanophyto 355 CALL iom_put( "PPNEWD", zpronewd(:,:,:) * zrfact2 * tmask(:,:,:) ) ! new primary production by diatom 356 CALL iom_put( "PBSi" , zprorcad(:,:,:) * zrfact2 * tmask(:,:,:) * zysopt(:,:,:) ) ! biogenic silica production 357 CALL iom_put( "PFeD" , zprofed (:,:,:) * zrfact2 * tmask(:,:,:) ) ! biogenic iron production by diatom 358 CALL iom_put( "PFeN" , zprofen (:,:,:) * zrfact2 * tmask(:,:,:) ) ! biogenic iron production by nanophyto 359 ENDIF 360 #endif 435 ENDIF 436 ! 437 ENDIF 361 438 362 439 IF(ln_ctl) THEN ! print mean trends (used for debugging) … … 365 442 CALL prt_ctl_trc(tab4d=tra, mask=tmask, clinfo=ctrcnm) 366 443 ENDIF 367 368 IF( wrk_not_released(2, 1,2,3) .OR. & 369 wrk_not_released(3, 2,3,4,5,6,7,8,9,10,11,12,13,14) ) & 370 CALL ctl_stop('p4z_prod: failed to release workspace arrays') 444 ! 445 CALL wrk_dealloc( jpi, jpj, zmixnano, zmixdiat, zstrn ) 446 CALL wrk_dealloc( jpi, jpj, jpk, zpislopead, zpislopead2, zprdia, zprbio, zprdch, zprnch, zysopt ) 447 CALL wrk_dealloc( jpi, jpj, jpk, zprorca, zprorcad, zprofed, zprofen, zprochln, zprochld, zpronew, zpronewd ) 448 ! 449 IF( nn_timing == 1 ) CALL timing_stop('p4z_prod') 371 450 ! 372 451 END SUBROUTINE p4z_prod … … 380 459 !! 381 460 !! ** Method : Read the nampisprod namelist and check the parameters 382 !! called at the first timestep (nit 000)461 !! called at the first timestep (nittrc000) 383 462 !! 384 463 !! ** input : Namelist nampisprod 385 464 !!---------------------------------------------------------------------- 386 NAMELIST/nampisprod/ pislope, pislope2, excret, excret2, chlcnm, chlcdm, & 387 & fecnm, fecdm, grosip 465 ! 466 NAMELIST/nampisprod/ pislope, pislope2, ln_newprod, bresp, excret, excret2, & 467 & chlcnm, chlcdm, chlcmin, fecnm, fecdm, grosip 388 468 !!---------------------------------------------------------------------- 389 469 390 REWIND( numnat ) ! read numnat391 READ ( numnat , nampisprod )470 REWIND( numnatp ) ! read numnatp 471 READ ( numnatp, nampisprod ) 392 472 393 473 IF(lwp) THEN ! control print … … 395 475 WRITE(numout,*) ' Namelist parameters for phytoplankton growth, nampisprod' 396 476 WRITE(numout,*) ' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~' 397 WRITE(numout,*) ' mean Si/C ratio grosip =', grosip 398 WRITE(numout,*) ' P-I slope pislope =', pislope 399 WRITE(numout,*) ' excretion ratio of nanophytoplankton excret =', excret 400 WRITE(numout,*) ' excretion ratio of diatoms excret2 =', excret2 401 WRITE(numout,*) ' P-I slope for diatoms pislope2 =', pislope2 402 WRITE(numout,*) ' Minimum Chl/C in nanophytoplankton chlcnm =', chlcnm 403 WRITE(numout,*) ' Minimum Chl/C in diatoms chlcdm =', chlcdm 404 WRITE(numout,*) ' Maximum Fe/C in nanophytoplankton fecnm =', fecnm 405 WRITE(numout,*) ' Minimum Fe/C in diatoms fecdm =', fecdm 406 ENDIF 407 ! 408 rday1 = 0.6 / rday 409 texcret = 1.0 - excret 410 texcret2 = 1.0 - excret2 411 tpp = 0. 477 WRITE(numout,*) ' Enable new parame. of production (T/F) ln_newprod =', ln_newprod 478 WRITE(numout,*) ' mean Si/C ratio grosip =', grosip 479 WRITE(numout,*) ' P-I slope pislope =', pislope 480 WRITE(numout,*) ' excretion ratio of nanophytoplankton excret =', excret 481 WRITE(numout,*) ' excretion ratio of diatoms excret2 =', excret2 482 IF( ln_newprod ) THEN 483 WRITE(numout,*) ' basal respiration in phytoplankton bresp =', bresp 484 WRITE(numout,*) ' Maximum Chl/C in phytoplankton chlcmin =', chlcmin 485 ENDIF 486 WRITE(numout,*) ' P-I slope for diatoms pislope2 =', pislope2 487 WRITE(numout,*) ' Minimum Chl/C in nanophytoplankton chlcnm =', chlcnm 488 WRITE(numout,*) ' Minimum Chl/C in diatoms chlcdm =', chlcdm 489 WRITE(numout,*) ' Maximum Fe/C in nanophytoplankton fecnm =', fecnm 490 WRITE(numout,*) ' Minimum Fe/C in diatoms fecdm =', fecdm 491 ENDIF 492 ! 493 r1_rday = 1._wp / rday 494 texcret = 1._wp - excret 495 texcret2 = 1._wp - excret2 496 tpp = 0._wp 412 497 ! 413 498 END SUBROUTINE p4z_prod_init … … 418 503 !! *** ROUTINE p4z_prod_alloc *** 419 504 !!---------------------------------------------------------------------- 420 ALLOCATE( prmax(jpi,jpj,jpk), STAT=p4z_prod_alloc )505 ALLOCATE( prmax(jpi,jpj,jpk), quotan(jpi,jpj,jpk), quotad(jpi,jpj,jpk), STAT = p4z_prod_alloc ) 421 506 ! 422 507 IF( p4z_prod_alloc /= 0 ) CALL ctl_warn('p4z_prod_alloc : failed to allocate arrays.') -
trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zrem.F90
r2773 r3294 6 6 !! History : 1.0 ! 2004 (O. Aumont) Original code 7 7 !! 2.0 ! 2007-12 (C. Ethe, G. Madec) F90 8 !! 3.4 ! 2011-06 (O. Aumont, C. Ethe) Quota model for iron 8 9 !!---------------------------------------------------------------------- 9 10 #if defined key_pisces … … 12 13 !! 'key_pisces' PISCES bio-model 13 14 !!---------------------------------------------------------------------- 14 !! p4z_rem : Compute remineralization/scavenging of organic compounds 15 !!---------------------------------------------------------------------- 16 USE trc 17 USE oce_trc ! 18 USE sms_pisces ! 19 USE prtctl_trc 20 USE p4zint 21 USE p4zopt 22 USE p4zmeso 23 USE p4zprod 24 USE p4zche 15 !! p4z_rem : Compute remineralization/scavenging of organic compounds 16 !! p4z_rem_init : Initialisation of parameters for remineralisation 17 !! p4z_rem_alloc : Allocate remineralisation variables 18 !!---------------------------------------------------------------------- 19 USE oce_trc ! shared variables between ocean and passive tracers 20 USE trc ! passive tracers common variables 21 USE sms_pisces ! PISCES Source Minus Sink variables 22 USE p4zopt ! optical model 23 USE p4zche ! chemical model 24 USE p4zprod ! Growth rate of the 2 phyto groups 25 USE p4zmeso ! Sources and sinks of mesozooplankton 26 USE p4zint ! interpolation and computation of various fields 27 USE prtctl_trc ! print control for debugging 25 28 26 29 IMPLICIT NONE … … 31 34 PUBLIC p4z_rem_alloc 32 35 33 REAL(wp), PUBLIC :: & 34 xremik = 0.3_wp , & !: 35 xremip = 0.025_wp , & !: 36 nitrif = 0.05_wp , & !: 37 xsirem = 0.015_wp , & !: 38 xlam1 = 0.005_wp , & !: 39 oxymin = 1.e-6_wp !: 40 41 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: denitr !: denitrification array 36 !! * Shared module variables 37 REAL(wp), PUBLIC :: xremik = 0.3_wp !: remineralisation rate of POC 38 REAL(wp), PUBLIC :: xremip = 0.025_wp !: remineralisation rate of DOC 39 REAL(wp), PUBLIC :: nitrif = 0.05_wp !: NH4 nitrification rate 40 REAL(wp), PUBLIC :: xsirem = 0.003_wp !: remineralisation rate of POC 41 REAL(wp), PUBLIC :: xsiremlab = 0.025_wp !: fast remineralisation rate of POC 42 REAL(wp), PUBLIC :: xsilab = 0.31_wp !: fraction of labile biogenic silica 43 REAL(wp), PUBLIC :: xlam1 = 0.005_wp !: scavenging rate of Iron 44 REAL(wp), PUBLIC :: oxymin = 1.e-6_wp !: halk saturation constant for anoxia 45 REAL(wp), PUBLIC :: ligand = 0.6E-9_wp !: ligand concentration in the ocean 46 47 48 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: denitr !: denitrification array 49 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: denitnh4 !: - - - - - 42 50 43 51 … … 59 67 !! ** Method : - ??? 60 68 !!--------------------------------------------------------------------- 61 USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released62 USE wrk_nemo, ONLY: ztempbac => wrk_2d_163 USE wrk_nemo, ONLY: zdepbac => wrk_3d_2 , zolimi => wrk_3d_364 69 ! 65 70 INTEGER, INTENT(in) :: kt ! ocean time step 66 71 ! 67 72 INTEGER :: ji, jj, jk 68 REAL(wp) :: zremip, zremik , zlam1b 73 REAL(wp) :: zremip, zremik , zlam1b, zdepbac2 69 74 REAL(wp) :: zkeq , zfeequi, zsiremin, zfesatur 70 REAL(wp) :: zsatur, zsatur2, znusil 75 REAL(wp) :: zsatur, zsatur2, znusil, zdep, zfactdep 71 76 REAL(wp) :: zbactfer, zorem, zorem2, zofer 72 REAL(wp) :: zosil, zdenom1, zscave, zaggdfe 77 REAL(wp) :: zosil, zdenom1, zscave, zaggdfe, zcoag 73 78 #if ! defined key_kriest 74 79 REAL(wp) :: zofer2, zdenom, zdenom2 … … 76 81 REAL(wp) :: zlamfac, zonitr, zstep 77 82 CHARACTER (len=25) :: charout 83 REAL(wp), POINTER, DIMENSION(:,: ) :: ztempbac 84 REAL(wp), POINTER, DIMENSION(:,:,:) :: zdepbac, zolimi, zolimi2 78 85 !!--------------------------------------------------------------------- 79 80 IF( wrk_in_use(2, 1) .OR. wrk_in_use(3, 2,3) ) THEN 81 CALL ctl_stop('p4z_rem: requested workspace arrays unavailable') ; RETURN 82 ENDIF 86 ! 87 IF( nn_timing == 1 ) CALL timing_start('p4z_rem') 88 ! 89 ! Allocate temporary workspace 90 CALL wrk_alloc( jpi, jpj, ztempbac ) 91 CALL wrk_alloc( jpi, jpj, jpk, zdepbac, zolimi, zolimi2 ) 83 92 84 93 ! Initialisation of temprary arrys 85 94 zdepbac (:,:,:) = 0._wp 86 95 zolimi (:,:,:) = 0._wp 96 zolimi2 (:,:,:) = 0._wp 87 97 ztempbac(:,:) = 0._wp 88 98 … … 93 103 DO jj = 1, jpj 94 104 DO ji = 1, jpi 95 IF( fsdept(ji,jj,jk) < 120. ) THEN 105 zdep = MAX( hmld(ji,jj), heup(ji,jj) ) 106 IF( fsdept(ji,jj,jk) < zdep ) THEN 96 107 zdepbac(ji,jj,jk) = MIN( 0.7 * ( trn(ji,jj,jk,jpzoo) + 2.* trn(ji,jj,jk,jpmes) ), 4.e-6 ) 97 108 ztempbac(ji,jj) = zdepbac(ji,jj,jk) 98 109 ELSE 99 zdepbac(ji,jj,jk) = MIN( 1., 120./ fsdept(ji,jj,jk) ) * ztempbac(ji,jj)110 zdepbac(ji,jj,jk) = MIN( 1., zdep / fsdept(ji,jj,jk) ) * ztempbac(ji,jj) 100 111 ENDIF 101 112 END DO … … 117 128 DO jj = 1, jpj 118 129 DO ji = 1, jpi 130 zstep = xstep 119 131 # if defined key_degrad 120 zstep = xstep * facvol(ji,jj,jk) 121 # else 122 zstep = xstep 132 zstep = zstep * facvol(ji,jj,jk) 123 133 # endif 124 134 ! DOC ammonification. Depends on depth, phytoplankton biomass … … 126 136 ! of the bacterial activity. 127 137 zremik = xremik * zstep / 1.e-6 * xlimbac(ji,jj,jk) * zdepbac(ji,jj,jk) 128 zremik = MAX( zremik, 5.5e-4 * xstep ) 129 138 zremik = MAX( zremik, 2.e-4 * xstep ) 130 139 ! Ammonification in oxic waters with oxygen consumption 131 140 ! ----------------------------------------------------- 132 zolimi(ji,jj,jk) = MIN( ( trn(ji,jj,jk,jpoxy) - rtrn ) / o2ut, & 133 & zremik * ( 1.- nitrfac(ji,jj,jk) ) * trn(ji,jj,jk,jpdoc) ) 134 141 zolimi (ji,jj,jk) = zremik * ( 1.- nitrfac(ji,jj,jk) ) * trn(ji,jj,jk,jpdoc) 142 zolimi2(ji,jj,jk) = MIN( ( trn(ji,jj,jk,jpoxy) - rtrn ) / o2ut, zolimi(ji,jj,jk) ) 135 143 ! Ammonification in suboxic waters with denitrification 136 144 ! ------------------------------------------------------- 137 denitr(ji,jj,jk) = MIN( ( trn(ji,jj,jk,jpno3) - rtrn ) / rdenit, &145 denitr(ji,jj,jk) = MIN( ( trn(ji,jj,jk,jpno3) - rtrn ) / rdenit, & 138 146 & zremik * nitrfac(ji,jj,jk) * trn(ji,jj,jk,jpdoc) ) 139 END DO 140 END DO 141 END DO 142 143 DO jk = 1, jpkm1 144 DO jj = 1, jpj 145 DO ji = 1, jpi 147 ! 146 148 zolimi (ji,jj,jk) = MAX( 0.e0, zolimi (ji,jj,jk) ) 149 zolimi2(ji,jj,jk) = MAX( 0.e0, zolimi2(ji,jj,jk) ) 147 150 denitr (ji,jj,jk) = MAX( 0.e0, denitr (ji,jj,jk) ) 148 END DO 149 END DO 150 END DO 151 152 DO jk = 1, jpkm1 153 DO jj = 1, jpj 154 DO ji = 1, jpi 151 ! 152 END DO 153 END DO 154 END DO 155 156 157 DO jk = 1, jpkm1 158 DO jj = 1, jpj 159 DO ji = 1, jpi 160 zstep = xstep 155 161 # if defined key_degrad 156 zstep = xstep * facvol(ji,jj,jk) 157 # else 158 zstep = xstep 162 zstep = zstep * facvol(ji,jj,jk) 159 163 # endif 160 164 ! NH4 nitrification to NO3. Ceased for oxygen concentrations 161 165 ! below 2 umol/L. Inhibited at strong light 162 166 ! ---------------------------------------------------------- 163 zonitr = 164 167 zonitr =nitrif * zstep * trn(ji,jj,jk,jpnh4) / ( 1.+ emoy(ji,jj,jk) ) * ( 1.- nitrfac(ji,jj,jk) ) 168 denitnh4(ji,jj,jk) = nitrif * zstep * trn(ji,jj,jk,jpnh4) * nitrfac(ji,jj,jk) 165 169 ! Update of the tracers trends 166 170 ! ---------------------------- 167 168 tra(ji,jj,jk,jpnh4) = tra(ji,jj,jk,jpnh4) - zonitr 169 tra(ji,jj,jk,jpno3) = tra(ji,jj,jk,jpno3) + zonitr 171 tra(ji,jj,jk,jpnh4) = tra(ji,jj,jk,jpnh4) - zonitr - denitnh4(ji,jj,jk) 172 tra(ji,jj,jk,jpno3) = tra(ji,jj,jk,jpno3) + zonitr - rdenita * denitnh4(ji,jj,jk) 170 173 tra(ji,jj,jk,jpoxy) = tra(ji,jj,jk,jpoxy) - o2nit * zonitr 171 tra(ji,jj,jk,jptal) = tra(ji,jj,jk,jptal) - rno3 * zonitr 172 174 tra(ji,jj,jk,jptal) = tra(ji,jj,jk,jptal) - 2 * rno3 * zonitr + rno3 * ( rdenita - 1. ) * denitnh4(ji,jj,jk) 173 175 END DO 174 176 END DO … … 189 191 ! studies (especially at Papa) have shown this uptake to be significant 190 192 ! ---------------------------------------------------------- 191 z bactfer = 15.e-6 * rfact2 * 4.* 0.4 * prmax(ji,jj,jk) &192 & * ( xlimphy(ji,jj,jk) * zdepbac(ji,jj,jk))&193 & * ( xlimphy(ji,jj,jk) * zdepbac(ji,jj,jk))&194 & / ( xkgraz2 + zdepbac(ji,jj,jk) )&195 & 193 zdepbac2 = zdepbac(ji,jj,jk) * zdepbac(ji,jj,jk) 194 zbactfer = 20.e-6 * rfact2 * prmax(ji,jj,jk) & 195 & * trn(ji,jj,jk,jpfer) / ( 5E-10 + trn(ji,jj,jk,jpfer) ) & 196 & * zdepbac2 / ( xkgraz2 + zdepbac(ji,jj,jk) ) & 197 & * ( 0.5 + SIGN( 0.5, trn(ji,jj,jk,jpfer) -2.e-11 ) ) 196 198 197 199 tra(ji,jj,jk,jpfer) = tra(ji,jj,jk,jpfer) - zbactfer … … 214 216 DO jj = 1, jpj 215 217 DO ji = 1, jpi 218 zstep = xstep 216 219 # if defined key_degrad 217 zstep = xstep * facvol(ji,jj,jk) 218 # else 219 zstep = xstep 220 zstep = zstep * facvol(ji,jj,jk) 220 221 # endif 221 222 ! POC disaggregation by turbulence and bacterial activity. 222 223 ! ------------------------------------------------------------- 223 zremip = xremip * zstep * tgfunc(ji,jj,jk) * ( 1.- 0. 5* nitrfac(ji,jj,jk) )224 zremip = xremip * zstep * tgfunc(ji,jj,jk) * ( 1.- 0.7 * nitrfac(ji,jj,jk) ) 224 225 225 226 ! POC disaggregation rate is reduced in anoxic zone as shown by … … 266 267 DO jj = 1, jpj 267 268 DO ji = 1, jpi 269 zstep = xstep 268 270 # if defined key_degrad 269 zstep = xstep * facvol(ji,jj,jk) 270 # else 271 zstep = xstep 271 zstep = zstep * facvol(ji,jj,jk) 272 272 # endif 273 273 ! Remineralization rate of BSi depedant on T and saturation 274 274 ! --------------------------------------------------------- 275 zsatur = ( sio3eq(ji,jj,jk) - trn(ji,jj,jk,jpsil) ) / ( sio3eq(ji,jj,jk) + rtrn ) 276 zsatur = MAX( rtrn, zsatur ) 277 zsatur2 = zsatur * ( 1. + tsn(ji,jj,jk,jp_tem) / 400.)**4 278 znusil = 0.225 * ( 1. + tsn(ji,jj,jk,jp_tem) / 15.) * zsatur + 0.775 * zsatur2**9 279 zsiremin = xsirem * zstep * znusil 280 zosil = zsiremin * trn(ji,jj,jk,jpdsi) 281 275 zsatur = ( sio3eq(ji,jj,jk) - trn(ji,jj,jk,jpsil) ) / ( sio3eq(ji,jj,jk) + rtrn ) 276 zsatur = MAX( rtrn, zsatur ) 277 zsatur2 = zsatur * ( 1. + tsn(ji,jj,jk,jp_tem) / 400.)**4 278 znusil = 0.225 * ( 1. + tsn(ji,jj,jk,jp_tem) / 15.) * zsatur + 0.775 * zsatur2**9.25 279 zdep = MAX( hmld(ji,jj), heup(ji,jj) ) 280 zdep = MAX( 0., fsdept(ji,jj,jk) - zdep ) 281 zfactdep = xsilab * EXP(-( xsiremlab - xsirem ) * zdep / wsbio2 ) 282 zsiremin = ( xsiremlab * zfactdep + xsirem * ( 1. - zfactdep ) ) * zstep * znusil 283 zosil = zsiremin * trn(ji,jj,jk,jpdsi) 284 ! 282 285 tra(ji,jj,jk,jpdsi) = tra(ji,jj,jk,jpdsi) - zosil 283 286 tra(ji,jj,jk,jpsil) = tra(ji,jj,jk,jpsil) + zosil … … 293 296 ENDIF 294 297 295 zfesatur = 0.6e-9298 zfesatur = ligand 296 299 !CDIR NOVERRCHK 297 300 DO jk = 1, jpkm1 … … 300 303 !CDIR NOVERRCHK 301 304 DO ji = 1, jpi 305 zstep = xstep 302 306 # if defined key_degrad 303 zstep = xstep * facvol(ji,jj,jk) 304 # else 305 zstep = xstep 307 zstep = zstep * facvol(ji,jj,jk) 306 308 # endif 307 309 ! Compute de different ratios for scavenging of iron … … 312 314 & ( trn(ji,jj,jk,jppoc) + trn(ji,jj,jk,jpdsi) + trn(ji,jj,jk,jpcal) + rtrn ) 313 315 #else 314 zdenom = 1. / ( trn(ji,jj,jk,jppoc) + trn(ji,jj,jk,jpgoc) & 315 & + trn(ji,jj,jk,jpdsi) + trn(ji,jj,jk,jpcal) + rtrn ) 316 316 zdenom = 1. / ( trn(ji,jj,jk,jppoc) + trn(ji,jj,jk,jpgoc) + trn(ji,jj,jk,jpdsi) + trn(ji,jj,jk,jpcal) + rtrn ) 317 317 zdenom1 = trn(ji,jj,jk,jppoc) * zdenom 318 318 zdenom2 = trn(ji,jj,jk,jpgoc) * zdenom … … 337 337 ! Increased scavenging for very high iron concentrations 338 338 ! found near the coasts due to increased lithogenic particles 339 ! and let s say itunknown processes (precipitation, ...)339 ! and let say it is unknown processes (precipitation, ...) 340 340 ! ----------------------------------------------------------- 341 zlam1b = xlam1 * MAX( 0.e0, ( trn(ji,jj,jk,jpfer) * 1.e9 - 1. ) ) 342 zcoag = zfeequi * zlam1b * zstep 341 343 zlamfac = MAX( 0.e0, ( gphit(ji,jj) + 55.) / 30. ) 342 344 zlamfac = MIN( 1. , zlamfac ) 345 zdep = MIN(1., 1000. / fsdept(ji,jj,jk) ) 343 346 #if ! defined key_kriest 344 347 zlam1b = ( 80.* ( trn(ji,jj,jk,jpdoc) + 35.e-6 ) & 345 & + 698.* trn(ji,jj,jk,jppoc) + 1.05e4 * trn(ji,jj,jk,jpgoc) ) & 346 & * xdiss(ji,jj,jk) + 1E-4 * (1.-zlamfac) & 347 & + xlam1 * MAX( 0.e0, ( trn(ji,jj,jk,jpfer) * 1.e9 - 1.) ) 348 #else 349 zlam1b = ( 80.* (trn(ji,jj,jk,jpdoc) + 35E-6) & 348 & + 698.* trn(ji,jj,jk,jppoc) + 1.05e4 * trn(ji,jj,jk,jpgoc) ) & 349 & * xdiss(ji,jj,jk) + 1E-4 * ( 1. - zlamfac ) * zdep 350 #else 351 zlam1b = ( 80.* (trn(ji,jj,jk,jpdoc) + 35E-6) & 350 352 & + 698.* trn(ji,jj,jk,jppoc) ) & 351 & * xdiss(ji,jj,jk) + 1E-4 * (1.-zlamfac) & 352 & + xlam1 * MAX( 0.e0, ( trn(ji,jj,jk,jpfer) * 1.e9 - 1.) ) 353 #endif 354 353 & * xdiss(ji,jj,jk) + 1E-4 * ( 1. - zlamfac ) * zdep 354 #endif 355 355 zaggdfe = zlam1b * zstep * 0.5 * ( trn(ji,jj,jk,jpfer) - zfeequi ) 356 357 tra(ji,jj,jk,jpfer) = tra(ji,jj,jk,jpfer) - zscave - zaggdfe 358 356 tra(ji,jj,jk,jpfer) = tra(ji,jj,jk,jpfer) - zscave - zaggdfe - zcoag 359 357 #if defined key_kriest 360 358 tra(ji,jj,jk,jpsfe) = tra(ji,jj,jk,jpsfe) + zscave * zdenom1 … … 378 376 379 377 DO jk = 1, jpkm1 380 tra(:,:,jk,jppo4) = tra(:,:,jk,jppo4) + zolimi (:,:,jk) + denitr(:,:,jk)381 tra(:,:,jk,jpnh4) = tra(:,:,jk,jpnh4) + zolimi (:,:,jk) + denitr(:,:,jk)382 tra(:,:,jk,jpno3) = tra(:,:,jk,jpno3) - denitr (:,:,jk) * rdenit383 tra(:,:,jk,jpdoc) = tra(:,:,jk,jpdoc) - zolimi (:,:,jk) - denitr(:,:,jk)384 tra(:,:,jk,jpoxy) = tra(:,:,jk,jpoxy) - zolimi (:,:,jk) * o2ut385 tra(:,:,jk,jpdic) = tra(:,:,jk,jpdic) + zolimi (:,:,jk) + denitr(:,:,jk)386 tra(:,:,jk,jptal) = tra(:,:,jk,jptal) + denitr(:,:,jk) * rno3 * rdenit378 tra(:,:,jk,jppo4) = tra(:,:,jk,jppo4) + zolimi (:,:,jk) + denitr(:,:,jk) 379 tra(:,:,jk,jpnh4) = tra(:,:,jk,jpnh4) + zolimi (:,:,jk) + denitr(:,:,jk) 380 tra(:,:,jk,jpno3) = tra(:,:,jk,jpno3) - denitr (:,:,jk) * rdenit 381 tra(:,:,jk,jpdoc) = tra(:,:,jk,jpdoc) - zolimi (:,:,jk) - denitr(:,:,jk) 382 tra(:,:,jk,jpoxy) = tra(:,:,jk,jpoxy) - zolimi2(:,:,jk) * o2ut 383 tra(:,:,jk,jpdic) = tra(:,:,jk,jpdic) + zolimi (:,:,jk) + denitr(:,:,jk) 384 tra(:,:,jk,jptal) = tra(:,:,jk,jptal) + rno3 * ( zolimi(:,:,jk) + ( rdenit + 1.) * denitr(:,:,jk) ) 387 385 END DO 388 386 … … 393 391 ENDIF 394 392 ! 395 IF( wrk_not_released(2, 1) .OR. & 396 wrk_not_released(3, 2,3) ) CALL ctl_stop('p4z_rem: failed to release workspace arrays') 393 CALL wrk_dealloc( jpi, jpj, ztempbac ) 394 CALL wrk_dealloc( jpi, jpj, jpk, zdepbac, zolimi, zolimi2 ) 395 ! 396 IF( nn_timing == 1 ) CALL timing_stop('p4z_rem') 397 397 ! 398 398 END SUBROUTINE p4z_rem … … 411 411 !! 412 412 !!---------------------------------------------------------------------- 413 NAMELIST/nampisrem/ xremik, xremip, nitrif, xsirem, x lam1, oxymin414 !!----------------------------------------------------------------------415 416 REWIND( numnat ) ! read numnat417 READ ( numnat , nampisrem )413 NAMELIST/nampisrem/ xremik, xremip, nitrif, xsirem, xsiremlab, xsilab, & 414 & xlam1, oxymin, ligand 415 416 REWIND( numnatp ) ! read numnatp 417 READ ( numnatp, nampisrem ) 418 418 419 419 IF(lwp) THEN ! control print … … 424 424 WRITE(numout,*) ' remineralization rate of DOC xremik =', xremik 425 425 WRITE(numout,*) ' remineralization rate of Si xsirem =', xsirem 426 WRITE(numout,*) ' fast remineralization rate of Si xsiremlab =', xsiremlab 427 WRITE(numout,*) ' fraction of labile biogenic silica xsilab =', xsilab 426 428 WRITE(numout,*) ' scavenging rate of Iron xlam1 =', xlam1 427 429 WRITE(numout,*) ' NH4 nitrification rate nitrif =', nitrif 428 430 WRITE(numout,*) ' halk saturation constant for anoxia oxymin =', oxymin 431 WRITE(numout,*) ' ligand concentration in the ocean ligand =', ligand 429 432 ENDIF 430 433 ! 431 nitrfac(:,:,:) = 0._wp 432 denitr (:,:,:) = 0._wp 434 nitrfac (:,:,:) = 0._wp 435 denitr (:,:,:) = 0._wp 436 denitnh4(:,:,:) = 0._wp 433 437 ! 434 438 END SUBROUTINE p4z_rem_init … … 439 443 !! *** ROUTINE p4z_rem_alloc *** 440 444 !!---------------------------------------------------------------------- 441 ALLOCATE( denitr(jpi,jpj,jpk), STAT=p4z_rem_alloc )445 ALLOCATE( denitr(jpi,jpj,jpk), denitnh4(jpi,jpj,jpk), STAT=p4z_rem_alloc ) 442 446 ! 443 447 IF( p4z_rem_alloc /= 0 ) CALL ctl_warn('p4z_rem_alloc: failed to allocate arrays') -
trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zsed.F90
r2774 r3294 6 6 !! History : 1.0 ! 2004-03 (O. Aumont) Original code 7 7 !! 2.0 ! 2007-12 (C. Ethe, G. Madec) F90 8 !! 3.4 ! 2011-06 (O. Aumont, C. Ethe) USE of fldread 8 9 !!---------------------------------------------------------------------- 9 10 #if defined key_pisces … … 15 16 !! p4z_sed_init : Initialization of p4z_sed 16 17 !!---------------------------------------------------------------------- 17 USE trc 18 USE oce_trc ! 19 USE sms_pisces 20 USE prtctl_trc 21 USE p4zbio 22 USE p4zint 23 USE p4zopt 24 USE p4zsink 25 USE p4zrem 26 USE p4zlim 27 USE iom 28 18 USE oce_trc ! shared variables between ocean and passive tracers 19 USE trc ! passive tracers common variables 20 USE sms_pisces ! PISCES Source Minus Sink variables 21 USE p4zsink ! vertical flux of particulate matter due to sinking 22 USE p4zopt ! optical model 23 USE p4zlim ! Co-limitations of differents nutrients 24 USE p4zrem ! Remineralisation of organic matter 25 USE p4zint ! interpolation and computation of various fields 26 USE iom ! I/O manager 27 USE fldread ! time interpolation 28 USE prtctl_trc ! print control for debugging 29 29 30 30 IMPLICIT NONE … … 36 36 37 37 !! * Shared module variables 38 LOGICAL, PUBLIC :: ln_dustfer = .FALSE. !: boolean for dust input from the atmosphere 39 LOGICAL, PUBLIC :: ln_river = .FALSE. !: boolean for river input of nutrients 40 LOGICAL, PUBLIC :: ln_ndepo = .FALSE. !: boolean for atmospheric deposition of N 41 LOGICAL, PUBLIC :: ln_sedinput = .FALSE. !: boolean for Fe input from sediments 42 43 REAL(wp), PUBLIC :: sedfeinput = 1.E-9_wp !: Coastal release of Iron 44 REAL(wp), PUBLIC :: dustsolub = 0.014_wp !: Solubility of the dust 38 LOGICAL :: ln_dust = .FALSE. !: boolean for dust input from the atmosphere 39 LOGICAL :: ln_river = .FALSE. !: boolean for river input of nutrients 40 LOGICAL :: ln_ndepo = .FALSE. !: boolean for atmospheric deposition of N 41 LOGICAL :: ln_ironsed = .FALSE. !: boolean for Fe input from sediments 42 43 REAL(wp) :: sedfeinput = 1.E-9_wp !: Coastal release of Iron 44 REAL(wp) :: dustsolub = 0.014_wp !: Solubility of the dust 45 REAL(wp) :: wdust = 2.0_wp !: Sinking speed of the dust 46 REAL(wp) :: nitrfix = 1E-7_wp !: Nitrogen fixation rate 47 REAL(wp) :: diazolight = 50._wp !: Nitrogen fixation sensitivty to light 48 REAL(wp) :: concfediaz = 1.E-10_wp !: Fe half-saturation Cste for diazotrophs 49 45 50 46 51 !! * Module variables 47 52 REAL(wp) :: ryyss !: number of seconds per year 48 REAL(wp) :: r yyss1!: inverse of ryyss53 REAL(wp) :: r1_ryyss !: inverse of ryyss 49 54 REAL(wp) :: rmtss !: number of seconds per month 50 REAL(wp) :: rday1 !: inverse of rday 51 52 INTEGER , PARAMETER :: jpmth = 12 !: number of months per year 53 INTEGER , PARAMETER :: jpyr = 1 !: one year 54 55 INTEGER :: numdust !: logical unit for surface fluxes data 56 INTEGER :: nflx1 , nflx2 !: first and second record used 57 INTEGER :: nflx11, nflx12 58 59 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: dustmo !: set of dust fields 55 REAL(wp) :: r1_rday !: inverse of rday 56 LOGICAL :: ll_sbc 57 58 TYPE(FLD), ALLOCATABLE, DIMENSION(:) :: sf_dust ! structure of input dust 59 TYPE(FLD), ALLOCATABLE, DIMENSION(:) :: sf_riverdic ! structure of input riverdic 60 TYPE(FLD), ALLOCATABLE, DIMENSION(:) :: sf_riverdoc ! structure of input riverdoc 61 TYPE(FLD), ALLOCATABLE, DIMENSION(:) :: sf_ndepo ! structure of input nitrogen deposition 62 TYPE(FLD), ALLOCATABLE, DIMENSION(:) :: sf_ironsed ! structure of input iron from sediment 63 64 INTEGER , PARAMETER :: nbtimes = 365 !: maximum number of times record in a file 65 INTEGER :: ntimes_dust, ntimes_riv, ntimes_ndep ! number of time steps in a file 66 60 67 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) :: dust !: dust fields 61 68 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) :: rivinp, cotdep !: river input fields … … 86 93 !! ** Method : - ??? 87 94 !!--------------------------------------------------------------------- 88 USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released89 USE wrk_nemo, ONLY: zsidep => wrk_2d_1, zwork => wrk_2d_2, zwork1 => wrk_2d_390 USE wrk_nemo, ONLY: znitrpot => wrk_3d_2, zirondep => wrk_3d_391 95 ! 92 96 INTEGER, INTENT(in) :: kt, jnt ! ocean time step … … 96 100 REAL(wp) :: zrivalk, zrivsil, zrivpo4 97 101 #endif 98 REAL(wp) :: zdenitot, znitrpottot, zlim, zfact 99 REAL(wp) :: z wsbio3, zwsbio4, zwscal102 REAL(wp) :: zdenitot, znitrpottot, zlim, zfact, zfactcal 103 REAL(wp) :: zsiloss, zcaloss, zwsbio3, zwsbio4, zwscal, zdep 100 104 CHARACTER (len=25) :: charout 105 REAL(wp), POINTER, DIMENSION(:,: ) :: zsidep, zwork1, zwork2, zwork3 106 REAL(wp), POINTER, DIMENSION(:,:,:) :: znitrpot, zirondep 101 107 !!--------------------------------------------------------------------- 102 103 IF( ( wrk_in_use(2, 1,2,3) ) .OR. ( wrk_in_use(3, 2,3) ) ) THEN 104 CALL ctl_stop('p4z_sed: requested workspace arrays unavailable') ; RETURN 105 END IF 106 107 IF( jnt == 1 .AND. ln_dustfer ) CALL p4z_sbc( kt ) 108 ! 109 IF( nn_timing == 1 ) CALL timing_start('p4z_sed') 110 ! 111 ! Allocate temporary workspace 112 CALL wrk_alloc( jpi, jpj, zsidep, zwork1, zwork2, zwork3 ) 113 CALL wrk_alloc( jpi, jpj, jpk, znitrpot, zirondep ) 114 115 IF( jnt == 1 .AND. ll_sbc ) CALL p4z_sbc( kt ) 116 117 zirondep(:,:,:) = 0.e0 ! Initialisation of variables USEd to compute deposition 118 zsidep (:,:) = 0.e0 108 119 109 120 ! Iron and Si deposition at the surface 110 121 ! ------------------------------------- 111 112 122 DO jj = 1, jpj 113 123 DO ji = 1, jpi 114 z irondep(ji,jj,1) = ( dustsolub * dust(ji,jj) / ( 55.85 * rmtss ) + 3.e-10 * ryyss1 ) &115 & * rfact2 / fse3t(ji,jj,1)116 zsidep (ji,jj) = 8.8 * 0.075 * dust(ji,jj) * rfact2 / ( fse3t(ji,jj,1) *28.1 * rmtss )124 zdep = rfact2 / fse3t(ji,jj,1) 125 zirondep(ji,jj,1) = ( dustsolub * dust(ji,jj) / ( 55.85 * rmtss ) + 3.e-10 * r1_ryyss ) * zdep 126 zsidep (ji,jj) = 8.8 * 0.075 * dust(ji,jj) * zdep / ( 28.1 * rmtss ) 117 127 END DO 118 128 END DO … … 120 130 ! Iron solubilization of particles in the water column 121 131 ! ---------------------------------------------------- 122 123 132 DO jk = 2, jpkm1 124 zirondep(:,:,jk) = dust(:,:) / ( 10. * 55.85 * rmtss ) * rfact2 * 1.e-4133 zirondep(:,:,jk) = dust(:,:) / ( wdust * 55.85 * rmtss ) * rfact2 * 1.e-4 * EXP( -fsdept(:,:,jk) / 1000. ) 125 134 END DO 126 135 127 136 ! Add the external input of nutrients, carbon and alkalinity 128 137 ! ---------------------------------------------------------- 129 130 138 trn(:,:,1,jppo4) = trn(:,:,1,jppo4) + rivinp(:,:) * rfact2 131 139 trn(:,:,1,jpno3) = trn(:,:,1,jpno3) + (rivinp(:,:) + nitdep(:,:)) * rfact2 … … 139 147 ! (dust, river and sediment mobilization) 140 148 ! ------------------------------------------------------ 141 142 149 DO jk = 1, jpkm1 143 150 trn(:,:,jk,jpfer) = trn(:,:,jk,jpfer) + zirondep(:,:,jk) + ironsed(:,:,jk) * rfact2 144 151 END DO 145 146 152 147 153 #if ! defined key_sed … … 154 160 ikt = mbkt(ji,jj) 155 161 # if defined key_kriest 156 zwork 157 zwork 1(ji,jj) = trn(ji,jj,ikt,jppoc) * wsbio3(ji,jj,ikt)162 zwork1(ji,jj) = trn(ji,jj,ikt,jpdsi) * wscal (ji,jj,ikt) 163 zwork2(ji,jj) = trn(ji,jj,ikt,jppoc) * wsbio3(ji,jj,ikt) 158 164 # else 159 zwork 160 zwork 1(ji,jj) = trn(ji,jj,ikt,jpgoc) * wsbio4(ji,jj,ikt) + trn(ji,jj,ikt,jppoc) * wsbio3(ji,jj,ikt)165 zwork1(ji,jj) = trn(ji,jj,ikt,jpdsi) * wsbio4(ji,jj,ikt) 166 zwork2(ji,jj) = trn(ji,jj,ikt,jpgoc) * wsbio4(ji,jj,ikt) + trn(ji,jj,ikt,jppoc) * wsbio3(ji,jj,ikt) 161 167 # endif 162 END DO 163 END DO 164 zsumsedsi = glob_sum( zwork (:,:) * e1e2t(:,:) ) * rday1 165 zsumsedpo4 = glob_sum( zwork1(:,:) * e1e2t(:,:) ) * rday1 166 DO jj = 1, jpj 167 DO ji = 1, jpi 168 ikt = mbkt(ji,jj) 169 zwork (ji,jj) = trn(ji,jj,ikt,jpcal) * wscal (ji,jj,ikt) 170 END DO 171 END DO 172 zsumsedcal = glob_sum( zwork (:,:) * e1e2t(:,:) ) * 2.0 * rday1 168 ! For calcite, burial efficiency is made a function of saturation 169 zfactcal = MIN( excess(ji,jj,ikt), 0.2 ) 170 zfactcal = MIN( 1., 1.3 * ( 0.2 - zfactcal ) / ( 0.4 - zfactcal ) ) 171 zwork3(ji,jj) = trn(ji,jj,ikt,jpcal) * wscal (ji,jj,ikt) * 2.e0 * zfactcal 172 END DO 173 END DO 174 zsumsedsi = glob_sum( zwork1(:,:) * e1e2t(:,:) ) * r1_rday 175 zsumsedpo4 = glob_sum( zwork2(:,:) * e1e2t(:,:) ) * r1_rday 176 zsumsedcal = glob_sum( zwork3(:,:) * e1e2t(:,:) ) * r1_rday 173 177 #endif 174 178 175 ! T henthis loss is scaled at each bottom grid cell for179 ! THEN this loss is scaled at each bottom grid cell for 176 180 ! equilibrating the total budget of silica in the ocean. 177 181 ! Thus, the amount of silica lost in the sediments equal 178 182 ! the supply at the surface (dust+rivers) 179 183 ! ------------------------------------------------------ 184 #if ! defined key_sed 185 zrivsil = 1._wp - ( sumdepsi + rivalkinput * r1_ryyss / 6. ) / zsumsedsi 186 zrivpo4 = 1._wp - ( rivpo4input * r1_ryyss ) / zsumsedpo4 187 #endif 180 188 181 189 DO jj = 1, jpj 182 190 DO ji = 1, jpi 183 ikt = mbkt(ji,jj) 184 zfact = xstep / fse3t(ji,jj,ikt) 185 zwsbio3 = 1._wp - zfact * wsbio3(ji,jj,ikt) 186 zwsbio4 = 1._wp - zfact * wsbio4(ji,jj,ikt) 187 zwscal = 1._wp - zfact * wscal (ji,jj,ikt) 191 ikt = mbkt(ji,jj) 192 zdep = xstep / fse3t(ji,jj,ikt) 193 zwsbio4 = wsbio4(ji,jj,ikt) * zdep 194 zwscal = wscal (ji,jj,ikt) * zdep 195 # if defined key_kriest 196 zsiloss = trn(ji,jj,ikt,jpdsi) * zwsbio4 197 # else 198 zsiloss = trn(ji,jj,ikt,jpdsi) * zwscal 199 # endif 200 zcaloss = trn(ji,jj,ikt,jpcal) * zwscal 188 201 ! 189 # if defined key_kriest 190 trn(ji,jj,ikt,jpdsi) = trn(ji,jj,ikt,jpdsi) * zwsbio4 191 trn(ji,jj,ikt,jpnum) = trn(ji,jj,ikt,jpnum) * zwsbio4 192 trn(ji,jj,ikt,jppoc) = trn(ji,jj,ikt,jppoc) * zwsbio3 193 trn(ji,jj,ikt,jpsfe) = trn(ji,jj,ikt,jpsfe) * zwsbio3 194 # else 195 trn(ji,jj,ikt,jpdsi) = trn(ji,jj,ikt,jpdsi) * zwscal 196 trn(ji,jj,ikt,jpgoc) = trn(ji,jj,ikt,jpgoc) * zwsbio4 197 trn(ji,jj,ikt,jppoc) = trn(ji,jj,ikt,jppoc) * zwsbio3 198 trn(ji,jj,ikt,jpbfe) = trn(ji,jj,ikt,jpbfe) * zwsbio4 199 trn(ji,jj,ikt,jpsfe) = trn(ji,jj,ikt,jpsfe) * zwsbio3 200 # endif 201 trn(ji,jj,ikt,jpcal) = trn(ji,jj,ikt,jpcal) * zwscal 202 END DO 203 END DO 204 202 trn(ji,jj,ikt,jpdsi) = trn(ji,jj,ikt,jpdsi) - zsiloss 203 trn(ji,jj,ikt,jpcal) = trn(ji,jj,ikt,jpcal) - zcaloss 205 204 #if ! defined key_sed 206 zrivsil = 1._wp - ( sumdepsi + rivalkinput * ryyss1 / 6. ) / zsumsedsi 207 zrivalk = 1._wp - ( rivalkinput * ryyss1 ) / zsumsedcal 208 zrivpo4 = 1._wp - ( rivpo4input * ryyss1 ) / zsumsedpo4 205 trn(ji,jj,ikt,jpsil) = trn(ji,jj,ikt,jpsil) + zsiloss * zrivsil 206 zfactcal = MIN( excess(ji,jj,ikt), 0.2 ) 207 zfactcal = MIN( 1., 1.3 * ( 0.2 - zfactcal ) / ( 0.4 - zfactcal ) ) 208 zrivalk = 1._wp - ( rivalkinput * r1_ryyss ) * zfactcal / zsumsedcal 209 trn(ji,jj,ikt,jptal) = trn(ji,jj,ikt,jptal) + zcaloss * zrivalk * 2.0 210 trn(ji,jj,ikt,jpdic) = trn(ji,jj,ikt,jpdic) + zcaloss * zrivalk 211 #endif 212 END DO 213 END DO 214 209 215 DO jj = 1, jpj 210 216 DO ji = 1, jpi 211 ikt = mbkt(ji,jj) 212 zfact = xstep / fse3t(ji,jj,ikt) 213 zwsbio3 = zfact * wsbio3(ji,jj,ikt) 214 zwsbio4 = zfact * wsbio4(ji,jj,ikt) 215 zwscal = zfact * wscal (ji,jj,ikt) 216 trn(ji,jj,ikt,jptal) = trn(ji,jj,ikt,jptal) + trn(ji,jj,ikt,jpcal) * zwscal * zrivalk * 2.0 217 trn(ji,jj,ikt,jpdic) = trn(ji,jj,ikt,jpdic) + trn(ji,jj,ikt,jpcal) * zwscal * zrivalk 218 # if defined key_kriest 219 trn(ji,jj,ikt,jpsil) = trn(ji,jj,ikt,jpsil) + trn(ji,jj,ikt,jpdsi) * zwsbio4 * zrivsil 220 trn(ji,jj,ikt,jpdoc) = trn(ji,jj,ikt,jpdoc) + trn(ji,jj,ikt,jppoc) * zwsbio3 * zrivpo4 217 ikt = mbkt(ji,jj) 218 zdep = xstep / fse3t(ji,jj,ikt) 219 zwsbio4 = wsbio4(ji,jj,ikt) * zdep 220 zwsbio3 = wsbio3(ji,jj,ikt) * zdep 221 # if ! defined key_kriest 222 trn(ji,jj,ikt,jpgoc) = trn(ji,jj,ikt,jpgoc) - trn(ji,jj,ikt,jpgoc) * zwsbio4 223 trn(ji,jj,ikt,jppoc) = trn(ji,jj,ikt,jppoc) - trn(ji,jj,ikt,jppoc) * zwsbio3 224 trn(ji,jj,ikt,jpbfe) = trn(ji,jj,ikt,jpbfe) - trn(ji,jj,ikt,jpbfe) * zwsbio4 225 trn(ji,jj,ikt,jpsfe) = trn(ji,jj,ikt,jpsfe) - trn(ji,jj,ikt,jpsfe) * zwsbio3 226 #if ! defined key_sed 227 trn(ji,jj,ikt,jpdoc) = trn(ji,jj,ikt,jpdoc) & 228 & + ( trn(ji,jj,ikt,jpgoc) * zwsbio4 + trn(ji,jj,ikt,jppoc) * zwsbio3 ) * zrivpo4 229 #endif 230 221 231 # else 222 trn(ji,jj,ikt,jpsil) = trn(ji,jj,ikt,jpsil) + trn(ji,jj,ikt,jpdsi) * zwscal * zrivsil 223 trn(ji,jj,ikt,jpdoc) = trn(ji,jj,ikt,jpdoc) & 224 & + ( trn(ji,jj,ikt,jppoc) * zwsbio3 + trn(ji,jj,ikt,jpgoc) * zwsbio4 ) * zrivpo4 232 trn(ji,jj,ikt,jpnum) = trn(ji,jj,ikt,jpnum) - trn(ji,jj,ikt,jpnum) * zwsbio4 233 trn(ji,jj,ikt,jppoc) = trn(ji,jj,ikt,jppoc) - trn(ji,jj,ikt,jppoc) * zwsbio3 234 trn(ji,jj,ikt,jpsfe) = trn(ji,jj,ikt,jpsfe) - trn(ji,jj,ikt,jpsfe) * zwsbio3 235 #if ! defined key_sed 236 trn(ji,jj,ikt,jpdoc) = trn(ji,jj,ikt,jpdoc) & 237 & + ( trn(ji,jj,ikt,jpnum) * zwsbio4 + trn(ji,jj,ikt,jppoc) * zwsbio3 ) * zrivpo4 238 #endif 239 225 240 # endif 226 241 END DO 227 242 END DO 228 # endif 243 229 244 230 245 ! Nitrogen fixation (simple parameterization). The total gain … … 233 248 ! ------------------------------------------------------------- 234 249 235 zdenitot = glob_sum( denitr(:,:,:) * cvol(:,:,:) * xnegtr(:,:,:) ) * rdenit250 zdenitot = glob_sum( ( denitr(:,:,:) * rdenit + denitnh4(:,:,:) * rdenita ) * cvol(:,:,:) ) 236 251 237 252 ! Potential nitrogen fixation dependant on temperature and iron … … 246 261 zlim = ( 1.- xnanono3(ji,jj,jk) - xnanonh4(ji,jj,jk) ) 247 262 IF( zlim <= 0.2 ) zlim = 0.01 248 znitrpot(ji,jj,jk) = MAX( 0.e0, ( 0.6 * tgfunc(ji,jj,jk) - 2.15 ) * rday1 ) & 249 # if defined key_degrad 250 & * facvol(ji,jj,jk) & 251 # endif 252 & * zlim * rfact2 * trn(ji,jj,jk,jpfer) & 253 & / ( conc3 + trn(ji,jj,jk,jpfer) ) * ( 1.- EXP( -etot(ji,jj,jk) / 50.) ) 263 #if defined key_degrad 264 zfact = zlim * rfact2 * facvol(ji,jj,jk) 265 #else 266 zfact = zlim * rfact2 267 #endif 268 znitrpot(ji,jj,jk) = MAX( 0.e0, ( 0.6 * tgfunc(ji,jj,jk) - 2.15 ) * r1_rday ) & 269 & * zfact * trn(ji,jj,jk,jpfer) / ( concfediaz + trn(ji,jj,jk,jpfer) ) & 270 & * ( 1.- EXP( -etot(ji,jj,jk) / diazolight ) ) 254 271 END DO 255 272 END DO … … 260 277 ! Nitrogen change due to nitrogen fixation 261 278 ! ---------------------------------------- 262 263 279 DO jk = 1, jpk 264 280 DO jj = 1, jpj 265 281 DO ji = 1, jpi 266 zfact = znitrpot(ji,jj,jk) * 1.e-7282 zfact = znitrpot(ji,jj,jk) * nitrfix 267 283 trn(ji,jj,jk,jpnh4) = trn(ji,jj,jk,jpnh4) + zfact 284 trn(ji,jj,jk,jptal) = trn(ji,jj,jk,jptal) + rno3 * zfact 268 285 trn(ji,jj,jk,jpoxy) = trn(ji,jj,jk,jpoxy) + zfact * o2nit 269 trn(ji,jj,jk,jppo4) = trn(ji,jj,jk,jppo4) + 30./ 46.* zfact 270 END DO 271 END DO 272 END DO 273 274 #if defined key_diatrc 275 zfact = 1.e+3 * rfact2r 276 # if ! defined key_iomput 277 trc2d(:,:,jp_pcs0_2d + 11) = zirondep(:,:,1) * zfact * fse3t(:,:,1) * tmask(:,:,1) 278 trc2d(:,:,jp_pcs0_2d + 12) = znitrpot(:,:,1) * 1.e-7 * zfact * fse3t(:,:,1) * tmask(:,:,1) 279 # else 280 zwork (:,:) = ( zirondep(:,:,1) + ironsed(:,:,1) * rfact2 ) * zfact * fse3t(:,:,1) * tmask(:,:,1) 281 zwork1(:,:) = znitrpot(:,:,1) * 1.e-7 * zfact * fse3t(:,:,1) * tmask(:,:,1) 282 IF( jnt == nrdttrc ) THEN 283 CALL iom_put( "Irondep", zwork ) ! surface downward net flux of iron 284 CALL iom_put( "Nfix" , zwork1 ) ! nitrogen fixation at surface 285 ENDIF 286 # endif 287 #endif 288 ! 289 IF(ln_ctl) THEN ! print mean trends (used for debugging) 290 WRITE(charout, FMT="('sed ')") 286 trn(ji,jj,jk,jppo4) = trn(ji,jj,jk,jppo4) + 30. / 46. * zfact 287 ! trn(ji,jj,jk,jppo4) = trn(ji,jj,jk,jppo4) + zfact 288 END DO 289 END DO 290 END DO 291 ! 292 IF( ln_diatrc ) THEN 293 zfact = 1.e+3 * rfact2r 294 IF( lk_iomput ) THEN 295 zwork1(:,:) = ( zirondep(:,:,1) + ironsed(:,:,1) * rfact2 ) * zfact * fse3t(:,:,1) * tmask(:,:,1) 296 zwork2(:,:) = znitrpot(:,:,1) * nitrfix * zfact * fse3t(:,:,1) * tmask(:,:,1) 297 IF( jnt == nrdttrc ) THEN 298 CALL iom_put( "Irondep", zwork1 ) ! surface downward net flux of iron 299 CALL iom_put( "Nfix" , zwork2 ) ! nitrogen fixation at surface 300 ENDIF 301 ELSE 302 trc2d(:,:,jp_pcs0_2d + 11) = zirondep(:,:,1) * zfact * fse3t(:,:,1) * tmask(:,:,1) 303 trc2d(:,:,jp_pcs0_2d + 12) = znitrpot(:,:,1) * nitrfix * zfact * fse3t(:,:,1) * tmask(:,:,1) 304 ENDIF 305 ENDIF 306 ! 307 IF(ln_ctl) THEN ! print mean trends (USEd for debugging) 308 WRITE(charout, fmt="('sed ')") 291 309 CALL prt_ctl_trc_info(charout) 292 310 CALL prt_ctl_trc(tab4d=trn, mask=tmask, clinfo=ctrcnm) 293 ENDIF 294 295 IF( ( wrk_not_released(2, 1,2,3) ) .OR. ( wrk_not_released(3, 2,3) ) ) & 296 & CALL ctl_stop('p4z_sed: failed to release workspace arrays') 297 311 ENDIF 312 ! 313 CALL wrk_dealloc( jpi, jpj, zsidep, zwork1, zwork2, zwork3 ) 314 CALL wrk_dealloc( jpi, jpj, jpk, znitrpot, zirondep ) 315 ! 316 IF( nn_timing == 1 ) CALL timing_stop('p4z_sed') 317 ! 298 318 END SUBROUTINE p4z_sed 299 319 300 320 SUBROUTINE p4z_sbc( kt ) 301 302 321 !!---------------------------------------------------------------------- 303 !! *** ROUTINEp4z_sbc ***304 !! 305 !! ** Purpose : Read and interpolate the external sources of322 !! *** routine p4z_sbc *** 323 !! 324 !! ** purpose : read and interpolate the external sources of 306 325 !! nutrients 307 326 !! 308 !! ** Method : Read the files and interpolate the appropriate variables327 !! ** method : read the files and interpolate the appropriate variables 309 328 !! 310 329 !! ** input : external netcdf files … … 314 333 INTEGER, INTENT( in ) :: kt ! ocean time step 315 334 316 !! * Local declarations 317 INTEGER :: imois, i15, iman 318 REAL(wp) :: zxy 319 335 !! * local declarations 336 INTEGER :: ji,jj 337 REAL(wp) :: zcoef 320 338 !!--------------------------------------------------------------------- 321 322 ! Initialization 323 ! -------------- 324 325 i15 = nday / 16 326 iman = INT( raamo ) 327 imois = nmonth + i15 - 1 328 IF( imois == 0 ) imois = iman 329 330 ! Calendar computation 331 IF( kt == nit000 .OR. imois /= nflx1 ) THEN 332 333 IF( kt == nit000 ) nflx1 = 0 334 335 ! nflx1 number of the first file record used in the simulation 336 ! nflx2 number of the last file record 337 338 nflx1 = imois 339 nflx2 = nflx1 + 1 340 nflx1 = MOD( nflx1, iman ) 341 nflx2 = MOD( nflx2, iman ) 342 IF( nflx1 == 0 ) nflx1 = iman 343 IF( nflx2 == 0 ) nflx2 = iman 344 IF(lwp) WRITE(numout,*) 345 IF(lwp) WRITE(numout,*) ' p4z_sbc : first record file used nflx1 ',nflx1 346 IF(lwp) WRITE(numout,*) ' p4z_sbc : last record file used nflx2 ',nflx2 347 348 ENDIF 349 350 ! 3. at every time step interpolation of fluxes 351 ! --------------------------------------------- 352 353 zxy = FLOAT( nday + 15 - 30 * i15 ) / 30 354 dust(:,:) = ( (1.-zxy) * dustmo(:,:,nflx1) + zxy * dustmo(:,:,nflx2) ) 355 339 ! 340 IF( nn_timing == 1 ) CALL timing_start('p4z_sbc') 341 ! 342 ! Compute dust at nit000 or only if there is more than 1 time record in dust file 343 IF( ln_dust ) THEN 344 IF( kt == nit000 .OR. ( kt /= nit000 .AND. ntimes_dust > 1 ) ) THEN 345 CALL fld_read( kt, 1, sf_dust ) 346 dust(:,:) = sf_dust(1)%fnow(:,:,1) 347 ENDIF 348 ENDIF 349 350 ! N/P and Si releases due to coastal rivers 351 ! Compute river at nit000 or only if there is more than 1 time record in river file 352 ! ----------------------------------------- 353 IF( ln_river ) THEN 354 IF( kt == nit000 .OR. ( kt /= nit000 .AND. ntimes_riv > 1 ) ) THEN 355 CALL fld_read( kt, 1, sf_riverdic ) 356 CALL fld_read( kt, 1, sf_riverdoc ) 357 DO jj = 1, jpj 358 DO ji = 1, jpi 359 zcoef = ryyss * cvol(ji,jj,1) 360 cotdep(ji,jj) = sf_riverdic(1)%fnow(ji,jj,1) * 1E9 / ( 12. * zcoef + rtrn ) 361 rivinp(ji,jj) = ( sf_riverdic(1)%fnow(ji,jj,1) + sf_riverdoc(1)%fnow(ji,jj,1) ) * 1E9 / ( 31.6* zcoef + rtrn ) 362 END DO 363 END DO 364 ENDIF 365 ENDIF 366 367 ! Compute N deposition at nit000 or only if there is more than 1 time record in N deposition file 368 IF( ln_ndepo ) THEN 369 IF( kt == nit000 .OR. ( kt /= nit000 .AND. ntimes_ndep > 1 ) ) THEN 370 CALL fld_read( kt, 1, sf_ndepo ) 371 DO jj = 1, jpj 372 DO ji = 1, jpi 373 nitdep(ji,jj) = 7.6 * sf_ndepo(1)%fnow(ji,jj,1) / ( 14E6 * ryyss * fse3t(ji,jj,1) + rtrn ) 374 END DO 375 END DO 376 ENDIF 377 ENDIF 378 ! 379 IF( nn_timing == 1 ) CALL timing_stop('p4z_sbc') 380 ! 356 381 END SUBROUTINE p4z_sbc 357 382 358 359 383 SUBROUTINE p4z_sed_init 360 384 361 385 !!---------------------------------------------------------------------- 362 !! *** ROUTINEp4z_sed_init ***363 !! 364 !! ** Purpose : Initialization of the external sources of nutrients365 !! 366 !! ** Method : Read the files and compute the budget367 !! called at the first timestep (nit000)386 !! *** routine p4z_sed_init *** 387 !! 388 !! ** purpose : initialization of the external sources of nutrients 389 !! 390 !! ** method : read the files and compute the budget 391 !! called at the first timestep (nittrc000) 368 392 !! 369 393 !! ** input : external netcdf files 370 394 !! 371 395 !!---------------------------------------------------------------------- 372 USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released 373 USE wrk_nemo, ONLY: zriverdoc => wrk_2d_1, zriver => wrk_2d_2, zndepo => wrk_2d_3 374 USE wrk_nemo, ONLY: zcmask => wrk_3d_2 375 ! 376 INTEGER :: ji, jj, jk, jm 377 INTEGER :: numriv, numbath, numdep 378 REAL(wp) :: zcoef 379 REAL(wp) :: expide, denitide,zmaskt 380 ! 381 NAMELIST/nampissed/ ln_dustfer, ln_river, ln_ndepo, ln_sedinput, sedfeinput, dustsolub 396 ! 397 INTEGER :: ji, jj, jk, jm 398 INTEGER :: numdust, numriv, numiron, numdepo 399 INTEGER :: ierr, ierr1, ierr2, ierr3 400 REAL(wp) :: zexpide, zdenitide, zmaskt 401 REAL(wp), DIMENSION(nbtimes) :: zsteps ! times records 402 REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: zdust, zndepo, zriverdic, zriverdoc, zcmask 403 ! 404 CHARACTER(len=100) :: cn_dir ! Root directory for location of ssr files 405 TYPE(FLD_N) :: sn_dust, sn_riverdoc, sn_riverdic, sn_ndepo, sn_ironsed ! informations about the fields to be read 406 NAMELIST/nampissed/cn_dir, sn_dust, sn_riverdic, sn_riverdoc, sn_ndepo, sn_ironsed, & 407 & ln_dust, ln_river, ln_ndepo, ln_ironsed, & 408 & sedfeinput, dustsolub, wdust, nitrfix, diazolight, concfediaz 382 409 !!---------------------------------------------------------------------- 383 384 IF( ( wrk_in_use(2, 1,2,3) ) .OR. ( wrk_in_use(3, 2) ) ) THEN 385 CALL ctl_stop('p4z_sed_init: requested workspace arrays unavailable') ; RETURN 386 END IF 387 ! 388 REWIND( numnat ) ! read numnat 389 READ ( numnat, nampissed ) 410 ! 411 IF( nn_timing == 1 ) CALL timing_start('p4z_sed_init') 412 ! 413 ! ! number of seconds per year and per month 414 ryyss = nyear_len(1) * rday 415 rmtss = ryyss / raamo 416 r1_rday = 1. / rday 417 r1_ryyss = 1. / ryyss 418 ! !* set file information 419 cn_dir = './' ! directory in which the model is executed 420 ! ... default values (NB: frequency positive => hours, negative => months) 421 ! ! file ! frequency ! variable ! time intep ! clim ! 'yearly' or ! weights ! rotation ! 422 ! ! name ! (hours) ! name ! (T/F) ! (T/F) ! 'monthly' ! filename ! pairs ! 423 sn_dust = FLD_N( 'dust' , -1 , 'dust' , .true. , .true. , 'yearly' , '' , '' ) 424 sn_riverdic = FLD_N( 'river' , -12 , 'riverdic' , .false. , .true. , 'yearly' , '' , '' ) 425 sn_riverdoc = FLD_N( 'river' , -12 , 'riverdoc' , .false. , .true. , 'yearly' , '' , '' ) 426 sn_ndepo = FLD_N( 'ndeposition', -12 , 'ndep' , .false. , .true. , 'yearly' , '' , '' ) 427 sn_ironsed = FLD_N( 'ironsed' , -12 , 'bathy' , .false. , .true. , 'yearly' , '' , '' ) 428 429 REWIND( numnatp ) ! read numnatp 430 READ ( numnatp, nampissed ) 390 431 391 432 IF(lwp) THEN 392 433 WRITE(numout,*) ' ' 393 WRITE(numout,*) ' Namelist : nampissed '434 WRITE(numout,*) ' namelist : nampissed ' 394 435 WRITE(numout,*) ' ~~~~~~~~~~~~~~~~~ ' 395 WRITE(numout,*) ' Dust input from the atmosphere ln_dustfer = ', ln_dustfer 396 WRITE(numout,*) ' River input of nutrients ln_river = ', ln_river 397 WRITE(numout,*) ' Atmospheric deposition of N ln_ndepo = ', ln_ndepo 398 WRITE(numout,*) ' Fe input from sediments ln_sedinput = ', ln_sedinput 399 WRITE(numout,*) ' Coastal release of Iron sedfeinput =', sedfeinput 400 WRITE(numout,*) ' Solubility of the dust dustsolub =', dustsolub 401 ENDIF 402 403 ! Dust input from the atmosphere 436 WRITE(numout,*) ' dust input from the atmosphere ln_dust = ', ln_dust 437 WRITE(numout,*) ' river input of nutrients ln_river = ', ln_river 438 WRITE(numout,*) ' atmospheric deposition of n ln_ndepo = ', ln_ndepo 439 WRITE(numout,*) ' fe input from sediments ln_sedinput = ', ln_ironsed 440 WRITE(numout,*) ' coastal release of iron sedfeinput = ', sedfeinput 441 WRITE(numout,*) ' solubility of the dust dustsolub = ', dustsolub 442 WRITE(numout,*) ' sinking speed of the dust wdust = ', wdust 443 WRITE(numout,*) ' nitrogen fixation rate nitrfix = ', nitrfix 444 WRITE(numout,*) ' nitrogen fixation sensitivty to light diazolight = ', diazolight 445 WRITE(numout,*) ' fe half-saturation cste for diazotrophs concfediaz = ', concfediaz 446 END IF 447 448 IF( ln_dust .OR. ln_river .OR. ln_ndepo ) THEN 449 ll_sbc = .TRUE. 450 ELSE 451 ll_sbc = .FALSE. 452 ENDIF 453 454 ! dust input from the atmosphere 404 455 ! ------------------------------ 405 IF( ln_dust fer) THEN406 IF(lwp) WRITE(numout,*) ' Initialize dust input from atmosphere '456 IF( ln_dust ) THEN 457 IF(lwp) WRITE(numout,*) ' initialize dust input from atmosphere ' 407 458 IF(lwp) WRITE(numout,*) ' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ' 408 CALL iom_open ( 'dust.orca.nc', numdust ) 409 DO jm = 1, jpmth 410 CALL iom_get( numdust, jpdom_data, 'dust', dustmo(:,:,jm), jm ) 459 ! 460 ALLOCATE( sf_dust(1), STAT=ierr ) !* allocate and fill sf_sst (forcing structure) with sn_sst 461 IF( ierr > 0 ) CALL ctl_stop( 'STOP', 'p4z_sed_init: unable to allocate sf_apr structure' ) 462 ! 463 CALL fld_fill( sf_dust, (/ sn_dust /), cn_dir, 'p4z_sed_init', 'Iron from sediment ', 'nampissed' ) 464 ALLOCATE( sf_dust(1)%fnow(jpi,jpj,1) ) 465 IF( sn_dust%ln_tint ) ALLOCATE( sf_dust(1)%fdta(jpi,jpj,1,2) ) 466 ! 467 ! Get total input dust ; need to compute total atmospheric supply of Si in a year 468 CALL iom_open ( TRIM( sn_dust%clname ) , numdust ) 469 CALL iom_gettime( numdust, zsteps, kntime=ntimes_dust) ! get number of record in file 470 ALLOCATE( zdust(jpi,jpj,ntimes_dust) ) 471 DO jm = 1, ntimes_dust 472 CALL iom_get( numdust, jpdom_data, TRIM( sn_dust%clvar ), zdust(:,:,jm), jm ) 411 473 END DO 412 474 CALL iom_close( numdust ) 475 sumdepsi = 0.e0 476 DO jm = 1, ntimes_dust 477 sumdepsi = sumdepsi + glob_sum( zdust(:,:,jm) * e1e2t(:,:) * tmask(:,:,1) ) 478 ENDDO 479 sumdepsi = sumdepsi * r1_ryyss * 8.8 * 0.075 / 28.1 480 DEALLOCATE( zdust) 413 481 ELSE 414 dust mo(:,:,:) = 0.e0415 dust(:,:) = 0.0416 END IF417 418 ! Nutrient input from rivers482 dust(:,:) = 0._wp 483 sumdepsi = 0._wp 484 END IF 485 486 ! nutrient input from rivers 419 487 ! -------------------------- 420 488 IF( ln_river ) THEN 421 IF(lwp) WRITE(numout,*) ' Initialize the nutrient input by rivers from river.orca.nc file' 422 IF(lwp) WRITE(numout,*) ' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~' 423 CALL iom_open ( 'river.orca.nc', numriv ) 424 CALL iom_get ( numriv, jpdom_data, 'riverdic', zriver (:,:), jpyr ) 425 CALL iom_get ( numriv, jpdom_data, 'riverdoc', zriverdoc(:,:), jpyr ) 489 ALLOCATE( sf_riverdic(1), STAT=ierr1 ) !* allocate and fill sf_sst (forcing structure) with sn_sst 490 ALLOCATE( sf_riverdoc(1), STAT=ierr2 ) !* allocate and fill sf_sst (forcing structure) with sn_sst 491 IF( ierr1 + ierr2 > 0 ) CALL ctl_stop( 'STOP', 'p4z_sed_init: unable to allocate sf_apr structure' ) 492 ! 493 CALL fld_fill( sf_riverdic, (/ sn_riverdic /), cn_dir, 'p4z_sed_init', 'Input DOC from river ', 'nampissed' ) 494 CALL fld_fill( sf_riverdoc, (/ sn_riverdoc /), cn_dir, 'p4z_sed_init', 'Input DOC from river ', 'nampissed' ) 495 ALLOCATE( sf_riverdic(1)%fnow(jpi,jpj,1) ) 496 ALLOCATE( sf_riverdoc(1)%fnow(jpi,jpj,1) ) 497 IF( sn_riverdic%ln_tint ) ALLOCATE( sf_riverdic(1)%fdta(jpi,jpj,1,2) ) 498 IF( sn_riverdoc%ln_tint ) ALLOCATE( sf_riverdoc(1)%fdta(jpi,jpj,1,2) ) 499 ! Get total input rivers ; need to compute total river supply in a year 500 CALL iom_open ( TRIM( sn_riverdic%clname ), numriv ) 501 CALL iom_gettime( numriv, zsteps, kntime=ntimes_riv) 502 ALLOCATE( zriverdic(jpi,jpj,ntimes_riv) ) ; ALLOCATE( zriverdoc(jpi,jpj,ntimes_riv) ) 503 DO jm = 1, ntimes_riv 504 CALL iom_get( numriv, jpdom_data, TRIM( sn_riverdic%clvar ), zriverdic(:,:,jm), jm ) 505 CALL iom_get( numriv, jpdom_data, TRIM( sn_riverdoc%clvar ), zriverdoc(:,:,jm), jm ) 506 END DO 426 507 CALL iom_close( numriv ) 508 ! N/P and Si releases due to coastal rivers 509 ! ----------------------------------------- 510 rivpo4input = 0._wp 511 rivalkinput = 0._wp 512 DO jm = 1, ntimes_riv 513 rivpo4input = rivpo4input + glob_sum( ( zriverdic(:,:,jm) + zriverdoc(:,:,jm) ) * tmask(:,:,1) ) 514 rivalkinput = rivalkinput + glob_sum( zriverdic(:,:,jm) * tmask(:,:,1) ) 515 END DO 516 rivpo4input = rivpo4input * 1E9 / 31.6_wp 517 rivalkinput = rivalkinput * 1E9 / 12._wp 518 DEALLOCATE( zriverdic) ; DEALLOCATE( zriverdoc) 427 519 ELSE 428 zriver (:,:) = 0.e0 429 zriverdoc(:,:) = 0.e0 430 endif 431 432 ! Nutrient input from dust 520 rivinp(:,:) = 0._wp 521 cotdep(:,:) = 0._wp 522 rivpo4input = 0._wp 523 rivalkinput = 0._wp 524 END IF 525 526 ! nutrient input from dust 433 527 ! ------------------------ 434 528 IF( ln_ndepo ) THEN 435 IF(lwp) WRITE(numout,*) ' Initialize the nutrient input by dust from ndeposition.orca.nc'529 IF(lwp) WRITE(numout,*) ' initialize the nutrient input by dust from ndeposition.orca.nc' 436 530 IF(lwp) WRITE(numout,*) ' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~' 437 CALL iom_open ( 'ndeposition.orca.nc', numdep ) 438 CALL iom_get ( numdep, jpdom_data, 'ndep', zndepo(:,:), jpyr ) 439 CALL iom_close( numdep ) 531 ALLOCATE( sf_ndepo(1), STAT=ierr3 ) !* allocate and fill sf_sst (forcing structure) with sn_sst 532 IF( ierr3 > 0 ) CALL ctl_stop( 'STOP', 'p4z_sed_init: unable to allocate sf_apr structure' ) 533 ! 534 CALL fld_fill( sf_ndepo, (/ sn_ndepo /), cn_dir, 'p4z_sed_init', 'Iron from sediment ', 'nampissed' ) 535 ALLOCATE( sf_ndepo(1)%fnow(jpi,jpj,1) ) 536 IF( sn_ndepo%ln_tint ) ALLOCATE( sf_ndepo(1)%fdta(jpi,jpj,1,2) ) 537 ! 538 ! Get total input dust ; need to compute total atmospheric supply of N in a year 539 CALL iom_open ( TRIM( sn_ndepo%clname ), numdepo ) 540 CALL iom_gettime( numdepo, zsteps, kntime=ntimes_ndep) 541 ALLOCATE( zndepo(jpi,jpj,ntimes_ndep) ) 542 DO jm = 1, ntimes_ndep 543 CALL iom_get( numdepo, jpdom_data, TRIM( sn_ndepo%clvar ), zndepo(:,:,jm), jm ) 544 END DO 545 CALL iom_close( numdepo ) 546 nitdepinput = 0._wp 547 DO jm = 1, ntimes_ndep 548 nitdepinput = nitdepinput + glob_sum( zndepo(:,:,jm) * e1e2t(:,:) * tmask(:,:,1) ) 549 ENDDO 550 nitdepinput = nitdepinput * 7.6 / 14E6 551 DEALLOCATE( zndepo) 440 552 ELSE 441 zndepo(:,:) = 0.e0 442 ENDIF 443 444 ! Coastal and island masks 553 nitdep(:,:) = 0._wp 554 nitdepinput = 0._wp 555 ENDIF 556 557 ! coastal and island masks 445 558 ! ------------------------ 446 IF( ln_ sedinput) THEN447 IF(lwp) WRITE(numout,*) ' Computation of an island mask to enhance coastal supply of iron'559 IF( ln_ironsed ) THEN 560 IF(lwp) WRITE(numout,*) ' computation of an island mask to enhance coastal supply of iron' 448 561 IF(lwp) WRITE(numout,*) ' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~' 449 IF(lwp) WRITE(numout,*) ' from bathy.orca.nc file '450 CALL iom_open ( 'bathy.orca.nc', numbath)451 CALL iom_get ( num bath, jpdom_data, 'bathy', zcmask(:,:,:), jpyr)452 CALL iom_close( num bath)562 CALL iom_open ( TRIM( sn_ironsed%clname ), numiron ) 563 ALLOCATE( zcmask(jpi,jpj,jpk) ) 564 CALL iom_get ( numiron, jpdom_data, TRIM( sn_ironsed%clvar ), zcmask(:,:,:), 1 ) 565 CALL iom_close( numiron ) 453 566 ! 454 567 DO jk = 1, 5 … … 459 572 & * tmask(ji,jj-1,jk) * tmask(ji,jj,jk+1) 460 573 IF( zmaskt == 0. ) zcmask(ji,jj,jk ) = MAX( 0.1, zcmask(ji,jj,jk) ) 461 END IF574 END IF 462 575 END DO 463 576 END DO 464 577 END DO 578 CALL lbc_lnk( zcmask , 'T', 1. ) ! lateral boundary conditions on cmask (sign unchanged) 465 579 DO jk = 1, jpk 466 580 DO jj = 1, jpj 467 581 DO ji = 1, jpi 468 expide = MIN( 8.,( fsdept(ji,jj,jk) / 500. )**(-1.5) )469 denitide = -0.9543 + 0.7662 * LOG( expide ) - 0.235 * LOG(expide )**2470 zcmask(ji,jj,jk) = zcmask(ji,jj,jk) * MIN( 1., EXP( denitide ) / 0.5 )582 zexpide = MIN( 8.,( fsdept(ji,jj,jk) / 500. )**(-1.5) ) 583 zdenitide = -0.9543 + 0.7662 * LOG( zexpide ) - 0.235 * LOG( zexpide )**2 584 zcmask(ji,jj,jk) = zcmask(ji,jj,jk) * MIN( 1., EXP( zdenitide ) / 0.5 ) 471 585 END DO 472 586 END DO 473 587 END DO 588 ! Coastal supply of iron 589 ! ------------------------- 590 ironsed(:,:,jpk) = 0._wp 591 DO jk = 1, jpkm1 592 ironsed(:,:,jk) = sedfeinput * zcmask(:,:,jk) / ( fse3t(:,:,jk) * rday ) 593 END DO 594 DEALLOCATE( zcmask) 474 595 ELSE 475 zcmask(:,:,:) = 0.e0 476 ENDIF 477 478 CALL lbc_lnk( zcmask , 'T', 1. ) ! Lateral boundary conditions on zcmask (sign unchanged) 479 480 481 ! ! Number of seconds per year and per month 482 ryyss = nyear_len(1) * rday 483 rmtss = ryyss / raamo 484 rday1 = 1. / rday 485 ryyss1 = 1. / ryyss 486 ! ! ocean surface cell 487 488 ! total atmospheric supply of Si 489 ! ------------------------------ 490 sumdepsi = 0.e0 491 DO jm = 1, jpmth 492 zcoef = 1. / ( 12. * rmtss ) * 8.8 * 0.075 / 28.1 493 sumdepsi = sumdepsi + glob_sum( dustmo(:,:,jm) * e1e2t(:,:) ) * zcoef 494 ENDDO 495 496 ! N/P and Si releases due to coastal rivers 497 ! ----------------------------------------- 498 DO jj = 1, jpj 499 DO ji = 1, jpi 500 zcoef = ryyss * e1e2t(ji,jj) * fse3t(ji,jj,1) * tmask(ji,jj,1) 501 cotdep(ji,jj) = zriver(ji,jj) *1E9 / ( 12. * zcoef + rtrn ) 502 rivinp(ji,jj) = (zriver(ji,jj)+zriverdoc(ji,jj)) *1E9 / ( 31.6* zcoef + rtrn ) 503 nitdep(ji,jj) = 7.6 * zndepo(ji,jj) / ( 14E6*ryyss*fse3t(ji,jj,1) + rtrn ) 504 END DO 505 END DO 506 ! Lateral boundary conditions on ( cotdep, rivinp, nitdep ) (sign unchanged) 507 CALL lbc_lnk( cotdep , 'T', 1. ) ; CALL lbc_lnk( rivinp , 'T', 1. ) ; CALL lbc_lnk( nitdep , 'T', 1. ) 508 509 rivpo4input = glob_sum( rivinp(:,:) * cvol(:,:,1) ) * ryyss 510 rivalkinput = glob_sum( cotdep(:,:) * cvol(:,:,1) ) * ryyss 511 nitdepinput = glob_sum( nitdep(:,:) * cvol(:,:,1) ) * ryyss 512 513 514 ! Coastal supply of iron 515 ! ------------------------- 516 DO jk = 1, jpkm1 517 ironsed(:,:,jk) = sedfeinput * zcmask(:,:,jk) / ( fse3t(:,:,jk) * rday ) 518 END DO 519 CALL lbc_lnk( ironsed , 'T', 1. ) ! Lateral boundary conditions on ( ironsed ) (sign unchanged) 520 521 IF( ( wrk_not_released(2, 1,2,3) ) .OR. ( wrk_not_released(3, 2) ) ) & 522 & CALL ctl_stop('p4z_sed_init: failed to release workspace arrays') 523 596 ironsed(:,:,:) = 0._wp 597 ENDIF 598 ! 599 IF( ll_sbc ) CALL p4z_sbc( nit000 ) 600 ! 601 IF(lwp) THEN 602 WRITE(numout,*) 603 WRITE(numout,*) ' Total input of elements from river supply' 604 WRITE(numout,*) ' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~' 605 WRITE(numout,*) ' N Supply : ', rivpo4input/7.6*1E3/1E12*14.,' TgN/yr' 606 WRITE(numout,*) ' Si Supply : ', rivalkinput/6.*1E3/1E12*32.,' TgSi/yr' 607 WRITE(numout,*) ' Alk Supply : ', rivalkinput*1E3/1E12,' Teq/yr' 608 WRITE(numout,*) ' DIC Supply : ', rivpo4input*2.631*1E3*12./1E12,'TgC/yr' 609 WRITE(numout,*) 610 WRITE(numout,*) ' Total input of elements from atmospheric supply' 611 WRITE(numout,*) ' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~' 612 WRITE(numout,*) ' N Supply : ', nitdepinput/7.6*1E3/1E12*14.,' TgN/yr' 613 WRITE(numout,*) 614 ENDIF 615 ! 616 IF( nn_timing == 1 ) CALL timing_stop('p4z_sed_init') 617 ! 524 618 END SUBROUTINE p4z_sed_init 525 619 … … 529 623 !!---------------------------------------------------------------------- 530 624 531 ALLOCATE( dustmo(jpi,jpj,jpmth), dust(jpi,jpj) , & 532 & rivinp(jpi,jpj) , cotdep(jpi,jpj) , & 533 & nitdep(jpi,jpj) , ironsed(jpi,jpj,jpk), STAT=p4z_sed_alloc ) 625 ALLOCATE( dust (jpi,jpj), rivinp(jpi,jpj) , cotdep(jpi,jpj), & 626 & nitdep(jpi,jpj), ironsed(jpi,jpj,jpk), STAT=p4z_sed_alloc ) 534 627 535 628 IF( p4z_sed_alloc /= 0 ) CALL ctl_warn('p4z_sed_alloc : failed to allocate arrays.') -
trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zsink.F90
r2715 r3294 2 2 !!====================================================================== 3 3 !! *** MODULE p4zsink *** 4 !! TOP : PISCES Computevertical flux of particulate matter due to gravitational sinking4 !! TOP : PISCES vertical flux of particulate matter due to gravitational sinking 5 5 !!====================================================================== 6 6 !! History : 1.0 ! 2004 (O. Aumont) Original code 7 7 !! 2.0 ! 2007-12 (C. Ethe, G. Madec) F90 8 !! 3.4 ! 2011-06 (O. Aumont, C. Ethe) Change aggregation formula 9 !!---------------------------------------------------------------------- 8 10 #if defined key_pisces 9 11 !!---------------------------------------------------------------------- 10 12 !! p4z_sink : Compute vertical flux of particulate matter due to gravitational sinking 13 !! p4z_sink_init : Unitialisation of sinking speed parameters 14 !! p4z_sink_alloc : Allocate sinking speed variables 11 15 !!---------------------------------------------------------------------- 12 USE trc13 USE oce_trc !14 USE sms_pisces 15 USE prtctl_trc 16 USE iom 16 USE oce_trc ! shared variables between ocean and passive tracers 17 USE trc ! passive tracers common variables 18 USE sms_pisces ! PISCES Source Minus Sink variables 19 USE prtctl_trc ! print control for debugging 20 USE iom ! I/O manager 17 21 18 22 IMPLICIT NONE … … 80 84 !! ** Method : - ??? 81 85 !!--------------------------------------------------------------------- 82 USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released83 USE wrk_nemo, ONLY: znum3d => wrk_3d_284 86 ! 85 87 INTEGER, INTENT(in) :: kt, jnt … … 91 93 REAL(wp) :: zdiv , zdiv1, zdiv2, zdiv3, zdiv4, zdiv5 92 94 REAL(wp) :: zval1, zval2, zval3, zval4 93 #if defined key_diatrc94 95 REAL(wp) :: zrfact2 95 96 INTEGER :: ik1 96 #endif97 97 CHARACTER (len=25) :: charout 98 !!--------------------------------------------------------------------- 99 ! 100 IF( wrk_in_use(3, 2 ) ) THEN 101 CALL ctl_stop('p4z_sink: requested workspace arrays unavailable') ; RETURN 102 ENDIF 103 98 REAL(wp), POINTER, DIMENSION(:,:,:) :: znum3d 99 !!--------------------------------------------------------------------- 100 ! 101 IF( nn_timing == 1 ) CALL timing_start('p4z_sink') 102 ! 103 CALL wrk_alloc( jpi, jpj, jpk, znum3d ) 104 ! 104 105 ! Initialisation of variables used to compute Sinking Speed 105 106 ! --------------------------------------------------------- … … 193 194 & * (zeps-1)/zdiv1 + 3.*(zfm*xkr_mass_max-xkr_mass_min) & 194 195 & * (zfm*xkr_mass_max**2-xkr_mass_min**2) & 195 & * (zeps-1.)**2/(zdiv2*zdiv3)) & 196 # if defined key_degrad 197 & *facvol(ji,jj,jk) & 198 # endif 199 & ) 200 201 zagg2 = ( 2*0.163*trn(ji,jj,jk,jpnum)**2*zfm* & 196 & * (zeps-1.)**2/(zdiv2*zdiv3)) 197 zagg2 = 2*0.163*trn(ji,jj,jk,jpnum)**2*zfm* & 202 198 & ((xkr_mass_max**3+3.*(xkr_mass_max**2 & 203 199 & *xkr_mass_min*(zeps-1.)/zdiv2 & … … 205 201 & +xkr_mass_min**3*(zeps-1)/zdiv1) & 206 202 & -zfm*xkr_mass_max**3*(1.+3.*((zeps-1.)/ & 207 & (zeps-2.)+(zeps-1.)/zdiv3)+(zeps-1.)/zdiv1)) & 208 # if defined key_degrad 209 & *facvol(ji,jj,jk) & 210 # endif 211 & ) 212 213 zagg3 = ( 0.163*trn(ji,jj,jk,jpnum)**2*zfm**2*8. * xkr_mass_max**3 & 214 # if defined key_degrad 215 & *facvol(ji,jj,jk) & 216 # endif 217 & ) 218 219 zaggsh = ( zagg1 + zagg2 + zagg3 ) * rfact2 * xdiss(ji,jj,jk) / 1000. 220 203 & (zeps-2.)+(zeps-1.)/zdiv3)+(zeps-1.)/zdiv1)) 204 205 zagg3 = 0.163*trn(ji,jj,jk,jpnum)**2*zfm**2*8. * xkr_mass_max**3 206 221 207 ! Aggregation of small into large particles 222 208 ! Part II : Differential settling 223 209 ! ---------------------------------------------- 224 210 225 zagg4 = (2.*3.141*0.125*trn(ji,jj,jk,jpnum)**2* &211 zagg4 = 2.*3.141*0.125*trn(ji,jj,jk,jpnum)**2* & 226 212 & xkr_wsbio_min*(zeps-1.)**2 & 227 213 & *(xkr_mass_min**2*((1.-zsm*zfm)/(zdiv3*zdiv4) & 228 214 & -(1.-zfm)/(zdiv*(zeps-1.)))- & 229 215 & ((zfm*zfm*xkr_mass_max**2*zsm-xkr_mass_min**2) & 230 & *xkr_eta)/(zdiv*zdiv3*zdiv5) ) & 231 # if defined key_degrad 232 & *facvol(ji,jj,jk) & 233 # endif 234 & ) 235 236 zagg5 = ( 2.*3.141*0.125*trn(ji,jj,jk,jpnum)**2 & 216 & *xkr_eta)/(zdiv*zdiv3*zdiv5) ) 217 218 zagg5 = 2.*3.141*0.125*trn(ji,jj,jk,jpnum)**2 & 237 219 & *(zeps-1.)*zfm*xkr_wsbio_min & 238 220 & *(zsm*(xkr_mass_min**2-zfm*xkr_mass_max**2) & 239 221 & /zdiv3-(xkr_mass_min**2-zfm*zsm*xkr_mass_max**2) & 240 & /zdiv) & 241 # if defined key_degrad 242 & *facvol(ji,jj,jk) & 243 # endif 244 & ) 245 222 & /zdiv) 246 223 zaggsi = ( zagg4 + zagg5 ) * xstep / 10. 247 224 … … 253 230 zaggdoc = ( 0.4 * trn(ji,jj,jk,jpdoc) & 254 231 & + 1018. * trn(ji,jj,jk,jppoc) ) * xstep & 232 & * xdiss(ji,jj,jk) * trn(ji,jj,jk,jpdoc) 233 255 234 # if defined key_degrad 256 & * facvol(ji,jj,jk) & 235 zagg1 = zagg1 * facvol(ji,jj,jk) 236 zagg2 = zagg2 * facvol(ji,jj,jk) 237 zagg3 = zagg3 * facvol(ji,jj,jk) 238 zagg4 = zagg4 * facvol(ji,jj,jk) 239 zagg5 = zagg5 * facvol(ji,jj,jk) 240 zaggdoc = zaggdoc * facvol(ji,jj,jk) 257 241 # endif 258 & * xdiss(ji,jj,jk) * trn(ji,jj,jk,jpdoc) 259 242 zaggsh = ( zagg1 + zagg2 + zagg3 ) * rfact2 * xdiss(ji,jj,jk) / 1000. 243 zaggsi = ( zagg4 + zagg5 ) * xstep / 10. 244 zagg = 0.5 * xkr_stick * ( zaggsh + zaggsi ) 245 ! 260 246 znumdoc = trn(ji,jj,jk,jpnum) / ( trn(ji,jj,jk,jppoc) + rtrn ) 261 247 tra(ji,jj,jk,jppoc) = tra(ji,jj,jk,jppoc) + zaggdoc … … 268 254 END DO 269 255 270 #if defined key_diatrc 271 zrfact2 = 1.e3 * rfact2r272 ik1 = iksed + 1273 # if ! defined key_iomput 274 trc2d(:,: ,jp_pcs0_2d + 4) = sinking (:,:,ik1) * zrfact2 * tmask(:,:,1)275 trc2d(:,: ,jp_pcs0_2d + 5) = sinking2(:,:,ik1) * zrfact2 * tmask(:,:,1)276 trc2d(:,: ,jp_pcs0_2d + 6) = sinkfer (:,:,ik1) * zrfact2 * tmask(:,:,1)277 trc2d(:,: ,jp_pcs0_2d + 7) = sinksil (:,:,ik1) * zrfact2 * tmask(:,:,1)278 trc2d(:,: ,jp_pcs0_2d + 8) = sinkcal (:,:,ik1) * zrfact2 * tmask(:,:,1)279 trc3d(:,:,:,jp_pcs0_3d + 11) = sinking (:,:,:) * zrfact2 * tmask(:,:,:)280 trc3d(:,:,:,jp_pcs0_3d + 12) = sinking2(:,:,:) * zrfact2 * tmask(:,:,:)281 trc3d(:,:,:,jp_pcs0_3d + 13) = sinksil (:,:,:) * zrfact2 * tmask(:,:,:)282 trc3d(:,:,:,jp_pcs0_3d + 14) = sinkcal (:,:,:) * zrfact2 * tmask(:,:,:)283 trc3d(:,:,:,jp_pcs0_3d + 15) = znum3d (:,:,:) * tmask(:,:,:)284 trc3d(:,:,:,jp_pcs0_3d + 16) = wsbio3 (:,:,:) * tmask(:,:,:)285 trc3d(:,:,:,jp_pcs0_3d + 17) = wsbio4 (:,:,:) * tmask(:,:,:)286 #else 287 IF( jnt == nrdttrc ) then288 CALL iom_put( "POCFlx" , sinking (:,:,:) * zrfact2 * tmask(:,:,:) ) ! POC export289 CALL iom_put( "NumFlx" , sinking2 (:,:,:) * zrfact2 * tmask(:,:,:) ) ! Num export290 CALL iom_put( "SiFlx" , sinksil (:,:,:) * zrfact2 * tmask(:,:,:) ) ! Silica export291 CALL iom_put( "CaCO3Flx", sinkcal (:,:,:) * zrfact2 * tmask(:,:,:) ) ! Calcite export292 CALL iom_put( "xnum" , znum3d (:,:,:) * tmask(:,:,:) ) ! Number of particles in aggregats293 CALL iom_put( "W1" , wsbio3 (:,:,:) * tmask(:,:,:) ) ! sinking speed of POC294 CALL iom_put( "W2" , wsbio4 (:,:,:) * tmask(:,:,:) ) ! sinking speed of aggregats295 CALL iom_put( "PMO" , sinking (:,:,ik1) * zrfact2 * tmask(:,:,1) ) ! POC export at 100m296 CALL iom_put( "PMO2" , sinking2(:,:,ik1) * zrfact2 * tmask(:,:,1) ) ! Num export at 100m297 CALL iom_put( "ExpFe1" , sinkfer (:,:,ik1) * zrfact2 * tmask(:,:,1) ) ! Export of iron at 100m298 CALL iom_put( "ExpSi" , sinksil (:,:,ik1) * zrfact2 * tmask(:,:,1) ) ! export of silica at 100m299 CALL iom_put( "ExpCaCO3", sinkcal (:,:,ik1) * zrfact2 * tmask(:,:,1) ) ! export of calcite at 100m300 ENDIF301 # 302 303 #endif 256 IF( ln_diatrc ) THEN 257 ! 258 ik1 = iksed + 1 259 zrfact2 = 1.e3 * rfact2r 260 IF( jnt == nrdttrc ) THEN 261 CALL iom_put( "POCFlx" , sinking (:,:,:) * zrfact2 * tmask(:,:,:) ) ! POC export 262 CALL iom_put( "NumFlx" , sinking2 (:,:,:) * zrfact2 * tmask(:,:,:) ) ! Num export 263 CALL iom_put( "SiFlx" , sinksil (:,:,:) * zrfact2 * tmask(:,:,:) ) ! Silica export 264 CALL iom_put( "CaCO3Flx", sinkcal (:,:,:) * zrfact2 * tmask(:,:,:) ) ! Calcite export 265 CALL iom_put( "xnum" , znum3d (:,:,:) * tmask(:,:,:) ) ! Number of particles in aggregats 266 CALL iom_put( "W1" , wsbio3 (:,:,:) * tmask(:,:,:) ) ! sinking speed of POC 267 CALL iom_put( "W2" , wsbio4 (:,:,:) * tmask(:,:,:) ) ! sinking speed of aggregats 268 CALL iom_put( "PMO" , sinking (:,:,ik1) * zrfact2 * tmask(:,:,1) ) ! POC export at 100m 269 CALL iom_put( "PMO2" , sinking2(:,:,ik1) * zrfact2 * tmask(:,:,1) ) ! Num export at 100m 270 CALL iom_put( "ExpFe1" , sinkfer (:,:,ik1) * zrfact2 * tmask(:,:,1) ) ! Export of iron at 100m 271 CALL iom_put( "ExpSi" , sinksil (:,:,ik1) * zrfact2 * tmask(:,:,1) ) ! export of silica at 100m 272 CALL iom_put( "ExpCaCO3", sinkcal (:,:,ik1) * zrfact2 * tmask(:,:,1) ) ! export of calcite at 100m 273 ENDIF 274 # if ! defined key_iomput 275 trc2d(:,: ,jp_pcs0_2d + 4) = sinking (:,:,ik1) * zrfact2 * tmask(:,:,1) 276 trc2d(:,: ,jp_pcs0_2d + 5) = sinking2(:,:,ik1) * zrfact2 * tmask(:,:,1) 277 trc2d(:,: ,jp_pcs0_2d + 6) = sinkfer (:,:,ik1) * zrfact2 * tmask(:,:,1) 278 trc2d(:,: ,jp_pcs0_2d + 7) = sinksil (:,:,ik1) * zrfact2 * tmask(:,:,1) 279 trc2d(:,: ,jp_pcs0_2d + 8) = sinkcal (:,:,ik1) * zrfact2 * tmask(:,:,1) 280 trc3d(:,:,:,jp_pcs0_3d + 11) = sinking (:,:,:) * zrfact2 * tmask(:,:,:) 281 trc3d(:,:,:,jp_pcs0_3d + 12) = sinking2(:,:,:) * zrfact2 * tmask(:,:,:) 282 trc3d(:,:,:,jp_pcs0_3d + 13) = sinksil (:,:,:) * zrfact2 * tmask(:,:,:) 283 trc3d(:,:,:,jp_pcs0_3d + 14) = sinkcal (:,:,:) * zrfact2 * tmask(:,:,:) 284 trc3d(:,:,:,jp_pcs0_3d + 15) = znum3d (:,:,:) * tmask(:,:,:) 285 trc3d(:,:,:,jp_pcs0_3d + 16) = wsbio3 (:,:,:) * tmask(:,:,:) 286 trc3d(:,:,:,jp_pcs0_3d + 17) = wsbio4 (:,:,:) * tmask(:,:,:) 287 # endif 288 ! 289 ENDIF 304 290 ! 305 291 IF(ln_ctl) THEN ! print mean trends (used for debugging) … … 309 295 ENDIF 310 296 ! 311 IF( wrk_not_released(3, 2 ) ) CALL ctl_stop('p4z_sink: failed to release workspace arrays') 297 CALL wrk_alloc( jpi, jpj, jpk, znum3d ) 298 ! 299 IF( nn_timing == 1 ) CALL timing_stop('p4z_sink') 312 300 ! 313 301 END SUBROUTINE p4z_sink … … 335 323 !!---------------------------------------------------------------------- 336 324 ! 337 REWIND( numnat ) ! read nampiskrs 338 READ ( numnat, nampiskrs ) 325 IF( nn_timing == 1 ) CALL timing_start('p4z_sink_init') 326 ! 327 REWIND( numnatp ) ! read nampiskrs 328 READ ( numnatp, nampiskrs ) 339 329 340 330 IF(lwp) THEN … … 441 431 END DO 442 432 ! 433 IF( nn_timing == 1 ) CALL timing_stop('p4z_sink_init') 434 ! 443 435 END SUBROUTINE p4z_sink_init 444 436 … … 457 449 INTEGER :: ji, jj, jk 458 450 REAL(wp) :: zagg1, zagg2, zagg3, zagg4 459 REAL(wp) :: zagg , zaggfe, zaggdoc, zaggdoc2 460 REAL(wp) :: zfact, zwsmax, zstep 461 #if defined key_diatrc 451 REAL(wp) :: zagg , zaggfe, zaggdoc, zaggdoc2, zaggdoc3 452 REAL(wp) :: zfact, zwsmax, zmax, zstep 462 453 REAL(wp) :: zrfact2 463 454 INTEGER :: ik1 464 #endif465 455 CHARACTER (len=25) :: charout 466 456 !!--------------------------------------------------------------------- 467 457 ! 458 IF( nn_timing == 1 ) CALL timing_start('p4z_sink') 459 ! 468 460 ! Sinking speeds of detritus is increased with depth as shown 469 461 ! by data and from the coagulation theory … … 471 463 DO jk = 1, jpkm1 472 464 DO jj = 1, jpj 473 DO ji=1,jpi 474 zfact = MAX( 0., fsdepw(ji,jj,jk+1) - hmld(ji,jj) ) / 4000._wp 465 DO ji = 1,jpi 466 ! zmax = MAX( heup(ji,jj), hmld(ji,jj) ) 467 ! zfact = MAX( 0., fsdepw(ji,jj,jk+1) - zmax ) / 5000._wp 468 zmax = hmld(ji,jj) 469 zfact = MAX( 0., fsdepw(ji,jj,jk+1) - zmax ) / 4000._wp 475 470 wsbio4(ji,jj,jk) = wsbio2 + ( 200.- wsbio2 ) * zfact 476 471 END DO … … 526 521 DO jj = 1, jpj 527 522 DO ji = 1, jpi 523 ! 524 zstep = xstep 528 525 # if defined key_degrad 529 zstep = xstep * facvol(ji,jj,jk) 530 # else 531 zstep = xstep 526 zstep = zstep * facvol(ji,jj,jk) 532 527 # endif 533 528 zfact = zstep * xdiss(ji,jj,jk) 534 529 ! Part I : Coagulation dependent on turbulence 535 zagg1 = 940.* zfact * trn(ji,jj,jk,jppoc) * trn(ji,jj,jk,jppoc)536 zagg2 = 1.054e4* zfact * trn(ji,jj,jk,jppoc) * trn(ji,jj,jk,jpgoc)530 zagg1 = 354. * zfact * trn(ji,jj,jk,jppoc) * trn(ji,jj,jk,jppoc) 531 zagg2 = 4452. * zfact * trn(ji,jj,jk,jppoc) * trn(ji,jj,jk,jpgoc) 537 532 538 533 ! Part II : Differential settling 539 534 540 535 ! Aggregation of small into large particles 541 zagg3 = 0.66* zstep * trn(ji,jj,jk,jppoc) * trn(ji,jj,jk,jpgoc)542 zagg4 = 0.e0* zstep * trn(ji,jj,jk,jppoc) * trn(ji,jj,jk,jppoc)536 zagg3 = 4.7 * zstep * trn(ji,jj,jk,jppoc) * trn(ji,jj,jk,jpgoc) 537 zagg4 = 0.4 * zstep * trn(ji,jj,jk,jppoc) * trn(ji,jj,jk,jppoc) 543 538 544 539 zagg = zagg1 + zagg2 + zagg3 + zagg4 … … 546 541 547 542 ! Aggregation of DOC to small particles 548 zaggdoc = ( 80.* trn(ji,jj,jk,jpdoc) + 698. * trn(ji,jj,jk,jppoc) ) * zfact * trn(ji,jj,jk,jpdoc) 549 zaggdoc2 = 1.05e4 * zfact * trn(ji,jj,jk,jpgoc) * trn(ji,jj,jk,jpdoc) 543 zaggdoc = ( 0.83 * trn(ji,jj,jk,jpdoc) + 271. * trn(ji,jj,jk,jppoc) ) * zfact * trn(ji,jj,jk,jpdoc) 544 zaggdoc2 = 1.07e4 * zfact * trn(ji,jj,jk,jpgoc) * trn(ji,jj,jk,jpdoc) 545 zaggdoc3 = 0.02 * ( 16706. * trn(ji,jj,jk,jppoc) + 231. * trn(ji,jj,jk,jpdoc) ) * zstep * trn(ji,jj,jk,jpdoc) 550 546 551 547 ! Update the trends 552 tra(ji,jj,jk,jppoc) = tra(ji,jj,jk,jppoc) - zagg + zaggdoc 548 tra(ji,jj,jk,jppoc) = tra(ji,jj,jk,jppoc) - zagg + zaggdoc + zaggdoc3 553 549 tra(ji,jj,jk,jpgoc) = tra(ji,jj,jk,jpgoc) + zagg + zaggdoc2 554 550 tra(ji,jj,jk,jpsfe) = tra(ji,jj,jk,jpsfe) - zaggfe 555 551 tra(ji,jj,jk,jpbfe) = tra(ji,jj,jk,jpbfe) + zaggfe 556 tra(ji,jj,jk,jpdoc) = tra(ji,jj,jk,jpdoc) - zaggdoc - zaggdoc2 552 tra(ji,jj,jk,jpdoc) = tra(ji,jj,jk,jpdoc) - zaggdoc - zaggdoc2 - zaggdoc3 557 553 ! 558 554 END DO … … 560 556 END DO 561 557 562 #if defined key_diatrc 563 zrfact2 = 1.e3 * rfact2r 564 ik1 = iksed + 1 565 # if ! defined key_iomput 566 trc2d(:,:,jp_pcs0_2d + 4) = sinking (:,:,ik1) * zrfact2 * tmask(:,:,1) 567 trc2d(:,:,jp_pcs0_2d + 5) = sinking2(:,:,ik1) * zrfact2 * tmask(:,:,1) 568 trc2d(:,:,jp_pcs0_2d + 6) = sinkfer (:,:,ik1) * zrfact2 * tmask(:,:,1) 569 trc2d(:,:,jp_pcs0_2d + 7) = sinkfer2(:,:,ik1) * zrfact2 * tmask(:,:,1) 570 trc2d(:,:,jp_pcs0_2d + 8) = sinksil (:,:,ik1) * zrfact2 * tmask(:,:,1) 571 trc2d(:,:,jp_pcs0_2d + 9) = sinkcal (:,:,ik1) * zrfact2 * tmask(:,:,1) 572 # else 573 IF( jnt == nrdttrc ) then 574 CALL iom_put( "EPC100" , ( sinking(:,:,ik1) + sinking2(:,:,ik1) ) * zrfact2 * tmask(:,:,1) ) ! Export of carbon at 100m 575 CALL iom_put( "EPFE100" , ( sinkfer(:,:,ik1) + sinkfer2(:,:,ik1) ) * zrfact2 * tmask(:,:,1) ) ! Export of iron at 100m 576 CALL iom_put( "EPCAL100", sinkcal(:,:,ik1) * zrfact2 * tmask(:,:,1) ) ! Export of calcite at 100m 577 CALL iom_put( "EPSI100" , sinksil(:,:,ik1) * zrfact2 * tmask(:,:,1) ) ! Export of biogenic silica at 100m 558 IF( ln_diatrc ) THEN 559 zrfact2 = 1.e3 * rfact2r 560 ik1 = iksed + 1 561 IF( lk_iomput ) THEN 562 IF( jnt == nrdttrc ) THEN 563 CALL iom_put( "EPC100" , ( sinking(:,:,ik1) + sinking2(:,:,ik1) ) * zrfact2 * tmask(:,:,1) ) ! Export of carbon at 100m 564 CALL iom_put( "EPFE100" , ( sinkfer(:,:,ik1) + sinkfer2(:,:,ik1) ) * zrfact2 * tmask(:,:,1) ) ! Export of iron at 100m 565 CALL iom_put( "EPCAL100", sinkcal(:,:,ik1) * zrfact2 * tmask(:,:,1) ) ! Export of calcite at 100m 566 CALL iom_put( "EPSI100" , sinksil(:,:,ik1) * zrfact2 * tmask(:,:,1) ) ! Export of biogenic silica at 100m 567 ENDIF 568 ELSE 569 trc2d(:,:,jp_pcs0_2d + 4) = sinking (:,:,ik1) * zrfact2 * tmask(:,:,1) 570 trc2d(:,:,jp_pcs0_2d + 5) = sinking2(:,:,ik1) * zrfact2 * tmask(:,:,1) 571 trc2d(:,:,jp_pcs0_2d + 6) = sinkfer (:,:,ik1) * zrfact2 * tmask(:,:,1) 572 trc2d(:,:,jp_pcs0_2d + 7) = sinkfer2(:,:,ik1) * zrfact2 * tmask(:,:,1) 573 trc2d(:,:,jp_pcs0_2d + 8) = sinksil (:,:,ik1) * zrfact2 * tmask(:,:,1) 574 trc2d(:,:,jp_pcs0_2d + 9) = sinkcal (:,:,ik1) * zrfact2 * tmask(:,:,1) 575 ENDIF 578 576 ENDIF 579 #endif580 #endif581 577 ! 582 578 IF(ln_ctl) THEN ! print mean trends (used for debugging) … … 586 582 ENDIF 587 583 ! 584 IF( nn_timing == 1 ) CALL timing_stop('p4z_sink') 585 ! 588 586 END SUBROUTINE p4z_sink 589 590 587 591 588 SUBROUTINE p4z_sink_init … … 597 594 #endif 598 595 596 597 599 598 SUBROUTINE p4z_sink2( pwsink, psinkflx, jp_tra ) 600 599 !!--------------------------------------------------------------------- … … 608 607 !! transport term, i.e. div(u*tra). 609 608 !!--------------------------------------------------------------------- 610 USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released611 USE wrk_nemo, ONLY: ztraz => wrk_3d_2, zakz => wrk_3d_3, zwsink2 => wrk_3d_4612 609 ! 613 610 INTEGER , INTENT(in ) :: jp_tra ! tracer index index … … 617 614 INTEGER :: ji, jj, jk, jn 618 615 REAL(wp) :: zigma,zew,zign, zflx, zstep 619 !!--------------------------------------------------------------------- 620 621 IF( wrk_in_use(3, 2,3,4 ) ) THEN 622 CALL ctl_stop('p4z_sink2: requested workspace arrays unavailable') 623 RETURN 624 END IF 616 REAL(wp), POINTER, DIMENSION(:,:,:) :: ztraz, zakz, zwsink2 617 !!--------------------------------------------------------------------- 618 ! 619 IF( nn_timing == 1 ) CALL timing_start('p4z_sink2') 620 ! 621 ! Allocate temporary workspace 622 CALL wrk_alloc( jpi, jpj, jpk, ztraz, zakz, zwsink2 ) 625 623 626 624 zstep = rfact2 / 2. … … 630 628 631 629 DO jk = 1, jpkm1 632 # if defined key_degrad 633 zwsink2(:,:,jk+1) = -pwsink(:,:,jk) / rday * tmask(:,:,jk+1) * facvol(:,:,jk) 634 # else 635 zwsink2(:,:,jk+1) = -pwsink(:,:,jk) / rday * tmask(:,:,jk+1) 636 # endif 630 zwsink2(:,:,jk+1) = -pwsink(:,:,jk) / rday * tmask(:,:,jk+1) 637 631 END DO 638 632 zwsink2(:,:,1) = 0.e0 633 IF( lk_degrad ) THEN 634 zwsink2(:,:,:) = zwsink2(:,:,:) * facvol(:,:,:) 635 ENDIF 639 636 640 637 … … 706 703 psinkflx(:,:,:) = 2. * psinkflx(:,:,:) 707 704 ! 708 IF( wrk_not_released(3, 2,3,4) ) CALL ctl_stop('p4z_sink2: failed to release workspace arrays') 705 CALL wrk_dealloc( jpi, jpj, jpk, ztraz, zakz, zwsink2 ) 706 ! 707 IF( nn_timing == 1 ) CALL timing_stop('p4z_sink2') 709 708 ! 710 709 END SUBROUTINE p4z_sink2 -
trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/par_pisces.F90
r2528 r3294 29 29 LOGICAL, PUBLIC, PARAMETER :: lk_kriest = .TRUE. !: Kriest flag 30 30 INTEGER, PUBLIC, PARAMETER :: jp_pisces = 23 !: number of passive tracers 31 INTEGER, PUBLIC, PARAMETER :: jp_pisces_2d = 13 !: additional 2d output ('key_diatrc')32 INTEGER, PUBLIC, PARAMETER :: jp_pisces_3d = 18 !: additional 3d output ('key_diatrc')31 INTEGER, PUBLIC, PARAMETER :: jp_pisces_2d = 13 !: additional 2d output 32 INTEGER, PUBLIC, PARAMETER :: jp_pisces_3d = 18 !: additional 3d output 33 33 INTEGER, PUBLIC, PARAMETER :: jp_pisces_trd = 1 !: number of sms trends for PISCES 34 34 … … 67 67 LOGICAL, PUBLIC, PARAMETER :: lk_kriest = .FALSE. !: Kriest flag 68 68 INTEGER, PUBLIC, PARAMETER :: jp_pisces = 24 !: number of PISCES passive tracers 69 INTEGER, PUBLIC, PARAMETER :: jp_pisces_2d = 13 !: additional 2d output ('key_diatrc')70 INTEGER, PUBLIC, PARAMETER :: jp_pisces_3d = 11 !: additional 3d output ('key_diatrc')69 INTEGER, PUBLIC, PARAMETER :: jp_pisces_2d = 13 !: additional 2d output 70 INTEGER, PUBLIC, PARAMETER :: jp_pisces_3d = 11 !: additional 3d output 71 71 INTEGER, PUBLIC, PARAMETER :: jp_pisces_trd = 1 !: number of sms trends for PISCES 72 72 -
trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/sms_pisces.F90
r2715 r3294 17 17 PUBLIC 18 18 19 INTEGER :: numnatp 20 19 21 !!* Time variables 20 22 INTEGER :: nrdttrc !: ??? … … 25 27 26 28 !!* Biological parameters 27 REAL(wp) :: part !: ???28 29 REAL(wp) :: rno3 !: ??? 29 30 REAL(wp) :: o2ut !: ??? 30 31 REAL(wp) :: po4r !: ??? 31 32 REAL(wp) :: rdenit !: ??? 33 REAL(wp) :: rdenita !: ??? 32 34 REAL(wp) :: o2nit !: ??? 33 35 REAL(wp) :: wsbio, wsbio2 !: ??? … … 37 39 !!* Damping 38 40 LOGICAL :: ln_pisdmp !: relaxation or not of nutrients to a mean value 41 INTEGER :: nn_pisdmp !: frequency of relaxation or not of nutrients to a mean value 39 42 LOGICAL :: ln_pisclo !: Restoring or not of nutrients to initial value 40 43 !: on close seas … … 55 58 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: concdfe !: ??? 56 59 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: concnfe !: ??? 60 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: xlimnfe !: ??? 61 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: xlimdfe !: ??? 62 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: xlimsi !: ??? 63 57 64 58 65 !!* SMS for the organic matter … … 61 68 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: xlimbac !: ?? 62 69 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: xdiss !: ?? 63 #if defined key_diatrc 64 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: prodcal !: Calcite production 65 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: grazing !: Total zooplankton grazing 66 #endif 70 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: prodcal !: Calcite production 71 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: grazing !: Total zooplankton grazing 67 72 68 73 !!* Variable for chemistry of the CO2 cycle … … 74 79 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: borat !: ??? 75 80 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: hi !: ??? 81 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: excess !: ??? 82 83 !!* Temperature dependancy of SMS terms 84 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: tgfunc !: Temp. dependancy of various biological rates 85 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: tgfunc2 !: Temp. dependancy of mesozooplankton rates 76 86 77 87 !!* Array used to indicate negative tracer values … … 98 108 !!---------------------------------------------------------------------- 99 109 USE lib_mpp , ONLY: ctl_warn 100 INTEGER :: ierr( 5) ! Local variables110 INTEGER :: ierr(6) ! Local variables 101 111 !!---------------------------------------------------------------------- 102 112 ierr(:) = 0 103 !104 113 !* Biological fluxes for light 105 ALLOCATE( neln(jpi,jpj), heup(jpi,jpj), 114 ALLOCATE( neln(jpi,jpj), heup(jpi,jpj), STAT=ierr(1) ) 106 115 ! 107 116 !* Biological fluxes for primary production 108 ALLOCATE( xksimax(jpi,jpj) , xksi(jpi,jpj) , & 109 & xnanono3(jpi,jpj,jpk), xdiatno3(jpi,jpj,jpk), & 110 & xnanonh4(jpi,jpj,jpk), xdiatnh4(jpi,jpj,jpk), & 111 & xlimphy (jpi,jpj,jpk), xlimdia (jpi,jpj,jpk), & 112 & concdfe (jpi,jpj,jpk), concnfe (jpi,jpj,jpk), STAT=ierr(2) ) 117 ALLOCATE( xksimax(jpi,jpj) , xksi(jpi,jpj) , & 118 & xnanono3(jpi,jpj,jpk), xdiatno3(jpi,jpj,jpk), & 119 & xnanonh4(jpi,jpj,jpk), xdiatnh4(jpi,jpj,jpk), & 120 & xlimphy (jpi,jpj,jpk), xlimdia (jpi,jpj,jpk), & 121 & xlimnfe (jpi,jpj,jpk), xlimdfe (jpi,jpj,jpk), & 122 & xlimsi (jpi,jpj,jpk), concdfe (jpi,jpj,jpk), & 123 & concnfe (jpi,jpj,jpk), STAT=ierr(2) ) 113 124 ! 114 125 !* SMS for the organic matter 115 ALLOCATE( xfracal (jpi,jpj,jpk), nitrfac (jpi,jpj,jpk), & 116 #if defined key_diatrc 117 & prodcal(jpi,jpj,jpk) , grazing(jpi,jpj,jpk) , & 118 #endif 119 & xlimbac (jpi,jpj,jpk), xdiss(jpi,jpj,jpk) , STAT=ierr(3) ) 126 ALLOCATE( xfracal (jpi,jpj,jpk), nitrfac(jpi,jpj,jpk), & 127 & prodcal(jpi,jpj,jpk) , grazing(jpi,jpj,jpk), & 128 & xlimbac (jpi,jpj,jpk), xdiss (jpi,jpj,jpk), STAT=ierr(3) ) 120 129 ! 121 130 !* Variable for chemistry of the CO2 cycle 122 ALLOCATE( akb3(jpi,jpj,jpk), ak13(jpi,jpj,jpk) , & 123 & ak23(jpi,jpj,jpk), aksp(jpi,jpj,jpk) , & 124 & akw3(jpi,jpj,jpk), borat(jpi,jpj,jpk), hi(jpi,jpj,jpk), STAT=ierr(4) ) 131 ALLOCATE( akb3(jpi,jpj,jpk) , ak13 (jpi,jpj,jpk) , & 132 & ak23(jpi,jpj,jpk) , aksp (jpi,jpj,jpk) , & 133 & akw3(jpi,jpj,jpk) , borat (jpi,jpj,jpk) , & 134 & hi (jpi,jpj,jpk) , excess(jpi,jpj,jpk) , STAT=ierr(4) ) 135 ! 136 !* Temperature dependancy of SMS terms 137 ALLOCATE( tgfunc(jpi,jpj,jpk) , tgfunc2(jpi,jpj,jpk) , STAT=ierr(5) ) 125 138 ! 126 139 !* Array used to indicate negative tracer values 127 ALLOCATE( xnegtr(jpi,jpj,jpk) , STAT=ierr(5) )140 ALLOCATE( xnegtr(jpi,jpj,jpk) , STAT=ierr(6) ) 128 141 ! 129 142 sms_pisces_alloc = MAXVAL( ierr ) -
trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/trcini_pisces.F90
r2715 r3294 17 17 !!---------------------------------------------------------------------- 18 18 USE par_trc ! TOP parameters 19 USE sms_pisces ! Source Minus Sink variables 20 USE trc 21 USE oce_trc ! ocean variables 22 USE p4zche 23 USE p4zche ! 24 USE p4zsink ! 25 USE p4zopt ! 26 USE p4zprod ! 27 USE p4zrem ! 28 USE p4zsed ! 29 USE p4zflx ! 19 USE oce_trc ! shared variables between ocean and passive tracers 20 USE trc ! passive tracers common variables 21 USE sms_pisces ! PISCES Source Minus Sink variables 22 USE p4zche ! Chemical model 23 USE p4zsink ! vertical flux of particulate matter due to sinking 24 USE p4zopt ! optical model 25 USE p4zrem ! Remineralisation of organic matter 26 USE p4zflx ! Gas exchange 27 USE p4zsed ! Sedimentation 28 USE p4zlim ! Co-limitations of differents nutrients 29 USE p4zprod ! Growth rate of the 2 phyto groups 30 USE p4zmicro ! Sources and sinks of microzooplankton 31 USE p4zmeso ! Sources and sinks of mesozooplankton 32 USE p4zmort ! Mortality terms for phytoplankton 33 USE p4zlys ! Calcite saturation 34 USE p4zsed ! Sedimentation 30 35 31 36 IMPLICIT NONE … … 40 45 REAL(wp) :: bioma0 = 1.000e-8_wp 41 46 REAL(wp) :: silic1 = 91.65e-6_wp 42 REAL(wp) :: no3 = 31.04e-6_wp * 7.6 _wp47 REAL(wp) :: no3 = 31.04e-6_wp * 7.625_wp 43 48 44 49 # include "top_substitute.h90" … … 57 62 !!---------------------------------------------------------------------- 58 63 ! 64 INTEGER :: ji, jj, jk 65 REAL(wp) :: zcaralk, zbicarb, zco3 66 REAL(wp) :: ztmas, ztmas1 67 !!---------------------------------------------------------------------- 59 68 IF(lwp) WRITE(numout,*) 60 69 IF(lwp) WRITE(numout,*) ' trc_ini_pisces : PISCES biochemical model initialisation' … … 76 85 ! Set biological ratios 77 86 ! --------------------- 78 rno3 = (16.+2.) / 122. 79 po4r = 1.e0 / 122. 80 o2nit = 32. / 122. 81 rdenit = 97.6 / 16. 82 o2ut = 140. / 122. 87 rno3 = 16._wp / 122._wp 88 po4r = 1._wp / 122._wp 89 o2nit = 32._wp / 122._wp 90 rdenit = 105._wp / 16._wp 91 rdenita = 3._wp / 5._wp 92 o2ut = 131._wp / 122._wp 83 93 84 94 CALL p4z_che ! initialize the chemical constants … … 124 134 ENDIF 125 135 136 IF( .NOT. ln_rsttr ) THEN 137 ! Initialization of chemical variables of the carbon cycle 138 ! -------------------------------------------------------- 139 DO jk = 1, jpk 140 DO jj = 1, jpj 141 DO ji = 1, jpi 142 ztmas = tmask(ji,jj,jk) 143 ztmas1 = 1. - tmask(ji,jj,jk) 144 zcaralk = trn(ji,jj,jk,jptal) - borat(ji,jj,jk) / ( 1. + 1.E-8 / ( rtrn + akb3(ji,jj,jk) ) ) 145 zco3 = ( zcaralk - trn(ji,jj,jk,jpdic) ) * ztmas + 0.5e-3 * ztmas1 146 zbicarb = ( 2. * trn(ji,jj,jk,jpdic) - zcaralk ) 147 hi(ji,jj,jk) = ( ak23(ji,jj,jk) * zbicarb / zco3 ) * ztmas + 1.e-9 * ztmas1 148 END DO 149 END DO 150 END DO 151 ! 152 END IF 153 154 ! Time step duration for biology 155 xstep = rfact2 / rday 156 157 CALL p4z_sink_init ! vertical flux of particulate organic matter 158 CALL p4z_opt_init ! Optic: PAR in the water column 159 CALL p4z_lim_init ! co-limitations by the various nutrients 160 CALL p4z_prod_init ! phytoplankton growth rate over the global ocean. 161 CALL p4z_rem_init ! remineralisation 162 CALL p4z_mort_init ! phytoplankton mortality 163 CALL p4z_micro_init ! microzooplankton 164 CALL p4z_meso_init ! mesozooplankton 165 CALL p4z_sed_init ! sedimentation 166 CALL p4z_lys_init ! calcite saturation 167 CALL p4z_flx_init ! gas exchange 168 169 ndayflxtr = 0 170 171 IF(lwp) WRITE(numout,*) 126 172 IF(lwp) WRITE(numout,*) 'Initialization of PISCES tracers done' 127 IF(lwp) WRITE(numout,*) ' '173 IF(lwp) WRITE(numout,*) 128 174 ! 129 175 END SUBROUTINE trc_ini_pisces … … 136 182 !! ** Purpose : Allocate all the dynamic arrays of PISCES 137 183 !!---------------------------------------------------------------------- 138 USE p4zint , ONLY : p4z_int_alloc139 USE p4zsink, ONLY : p4z_sink_alloc140 USE p4zopt , ONLY : p4z_opt_alloc141 USE p4zprod, ONLY : p4z_prod_alloc142 USE p4zrem , ONLY : p4z_rem_alloc143 USE p4zsed , ONLY : p4z_sed_alloc144 USE p4zflx , ONLY : p4z_flx_alloc145 184 ! 146 185 INTEGER :: ierr … … 148 187 ! 149 188 ierr = sms_pisces_alloc() ! Start of PISCES-related alloc routines... 150 ierr = ierr + p4z_che_alloc() 151 ierr = ierr + p4z_int_alloc() 152 ierr = ierr + p4z_sink_alloc() 153 ierr = ierr + p4z_opt_alloc() 154 ierr = ierr + p4z_prod_alloc() 155 ierr = ierr + p4z_rem_alloc() 156 ierr = ierr + p4z_sed_alloc() 157 ierr = ierr + p4z_flx_alloc() 189 ierr = ierr + p4z_che_alloc() 190 ierr = ierr + p4z_sink_alloc() 191 ierr = ierr + p4z_opt_alloc() 192 ierr = ierr + p4z_prod_alloc() 193 ierr = ierr + p4z_rem_alloc() 194 ierr = ierr + p4z_sed_alloc() 195 ierr = ierr + p4z_flx_alloc() 158 196 ! 159 197 IF( lk_mpp ) CALL mpp_sum( ierr ) -
trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/trcnam_pisces.F90
r2715 r3294 19 19 USE trc ! TOP variables 20 20 USE sms_pisces ! sms trends 21 USE iom ! I/O manager 21 22 22 23 … … 46 47 !!---------------------------------------------------------------------- 47 48 !! 48 #if defined key_diatrc && ! defined key_iomput 49 INTEGER :: jl, jn 50 ! definition of additional diagnostic as a structure 51 TYPE DIAG 52 CHARACTER(len = 20) :: snamedia !: short name 53 CHARACTER(len = 80 ) :: lnamedia !: long name 54 CHARACTER(len = 20 ) :: unitdia !: unit 55 END TYPE DIAG 56 57 TYPE(DIAG) , DIMENSION(jp_pisces_2d) :: pisdia2d 58 TYPE(DIAG) , DIMENSION(jp_pisces_3d) :: pisdia3d 59 #endif 60 61 NAMELIST/nampisbio/ part, nrdttrc, wsbio, xkmort, ferat3, wsbio2 49 INTEGER :: jl, jn 50 TYPE(DIAG), DIMENSION(jp_pisces_2d) :: pisdia2d 51 TYPE(DIAG), DIMENSION(jp_pisces_3d) :: pisdia3d 52 !! 53 NAMELIST/nampisbio/ nrdttrc, wsbio, xkmort, ferat3, wsbio2 62 54 #if defined key_kriest 63 55 NAMELIST/nampiskrp/ xkr_eta, xkr_zeta, xkr_mass_min, xkr_mass_max 64 56 #endif 65 #if defined key_diatrc && ! defined key_iomput 66 NAMELIST/nampisdia/ nn_writedia, pisdia3d, pisdia2d ! additional diagnostics 67 #endif 68 NAMELIST/nampisdmp/ ln_pisdmp, ln_pisclo 57 NAMELIST/nampisdia/ pisdia3d, pisdia2d ! additional diagnostics 58 NAMELIST/nampisdmp/ ln_pisdmp, nn_pisdmp, ln_pisclo 69 59 70 60 !!---------------------------------------------------------------------- … … 77 67 ! ! Open the namelist file 78 68 ! ! ---------------------- 79 CALL ctl_opn( numnat , 'namelist_pisces', 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. )69 CALL ctl_opn( numnatp, 'namelist_pisces', 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. ) 80 70 81 REWIND( numnat )82 READ ( numnat , nampisbio )71 REWIND( numnatp ) 72 READ ( numnatp, nampisbio ) 83 73 84 74 IF(lwp) THEN ! control print 85 75 WRITE(numout,*) ' Namelist : nampisbio' 86 WRITE(numout,*) ' part of calcite not dissolved in guts part =', part87 76 WRITE(numout,*) ' frequence pour la biologie nrdttrc =', nrdttrc 88 77 WRITE(numout,*) ' POC sinking speed wsbio =', wsbio … … 101 90 xkr_mass_max = 1. 102 91 103 REWIND( numnat ) ! read natkriest104 READ ( numnat , nampiskrp )92 REWIND( numnatp ) ! read natkriest 93 READ ( numnatp, nampiskrp ) 105 94 106 95 IF(lwp) THEN … … 120 109 #endif 121 110 ! 122 #if defined key_diatrc && ! defined key_iomput 111 IF( .NOT.lk_iomput .AND. ln_diatrc ) THEN 112 ! 113 ! Namelist nampisdia 114 ! ------------------- 115 DO jl = 1, jp_pisces_2d 116 WRITE(pisdia2d(jl)%sname,'("2D_",I1)') jl ! short name 117 WRITE(pisdia2d(jl)%lname,'("2D DIAGNOSTIC NUMBER ",I2)') jl ! long name 118 pisdia2d(jl)%units = ' ' ! units 119 END DO 120 ! ! 3D output arrays 121 DO jl = 1, jp_pisces_3d 122 WRITE(pisdia3d(jl)%sname,'("3D_",I1)') jl ! short name 123 WRITE(pisdia3d(jl)%lname,'("3D DIAGNOSTIC NUMBER ",I2)') jl ! long name 124 pisdia3d(jl)%units = ' ' ! units 125 END DO 123 126 124 ! Namelist namlobdia 125 ! ------------------- 126 nn_writedia = 10 ! default values 127 128 DO jl = 1, jp_pisces_2d 129 jn = jp_pcs0_2d + jl - 1 130 WRITE(ctrc2d(jn),'("2D_",I1)') jn ! short name 131 WRITE(ctrc2l(jn),'("2D DIAGNOSTIC NUMBER ",I2)') jn ! long name 132 ctrc2u(jn) = ' ' ! units 133 END DO 134 ! ! 3D output arrays 135 DO jl = 1, jp_pisces_3d 136 jn = jp_pcs0_3d + jl - 1 137 WRITE(ctrc3d(jn),'("3D_",I1)') jn ! short name 138 WRITE(ctrc3l(jn),'("3D DIAGNOSTIC NUMBER ",I2)') jn ! long name 139 ctrc3u(jn) = ' ' ! units 140 END DO 141 142 REWIND( numnat ) ! read natrtd 143 READ ( numnat, nampisdia ) 144 145 DO jl = 1, jp_pisces_2d 146 jn = jp_pcs0_2d + jl - 1 147 ctrc2d(jn) = pisdia2d(jl)%snamedia 148 ctrc2l(jn) = pisdia2d(jl)%lnamedia 149 ctrc2u(jn) = pisdia2d(jl)%unitdia 150 END DO 151 152 DO jl = 1, jp_pisces_3d 153 jn = jp_pcs0_3d + jl - 1 154 ctrc3d(jn) = pisdia3d(jl)%snamedia 155 ctrc3l(jn) = pisdia3d(jl)%lnamedia 156 ctrc3u(jn) = pisdia3d(jl)%unitdia 157 END DO 158 159 IF(lwp) THEN ! control print 160 WRITE(numout,*) 161 WRITE(numout,*) ' Namelist : natadd' 162 WRITE(numout,*) ' frequency of outputs for additional arrays nn_writedia = ', nn_writedia 163 DO jl = 1, jp_pisces_3d 164 jn = jp_pcs0_3d + jl - 1 165 WRITE(numout,*) ' 3d output field No : ',jn 166 WRITE(numout,*) ' short name : ', TRIM(ctrc3d(jn)) 167 WRITE(numout,*) ' long name : ', TRIM(ctrc3l(jn)) 168 WRITE(numout,*) ' unit : ', TRIM(ctrc3u(jn)) 169 WRITE(numout,*) ' ' 170 END DO 127 REWIND( numnatp ) ! 128 READ ( numnatp, nampisdia ) 171 129 172 130 DO jl = 1, jp_pisces_2d 173 131 jn = jp_pcs0_2d + jl - 1 174 WRITE(numout,*) ' 2d output field No : ',jn 175 WRITE(numout,*) ' short name : ', TRIM(ctrc2d(jn)) 176 WRITE(numout,*) ' long name : ', TRIM(ctrc2l(jn)) 177 WRITE(numout,*) ' unit : ', TRIM(ctrc2u(jn)) 132 ctrc2d(jn) = pisdia2d(jl)%sname 133 ctrc2l(jn) = pisdia2d(jl)%lname 134 ctrc2u(jn) = pisdia2d(jl)%units 135 END DO 136 137 DO jl = 1, jp_pisces_3d 138 jn = jp_pcs0_3d + jl - 1 139 ctrc3d(jn) = pisdia3d(jl)%sname 140 ctrc3l(jn) = pisdia3d(jl)%lname 141 ctrc3u(jn) = pisdia3d(jl)%units 142 END DO 143 144 IF(lwp) THEN ! control print 145 WRITE(numout,*) 146 WRITE(numout,*) ' Namelist : natadd' 147 DO jl = 1, jp_pisces_3d 148 jn = jp_pcs0_3d + jl - 1 149 WRITE(numout,*) ' 3d diag nb : ', jn, ' short name : ', ctrc3d(jn), & 150 & ' long name : ', ctrc3l(jn), ' unit : ', ctrc3u(jn) 151 END DO 178 152 WRITE(numout,*) ' ' 179 END DO 153 154 DO jl = 1, jp_pisces_2d 155 jn = jp_pcs0_2d + jl - 1 156 WRITE(numout,*) ' 2d diag nb : ', jn, ' short name : ', ctrc2d(jn), & 157 & ' long name : ', ctrc2l(jn), ' unit : ', ctrc2u(jn) 158 END DO 159 WRITE(numout,*) ' ' 160 ENDIF 161 ! 180 162 ENDIF 181 #endif182 163 183 REWIND( numnat )184 READ ( numnat , nampisdmp )164 REWIND( numnatp ) 165 READ ( numnatp, nampisdmp ) 185 166 186 167 IF(lwp) THEN ! control print 187 168 WRITE(numout,*) 188 169 WRITE(numout,*) ' Namelist : nampisdmp' 189 WRITE(numout,*) ' Relaxation of tracer to glodap mean value ln_pisdmp =', ln_pisdmp 170 WRITE(numout,*) ' Relaxation of tracer to glodap mean value ln_pisdmp =', ln_pisdmp 171 WRITE(numout,*) ' Frequency of Relaxation nn_pisdmp =', nn_pisdmp 190 172 WRITE(numout,*) ' Restoring of tracer to initial value on closed seas ln_pisclo =', ln_pisclo 191 173 WRITE(numout,*) ' ' -
trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/trcrst_pisces.F90
r2715 r3294 43 43 44 44 ! 45 IF( lk_dtatrc .AND. ln_pisclo ) CALL pis_dmp_clo ! restoring of nutrients on close seas 46 IF( ln_pisdmp ) CALL pis_dmp_ini ! relaxation of some tracers 45 IF( ln_trcdta .AND. ln_pisclo ) CALL pis_dmp_clo ! restoring of nutrients on close seas 47 46 ! 48 47 IF(lwp) WRITE(numout,*) … … 53 52 CALL iom_get( knum, jpdom_autoglo, 'PH' , hi(:,:,:) ) 54 53 ELSE 54 ! hi(:,:,:) = 1.e-9 55 55 ! Set PH from total alkalinity, borat (???), akb3 (???) and ak23 (???) 56 56 ! -------------------------------------------------------- … … 63 63 zco3 = ( zcaralk - trn(ji,jj,jk,jpdic) ) * ztmas + 0.5e-3 * ztmas1 64 64 zbicarb = ( 2. * trn(ji,jj,jk,jpdic) - zcaralk ) 65 65 hi(ji,jj,jk) = ( ak23(ji,jj,jk) * zbicarb / zco3 ) * ztmas + 1.e-9 * ztmas1 66 66 END DO 67 67 END DO … … 99 99 END SUBROUTINE trc_rst_wri_pisces 100 100 101 SUBROUTINE pis_dmp_ini102 !!----------------------------------------------------------------------103 !! *** pis_dmp_ini ***104 !!105 !! ** purpose : Relaxation of some tracers106 !!----------------------------------------------------------------------107 REAL(wp) :: alkmean = 2426. ! mean value of alkalinity ( Glodap ; for Goyet 2391. )108 REAL(wp) :: po4mean = 2.165 ! mean value of phosphates109 REAL(wp) :: no3mean = 30.90 ! mean value of nitrate110 REAL(wp) :: silmean = 91.51 ! mean value of silicate111 112 REAL(wp) :: zarea, zalksum, zpo4sum, zno3sum, zsilsum113 114 115 IF(lwp) WRITE(numout,*)116 117 IF( cp_cfg == "orca" .AND. .NOT. lk_c1d ) THEN ! ORCA condiguration (not 1D) !118 ! ! --------------------------- !119 ! set total alkalinity, phosphate, nitrate & silicate120 121 zarea = 1. / areatot * 1.e6122 # if defined key_degrad123 zalksum = glob_sum( trn(:,:,:,jptal) * cvol(:,:,:) * facvol(:,:,:) ) * zarea124 zpo4sum = glob_sum( trn(:,:,:,jppo4) * cvol(:,:,:) * facvol(:,:,:) ) * zarea / 122.125 zno3sum = glob_sum( trn(:,:,:,jpno3) * cvol(:,:,:) * facvol(:,:,:) ) * zarea / 7.6126 zsilsum = glob_sum( trn(:,:,:,jpsil) * cvol(:,:,:) * facvol(:,:,:) ) * zarea127 # else128 zalksum = glob_sum( trn(:,:,:,jptal) * cvol(:,:,:) ) * zarea129 zpo4sum = glob_sum( trn(:,:,:,jppo4) * cvol(:,:,:) ) * zarea / 122.130 zno3sum = glob_sum( trn(:,:,:,jpno3) * cvol(:,:,:) ) * zarea / 7.6131 zsilsum = glob_sum( trn(:,:,:,jpsil) * cvol(:,:,:) ) * zarea132 # endif133 134 IF(lwp) WRITE(numout,*) ' TALK mean : ', zalksum135 trn(:,:,:,jptal) = trn(:,:,:,jptal) * alkmean / zalksum136 137 IF(lwp) WRITE(numout,*) ' PO4 mean : ', zpo4sum138 trn(:,:,:,jppo4) = trn(:,:,:,jppo4) * po4mean / zpo4sum139 140 IF(lwp) WRITE(numout,*) ' NO3 mean : ', zno3sum141 trn(:,:,:,jpno3) = trn(:,:,:,jpno3) * no3mean / zno3sum142 143 IF(lwp) WRITE(numout,*) ' SiO3 mean : ', zsilsum144 trn(:,:,:,jpsil) = MIN( 400.e-6,trn(:,:,:,jpsil) * silmean / zsilsum )145 !146 ENDIF147 148 !#if defined key_kriest149 ! !! Initialize number of particles from a standart restart file150 ! !! The name of big organic particles jpgoc has been only change151 ! !! and replace by jpnum but the values here are concentration152 ! trn(:,:,:,jppoc) = trn(:,:,:,jppoc) + trn(:,:,:,jpnum)153 ! trn(:,:,:,jpnum) = trn(:,:,:,jppoc) / ( 6. * xkr_massp )154 !#endif155 156 END SUBROUTINE pis_dmp_ini157 158 101 SUBROUTINE pis_dmp_clo 159 102 !!--------------------------------------------------------------------- … … 168 111 !! ictsi2(), ictsj2() : north-east Closed sea limits (i,j) 169 112 !!---------------------------------------------------------------------- 170 INTEGER, PARAMETER :: npicts = 4 !: number of closed sea 171 INTEGER, DIMENSION(npicts) :: ictsi1, ictsj1 !: south-west closed sea limits (i,j) 172 INTEGER, DIMENSION(npicts) :: ictsi2, ictsj2 !: north-east closed sea limits (i,j) 173 INTEGER :: ji, jj, jk, jn, jc ! dummy loop indices 113 INTEGER, PARAMETER :: npicts = 4 ! number of closed sea 114 INTEGER, DIMENSION(npicts) :: ictsi1, ictsj1 ! south-west closed sea limits (i,j) 115 INTEGER, DIMENSION(npicts) :: ictsi2, ictsj2 ! north-east closed sea limits (i,j) 116 INTEGER :: ji, jj, jk, jn, jl, jc ! dummy loop indices 117 INTEGER :: ierr ! local integer 118 REAL(wp), ALLOCATABLE, DIMENSION(:,:,:,:) :: ztrcdta ! 4D workspace 174 119 !!---------------------------------------------------------------------- 175 120 … … 243 188 END DO 244 189 245 #if defined key_dtatrc246 190 ! Restore close seas values to initial data 247 CALL trc_dta( nit000 ) 248 DO jn = 1, jptra 249 IF( lutini(jn) ) THEN 250 DO jc = 1, npicts 251 DO jk = 1, jpkm1 252 DO jj = ictsj1(jc), ictsj2(jc) 253 DO ji = ictsi1(jc), ictsi2(jc) 254 trn(ji,jj,jk,jn) = trdta(ji,jj,jk,jn) * tmask(ji,jj,jk) 255 trb(ji,jj,jk,jn) = trn(ji,jj,jk,jn) 256 ENDDO 257 ENDDO 258 ENDDO 259 ENDDO 260 ENDIF 261 ENDDO 262 #endif 263 ! 191 IF( nb_trcdta > 0 ) THEN ! Initialisation of tracer from a file that may also be used for damping 192 ALLOCATE( ztrcdta(jpi,jpj,jpk,nb_trcdta), STAT=ierr ) 193 IF( ierr > 0 ) THEN 194 CALL ctl_stop( 'trc_ini: unable to allocate ztrcdta array' ) ; RETURN 195 ENDIF 196 ! 197 CALL trc_dta( nittrc000, ztrcdta ) ! read tracer data at nittrc000 198 ! 199 DO jn = 1, jptra 200 IF( ln_trc_ini(jn) ) THEN ! update passive tracers arrays with input data read from file 201 jl = n_trc_index(jn) 202 DO jc = 1, npicts 203 DO jk = 1, jpkm1 204 DO jj = ictsj1(jc), ictsj2(jc) 205 DO ji = ictsi1(jc), ictsi2(jc) 206 trn(ji,jj,jk,jn) = ztrcdta(ji,jj,jk,jl) * tmask(ji,jj,jk) 207 trb(ji,jj,jk,jn) = trn(ji,jj,jk,jn) 208 ENDDO 209 ENDDO 210 ENDDO 211 ENDDO 212 ENDIF 213 ENDDO 214 DEALLOCATE( ztrcdta ) 215 ENDIF 216 ! 264 217 END SUBROUTINE pis_dmp_clo 265 218 -
trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/trcsms_pisces.F90
r2715 r3294 13 13 !! trcsms_pisces : Time loop of passive tracers sms 14 14 !!---------------------------------------------------------------------- 15 USE oce_trc ! 16 USE trc 17 USE sms_pisces 18 19 USE p4zint ! 20 USE p4zche ! 21 USE p4zbio ! 22 USE p4zsink ! 23 USE p4zopt ! 24 USE p4zlim ! 25 USE p4zprod ! 26 USE p4zmort ! 27 USE p4zmicro ! 28 USE p4zmeso ! 29 USE p4zrem ! 30 USE p4zsed ! 31 USE p4zlys ! 32 USE p4zflx ! 33 34 USE prtctl_trc 35 36 USE trdmod_oce 37 USE trdmod_trc 38 39 USE sedmodel 15 USE oce_trc ! shared variables between ocean and passive tracers 16 USE trc ! passive tracers common variables 17 USE sms_pisces ! PISCES Source Minus Sink variables 18 USE p4zbio ! Biological model 19 USE p4zche ! Chemical model 20 USE p4zlys ! Calcite saturation 21 USE p4zflx ! Gas exchange 22 USE p4zsed ! Sedimentation 23 USE p4zint ! time interpolation 24 USE trdmod_oce ! Ocean trends variables 25 USE trdmod_trc ! TOP trends variables 26 USE sedmodel ! Sediment model 27 USE prtctl_trc ! print control for debugging 40 28 41 29 IMPLICIT NONE … … 43 31 44 32 PUBLIC trc_sms_pisces ! called in trcsms.F90 33 34 LOGICAL :: ln_check_mass = .false. !: Flag to check mass conservation 35 36 INTEGER :: numno3 !: logical unit for NO3 budget 37 INTEGER :: numalk !: logical unit for talk budget 38 INTEGER :: numsil !: logical unit for Si budget 45 39 46 40 !!---------------------------------------------------------------------- … … 63 57 !! - ... 64 58 !!--------------------------------------------------------------------- 65 USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released66 USE wrk_nemo, ONLY: ztrpis => wrk_3d_1 ! used for pisces sms trends67 59 ! 68 60 INTEGER, INTENT( in ) :: kt ! ocean time-step index … … 71 63 CHARACTER (len=25) :: charout 72 64 !!--------------------------------------------------------------------- 73 74 IF( kt == nit000 ) CALL trc_sms_pisces_init ! Initialization (first time-step only) 75 76 IF( wrk_in_use(3,1) ) THEN 77 CALL ctl_stop('trc_sms_pisces : requested workspace array unavailable.') ; RETURN 78 ENDIF 65 ! 66 IF( nn_timing == 1 ) CALL timing_start('trc_sms_pisces') 67 ! 68 IF( ln_pisdmp .AND. MOD( kt - nn_dttrc, nn_pisdmp ) == 0 ) CALL trc_sms_pisces_dmp( kt ) ! Relaxation of some tracers 69 CALL trc_sms_pisces_mass_conserv( kt ) ! Mass conservation checking 79 70 80 71 IF( ndayflxtr /= nday_year ) THEN ! New days … … 86 77 IF(lwp) write(numout,*) '~~~~~~' 87 78 88 CALL p4z_che ! computation of chemical constants89 CALL p4z_int ! computation of various rates for biogeochemistry79 CALL p4z_che ! computation of chemical constants 80 CALL p4z_int ! computation of various rates for biogeochemistry 90 81 ! 91 82 ENDIF … … 109 100 END DO 110 101 111 112 102 IF( l_trdtrc ) THEN 113 103 DO jn = jp_pcs0, jp_pcs1 114 ztrpis(:,:,:) = tra(:,:,:,jn) 115 CALL trd_mod_trc( ztrpis, jn, jptra_trd_sms, kt ) ! save trends 104 CALL trd_mod_trc( tra(:,:,:,jn), jn, jptra_trd_sms, kt ) ! save trends 116 105 END DO 117 DEALLOCATE( ztrpis )118 106 END IF 119 107 … … 127 115 ! 128 116 ENDIF 129 130 IF( wrk_not_released(3,1) ) CALL ctl_stop('trc_sms_pisces : failed to release workspace array.')131 117 ! 118 IF( nn_timing == 1 ) CALL timing_stop('trc_sms_pisces') 119 ! 132 120 END SUBROUTINE trc_sms_pisces 133 121 134 SUBROUTINE trc_sms_pisces_ init122 SUBROUTINE trc_sms_pisces_dmp( kt ) 135 123 !!---------------------------------------------------------------------- 136 !! *** ROUTINE trc_sms_pisces_init *** 137 !! 138 !! ** Purpose : Initialization of PH variable 139 !! 124 !! *** trc_sms_pisces_dmp *** 125 !! 126 !! ** purpose : Relaxation of some tracers 140 127 !!---------------------------------------------------------------------- 141 INTEGER :: ji, jj, jk 142 REAL(wp) :: zcaralk, zbicarb, zco3 143 REAL(wp) :: ztmas, ztmas1 144 145 IF( .NOT. ln_rsttr ) THEN 146 ! Initialization of chemical variables of the carbon cycle 147 ! -------------------------------------------------------- 148 DO jk = 1, jpk 149 DO jj = 1, jpj 150 DO ji = 1, jpi 151 ztmas = tmask(ji,jj,jk) 152 ztmas1 = 1. - tmask(ji,jj,jk) 153 zcaralk = trn(ji,jj,jk,jptal) - borat(ji,jj,jk) / ( 1. + 1.E-8 / ( rtrn + akb3(ji,jj,jk) ) ) 154 zco3 = ( zcaralk - trn(ji,jj,jk,jpdic) ) * ztmas + 0.5e-3 * ztmas1 155 zbicarb = ( 2. * trn(ji,jj,jk,jpdic) - zcaralk ) 156 hi(ji,jj,jk) = ( ak23(ji,jj,jk) * zbicarb / zco3 ) * ztmas + 1.e-9 * ztmas1 157 END DO 158 END DO 159 END DO 160 ! 161 END IF 162 163 ! Time step duration for biology 164 xstep = rfact2 / rday 165 166 CALL p4z_sink_init ! vertical flux of particulate organic matter 167 CALL p4z_opt_init ! Optic: PAR in the water column 168 CALL p4z_lim_init ! co-limitations by the various nutrients 169 CALL p4z_prod_init ! phytoplankton growth rate over the global ocean. 170 CALL p4z_rem_init ! remineralisation 171 CALL p4z_mort_init ! phytoplankton mortality 172 CALL p4z_micro_init ! microzooplankton 173 CALL p4z_meso_init ! mesozooplankton 174 CALL p4z_sed_init ! sedimentation 175 CALL p4z_lys_init ! calcite saturation 176 CALL p4z_flx_init ! gas exchange 177 178 ndayflxtr = 0 179 180 END SUBROUTINE trc_sms_pisces_init 128 ! 129 INTEGER, INTENT( in ) :: kt ! time step 130 ! 131 REAL(wp) :: alkmean = 2426. ! mean value of alkalinity ( Glodap ; for Goyet 2391. ) 132 REAL(wp) :: po4mean = 2.165 ! mean value of phosphates 133 REAL(wp) :: no3mean = 30.90 ! mean value of nitrate 134 REAL(wp) :: silmean = 91.51 ! mean value of silicate 135 ! 136 REAL(wp) :: zarea, zalksum, zpo4sum, zno3sum, zsilsum 137 !!--------------------------------------------------------------------- 138 139 140 IF(lwp) WRITE(numout,*) 141 IF(lwp) WRITE(numout,*) ' trc_sms_pisces_dmp : Relaxation of nutrients at time-step kt = ', kt 142 IF(lwp) WRITE(numout,*) 143 144 IF( cp_cfg == "orca" .AND. .NOT. lk_c1d ) THEN ! ORCA condiguration (not 1D) ! 145 ! ! --------------------------- ! 146 ! set total alkalinity, phosphate, nitrate & silicate 147 zarea = 1._wp / glob_sum( cvol(:,:,:) ) * 1e6 148 149 zalksum = glob_sum( trn(:,:,:,jptal) * cvol(:,:,:) ) * zarea 150 zpo4sum = glob_sum( trn(:,:,:,jppo4) * cvol(:,:,:) ) * zarea / 122. 151 zno3sum = glob_sum( trn(:,:,:,jpno3) * cvol(:,:,:) ) * zarea / 7.6 152 zsilsum = glob_sum( trn(:,:,:,jpsil) * cvol(:,:,:) ) * zarea 153 154 IF(lwp) WRITE(numout,*) ' TALK mean : ', zalksum 155 trn(:,:,:,jptal) = trn(:,:,:,jptal) * alkmean / zalksum 156 157 IF(lwp) WRITE(numout,*) ' PO4 mean : ', zpo4sum 158 trn(:,:,:,jppo4) = trn(:,:,:,jppo4) * po4mean / zpo4sum 159 160 IF(lwp) WRITE(numout,*) ' NO3 mean : ', zno3sum 161 trn(:,:,:,jpno3) = trn(:,:,:,jpno3) * no3mean / zno3sum 162 163 IF(lwp) WRITE(numout,*) ' SiO3 mean : ', zsilsum 164 trn(:,:,:,jpsil) = MIN( 400.e-6,trn(:,:,:,jpsil) * silmean / zsilsum ) 165 ! 166 ENDIF 167 168 END SUBROUTINE trc_sms_pisces_dmp 169 170 SUBROUTINE trc_sms_pisces_mass_conserv ( kt ) 171 !!---------------------------------------------------------------------- 172 !! *** ROUTINE trc_sms_pisces_mass_conserv *** 173 !! 174 !! ** Purpose : Mass conservation check 175 !! 176 !!--------------------------------------------------------------------- 177 ! 178 INTEGER, INTENT( in ) :: kt ! ocean time-step index 179 !! 180 REAL(wp) :: zalkbudget, zno3budget, zsilbudget 181 ! 182 NAMELIST/nampismass/ ln_check_mass 183 !!--------------------------------------------------------------------- 184 185 IF( kt == nittrc000 ) THEN 186 REWIND( numnatp ) 187 READ ( numnatp, nampismass ) 188 IF(lwp) THEN ! control print 189 WRITE(numout,*) ' ' 190 WRITE(numout,*) ' Namelist parameter for mass conservation checking' 191 WRITE(numout,*) ' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~' 192 WRITE(numout,*) ' Flag to check mass conservation of NO3/Si/TALK ln_check_mass = ', ln_check_mass 193 ENDIF 194 195 IF( ln_check_mass .AND. lwp) THEN ! Open budget file of NO3, ALK, Si 196 CALL ctl_opn( numno3, 'no3.budget' , 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, 6, .FALSE., narea ) 197 CALL ctl_opn( numsil, 'sil.budget' , 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, 6, .FALSE., narea ) 198 CALL ctl_opn( numalk, 'talk.budget', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, 6, .FALSE., narea ) 199 ENDIF 200 ENDIF 201 202 IF( ln_check_mass ) THEN ! Compute the budget of NO3, ALK, Si 203 zno3budget = glob_sum( ( trn(:,:,:,jpno3) + trn(:,:,:,jpnh4) & 204 & + trn(:,:,:,jpphy) + trn(:,:,:,jpdia) & 205 & + trn(:,:,:,jpzoo) + trn(:,:,:,jpmes) & 206 & + trn(:,:,:,jppoc) + trn(:,:,:,jpgoc) & 207 & + trn(:,:,:,jpdoc) ) * cvol(:,:,:) ) 208 ! 209 zsilbudget = glob_sum( ( trn(:,:,:,jpsil) + trn(:,:,:,jpdsi) & 210 & + trn(:,:,:,jpbsi) ) * cvol(:,:,:) ) 211 ! 212 zalkbudget = glob_sum( ( trn(:,:,:,jpno3) * rno3 & 213 & + trn(:,:,:,jptal) & 214 & + trn(:,:,:,jpcal) * 2. ) * cvol(:,:,:) ) 215 216 IF( lwp ) THEN 217 WRITE(numno3,9500) kt, zno3budget / areatot 218 WRITE(numsil,9500) kt, zsilbudget / areatot 219 WRITE(numalk,9500) kt, zalkbudget / areatot 220 ENDIF 221 ENDIF 222 9500 FORMAT(i10,e18.10) 223 ! 224 END SUBROUTINE trc_sms_pisces_mass_conserv 181 225 182 226 #else -
trunk/NEMOGCM/NEMO/TOP_SRC/SED/sedini.F90
r2761 r3294 449 449 450 450 dtsed = rdt 451 nitsed000 = nit 000451 nitsed000 = nittrc000 452 452 nitsedend = nitend 453 453 #if ! defined key_sed_off -
trunk/NEMOGCM/NEMO/TOP_SRC/SED/sedmodel.F90
r2528 r3294 35 35 36 36 37 IF( kt == nit 000 ) CALL sed_init ! Initialization of sediment model37 IF( kt == nittrc000 ) CALL sed_init ! Initialization of sediment model 38 38 39 39 CALL sed_stp( kt ) ! Time stepping of Sediment model -
trunk/NEMOGCM/NEMO/TOP_SRC/SED/sedwri.F90
r2761 r3294 56 56 ! Initialisation 57 57 ! ----------------- 58 IF( kt == nit 000 ) ALLOCATE( ndext52(jpij*jpksed), ndext51(jpij) )58 IF( kt == nittrc000 ) ALLOCATE( ndext52(jpij*jpksed), ndext51(jpij) ) 59 59 60 60 ! Define frequency of output and means -
trunk/NEMOGCM/NEMO/TOP_SRC/TRP/trcadv.F90
r2715 r3294 35 35 INTEGER :: nadv ! choice of the type of advection scheme 36 36 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:) :: r2dt ! vertical profile time-step, = 2 rdttra 37 ! ! except at nit 000 (=rdttra) if neuler=037 ! ! except at nitrrc000 (=rdttra) if neuler=0 38 38 39 39 !! * Substitutions … … 67 67 !! ** Method : - Update the tracer with the advection term following nadv 68 68 !!---------------------------------------------------------------------- 69 USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released70 USE wrk_nemo, ONLY: zun => wrk_3d_4, zvn => wrk_3d_5, zwn => wrk_3d_6 ! effective velocity71 69 !! 72 70 INTEGER, INTENT(in) :: kt ! ocean time-step index … … 74 72 INTEGER :: jk 75 73 CHARACTER (len=22) :: charout 76 !!---------------------------------------------------------------------- 77 ! 78 IF( wrk_in_use(3, 4,5,6) ) THEN 79 CALL ctl_stop('trc_adv : requested workspace arrays unavailable') ; RETURN 80 ENDIF 81 82 IF( kt == nit000 ) CALL trc_adv_ctl ! initialisation & control of options 74 REAL(wp), POINTER, DIMENSION(:,:,:) :: zun, zvn, zwn ! effective velocity 75 !!---------------------------------------------------------------------- 76 ! 77 IF( nn_timing == 1 ) CALL timing_start('trc_adv') 78 ! 79 CALL wrk_alloc( jpi, jpj, jpk, zun, zvn, zwn ) 80 ! 81 82 IF( kt == nittrc000 ) CALL trc_adv_ctl ! initialisation & control of options 83 83 84 84 #if ! defined key_pisces 85 IF( neuler == 0 .AND. kt == nit 000 ) THEN ! at nit00085 IF( neuler == 0 .AND. kt == nittrc000 ) THEN ! at nittrc000 86 86 r2dt(:) = rdttrc(:) ! = rdttrc (restarting with Euler time stepping) 87 ELSEIF( kt <= nit 000 + nn_dttrc ) THEN ! at nit000 or nit000+187 ELSEIF( kt <= nittrc000 + 1 ) THEN ! at nittrc000 or nittrc000+1 88 88 r2dt(:) = 2. * rdttrc(:) ! = 2 rdttrc (leapfrog) 89 89 ENDIF … … 102 102 zwn(:,:,jpk) = 0.e0 ! no transport trough the bottom 103 103 104 !! add the eiv transport (if necessary)105 IF( lk_traldf_eiv ) CALL tra_adv_eiv( kt, zun, zvn, zwn, 'TRC' )104 IF( lk_traldf_eiv .AND. .NOT. ln_traldf_grif ) & ! add the eiv transport (if necessary) 105 & CALL tra_adv_eiv( kt, nittrc000, zun, zvn, zwn, 'TRC' ) 106 106 ! 107 107 SELECT CASE ( nadv ) !== compute advection trend and add it to general trend ==! 108 CASE ( 1 ) ; CALL tra_adv_cen2 ( kt, 'TRC', zun, zvn, zwn, trb, trn, tra, jptra ) ! 2nd order centered109 CASE ( 2 ) ; CALL tra_adv_tvd ( kt, 'TRC', r2dt, zun, zvn, zwn, trb, trn, tra, jptra ) ! TVD110 CASE ( 3 ) ; CALL tra_adv_muscl ( kt, 'TRC', r2dt, zun, zvn, zwn, trb, tra, jptra ) ! MUSCL111 CASE ( 4 ) ; CALL tra_adv_muscl2( kt, 'TRC', r2dt, zun, zvn, zwn, trb, trn, tra, jptra ) ! MUSCL2112 CASE ( 5 ) ; CALL tra_adv_ubs ( kt, 'TRC', r2dt, zun, zvn, zwn, trb, trn, tra, jptra ) ! UBS113 CASE ( 6 ) ; CALL tra_adv_qck ( kt, 'TRC', r2dt, zun, zvn, zwn, trb, trn, tra, jptra ) ! QUICKEST108 CASE ( 1 ) ; CALL tra_adv_cen2 ( kt, nittrc000, 'TRC', zun, zvn, zwn, trb, trn, tra, jptra ) ! 2nd order centered 109 CASE ( 2 ) ; CALL tra_adv_tvd ( kt, nittrc000, 'TRC', r2dt, zun, zvn, zwn, trb, trn, tra, jptra ) ! TVD 110 CASE ( 3 ) ; CALL tra_adv_muscl ( kt, nittrc000, 'TRC', r2dt, zun, zvn, zwn, trb, tra, jptra ) ! MUSCL 111 CASE ( 4 ) ; CALL tra_adv_muscl2( kt, nittrc000, 'TRC', r2dt, zun, zvn, zwn, trb, trn, tra, jptra ) ! MUSCL2 112 CASE ( 5 ) ; CALL tra_adv_ubs ( kt, nittrc000, 'TRC', r2dt, zun, zvn, zwn, trb, trn, tra, jptra ) ! UBS 113 CASE ( 6 ) ; CALL tra_adv_qck ( kt, nittrc000, 'TRC', r2dt, zun, zvn, zwn, trb, trn, tra, jptra ) ! QUICKEST 114 114 ! 115 115 CASE (-1 ) !== esopa: test all possibility with control print ==! 116 CALL tra_adv_cen2 ( kt, 'TRC', zun, zvn, zwn, trb, trn, tra, jptra )116 CALL tra_adv_cen2 ( kt, nittrc000, 'TRC', zun, zvn, zwn, trb, trn, tra, jptra ) 117 117 WRITE(charout, FMT="('adv1')") ; CALL prt_ctl_trc_info(charout) 118 118 CALL prt_ctl_trc(tab4d=tra, mask=tmask, clinfo=ctrcnm,clinfo2='trd') 119 CALL tra_adv_tvd ( kt, 'TRC', r2dt, zun, zvn, zwn, trb, trn, tra, jptra )119 CALL tra_adv_tvd ( kt, nittrc000, 'TRC', r2dt, zun, zvn, zwn, trb, trn, tra, jptra ) 120 120 WRITE(charout, FMT="('adv2')") ; CALL prt_ctl_trc_info(charout) 121 121 CALL prt_ctl_trc(tab4d=tra, mask=tmask, clinfo=ctrcnm,clinfo2='trd') 122 CALL tra_adv_muscl ( kt, 'TRC', r2dt, zun, zvn, zwn, trb, tra, jptra )122 CALL tra_adv_muscl ( kt, nittrc000, 'TRC', r2dt, zun, zvn, zwn, trb, tra, jptra ) 123 123 WRITE(charout, FMT="('adv3')") ; CALL prt_ctl_trc_info(charout) 124 124 CALL prt_ctl_trc(tab4d=tra, mask=tmask, clinfo=ctrcnm,clinfo2='trd') 125 CALL tra_adv_muscl2( kt, 'TRC', r2dt, zun, zvn, zwn, trb, trn, tra, jptra )125 CALL tra_adv_muscl2( kt, nittrc000, 'TRC', r2dt, zun, zvn, zwn, trb, trn, tra, jptra ) 126 126 WRITE(charout, FMT="('adv4')") ; CALL prt_ctl_trc_info(charout) 127 127 CALL prt_ctl_trc(tab4d=tra, mask=tmask, clinfo=ctrcnm,clinfo2='trd') 128 CALL tra_adv_ubs ( kt, 'TRC', r2dt, zun, zvn, zwn, trb, trn, tra, jptra )128 CALL tra_adv_ubs ( kt, nittrc000, 'TRC', r2dt, zun, zvn, zwn, trb, trn, tra, jptra ) 129 129 WRITE(charout, FMT="('adv5')") ; CALL prt_ctl_trc_info(charout) 130 130 CALL prt_ctl_trc(tab4d=tra, mask=tmask, clinfo=ctrcnm,clinfo2='trd') 131 CALL tra_adv_qck ( kt, 'TRC', r2dt, zun, zvn, zwn, trb, trn, tra, jptra )131 CALL tra_adv_qck ( kt, nittrc000, 'TRC', r2dt, zun, zvn, zwn, trb, trn, tra, jptra ) 132 132 WRITE(charout, FMT="('adv6')") ; CALL prt_ctl_trc_info(charout) 133 133 CALL prt_ctl_trc(tab4d=tra, mask=tmask, clinfo=ctrcnm,clinfo2='trd') … … 141 141 END IF 142 142 ! 143 IF( wrk_not_released(3, 4,5,6) ) CALL ctl_stop('trc_adv : failed to release workspace arrays.') 143 CALL wrk_dealloc( jpi, jpj, jpk, zun, zvn, zwn ) 144 ! 145 IF( nn_timing == 1 ) CALL timing_stop('trc_adv') 144 146 ! 145 147 END SUBROUTINE trc_adv -
trunk/NEMOGCM/NEMO/TOP_SRC/TRP/trcbbl.F90
r2528 r3294 53 53 INTEGER, INTENT( in ) :: kt ! ocean time-step 54 54 CHARACTER (len=22) :: charout 55 REAL(wp), DIMENSION(:,:,:,:), ALLOCATABLE:: ztrtrd55 REAL(wp), POINTER, DIMENSION(:,:,:,:) :: ztrtrd 56 56 !!---------------------------------------------------------------------- 57 58 IF( .NOT. lk_offline ) THEN 59 CALL bbl( kt, 'TRC' ) ! Online coupling with dynamics : Computation of bbl coef and bbl transport 60 l_bbl = .FALSE. ! Offline coupling with dynamics : Read bbl coef and bbl transport from input files 57 ! 58 IF( nn_timing == 1 ) CALL timing_start('trc_bbl') 59 ! 60 IF( .NOT. lk_offline .AND. nn_dttrc == 1 ) THEN 61 CALL bbl( kt, nittrc000, 'TRC' ) ! Online coupling with dynamics : Computation of bbl coef and bbl transport 62 l_bbl = .FALSE. ! Offline coupling with dynamics : Read bbl coef and bbl transport from input files 61 63 ENDIF 62 64 63 65 IF( l_trdtrc ) THEN 64 ALLOCATE( ztrtrd(jpi,jpj,jpk,jptra) )! temporary save of trends66 CALL wrk_alloc( jpi, jpj, jpk, jptra, ztrtrd ) ! temporary save of trends 65 67 ztrtrd(:,:,:,:) = tra(:,:,:,:) 66 68 ENDIF … … 93 95 CALL trd_tra( kt, 'TRC', jn, jptra_trd_ldf, ztrtrd(:,:,:,jn) ) 94 96 END DO 95 DEALLOCATE( ztrtrd )97 CALL wrk_dealloc( jpi, jpj, jpk, jptra, ztrtrd ) ! temporary save of trends 96 98 ENDIF 99 ! 100 IF( nn_timing == 1 ) CALL timing_stop('trc_bbl') 97 101 ! 98 102 END SUBROUTINE trc_bbl -
trunk/NEMOGCM/NEMO/TOP_SRC/TRP/trcdmp.F90
r2715 r3294 89 89 REAL(wp) :: ztra ! temporary scalars 90 90 CHARACTER (len=22) :: charout 91 REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: ztrtrd 92 !!---------------------------------------------------------------------- 93 91 REAL(wp), POINTER, DIMENSION(:,:,:) :: ztrtrd 92 !!---------------------------------------------------------------------- 93 ! 94 IF( nn_timing == 1 ) CALL timing_start('trc_dmp') 95 ! 94 96 ! 0. Initialization (first time-step only) 95 97 ! -------------- 96 IF( kt == nit 000 ) CALL trc_dmp_init97 98 IF( l_trdtrc ) ALLOCATE( ztrtrd(jpi,jpj,jpk)) ! temporary save of trends98 IF( kt == nittrc000 ) CALL trc_dmp_init 99 100 IF( l_trdtrc ) CALL wrk_alloc( jpi, jpj, jpk, ztrtrd ) ! temporary save of trends 99 101 100 102 ! 1. Newtonian damping trends on tracer fields … … 156 158 END DO ! tracer loop 157 159 ! ! =========== 158 IF( l_trdtrc ) DEALLOCATE(ztrtrd )160 IF( l_trdtrc ) CALL wrk_dealloc( jpi, jpj, jpk, ztrtrd ) 159 161 ! ! print mean trends (used for debugging) 160 162 IF( ln_ctl ) THEN … … 163 165 ENDIF 164 166 ! 167 IF( nn_timing == 1 ) CALL timing_stop('trc_dmp') 168 ! 165 169 END SUBROUTINE trc_dmp 166 170 … … 173 177 !! 174 178 !! ** Method : read the nammbf namelist and check the parameters 175 !! called by trc_dmp at the first timestep (nit000) 176 !!---------------------------------------------------------------------- 177 179 !! called by trc_dmp at the first timestep (nittrc000) 180 !!---------------------------------------------------------------------- 181 ! 182 IF( nn_timing == 1 ) CALL timing_start('trc_dmp_init') 183 ! 178 184 SELECT CASE ( nn_hdmp_tr ) 179 185 CASE ( -1 ) ; IF(lwp) WRITE(numout,*) ' tracer damping in the Med & Red seas only' … … 204 210 & nn_file_tr, 'TRC' , restotr ) 205 211 ENDIF 212 ! 213 IF( nn_timing == 1 ) CALL timing_stop('trc_dmp_init') 206 214 ! 207 215 END SUBROUTINE trc_dmp_init -
trunk/NEMOGCM/NEMO/TOP_SRC/TRP/trcldf.F90
r2715 r3294 2 2 !!====================================================================== 3 3 !! *** MODULE trcldf *** 4 !! Ocean Passive tracers : lateral diffusive trends 4 !! Ocean Passive tracers : lateral diffusive trends 5 5 !!===================================================================== 6 6 !! History : 9.0 ! 2005-11 (G. Madec) Original code 7 !! NEMO 3.0 ! 2008-01 (C. Ethe, G. Madec) merge TRC-TRA 7 !! NEMO 3.0 ! 2008-01 (C. Ethe, G. Madec) merge TRC-TRA 8 8 !!---------------------------------------------------------------------- 9 9 #if defined key_top … … 23 23 USE traldf_bilap ! lateral mixing (tra_ldf_bilap routine) 24 24 USE traldf_iso ! lateral mixing (tra_ldf_iso routine) 25 USE traldf_iso_grif ! lateral mixing (tra_ldf_iso_grif routine) 25 26 USE traldf_lap ! lateral mixing (tra_ldf_lap routine) 26 27 USE trdmod_oce … … 31 32 PRIVATE 32 33 33 PUBLIC trc_ldf ! called by step.F90 34 PUBLIC trc_ldf ! called by step.F90 34 35 ! !!: ** lateral mixing namelist (nam_trcldf) ** 35 INTEGER :: nldf = 0 ! type of lateral diffusion used defined from ln_trcldf_... namlist logicals) 36 REAL(wp) :: rldf_rat ! ratio between active and passive tracers diffusive coefficient 37 INTEGER :: nldf = 0 ! type of lateral diffusion used defined from ln_trcldf_... namlist logicals) 36 38 !! * Substitutions 37 39 # include "domzgr_substitute.h90" … … 39 41 !!---------------------------------------------------------------------- 40 42 !! NEMO/TOP 3.3 , NEMO Consortium (2010) 41 !! $Id$ 43 !! $Id$ 42 44 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 43 45 !!---------------------------------------------------------------------- … … 48 50 !!---------------------------------------------------------------------- 49 51 !! *** ROUTINE tra_ldf *** 50 !! 52 !! 51 53 !! ** Purpose : compute the lateral ocean tracer physics. 52 54 !! … … 56 58 INTEGER :: jn 57 59 CHARACTER (len=22) :: charout 58 REAL(wp), DIMENSION(:,:,:,:), ALLOCATABLE :: ztrtrd 59 !!---------------------------------------------------------------------- 60 61 IF( kt == nit000 ) CALL ldf_ctl ! initialisation & control of options 62 63 IF( l_trdtrc ) THEN 64 ALLOCATE( ztrtrd(jpi,jpj,jpk,jptra) ) ! temporary save of trends 60 REAL(wp), POINTER, DIMENSION(:,:,:,:) :: ztrtrd 61 !!---------------------------------------------------------------------- 62 ! 63 IF( nn_timing == 1 ) CALL timing_start('trc_ldf') 64 ! 65 IF( kt == nittrc000 ) CALL ldf_ctl ! initialisation & control of options 66 67 rldf = rldf_rat 68 69 IF( l_trdtrc ) THEN 70 CALL wrk_alloc( jpi, jpj, jpk, jptra, ztrtrd ) 65 71 ztrtrd(:,:,:,:) = tra(:,:,:,:) 66 72 ENDIF 67 73 68 74 SELECT CASE ( nldf ) ! compute lateral mixing trend and add it to the general trend 69 CASE ( 0 ) ; CALL tra_ldf_lap ( kt, 'TRC', gtru, gtrv, trb, tra, jptra ) ! iso-level laplacian 70 CASE ( 1 ) ; CALL tra_ldf_iso ( kt, 'TRC', gtru, gtrv, trb, tra, jptra, rn_ahtb_0 ) ! rotated laplacian 71 CASE ( 2 ) ; CALL tra_ldf_bilap ( kt, 'TRC', gtru, gtrv, trb, tra, jptra ) ! iso-level bilaplacian 72 CASE ( 3 ) ; CALL tra_ldf_bilapg( kt, 'TRC', trb, tra, jptra ) ! s-coord. horizontal bilaplacian 75 CASE ( 0 ) ; CALL tra_ldf_lap ( kt, nittrc000, 'TRC', gtru, gtrv, trb, tra, jptra ) ! iso-level laplacian 76 CASE ( 1 ) ! rotated laplacian 77 IF( ln_traldf_grif ) THEN 78 CALL tra_ldf_iso_grif( kt, nittrc000, 'TRC', gtru, gtrv, trb, tra, jptra, rn_ahtb_0 ) 79 ELSE 80 CALL tra_ldf_iso ( kt, nittrc000, 'TRC', gtru, gtrv, trb, tra, jptra, rn_ahtb_0 ) 81 ENDIF 82 CASE ( 2 ) ; CALL tra_ldf_bilap ( kt, nittrc000, 'TRC', gtru, gtrv, trb, tra, jptra ) ! iso-level bilaplacian 83 CASE ( 3 ) ; CALL tra_ldf_bilapg( kt, nittrc000, 'TRC', trb, tra, jptra ) ! s-coord. horizontal bilaplacian 73 84 ! 74 85 CASE ( -1 ) ! esopa: test all possibility with control print 75 CALL tra_ldf_lap ( kt, 'TRC', gtru, gtrv, trb, tra, jptra )86 CALL tra_ldf_lap ( kt, nittrc000, 'TRC', gtru, gtrv, trb, tra, jptra ) 76 87 WRITE(charout, FMT="('ldf0 ')") ; CALL prt_ctl_trc_info(charout) 77 88 CALL prt_ctl_trc( tab4d=tra, mask=tmask, clinfo=ctrcnm, clinfo2='trd' ) 78 CALL tra_ldf_iso ( kt, 'TRC', gtru, gtrv, trb, tra, jptra, rn_ahtb_0 ) 89 IF( ln_traldf_grif ) THEN 90 CALL tra_ldf_iso_grif( kt, nittrc000, 'TRC', gtru, gtrv, trb, tra, jptra, rn_ahtb_0 ) 91 ELSE 92 CALL tra_ldf_iso ( kt, nittrc000, 'TRC', gtru, gtrv, trb, tra, jptra, rn_ahtb_0 ) 93 ENDIF 79 94 WRITE(charout, FMT="('ldf1 ')") ; CALL prt_ctl_trc_info(charout) 80 95 CALL prt_ctl_trc( tab4d=tra, mask=tmask, clinfo=ctrcnm, clinfo2='trd' ) 81 CALL tra_ldf_bilap ( kt, 'TRC', gtru, gtrv, trb, tra, jptra )96 CALL tra_ldf_bilap ( kt, nittrc000, 'TRC', gtru, gtrv, trb, tra, jptra ) 82 97 WRITE(charout, FMT="('ldf2 ')") ; CALL prt_ctl_trc_info(charout) 83 98 CALL prt_ctl_trc( tab4d=tra, mask=tmask, clinfo=ctrcnm, clinfo2='trd' ) 84 CALL tra_ldf_bilapg( kt, 'TRC', trb, tra, jptra )99 CALL tra_ldf_bilapg( kt, nittrc000, 'TRC', trb, tra, jptra ) 85 100 WRITE(charout, FMT="('ldf3 ')") ; CALL prt_ctl_trc_info(charout) 86 101 CALL prt_ctl_trc( tab4d=tra, mask=tmask, clinfo=ctrcnm, clinfo2='trd' ) … … 92 107 CALL trd_tra( kt, 'TRC', jn, jptra_trd_ldf, ztrtrd(:,:,:,jn) ) 93 108 END DO 94 DEALLOCATE( ztrtrd )109 CALL wrk_dealloc( jpi, jpj, jpk, jptra, ztrtrd ) 95 110 ENDIF 96 111 ! ! print mean trends (used for debugging) … … 100 115 ENDIF 101 116 ! 117 IF( nn_timing == 1 ) CALL timing_stop('trc_ldf') 118 ! 102 119 END SUBROUTINE trc_ldf 103 120 … … 106 123 !!---------------------------------------------------------------------- 107 124 !! *** ROUTINE ldf_ctl *** 108 !! 125 !! 109 126 !! ** Purpose : Choice of the operator for the lateral tracer diffusion 110 127 !! 111 128 !! ** Method : set nldf from the namtra_ldf logicals 112 !! nldf == -2 No lateral diffusion 129 !! nldf == -2 No lateral diffusion 113 130 !! nldf == -1 ESOPA test: ALL operators are used 114 131 !! nldf == 0 laplacian operator … … 117 134 !! nldf == 3 Rotated bilaplacian 118 135 !!---------------------------------------------------------------------- 119 INTEGER :: ioptio, ierr ! temporary integers 120 !!---------------------------------------------------------------------- 121 136 INTEGER :: ioptio, ierr ! temporary integers 137 !!---------------------------------------------------------------------- 138 139 IF (ABS(rn_aht_0) < 2._wp*TINY(1.e0)) THEN 140 IF (ABS(rn_ahtrc_0) < 2._wp*TINY(1.e0)) THEN 141 rldf_rat = 1.0_wp 142 ELSE 143 CALL ctl_stop( 'STOP', 'ldf_ctl : cannot define rldf_rat, rn_aht_0==0, rn_ahtrc_0 /=0' ) 144 END IF 145 ELSE 146 rldf_rat = rn_ahtrc_0 / rn_aht_0 147 END IF 122 148 ! Define the lateral mixing oparator for tracers 123 149 ! =============================================== 124 150 125 151 ! ! control the input 126 152 ioptio = 0 … … 163 189 ENDIF 164 190 IF ( ln_zps ) THEN ! z-coordinate 165 IF ( ln_trcldf_level ) ierr = 1 ! iso-level not allowed 191 IF ( ln_trcldf_level ) ierr = 1 ! iso-level not allowed 166 192 IF ( ln_trcldf_hor ) nldf = 2 ! horizontal (no rotation) 167 193 IF ( ln_trcldf_iso ) ierr = 2 ! isoneutral ( rotation) … … 206 232 ENDIF 207 233 234 IF( ln_trcldf_bilap ) THEN 235 IF(lwp) WRITE(numout,*) ' biharmonic tracer diffusion' 236 IF( rn_ahtrc_0 > 0 .AND. .NOT. lk_esopa ) CALL ctl_stop( 'The horizontal diffusivity coef. rn_ahtrc_0 must be negative' ) 237 ELSE 238 IF(lwp) WRITE(numout,*) ' harmonic tracer diffusion (default)' 239 IF( rn_ahtrc_0 < 0 .AND. .NOT. lk_esopa ) CALL ctl_stop('The horizontal diffusivity coef. rn_ahtrc_0 must be positive' ) 240 ENDIF 241 242 ! ratio between active and passive tracers diffusive coef. 243 IF (ABS(rn_aht_0) < 2._wp*TINY(1.e0)) THEN 244 IF (ABS(rn_ahtrc_0) < 2._wp*TINY(1.e0)) THEN 245 rldf_rat = 1.0_wp 246 ELSE 247 CALL ctl_stop( 'STOP', 'ldf_ctl : cannot define rldf_rat, rn_aht_0==0, rn_ahtrc_0 /=0' ) 248 END IF 249 ELSE 250 rldf_rat = rn_ahtrc_0 / rn_aht_0 251 END IF 252 IF( rldf_rat < 0 ) THEN 253 IF( .NOT.lk_offline ) THEN 254 CALL ctl_stop( 'Choose the same type of diffusive scheme both for active & passive tracers' ) 255 ELSE 256 CALL ctl_stop( 'Change the sign of rn_aht_0 in namelist to -/+1' ) 257 ENDIF 258 ENDIF 208 259 ! 209 260 END SUBROUTINE ldf_ctl -
trunk/NEMOGCM/NEMO/TOP_SRC/TRP/trcnam_trp.F90
r2528 r3294 36 36 LOGICAL , PUBLIC :: ln_trcldf_hor = .FALSE. !: horizontal (geopotential) direction 37 37 LOGICAL , PUBLIC :: ln_trcldf_iso = .TRUE. !: iso-neutral direction 38 REAL(wp), PUBLIC :: rn_ahtrc_0 !: diffusivity coefficient for passive tracer (m2/s) 38 39 REAL(wp), PUBLIC :: rn_ahtrb_0 !: background diffusivity coefficient for passive tracer (m2/s) 39 40 … … 76 77 NAMELIST/namtrc_ldf/ ln_trcldf_diff , ln_trcldf_lap , & 77 78 & ln_trcldf_bilap, ln_trcldf_level, & 78 & ln_trcldf_hor , ln_trcldf_iso , rn_ahtr b_079 & ln_trcldf_hor , ln_trcldf_iso , rn_ahtrc_0, rn_ahtrb_0 79 80 NAMELIST/namtrc_zdf/ ln_trczdf_exp , nn_trczdf_exp 80 81 NAMELIST/namtrc_rad/ ln_trcrad … … 119 120 WRITE(numout,*) ' horizontal (geopotential) ln_trcldf_hor = ', ln_trcldf_hor 120 121 WRITE(numout,*) ' iso-neutral ln_trcldf_iso = ', ln_trcldf_iso 122 WRITE(numout,*) ' diffusivity coefficient rn_ahtrc_0 = ', rn_ahtrc_0 121 123 WRITE(numout,*) ' background hor. diffusivity rn_ahtrb_0 = ', rn_ahtrb_0 122 124 ENDIF -
trunk/NEMOGCM/NEMO/TOP_SRC/TRP/trcnxt.F90
r2715 r3294 93 93 REAL(wp) :: zfact ! temporary scalar 94 94 CHARACTER (len=22) :: charout 95 REAL(wp), DIMENSION(:,:,:,:), ALLOCATABLE:: ztrdt95 REAL(wp), POINTER, DIMENSION(:,:,:,:) :: ztrdt 96 96 !!---------------------------------------------------------------------- 97 98 IF( kt == nit000 .AND. lwp ) THEN 97 ! 98 IF( nn_timing == 1 ) CALL timing_start('trc_nxt') 99 ! 100 IF( kt == nittrc000 .AND. lwp ) THEN 99 101 WRITE(numout,*) 100 102 WRITE(numout,*) 'trc_nxt : time stepping on passive tracers' … … 119 121 120 122 ! set time step size (Euler/Leapfrog) 121 IF( neuler == 0 .AND. kt == nit 000) THEN ; r2dt(:) = rdttrc(:) ! at nit000 (Euler)122 ELSEIF( kt <= nit 000 + 1 )THEN ; r2dt(:) = 2.* rdttrc(:) ! at nit000 or nit000+1 (Leapfrog)123 IF( neuler == 0 .AND. kt == nittrc000 ) THEN ; r2dt(:) = rdttrc(:) ! at nittrc000 (Euler) 124 ELSEIF( kt <= nittrc000 + 1 ) THEN ; r2dt(:) = 2.* rdttrc(:) ! at nit000 or nit000+1 (Leapfrog) 123 125 ENDIF 124 126 125 127 ! trends computation initialisation 126 128 IF( l_trdtrc ) THEN 127 ALLOCATE( ztrdt(jpi,jpj,jpk,jptra)) !* store now fields before applying the Asselin filter129 CALL wrk_alloc( jpi, jpj, jpk, jptra, ztrdt ) !* store now fields before applying the Asselin filter 128 130 ztrdt(:,:,:,:) = trn(:,:,:,:) 129 131 ENDIF 130 132 ! Leap-Frog + Asselin filter time stepping 131 IF( neuler == 0 .AND. kt == nit 000 ) THEN ! Euler time-stepping at first time-step132 ! ! (only swap)133 IF( neuler == 0 .AND. kt == nittrc000 ) THEN ! Euler time-stepping at first time-step 134 ! ! (only swap) 133 135 DO jn = 1, jptra 134 136 DO jk = 1, jpkm1 … … 139 141 ELSE 140 142 ! Leap-Frog + Asselin filter time stepping 141 IF( lk_vvl ) THEN ; CALL tra_nxt_vvl( kt, 'TRC', trb, trn, tra, jptra ) ! variable volume level (vvl)142 ELSE ; CALL tra_nxt_fix( kt, 'TRC', trb, trn, tra, jptra ) ! fixed volume level143 IF( lk_vvl ) THEN ; CALL tra_nxt_vvl( kt, nittrc000, 'TRC', trb, trn, tra, jptra ) ! variable volume level (vvl) 144 ELSE ; CALL tra_nxt_fix( kt, nittrc000, 'TRC', trb, trn, tra, jptra ) ! fixed volume level 143 145 ENDIF 144 146 ENDIF … … 158 160 END DO 159 161 END DO 160 DEALLOCATE( ztrdt )162 CALL wrk_dealloc( jpi, jpj, jpk, jptra, ztrdt ) 161 163 END IF 162 164 ! … … 166 168 CALL prt_ctl_trc(tab4d=trn, mask=tmask, clinfo=ctrcnm) 167 169 ENDIF 170 ! 171 IF( nn_timing == 1 ) CALL timing_stop('trc_nxt') 168 172 ! 169 173 END SUBROUTINE trc_nxt -
trunk/NEMOGCM/NEMO/TOP_SRC/TRP/trcrad.F90
r2715 r3294 52 52 CHARACTER (len=22) :: charout 53 53 !!---------------------------------------------------------------------- 54 55 IF( kt == nit000 ) THEN 54 ! 55 IF( nn_timing == 1 ) CALL timing_start('trc_rad') 56 ! 57 IF( kt == nittrc000 ) THEN 56 58 IF(lwp) WRITE(numout,*) 57 59 IF(lwp) WRITE(numout,*) 'trc_rad : Correct artificial negative concentrations ' … … 65 67 IF( lk_my_trc ) CALL trc_rad_sms( kt, trb, trn, jp_myt0 , jp_myt1 ) ! MY_TRC model 66 68 67 68 69 ! 69 70 IF(ln_ctl) THEN ! print mean trends (used for debugging) … … 72 73 CALL prt_ctl_trc( tab4d=trn, mask=tmask, clinfo=ctrcnm ) 73 74 ENDIF 75 ! 76 IF( nn_timing == 1 ) CALL timing_stop('trc_rad') 74 77 ! 75 78 END SUBROUTINE trc_rad … … 104 107 105 108 ! Local declarations 106 INTEGER :: 107 REAL(wp) :: z volk, ztrcorb, ztrmasb ! temporary scalars109 INTEGER :: ji, jj, jk, jn ! dummy loop indices 110 REAL(wp) :: ztrcorb, ztrmasb ! temporary scalars 108 111 REAL(wp) :: zcoef, ztrcorn, ztrmasn ! " " 109 REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: ztrtrdb ! workspace arrays 110 REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: ztrtrdn ! workspace arrays 112 REAL(wp), POINTER, DIMENSION(:,:,:) :: ztrtrdb, ztrtrdn ! workspace arrays 111 113 REAL(wp) :: zs2rdt 112 114 LOGICAL :: lldebug = .FALSE. 113 114 !!---------------------------------------------------------------------- 115 116 IF( l_trdtrc ) THEN 117 ! 118 ALLOCATE( ztrtrdb(jpi,jpj,jpk) ) 119 ALLOCATE( ztrtrdn(jpi,jpj,jpk) ) 120 ! 121 ENDIF 115 !!---------------------------------------------------------------------- 116 117 118 IF( l_trdtrc ) CALL wrk_alloc( jpi, jpj, jpk, ztrtrdb, ztrtrdn ) 122 119 123 120 IF( PRESENT( cpreserv ) ) THEN ! total tracer concentration is preserved 124 121 125 122 DO jn = jp_sms0, jp_sms1 126 ! ! ===========123 ! ! =========== 127 124 ztrcorb = 0.e0 ; ztrmasb = 0.e0 128 125 ztrcorn = 0.e0 ; ztrmasn = 0.e0 129 126 130 IF( l_trdtrc ) THEN 131 ztrtrdb(:,:,:) = ptrb(:,:,:,jn) ! save input trb for trend computation 132 ztrtrdn(:,:,:) = ptrn(:,:,:,jn) ! save input trn for trend computation 133 ENDIF 134 135 136 DO jk = 1, jpkm1 137 DO jj = 1, jpj 138 DO ji = 1, jpi 139 zvolk = cvol(ji,jj,jk) 140 # if defined key_degrad 141 zvolk = zvolk * facvol(ji,jj,jk) 142 # endif 143 ztrcorb = ztrcorb + MIN( 0., ptrb(ji,jj,jk,jn) ) * zvolk 144 ztrcorn = ztrcorn + MIN( 0., ptrn(ji,jj,jk,jn) ) * zvolk 145 146 ptrb(ji,jj,jk,jn) = MAX( 0., ptrb(ji,jj,jk,jn) ) 147 ptrn(ji,jj,jk,jn) = MAX( 0., ptrn(ji,jj,jk,jn) ) 148 149 ztrmasb = ztrmasb + ptrb(ji,jj,jk,jn) * zvolk 150 ztrmasn = ztrmasn + ptrn(ji,jj,jk,jn) * zvolk 151 END DO 152 END DO 153 END DO 154 155 IF( lk_mpp ) THEN 156 CALL mpp_sum( ztrcorb ) ! sum over the global domain 157 CALL mpp_sum( ztrcorn ) ! sum over the global domain 158 CALL mpp_sum( ztrmasb ) ! sum over the global domain 159 CALL mpp_sum( ztrmasn ) ! sum over the global domain 160 ENDIF 127 IF( l_trdtrc ) THEN 128 ztrtrdb(:,:,:) = ptrb(:,:,:,jn) ! save input trb for trend computation 129 ztrtrdn(:,:,:) = ptrn(:,:,:,jn) ! save input trn for trend computation 130 ENDIF 131 ! ! sum over the global domain 132 ztrcorb = glob_sum( MIN( 0., ptrb(:,:,:,jn) ) * cvol(:,:,:) ) 133 ztrcorn = glob_sum( MIN( 0., ptrn(:,:,:,jn) ) * cvol(:,:,:) ) 134 135 ztrmasb = glob_sum( MAX( 0., ptrb(:,:,:,jn) ) * cvol(:,:,:) ) 136 ztrmasn = glob_sum( MAX( 0., ptrn(:,:,:,jn) ) * cvol(:,:,:) ) 161 137 162 138 IF( ztrcorb /= 0 ) THEN 163 139 zcoef = 1. + ztrcorb / ztrmasb 164 140 DO jk = 1, jpkm1 141 ptrb(:,:,jk,jn) = MAX( 0., ptrb(:,:,jk,jn) ) 165 142 ptrb(:,:,jk,jn) = ptrb(:,:,jk,jn) * zcoef * tmask(:,:,jk) 166 143 END DO … … 170 147 zcoef = 1. + ztrcorn / ztrmasn 171 148 DO jk = 1, jpkm1 149 ptrn(:,:,jk,jn) = MAX( 0., ptrn(:,:,jk,jn) ) 172 150 ptrn(:,:,jk,jn) = ptrn(:,:,jk,jn) * zcoef * tmask(:,:,jk) 173 151 END DO … … 207 185 IF( l_trdtrc ) THEN 208 186 ! 209 zs2rdt = 1. / ( 2. * rdt * FLOAT( nn_dttrc) )187 zs2rdt = 1. / ( 2. * rdt * FLOAT( nn_dttrc ) ) 210 188 ztrtrdb(:,:,:) = ( ptrb(:,:,:,jn) - ztrtrdb(:,:,:) ) * zs2rdt 211 189 ztrtrdn(:,:,:) = ( ptrn(:,:,:,jn) - ztrtrdn(:,:,:) ) * zs2rdt … … 219 197 ENDIF 220 198 221 IF( l_trdtrc ) DEALLOCATE(ztrtrdb, ztrtrdn )199 IF( l_trdtrc ) CALL wrk_dealloc( jpi, jpj, jpk, ztrtrdb, ztrtrdn ) 222 200 223 201 END SUBROUTINE trc_rad_sms -
trunk/NEMOGCM/NEMO/TOP_SRC/TRP/trcsbc.F90
r2715 r3294 57 57 !! 58 58 !!---------------------------------------------------------------------- 59 USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released60 USE wrk_nemo, ONLY: zemps => wrk_2d_161 USE wrk_nemo, ONLY: ztrtrd => wrk_3d_162 59 ! 63 60 INTEGER, INTENT( in ) :: kt ! ocean time-step index … … 66 63 REAL(wp) :: zsrau, zse3t ! temporary scalars 67 64 CHARACTER (len=22) :: charout 68 !!---------------------------------------------------------------------- 65 REAL(wp), POINTER, DIMENSION(:,: ) :: zemps 66 REAL(wp), POINTER, DIMENSION(:,:,:) :: ztrtrd 67 !!--------------------------------------------------------------------- 68 ! 69 IF( nn_timing == 1 ) CALL timing_start('trc_sbc') 70 ! 71 ! Allocate temporary workspace 72 CALL wrk_alloc( jpi, jpj, zemps ) 73 IF( l_trdtrc ) CALL wrk_alloc( jpi, jpj, jpk, ztrtrd ) 69 74 70 IF( wrk_in_use(2, 1) .OR. wrk_in_use(3, 1) ) THEN 71 CALL ctl_stop('trc_sbc: requested workspace array unavailable.') ; RETURN 72 END IF 73 74 IF( kt == nit000 ) THEN 75 IF( kt == nittrc000 ) THEN 75 76 IF(lwp) WRITE(numout,*) 76 77 IF(lwp) WRITE(numout,*) 'trc_sbc : Passive tracers surface boundary condition' … … 116 117 CALL prt_ctl_trc( tab4d=tra, mask=tmask, clinfo=ctrcnm, clinfo2='trd' ) 117 118 ENDIF 118 119 IF( wrk_not_released(2, 1) .OR. wrk_not_released(3, 1) ) & 120 & CALL ctl_stop('trc_sbc: failed to release workspace array.') 121 119 CALL wrk_dealloc( jpi, jpj, zemps ) 120 IF( l_trdtrc ) CALL wrk_dealloc( jpi, jpj, jpk, ztrtrd ) 121 ! 122 IF( nn_timing == 1 ) CALL timing_stop('trc_sbc') 123 ! 122 124 END SUBROUTINE trc_sbc 123 125 -
trunk/NEMOGCM/NEMO/TOP_SRC/TRP/trctrp.F90
r2528 r3294 58 58 INTEGER, INTENT( in ) :: kstp ! ocean time-step index 59 59 !! --------------------------------------------------------------------- 60 ! 61 IF( nn_timing == 1 ) CALL timing_start('trc_trp') 62 ! 60 63 IF( .NOT. lk_c1d ) THEN 61 64 ! … … 86 89 END IF 87 90 ! 91 IF( nn_timing == 1 ) CALL timing_stop('trc_trp') 92 ! 88 93 END SUBROUTINE trc_trp 89 94 -
trunk/NEMOGCM/NEMO/TOP_SRC/TRP/trczdf.F90
r2715 r3294 32 32 ! ! defined from ln_zdf... namlist logicals) 33 33 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:) :: r2dt ! vertical profile time-step, = 2 rdttra 34 ! ! except at nit 000 (=rdttra) if neuler=034 ! ! except at nittrc000 (=rdttra) if neuler=0 35 35 36 36 !! * Substitutions … … 66 66 INTEGER :: jk, jn 67 67 CHARACTER (len=22) :: charout 68 REAL(wp), DIMENSION(:,:,:,:), ALLOCATABLE:: ztrtrd ! 4D workspace68 REAL(wp), POINTER, DIMENSION(:,:,:,:) :: ztrtrd ! 4D workspace 69 69 !!--------------------------------------------------------------------- 70 71 IF( kt == nit000 ) CALL zdf_ctl ! initialisation & control of options 70 ! 71 IF( nn_timing == 1 ) CALL timing_start('trc_zdf') 72 ! 73 IF( kt == nittrc000 ) CALL zdf_ctl ! initialisation & control of options 72 74 73 75 #if ! defined key_pisces 74 IF( neuler == 0 .AND. kt == nit 000 ) THEN ! at nit00076 IF( neuler == 0 .AND. kt == nittrc000 ) THEN ! at nittrc000 75 77 r2dt(:) = rdttrc(:) ! = rdttrc (restarting with Euler time stepping) 76 ELSEIF( kt <= nit 000 + nn_dttrc ) THEN ! at nit000 or nit000+178 ELSEIF( kt <= nittrc000 + 1 ) THEN ! at nittrc000 or nittrc000+1 77 79 r2dt(:) = 2. * rdttrc(:) ! = 2 rdttrc (leapfrog) 78 80 ENDIF … … 82 84 83 85 IF( l_trdtrc ) THEN 84 ALLOCATE( ztrtrd(jpi,jpj,jpk,jptra) ) ! temporary save of trends86 CALL wrk_alloc( jpi, jpj, jpk, jptra, ztrtrd ) 85 87 ztrtrd(:,:,:,:) = tra(:,:,:,:) 86 88 ENDIF … … 88 90 SELECT CASE ( nzdf ) ! compute lateral mixing trend and add it to the general trend 89 91 CASE ( -1 ) ! esopa: test all possibility with control print 90 CALL tra_zdf_exp( kt, 'TRC', r2dt, nn_trczdf_exp, trb, tra, jptra )92 CALL tra_zdf_exp( kt, nittrc000, 'TRC', r2dt, nn_trczdf_exp, trb, tra, jptra ) 91 93 WRITE(charout, FMT="('zdf1 ')") ; CALL prt_ctl_trc_info(charout) 92 94 CALL prt_ctl_trc( tab4d=tra, mask=tmask, clinfo=ctrcnm, clinfo2='trd' ) 93 CALL tra_zdf_imp( kt, 'TRC', r2dt, trb, tra, jptra )95 CALL tra_zdf_imp( kt, nittrc000, 'TRC', r2dt, trb, tra, jptra ) 94 96 WRITE(charout, FMT="('zdf2 ')") ; CALL prt_ctl_trc_info(charout) 95 97 CALL prt_ctl_trc( tab4d=tra, mask=tmask, clinfo=ctrcnm, clinfo2='trd' ) 96 CASE ( 0 ) ; CALL tra_zdf_exp( kt, 'TRC', r2dt, nn_trczdf_exp, trb, tra, jptra ) ! explicit scheme97 CASE ( 1 ) ; CALL tra_zdf_imp( kt, 'TRC', r2dt, trb, tra, jptra ) ! implicit scheme98 CASE ( 0 ) ; CALL tra_zdf_exp( kt, nittrc000, 'TRC', r2dt, nn_trczdf_exp, trb, tra, jptra ) ! explicit scheme 99 CASE ( 1 ) ; CALL tra_zdf_imp( kt, nittrc000, 'TRC', r2dt, trb, tra, jptra ) ! implicit scheme 98 100 99 101 END SELECT … … 106 108 CALL trd_tra( kt, 'TRC', jn, jptra_trd_zdf, ztrtrd(:,:,:,jn) ) 107 109 END DO 108 DEALLOCATE(ztrtrd )110 CALL wrk_dealloc( jpi, jpj, jpk, jptra, ztrtrd ) 109 111 ENDIF 110 111 112 ! ! print mean trends (used for debugging) 112 113 IF( ln_ctl ) THEN … … 114 115 CALL prt_ctl_trc( tab4d=tra, mask=tmask, clinfo=ctrcnm, clinfo2='trd' ) 115 116 END IF 117 ! 118 IF( nn_timing == 1 ) CALL timing_stop('trc_zdf') 116 119 ! 117 120 END SUBROUTINE trc_zdf -
trunk/NEMOGCM/NEMO/TOP_SRC/TRP/trdmld_trc.F90
r2715 r3294 33 33 USE trdmld_trc_rst ! restart for diagnosing the ML trends 34 34 USE prtctl ! print control 35 USE sms_pisces 36 USE sms_lobster 35 USE sms_pisces ! PISCES bio-model 36 USE sms_lobster ! LOBSTER bio-model 37 37 38 38 IMPLICIT NONE … … 60 60 LOGICAL :: lldebug = .TRUE. 61 61 62 ! Workspace array for trd_mld_trc() routine. Declared here as is 4D and63 ! cannot use workspaces in wrk_nemo module.64 62 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: ztmltrd2 ! 65 63 #if defined key_lobster … … 112 110 !! surface and the control surface is called "mixed-layer" 113 111 !!---------------------------------------------------------------------- 114 USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released115 USE wrk_nemo, ONLY: zvlmsk => wrk_2d_1116 112 !! 117 113 INTEGER, INTENT( in ) :: ktrd, kjn ! ocean trend index and passive tracer rank 118 114 CHARACTER(len=2), INTENT( in ) :: ctype ! surface/bottom (2D) or interior (3D) physics 119 115 REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT( in ) :: ptrc_trdmld ! passive tracer trend 116 ! 120 117 INTEGER :: ji, jj, jk, isum 121 !!---------------------------------------------------------------------- 122 123 IF( wrk_in_use(2, 1) ) THEN 124 CALL ctl_stop('trd_mld_trc_zint: requested workspace array unavailable') ; RETURN 125 ENDIF 118 REAL(wp), POINTER, DIMENSION(:,:) :: zvlmsk 119 !!---------------------------------------------------------------------- 120 121 CALL wrk_alloc( jpi, jpj, zvlmsk ) 126 122 127 123 ! I. Definition of control surface and integration weights … … 208 204 END SELECT 209 205 ! 210 IF( wrk_not_released(2, 1) ) CALL ctl_stop('trd_mld_trc_zint: failed to release workspace array')206 CALL wrk_dealloc( jpi, jpj, zvlmsk ) 211 207 ! 212 208 END SUBROUTINE trd_mld_trc_zint … … 231 227 !! surface and the control surface is called "mixed-layer" 232 228 !!---------------------------------------------------------------------- 233 USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released234 USE wrk_nemo, ONLY: zvlmsk => wrk_2d_1235 229 !! 236 230 INTEGER , INTENT(in) :: ktrd ! bio trend index … … 239 233 ! 240 234 INTEGER :: ji, jj, jk, isum 241 !!---------------------------------------------------------------------- 242 243 IF( wrk_in_use(2, 1) ) THEN 244 CALL ctl_stop('trd_mld_bio_zint: requested workspace array unavailable') ; RETURN 245 ENDIF 235 REAL(wp), POINTER, DIMENSION(:,:) :: zvlmsk 236 !!---------------------------------------------------------------------- 237 238 CALL wrk_alloc( jpi, jpj, zvlmsk ) 246 239 247 240 ! I. Definition of control surface and integration weights … … 325 318 END DO 326 319 327 IF( wrk_not_released(2, 1) ) CALL ctl_stop('trd_mld_bio_zint: failed to release workspace array')320 CALL wrk_alloc( jpi, jpj, zvlmsk ) 328 321 #endif 329 322 ! … … 378 371 !! - See NEMO documentation (in preparation) 379 372 !!---------------------------------------------------------------------- 380 USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released381 USE wrk_nemo, ONLY: wrk_3d_1, wrk_3d_2, wrk_3d_3, wrk_3d_4382 USE wrk_nemo, ONLY: wrk_3d_5, wrk_3d_6, wrk_3d_7, wrk_3d_8, wrk_3d_9383 373 ! 384 374 INTEGER, INTENT(in) :: kt ! ocean time-step index … … 397 387 REAL(wp), POINTER, DIMENSION(:,:,:) :: ztmlatf2 ! | passive tracers 398 388 REAL(wp), POINTER, DIMENSION(:,:,:) :: ztmlrad2 ! | (-> for trb<0 corr in trcrad) 399 !REAL(wp), DIMENSION(jpi,jpj,jpltrd_trc,jptra) :: ztmltrd2 ! -+400 389 ! 401 390 CHARACTER (LEN= 5) :: clvar … … 406 395 !!---------------------------------------------------------------------- 407 396 408 IF( wrk_in_use(3, 1,2,3,4,5,6,7,8,9) ) THEN409 CALL ctl_stop('trd_mld_trc : requested workspace arrays unavailable') ; RETURN410 ENDIF411 397 ! Set-up pointers into sub-arrays of workspaces 412 ztmltot => wrk_3d_1(:,:,1:jptra) 413 ztmlres => wrk_3d_2(:,:,1:jptra) 414 ztmlatf => wrk_3d_3(:,:,1:jptra) 415 ztmlrad => wrk_3d_4(:,:,1:jptra) 416 ztmltot2 => wrk_3d_5(:,:,1:jptra) 417 ztmlres2 => wrk_3d_6(:,:,1:jptra) 418 ztmltrdm2 => wrk_3d_7(:,:,1:jptra) 419 ztmlatf2 => wrk_3d_8(:,:,1:jptra) 420 ztmlrad2 => wrk_3d_9(:,:,1:jptra) 421 398 CALL wrk_alloc( jpi, jpj, jptra, ztmltot , ztmlres , ztmlatf , ztmlrad ) 399 CALL wrk_alloc( jpi, jpj, jptra, ztmltot2, ztmlres2, ztmlatf2, ztmlrad2, ztmltrdm2 ) 422 400 423 401 IF( nn_dttrc /= 1 ) CALL ctl_stop( " Be careful, trends diags never validated " ) … … 475 453 ! II.1 Set before values of vertically averages passive tracers 476 454 ! ------------------------------------------------------------- 477 IF( kt > nit 000 ) THEN455 IF( kt > nittrc000 ) THEN 478 456 DO jn = 1, jptra 479 457 IF( ln_trdtrc(jn) ) THEN … … 497 475 ! II.3 Initialize mixed-layer "before" arrays for the 1rst analysis window 498 476 ! ------------------------------------------------------------------------ 499 IF( kt == 2) THEN ! i.e. ( .NOT. ln_rstart ).AND.( kt == nit000 + 1) ???477 IF( kt == nittrc000 + nn_dttrc ) THEN ! i.e. ( .NOT. ln_rstart ).AND.( kt == nit000 + 1) ??? 500 478 ! 501 479 DO jn = 1, jptra … … 560 538 tmltrd_trc(:,:,:,:) = tmltrd_trc(:,:,:,:) * rn_ucf_trc 561 539 562 itmod = kt - nit 000 + 1540 itmod = kt - nittrc000 + 1 563 541 it = kt 564 542 … … 907 885 IF( lrst_trc ) CALL trd_mld_trc_rst_write( kt ) ! this must be after the array swap above (III.3) 908 886 909 IF( wrk_not_released(3, 1,2,3,4,5,6,7,8,9) ) CALL ctl_stop('trd_mld_trc: failed to release workspace arrays') 887 CALL wrk_dealloc( jpi, jpj, jptra, ztmltot , ztmlres , ztmlatf , ztmlrad ) 888 CALL wrk_dealloc( jpi, jpj, jptra, ztmltot2, ztmlres2, ztmlatf2, ztmlrad2, ztmltrdm2 ) 910 889 ! 911 890 END SUBROUTINE trd_mld_trc … … 980 959 ! II.3 Initialize mixed-layer "before" arrays for the 1rst analysis window 981 960 ! ------------------------------------------------------------------------ 982 IF( kt == 2) THEN ! i.e. ( .NOT. ln_rstart ).AND.( kt == nit000 + 1)961 IF( kt == nittrc000 + nn_dttrc ) THEN ! i.e. ( .NOT. ln_rstart ).AND.( kt == nit000 + 1) 983 962 ! 984 963 tmltrd_csum_ub_bio (:,:,:) = 0.e0 … … 1086 1065 1087 1066 ! define time axis 1088 itmod = kt - nit 000 + 11067 itmod = kt - nittrc000 + 1 1089 1068 it = kt 1090 1069 … … 1331 1310 zjulian = zjulian - adatrj ! set calendar origin to the beginning of the experiment 1332 1311 IF(lwp) WRITE(numout,*)' ' 1333 IF(lwp) WRITE(numout,*)' Date 0 used :', nit 000&1312 IF(lwp) WRITE(numout,*)' Date 0 used :', nittrc000 & 1334 1313 & ,' YEAR ', nyear, ' MONTH ', nmonth,' DAY ', nday & 1335 1314 & ,'Julian day : ', zjulian … … 1360 1339 CALL dia_nam( clhstnam, nn_trd_trc, csuff ) 1361 1340 CALL histbeg( clhstnam, jpi, glamt, jpj, gphit, & 1362 & 1, jpi, 1, jpj, nit 000, zjulian, rdt, nh_t(jn), nidtrd(jn), domain_id=nidom, snc4chunks=snc4set )1341 & 1, jpi, 1, jpj, nittrc000, zjulian, rdt, nh_t(jn), nidtrd(jn), domain_id=nidom, snc4chunks=snc4set ) 1363 1342 1364 1343 !-- Define the ML depth variable … … 1373 1352 CALL dia_nam( clhstnam, nn_trd_trc, 'trdbio' ) 1374 1353 CALL histbeg( clhstnam, jpi, glamt, jpj, gphit, & 1375 & 1, jpi, 1, jpj, nit 000, zjulian, rdt, nh_tb, nidtrdbio, domain_id=nidom, snc4chunks=snc4set )1354 & 1, jpi, 1, jpj, nittrc000, zjulian, rdt, nh_tb, nidtrdbio, domain_id=nidom, snc4chunks=snc4set ) 1376 1355 #endif 1377 1356 -
trunk/NEMOGCM/NEMO/TOP_SRC/TRP/trdmod_trc.F90
r2528 r3294 50 50 !!---------------------------------------------------------------------- 51 51 52 IF( kt == nit 000 ) THEN52 IF( kt == nittrc000 ) THEN 53 53 ! IF(lwp)WRITE(numout,*) 54 54 ! IF(lwp)WRITE(numout,*) 'trd_mod_trc:' -
trunk/NEMOGCM/NEMO/TOP_SRC/oce_trc.F90
r2787 r3294 33 33 !* IO manager * 34 34 USE in_out_manager 35 36 !* Memory Allocation * 37 USE wrk_nemo 38 39 !* Timing * 40 USE timing 35 41 36 42 !* MPP library … … 108 114 USE dom_oce , ONLY : e3w_0 => e3w_0 !: reference depth of w-points (m) 109 115 USE dom_oce , ONLY : gdepw_0 => gdepw_0 !: reference depth of w-points (m) 116 # if ! defined key_zco 110 117 USE dom_oce , ONLY : gdep3w => gdep3w !: ??? 111 118 USE dom_oce , ONLY : gdept => gdept !: depth of t-points (m) … … 118 125 USE dom_oce , ONLY : e3uw => e3uw !: uw-points (m) 119 126 USE dom_oce , ONLY : e3vw => e3vw !: vw-points (m) 120 127 # endif 121 128 USE dom_oce , ONLY : ln_zps => ln_zps !: partial steps flag 122 129 USE dom_oce , ONLY : ln_sco => ln_sco !: s-coordinate flag … … 184 191 USE oce , ONLY : vn => vn !: j-horizontal velocity (m s-1) 185 192 USE oce , ONLY : wn => wn !: vertical velocity (m s-1) 186 USE oce , ONLY : tn => tn !: pot. temperature (celsius)187 USE oce , ONLY : sn => sn !: salinity (psu)188 193 USE oce , ONLY : tsn => tsn !: 4D array contaning ( tn, sn ) 189 194 USE oce , ONLY : tsb => tsb !: 4D array contaning ( tb, sb ) … … 192 197 USE oce , ONLY : rhd => rhd !: in situ density anomalie rhd=(rho-rau0)/rau0 (no units) 193 198 USE oce , ONLY : hdivn => hdivn !: horizontal divergence (1/s) 199 USE oce , ONLY : rotn => rotn !: relative vorticity [s-1] 200 USE oce , ONLY : hdivb => hdivb !: horizontal divergence (1/s) 201 USE oce , ONLY : rotb => rotb !: relative vorticity [s-1] 202 USE oce , ONLY : sshn => sshn !: sea surface height at t-point [m] 203 USE oce , ONLY : sshb => sshb !: sea surface height at t-point [m] 204 USE oce , ONLY : ssha => ssha !: sea surface height at t-point [m] 205 USE oce , ONLY : sshu_n => sshu_n !: sea surface height at u-point [m] 206 USE oce , ONLY : sshu_b => sshu_b !: sea surface height at u-point [m] 207 USE oce , ONLY : sshu_a => sshu_a !: sea surface height at u-point [m] 208 USE oce , ONLY : sshv_n => sshv_n !: sea surface height at v-point [m] 209 USE oce , ONLY : sshv_b => sshv_b !: sea surface height at v-point [m] 210 USE oce , ONLY : sshv_a => sshv_a !: sea surface height at v-point [m] 211 USE oce , ONLY : sshf_n => sshf_n !: sea surface height at v-point [m] 194 212 USE oce , ONLY : l_traldf_rot => l_traldf_rot !: rotated laplacian operator for lateral diffusion 195 213 #if defined key_offline … … 198 216 USE oce , ONLY : gru => gru !: 199 217 USE oce , ONLY : grv => grv !: 200 # if defined key_degrad201 USE dommsk , ONLY : facvol => facvol !: volume factor for degradation202 # endif203 204 218 #endif 205 219 … … 212 226 USE sbc_oce , ONLY : qsr => qsr !: penetrative solar radiation (w m-2) 213 227 USE sbc_oce , ONLY : emp => emp !: freshwater budget: volume flux [Kg/m2/s] 228 USE sbc_oce , ONLY : emp_b => emp_b !: freshwater budget: volume flux [Kg/m2/s] 214 229 USE sbc_oce , ONLY : emps => emps !: freshwater budget: concentration/dillution [Kg/m2/s] 215 230 USE sbc_oce , ONLY : rnf => rnf !: river runoff [Kg/m2/s] … … 222 237 USE sbcrnf , ONLY : rnfmsk => rnfmsk !: mixed adv scheme in runoffs vicinity (hori.) 223 238 USE sbcrnf , ONLY : rnfmsk_z => rnfmsk_z !: mixed adv scheme in runoffs vicinity (vert.) 239 USE sbcrnf , ONLY : h_rnf => h_rnf !: river runoff [Kg/m2/s] 224 240 225 241 USE trc_oce 226 242 227 243 !* lateral diffusivity (tracers) * 228 USE ldftra_oce , ONLY : aht0 => aht0 !: horizontal eddy diffusivity for tracers (m2/s) 229 USE ldftra_oce , ONLY : ahtb0 => ahtb0 !: background eddy diffusivity for isopycnal diff. (m2/s) 230 USE ldftra_oce , ONLY : ahtu => ahtu !: lateral diffusivity coef. at u-points 231 USE ldftra_oce , ONLY : ahtv => ahtv !: lateral diffusivity coef. at v-points 232 USE ldftra_oce , ONLY : ahtw => ahtw !: lateral diffusivity coef. at w-points 233 USE ldftra_oce , ONLY : ahtt => ahtt !: lateral diffusivity coef. at t-points 234 USE ldftra_oce , ONLY : aeiv0 => aeiv0 !: eddy induced velocity coefficient (m2/s) 235 USE ldftra_oce , ONLY : aeiu => aeiu !: eddy induced velocity coef. at u-points (m2/s) 236 USE ldftra_oce , ONLY : aeiv => aeiv !: eddy induced velocity coef. at v-points (m2/s) 237 USE ldftra_oce , ONLY : aeiw => aeiw !: eddy induced velocity coef. at w-points (m2/s) 244 USE ldftra_oce , ONLY : rldf => rldf !: multiplicative coef. for lateral diffusivity 245 USE ldftra_oce , ONLY : rn_aht_0 => rn_aht_0 !: horizontal eddy diffusivity for tracers (m2/s) 246 USE ldftra_oce , ONLY : aht0 => aht0 !: horizontal eddy diffusivity for tracers (m2/s) 247 USE ldftra_oce , ONLY : ahtb0 => ahtb0 !: background eddy diffusivity for isopycnal diff. (m2/s) 248 USE ldftra_oce , ONLY : ahtu => ahtu !: lateral diffusivity coef. at u-points 249 USE ldftra_oce , ONLY : ahtv => ahtv !: lateral diffusivity coef. at v-points 250 USE ldftra_oce , ONLY : ahtw => ahtw !: lateral diffusivity coef. at w-points 251 USE ldftra_oce , ONLY : ahtt => ahtt !: lateral diffusivity coef. at t-points 252 USE ldftra_oce , ONLY : aeiv0 => aeiv0 !: eddy induced velocity coefficient (m2/s) 253 USE ldftra_oce , ONLY : aeiu => aeiu !: eddy induced velocity coef. at u-points (m2/s) 254 USE ldftra_oce , ONLY : aeiv => aeiv !: eddy induced velocity coef. at v-points (m2/s) 255 USE ldftra_oce , ONLY : aeiw => aeiw !: eddy induced velocity coef. at w-points (m2/s) 256 USE ldftra_oce , ONLY : lk_traldf_eiv => lk_traldf_eiv !: eddy induced velocity flag 238 257 239 258 !* vertical diffusion * 240 259 USE zdf_oce , ONLY : avt => avt !: vert. diffusivity coef. at w-point for temp 241 260 # if defined key_zdfddm 242 USE zdfddm , ONLY : avs => avs !: salinity vertical diffusivity coeff. at w-point261 USE zdfddm , ONLY : avs => avs !: salinity vertical diffusivity coeff. at w-point 243 262 # endif 244 263 -
trunk/NEMOGCM/NEMO/TOP_SRC/prtctl_trc.F90
r2715 r3294 67 67 INTEGER , INTENT(in), OPTIONAL :: kdim ! k- direction for 4D arrays 68 68 !! 69 REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: zmask, ztab3d70 69 INTEGER :: overlap, jn, js, sind, eind, kdir, j_id 71 70 REAL(wp) :: zsum, zvctl 72 71 CHARACTER (len=20), DIMENSION(jptra) :: cl 73 72 CHARACTER (len=10) :: cl2 74 !!----------------------------------------------------------------------75 76 ALLOCATE( zmask (jpi,jpj,jpk) ) 77 ALLOCATE( ztab3d(jpi,jpj,jpk))73 REAL(wp), POINTER, DIMENSION(:,:,:) :: zmask, ztab3d 74 !!---------------------------------------------------------------------- 75 76 CALL wrk_alloc( jpi, jpj, jpk, zmask, ztab3d ) 78 77 ! ! Arrays, scalars initialization 79 78 overlap = 0 … … 151 150 END DO 152 151 ! 153 DEALLOCATE( zmask ) 154 DEALLOCATE( ztab3d ) 152 CALL wrk_dealloc( jpi, jpj, jpk, zmask, ztab3d ) 155 153 ! 156 154 END SUBROUTINE prt_ctl_trc … … 336 334 INTEGER :: nrecil, nrecjl, nldil, nleil, nldjl, nlejl 337 335 REAL(wp) :: zidom, zjdom ! temporary scalars 338 INTEGER, DIMENSION(:,:), ALLOCATABLE :: iimpptl, ijmpptl, ilcitl, ilcjtl ! temporary workspace 339 !!---------------------------------------------------------------------- 340 336 INTEGER, POINTER, DIMENSION(:,:) :: iimpptl, ijmpptl, ilcitl, ilcjtl ! temporary workspace 337 !!---------------------------------------------------------------------- 338 ! 339 CALL wrk_alloc( isplt, jsplt, ilcitl, ilcjtl, iimpptl, ijmpptl ) 340 ! 341 341 ! Dimension arrays for subdomains 342 342 ! ------------------------------- … … 350 350 ijpj = ( jpjglo-2*jprecj + (jsplt-1) ) / jsplt + 2*jprecj 351 351 352 ALLOCATE( ilcitl (isplt,jsplt) )353 ALLOCATE( ilcjtl (isplt,jsplt) )354 355 352 nrecil = 2 * jpreci 356 353 nrecjl = 2 * jprecj … … 391 388 ! --------------------------- 392 389 393 ALLOCATE( iimpptl(isplt,jsplt) )394 ALLOCATE( ijmpptl(isplt,jsplt) )395 396 390 iimpptl(:,:) = 1 397 391 ijmpptl(:,:) = 1 … … 450 444 nlejtl(js) = nlejl 451 445 END DO 452 453 DEALLOCATE( iimpptl ) 454 DEALLOCATE( ijmpptl ) 455 DEALLOCATE( ilcitl ) 456 DEALLOCATE( ilcjtl ) 446 ! 447 CALL wrk_dealloc( isplt, jsplt, ilcitl, ilcjtl, iimpptl, ijmpptl ) 457 448 ! 458 449 END SUBROUTINE sub_dom -
trunk/NEMOGCM/NEMO/TOP_SRC/trc.F90
r2715 r3294 21 21 PUBLIC trc_alloc ! called by nemogcm.F90 22 22 23 !! passive tracers names and units (read in namelist)24 !! --------------------------------------------------25 CHARACTER(len=12), PUBLIC, DIMENSION(jptra) :: ctrcnm !: tracer name26 CHARACTER(len=12), PUBLIC, DIMENSION(jptra) :: ctrcun !: tracer unit27 CHARACTER(len=80), PUBLIC, DIMENSION(jptra) :: ctrcnl !: tracer long name28 29 30 23 !! parameters for the control of passive tracers 31 24 !! -------------------------------------------------- 32 INTEGER, PUBLIC :: numnat !: the number of the passive tracer NAMELIST 33 LOGICAL, PUBLIC, DIMENSION(jptra) :: lutini !: initialisation from FILE or not (NAMELIST) 34 LOGICAL, PUBLIC, DIMENSION(jptra) :: lutsav !: save the tracer or not 25 INTEGER, PUBLIC :: numnat !: logicla unit for the passive tracer NAMELIST 26 INTEGER, PUBLIC :: numstr !: logical unit for tracer statistics 35 27 36 28 !! passive tracers fields (before,now,after) 37 29 !! -------------------------------------------------- 38 REAL(wp), PUBLIC :: trai!: initial total tracer39 REAL(wp), PUBLIC :: areatot!: total volume40 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION (:,:,:) :: cvol!: volume correction -degrad option-41 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION (:,:,:,:) :: trn!: traceur concentration for now time step42 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION (:,:,:,:) :: tra!: traceur concentration for next time step43 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION (:,:,:,:) :: trb!: traceur concentration for before time step30 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: trai !: initial total tracer 31 REAL(wp), PUBLIC :: areatot !: total volume 32 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,: ) :: cvol !: volume correction -degrad option- 33 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: trn !: traceur concentration for now time step 34 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: tra !: traceur concentration for next time step 35 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: trb !: traceur concentration for before time step 44 36 45 37 !! interpolated gradient 46 38 !!-------------------------------------------------- 47 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION (:,:,:) :: gtru!: hor. gradient at u-points at bottom ocean level48 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION (:,:,:) :: gtrv!: hor. gradient at v-points at bottom ocean level39 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: gtru !: hor. gradient at u-points at bottom ocean level 40 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: gtrv !: hor. gradient at v-points at bottom ocean level 49 41 50 !! passive tracers restart(input and output)42 !! passive tracers (input and output) 51 43 !! ------------------------------------------ 52 LOGICAL , PUBLIC :: ln_rsttr !: boolean term for restart i/o for passive tracers (namelist) 53 LOGICAL , PUBLIC :: lrst_trc !: logical to control the trc restart write 54 INTEGER , PUBLIC :: nn_dttrc !: frequency of step on passive tracers 55 INTEGER , PUBLIC :: nutwrs !: output FILE for passive tracers restart 56 INTEGER , PUBLIC :: nutrst !: logical unit for restart FILE for passive tracers 57 INTEGER , PUBLIC :: nn_rsttr !: control of the time step ( 0 or 1 ) for pass. tr. 58 CHARACTER(len=50), PUBLIC :: cn_trcrst_in !: suffix of pass. tracer restart name (input) 59 CHARACTER(len=50), PUBLIC :: cn_trcrst_out !: suffix of pass. tracer restart name (output) 60 44 LOGICAL , PUBLIC :: ln_rsttr !: boolean term for restart i/o for passive tracers (namelist) 45 LOGICAL , PUBLIC :: lrst_trc !: logical to control the trc restart write 46 INTEGER , PUBLIC :: nn_dttrc !: frequency of step on passive tracers 47 INTEGER , PUBLIC :: nn_writetrc !: time step frequency for concentration outputs (namelist) 48 INTEGER , PUBLIC :: nutwrs !: output FILE for passive tracers restart 49 INTEGER , PUBLIC :: nutrst !: logical unit for restart FILE for passive tracers 50 INTEGER , PUBLIC :: nn_rsttr !: control of the time step ( 0 or 1 ) for pass. tr. 51 CHARACTER(len = 80) , PUBLIC :: cn_trcrst_in !: suffix of pass. tracer restart name (input) 52 CHARACTER(len = 80) , PUBLIC :: cn_trcrst_out !: suffix of pass. tracer restart name (output) 53 REAL(wp) , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: rdttrc !: vertical profile of passive tracer time step 54 LOGICAL , PUBLIC :: ln_trcdta !: Read inputs data from files 55 LOGICAL , PUBLIC :: ln_trcdmp !: internal damping flag 56 INTEGER , PUBLIC :: nittrc000 !: first time step of passive tracers model 57 61 58 !! information for outputs 62 59 !! -------------------------------------------------- 63 INTEGER , PUBLIC :: nn_writetrc !: time step frequency for concentration outputs (namelist) 64 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: rdttrc !: vertical profile of passive tracer time step 65 66 # if defined key_diatrc && ! defined key_iomput 60 TYPE, PUBLIC :: PTRACER !: Passive tracer type 61 CHARACTER(len = 20) :: clsname !: short name 62 CHARACTER(len = 80) :: cllname !: long name 63 CHARACTER(len = 20) :: clunit !: unit 64 LOGICAL :: llinit !: read in a file or not 65 LOGICAL :: llsave !: save the tracer or not 66 END TYPE PTRACER 67 CHARACTER(len = 20), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: ctrcnm !: tracer name 68 CHARACTER(len = 80), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: ctrcln !: trccer field long name 69 CHARACTER(len = 20), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: ctrcun !: tracer unit 70 LOGICAL , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: ln_trc_ini !: Initialisation from data input file 71 LOGICAL , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: ln_trc_wri !: save the tracer or not 72 73 TYPE, PUBLIC :: DIAG !: passive trcacer ddditional diagnostic type 74 CHARACTER(len = 20) :: sname !: short name 75 CHARACTER(len = 80) :: lname !: long name 76 CHARACTER(len = 20) :: units !: unit 77 END TYPE DIAG 78 67 79 !! additional 2D/3D outputs namelist 68 80 !! -------------------------------------------------- 69 INTEGER , PUBLIC :: nn_writedia !: frequency of additional arrays outputs(namelist) 70 CHARACTER(len= 8), PUBLIC, DIMENSION(jpdia2d) :: ctrc2d !: 2d output field name 71 CHARACTER(len= 8), PUBLIC, DIMENSION(jpdia2d) :: ctrc2u !: 2d output field unit 72 CHARACTER(len= 8), PUBLIC, DIMENSION(jpdia3d) :: ctrc3d !: 3d output field name 73 CHARACTER(len= 8), PUBLIC, DIMENSION(jpdia3d) :: ctrc3u !: 3d output field unit 74 CHARACTER(len=80), PUBLIC, DIMENSION(jpdia2d) :: ctrc2l !: 2d output field long name 75 CHARACTER(len=80), PUBLIC, DIMENSION(jpdia3d) :: ctrc3l !: 3d output field long name 76 77 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:, :) :: trc2d !: additional 2d outputs 78 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: trc3d !: additional 3d outputs 79 # endif 80 81 # if defined key_diabio || defined key_trdmld_trc 82 ! !!* namtop_XXX namelist * 83 INTEGER , PUBLIC :: nn_writebio !: time step frequency for biological outputs 84 CHARACTER(len=8 ), PUBLIC, DIMENSION(jpdiabio) :: ctrbio !: biological trends name 85 CHARACTER(len=20), PUBLIC, DIMENSION(jpdiabio) :: ctrbiu !: biological trends unit 86 CHARACTER(len=80), PUBLIC, DIMENSION(jpdiabio) :: ctrbil !: biological trends long name 87 # endif 88 # if defined key_diabio 81 REAL(wp) , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:, :) :: trc2d !: additional 2d outputs array 82 REAL(wp) , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: trc3d !: additional 3d outputs array 83 CHARACTER(len = 20), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: ctrc2d !: 2d field short name 84 CHARACTER(len = 80), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: ctrc2l !: 2d field long name 85 CHARACTER(len = 20), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: ctrc2u !: 2d field unit 86 CHARACTER(len = 20), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: ctrc3d !: 3d field short name 87 CHARACTER(len = 80), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: ctrc3l !: 3d field long name 88 CHARACTER(len = 20), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: ctrc3u !: 3d field unit 89 LOGICAL , PUBLIC :: ln_diatrc !: boolean term for additional diagnostic 90 INTEGER , PUBLIC :: nn_writedia !: frequency of additional outputs 91 89 92 !! Biological trends 90 93 !! ----------------- 91 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: trbio !: biological trends 92 # endif 93 94 95 !! passive tracers data read and at given time_step 96 !! -------------------------------------------------- 97 # if defined key_dtatrc 98 INTEGER , PUBLIC, DIMENSION(jptra) :: numtr !: logical unit for passive tracers data 94 LOGICAL , PUBLIC :: ln_diabio !: boolean term for biological diagnostic 95 INTEGER , PUBLIC :: nn_writebio !: frequency of biological outputs 96 REAL(wp) , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: trbio !: biological trends 97 CHARACTER(len = 20), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: ctrbio !: bio field short name 98 CHARACTER(len = 80), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: ctrbil !: bio field long name 99 CHARACTER(len = 20), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: ctrbiu !: bio field unit 100 101 !! variables to average over physics over passive tracer sub-steps. 102 !! ---------------------------------------------------------------- 103 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: un_tm !: i-horizontal velocity average [m/s] 104 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: vn_tm !: j-horizontal velocity average [m/s] 105 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: tsn_tm !: t/s average [m/s] 106 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: avt_tm !: vertical diffusivity coeff. at w-point [m2/s] 107 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: rhop_tm !: 108 # if defined key_zdfddm 109 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: avs_tm !: vertical double diffusivity coeff. at w-point [m/s] 110 # endif 111 #if defined key_ldfslp 112 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: wslpi_tm !: i-direction slope at u-, w-points 113 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: wslpj_tm !: j-direction slope at u-, w-points 114 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: uslp_tm !: j-direction slope at u-, w-points 115 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: vslp_tm !: j-direction slope at u-, w-points 116 #endif 117 #if defined key_trabbl 118 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: ahu_bbl_tm !: u-, w-points 119 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: ahv_bbl_tm !: j-direction slope at u-, w-points 120 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: utr_bbl_tm !: j-direction slope at u-, w-points 121 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: vtr_bbl_tm !: j-direction slope at u-, w-points 122 #endif 123 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: sshn_tm !: average ssh for the now step [m] 124 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: sshu_n_tm !: average ssh for the now step [m] 125 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: sshv_n_tm !: average ssh for the now step [m] 126 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: sshb_hold !:hold sshb from the beginning of each sub-stepping[m] 127 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: sshu_b_hold !:hold sshb from the beginning of each sub-stepping[m] 128 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: sshv_b_hold !:hold sshb from the beginning of each sub-stepping[m] 129 130 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: rnf_tm !: river runoff 131 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: h_rnf_tm !: depth in metres to the bottom of the relevant grid box 132 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: hmld_tm !: mixed layer depth average [m] 133 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: fr_i_tm !: average ice fraction [m/s] 134 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: emp_tm !: freshwater budget: volume flux [Kg/m2/s] 135 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: emps_tm !: freshwater budget:concentration/dilution [Kg/m2/s] 136 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: emp_b_hold !: hold emp from the beginning of each sub-stepping[m] 137 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: qsr_tm !: solar radiation average [m] 138 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: wndm_tm !: 10m wind average [m] 139 ! 140 #if defined key_traldf_c3d 141 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: ahtt_tm, ahtu_tm, ahtv_tm, ahtw_tm !: ** 3D coefficients ** at T-,U-,V-,W-points 142 #elif defined key_traldf_c2d 143 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: ahtt_tm, ahtu_tm, ahtv_tm, ahtw_tm !: ** 2D coefficients ** at T-,U-,V-,W-points 144 #elif defined key_traldf_c1d 145 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: ahtt_tm, ahtu_tm, ahtv_tm, ahtw_tm !: ** 1D coefficients ** at T-,U-,V-,W-points 146 #else 147 REAL(wp), PUBLIC :: ahtt_tm, ahtu_tm, ahtv_tm, ahtw_tm !: ** 0D coefficients ** at T-,U-,V-,W-points 148 #endif 149 ! 150 #if defined key_traldf_eiv 151 # if defined key_traldf_c3d 152 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: aeiu_tm , aeiv_tm , aeiw_tm !: ** 3D coefficients ** 153 # elif defined key_traldf_c2d 154 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: aeiu_tm , aeiv_tm , aeiw_tm !: ** 2D coefficients ** 155 # elif defined key_traldf_c1d 156 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: aeiu_tm , aeiv_tm, aeiw_tm !: ** 1D coefficients ** 157 # else 158 REAL(wp), PUBLIC :: aeiu_tm , aeiv_tm , aeiw_tm !: ** 0D coefficients ** 159 # endif 160 #endif 161 162 ! Temporary physical arrays for sub_stepping 163 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: tsn_temp 164 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: un_temp,vn_temp,wn_temp !: hold current values of avt, un, vn, wn 165 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: avt_temp, rhop_temp !: hold current values of avt, un, vn, wn 166 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: e3t_temp,e3u_temp,e3v_temp,e3w_temp !: hold current values 167 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: sshn_temp, sshb_temp, ssha_temp, rnf_temp,h_rnf_temp 168 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: sshu_n_temp, sshu_b_temp, sshu_a_temp 169 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: sshf_n_temp 170 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: sshv_n_temp, sshv_b_temp, sshv_a_temp 171 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: hu_temp, hv_temp, hur_temp, hvr_temp 172 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: hdivn_temp, rotn_temp 173 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: hdivb_temp, rotb_temp 174 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: hmld_temp, qsr_temp, fr_i_temp,wndm_temp 175 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: emp_temp, emps_temp, emp_b_temp 176 ! 177 #if defined key_trabbl 178 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: ahu_bbl_temp, ahv_bbl_temp, utr_bbl_temp, vtr_bbl_temp !: hold current values 179 #endif 180 ! 181 #if defined key_ldfslp 182 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: wslpi_temp, wslpj_temp, uslp_temp, vslp_temp !: hold current values 183 #endif 184 ! 185 # if defined key_zdfddm 186 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: avs_temp !: salinity vertical diffusivity coeff. at w-point [m/s] 187 # endif 188 ! 189 #if defined key_traldf_c3d 190 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: ahtt_temp, ahtu_temp, ahtv_temp, ahtw_temp 191 #elif defined key_traldf_c2d 192 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: ahtt_temp, ahtu_temp, ahtv_temp, ahtw_temp 193 #elif defined key_traldf_c1d 194 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: ahtt_temp, ahtu_temp, ahtv_temp, ahtw_temp 195 #else 196 REAL(wp), PUBLIC :: ahtt_temp, ahtu_temp, ahtv_temp, ahtw_temp 197 #endif 198 ! 199 #if defined key_traldf_eiv 200 # if defined key_traldf_c3d 201 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: aeiu_temp , aeiv_temp , aeiw_temp !: ** 3D coefficients ** 202 # elif defined key_traldf_c2d 203 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: aeiu_temp , aeiv_temp , aeiw_temp !: ** 2D coefficients ** 204 # elif defined key_traldf_c1d 205 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: aeiu_temp , aeiv_temp, aeiw_temp !: ** 1D coefficients ** 206 # else 207 REAL(wp), PUBLIC :: aeiu_temp , aeiv_temp , aeiw_temp !: ** 0D coefficients ** 208 # endif 99 209 # endif 100 210 … … 113 223 !!------------------------------------------------------------------- 114 224 ! 115 ALLOCATE( cvol(jpi,jpj,jpk ) , & 116 & trn (jpi,jpj,jpk,jptra) , & 117 & tra (jpi,jpj,jpk,jptra) , & 118 & trb (jpi,jpj,jpk,jptra) , & 119 & gtru(jpi,jpj ,jptra) , gtrv(jpi,jpj,jptra) , & 120 # if defined key_diatrc && ! defined key_iomput 121 & trc2d(jpi,jpj,jpdia2d), trc3d(jpi,jpj,jpk,jpdia3d), & 122 # endif 123 # if defined key_diabio 124 & trbio(jpi,jpj,jpk,jpdiabio), & 125 #endif 126 rdttrc(jpk) , STAT=trc_alloc ) 225 ALLOCATE( trn(jpi,jpj,jpk,jptra), trb(jpi,jpj,jpk,jptra), tra(jpi,jpj,jpk,jptra), & 226 & gtru(jpi,jpj,jpk) , gtrv(jpi,jpj,jpk) , & 227 & cvol(jpi,jpj,jpk) , rdttrc(jpk) , trai(jptra) , & 228 & ctrcnm(jptra) , ctrcln(jptra) , ctrcun(jptra) , & 229 & ln_trc_ini(jptra) , ln_trc_wri(jptra) , STAT = trc_alloc ) 127 230 128 231 IF( trc_alloc /= 0 ) CALL ctl_warn('trc_alloc: failed to allocate arrays') -
trunk/NEMOGCM/NEMO/TOP_SRC/trcdia.F90
r2715 r3294 11 11 !! ! 2008-05 (C. Ethe re-organization) 12 12 !!---------------------------------------------------------------------- 13 #if defined key_top && ! defined key_iomput13 #if defined key_top 14 14 !!---------------------------------------------------------------------- 15 15 !! 'key_top' TOP models … … 25 25 USE par_trc 26 26 USE dianam ! build name of file (routine) 27 USE ioipsl 27 USE ioipsl ! I/O manager 28 USE iom ! I/O manager 29 USE lib_mpp ! MPP library 28 30 29 31 IMPLICIT NONE … … 31 33 32 34 PUBLIC trc_dia ! called by XXX module 33 PUBLIC trc_dia_alloc ! called by nemogcm.F9034 35 35 36 INTEGER :: nit5 !: id for tracer output file … … 41 42 INTEGER , ALLOCATABLE, SAVE, DIMENSION (:) :: ndext50 !: integer arrays for ocean 3D index 42 43 INTEGER , ALLOCATABLE, SAVE, DIMENSION (:) :: ndext51 !: integer arrays for ocean surface index 43 # if defined key_diatrc 44 44 45 INTEGER :: nitd !: id for additional array output file 45 46 INTEGER :: ndepitd !: id for depth mesh 46 47 INTEGER :: nhoritd !: id for horizontal mesh 47 # endif 48 # if defined key_diabio 48 49 49 INTEGER :: nitb !: id. for additional array output file 50 50 INTEGER :: ndepitb !: id for depth mesh 51 51 INTEGER :: nhoritb !: id for horizontal mesh 52 # endif53 52 54 53 !! * Substitutions … … 67 66 !! ** Purpose : output passive tracers fields 68 67 !!--------------------------------------------------------------------- 69 INTEGER, INTENT(in) :: kt ! ocean time-step70 ! 71 INTEGER :: kindic! local integer68 INTEGER, INTENT(in) :: kt ! ocean time-step 69 ! 70 INTEGER :: ierr ! local integer 72 71 !!--------------------------------------------------------------------- 73 72 ! 74 CALL trcdit_wr( kt, kindic ) ! outputs for tracer concentration 75 CALL trcdii_wr( kt, kindic ) ! outputs for additional arrays 76 CALL trcdib_wr( kt, kindic ) ! outputs for biological trends 73 IF( kt == nittrc000 ) THEN 74 ALLOCATE( ndext50(jpij*jpk), ndext51(jpij), STAT=ierr ) 75 IF( ierr > 0 ) THEN 76 CALL ctl_stop( 'STOP', 'trc_diat: unable to allocate arrays' ) ; RETURN 77 ENDIF 78 ENDIF 79 ! 80 IF( .NOT.lk_iomput ) THEN 81 CALL trcdit_wr( kt ) ! outputs for tracer concentration 82 IF( ln_diatrc ) CALL trcdii_wr( kt ) ! outputs for additional arrays 83 IF( ln_diabio ) CALL trcdib_wr( kt ) ! outputs for biological trends 84 ENDIF 77 85 ! 78 86 END SUBROUTINE trc_dia 79 87 80 88 81 SUBROUTINE trcdit_wr( kt , kindic)89 SUBROUTINE trcdit_wr( kt ) 82 90 !!---------------------------------------------------------------------- 83 91 !! *** ROUTINE trcdit_wr *** … … 85 93 !! ** Purpose : Standard output of passive tracer : concentration fields 86 94 !! 87 !! ** Method : At the beginning of the first time step (nit 000), define all95 !! ** Method : At the beginning of the first time step (nittrc000), define all 88 96 !! the NETCDF files and fields for concentration of passive tracer 89 97 !! … … 91 99 !! Each nwritetrc time step, output the instantaneous or mean fields 92 100 !! 93 !! IF kindic <0, output of fields before the model interruption.94 !! IF kindic =0, time step loop95 !! IF kindic >0, output of fields before the time step loop96 101 !!---------------------------------------------------------------------- 97 102 INTEGER, INTENT(in) :: kt ! ocean time-step 98 INTEGER, INTENT(in) :: kindic ! indicator of abnormal termination99 103 ! 100 104 INTEGER :: jn … … 135 139 136 140 ! define time axis 137 itmod = kt - nit 000 + 1141 itmod = kt - nittrc000 + 1 138 142 it = kt 139 iiter = ( nit 000 - 1 ) / nn_dttrc143 iiter = ( nittrc000 - 1 ) / nn_dttrc 140 144 141 145 ! Define NETCDF files and fields at beginning of first time step 142 146 ! -------------------------------------------------------------- 143 147 144 IF(ll_print)WRITE(numout,*)'trcdit_wr kt=',kt ,' kindic ',kindic148 IF(ll_print)WRITE(numout,*)'trcdit_wr kt=',kt 145 149 146 IF( kt == nit000 ) THEN 150 IF( kt == nittrc000 ) THEN 151 152 IF(lwp) THEN ! control print 153 WRITE(numout,*) 154 WRITE(numout,*) ' frequency of outputs for passive tracers nn_writetrc = ', nn_writetrc 155 DO jn = 1, jptra 156 IF( ln_trc_wri(jn) ) WRITE(numout,*) ' ouput tracer nb : ', jn, ' short name : ', ctrcnm(jn) 157 END DO 158 WRITE(numout,*) ' ' 159 ENDIF 147 160 148 161 ! Compute julian date from starting date of the run … … 150 163 zjulian = zjulian - adatrj ! set calendar origin to the beginning of the experiment 151 164 IF(lwp)WRITE(numout,*)' ' 152 IF(lwp)WRITE(numout,*)' Date 0 used :', nit 000 &165 IF(lwp)WRITE(numout,*)' Date 0 used :', nittrc000 & 153 166 & ,' YEAR ', nyear, ' MONTH ', nmonth, ' DAY ', nday & 154 167 & ,'Julian day : ', zjulian … … 182 195 ! Declare all the output fields as NETCDF variables 183 196 DO jn = 1, jptra 184 IF( l utsav(jn) ) THEN197 IF( ln_trc_wri(jn) ) THEN 185 198 cltra = TRIM( ctrcnm(jn) ) ! short title for tracer 186 cltral = TRIM( ctrc nl(jn) ) ! long title for tracer199 cltral = TRIM( ctrcln(jn) ) ! long title for tracer 187 200 cltrau = TRIM( ctrcun(jn) ) ! UNIT for tracer 188 201 CALL histdef( nit5, cltra, cltral, cltrau, jpi, jpj, nhorit5, & … … 209 222 DO jn = 1, jptra 210 223 cltra = TRIM( ctrcnm(jn) ) ! short title for tracer 211 IF( l utsav(jn) ) CALL histwrite( nit5, cltra, it, trn(:,:,:,jn), ndimt50, ndext50 )224 IF( ln_trc_wri(jn) ) CALL histwrite( nit5, cltra, it, trn(:,:,:,jn), ndimt50, ndext50 ) 212 225 END DO 213 226 214 227 ! close the file 215 228 ! -------------- 216 IF( kt == nitend .OR. kindic < 0) CALL histclo( nit5 )229 IF( kt == nitend ) CALL histclo( nit5 ) 217 230 ! 218 231 END SUBROUTINE trcdit_wr 219 232 220 #if defined key_diatrc 221 222 SUBROUTINE trcdii_wr( kt, kindic ) 233 SUBROUTINE trcdii_wr( kt ) 223 234 !!---------------------------------------------------------------------- 224 235 !! *** ROUTINE trcdii_wr *** … … 226 237 !! ** Purpose : output of passive tracer : additional 2D and 3D arrays 227 238 !! 228 !! ** Method : At the beginning of the first time step (nit 000), define all239 !! ** Method : At the beginning of the first time step (nittrc000), define all 229 240 !! the NETCDF files and fields for concentration of passive tracer 230 241 !! … … 232 243 !! Each nn_writedia time step, output the instantaneous or mean fields 233 244 !! 234 !! IF kindic <0, output of fields before the model interruption.235 !! IF kindic =0, time step loop236 !! IF kindic >0, output of fields before the time step loop237 245 !!---------------------------------------------------------------------- 238 246 INTEGER, INTENT(in) :: kt ! ocean time-step 239 INTEGER, INTENT(in) :: kindic ! indicator of abnormal termination240 247 !! 241 248 LOGICAL :: ll_print = .FALSE. … … 275 282 276 283 ! define time axis 277 itmod = kt - nit 000 + 1284 itmod = kt - nittrc000 + 1 278 285 it = kt 279 iiter = ( nit 000 - 1 ) / nn_dttrc286 iiter = ( nittrc000 - 1 ) / nn_dttrc 280 287 281 288 ! 1. Define NETCDF files and fields at beginning of first time step 282 289 ! ----------------------------------------------------------------- 283 290 284 IF( ll_print ) WRITE(numout,*) 'trcdii_wr kt=', kt , ' kindic ', kindic285 286 IF( kt == nit 000 ) THEN291 IF( ll_print ) WRITE(numout,*) 'trcdii_wr kt=', kt 292 293 IF( kt == nittrc000 ) THEN 287 294 288 295 ! Define the NETCDF files for additional arrays : 2D or 3D … … 356 363 ! Closing all files 357 364 ! ----------------- 358 IF( kt == nitend .OR. kindic < 0) CALL histclo(nitd)365 IF( kt == nitend ) CALL histclo(nitd) 359 366 ! 360 367 361 368 END SUBROUTINE trcdii_wr 362 369 363 # else 364 SUBROUTINE trcdii_wr( kt, kindic ) ! Dummy routine 365 INTEGER, INTENT (in) :: kt, kindic 366 END SUBROUTINE trcdii_wr 367 # endif 368 369 # if defined key_diabio 370 371 SUBROUTINE trcdib_wr( kt, kindic ) 370 SUBROUTINE trcdib_wr( kt ) 372 371 !!---------------------------------------------------------------------- 373 372 !! *** ROUTINE trcdib_wr *** … … 375 374 !! ** Purpose : output of passive tracer : biological fields 376 375 !! 377 !! ** Method : At the beginning of the first time step (nit 000), define all376 !! ** Method : At the beginning of the first time step (nittrc000), define all 378 377 !! the NETCDF files and fields for concentration of passive tracer 379 378 !! … … 381 380 !! Each nn_writebio time step, output the instantaneous or mean fields 382 381 !! 383 !! IF kindic <0, output of fields before the model interruption.384 !! IF kindic =0, time step loop385 !! IF kindic >0, output of fields before the time step loop386 382 !!---------------------------------------------------------------------- 387 383 INTEGER, INTENT( in ) :: kt ! ocean time-step 388 INTEGER, INTENT( in ) :: kindic ! indicator of abnormal termination389 384 !! 390 385 LOGICAL :: ll_print = .FALSE. … … 424 419 425 420 ! define time axis 426 itmod = kt - nit 000 + 1421 itmod = kt - nittrc000 + 1 427 422 it = kt 428 iiter = ( nit 000 - 1 ) / nn_dttrc423 iiter = ( nittrc000 - 1 ) / nn_dttrc 429 424 430 425 ! Define NETCDF files and fields at beginning of first time step 431 426 ! -------------------------------------------------------------- 432 427 433 IF(ll_print) WRITE(numout,*)'trcdib_wr kt=',kt ,' kindic ',kindic434 435 IF( kt == nit 000 ) THEN428 IF(ll_print) WRITE(numout,*)'trcdib_wr kt=',kt 429 430 IF( kt == nittrc000 ) THEN 436 431 437 432 ! Define the NETCDF files for biological trends … … 481 476 ! Closing all files 482 477 ! ----------------- 483 IF( kt == nitend .OR. kindic < 0) CALL histclo( nitb )478 IF( kt == nitend ) CALL histclo( nitb ) 484 479 ! 485 480 END SUBROUTINE trcdib_wr 486 481 487 # else488 489 SUBROUTINE trcdib_wr( kt, kindic ) ! Dummy routine490 INTEGER, INTENT ( in ) :: kt, kindic491 END SUBROUTINE trcdib_wr492 493 # endif494 495 INTEGER FUNCTION trc_dia_alloc()496 !!---------------------------------------------------------------------497 !! *** ROUTINE trc_dia_alloc ***498 !!---------------------------------------------------------------------499 ALLOCATE( ndext50(jpij*jpk), ndext51(jpij), STAT=trc_dia_alloc )500 !501 IF( trc_dia_alloc /= 0 ) CALL ctl_warn('trc_dia_alloc : failed to allocate arrays')502 !503 END FUNCTION trc_dia_alloc504 482 #else 505 483 !!---------------------------------------------------------------------- -
trunk/NEMOGCM/NEMO/TOP_SRC/trcdta.F90
r2715 r3294 7 7 !! - ! 2004-03 (C. Ethe) module 8 8 !! - ! 2005-03 (O. Aumont, A. El Moussaoui) F90 9 !!---------------------------------------------------------------------- 10 #if defined key_top && defined key_dtatrc 11 !!---------------------------------------------------------------------- 12 !! 'key_top' and 'key_dtatrc' TOP model + passive tracer data 13 !!---------------------------------------------------------------------- 14 !! trc_dta : read ocean passive tracer data 15 !!---------------------------------------------------------------------- 16 USE oce_trc 17 USE par_trc 18 USE trc 19 USE lib_print 20 USE iom 9 !! 3.4 ! 2010-11 (C. Ethe, G. Madec) use of fldread + dynamical allocation 10 !!---------------------------------------------------------------------- 11 #if defined key_top 12 !!---------------------------------------------------------------------- 13 !! 'key_top' TOP model 14 !!---------------------------------------------------------------------- 15 !! trc_dta : read and time interpolated passive tracer data 16 !!---------------------------------------------------------------------- 17 USE par_trc ! passive tracers parameters 18 USE oce_trc ! shared variables between ocean and passive tracers 19 USE trc ! passive tracers common variables 20 USE iom ! I/O manager 21 USE lib_mpp ! MPP library 22 USE fldread ! read input fields 21 23 22 24 IMPLICIT NONE … … 24 26 25 27 PUBLIC trc_dta ! called in trcini.F90 and trcdmp.F90 26 PUBLIC trc_dta_alloc ! called in nemogcm.F90 27 28 LOGICAL , PUBLIC, PARAMETER :: lk_dtatrc = .TRUE. !: temperature data flag 29 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: trdta !: tracer data at given time-step 30 31 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:,:,:) :: tracdta ! tracer data at two consecutive times 32 INTEGER , ALLOCATABLE, SAVE, DIMENSION(:) :: nlectr !: switch for reading once 33 INTEGER , ALLOCATABLE, SAVE, DIMENSION(:) :: ntrc1 !: number of 1st month when reading 12 monthly value 34 INTEGER , ALLOCATABLE, SAVE, DIMENSION(:) :: ntrc2 !: number of 2nd month when reading 12 monthly value 28 PUBLIC trc_dta_init ! called in trcini.F90 29 30 INTEGER , SAVE, PUBLIC :: nb_trcdta ! number of tracers to be initialised with data 31 INTEGER , SAVE, PUBLIC, ALLOCATABLE, DIMENSION(:) :: n_trc_index ! indice of tracer which is initialised with data 32 INTEGER , SAVE :: ntra ! MAX( 1, nb_trcdta ) to avoid compilation error with bounds checking 33 REAL(wp) , SAVE, ALLOCATABLE, DIMENSION(:) :: rf_trfac ! multiplicative factor for tracer values 34 TYPE(FLD), SAVE, ALLOCATABLE, DIMENSION(:) :: sf_trcdta ! structure of input SST (file informations, fields read) 35 35 36 36 !! * Substitutions 37 # include " top_substitute.h90"38 !!---------------------------------------------------------------------- 39 !! NEMO/ TOP3.3 , NEMO Consortium (2010)37 # include "domzgr_substitute.h90" 38 !!---------------------------------------------------------------------- 39 !! NEMO/OPA 3.3 , NEMO Consortium (2010) 40 40 !! $Id$ 41 41 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) … … 43 43 CONTAINS 44 44 45 SUBROUTINE trc_dta( kt ) 45 SUBROUTINE trc_dta_init 46 !!---------------------------------------------------------------------- 47 !! *** ROUTINE trc_dta_init *** 48 !! 49 !! ** Purpose : initialisation of passive tracer input data 50 !! 51 !! ** Method : - Read namtsd namelist 52 !! - allocates passive tracer data structure 53 !!---------------------------------------------------------------------- 54 ! 55 INTEGER :: jl, jn ! dummy loop indicies 56 INTEGER :: ierr0, ierr1, ierr2, ierr3 ! temporary integers 57 CHARACTER(len=100) :: clndta, clntrc 58 REAL(wp) :: zfact 59 ! 60 CHARACTER(len=100) :: cn_dir 61 TYPE(FLD_N), DIMENSION(jptra) :: slf_i ! array of namelist informations on the fields to read 62 TYPE(FLD_N), DIMENSION(jptra) :: sn_trcdta 63 REAL(wp) , DIMENSION(jptra) :: rn_trfac ! multiplicative factor for tracer values 64 !! 65 NAMELIST/namtrc_dta/ sn_trcdta, cn_dir, rn_trfac 66 !!---------------------------------------------------------------------- 67 ! 68 IF( nn_timing == 1 ) CALL timing_start('trc_dta_init') 69 ! 70 ! Initialisation 71 ierr0 = 0 ; ierr1 = 0 ; ierr2 = 0 ; ierr3 = 0 72 ! Compute the number of tracers to be initialised with data 73 ALLOCATE( n_trc_index(jptra), STAT=ierr0 ) 74 IF( ierr0 > 0 ) THEN 75 CALL ctl_stop( 'trc_nam: unable to allocate n_trc_index' ) ; RETURN 76 ENDIF 77 nb_trcdta = 0 78 n_trc_index(:) = 0 79 DO jn = 1, jptra 80 IF( ln_trc_ini(jn) ) THEN 81 nb_trcdta = nb_trcdta + 1 82 n_trc_index(jn) = nb_trcdta 83 ENDIF 84 ENDDO 85 ! 86 ntra = MAX( 1, nb_trcdta ) ! To avoid compilation error with bounds checking 87 WRITE(numout,*) ' ' 88 WRITE(numout,*) ' number of passive tracers to be initialize by data :', ntra 89 WRITE(numout,*) ' ' 90 ! ! allocate the arrays (if necessary) 91 ! 92 cn_dir = './' ! directory in which the model is executed 93 DO jn = 1, jptra 94 WRITE( clndta,'("TR_",I1)' ) jn 95 clndta = TRIM( clndta ) 96 ! ! file ! frequency ! variable ! time intep ! clim ! 'yearly' or ! weights ! rotation ! 97 ! ! name ! (hours) ! name ! (T/F) ! (T/F) ! 'monthly' ! filename ! pairs ! 98 sn_trcdta(jn) = FLD_N( clndta , -1 , clndta , .false. , .true. , 'monthly' , '' , '' ) 99 ! 100 rn_trfac(jn) = 1._wp 101 END DO 102 ! 103 REWIND( numnat ) ! read nattrc 104 READ ( numnat, namtrc_dta ) 105 106 IF( lwp ) THEN 107 DO jn = 1, jptra 108 IF( ln_trc_ini(jn) ) THEN ! open input file only if ln_trc_ini(jn) is true 109 clndta = TRIM( sn_trcdta(jn)%clvar ) 110 clntrc = TRIM( ctrcnm (jn) ) 111 zfact = rn_trfac(jn) 112 IF( clndta /= clntrc ) THEN 113 CALL ctl_warn( 'trc_dta_init: passive tracer data initialisation : ', & 114 & 'the variable name in the data file : '//clndta// & 115 & ' must be the same than the name of the passive tracer : '//clntrc//' ') 116 ENDIF 117 WRITE(numout,*) ' read an initial file for passive tracer number :', jn, ' name : ', clndta, & 118 & ' multiplicative factor : ', zfact 119 ENDIF 120 END DO 121 ENDIF 122 ! 123 IF( nb_trcdta > 0 ) THEN ! allocate only if the number of tracer to initialise is greater than zero 124 ALLOCATE( sf_trcdta(nb_trcdta), rf_trfac(nb_trcdta), STAT=ierr1 ) 125 IF( ierr1 > 0 ) THEN 126 CALL ctl_stop( 'trc_dta_ini: unable to allocate sf_trcdta structure' ) ; RETURN 127 ENDIF 128 ! 129 DO jn = 1, jptra 130 IF( ln_trc_ini(jn) ) THEN ! update passive tracers arrays with input data read from file 131 jl = n_trc_index(jn) 132 slf_i(jl) = sn_trcdta(jn) 133 rf_trfac(jl) = rn_trfac(jn) 134 ALLOCATE( sf_trcdta(jl)%fnow(jpi,jpj,jpk) , STAT=ierr2 ) 135 IF( sn_trcdta(jn)%ln_tint ) ALLOCATE( sf_trcdta(jl)%fdta(jpi,jpj,jpk,2) , STAT=ierr3 ) 136 IF( ierr2 + ierr3 > 0 ) THEN 137 CALL ctl_stop( 'trc_dta : unable to allocate passive tracer data arrays' ) ; RETURN 138 ENDIF 139 ENDIF 140 ! 141 ENDDO 142 ! ! fill sf_trcdta with slf_i and control print 143 CALL fld_fill( sf_trcdta, slf_i, cn_dir, 'trc_dta', 'Passive tracer data', 'namtrc' ) 144 ! 145 ENDIF 146 ! 147 IF( nn_timing == 1 ) CALL timing_stop('trc_dta_init') 148 ! 149 END SUBROUTINE trc_dta_init 150 151 152 SUBROUTINE trc_dta( kt, ptrc ) 46 153 !!---------------------------------------------------------------------- 47 154 !! *** ROUTINE trc_dta *** 155 !! 156 !! ** Purpose : provides passive tracer data at kt 157 !! 158 !! ** Method : - call fldread routine 159 !! - s- or mixed z-s coordinate: vertical interpolation on model mesh 160 !! - ln_trcdmp=F: deallocates the data structure as they are not used 48 161 !! 49 !! ** Purpose : Reads passive tracer data (Levitus monthly data) 50 !! 51 !! ** Method : Read on unit numtr the interpolated tracer concentra- 52 !! tion onto the global grid. Data begin at january. 53 !! The value is centered at the middle of month. 54 !! In the opa model, kt=1 agree with january 1. 55 !! At each time step, a linear interpolation is applied between 56 !! two monthly values. 57 !!---------------------------------------------------------------------- 58 INTEGER, INTENT(in) :: kt ! ocean time-step 59 !! 60 CHARACTER (len=39) :: clname(jptra) 61 INTEGER, PARAMETER :: jpmonth = 12 ! number of months 62 INTEGER :: ji, jj, jn, jl 63 INTEGER :: imois, iman, i15, ik ! temporary integers 64 REAL(wp) :: zxy, zl 65 !!gm HERE the daymod should be used instead of computation of month and co !! 66 !!gm better in case of real calandar and leap-years ! 67 !!---------------------------------------------------------------------- 68 69 DO jn = 1, jptra 70 71 IF( lutini(jn) ) THEN 72 73 IF ( kt == nit000 ) THEN 74 !! 3D tracer data 75 IF(lwp)WRITE(numout,*) 76 IF(lwp)WRITE(numout,*) ' dta_trc: reading tracer' 77 IF(lwp)WRITE(numout,*) ' data file ', jn, ctrcnm(jn) 78 IF(lwp)WRITE(numout,*) 79 nlectr(jn) = 0 162 !! ** Action : ptrc passive tracer data on medl mesh and interpolated at time-step kt 163 !!---------------------------------------------------------------------- 164 INTEGER , INTENT(in ) :: kt ! ocean time-step 165 REAL(wp), DIMENSION(:,:,:,:), INTENT( out) :: ptrc ! passive tracer data 166 ! 167 INTEGER :: ji, jj, jk, jl, jn, jkk, ik ! dummy loop indicies 168 REAL(wp):: zl, zi 169 REAL(wp), DIMENSION(jpk) :: ztp ! 1D workspace 170 CHARACTER(len=100) :: clndta 171 !!---------------------------------------------------------------------- 172 ! 173 IF( nn_timing == 1 ) CALL timing_start('trc_dta') 174 ! 175 IF( nb_trcdta > 0 ) THEN 176 ! 177 CALL fld_read( kt, 1, sf_trcdta ) !== read data at kt time step ==! 178 ! 179 DO jn = 1, ntra 180 ptrc(:,:,:,jn) = sf_trcdta(jn)%fnow(:,:,:) ! NO mask 181 ENDDO 182 ! 183 IF( ln_sco ) THEN !== s- or mixed s-zps-coordinate ==! 184 ! 185 IF( kt == nit000 .AND. lwp )THEN 186 WRITE(numout,*) 187 WRITE(numout,*) 'trc_dta: interpolates passive tracer data onto the s- or mixed s-z-coordinate mesh' 80 188 ENDIF 81 ! Initialization 82 iman = jpmonth 83 i15 = nday / 16 84 imois = nmonth + i15 -1 85 IF( imois == 0 ) imois = iman 86 87 88 ! First call kt=nit000 89 ! -------------------- 90 91 IF ( kt == nit000 .AND. nlectr(jn) == 0 ) THEN 92 ntrc1(jn) = 0 93 IF(lwp) WRITE(numout,*) ' trc_dta : Levitus tracer data monthly fields' 94 ! open file 95 # if defined key_pisces 96 clname(jn) = 'data_1m_'//TRIM(ctrcnm(jn))//'_nomask' 97 # else 98 clname(jn) = TRIM(ctrcnm(jn)) 99 # endif 100 CALL iom_open ( clname(jn), numtr(jn) ) 101 102 ENDIF 103 104 # if defined key_pisces 105 ! Read montly file 106 IF( ( kt == nit000 .AND. nlectr(jn) == 0) .OR. imois /= ntrc1(jn) ) THEN 107 nlectr(jn) = 1 108 109 ! Calendar computation 110 111 ! ntrc1 number of the first file record used in the simulation 112 ! ntrc2 number of the last file record 113 114 ntrc1(jn) = imois 115 ntrc2(jn) = ntrc1(jn) + 1 116 ntrc1(jn) = MOD( ntrc1(jn), iman ) 117 IF ( ntrc1(jn) == 0 ) ntrc1(jn) = iman 118 ntrc2(jn) = MOD( ntrc2(jn), iman ) 119 IF ( ntrc2(jn) == 0 ) ntrc2(jn) = iman 120 IF(lwp) WRITE(numout,*) 'first record file used ntrc1 ', ntrc1(jn) 121 IF(lwp) WRITE(numout,*) 'last record file used ntrc2 ', ntrc2(jn) 122 123 ! Read montly passive tracer data Levitus 124 125 CALL iom_get ( numtr(jn), jpdom_data, ctrcnm(jn), tracdta(:,:,:,jn,1), ntrc1(jn) ) 126 CALL iom_get ( numtr(jn), jpdom_data, ctrcnm(jn), tracdta(:,:,:,jn,2), ntrc2(jn) ) 127 128 IF(lwp) THEN 129 WRITE(numout,*) 130 WRITE(numout,*) ' read tracer data ', ctrcnm(jn),' ok' 131 WRITE(numout,*) 189 ! 190 DO jn = 1, ntra 191 DO jj = 1, jpj ! vertical interpolation of T & S 192 DO ji = 1, jpi 193 DO jk = 1, jpk ! determines the intepolated T-S profiles at each (i,j) points 194 zl = fsdept_0(ji,jj,jk) 195 IF( zl < gdept_0(1 ) ) THEN ! above the first level of data 196 ztp(jk) = ptrc(ji,jj,1 ,jn) 197 ELSEIF( zl > gdept_0(jpk) ) THEN ! below the last level of data 198 ztp(jk) = ptrc(ji,jj,jpkm1,jn) 199 ELSE ! inbetween : vertical interpolation between jkk & jkk+1 200 DO jkk = 1, jpkm1 ! when gdept(jkk) < zl < gdept(jkk+1) 201 IF( (zl-gdept_0(jkk)) * (zl-gdept_0(jkk+1)) <= 0._wp ) THEN 202 zi = ( zl - gdept_0(jkk) ) / (gdept_0(jkk+1)-gdept_0(jkk)) 203 ztp(jk) = ptrc(ji,jj,jkk,jn) + ( ptrc(ji,jj,jkk+1,jn) - ptrc(ji,jj,jkk,jn) ) * zi 204 ENDIF 205 END DO 206 ENDIF 207 END DO 208 DO jk = 1, jpkm1 209 ptrc(ji,jj,jk,jn) = ztp(jk) * tmask(ji,jj,jk) ! mask required for mixed zps-s-coord 210 END DO 211 ptrc(ji,jj,jpk,jn) = 0._wp 212 END DO 213 END DO 214 ENDDO 215 ! 216 ELSE !== z- or zps- coordinate ==! 217 ! 218 DO jn = 1, ntra 219 ptrc(:,:,:,jn) = ptrc(:,:,:,jn) * tmask(:,:,:) ! Mask 220 ! 221 IF( ln_zps ) THEN ! zps-coordinate (partial steps) interpolation at the last ocean level 222 DO jj = 1, jpj 223 DO ji = 1, jpi 224 ik = mbkt(ji,jj) 225 IF( ik > 1 ) THEN 226 zl = ( gdept_0(ik) - fsdept_0(ji,jj,ik) ) / ( gdept_0(ik) - gdept_0(ik-1) ) 227 ptrc(ji,jj,ik,jn) = (1.-zl) * ptrc(ji,jj,ik,jn) + zl * ptrc(ji,jj,ik-1,jn) 228 ENDIF 229 END DO 230 END DO 132 231 ENDIF 133 134 ! Apply Mask 135 DO jl = 1, 2 136 tracdta(:,:,: ,jn,jl) = tracdta(:,:,:,jn,jl) * tmask(:,:,:) 137 tracdta(:,:,jpk,jn,jl) = 0. 138 IF( ln_zps ) THEN ! z-coord. with partial steps 139 DO jj = 1, jpj ! interpolation of temperature at the last level 140 DO ji = 1, jpi 141 ik = mbkt(ji,jj) 142 IF( ik > 2 ) THEN 143 zl = ( gdept_0(ik) - fsdept_0(ji,jj,ik) ) / ( gdept_0(ik) - gdept_0(ik-1) ) 144 tracdta(ji,jj,ik,jn,jl) = (1.-zl) * tracdta(ji,jj,ik ,jn,jl) & 145 & + zl * tracdta(ji,jj,ik-1,jn,jl) 146 ENDIF 147 END DO 148 END DO 149 ENDIF 150 151 END DO 152 153 ENDIF 154 155 IF(lwp) THEN 156 WRITE(numout,*) ctrcnm(jn), 'Levitus month ', ntrc1(jn), ntrc2(jn) 232 ENDDO 233 ! 234 ENDIF 235 ! 236 DO jn = 1, ntra 237 ptrc(:,:,:,jn) = ptrc(:,:,:,jn) * rf_trfac(jn) ! multiplicative factor 238 ENDDO 239 ! 240 IF( lwp .AND. kt == nit000 ) THEN 241 DO jn = 1, ntra 242 clndta = TRIM( sf_trcdta(jn)%clvar ) 243 WRITE(numout,*) ''//clndta//' data ' 157 244 WRITE(numout,*) 158 WRITE(numout,*) ' Levitus month = ', ntrc1(jn), ' level = 1' 159 CALL prihre( tracdta(1,1,1,jn,1), jpi, jpj, 1, jpi, 20, 1 & 160 & ,jpj, 20, 1., numout ) 161 WRITE(numout,*) ' Levitus month = ', ntrc1(jn), ' level = ',jpk/2 162 CALL prihre( tracdta(1,1,jpk/2,jn,1), jpi, jpj, 1, jpi, & 163 & 20, 1, jpj, 20, 1., numout ) 164 WRITE(numout,*) ' Levitus month = ',ntrc1(jn),' level = ',jpkm1 165 CALL prihre( tracdta(1,1,jpkm1,jn,1), jpi, jpj, 1, jpi, & 166 & 20, 1, jpj, 20, 1., numout ) 167 ENDIF 168 169 ! At every time step compute temperature data 170 zxy = FLOAT( nday + 15 - 30 * i15 ) / 30. 171 trdta(:,:,:,jn) = ( 1. - zxy ) * tracdta(:,:,:,jn,1) & 172 & + zxy * tracdta(:,:,:,jn,2) 173 174 IF( jn == jpno3 ) trdta(:,:,:,jn) = trdta(:,:,:,jn) * 7.6e-6 175 IF( jn == jpdic ) trdta(:,:,:,jn) = trdta(:,:,:,jn) * 1.0e-6 176 IF( jn == jptal ) trdta(:,:,:,jn) = trdta(:,:,:,jn) * 1.0e-6 177 IF( jn == jpoxy ) trdta(:,:,:,jn) = trdta(:,:,:,jn) * 44.6e-6 178 IF( jn == jpsil ) trdta(:,:,:,jn) = trdta(:,:,:,jn) * 1.0e-6 179 IF( jn == jppo4 ) trdta(:,:,:,jn) = trdta(:,:,:,jn) * 122.0e-6 180 181 ! Close the file 182 ! -------------- 183 184 IF( kt == nitend ) CALL iom_close( numtr(jn) ) 185 186 # else 187 ! Read init file only 188 IF( kt == nit000 ) THEN 189 ntrc1(jn) = 1 190 CALL iom_get ( numtr(jn), jpdom_data, ctrcnm(jn), trdta(:,:,:,jn), ntrc1(jn) ) 191 trdta(:,:,:,jn) = trdta(:,:,:,jn) * tmask(:,:,:) 192 CALL iom_close ( numtr(jn) ) 193 ENDIF 194 # endif 195 ENDIF 196 197 END DO 245 WRITE(numout,*)' level = 1' 246 CALL prihre( ptrc(:,:,1 ,jn), jpi, jpj, 1, jpi, 20, 1, jpj, 20, 1., numout ) 247 WRITE(numout,*)' level = ', jpk/2 248 CALL prihre( ptrc(:,:,jpk/2,jn), jpi, jpj, 1, jpi, 20, 1, jpj, 20, 1., numout ) 249 WRITE(numout,*)' level = ', jpkm1 250 CALL prihre( ptrc(:,:,jpkm1,jn), jpi, jpj, 1, jpi, 20, 1, jpj, 20, 1., numout ) 251 WRITE(numout,*) 252 ENDDO 253 ENDIF 254 ! 255 IF( .NOT.ln_trcdmp ) THEN !== deallocate data structure ==! 256 ! (data used only for initialisation) 257 IF(lwp) WRITE(numout,*) 'trc_dta: deallocate data arrays as they are only use to initialize the run' 258 DO jn = 1, ntra 259 DEALLOCATE( sf_trcdta(jn)%fnow ) ! arrays in the structure 260 IF( sf_trcdta(jn)%ln_tint ) DEALLOCATE( sf_trcdta(jn)%fdta ) 261 ENDDO 262 DEALLOCATE( sf_trcdta ) ! the structure itself 263 ! 264 ENDIF 265 ! 266 ENDIF 267 ! 268 IF( nn_timing == 1 ) CALL timing_stop('trc_dta') 198 269 ! 199 270 END SUBROUTINE trc_dta 200 201 202 INTEGER FUNCTION trc_dta_alloc()203 !!----------------------------------------------------------------------204 !! *** ROUTINE trc_dta_alloc ***205 !!----------------------------------------------------------------------206 ALLOCATE( trdta (jpi,jpj,jpk,jptra ) , &207 & tracdta(jpi,jpj,jpk,jptra,2) , &208 & nlectr(jptra) , ntrc1(jptra) , ntrc2(jptra) , STAT=trc_dta_alloc)209 !210 IF( trc_dta_alloc /= 0 ) CALL ctl_warn('trc_dta_alloc : failed to allocate arrays')211 !212 END FUNCTION trc_dta_alloc213 214 271 #else 215 272 !!---------------------------------------------------------------------- 216 273 !! Dummy module NO 3D passive tracer data 217 274 !!---------------------------------------------------------------------- 218 LOGICAL , PUBLIC, PARAMETER :: lk_dtatrc = .FALSE. !: temperature data flag219 275 CONTAINS 220 276 SUBROUTINE trc_dta( kt ) ! Empty routine … … 222 278 END SUBROUTINE trc_dta 223 279 #endif 224 225 280 !!====================================================================== 226 281 END MODULE trcdta -
trunk/NEMOGCM/NEMO/TOP_SRC/trcini.F90
r2715 r3294 16 16 !! top_alloc : allocate the TOP arrays 17 17 !!---------------------------------------------------------------------- 18 USE oce_trc 19 USE trc 20 USE trcrst 18 USE oce_trc ! shared variables between ocean and passive tracers 19 USE trc ! passive tracers common variables 20 USE trcrst ! passive tracers restart 21 21 USE trcnam ! Namelist read 22 22 USE trcini_cfc ! CFC initialisation … … 25 25 USE trcini_c14b ! C14 bomb initialisation 26 26 USE trcini_my_trc ! MY_TRC initialisation 27 USE trcdta 28 USE daymod 27 USE trcdta ! initialisation form files 28 USE daymod ! calendar manager 29 29 USE zpshde ! partial step: hor. derivative (zps_hde routine) 30 30 USE prtctl_trc ! Print control passive tracers (prt_ctl_trc_init routine) 31 USE trcsub ! variables to substep passive tracers 31 32 32 33 IMPLICIT NONE … … 56 57 !! or read data or analytical formulation 57 58 !!--------------------------------------------------------------------- 58 INTEGER :: jk, jn ! dummy loop indices59 INTEGER :: jk, jn, jl ! dummy loop indices 59 60 CHARACTER (len=25) :: charout 61 REAL(wp), POINTER, DIMENSION(:,:,:,:) :: ztrcdta ! 4D workspace 60 62 !!--------------------------------------------------------------------- 61 63 ! 64 IF( nn_timing == 1 ) CALL timing_start('trc_init') 65 ! 62 66 IF(lwp) WRITE(numout,*) 63 67 IF(lwp) WRITE(numout,*) 'trc_init : initial set up of the passive tracers' … … 66 70 CALL top_alloc() ! allocate TOP arrays 67 71 68 ! ! masked grid volume 69 DO jk = 1, jpk 70 cvol(:,:,jk) = e1t(:,:) * e2t(:,:) * fse3t(:,:,jk) * tmask(:,:,jk) 71 END DO 72 73 ! ! total volume of the ocean 74 #if ! defined key_degrad 75 areatot = glob_sum( cvol(:,:,:) ) 76 #else 77 areatot = glob_sum( cvol(:,:,:) * facvol(:,:,:) ) ! degrad option: reduction by facvol 78 #endif 72 IF( ln_dm2dc .AND. ( lk_pisces .OR. lk_lobster ) ) & 73 & CALL ctl_stop( ' The diurnal cycle is not compatible with PISCES or LOBSTER ' ) 74 75 IF( nn_cla == 1 ) & 76 & CALL ctl_stop( ' Cross Land Advection not yet implemented with passive tracer ; nn_cla must be 0' ) 79 77 80 78 CALL trc_nam ! read passive tracers namelists 81 82 ! ! restart for passive tracer (input)79 ! 80 IF(lwp) WRITE(numout,*) 83 81 IF( ln_rsttr ) THEN 84 IF(lwp) WRITE(numout,*) ' read a restart file for passive tracer : ', cn_trcrst_in85 IF(lwp) WRITE(numout,*) ' '86 ELSE87 IF( lwp .AND. lk_dtatrc ) THEN88 DO jn = 1, jptra89 IF( lutini(jn) ) & ! open input FILE only IF lutini(jn) is true90 & WRITE(numout,*) ' read an initial file for passive tracer number :', jn, ' traceur : ', ctrcnm(jn)91 END DO92 ENDIF93 IF( lwp ) WRITE(numout,*)94 ENDIF95 96 IF( ln_dm2dc .AND. ( lk_pisces .OR. lk_lobster ) ) &97 & CALL ctl_stop( ' The diurnal cycle is not compatible with PISCES or LOBSTER ' )98 99 IF( nn_cla == 1 ) &100 & CALL ctl_stop( ' Cross Land Advection not yet implemented with passive tracer ; nn_cla must be 0' )101 102 IF( lk_lobster ) THEN ; CALL trc_ini_lobster ! LOBSTER bio-model103 ELSE ; IF(lwp) WRITE(numout,*) ' LOBSTER not used'104 ENDIF105 106 IF( lk_pisces ) THEN ; CALL trc_ini_pisces ! PISCES bio-model107 ELSE ; IF(lwp) WRITE(numout,*) ' PISCES not used'108 ENDIF109 110 IF( lk_cfc ) THEN ; CALL trc_ini_cfc ! CFC tracers111 ELSE ; IF(lwp) WRITE(numout,*) ' CFC not used'112 ENDIF113 114 IF( lk_c14b ) THEN ; CALL trc_ini_c14b ! C14 bomb tracer115 ELSE ; IF(lwp) WRITE(numout,*) ' C14 not used'116 ENDIF117 118 IF( lk_my_trc ) THEN ; CALL trc_ini_my_trc ! MY_TRC tracers119 ELSE ; IF(lwp) WRITE(numout,*) ' MY_TRC not used'120 ENDIF121 122 IF( ln_rsttr ) THEN123 82 ! 124 83 IF( lk_offline ) neuler = 1 ! Set time-step indicator at nit000 (leap-frog) 125 CALL trc_rst_ read ! restart from a file84 CALL trc_rst_cal( nittrc000, 'READ' ) ! calendar 126 85 ! 127 86 ELSE … … 130 89 CALL day_init ! set calendar 131 90 ENDIF 132 #if defined key_dtatrc 133 CALL trc_dta( nit000 ) ! Initialization of tracer from a file that may also be used for damping 134 DO jn = 1, jptra 135 IF( lutini(jn) ) trn(:,:,:,jn) = trdta(:,:,:,jn) * tmask(:,:,:) ! initialisation from file if required 136 END DO 137 #endif 91 ! 92 ENDIF 93 IF(lwp) WRITE(numout,*) 94 ! masked grid volume 95 ! ! masked grid volume 96 DO jk = 1, jpk 97 cvol(:,:,jk) = e1e2t(:,:) * fse3t(:,:,jk) * tmask(:,:,jk) 98 END DO 99 IF( lk_degrad ) cvol(:,:,:) = cvol(:,:,:) * facvol(:,:,:) ! degrad option: reduction by facvol 100 ! ! total volume of the ocean 101 areatot = glob_sum( cvol(:,:,:) ) 102 103 IF( lk_lobster ) CALL trc_ini_lobster ! LOBSTER bio-model 104 IF( lk_pisces ) CALL trc_ini_pisces ! PISCES bio-model 105 IF( lk_cfc ) CALL trc_ini_cfc ! CFC tracers 106 IF( lk_c14b ) CALL trc_ini_c14b ! C14 bomb tracer 107 IF( lk_my_trc ) CALL trc_ini_my_trc ! MY_TRC tracers 108 109 IF( lwp ) THEN 110 ! 111 CALL ctl_opn( numstr, 'tracer.stat', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, 6, .FALSE., narea ) 112 ! 113 ENDIF 114 115 IF( ln_trcdta ) CALL trc_dta_init 116 117 118 IF( ln_rsttr ) THEN 119 ! 120 CALL trc_rst_read ! restart from a file 121 ! 122 ELSE 123 ! 124 IF( ln_trcdta .AND. nb_trcdta > 0 ) THEN ! Initialisation of tracer from a file that may also be used for damping 125 ! 126 CALL wrk_alloc( jpi, jpj, jpk, nb_trcdta, ztrcdta ) ! Memory allocation 127 ! 128 CALL trc_dta( nit000, ztrcdta ) ! read tracer data at nit000 129 ! 130 DO jn = 1, jptra 131 IF( ln_trc_ini(jn) ) THEN ! update passive tracers arrays with input data read from file 132 jl = n_trc_index(jn) 133 trn(:,:,:,jn) = ztrcdta(:,:,:,jl) * tmask(:,:,:) 134 ENDIF 135 ENDDO 136 CALL wrk_dealloc( jpi, jpj, jpk, nb_trcdta, ztrcdta ) 137 ENDIF 138 ! 138 139 trb(:,:,:,:) = trn(:,:,:,:) 139 140 ! … … 145 146 & CALL zps_hde( nit000, jptra, trn, gtru, gtrv ) ! tracers at the bottom ocean level 146 147 147 148 ! 149 trai = 0._wp ! Computation content of all tracers 148 ! 149 IF( nn_dttrc /= 1 ) CALL trc_sub_ini ! Initialize variables for substepping passive tracers 150 ! 151 152 trai(:) = 0._wp ! initial content of all tracers 150 153 DO jn = 1, jptra 151 #if ! defined key_degrad 152 trai = trai + glob_sum( trn(:,:,:,jn) * cvol(:,:,:) ) 153 #else 154 trai = trai + glob_sum( trn(:,:,:,jn) * cvol(:,:,:) * facvol(:,:,:) ) ! degrad option: reduction by facvol 155 #endif 156 END DO 154 trai(jn) = trai(jn) + glob_sum( trn(:,:,:,jn) * cvol(:,:,:) ) 155 END DO 157 156 158 157 IF(lwp) THEN ! control print … … 161 160 WRITE(numout,*) ' *** Total number of passive tracer jptra = ', jptra 162 161 WRITE(numout,*) ' *** Total volume of ocean = ', areatot 163 WRITE(numout,*) ' *** Total inital content of all tracers = ', trai 164 WRITE(numout,*) 165 ENDIF 166 162 WRITE(numout,*) ' *** Total inital content of all tracers ' 163 WRITE(numout,*) 164 DO jn = 1, jptra 165 WRITE(numout,9000) jn, TRIM( ctrcnm(jn) ), trai(jn) 166 ENDDO 167 WRITE(numout,*) 168 ENDIF 169 IF(lwp) WRITE(numout,*) 167 170 IF(ln_ctl) THEN ! print mean trends (used for debugging) 168 171 CALL prt_ctl_trc_init … … 171 174 CALL prt_ctl_trc( tab4d=trn, mask=tmask, clinfo=ctrcnm ) 172 175 ENDIF 176 9000 FORMAT(' tracer nb : ',i2,' name :',a10,' initial content :',e18.10) 177 ! 178 IF( nn_timing == 1 ) CALL timing_stop('trc_init') 173 179 ! 174 180 END SUBROUTINE trc_init … … 186 192 USE trczdf , ONLY: trc_zdf_alloc 187 193 USE trdmod_trc_oce, ONLY: trd_mod_trc_oce_alloc 188 #if ! defined key_iomput 189 USE trcdia , ONLY: trc_dia_alloc 190 #endif 191 #if defined key_trcdmp 192 USE trcdmp , ONLY: trc_dmp_alloc 193 #endif 194 #if defined key_dtatrc 195 USE trcdta , ONLY: trc_dta_alloc 196 #endif 197 #if defined key_trdmld_trc || defined key_esopa 194 #if defined key_trdmld_trc 198 195 USE trdmld_trc , ONLY: trd_mld_trc_alloc 199 196 #endif … … 207 204 ierr = ierr + trc_zdf_alloc() 208 205 ierr = ierr + trd_mod_trc_oce_alloc() 209 #if ! defined key_iomput 210 ierr = ierr + trc_dia_alloc() 211 #endif 212 #if defined key_trcdmp 213 ierr = ierr + trc_dmp_alloc() 214 #endif 215 #if defined key_dtatrc 216 ierr = ierr + trc_dta_alloc() 217 #endif 218 #if defined key_trdmld_trc || defined key_esopa 206 #if defined key_trdmld_trc 219 207 ierr = ierr + trd_mld_trc_alloc() 220 208 #endif -
trunk/NEMOGCM/NEMO/TOP_SRC/trcnam.F90
r2715 r3294 18 18 !! trc_nam : Read and print options for the passive tracer run (namelist) 19 19 !!---------------------------------------------------------------------- 20 USE oce_trc 21 USE trc 20 USE oce_trc ! shared variables between ocean and passive tracers 21 USE trc ! passive tracers common variables 22 22 USE trcnam_trp ! Transport namelist 23 23 USE trcnam_lobster ! LOBSTER namelist … … 26 26 USE trcnam_c14b ! C14 SMS namelist 27 27 USE trcnam_my_trc ! MY_TRC SMS namelist 28 USE trdmod_oce 28 29 USE trdmod_trc_oce 30 USE iom ! I/O manager 29 31 30 32 IMPLICIT NONE … … 53 55 !! ( (LOBSTER, PISCES, CFC, MY_TRC ) 54 56 !!--------------------------------------------------------------------- 55 INTEGER :: jn 56 57 INTEGER :: jn, ierr 57 58 ! Definition of a tracer as a structure 58 TYPE PTRACER 59 CHARACTER(len = 20) :: clsname !: short name 60 CHARACTER(len = 80 ) :: cllname !: long name 61 CHARACTER(len = 20 ) :: clunit !: unit 62 LOGICAL :: llinit !: read in a file or not 63 LOGICAL :: llsave !: save the tracer or not 64 END TYPE PTRACER 65 66 TYPE(PTRACER) , DIMENSION(jptra) :: sn_tracer 67 59 TYPE(PTRACER), DIMENSION(jptra) :: sn_tracer ! type of tracer for saving if not key_iomput 68 60 !! 69 NAMELIST/namtrc/ 70 cn_trcrst_in, cn_trcrst_out, sn_tracer61 NAMELIST/namtrc/ nn_dttrc, nn_writetrc, ln_rsttr, nn_rsttr, & 62 & cn_trcrst_in, cn_trcrst_out, sn_tracer, ln_trcdta 71 63 #if defined key_trdmld_trc || defined key_trdtrc 72 64 NAMELIST/namtrc_trd/ nn_trd_trc, nn_ctls_trc, rn_ucf_trc, & 73 ln_trdmld_trc_restart, ln_trdmld_trc_instant, &74 cn_trdrst_trc_in, cn_trdrst_trc_out, ln_trdtrc65 & ln_trdmld_trc_restart, ln_trdmld_trc_instant, & 66 & cn_trdrst_trc_in, cn_trdrst_trc_out, ln_trdtrc 75 67 #endif 68 NAMELIST/namtrc_dia/ ln_diatrc, ln_diabio, nn_writedia, nn_writebio 76 69 77 70 !!--------------------------------------------------------------------- … … 84 77 ! Namelist nattrc (files) 85 78 ! ---------------------------------------------- 86 nn_dttrc = 1 ! default values87 nn_writetrc = 1088 ln_rsttr = .FALSE.89 nn_rsttr = 079 nn_dttrc = 1 ! default values 80 nn_writetrc = 10 81 ln_rsttr = .FALSE. 82 nn_rsttr = 0 90 83 cn_trcrst_in = 'restart_trc' 91 84 cn_trcrst_out = 'restart_trc' 85 ! 92 86 DO jn = 1, jptra 93 WRITE( ctrcnm(jn),'("TR_",I1)' ) jn94 WRITE( ctrcnl(jn),'("TRACER NUMBER ",I1)') jn95 ctrcun(jn)= 'mmole/m3'96 lutini(jn) = .FALSE.97 lutsav(jn) = .TRUE.87 WRITE( sn_tracer(jn)%clsname,'("TR_",I1)' ) jn 88 WRITE( sn_tracer(jn)%cllname,'("TRACER NUMBER ",I1)') jn 89 sn_tracer(jn)%clunit = 'mmole/m3' 90 sn_tracer(jn)%llinit = .FALSE. 91 sn_tracer(jn)%llsave = .TRUE. 98 92 END DO 93 ln_trcdta = .FALSE. 94 99 95 100 96 REWIND( numnat ) ! read nattrc … … 102 98 103 99 DO jn = 1, jptra 104 ctrcnm (jn) = TRIM( sn_tracer(jn)%clsname )105 ctrc nl(jn) = TRIM( sn_tracer(jn)%cllname )106 ctrcun (jn) = TRIM( sn_tracer(jn)%clunit )107 l utini(jn) = sn_tracer(jn)%llinit108 l utsav(jn) = sn_tracer(jn)%llsave100 ctrcnm (jn) = TRIM( sn_tracer(jn)%clsname ) 101 ctrcln (jn) = TRIM( sn_tracer(jn)%cllname ) 102 ctrcun (jn) = TRIM( sn_tracer(jn)%clunit ) 103 ln_trc_ini(jn) = sn_tracer(jn)%llinit 104 ln_trc_wri(jn) = sn_tracer(jn)%llsave 109 105 END DO 110 106 107 !!KPE computes the first time step of tracer model 108 nittrc000 = nit000 + nn_dttrc - 1 109 111 110 112 111 IF(lwp) THEN ! control print 113 112 WRITE(numout,*) 114 113 WRITE(numout,*) ' Namelist : namtrc' 115 WRITE(numout,*) ' time step freq. for pass. trac. nn_dttrc = ', nn_dttrc 116 WRITE(numout,*) ' frequency of outputs for passive tracers nn_writetrc = ', nn_writetrc 117 WRITE(numout,*) ' restart LOGICAL for passive tr. ln_rsttr = ', ln_rsttr 118 WRITE(numout,*) ' control of time step for p. tr. nn_rsttr = ', nn_rsttr 114 WRITE(numout,*) ' time step freq. for passive tracer nn_dttrc = ', nn_dttrc 115 WRITE(numout,*) ' restart for passive tracer ln_rsttr = ', ln_rsttr 116 WRITE(numout,*) ' control of time step for passive tracer nn_rsttr = ', nn_rsttr 117 WRITE(numout,*) ' first time step for pass. trac. nittrc000 = ', nittrc000 118 WRITE(numout,*) ' frequency of outputs for passive tracers nn_writetrc = ', nn_writetrc 119 WRITE(numout,*) ' Read inputs data from file ln_trcdta = ', ln_trcdta 119 120 WRITE(numout,*) ' ' 120 121 DO jn = 1, jptra 121 WRITE(numout,*) ' tracer nb : ', jn 122 WRITE(numout,*) ' short name : ', ctrcnm(jn) 123 WRITE(numout,*) ' long name : ', ctrcnl(jn) 124 WRITE(numout,*) ' unit : ', ctrcun(jn) 125 WRITE(numout,*) ' initial value in FILE : ', lutini(jn) 126 WRITE(numout,*) ' ' 122 WRITE(numout,*) ' tracer nb : ', jn, ' short name : ', ctrcnm(jn) 127 123 END DO 124 WRITE(numout,*) ' ' 128 125 ENDIF 129 126 130 127 rdttrc(:) = rdttra(:) * FLOAT( nn_dttrc ) ! vertical profile of passive tracer time-step 131 128 132 IF(lwp) WRITE(numout,*) 133 IF(lwp) WRITE(numout,*) ' Passive Tracer time step rdttrc = ', rdttrc(1) 134 IF(lwp) WRITE(numout,*) 135 136 #if defined key_trdmld_trc || defined key_trdtrc 137 nn_trd_trc = 20 138 nn_ctls_trc = 9 139 rn_ucf_trc = 1. 140 ln_trdmld_trc_instant = .TRUE. 141 ln_trdmld_trc_restart =.FALSE. 142 cn_trdrst_trc_in = "restart_mld_trc" 143 cn_trdrst_trc_out = "restart_mld_trc" 144 ln_trdtrc(:) = .FALSE. 129 IF(lwp) THEN ! control print 130 WRITE(numout,*) 131 WRITE(numout,*) ' Passive Tracer time step rdttrc = ', rdttrc(1) 132 WRITE(numout,*) 133 ENDIF 134 135 ln_diatrc = .FALSE. 136 ln_diabio = .FALSE. 137 nn_writedia = 10 138 nn_writebio = 10 145 139 146 140 REWIND( numnat ) ! namelist namtoptrd : passive tracer trends diagnostic 147 READ ( numnat, namtrc_ trd)148 149 IF(lwp) THEN141 READ ( numnat, namtrc_dia ) 142 143 IF(lwp) THEN 150 144 WRITE(numout,*) 151 WRITE(numout,*) ' trd_mld_trc_init : read namelist namtrc_trd ' 152 WRITE(numout,*) ' ~~~~~~~~~~~~~~~~ ' 153 WRITE(numout,*) ' * frequency of trends diagnostics nn_trd_trc = ', nn_trd_trc 154 WRITE(numout,*) ' * control surface type nn_ctls_trc = ', nn_ctls_trc 155 WRITE(numout,*) ' * restart for ML diagnostics ln_trdmld_trc_restart = ', ln_trdmld_trc_restart 156 WRITE(numout,*) ' * flag to diagnose trends of ' 157 WRITE(numout,*) ' instantantaneous or mean ML T/S ln_trdmld_trc_instant = ', ln_trdmld_trc_instant 158 WRITE(numout,*) ' * unit conversion factor rn_ucf_trc = ', rn_ucf_trc 159 DO jn = 1, jptra 160 IF( ln_trdtrc(jn) ) WRITE(numout,*) ' compute ML trends for tracer number :', jn 161 END DO 162 ENDIF 163 #endif 145 WRITE(numout,*) 146 WRITE(numout,*) ' Namelist : namtrc_dia' 147 WRITE(numout,*) ' save additionnal diagnostics arrays ln_diatrc = ', ln_diatrc 148 WRITE(numout,*) ' save additionnal biology diagnostics arrays ln_diabio = ', ln_diabio 149 WRITE(numout,*) ' frequency of outputs for additional arrays nn_writedia = ', nn_writedia 150 WRITE(numout,*) ' frequency of outputs for biological trends nn_writebio = ', nn_writebio 151 WRITE(numout,*) ' ' 152 ENDIF 153 154 IF( ln_diatrc .AND. .NOT. lk_iomput ) THEN 155 ALLOCATE( trc2d(jpi,jpj,jpdia2d), trc3d(jpi,jpj,jpk,jpdia3d), & 156 & ctrc2d(jpdia2d), ctrc2l(jpdia2d), ctrc2u(jpdia2d) , & 157 & ctrc3d(jpdia3d), ctrc3l(jpdia3d), ctrc3u(jpdia3d) , STAT = ierr ) 158 IF( ierr > 0 ) CALL ctl_stop( 'STOP', 'trcnam: unable to allocate add. diag. array' ) 159 ENDIF 160 161 IF( ( ln_diabio .AND. .NOT. lk_iomput ) .OR. l_trdtrc ) THEN 162 ALLOCATE( trbio (jpi,jpj,jpk,jpdiabio) , & 163 & ctrbio(jpdiabio), ctrbil(jpdiabio), ctrbiu(jpdiabio), STAT = ierr ) 164 IF( ierr > 0 ) CALL ctl_stop( 'STOP', 'trcnam: unable to allocate bio. diag. array' ) 165 ENDIF 164 166 165 167 ! namelist of transport 166 168 ! --------------------- 167 169 CALL trc_nam_trp 170 171 172 IF( ln_trcdmp .AND. .NOT.ln_trcdta ) THEN 173 CALL ctl_warn( 'trc_nam: passive tracer damping requires data from files we set ln_trcdta to TRUE' ) 174 ln_trcdta = .TRUE. 175 ENDIF 176 ! 177 IF( ln_rsttr .AND. .NOT.ln_trcdmp .AND. ln_trcdta ) THEN 178 CALL ctl_warn( 'trc_nam: passive tracer restart and data intialisation, ', & 179 & 'we keep the restart values and set ln_trcdta to FALSE' ) 180 ln_trcdta = .FALSE. 181 ENDIF 182 ! 183 IF( .NOT.ln_trcdta ) THEN 184 ln_trc_ini(:) = .FALSE. 185 ENDIF 186 187 IF(lwp) THEN ! control print 188 IF( ln_rsttr ) THEN 189 WRITE(numout,*) 190 WRITE(numout,*) ' read a restart file for passive tracer : ', TRIM( cn_trcrst_in ) 191 WRITE(numout,*) 192 ELSE 193 IF( .NOT.ln_trcdta ) THEN 194 WRITE(numout,*) 195 WRITE(numout,*) ' All the passive tracers are initialised with constant values ' 196 WRITE(numout,*) 197 ENDIF 198 ENDIF 199 ENDIF 200 201 202 #if defined key_trdmld_trc || defined key_trdtrc 203 nn_trd_trc = 20 204 nn_ctls_trc = 9 205 rn_ucf_trc = 1. 206 ln_trdmld_trc_instant = .TRUE. 207 ln_trdmld_trc_restart =.FALSE. 208 cn_trdrst_trc_in = "restart_mld_trc" 209 cn_trdrst_trc_out = "restart_mld_trc" 210 ln_trdtrc(:) = .FALSE. 211 212 REWIND( numnat ) ! namelist namtoptrd : passive tracer trends diagnostic 213 READ ( numnat, namtrc_trd ) 214 215 IF(lwp) THEN 216 WRITE(numout,*) 217 WRITE(numout,*) ' trd_mld_trc_init : read namelist namtrc_trd ' 218 WRITE(numout,*) ' ~~~~~~~~~~~~~~~~ ' 219 WRITE(numout,*) ' * frequency of trends diagnostics nn_trd_trc = ', nn_trd_trc 220 WRITE(numout,*) ' * control surface type nn_ctls_trc = ', nn_ctls_trc 221 WRITE(numout,*) ' * restart for ML diagnostics ln_trdmld_trc_restart = ', ln_trdmld_trc_restart 222 WRITE(numout,*) ' * flag to diagnose trends of ' 223 WRITE(numout,*) ' instantantaneous or mean ML T/S ln_trdmld_trc_instant = ', ln_trdmld_trc_instant 224 WRITE(numout,*) ' * unit conversion factor rn_ucf_trc = ', rn_ucf_trc 225 DO jn = 1, jptra 226 IF( ln_trdtrc(jn) ) WRITE(numout,*) ' compute ML trends for tracer number :', jn 227 END DO 228 ENDIF 229 #endif 168 230 169 231 -
trunk/NEMOGCM/NEMO/TOP_SRC/trcrst.F90
r2715 r3294 39 39 PUBLIC trc_rst_read ! called by ??? 40 40 PUBLIC trc_rst_wri ! called by ??? 41 PUBLIC trc_rst_cal 41 42 42 43 INTEGER, PUBLIC :: numrtr, numrtw !: logical unit for trc restart (read and write) … … 60 61 ! 61 62 IF( lk_offline ) THEN 62 IF( kt == nit 000 ) THEN63 IF( kt == nittrc000 ) THEN 63 64 lrst_trc = .FALSE. 64 65 nitrst = nitend … … 66 67 67 68 IF( MOD( kt - 1, nstock ) == 0 ) THEN 68 ! we use kt - 1 and not kt - nit 000 to keep the same periodicity from the beginning of the experiment69 ! we use kt - 1 and not kt - nittrc000 to keep the same periodicity from the beginning of the experiment 69 70 nitrst = kt + nstock - 1 ! define the next value of nitrst for restart writing 70 71 IF( nitrst > nitend ) nitrst = nitend ! make sure we write a restart at the end of the run 71 72 ENDIF 72 73 ELSE 73 IF( kt == nit 000 ) lrst_trc = .FALSE.74 IF( kt == nittrc000 ) lrst_trc = .FALSE. 74 75 ENDIF 75 76 … … 77 78 ! we open and define the tracer restart file one tracer time step before writing the data (-> at nitrst - 2*nn_dttrc + 1) 78 79 ! except if we write tracer restart files every tracer time step or if a tracer restart file was writen at nitend - 2*nn_dttrc + 1 79 IF( kt == nitrst - 2*nn_dttrc + 1 .OR. nstock == nn_dttrc .OR. ( kt == nitend - nn_dttrc + 1.AND. .NOT. lrst_trc ) ) THEN80 IF( kt == nitrst - 2*nn_dttrc .OR. nstock == nn_dttrc .OR. ( kt == nitend - nn_dttrc .AND. .NOT. lrst_trc ) ) THEN 80 81 ! beware of the format used to write kt (default is i8.8, that should be large enough) 81 82 IF( nitrst > 1.0e9 ) THEN ; WRITE(clkt,* ) nitrst … … 99 100 !!---------------------------------------------------------------------- 100 101 INTEGER :: jn 101 INTEGER :: jlibalt = jprstlib 102 LOGICAL :: llok 103 104 !!---------------------------------------------------------------------- 105 102 103 !!---------------------------------------------------------------------- 104 ! 106 105 IF(lwp) WRITE(numout,*) 107 IF(lwp) WRITE(numout,*) 'trc_rst_read : read the TOP restart file'106 IF(lwp) WRITE(numout,*) 'trc_rst_read : read data in the TOP restart file' 108 107 IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~' 109 110 IF ( jprstlib == jprstdimg ) THEN111 ! eventually read netcdf file (monobloc) for restarting on different number of processors112 ! if {cn_trcrst_in}.nc exists, then set jlibalt to jpnf90113 INQUIRE( FILE = TRIM(cn_trcrst_in)//'.nc', EXIST = llok )114 IF ( llok ) THEN ; jlibalt = jpnf90 ; ELSE ; jlibalt = jprstlib ; ENDIF115 ENDIF116 117 CALL iom_open( cn_trcrst_in, numrtr, kiolib = jlibalt )118 119 ! Time domain : restart120 ! ---------------------121 CALL trc_rst_cal( nit000, 'READ' ) ! calendar122 108 123 109 ! READ prognostic variables and computes diagnostic variable … … 151 137 REAL(wp) :: zarak0 152 138 !!---------------------------------------------------------------------- 153 154 139 ! 155 140 CALL trc_rst_cal( kt, 'WRITE' ) ! calendar 156 141 CALL iom_rstput( kt, nitrst, numrtw, 'rdttrc1', rdttrc(1) ) ! surface passive tracer time step … … 196 181 !! 197 182 !! According to namelist parameter nrstdt, 198 !! nn_rsttr = 0 no control on the date (nit 000 is arbitrary).199 !! nn_rsttr = 1 we verify that nit 000 is equal to the last183 !! nn_rsttr = 0 no control on the date (nittrc000 is arbitrary). 184 !! nn_rsttr = 1 we verify that nittrc000 is equal to the last 200 185 !! time step of previous run + 1. 201 186 !! In both those options, the exact duration of the experiment 202 187 !! since the beginning (cumulated duration of all previous restart runs) 203 !! is not stored in the restart and is assumed to be (nit 000-1)*rdt.188 !! is not stored in the restart and is assumed to be (nittrc000-1)*rdt. 204 189 !! This is valid is the time step has remained constant. 205 190 !! … … 210 195 CHARACTER(len=*), INTENT(in) :: cdrw ! "READ"/"WRITE" flag 211 196 ! 197 INTEGER :: jlibalt = jprstlib 198 LOGICAL :: llok 212 199 REAL(wp) :: zkt, zrdttrc1 213 200 REAL(wp) :: zndastp … … 217 204 218 205 IF( TRIM(cdrw) == 'READ' ) THEN 206 207 IF(lwp) WRITE(numout,*) 208 IF(lwp) WRITE(numout,*) 'trc_rst_cal : read the TOP restart file for calendar' 209 IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~' 210 211 IF ( jprstlib == jprstdimg ) THEN 212 ! eventually read netcdf file (monobloc) for restarting on different number of processors 213 ! if {cn_trcrst_in}.nc exists, then set jlibalt to jpnf90 214 INQUIRE( FILE = TRIM(cn_trcrst_in)//'.nc', EXIST = llok ) 215 IF ( llok ) THEN ; jlibalt = jpnf90 ; ELSE ; jlibalt = jprstlib ; ENDIF 216 ENDIF 217 218 CALL iom_open( cn_trcrst_in, numrtr, kiolib = jlibalt ) 219 219 220 CALL iom_get ( numrtr, 'kt', zkt ) ! last time-step of previous run 220 221 IF(lwp) THEN … … 223 224 WRITE(numout,*) ' *** restart option' 224 225 SELECT CASE ( nn_rsttr ) 225 CASE ( 0 ) ; WRITE(numout,*) ' nn_rsttr = 0 : no control of nit 000'226 CASE ( 1 ) ; WRITE(numout,*) ' nn_rsttr = 1 : no control the date at nit 000 (use ndate0 read in the namelist)'226 CASE ( 0 ) ; WRITE(numout,*) ' nn_rsttr = 0 : no control of nittrc000' 227 CASE ( 1 ) ; WRITE(numout,*) ' nn_rsttr = 1 : no control the date at nittrc000 (use ndate0 read in the namelist)' 227 228 CASE ( 2 ) ; WRITE(numout,*) ' nn_rsttr = 2 : calendar parameters read in restart' 228 229 END SELECT … … 230 231 ENDIF 231 232 ! Control of date 232 IF( nit 000 - NINT( zkt ) /= 1.AND. nn_rsttr /= 0 ) &233 & CALL ctl_stop( ' ===>>>> : problem with nit 000 for the restart', &233 IF( nittrc000 - NINT( zkt ) /= nn_dttrc .AND. nn_rsttr /= 0 ) & 234 & CALL ctl_stop( ' ===>>>> : problem with nittrc000 for the restart', & 234 235 & ' verify the restart file or rerun with nn_rsttr = 0 (namelist)' ) 235 236 IF( lk_offline ) THEN ! set the date in offline mode … … 246 247 ELSE 247 248 ndastp = ndate0 - 1 ! ndate0 read in the namelist in dom_nam 248 adatrj = ( REAL( nit 000-1, wp ) * rdttra(1) ) / rday249 adatrj = ( REAL( nittrc000-1, wp ) * rdttra(1) ) / rday 249 250 ! note this is wrong if time step has changed during run 250 251 ENDIF … … 283 284 !! ** purpose : Compute tracers statistics 284 285 !!---------------------------------------------------------------------- 285 286 INTEGER :: jn 287 REAL(wp) :: zdiag_var, zdiag_varmin, zdiag_varmax, zdiag_tot 288 REAL(wp) :: zder 289 !!---------------------------------------------------------------------- 290 286 INTEGER :: jk, jn 287 REAL(wp) :: ztraf, zmin, zmax, zmean, zdrift 288 !!---------------------------------------------------------------------- 291 289 292 290 IF( lwp ) THEN … … 295 293 WRITE(numout,*) 296 294 ENDIF 297 298 zdiag_tot = 0.e0 299 DO jn = 1, jptra 300 # if defined key_degrad 301 zdiag_var = glob_sum( trn(:,:,:,jn) * cvol(:,:,:) * facvol(:,:,:) ) 302 # else 303 zdiag_var = glob_sum( trn(:,:,:,jn) * cvol(:,:,:) ) 304 # endif 305 zdiag_varmin = MINVAL( trn(:,:,:,jn), mask= ((tmask*SPREAD(tmask_i,DIM=3,NCOPIES=jpk).NE.0.)) ) 306 zdiag_varmax = MAXVAL( trn(:,:,:,jn), mask= ((tmask*SPREAD(tmask_i,DIM=3,NCOPIES=jpk).NE.0.)) ) 295 ! 296 DO jn = 1, jptra 297 ztraf = glob_sum( trn(:,:,:,jn) * cvol(:,:,:) ) 298 zmin = MINVAL( trn(:,:,:,jn), mask= ((tmask*SPREAD(tmask_i,DIM=3,NCOPIES=jpk).NE.0.)) ) 299 zmax = MAXVAL( trn(:,:,:,jn), mask= ((tmask*SPREAD(tmask_i,DIM=3,NCOPIES=jpk).NE.0.)) ) 307 300 IF( lk_mpp ) THEN 308 CALL mpp_min( z diag_varmin ) ! min over the global domain309 CALL mpp_max( z diag_varmax ) ! max over the global domain301 CALL mpp_min( zmin ) ! min over the global domain 302 CALL mpp_max( zmax ) ! max over the global domain 310 303 END IF 311 zdiag_tot = zdiag_tot + zdiag_var 312 zdiag_var = zdiag_var / areatot 313 IF(lwp) WRITE(numout,*) ' MEAN NO ', jn, ctrcnm(jn), ' = ', zdiag_var, & 314 & ' MIN = ', zdiag_varmin, ' MAX = ', zdiag_varmax 315 END DO 316 317 zder = ( ( zdiag_tot - trai ) / ( trai + 1.e-12 ) ) * 100._wp 318 IF(lwp) WRITE(numout,*) ' Integral of all tracers over the full domain = ', zdiag_tot 319 IF(lwp) WRITE(numout,*) ' Drift of the sum of all tracers =', zder, ' %' 320 304 zmean = ztraf / areatot 305 zdrift = ( ( ztraf - trai(jn) ) / ( trai(jn) + 1.e-12 ) ) * 100._wp 306 IF(lwp) WRITE(numout,9000) jn, TRIM( ctrcnm(jn) ), zmean, zmin, zmax, zdrift 307 END DO 308 WRITE(numout,*) 309 9000 FORMAT(' tracer nb :',i2,' name :',a10,' mean :',e18.10,' min :',e18.10, & 310 & ' max :',e18.10,' drift :',e18.10, ' %') 311 ! 321 312 END SUBROUTINE trc_rst_stat 322 313 -
trunk/NEMOGCM/NEMO/TOP_SRC/trcsms.F90
r2715 r3294 46 46 CHARACTER (len=25) :: charout 47 47 !!--------------------------------------------------------------------- 48 49 IF ( MOD( kt, nn_dttrc) /= 0 ) RETURN ! this ROUTINE is called only every ndttrc time step50 48 ! 49 IF( nn_timing == 1 ) CALL timing_start('trc_sms') 50 ! 51 51 IF( lk_lobster ) CALL trc_sms_lobster( kt ) ! main program of LOBSTER 52 52 IF( lk_pisces ) CALL trc_sms_pisces ( kt ) ! main program of PISCES … … 60 60 CALL prt_ctl_trc( tab4d=trn, mask=tmask, clinfo=ctrcnm ) 61 61 ENDIF 62 ! 63 IF( nn_timing == 1 ) CALL timing_stop('trc_sms') 62 64 ! 63 65 END SUBROUTINE trc_sms -
trunk/NEMOGCM/NEMO/TOP_SRC/trcstp.F90
r2528 r3294 22 22 USE iom 23 23 USE in_out_manager 24 USE trcsub 24 25 25 26 IMPLICIT NONE … … 27 28 28 29 PUBLIC trc_stp ! called by step 29 30 31 !! * Substitutions 32 # include "domzgr_substitute.h90" 30 33 !!---------------------------------------------------------------------- 31 34 !! NEMO/TOP 3.3 , NEMO Consortium (2010) … … 45 48 !! Update the passive tracers 46 49 !!------------------------------------------------------------------- 47 INTEGER, INTENT( in ) :: kt ! ocean time-step index 50 INTEGER, INTENT( in ) :: kt ! ocean time-step index 51 INTEGER :: jk, jn ! dummy loop indices 52 REAL(wp) :: ztrai 48 53 CHARACTER (len=25) :: charout 49 54 !!------------------------------------------------------------------- 55 ! 56 IF( nn_timing == 1 ) CALL timing_start('trc_stp') 57 ! 58 IF( kt == nittrc000 ) THEN 59 CALL iom_close( numrtr ) ! close input passive tracers restart file 60 IF( lk_trdmld_trc ) CALL trd_mld_trc_init ! trends: Mixed-layer 61 ENDIF 62 ! 63 IF( lk_vvl ) THEN ! update ocean volume due to ssh temporal evolution 64 DO jk = 1, jpk 65 cvol(:,:,jk) = e1e2t(:,:) * fse3t(:,:,jk) * tmask(:,:,jk) 66 END DO 67 IF( lk_degrad ) cvol(:,:,:) = cvol(:,:,:) * facvol(:,:,:) ! degrad option: reduction by facvol 68 areatot = glob_sum( cvol(:,:,:) ) 69 ENDIF 70 ! 71 IF( nn_dttrc /= 1 ) CALL trc_sub_stp( kt ) ! averaging physical variables for sub-stepping 50 72 51 IF( MOD( kt - 1, nn_dttrc ) == 0 ) THEN ! only every nn_dttrc time step73 IF( MOD( kt , nn_dttrc ) == 0 ) THEN ! only every nn_dttrc time step 52 74 ! 53 75 IF(ln_ctl) THEN … … 58 80 tra(:,:,:,:) = 0.e0 59 81 ! 60 IF( kt == nit000 .AND. lk_trdmld_trc ) & 61 & CALL trd_mld_trc_init ! trends: Mixed-layer 62 CALL trc_rst_opn( kt ) ! Open tracer restart file 63 IF( lk_iomput ) THEN ; CALL trc_wri( kt ) ! output of passive tracers 64 ELSE ; CALL trc_dia( kt ) 82 CALL trc_rst_opn ( kt ) ! Open tracer restart file 83 IF( lk_iomput ) THEN ; CALL trc_wri ( kt ) ! output of passive tracers with iom I/O manager 84 ELSE ; CALL trc_dia ( kt ) ! output of passive tracers with old I/O manager 65 85 ENDIF 66 CALL trc_sms( kt ) ! tracers: sink and source 67 CALL trc_trp( kt ) ! transport of passive tracers 68 IF( kt == nit000 ) CALL iom_close( numrtr ) ! close input passive tracers restart file 69 IF( lrst_trc ) CALL trc_rst_wri( kt ) ! write tracer restart file 70 IF( lk_trdmld_trc ) CALL trd_mld_trc( kt ) ! trends: Mixed-layer 86 CALL trc_sms ( kt ) ! tracers: sinks and sources 87 CALL trc_trp ( kt ) ! transport of passive tracers 88 IF( lrst_trc ) CALL trc_rst_wri ( kt ) ! write tracer restart file 89 IF( lk_trdmld_trc ) CALL trd_mld_trc ( kt ) ! trends: Mixed-layer 90 ! 91 IF( nn_dttrc /= 1 ) CALL trc_sub_reset( kt ) ! resetting physical variables when sub-stepping 71 92 ! 72 93 ENDIF 73 94 ! 95 ztrai = 0._wp ! content of all tracers 96 DO jn = 1, jptra 97 ztrai = ztrai + glob_sum( trn(:,:,:,jn) * cvol(:,:,:) ) 98 END DO 99 IF( lwp ) WRITE(numstr,9300) kt, ztrai / areatot 100 9300 FORMAT(i10,e18.10) 101 ! 102 IF( nn_timing == 1 ) CALL timing_stop('trc_stp') 103 ! 74 104 END SUBROUTINE trc_stp 75 105 -
trunk/NEMOGCM/NEMO/TOP_SRC/trcwri.F90
r2567 r3294 1 1 MODULE trcwri 2 !!====================================================================== =============2 !!====================================================================== 3 3 !! *** MODULE trcwri *** 4 4 !! TOP : Output of passive tracers 5 !!====================================================================== ==============5 !!====================================================================== 6 6 !! History : 1.0 ! 2009-05 (C. Ethe) Original code 7 7 !!---------------------------------------------------------------------- 8 #if defined key_top && 8 #if defined key_top && defined key_iomput 9 9 !!---------------------------------------------------------------------- 10 !! 'key_top' && 'key_iomput'TOP models10 !! 'key_top' TOP models 11 11 !!---------------------------------------------------------------------- 12 12 !! trc_wri_trc : outputs of concentration fields 13 13 !!---------------------------------------------------------------------- 14 USE dom_oce 15 USE oce_trc 16 USE trc 17 USE iom 18 USE dianam 14 USE dom_oce ! ocean space and time domain variables 15 USE oce_trc ! shared variables between ocean and passive tracers 16 USE trc ! passive tracers common variables 17 USE iom ! I/O manager 18 USE dianam ! Output file name 19 19 20 20 IMPLICIT NONE … … 36 36 INTEGER, INTENT( in ) :: kt 37 37 !!--------------------------------------------------------------------- 38 38 ! 39 IF( nn_timing == 1 ) CALL timing_start('trc_wri') 39 40 ! 40 41 CALL iom_setkt ( kt + nn_dttrc - 1 ) ! set the passive tracer time step 41 42 CALL trc_wri_trc( kt ) ! outputs for tracer concentration 42 43 CALL iom_setkt ( kt ) ! set the model time step 44 ! 45 IF( nn_timing == 1 ) CALL timing_stop('trc_wri') 43 46 ! 44 47 END SUBROUTINE trc_wri … … 50 53 !! ** Purpose : output passive tracers fields 51 54 !!--------------------------------------------------------------------- 52 INTEGER, INTENT( in ) :: kt ! ocean time-step53 INTEGER :: jn54 CHARACTER (len=20) :: cltra55 CHARACTER (len=40) :: clhstnam55 INTEGER, INTENT( in ) :: kt ! ocean time-step 56 INTEGER :: jn 57 CHARACTER (len=20) :: cltra 58 CHARACTER (len=40) :: clhstnam 56 59 INTEGER :: inum = 11 ! temporary logical unit 57 60 !!--------------------------------------------------------------------- 58 61 59 IF( lk_offline .AND. kt == nit 000 .AND. lwp ) THEN ! WRITE root name in date.file for use by postpro62 IF( lk_offline .AND. kt == nittrc000 .AND. lwp ) THEN ! WRITE root name in date.file for use by postpro 60 63 CALL dia_nam( clhstnam, nn_writetrc,' ' ) 61 64 CALL ctl_opn( inum, 'date.file', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, narea )
Note: See TracChangeset
for help on using the changeset viewer.