- Timestamp:
- 2016-07-19T10:38:35+02:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/NERC/dev_r5549_BDY_ZEROGRAD/NEMOGCM/NEMO/TOP_SRC/trcdta.F90
r5385 r6808 9 9 !! 3.4 ! 2010-11 (C. Ethe, G. Madec) use of fldread + dynamical allocation 10 10 !! 3.5 ! 2013-08 (M. Vichi) generalization for other BGC models 11 !!---------------------------------------------------------------------- 12 #if defined key_top 11 !! 3.6 ! 2015-03 (T. Lovato) revision of code log info 12 !!---------------------------------------------------------------------- 13 #if defined key_top 13 14 !!---------------------------------------------------------------------- 14 15 !! 'key_top' TOP model … … 36 37 TYPE(FLD), SAVE, PUBLIC, ALLOCATABLE, DIMENSION(:) :: sf_trcdta ! structure of input SST (file informations, fields read) 37 38 !$AGRIF_END_DO_NOT_TREAT 38 !! * Substitutions 39 # include "domzgr_substitute.h90" 39 40 40 !!---------------------------------------------------------------------- 41 41 !! NEMO/OPA 3.3 , NEMO Consortium (2010) … … 72 72 IF( nn_timing == 1 ) CALL timing_start('trc_dta_init') 73 73 ! 74 IF( lwp ) THEN 75 WRITE(numout,*) ' ' 76 WRITE(numout,*) ' trc_dta_init : Tracers Initial Conditions (IC)' 77 WRITE(numout,*) ' ~~~~~~~~~~~ ' 78 ENDIF 79 ! 74 80 ! Initialisation 75 81 ierr0 = 0 ; ierr1 = 0 ; ierr2 = 0 ; ierr3 = 0 … … 77 83 ALLOCATE( n_trc_index(ntrc), slf_i(ntrc), STAT=ierr0 ) 78 84 IF( ierr0 > 0 ) THEN 79 CALL ctl_stop( 'trc_ nam: unable to allocate n_trc_index' ) ; RETURN85 CALL ctl_stop( 'trc_dta_init: unable to allocate n_trc_index' ) ; RETURN 80 86 ENDIF 81 87 nb_trcdta = 0 … … 97 103 REWIND( numnat_ref ) ! Namelist namtrc_dta in reference namelist : Passive tracer input data 98 104 READ ( numnat_ref, namtrc_dta, IOSTAT = ios, ERR = 901) 99 901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc_dta in reference namelist', lwp )105 901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc_dta_init in reference namelist', lwp ) 100 106 101 107 REWIND( numnat_cfg ) ! Namelist namtrc_dta in configuration namelist : Passive tracer input data 102 108 READ ( numnat_cfg, namtrc_dta, IOSTAT = ios, ERR = 902 ) 103 902 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc_dta in configuration namelist', lwp )109 902 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc_dta_init in configuration namelist', lwp ) 104 110 IF(lwm) WRITE ( numont, namtrc_dta ) 105 111 … … 109 115 clndta = TRIM( sn_trcdta(jn)%clvar ) 110 116 clntrc = TRIM( ctrcnm (jn) ) 117 if (jn > jptra) clntrc='Dummy' ! By pass weird formats in ocean.output if ntrc > jptra 111 118 zfact = rn_trfac(jn) 112 119 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//' ')120 CALL ctl_warn( 'trc_dta_init: passive tracer data initialisation ', & 121 & 'Input name of data file : '//TRIM(clndta)// & 122 & ' differs from that of tracer : '//TRIM(clntrc)//' ') 116 123 ENDIF 117 WRITE(numout,*) ' read an initial file for passive tracer number :', jn, ' name : ', clndta, & 118 & ' multiplicative factor : ', zfact 124 WRITE(numout,*) ' ' 125 WRITE(numout,'(a, i3,3a,e11.3)') ' Read IC file for tracer number :', & 126 & jn, ', name : ', TRIM(clndta), ', Multiplicative Scaling factor : ', zfact 119 127 ENDIF 120 128 END DO … … 124 132 ALLOCATE( sf_trcdta(nb_trcdta), rf_trfac(nb_trcdta), STAT=ierr1 ) 125 133 IF( ierr1 > 0 ) THEN 126 CALL ctl_stop( 'trc_dta_ini : unable to allocate sf_trcdta structure' ) ; RETURN134 CALL ctl_stop( 'trc_dta_init: unable to allocate sf_trcdta structure' ) ; RETURN 127 135 ENDIF 128 136 ! … … 135 143 IF( sn_trcdta(jn)%ln_tint ) ALLOCATE( sf_trcdta(jl)%fdta(jpi,jpj,jpk,2) , STAT=ierr3 ) 136 144 IF( ierr2 + ierr3 > 0 ) THEN 137 CALL ctl_stop( 'trc_dta : unable to allocate passive tracer data arrays' ) ; RETURN145 CALL ctl_stop( 'trc_dta_init : unable to allocate passive tracer data arrays' ) ; RETURN 138 146 ENDIF 139 147 ENDIF … … 141 149 ENDDO 142 150 ! ! 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' )151 CALL fld_fill( sf_trcdta, slf_i, cn_dir, 'trc_dta_init', 'Passive tracer data', 'namtrc' ) 144 152 ! 145 153 ENDIF … … 189 197 DO ji = 1, jpi 190 198 DO jk = 1, jpk ! determines the intepolated T-S profiles at each (i,j) points 191 zl = fsdept_n(ji,jj,jk)199 zl = gdept_n(ji,jj,jk) 192 200 IF( zl < gdept_1d(1 ) ) THEN ! above the first level of data 193 201 ztp(jk) = sf_dta(1)%fnow(ji,jj,1) … … 220 228 ik = mbkt(ji,jj) 221 229 IF( ik > 1 ) THEN 222 zl = ( gdept_1d(ik) - fsdept_n(ji,jj,ik) ) / ( gdept_1d(ik) - gdept_1d(ik-1) )230 zl = ( gdept_1d(ik) - gdept_n(ji,jj,ik) ) / ( gdept_1d(ik) - gdept_1d(ik-1) ) 223 231 sf_dta(1)%fnow(ji,jj,ik) = (1.-zl) * sf_dta(1)%fnow(ji,jj,ik) + zl * sf_dta(1)%fnow(ji,jj,ik-1) 224 ENDIF225 ik = mikt(ji,jj)226 IF( ik > 1 ) THEN227 zl = ( gdept_0(ji,jj,ik) - gdept_1d(ik) ) / ( gdept_1d(ik+1) - gdept_1d(ik) )228 sf_dta(1)%fnow(ji,jj,ik) = (1.-zl) * sf_dta(1)%fnow(ji,jj,ik) + zl * sf_dta(1)%fnow(ji,jj,ik+1)229 232 ENDIF 230 233 END DO … … 236 239 sf_dta(1)%fnow(:,:,:) = sf_dta(1)%fnow(:,:,:) * zrf_trfac ! multiplicative factor 237 240 ! 238 IF( lwp .AND. kt == nit000 ) THEN239 clndta = TRIM( sf_dta(1)%clvar )240 WRITE(numout,*) ''//clndta//' data '241 WRITE(numout,*)242 WRITE(numout,*)' level = 1'243 CALL prihre( sf_dta(1)%fnow(:,:,1), jpi, jpj, 1, jpi, 20, 1, jpj, 20, 1., numout )244 WRITE(numout,*)' level = ', jpk/2245 CALL prihre( sf_dta(1)%fnow(:,:,jpk/2), jpi, jpj, 1, jpi, 20, 1, jpj, 20, 1., numout )246 WRITE(numout,*)' level = ', jpkm1247 CALL prihre( sf_dta(1)%fnow(:,:,jpkm1), jpi, jpj, 1, jpi, 20, 1, jpj, 20, 1., numout )248 WRITE(numout,*)249 ENDIF250 241 ENDIF 251 242 ! … … 253 244 ! 254 245 END SUBROUTINE trc_dta 246 255 247 #else 256 248 !!---------------------------------------------------------------------- … … 262 254 END SUBROUTINE trc_dta 263 255 #endif 256 264 257 !!====================================================================== 265 258 END MODULE trcdta
Note: See TracChangeset
for help on using the changeset viewer.