- Timestamp:
- 2020-04-07T18:34:56+02:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
NEMO/branches/UKMO/NEMO_4.0.2_ENHANCE-02_ISF_nemo/src/OCE/SBC/sbcrnf.F90
r12143 r12706 20 20 USE sbc_oce ! surface boundary condition variables 21 21 USE eosbn2 ! Equation Of State 22 USE closea 22 USE closea, ONLY: l_clo_rnf, clo_rnf ! closed seas 23 23 ! 24 24 USE in_out_manager ! I/O manager … … 42 42 REAL(wp) :: rn_dep_max !: depth over which runoffs is spread (ln_rnf_depth_ini =T) 43 43 INTEGER :: nn_rnf_depth_file !: create (=1) a runoff depth file or not (=0) 44 LOGICAL :: ln_rnf_icb !: iceberg flux is specified in a file 44 45 LOGICAL :: ln_rnf_tem !: temperature river runoffs attribute specified in a file 45 46 LOGICAL , PUBLIC :: ln_rnf_sal !: salinity river runoffs attribute specified in a file 46 47 TYPE(FLD_N) , PUBLIC :: sn_rnf !: information about the runoff file to be read 47 48 TYPE(FLD_N) :: sn_cnf !: information about the runoff mouth file to be read 49 TYPE(FLD_N) :: sn_i_rnf !: information about the iceberg flux file to be read 48 50 TYPE(FLD_N) :: sn_s_rnf !: information about the salinities of runoff file to be read 49 51 TYPE(FLD_N) :: sn_t_rnf !: information about the temperatures of runoff file to be read … … 64 66 65 67 TYPE(FLD), ALLOCATABLE, DIMENSION(:) :: sf_rnf ! structure: river runoff (file information, fields read) 68 TYPE(FLD), ALLOCATABLE, DIMENSION(:) :: sf_i_rnf ! structure: iceberg flux (file information, fields read) 66 69 TYPE(FLD), ALLOCATABLE, DIMENSION(:) :: sf_s_rnf ! structure: river runoff salinity (file information, fields read) 67 70 TYPE(FLD), ALLOCATABLE, DIMENSION(:) :: sf_t_rnf ! structure: river runoff temperature (file information, fields read) … … 111 114 ! !-------------------! 112 115 ! 113 IF( .NOT. l_rnfcpl ) CALL fld_read ( kt, nn_fsbc, sf_rnf ) ! Read Runoffs data and provide it at kt 116 ! 117 IF( .NOT. l_rnfcpl ) THEN 118 CALL fld_read ( kt, nn_fsbc, sf_rnf ) ! Read Runoffs data and provide it at kt ( runoffs + iceberg ) 119 IF( ln_rnf_icb ) CALL fld_read ( kt, nn_fsbc, sf_i_rnf ) ! idem for iceberg flux if required 120 ENDIF 114 121 IF( ln_rnf_tem ) CALL fld_read ( kt, nn_fsbc, sf_t_rnf ) ! idem for runoffs temperature if required 115 122 IF( ln_rnf_sal ) CALL fld_read ( kt, nn_fsbc, sf_s_rnf ) ! idem for runoffs salinity if required … … 117 124 IF( MOD( kt - 1, nn_fsbc ) == 0 ) THEN 118 125 ! 119 IF( .NOT. l_rnfcpl ) rnf(:,:) = rn_rfact * ( sf_rnf(1)%fnow(:,:,1) ) * tmask(:,:,1) ! updated runoff value at time step kt 126 IF( .NOT. l_rnfcpl ) THEN 127 rnf(:,:) = rn_rfact * ( sf_rnf(1)%fnow(:,:,1) ) * tmask(:,:,1) ! updated runoff value at time step kt 128 IF( ln_rnf_icb ) THEN 129 fwficb(:,:) = rn_rfact * ( sf_i_rnf(1)%fnow(:,:,1) ) * tmask(:,:,1) ! updated runoff value at time step kt 130 CALL iom_put( 'iceberg_cea' , fwficb(:,:) ) ! output iceberg flux 131 CALL iom_put( 'hflx_icb_cea' , fwficb(:,:) * rLfus ) ! output Heat Flux into Sea Water due to Iceberg Thermodynamics --> 132 ENDIF 133 ENDIF 120 134 ! 121 135 ! ! set temperature & salinity content of runoffs … … 128 142 ELSE ! use SST as runoffs temperature 129 143 !CEOD River is fresh water so must at least be 0 unless we consider ice 130 rnf_tsc(:,:,jp_tem) = MAX( sst_m(:,:),0.0_wp) * rnf(:,:) * r1_rau0144 rnf_tsc(:,:,jp_tem) = MAX( sst_m(:,:), 0.0_wp ) * rnf(:,:) * r1_rau0 131 145 ENDIF 132 146 ! ! use runoffs salinity data 133 147 IF( ln_rnf_sal ) rnf_tsc(:,:,jp_sal) = ( sf_s_rnf(1)%fnow(:,:,1) ) * rnf(:,:) * r1_rau0 134 148 ! ! else use S=0 for runoffs (done one for all in the init) 135 IF( iom_use('runoffs') )CALL iom_put( 'runoffs' , rnf(:,:) ) ! output runoff mass flux149 CALL iom_put( 'runoffs' , rnf(:,:) ) ! output runoff mass flux 136 150 IF( iom_use('hflx_rnf_cea') ) CALL iom_put( 'hflx_rnf_cea', rnf_tsc(:,:,jp_tem) * rau0 * rcp ) ! output runoff sensible heat (W/m2) 137 151 ENDIF … … 238 252 REAL(wp), DIMENSION(jpi,jpj,2) :: zrnfcl 239 253 !! 240 NAMELIST/namsbc_rnf/ cn_dir , ln_rnf_depth, ln_rnf_tem, ln_rnf_sal, &241 & sn_rnf, sn_cnf , sn_ s_rnf , sn_t_rnf , sn_dep_rnf, &254 NAMELIST/namsbc_rnf/ cn_dir , ln_rnf_depth, ln_rnf_tem, ln_rnf_sal, ln_rnf_icb, & 255 & sn_rnf, sn_cnf , sn_i_rnf, sn_s_rnf , sn_t_rnf , sn_dep_rnf, & 242 256 & ln_rnf_mouth , rn_hrnf , rn_avt_rnf, rn_rfact, & 243 257 & ln_rnf_depth_ini , rn_dep_max , rn_rnf_max, nn_rnf_depth_file … … 261 275 ! ! ============ 262 276 ! 263 REWIND( numnam_ref ) ! Namelist namsbc_rnf in reference namelist : Runoffs277 REWIND( numnam_ref ) 264 278 READ ( numnam_ref, namsbc_rnf, IOSTAT = ios, ERR = 901) 265 279 901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namsbc_rnf in reference namelist' ) 266 280 267 REWIND( numnam_cfg ) ! Namelist namsbc_rnf in configuration namelist : Runoffs281 REWIND( numnam_cfg ) 268 282 READ ( numnam_cfg, namsbc_rnf, IOSTAT = ios, ERR = 902 ) 269 283 902 IF( ios > 0 ) CALL ctl_nam ( ios , 'namsbc_rnf in configuration namelist' ) … … 295 309 IF( sn_rnf%ln_tint ) ALLOCATE( sf_rnf(1)%fdta(jpi,jpj,1,2) ) 296 310 CALL fld_fill( sf_rnf, (/ sn_rnf /), cn_dir, 'sbc_rnf_init', 'read runoffs data', 'namsbc_rnf', no_print ) 311 ! 312 IF( ln_rnf_icb ) THEN ! Create (if required) sf_i_rnf structure 313 IF(lwp) WRITE(numout,*) 314 IF(lwp) WRITE(numout,*) ' iceberg flux read in a file' 315 ALLOCATE( sf_i_rnf(1), STAT=ierror ) 316 IF( ierror > 0 ) THEN 317 CALL ctl_stop( 'sbc_rnf_init: unable to allocate sf_i_rnf structure' ) ; RETURN 318 ENDIF 319 ALLOCATE( sf_i_rnf(1)%fnow(jpi,jpj,1) ) 320 IF( sn_i_rnf%ln_tint ) ALLOCATE( sf_i_rnf(1)%fdta(jpi,jpj,1,2) ) 321 CALL fld_fill (sf_i_rnf, (/ sn_i_rnf /), cn_dir, 'sbc_rnf_init', 'read iceberg flux data', 'namsbc_rnf' ) 322 ELSE 323 fwficb(:,:) = 0._wp 324 ENDIF 325 297 326 ENDIF 298 327 ! … … 337 366 IF( h_rnf(ji,jj) > 0._wp ) THEN 338 367 jk = 2 339 DO WHILE ( jk /=mbkt(ji,jj) .AND. gdept_0(ji,jj,jk) < h_rnf(ji,jj) ) ; jk = jk + 1368 DO WHILE ( jk < mbkt(ji,jj) .AND. gdept_0(ji,jj,jk) < h_rnf(ji,jj) ) ; jk = jk + 1 340 369 END DO 341 370 nk_rnf(ji,jj) = jk … … 394 423 IF( zrnfcl(ji,jj,1) > 0._wp ) THEN 395 424 jk = 2 396 DO WHILE ( jk /=mbkt(ji,jj) .AND. gdept_0(ji,jj,jk) < h_rnf(ji,jj) ) ; jk = jk + 1425 DO WHILE ( jk < mbkt(ji,jj) .AND. gdept_0(ji,jj,jk) < h_rnf(ji,jj) ) ; jk = jk + 1 397 426 END DO 398 427 nk_rnf(ji,jj) = jk … … 435 464 ! ! - mixed upstream-centered (ln_traadv_cen2=T) 436 465 ! 437 IF 466 IF( ln_rnf_depth ) CALL ctl_warn( 'sbc_rnf_init: increased mixing turned on but effects may already', & 438 467 & 'be spread through depth by ln_rnf_depth' ) 439 468 !
Note: See TracChangeset
for help on using the changeset viewer.