Changeset 9495
- Timestamp:
- 2018-04-23T16:34:55+02:00 (7 years ago)
- Location:
- branches/UKMO/dev_merge_2017_restart_datestamp_GO6_mixing/NEMOGCM
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/UKMO/dev_merge_2017_restart_datestamp_GO6_mixing/NEMOGCM/CONFIG/SHARED/field_def_nemo-opa.xml
r9493 r9495 62 62 <field id="mldr10_1max" long_name="Max of Mixed Layer Depth (dsigma = 0.01 wrt 10m)" field_ref="mldr10_1" operation="maximum" /> 63 63 <field id="mldr10_1min" long_name="Min of Mixed Layer Depth (dsigma = 0.01 wrt 10m)" field_ref="mldr10_1" operation="minimum" /> 64 <field id="mldzint_1" long_name="Mixed Layer Depth interpolated" standard_name="ocean_mixed_layer_thickness" unit="m" />65 <field id="mldzint_2" long_name="Mixed Layer Depth interpolated" standard_name="ocean_mixed_layer_thickness" unit="m" />66 <field id="mldzint_3" long_name="Mixed Layer Depth interpolated" standard_name="ocean_mixed_layer_thickness" unit="m" />67 <field id="mldzint_4" long_name="Mixed Layer Depth interpolated" standard_name="ocean_mixed_layer_thickness" unit="m" />68 <field id="mldzint_5" long_name="Mixed Layer Depth interpolated" standard_name="ocean_mixed_layer_thickness" unit="m" />69 <field id="mldhtc_1" long_name="Mixed Layer Depth integrated heat content" standard_name="integral_of_sea_water_potential_temperature_wrt_depth_expressed_as_heat_content" unit="J/m2" />70 <field id="mldhtc_2" long_name="Mixed Layer Depth integrated heat content" standard_name="integral_of_sea_water_potential_temperature_wrt_depth_expressed_as_heat_content" unit="J/m2" />71 <field id="mldhtc_3" long_name="Mixed Layer Depth integrated heat content" standard_name="integral_of_sea_water_potential_temperature_wrt_depth_expressed_as_heat_content" unit="J/m2" />72 <field id="mldhtc_4" long_name="Mixed Layer Depth integrated heat content" standard_name="integral_of_sea_water_potential_temperature_wrt_depth_expressed_as_heat_content" unit="J/m2" />73 <field id="mldhtc_5" long_name="Mixed Layer Depth integrated heat content" standard_name="integral_of_sea_water_potential_temperature_wrt_depth_expressed_as_heat_content" unit="J/m2" />74 64 <field id="heatc" long_name="Heat content vertically integrated" standard_name="integral_of_sea_water_potential_temperature_wrt_depth_expressed_as_heat_content" unit="J/m2" /> 75 65 <field id="saltc" long_name="Salt content vertically integrated" unit="1e-3*kg/m2" /> -
branches/UKMO/dev_merge_2017_restart_datestamp_GO6_mixing/NEMOGCM/NEMO/LIM_SRC_3/icerst.F90
r9493 r9495 24 24 USE in_out_manager ! I/O manager 25 25 USE iom ! I/O manager library 26 USE ioipsl, ONLY : ju2ymds ! for calendar27 26 USE lib_mpp ! MPP library 28 27 USE lib_fortran ! fortran utilities (glob_sum + no signed zero) … … 50 49 INTEGER, INTENT(in) :: kt ! number of iteration 51 50 ! 52 INTEGER :: iyear, imonth, iday53 REAL (wp) :: zsec54 REAL (wp) :: zfjulday55 51 CHARACTER(len=20) :: clkt ! ocean time-step define as a character 56 52 CHARACTER(len=50) :: clname ! ice output restart file name … … 67 63 IF( nitrst <= nitend .AND. nitrst > 0 ) THEN 68 64 ! beware of the format used to write kt (default is i8.8, that should be large enough...) 69 IF ( ln_rstdate ) THEN 70 zfjulday = fjulday + (2*nn_fsbc+1)*rdt / rday 71 IF( ABS(zfjulday - REAL(NINT(zfjulday),wp)) < 0.1 / rday ) zfjulday = REAL(NINT(zfjulday),wp) ! avoid truncation error 72 CALL ju2ymds( zfjulday, iyear, imonth, iday, zsec ) 73 WRITE(clkt, '(i4.4,2i2.2)') iyear, imonth, iday 74 ELSE 75 IF( nitrst > 99999999 ) THEN ; WRITE(clkt, * ) nitrst 76 ELSE ; WRITE(clkt, '(i8.8)') nitrst 77 ENDIF 65 IF( nitrst > 99999999 ) THEN ; WRITE(clkt, * ) nitrst 66 ELSE ; WRITE(clkt, '(i8.8)') nitrst 78 67 ENDIF 79 68 ! create the file -
branches/UKMO/dev_merge_2017_restart_datestamp_GO6_mixing/NEMOGCM/NEMO/OPA_SRC/DOM/domain.F90
r9493 r9495 292 292 & nn_it000, nn_itend , nn_date0 , nn_time0 , nn_leapy , nn_istate , & 293 293 & nn_stock, nn_write , ln_mskland , ln_clobber , nn_chunksz, nn_euler , & 294 & ln_cfmeta, ln_iscpl, ln_xios_read, nn_wxios , ln_rstdate294 & ln_cfmeta, ln_iscpl, ln_xios_read, nn_wxios 295 295 NAMELIST/namdom/ ln_linssh, rn_isfhmin, rn_rdt, rn_atfp, ln_crs, ln_meshmask 296 296 #if defined key_netcdf4 … … 338 338 WRITE(numout,*) ' frequency of output file nn_write = ', nn_write 339 339 WRITE(numout,*) ' mask land points ln_mskland = ', ln_mskland 340 WRITE(numout,*) ' date-stamp restart files ln_rstdate = ', ln_rstdate341 340 WRITE(numout,*) ' additional CF standard metadata ln_cfmeta = ', ln_cfmeta 342 341 WRITE(numout,*) ' overwrite an existing file ln_clobber = ', ln_clobber -
branches/UKMO/dev_merge_2017_restart_datestamp_GO6_mixing/NEMOGCM/NEMO/OPA_SRC/ICB/icbrst.F90
r9493 r9495 25 25 USE netcdf ! netcdf routines for IO 26 26 USE iom 27 USE ioipsl, ONLY : ju2ymds ! for calendar28 27 USE icb_oce ! define iceberg arrays 29 28 USE icbutl ! iceberg utility routines … … 158 157 INTEGER :: jn ! dummy loop index 159 158 INTEGER :: ix_dim, iy_dim, ik_dim, in_dim 160 INTEGER :: iyear, imonth, iday 161 REAL (wp) :: zsec 162 REAL (wp) :: zfjulday 163 CHARACTER(len=256) :: cl_path 164 CHARACTER(len=256) :: cl_filename 165 CHARACTER(LEN=20) :: clkt ! ocean time-step deine as a character 159 CHARACTER(len=256) :: cl_path 160 CHARACTER(len=256) :: cl_filename 166 161 TYPE(iceberg), POINTER :: this 167 162 TYPE(point) , POINTER :: pt … … 171 166 cl_path = TRIM(cn_ocerst_outdir) 172 167 IF( cl_path(LEN_TRIM(cl_path):) /= '/' ) cl_path = TRIM(cl_path) // '/' 173 IF ( ln_rstdate ) THEN 174 zfjulday = fjulday + rdt / rday 175 IF( ABS(zfjulday - REAL(NINT(zfjulday),wp)) < 0.1 / rday ) zfjulday = REAL(NINT(zfjulday),wp) ! avoid truncation error 176 CALL ju2ymds( zfjulday, iyear, imonth, iday, zsec ) 177 WRITE(clkt, '(i4.4,2i2.2)') iyear, imonth, iday 168 IF( lk_mpp ) THEN 169 WRITE(cl_filename,'(A,"_icebergs_",I8.8,"_restart_",I4.4,".nc")') TRIM(cexper), kt, narea-1 178 170 ELSE 179 IF( kt > 999999999 ) THEN ; WRITE(clkt, * ) kt 180 ELSE ; WRITE(clkt, '(i8.8)') kt 181 ENDIF 182 ENDIF 183 IF( lk_mpp ) THEN 184 WRITE(cl_filename,'(A,"_icebergs_",A,"_restart_",I4.4,".nc")') TRIM(cexper), TRIM(ADJUSTL(clkt)), narea-1 185 ELSE 186 WRITE(cl_filename,'(A,"_icebergs_",A,"_restart.nc")') TRIM(cexper), TRIM(ADJUSTL(clkt)) 171 WRITE(cl_filename,'(A,"_icebergs_",I8.8,"_restart.nc")') TRIM(cexper), kt 187 172 ENDIF 188 173 IF (nn_verbose_level >= 0) WRITE(numout,'(2a)') 'icebergs, write_restart: creating ',TRIM(cl_path)//TRIM(cl_filename) -
branches/UKMO/dev_merge_2017_restart_datestamp_GO6_mixing/NEMOGCM/NEMO/OPA_SRC/IOM/in_out_manager.F90
r9493 r9495 40 40 INTEGER, DIMENSION(10) :: nn_stocklist !: restart dump times 41 41 LOGICAL :: ln_mskland !: mask land points in NetCDF outputs (costly: + ~15%) 42 LOGICAL :: ln_rstdate !: T=> stamp output restart files with date instead of timestep43 42 LOGICAL :: ln_cfmeta !: output additional data to netCDF files required for compliance with the CF metadata standard 44 43 LOGICAL :: ln_clobber !: clobber (overwrite) an existing file -
branches/UKMO/dev_merge_2017_restart_datestamp_GO6_mixing/NEMOGCM/NEMO/OPA_SRC/IOM/restart.F90
r9493 r9495 27 27 USE in_out_manager ! I/O manager 28 28 USE iom ! I/O module 29 USE ioipsl, ONLY : ju2ymds ! for calendar30 29 USE diurnal_bulk 31 30 … … 59 58 INTEGER, INTENT(in) :: kt ! ocean time-step 60 59 !! 61 INTEGER :: iyear, imonth, iday62 REAL (wp) :: zsec63 REAL (wp) :: zfjulday64 60 CHARACTER(LEN=20) :: clkt ! ocean time-step deine as a character 65 61 CHARACTER(LEN=50) :: clname ! ocean output restart file name … … 90 86 IF( nitrst <= nitend .AND. nitrst > 0 ) THEN 91 87 ! beware of the format used to write kt (default is i8.8, that should be large enough...) 92 IF ( ln_rstdate ) THEN 93 zfjulday = fjulday + rdt / rday 94 IF( ABS(zfjulday - REAL(NINT(zfjulday),wp)) < 0.1 / rday ) zfjulday = REAL(NINT(zfjulday),wp) ! avoid truncation error 95 CALL ju2ymds( zfjulday, iyear, imonth, iday, zsec ) 96 WRITE(clkt, '(i4.4,2i2.2)') iyear, imonth, iday 97 ELSE 98 IF( nitrst > 999999999 ) THEN ; WRITE(clkt, * ) nitrst 99 ELSE ; WRITE(clkt, '(i8.8)') nitrst 100 ENDIF 88 IF( nitrst > 999999999 ) THEN ; WRITE(clkt, * ) nitrst 89 ELSE ; WRITE(clkt, '(i8.8)') nitrst 101 90 ENDIF 102 91 ! create the file -
branches/UKMO/dev_merge_2017_restart_datestamp_GO6_mixing/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfmxl.F90
r9493 r9495 15 15 USE trc_oce , ONLY: l_offline ! ocean space and time domain variables 16 16 USE zdf_oce ! ocean vertical physics 17 USE eosbn2 ! for zdf_mxl_zint18 17 ! 19 18 USE in_out_manager ! I/O manager … … 32 31 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: hmlp !: mixed layer depth (rho=rho0+zdcrit) [m] (used by LDF) 33 32 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: hmlpt !: depth of the last T-point inside the mixed layer [m] (used by LDF) 34 REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:,:) :: hmld_zint !: vertically-interpolated mixed layer depth [m]35 REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:,:) :: htc_mld ! Heat content of hmld_zint36 LOGICAL, PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: ll_found ! Is T_b to be found by interpolation ?37 LOGICAL, PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: ll_belowml ! Flag points below mixed layer when ll_found=F38 33 39 34 REAL(wp), PUBLIC :: rho_c = 0.01_wp !: density criterion for mixed layer depth 40 35 REAL(wp) :: avt_c = 5.e-4_wp ! Kz criterion for the turbocline depth 41 42 TYPE, PUBLIC :: MXL_ZINT !: Structure for MLD defs43 INTEGER :: mld_type ! mixed layer type44 REAL(wp) :: zref ! depth of initial T_ref45 REAL(wp) :: dT_crit ! Critical temp diff46 REAL(wp) :: iso_frac ! Fraction of rn_dT_crit used47 END TYPE MXL_ZINT48 36 49 37 !!---------------------------------------------------------------------- … … 60 48 zdf_mxl_alloc = 0 ! set to zero if no array to be allocated 61 49 IF( .NOT. ALLOCATED( nmln ) ) THEN 62 ALLOCATE( nmln(jpi,jpj), hmld(jpi,jpj), hmlp(jpi,jpj), hmlpt(jpi,jpj), hmld_zint(jpi,jpj), & 63 & htc_mld(jpi,jpj), & 64 & ll_found(jpi,jpj), ll_belowml(jpi,jpj,jpk), STAT= zdf_mxl_alloc ) 50 ALLOCATE( nmln(jpi,jpj), hmld(jpi,jpj), hmlp(jpi,jpj), hmlpt(jpi,jpj), STAT= zdf_mxl_alloc ) 65 51 ! 66 52 IF( lk_mpp ) CALL mpp_sum ( zdf_mxl_alloc ) … … 151 137 ENDIF 152 138 ! 153 ! Vertically-interpolated mixed-layer depth diagnostic154 CALL zdf_mxl_zint( kt )155 !156 139 IF(ln_ctl) CALL prt_ctl( tab2d_1=REAL(nmln,wp), clinfo1=' nmln : ', tab2d_2=hmlp, clinfo2=' hmlp : ' ) 157 140 ! 158 141 END SUBROUTINE zdf_mxl 159 142 160 SUBROUTINE zdf_mxl_zint_mld( sf )161 !!----------------------------------------------------------------------------------162 !! *** ROUTINE zdf_mxl_zint_mld ***163 !164 ! Calculate vertically-interpolated mixed layer depth diagnostic.165 !166 ! This routine can calculate the mixed layer depth diagnostic suggested by167 ! Kara et al, 2000, JGR, 105, 16803, but is more general and can calculate168 ! vertically-interpolated mixed-layer depth diagnostics with other parameter169 ! settings set in the namzdf_mldzint namelist.170 !171 ! If mld_type=1 the mixed layer depth is calculated as the depth at which the172 ! density has increased by an amount equivalent to a temperature difference of173 ! 0.8C at the surface.174 !175 ! For other values of mld_type the mixed layer is calculated as the depth at176 ! which the temperature differs by 0.8C from the surface temperature.177 !178 ! David Acreman, Daley Calvert179 !180 !!-----------------------------------------------------------------------------------181 182 TYPE(MXL_ZINT), INTENT(in) :: sf183 184 ! Diagnostic criteria185 INTEGER :: nn_mld_type ! mixed layer type186 REAL(wp) :: rn_zref ! depth of initial T_ref187 REAL(wp) :: rn_dT_crit ! Critical temp diff188 REAL(wp) :: rn_iso_frac ! Fraction of rn_dT_crit used189 190 ! Local variables191 REAL(wp), PARAMETER :: zepsilon = 1.e-30 ! local small value192 INTEGER, DIMENSION(jpi,jpj) :: ikmt ! number of active tracer levels193 INTEGER, DIMENSION(jpi,jpj) :: ik_ref ! index of reference level194 INTEGER, DIMENSION(jpi,jpj) :: ik_iso ! index of last uniform temp level195 REAL, DIMENSION(jpi,jpj,jpk) :: zT ! Temperature or density196 REAL, DIMENSION(jpi,jpj) :: ppzdep ! depth for use in calculating d(rho)197 REAL, DIMENSION(jpi,jpj) :: zT_ref ! reference temperature198 REAL :: zT_b ! base temperature199 REAL, DIMENSION(jpi,jpj,jpk) :: zdTdz ! gradient of zT200 REAL, DIMENSION(jpi,jpj,jpk) :: zmoddT ! Absolute temperature difference201 REAL :: zdz ! depth difference202 REAL :: zdT ! temperature difference203 REAL, DIMENSION(jpi,jpj) :: zdelta_T ! difference critereon204 REAL, DIMENSION(jpi,jpj) :: zRHO1, zRHO2 ! Densities205 INTEGER :: ji, jj, jk ! loop counter206 207 !!-------------------------------------------------------------------------------------208 !209 ! Unpack structure210 nn_mld_type = sf%mld_type211 rn_zref = sf%zref212 rn_dT_crit = sf%dT_crit213 rn_iso_frac = sf%iso_frac214 215 ! Set the mixed layer depth criterion at each grid point216 IF( nn_mld_type == 0 ) THEN217 zdelta_T(:,:) = rn_dT_crit218 zT(:,:,:) = rhop(:,:,:)219 ELSE IF( nn_mld_type == 1 ) THEN220 ppzdep(:,:)=0.0221 call eos ( tsn(:,:,1,:), ppzdep(:,:), zRHO1(:,:) )222 ! Use zT temporarily as a copy of tsn with rn_dT_crit added to SST223 ! [assumes number of tracers less than number of vertical levels]224 zT(:,:,1:jpts)=tsn(:,:,1,1:jpts)225 zT(:,:,jp_tem)=zT(:,:,1)+rn_dT_crit226 CALL eos( zT(:,:,1:jpts), ppzdep(:,:), zRHO2(:,:) )227 zdelta_T(:,:) = abs( zRHO1(:,:) - zRHO2(:,:) ) * rau0228 ! RHO from eos (2d version) doesn't calculate north or east halo:229 CALL lbc_lnk( zdelta_T, 'T', 1. )230 zT(:,:,:) = rhop(:,:,:)231 ELSE232 zdelta_T(:,:) = rn_dT_crit233 zT(:,:,:) = tsn(:,:,:,jp_tem)234 END IF235 236 ! Calculate the gradient of zT and absolute difference for use later237 DO jk = 1 ,jpk-2238 zdTdz(:,:,jk) = ( zT(:,:,jk+1) - zT(:,:,jk) ) / e3w_n(:,:,jk+1)239 zmoddT(:,:,jk) = abs( zT(:,:,jk+1) - zT(:,:,jk) )240 END DO241 242 ! Find density/temperature at the reference level (Kara et al use 10m).243 ! ik_ref is the index of the box centre immediately above or at the reference level244 ! Find rn_zref in the array of model level depths and find the ref245 ! density/temperature by linear interpolation.246 DO jk = jpkm1, 2, -1247 WHERE ( gdept_n(:,:,jk) > rn_zref )248 ik_ref(:,:) = jk - 1249 zT_ref(:,:) = zT(:,:,jk-1) + zdTdz(:,:,jk-1) * ( rn_zref - gdept_n(:,:,jk-1) )250 END WHERE251 END DO252 253 ! If the first grid box centre is below the reference level then use the254 ! top model level to get zT_ref255 WHERE ( gdept_n(:,:,1) > rn_zref )256 zT_ref = zT(:,:,1)257 ik_ref = 1258 END WHERE259 260 ! The number of active tracer levels is 1 less than the number of active w levels261 ikmt(:,:) = mbkt(:,:) - 1262 263 ! Initialize / reset264 ll_found(:,:) = .false.265 266 IF ( rn_iso_frac - zepsilon > 0. ) THEN267 ! Search for a uniform density/temperature region where adjacent levels268 ! differ by less than rn_iso_frac * deltaT.269 ! ik_iso is the index of the last level in the uniform layer270 ! ll_found indicates whether the mixed layer depth can be found by interpolation271 ik_iso(:,:) = ik_ref(:,:)272 DO jj = 1, nlcj273 DO ji = 1, nlci274 !CDIR NOVECTOR275 DO jk = ik_ref(ji,jj), ikmt(ji,jj)-1276 IF ( zmoddT(ji,jj,jk) > ( rn_iso_frac * zdelta_T(ji,jj) ) ) THEN277 ik_iso(ji,jj) = jk278 ll_found(ji,jj) = ( zmoddT(ji,jj,jk) > zdelta_T(ji,jj) )279 EXIT280 END IF281 END DO282 END DO283 END DO284 285 ! Use linear interpolation to find depth of mixed layer base where possible286 hmld_zint(:,:) = rn_zref287 DO jj = 1, jpj288 DO ji = 1, jpi289 IF (ll_found(ji,jj) .and. tmask(ji,jj,1) == 1.0) THEN290 zdz = abs( zdelta_T(ji,jj) / zdTdz(ji,jj,ik_iso(ji,jj)) )291 hmld_zint(ji,jj) = gdept_n(ji,jj,ik_iso(ji,jj)) + zdz292 END IF293 END DO294 END DO295 END IF296 297 ! If ll_found = .false. then calculate MLD using difference of zdelta_T298 ! from the reference density/temperature299 300 ! Prevent this section from working on land points301 WHERE ( tmask(:,:,1) /= 1.0 )302 ll_found = .true.303 END WHERE304 305 DO jk=1, jpk306 ll_belowml(:,:,jk) = abs( zT(:,:,jk) - zT_ref(:,:) ) >= zdelta_T(:,:)307 END DO308 309 ! Set default value where interpolation cannot be used (ll_found=false)310 DO jj = 1, jpj311 DO ji = 1, jpi312 IF ( .not. ll_found(ji,jj) ) hmld_zint(ji,jj) = gdept_n(ji,jj,ikmt(ji,jj))313 END DO314 END DO315 316 DO jj = 1, jpj317 DO ji = 1, jpi318 !CDIR NOVECTOR319 DO jk = ik_ref(ji,jj)+1, ikmt(ji,jj)320 IF ( ll_found(ji,jj) ) EXIT321 IF ( ll_belowml(ji,jj,jk) ) THEN322 zT_b = zT_ref(ji,jj) + zdelta_T(ji,jj) * SIGN(1.0, zdTdz(ji,jj,jk-1) )323 zdT = zT_b - zT(ji,jj,jk-1)324 zdz = zdT / zdTdz(ji,jj,jk-1)325 hmld_zint(ji,jj) = gdept_n(ji,jj,jk-1) + zdz326 EXIT327 END IF328 END DO329 END DO330 END DO331 332 hmld_zint(:,:) = hmld_zint(:,:)*tmask(:,:,1)333 !334 END SUBROUTINE zdf_mxl_zint_mld335 336 SUBROUTINE zdf_mxl_zint_htc( kt )337 !!----------------------------------------------------------------------338 !! *** ROUTINE zdf_mxl_zint_htc ***339 !!340 !! ** Purpose :341 !!342 !! ** Method :343 !!----------------------------------------------------------------------344 345 INTEGER, INTENT(in) :: kt ! ocean time-step index346 347 INTEGER :: ji, jj, jk348 INTEGER :: ikmax349 REAL(wp) :: zc, zcoef350 !351 INTEGER, ALLOCATABLE, DIMENSION(:,:) :: ilevel352 REAL(wp), ALLOCATABLE, DIMENSION(:,:) :: zthick_0, zthick353 354 !!----------------------------------------------------------------------355 356 IF( .NOT. ALLOCATED(ilevel) ) THEN357 ALLOCATE( ilevel(jpi,jpj), zthick_0(jpi,jpj), &358 & zthick(jpi,jpj), STAT=ji )359 IF( lk_mpp ) CALL mpp_sum(ji)360 IF( ji /= 0 ) CALL ctl_stop( 'STOP', 'zdf_mxl_zint_htc : unable to allocate arrays' )361 ENDIF362 363 ! Find last whole model T level above the MLD364 ilevel(:,:) = 0365 zthick_0(:,:) = 0._wp366 367 DO jk = 1, jpkm1368 DO jj = 1, jpj369 DO ji = 1, jpi370 zthick_0(ji,jj) = zthick_0(ji,jj) + e3t_n(ji,jj,jk)371 IF( zthick_0(ji,jj) < hmld_zint(ji,jj) ) ilevel(ji,jj) = jk372 END DO373 END DO374 WRITE(numout,*) 'zthick_0(jk =',jk,') =',zthick_0(2,2)375 WRITE(numout,*) 'gdepw_n(jk+1 =',jk+1,') =',gdepw_n(2,2,jk+1)376 END DO377 378 ! Surface boundary condition379 IF( ln_linssh ) THEN ; zthick(:,:) = sshn(:,:) ; htc_mld(:,:) = tsn(:,:,1,jp_tem) * sshn(:,:) * tmask(:,:,1)380 ELSE ; zthick(:,:) = 0._wp ; htc_mld(:,:) = 0._wp381 ENDIF382 383 ! Deepest whole T level above the MLD384 ikmax = MIN( MAXVAL( ilevel(:,:) ), jpkm1 )385 386 ! Integration down to last whole model T level387 DO jk = 1, ikmax388 DO jj = 1, jpj389 DO ji = 1, jpi390 zc = e3t_n(ji,jj,jk) * REAL( MIN( MAX( 0, ilevel(ji,jj) - jk + 1 ) , 1 ) ) ! 0 below ilevel391 zthick(ji,jj) = zthick(ji,jj) + zc392 htc_mld(ji,jj) = htc_mld(ji,jj) + zc * tsn(ji,jj,jk,jp_tem) * tmask(ji,jj,jk)393 END DO394 END DO395 END DO396 397 ! Subsequent partial T level398 zthick(:,:) = hmld_zint(:,:) - zthick(:,:) ! remaining thickness to reach MLD399 400 DO jj = 1, jpj401 DO ji = 1, jpi402 htc_mld(ji,jj) = htc_mld(ji,jj) + tsn(ji,jj,ilevel(ji,jj)+1,jp_tem) &403 & * MIN( e3t_n(ji,jj,ilevel(ji,jj)+1), zthick(ji,jj) ) * tmask(ji,jj,ilevel(ji,jj)+1)404 END DO405 END DO406 407 WRITE(numout,*) 'htc_mld(after) =',htc_mld(2,2)408 409 ! Convert to heat content410 zcoef = rau0 * rcp411 htc_mld(:,:) = zcoef * htc_mld(:,:)412 413 END SUBROUTINE zdf_mxl_zint_htc414 415 SUBROUTINE zdf_mxl_zint( kt )416 !!----------------------------------------------------------------------417 !! *** ROUTINE zdf_mxl_zint ***418 !!419 !! ** Purpose :420 !!421 !! ** Method :422 !!----------------------------------------------------------------------423 424 INTEGER, INTENT(in) :: kt ! ocean time-step index425 426 INTEGER :: ios427 INTEGER :: jn428 429 INTEGER :: nn_mld_diag = 0 ! number of diagnostics430 431 CHARACTER(len=1) :: cmld432 433 TYPE(MXL_ZINT) :: sn_mld1, sn_mld2, sn_mld3, sn_mld4, sn_mld5434 TYPE(MXL_ZINT), SAVE, DIMENSION(5) :: mld_diags435 436 NAMELIST/namzdf_mldzint/ nn_mld_diag, sn_mld1, sn_mld2, sn_mld3, sn_mld4, sn_mld5437 438 !!----------------------------------------------------------------------439 440 IF( kt == nit000 ) THEN441 REWIND( numnam_ref ) ! Namelist namzdf_mldzint in reference namelist442 READ ( numnam_ref, namzdf_mldzint, IOSTAT = ios, ERR = 901)443 901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namzdf_mldzint in reference namelist', lwp )444 445 REWIND( numnam_cfg ) ! Namelist namzdf_mldzint in configuration namelist446 READ ( numnam_cfg, namzdf_mldzint, IOSTAT = ios, ERR = 902 )447 902 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namzdf_mldzint in configuration namelist', lwp )448 IF(lwm) WRITE ( numond, namzdf_mldzint )449 450 IF( nn_mld_diag > 5 ) CALL ctl_stop( 'STOP', 'zdf_mxl_ini: Specify no more than 5 MLD definitions' )451 452 mld_diags(1) = sn_mld1453 mld_diags(2) = sn_mld2454 mld_diags(3) = sn_mld3455 mld_diags(4) = sn_mld4456 mld_diags(5) = sn_mld5457 458 IF( lwp .AND. (nn_mld_diag > 0) ) THEN459 WRITE(numout,*) '=============== Vertically-interpolated mixed layer ================'460 WRITE(numout,*) '(Diagnostic number, nn_mld_type, rn_zref, rn_dT_crit, rn_iso_frac)'461 DO jn = 1, nn_mld_diag462 WRITE(numout,*) 'MLD criterion',jn,':'463 WRITE(numout,*) ' nn_mld_type =', mld_diags(jn)%mld_type464 WRITE(numout,*) ' rn_zref =' , mld_diags(jn)%zref465 WRITE(numout,*) ' rn_dT_crit =' , mld_diags(jn)%dT_crit466 WRITE(numout,*) ' rn_iso_frac =', mld_diags(jn)%iso_frac467 END DO468 WRITE(numout,*) '===================================================================='469 ENDIF470 ENDIF471 472 IF( nn_mld_diag > 0 ) THEN473 DO jn = 1, nn_mld_diag474 WRITE(cmld,'(I1)') jn475 IF( iom_use( "mldzint_"//cmld ) .OR. iom_use( "mldhtc_"//cmld ) ) THEN476 CALL zdf_mxl_zint_mld( mld_diags(jn) )477 478 IF( iom_use( "mldzint_"//cmld ) ) THEN479 CALL iom_put( "mldzint_"//cmld, hmld_zint(:,:) )480 ENDIF481 482 IF( iom_use( "mldhtc_"//cmld ) ) THEN483 CALL zdf_mxl_zint_htc( kt )484 CALL iom_put( "mldhtc_"//cmld , htc_mld(:,:) )485 ENDIF486 ENDIF487 END DO488 ENDIF489 490 END SUBROUTINE zdf_mxl_zint491 492 143 !!====================================================================== 493 144 END MODULE zdfmxl -
branches/UKMO/dev_merge_2017_restart_datestamp_GO6_mixing/NEMOGCM/NEMO/OPA_SRC/ZDF/zdftke.F90
r9493 r9495 709 709 IF( nn_mxl < 0 .OR. nn_mxl > 3 ) CALL ctl_stop( 'bad flag: nn_mxl is 0, 1 or 2 ' ) 710 710 IF( nn_pdl < 0 .OR. nn_pdl > 1 ) CALL ctl_stop( 'bad flag: nn_pdl is 0 or 1 ' ) 711 IF( nn_htau < 0 .OR. nn_htau == 2 .OR. nn_htau > 5 ) CALL ctl_stop( 'bad flag: nn_htau is 0, 1, 3, 4 or 5' )711 IF( nn_htau < 0 .OR. nn_htau > 1 ) CALL ctl_stop( 'bad flag: nn_htau is 0, 1 or 2 ' ) 712 712 IF( nn_etau == 3 .AND. .NOT. ln_cpl ) CALL ctl_stop( 'nn_etau == 3 : HF taum only known in coupled mode' ) 713 713 ! … … 722 722 ! !* depth of penetration of surface tke 723 723 IF( nn_etau /= 0 ) THEN 724 htau(:,:) = 0._wp725 724 SELECT CASE( nn_htau ) ! Choice of the depth of penetration 726 725 CASE( 0 ) ! constant depth penetration (here 10 meters) … … 728 727 CASE( 1 ) ! F(latitude) : 0.5m to 30m poleward of 40 degrees 729 728 htau(:,:) = MAX( 0.5_wp, MIN( 30._wp, 45._wp* ABS( SIN( rpi/180._wp * gphit(:,:) ) ) ) ) 730 CASE( 3 ) ! F(latitude) : 0.5m to 15m poleward of 20 degrees731 htau(:,:) = MAX( 0.5_wp, MIN( 15._wp, 45._wp* ABS( SIN( rpi/180._wp * gphit(:,:) ) ) ) )732 CASE( 4 ) ! F(latitude) : 0.5m to 10m/30m poleward of 13/40 degrees north/south733 DO jj = 2, jpjm1734 DO ji = fs_2, fs_jpim1 ! vector opt.735 IF( gphit(ji,jj) <= 0._wp ) THEN736 htau(ji,jj) = MAX( 0.5_wp, MIN( 30._wp, 45._wp* ABS( SIN( rpi/180._wp * gphit(ji,jj) ) ) ) )737 ELSE738 htau(ji,jj) = MAX( 0.5_wp, MIN( 10._wp, 45._wp* ABS( SIN( rpi/180._wp * gphit(ji,jj) ) ) ) )739 ENDIF740 END DO741 END DO742 CASE ( 5 ) ! F(latitude) : 0.5m to 10m poleward of 13 degrees north/south,743 DO jj = 2, jpjm1 ! 10m to 30m between 30/45 degrees south744 DO ji = fs_2, fs_jpim1 ! vector opt.745 IF( gphit(ji,jj) <= -30._wp ) THEN746 htau(ji,jj) = MAX( 10._wp, MIN( 30._wp, 55._wp* ABS( SIN( rpi/120._wp * ( gphit(ji,jj) + 23._wp ) ) ) ) )747 ELSE748 htau(ji,jj) = MAX( 0.5_wp, MIN( 10._wp, 45._wp* ABS( SIN( rpi/180._wp * gphit(ji,jj) ) ) ) )749 ENDIF750 END DO751 END DO752 729 END SELECT 753 !754 730 ENDIF 755 731 ! !* read or initialize all required files
Note: See TracChangeset
for help on using the changeset viewer.