- Timestamp:
- 2013-01-23T15:33:04+01:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/OPA_SRC/SBC/sbcrnf.F90
r3680 r3764 6 6 !! History : OPA ! 2000-11 (R. Hordoir, E. Durand) NetCDF FORMAT 7 7 !! NEMO 1.0 ! 2002-09 (G. Madec) F90: Free form and module 8 !! 3.0 ! 2006-07 (G. Madec) Surface module 8 !! 3.0 ! 2006-07 (G. Madec) Surface module 9 9 !! 3.2 ! 2009-04 (B. Lemaire) Introduce iom_put 10 10 !! 3.3 ! 2010-10 (R. Furner, G. Madec) runoff distributed over ocean levels … … 31 31 PUBLIC sbc_rnf_div ! routine called in sshwzv module 32 32 PUBLIC sbc_rnf_alloc ! routine call in sbcmod module 33 33 PUBLIC sbc_rnf_init ! (PUBLIC for TAM) 34 34 ! !!* namsbc_rnf namelist * 35 35 CHARACTER(len=100), PUBLIC :: cn_dir = './' !: Root directory for location of ssr files 36 36 LOGICAL , PUBLIC :: ln_rnf_depth = .false. !: depth river runoffs attribute specified in a file 37 LOGICAL , PUBLIC :: ln_rnf_tem = .false. !: temperature river runoffs attribute specified in a file 38 LOGICAL , PUBLIC :: ln_rnf_sal = .false. !: salinity river runoffs attribute specified in a file 37 LOGICAL , PUBLIC :: ln_rnf_tem = .false. !: temperature river runoffs attribute specified in a file 38 LOGICAL , PUBLIC :: ln_rnf_sal = .false. !: salinity river runoffs attribute specified in a file 39 39 LOGICAL , PUBLIC :: ln_rnf_emp = .false. !: runoffs into a file to be read or already into precipitation 40 40 TYPE(FLD_N) , PUBLIC :: sn_rnf !: information about the runoff file to be read 41 41 TYPE(FLD_N) , PUBLIC :: sn_cnf !: information about the runoff mouth file to be read 42 TYPE(FLD_N) :: sn_s_rnf !: information about the salinities of runoff file to be read 43 TYPE(FLD_N) :: sn_t_rnf !: information about the temperatures of runoff file to be read 42 TYPE(FLD_N) :: sn_s_rnf !: information about the salinities of runoff file to be read 43 TYPE(FLD_N) :: sn_t_rnf !: information about the temperatures of runoff file to be read 44 44 TYPE(FLD_N) :: sn_dep_rnf !: information about the depth which river inflow affects 45 45 LOGICAL , PUBLIC :: ln_rnf_mouth = .false. !: specific treatment in mouths vicinity … … 53 53 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: h_rnf !: depth of runoff in m 54 54 INTEGER, PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: nk_rnf !: depth of runoff in model levels 55 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: rnf_tsc_b, rnf_tsc !: before and now T & S runoff contents [K.m/s & PSU.m/s] 56 55 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: rnf_tsc_b, rnf_tsc !: before and now T & S runoff contents [K.m/s & PSU.m/s] 57 56 58 57 TYPE(FLD), PUBLIC, ALLOCATABLE, DIMENSION(:) :: sf_rnf ! structure: river runoff (file information, fields read) … … 85 84 !!---------------------------------------------------------------------- 86 85 !! *** ROUTINE sbc_rnf *** 87 !! 86 !! 88 87 !! ** Purpose : Introduce a climatological run off forcing 89 88 !! 90 !! ** Method : Set each river mouth with a monthly climatology 89 !! ** Method : Set each river mouth with a monthly climatology 91 90 !! provided from different data. 92 91 !! CAUTION : upward water flux, runoff forced to be < 0 … … 98 97 INTEGER :: ji, jj ! dummy loop indices 99 98 !!---------------------------------------------------------------------- 100 ! 99 ! 101 100 IF( kt == nit000 ) CALL sbc_rnf_init ! Read namelist and allocate structures 102 101 … … 113 112 ! !-------------------! 114 113 ! 115 CALL fld_read ( kt, nn_fsbc, sf_rnf ) ! Read Runoffs data and provide it at kt 114 CALL fld_read ( kt, nn_fsbc, sf_rnf ) ! Read Runoffs data and provide it at kt 116 115 IF( ln_rnf_tem ) CALL fld_read ( kt, nn_fsbc, sf_t_rnf ) ! idem for runoffs temperature if required 117 116 IF( ln_rnf_sal ) CALL fld_read ( kt, nn_fsbc, sf_s_rnf ) ! idem for runoffs salinity if required … … 132 131 IF( ln_rnf_tem ) THEN ! use runoffs temperature data 133 132 rnf_tsc(:,:,jp_tem) = ( sf_t_rnf(1)%fnow(:,:,1) ) * rnf(:,:) * r1_rau0 134 WHERE( sf_t_rnf(1)%fnow(:,:,1) == -999 ) ! if missing data value use SST as runoffs temperature 133 WHERE( sf_t_rnf(1)%fnow(:,:,1) == -999 ) ! if missing data value use SST as runoffs temperature 135 134 rnf_tsc(:,:,jp_tem) = sst_m(:,:) * rnf(:,:) * r1_rau0 136 135 END WHERE 137 136 ELSE ! use SST as runoffs temperature 138 137 rnf_tsc(:,:,jp_tem) = sst_m(:,:) * rnf(:,:) * r1_rau0 139 ENDIF 140 ! ! use runoffs salinity data 138 ENDIF 139 ! ! use runoffs salinity data 141 140 IF( ln_rnf_sal ) rnf_tsc(:,:,jp_sal) = ( sf_s_rnf(1)%fnow(:,:,1) ) * rnf(:,:) * r1_rau0 142 141 ! ! else use S=0 for runoffs (done one for all in the init) 143 142 ! 144 143 IF( ln_rnf_tem .OR. ln_rnf_sal ) THEN ! runoffs as outflow: use ocean SST and SSS 145 WHERE( rnf(:,:) < 0._wp ) ! example baltic model when flow is out of domain 144 WHERE( rnf(:,:) < 0._wp ) ! example baltic model when flow is out of domain 146 145 rnf_tsc(:,:,jp_tem) = sst_m(:,:) * rnf(:,:) * r1_rau0 147 146 rnf_tsc(:,:,jp_sal) = sss_m(:,:) * rnf(:,:) * r1_rau0 … … 157 156 ! ! ---------------------------------------- ! 158 157 IF( ln_rstart .AND. & !* Restart: read in restart file 159 & iom_varid( numror, 'rnf_b', ldstop = .FALSE. ) > 0 ) THEN 158 & iom_varid( numror, 'rnf_b', ldstop = .FALSE. ) > 0 ) THEN 160 159 IF(lwp) WRITE(numout,*) ' nit000-1 runoff forcing fields red in the restart file' 161 160 CALL iom_get( numror, jpdom_autoglo, 'rnf_b', rnf_b ) ! before runoff … … 164 163 ELSE !* no restart: set from nit000 values 165 164 IF(lwp) WRITE(numout,*) ' nit000-1 runoff forcing fields set to nit000' 166 rnf_b (:,: ) = rnf (:,: ) 167 rnf_tsc_b(:,:,:) = rnf_tsc(:,:,:) 165 rnf_b (:,: ) = rnf (:,: ) 166 rnf_tsc_b(:,:,:) = rnf_tsc(:,:,:) 168 167 ENDIF 169 168 ENDIF … … 186 185 !!---------------------------------------------------------------------- 187 186 !! *** ROUTINE sbc_rnf *** 188 !! 187 !! 189 188 !! ** Purpose : update the horizontal divergence with the runoff inflow 190 189 !! 191 !! ** Method : 192 !! CAUTION : rnf is positive (inflow) decreasing the 190 !! ** Method : 191 !! CAUTION : rnf is positive (inflow) decreasing the 193 192 !! divergence and expressed in m/s 194 193 !! … … 204 203 ! 205 204 IF( ln_rnf_depth ) THEN !== runoff distributed over several levels ==! 206 IF( lk_vvl ) THEN ! variable volume case 205 IF( lk_vvl ) THEN ! variable volume case 207 206 DO jj = 1, jpj ! update the depth over which runoffs are distributed 208 207 DO ji = 1, jpi 209 h_rnf(ji,jj) = 0._wp 208 h_rnf(ji,jj) = 0._wp 210 209 DO jk = 1, nk_rnf(ji,jj) ! recalculates h_rnf to be the depth in metres 211 h_rnf(ji,jj) = h_rnf(ji,jj) + fse3t(ji,jj,jk) ! to the bottom of the relevant grid box 212 END DO 210 h_rnf(ji,jj) = h_rnf(ji,jj) + fse3t(ji,jj,jk) ! to the bottom of the relevant grid box 211 END DO 213 212 ! ! apply the runoff input flow 214 213 DO jk = 1, nk_rnf(ji,jj) … … 246 245 !! ** Action : - read parameters 247 246 !!---------------------------------------------------------------------- 248 CHARACTER(len=32) :: rn_dep_file ! runoff file name 247 CHARACTER(len=32) :: rn_dep_file ! runoff file name 249 248 INTEGER :: ji, jj, jk ! dummy loop indices 250 249 INTEGER :: ierror, inum ! temporary integer 251 250 ! 252 251 NAMELIST/namsbc_rnf/ cn_dir, ln_rnf_emp, ln_rnf_depth, ln_rnf_tem, ln_rnf_sal, & 253 & sn_rnf, sn_cnf , sn_s_rnf , sn_t_rnf , sn_dep_rnf, & 254 & ln_rnf_mouth , rn_hrnf , rn_avt_rnf, rn_rfact 252 & sn_rnf, sn_cnf , sn_s_rnf , sn_t_rnf , sn_dep_rnf, & 253 & ln_rnf_mouth , rn_hrnf , rn_avt_rnf, rn_rfact 255 254 !!---------------------------------------------------------------------- 256 255 ! … … 264 263 sn_cnf = FLD_N( 'runoffs', 0 , 'sorunoff' , .FALSE. , .true. , 'yearly' , '' , '' ) 265 264 266 sn_s_rnf = FLD_N( 'runoffs', 24. , 'rosaline' , .TRUE. , .true. , 'yearly' , '' , '' ) 267 sn_t_rnf = FLD_N( 'runoffs', 24. , 'rotemper' , .TRUE. , .true. , 'yearly' , '' , '' ) 268 sn_dep_rnf = FLD_N( 'runoffs', 0. , 'rodepth' , .FALSE. , .true. , 'yearly' , '' , '' ) 265 sn_s_rnf = FLD_N( 'runoffs', 24. , 'rosaline' , .TRUE. , .true. , 'yearly' , '' , '' ) 266 sn_t_rnf = FLD_N( 'runoffs', 24. , 'rotemper' , .TRUE. , .true. , 'yearly' , '' , '' ) 267 sn_dep_rnf = FLD_N( 'runoffs', 0. , 'rodepth' , .FALSE. , .true. , 'yearly' , '' , '' ) 269 268 ! 270 269 REWIND ( numnam ) ! Read Namelist namsbc_rnf … … 281 280 WRITE(numout,*) ' river mouth additional Kz rn_avt_rnf = ', rn_avt_rnf 282 281 WRITE(numout,*) ' depth of river mouth additional mixing rn_hrnf = ', rn_hrnf 283 WRITE(numout,*) ' multiplicative factor for runoff rn_rfact = ', rn_rfact 282 WRITE(numout,*) ' multiplicative factor for runoff rn_rfact = ', rn_rfact 284 283 ENDIF 285 284 ! … … 294 293 IF(lwp) WRITE(numout,*) ' runoffs directly provided in the precipitations' 295 294 IF( ln_rnf_depth .OR. ln_rnf_tem .OR. ln_rnf_sal ) THEN 296 CALL ctl_warn( 'runoffs already included in precipitations, so runoff (T,S, depth) attributes will not be used' ) 295 CALL ctl_warn( 'runoffs already included in precipitations, so runoff (T,S, depth) attributes will not be used' ) 297 296 ln_rnf_depth = .FALSE. ; ln_rnf_tem = .FALSE. ; ln_rnf_sal = .FALSE. 298 297 ENDIF … … 320 319 ALLOCATE( sf_t_rnf(1)%fnow(jpi,jpj,1) ) 321 320 IF( sn_t_rnf%ln_tint ) ALLOCATE( sf_t_rnf(1)%fdta(jpi,jpj,1,2) ) 322 CALL fld_fill (sf_t_rnf, (/ sn_t_rnf /), cn_dir, 'sbc_rnf_init', 'read runoff temperature data', 'namsbc_rnf' ) 321 CALL fld_fill (sf_t_rnf, (/ sn_t_rnf /), cn_dir, 'sbc_rnf_init', 'read runoff temperature data', 'namsbc_rnf' ) 323 322 ENDIF 324 323 ! … … 332 331 ALLOCATE( sf_s_rnf(1)%fnow(jpi,jpj,1) ) 333 332 IF( sn_s_rnf%ln_tint ) ALLOCATE( sf_s_rnf(1)%fdta(jpi,jpj,1,2) ) 334 CALL fld_fill (sf_s_rnf, (/ sn_s_rnf /), cn_dir, 'sbc_rnf_init', 'read runoff salinity data', 'namsbc_rnf' ) 335 ENDIF 336 ! 337 IF( ln_rnf_depth ) THEN ! depth of runoffs set from a file 333 CALL fld_fill (sf_s_rnf, (/ sn_s_rnf /), cn_dir, 'sbc_rnf_init', 'read runoff salinity data', 'namsbc_rnf' ) 334 ENDIF 335 ! 336 IF( ln_rnf_depth ) THEN ! depth of runoffs set from a file 338 337 IF(lwp) WRITE(numout,*) 339 338 IF(lwp) WRITE(numout,*) ' runoffs depth read in a file' 340 rn_dep_file = TRIM( cn_dir )//TRIM( sn_dep_rnf%clname ) 341 CALL iom_open ( rn_dep_file, inum ) ! open file 342 CALL iom_get ( inum, jpdom_data, sn_dep_rnf%clvar, h_rnf ) ! read the river mouth array 343 CALL iom_close( inum ) ! close file 339 rn_dep_file = TRIM( cn_dir )//TRIM( sn_dep_rnf%clname ) 340 CALL iom_open ( rn_dep_file, inum ) ! open file 341 CALL iom_get ( inum, jpdom_data, sn_dep_rnf%clvar, h_rnf ) ! read the river mouth array 342 CALL iom_close( inum ) ! close file 344 343 ! 345 344 nk_rnf(:,:) = 0 ! set the number of level over which river runoffs are applied 346 DO jj = 1, jpj 347 DO ji = 1, jpi 348 IF( h_rnf(ji,jj) > 0._wp ) THEN 349 jk = 2 350 DO WHILE ( jk /= mbkt(ji,jj) .AND. fsdept(ji,jj,jk) < h_rnf(ji,jj) ) ; jk = jk + 1 ; END DO 351 nk_rnf(ji,jj) = jk 352 ELSEIF( h_rnf(ji,jj) == -1 ) THEN ; nk_rnf(ji,jj) = 1353 ELSEIF( h_rnf(ji,jj) == -999 ) THEN ; nk_rnf(ji,jj) = mbkt(ji,jj)354 ELSE IF( h_rnf(ji,jj) /= 0 ) THEN355 CALL ctl_stop( 'runoff depth not positive, and not -999 or -1, rnf value in file fort.999' ) 356 WRITE(999,*) 'ji, jj, rnf(ji,jj) :', ji, jj, rnf(ji,jj) 357 ENDIF 358 END DO 359 END DO 360 DO jj = 1, jpj ! set the associated depth 361 DO ji = 1, jpi 345 DO jj = 1, jpj 346 DO ji = 1, jpi 347 IF( h_rnf(ji,jj) > 0._wp ) THEN 348 jk = 2 349 DO WHILE ( jk /= mbkt(ji,jj) .AND. fsdept(ji,jj,jk) < h_rnf(ji,jj) ) ; jk = jk + 1 ; END DO 350 nk_rnf(ji,jj) = jk 351 ELSEIF( h_rnf(ji,jj) == -1._wp ) THEN ; nk_rnf(ji,jj) = 1 352 ELSEIF( h_rnf(ji,jj) == -999._wp ) THEN ; nk_rnf(ji,jj) = mbkt(ji,jj) 353 ELSE 354 CALL ctl_stop( 'runoff depth not positive, and not -999 or -1, rnf value in file fort.999' ) 355 WRITE(999,*) 'ji, jj, rnf(ji,jj) :', ji, jj, rnf(ji,jj) 356 ENDIF 357 END DO 358 END DO 359 DO jj = 1, jpj ! set the associated depth 360 DO ji = 1, jpi 362 361 h_rnf(ji,jj) = 0._wp 363 DO jk = 1, nk_rnf(ji,jj) 364 h_rnf(ji,jj) = h_rnf(ji,jj) + fse3t(ji,jj,jk) 362 DO jk = 1, nk_rnf(ji,jj) 363 h_rnf(ji,jj) = h_rnf(ji,jj) + fse3t(ji,jj,jk) 365 364 END DO 366 365 END DO 367 366 END DO 368 ELSE ! runoffs applied at the surface 369 nk_rnf(:,:) = 1 367 ELSE ! runoffs applied at the surface 368 nk_rnf(:,:) = 1 370 369 h_rnf (:,:) = fse3t(:,:,1) 371 ENDIF 372 ! 370 ENDIF 371 ! 373 372 ENDIF 374 373 ! … … 386 385 ! 387 386 IF ( ln_rnf_depth ) CALL ctl_warn( 'sbc_rnf_init: increased mixing turned on but effects may already', & 388 & 'be spread through depth by ln_rnf_depth' ) 387 & 'be spread through depth by ln_rnf_depth' ) 389 388 ! 390 389 nkrnf = 0 ! Number of level over which Kz increase … … 406 405 IF(lwp) WRITE(numout,*) 407 406 IF(lwp) WRITE(numout,*) ' No specific treatment at river mouths' 408 rnfmsk (:,:) = 0._wp 407 rnfmsk (:,:) = 0._wp 409 408 rnfmsk_z(:) = 0._wp 410 409 nkrnf = 0 … … 417 416 !!---------------------------------------------------------------------- 418 417 !! *** ROUTINE rnf_mouth *** 419 !! 418 !! 420 419 !! ** Purpose : define the river mouths mask 421 420 !! 422 421 !! ** Method : read the river mouth mask (=0/1) in the river runoff 423 !! climatological file. Defined a given vertical structure. 424 !! CAUTION, the vertical structure is hard coded on the 422 !! climatological file. Defined a given vertical structure. 423 !! CAUTION, the vertical structure is hard coded on the 425 424 !! first 5 levels. 426 425 !! This fields can be used to: 427 !! - set an upstream advection scheme 426 !! - set an upstream advection scheme 428 427 !! (ln_rnf_mouth=T and ln_traadv_cen2=T) 429 !! - increase vertical on the top nn_krnf vertical levels 428 !! - increase vertical on the top nn_krnf vertical levels 430 429 !! at river runoff input grid point (nn_krnf>=2, see step.F90) 431 430 !! - set to zero SSS restoring flux at river mouth grid points … … 437 436 CHARACTER(len=140) :: cl_rnfile ! runoff file name 438 437 !!---------------------------------------------------------------------- 439 ! 438 ! 440 439 IF(lwp) WRITE(numout,*) 441 440 IF(lwp) WRITE(numout,*) 'rnf_mouth : river mouth mask' … … 454 453 IF( nn_closea == 1 ) CALL clo_rnf( rnfmsk ) ! closed sea inflow set as ruver mouth 455 454 ! 456 rnfmsk_z(:) = 0._wp ! vertical structure 455 rnfmsk_z(:) = 0._wp ! vertical structure 457 456 rnfmsk_z(1) = 1.0 458 457 rnfmsk_z(2) = 1.0 ! ********** … … 460 459 rnfmsk_z(4) = 0.25 ! ********** 461 460 rnfmsk_z(5) = 0.125 462 ! 461 ! 463 462 END SUBROUTINE rnf_mouth 464 463 465 464 !!====================================================================== 466 465 END MODULE sbcrnf
Note: See TracChangeset
for help on using the changeset viewer.