MODULE sbcrnf !!====================================================================== !! *** MODULE sbcrnf *** !! Ocean forcing: river runoff !!===================================================================== !! History : ! 00-11 (R. Hordoir, E. Durand) NetCDF FORMAT !! 8.5 ! 02-09 (G. Madec) F90: Free form and module !! 9.0 ! 06-07 (G. Madec) Surface module !!---------------------------------------------------------------------- !!---------------------------------------------------------------------- !! sbc_rnf : monthly runoffs read in a NetCDF file !! rnf_mouth : set river mouth mask !!---------------------------------------------------------------------- USE dom_oce ! ocean space and time domain USE phycst ! physical constants USE dom_oce ! ocean domain variables USE sbc_oce ! surface boundary condition variables USE fldread ! ??? USE in_out_manager ! I/O manager USE daymod ! calendar USE iom ! I/O module IMPLICIT NONE PRIVATE PUBLIC sbc_rnf ! routine call in step module !! * namsbc_rnf namelist CHARACTER(len=100), PUBLIC :: cn_dir = './' !: Root directory for location of ssr files INTEGER , PUBLIC :: nn_runoff = 1 !: runoffs flag REAL(wp) , PUBLIC :: rn_hrnf = 0.e0 !: runoffs, depth over which enhanced vertical mixing is used REAL(wp) , PUBLIC :: rn_avt_rnf = 0.e0 !: runoffs, value of the additional vertical mixing coef. [m2/s] TYPE(FLD_N) , PUBLIC :: sn_rnf !: information about the runoff file to be read TYPE(FLD_N) , PUBLIC :: sn_cnf !: information about the runoff mouth file to be read NAMELIST/namsbc_rnf/ cn_dir, nn_runoff, rn_hrnf, rn_avt_rnf, sn_rnf, sn_cnf INTEGER , PUBLIC :: nkrnf = 0 !: number of levels over which Kz is increased at river mouths REAL(wp), PUBLIC, DIMENSION(jpi,jpj) :: rnfmsk !: river mouth mask (hori.) REAL(wp), PUBLIC, DIMENSION(jpk) :: rnfmsk_z !: river mouth mask (vert.) TYPE(FLD), ALLOCATABLE, DIMENSION(:) :: sf_rnf ! structure of input SST (file information, fields read) !!---------------------------------------------------------------------- !! OPA 9.0 , LOCEAN-IPSL (2006) !! $ Id: $ !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) !!---------------------------------------------------------------------- CONTAINS SUBROUTINE sbc_rnf( kt ) !!---------------------------------------------------------------------- !! *** ROUTINE sbc_rnf *** !! !! ** Purpose : Introduce a climatological run off forcing !! !! ** Method : Set each river mouth with a monthly climatology !! provided from different data. !! CAUTION : upward water flux, runoff forced to be < 0 !! !! ** Action : runoff updated runoff field at time-step kt !!---------------------------------------------------------------------- INTEGER, INTENT(in) :: kt ! ocean time step ! INTEGER :: ji, jj ! dummy loop indices INTEGER :: ierror ! temporary integer !!---------------------------------------------------------------------- ! !------------------! IF( kt == nit000 ) THEN ! Initialisation ! ! !------------------! ! Default values (NB: frequency positive => hours, negative => months) ! ! file ! frequency ! variable ! time intep ! clim ! starting ! ! ! name ! (hours) ! name ! (T/F) ! (0/1) ! record ! sn_rnf = FLD_N( 'runoffs', -12. , 'sorunoff' , .TRUE. , 1 , 0 ) sn_cnf = FLD_N( 'runoffs', 0. , 'sorunoff' , .FALSE. , 1 , 0 ) ! REWIND ( numnam ) ! Read Namelist namsbc_rnf READ ( numnam, namsbc_rnf ) ! Control print IF(lwp) THEN WRITE(numout,*) WRITE(numout,*) 'sbc_rnf : runoff ' WRITE(numout,*) '~~~~~~~ ' WRITE(numout,*) ' Namelist namsbc_rnf' WRITE(numout,*) ' runoff type (=-1/1/2) nn_runoff = ', nn_runoff WRITE(numout,*) ' river mouth additional Kz rn_avt_rnf = ', rn_avt_rnf WRITE(numout,*) ' depth of river mouth additional mixing rn_hrnf = ', rn_hrnf ENDIF IF( nn_runoff >= 1 ) THEN ! set sf_rnf structure ! ALLOCATE( sf_rnf(1), STAT=ierror ) IF( ierror > 0 ) THEN CALL ctl_stop( 'sbc_rnf: unable to allocate sf_rnf structure' ) ; RETURN ENDIF ! namelist informations stored in sf_rnf structures WRITE( sf_rnf(1)%clrootname, '(a,a)' ) TRIM( cn_dir ), TRIM( sn_rnf%clname ) sf_rnf(1)%freqh = sn_rnf%freqh sf_rnf(1)%clvar = sn_rnf%clvar sf_rnf(1)%ln_tint = sn_rnf%ln_tint sf_rnf(1)%nclim = sn_rnf%nclim sf_rnf(1)%nstrec = sn_rnf%nstrec IF(lwp) THEN ! control print WRITE(numout,*) ' Runoffs data read in the following file: ' WRITE(numout,*) ' root filename: ' , trim( sf_rnf(1)%clrootname ), & & ' variable name: ' , trim( sf_rnf(1)%clvar ) WRITE(numout,*) ' frequency: ' , sf_rnf(1)%freqh , & & ' time interp: ' , sf_rnf(1)%ln_tint , & & ' climatology: ' , sf_rnf(1)%nclim , & & ' starting record: ', sf_rnf(1)%nstrec ENDIF ENDIF IF( nn_runoff == 1 ) THEN IF(lwp) WRITE(numout,*) IF(lwp) WRITE(numout,*) ' No specific treatment at river mouths' rnfmsk (:,:) = 0.e0 rnfmsk_z(:) = 0.e0 nkrnf = 0 ELSE ! ! Number of level over which Kz increase in vicinity of river mouths IF( rn_hrnf == 0.e0 ) THEN nkrnf = 0 ELSE nkrnf = 2 DO WHILE( nkrnf == jpkm1 .OR. gdepw_0(nkrnf) > rn_hrnf ) nkrnf = nkrnf + 1 END DO IF( ln_sco ) & CALL ctl_warn( 'sbc_rnf: number of levels over which Kz is increased is computed for zco...' ) ENDIF ! ! river mouths mask CALL rnf_mouth ! set river mouth mask ! ENDIF IF( nn_runoff /= -1 .AND. nn_runoff /= 1 .AND. nn_runoff /= 2 ) THEN WRITE(ctmp1,*) 'sbc_rnf: Error nn_runoff = ', nn_runoff, ' /= -1, 1 or 2' CALL ctl_stop( ctmp1 ) ENDIF ! Control print IF(lwp) THEN IF( nn_runoff == -1 ) THEN WRITE(numout,*) ' runoff directly provided in the precipitations' ELSE WRITE(numout,*) ' monthly runoff read in NetCDF file ' ENDIF IF( nn_runoff == 1 ) THEN WRITE(numout,*) ' No Kz increase nor upstream advection at river mouths' ELSE IF(lwp) WRITE(numout,*) ' mixed upstream/centered at river mouths (ln_traadv_cen2=T) ' IF(lwp) WRITE(numout,*) ' Kz is increased by ', rn_avt_rnf,' m2/s over ', nkrnf, ' w-levels' ENDIF ENDIF ! ENDIF ! !-------------------! IF( nn_runoff == 1 .OR. nn_runoff == 2 ) THEN ! Update runoff ! ! !-------------------! ! CALL fld_read( kt, nn_fsbc, sf_rnf ) ! Read Runoffs data and provides it ! ! at the current time-step ! Runoff reduction only associated to the ORCA2_LIM configuration ! when reading the NetCDF file runoff_1m_nomask.nc IF( cp_cfg == 'orca' .AND. jp_cfg == 2 ) THEN DO jj = 1, jpj DO ji = 1, jpi IF( gphit(ji,jj) > 40 .AND. gphit(ji,jj) < 65 ) sf_rnf(1)%fnow(ji,jj) = 0.85 * sf_rnf(1)%fnow(ji,jj) END DO END DO ENDIF ! C a u t i o n : runoff is negative and in kg/m2/s emp (:,:) = emp (:,:) - ABS( sf_rnf(1)%fnow(:,:) ) emps(:,:) = emps(:,:) - ABS( sf_rnf(1)%fnow(:,:) ) ! ENDIF ! END SUBROUTINE sbc_rnf SUBROUTINE rnf_mouth !!---------------------------------------------------------------------- !! *** ROUTINE rnf_mouth *** !! !! ** Purpose : define the river mouths mask !! !! ** Method : read the river mouth mask (=0/1) in the river runoff !! climatological file. Defined a given vertical structure. !! CAUTION, the vertical structure is hard coded on the !! first 5 levels. !! This fields can be used to: !! - set an upstream advection scheme !! (nn_runoff=2 and ln_traadv_cen2=T) !! - increase vertical on the top nn_krnf vertical levels !! at river runoff input grid point (nn_krnf>=2, see step.F90) !! - set to zero SSS restoring flux at river mouth grid points !! !! ** Action : rnfmsk set to 1 at river runoff input, 0 elsewhere !! rnfmsk_z vertical structure !!---------------------------------------------------------------------- USE closea, ONLY : nclosea, clo_rnf ! closed sea flag, rnfmsk update routine ! INTEGER :: inum ! temporary integers CHARACTER(len=32) :: cl_rnfile ! runoff file name !!---------------------------------------------------------------------- ! IF(lwp) WRITE(numout,*) IF(lwp) WRITE(numout,*) 'rnf_mouth : river mouth mask' IF(lwp) WRITE(numout,*) '~~~~~~~~~ ' WRITE(cl_rnfile, '(a,a)') TRIM( cn_dir ), TRIM( sn_cnf%clname ) SELECT CASE( sn_cnf%nclim ) CASE( 0 ) WRITE(cl_rnfile, '(a,a,"_",i4,".nc")' ) TRIM( cn_dir ), TRIM( sn_cnf%clname ), nyear CASE( 1 ) WRITE(cl_rnfile, '(a,a, "_0000.nc")' ) TRIM( cn_dir ), TRIM( sn_cnf%clname ) END SELECT ! horizontal mask (read in NetCDF file) CALL iom_open ( cl_rnfile, inum ) ! open file CALL iom_get ( inum, jpdom_data, sn_cnf%clvar, rnfmsk ) ! read the river mouth array CALL iom_close( inum ) ! close file IF( nclosea == 1 ) CALL clo_rnf( rnfmsk ) ! closed sea inflow set as ruver mouth rnfmsk_z(:) = 0.e0 ! vertical structure rnfmsk_z(1) = 1.0 rnfmsk_z(2) = 1.0 ! ********** rnfmsk_z(3) = 0.5 ! HARD CODED on the 5 first levels rnfmsk_z(4) = 0.25 ! ********** rnfmsk_z(5) = 0.125 ! END SUBROUTINE rnf_mouth !!====================================================================== END MODULE sbcrnf