New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Changeset 5327 for branches – NEMO

Changeset 5327 for branches


Ignore:
Timestamp:
2015-06-01T12:31:30+02:00 (9 years ago)
Author:
cetlod
Message:

NEMOGCM_dev_r5204_CNRS_PISCES_dcy : Add an option which gives the possibility to create a runoff depht file from runoff climatology

Location:
branches/2015/dev_r5204_CNRS_PISCES_dcy/NEMOGCM
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/2015/dev_r5204_CNRS_PISCES_dcy/NEMOGCM/CONFIG/SHARED/namelist_ref

    r5190 r5327  
    420420   ln_rnf_tem   = .false.   !  read in temperature information for runoff 
    421421   ln_rnf_sal   = .false.   !  read in salinity information for runoff 
     422   ln_rnf_depth_ini = .false.  ! compute depth at initialisation from runoff file 
     423   rn_rnf_max   = 5.735e-4  !  max value of the runoff climatologie over global domain ( ln_rnf_depth_ini = .true ) 
     424   rn_dep_max   = 150.      !  depth over which runoffs is spread ( ln_rnf_depth_ini = .true ) 
     425   nn_rnf_depth_file = 0    !  create (=1) a runoff depth file or not (=0) 
    422426/ 
    423427!----------------------------------------------------------------------- 
  • branches/2015/dev_r5204_CNRS_PISCES_dcy/NEMOGCM/NEMO/OPA_SRC/SBC/sbcrnf.F90

    r5226 r5327  
    3737   !                                                     !!* namsbc_rnf namelist * 
    3838   CHARACTER(len=100), PUBLIC ::   cn_dir          !: Root directory for location of ssr files 
    39    LOGICAL           , PUBLIC ::   ln_rnf_depth    !: depth       river runoffs attribute specified in a file 
     39   LOGICAL           , PUBLIC ::   ln_rnf_depth      !: depth       river runoffs attribute specified in a file 
     40   LOGICAL                    ::   ln_rnf_depth_ini  !: depth       river runoffs  computed at the initialisation 
     41   REAL(wp)                   ::   rn_rnf_max        !: maximum value of the runoff climatologie ( ln_rnf_depth_ini = .true ) 
     42   REAL(wp)                   ::   rn_dep_max        !: depth over which runoffs is spread ( ln_rnf_depth_ini = .true ) 
     43   INTEGER                    ::   nn_rnf_depth_file !: create (=1) a runoff depth file or not (=0) 
    4044   LOGICAL           , PUBLIC ::   ln_rnf_tem      !: temperature river runoffs attribute specified in a file 
    4145   LOGICAL           , PUBLIC ::   ln_rnf_sal      !: salinity    river runoffs attribute specified in a file 
     
    104108      ! 
    105109      CALL wrk_alloc( jpi,jpj, ztfrz) 
     110 
     111      ! 
     112      IF( kt == nit000 )   CALL sbc_rnf_init                           ! Read namelist and allocate structures 
    106113 
    107114      !                                            ! ---------------------------------------- ! 
     
    252259      !!---------------------------------------------------------------------- 
    253260      CHARACTER(len=32) ::   rn_dep_file   ! runoff file name 
    254       INTEGER           ::   ji, jj, jk    ! dummy loop indices 
     261      INTEGER           ::   ji, jj, jk, jm    ! dummy loop indices 
    255262      INTEGER           ::   ierror, inum  ! temporary integer 
    256263      INTEGER           ::   ios           ! Local integer output status for namelist read 
     264      INTEGER           ::   nbrec         ! temporary integer 
     265      REAL(wp)          ::   zacoef   
     266      REAL(wp), DIMENSION(12)                 :: zrec             ! times records 
     267      REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: zrnfcl     
     268      REAL(wp), DIMENSION(:,:  ), ALLOCATABLE :: zrnf 
    257269      ! 
    258270      NAMELIST/namsbc_rnf/ cn_dir, ln_rnf_emp, ln_rnf_depth, ln_rnf_tem, ln_rnf_sal,   & 
    259271         &                 sn_rnf, sn_cnf    , sn_s_rnf    , sn_t_rnf  , sn_dep_rnf,   & 
    260          &                 ln_rnf_mouth      , rn_hrnf     , rn_avt_rnf, rn_rfact 
     272         &                 ln_rnf_mouth      , rn_hrnf     , rn_avt_rnf, rn_rfact,     & 
     273         &                 ln_rnf_depth_ini  , rn_dep_max  , rn_rnf_max, nn_rnf_depth_file 
    261274      !!---------------------------------------------------------------------- 
    262275      ! 
     
    296309         IF(lwp) WRITE(numout,*) 
    297310         IF(lwp) WRITE(numout,*) '          runoffs directly provided in the precipitations' 
    298          IF( ln_rnf_depth .OR. ln_rnf_tem .OR. ln_rnf_sal ) THEN 
     311         IF( ln_rnf_depth .OR. ln_rnf_tem .OR. ln_rnf_sal .OR. ln_rnf_depth_ini ) THEN 
    299312           CALL ctl_warn( 'runoffs already included in precipitations, so runoff (T,S, depth) attributes will not be used' ) 
    300            ln_rnf_depth = .FALSE.   ;   ln_rnf_tem = .FALSE.   ;   ln_rnf_sal = .FALSE. 
     313           ln_rnf_depth = .FALSE.   ;   ln_rnf_tem = .FALSE.   ;   ln_rnf_sal = .FALSE.  ;   ln_rnf_depth_ini = .FALSE. 
    301314         ENDIF 
    302315         ! 
     
    372385               END DO 
    373386            END DO 
     387            ! 
     388         ELSE IF( ln_rnf_depth_ini ) THEN           ! runoffs applied at the surface 
     389            ! 
     390            IF(lwp) WRITE(numout,*) 
     391            IF(lwp) WRITE(numout,*) '    depth of runoff computed once from max value of runoff' 
     392            IF(lwp) WRITE(numout,*) '    max value of the runoff climatologie (over global domain) rn_rnf_max = ', rn_rnf_max 
     393            IF(lwp) WRITE(numout,*) '    depth over which runoffs is spread                        rn_dep_max = ', rn_dep_max 
     394            IF(lwp) WRITE(numout,*) '     create (=1) a runoff depth file or not (=0)      nn_rnf_depth_file  = ', nn_rnf_depth_file 
     395 
     396            CALL iom_open( TRIM( sn_rnf%clname ), inum )    !  open runoff file 
     397            CALL iom_gettime( inum, zrec, kntime=nbrec) 
     398            ALLOCATE( zrnfcl(jpi,jpj,nbrec) )     ;      ALLOCATE( zrnf(jpi,jpj) ) 
     399            DO jm = 1, nbrec 
     400               CALL iom_get( inum, jpdom_data, TRIM( sn_rnf%clvar ), zrnfcl(:,:,jm), jm ) 
     401            END DO 
     402            CALL iom_close( inum ) 
     403            zrnf(:,:) = MAXVAL( zrnfcl(:,:,:), DIM=3 )   !  maximum value in time 
     404            DEALLOCATE( zrnfcl ) 
     405            ! 
     406            h_rnf(:,:) = 1. 
     407            ! 
     408            zacoef = rn_dep_max / rn_rnf_max            ! coef of linear relation between runoff and its depth (150m for max of runoff) 
     409            ! 
     410            WHERE( zrnf(:,:) > 0._wp )  h_rnf(:,:) = zacoef * zrnf(:,:)   ! compute depth for all runoffs 
     411            ! 
     412            DO jj = 1, jpj                     ! take in account min depth of ocean rn_hmin 
     413               DO ji = 1, jpi 
     414                  IF( zrnf(ji,jj) > 0._wp ) THEN 
     415                     jk = mbkt(ji,jj) 
     416                     h_rnf(ji,jj) = MIN( h_rnf(ji,jj), gdept_0(ji,jj,jk ) ) 
     417                  ENDIF 
     418               END DO 
     419            END DO 
     420            ! 
     421            nk_rnf(:,:) = 0                       ! number of levels on which runoffs are distributed 
     422            DO jj = 1, jpj 
     423               DO ji = 1, jpi 
     424                   IF( zrnf(ji,jj) > 0._wp ) THEN 
     425                     jk = 2 
     426                     DO WHILE ( jk /= mbkt(ji,jj) .AND. gdept_0(ji,jj,jk) < h_rnf(ji,jj) ) ;  jk = jk + 1 ;  END DO 
     427                     nk_rnf(ji,jj) = jk 
     428                   ELSE 
     429                     nk_rnf(ji,jj) = 1 
     430                   ENDIF 
     431                END DO 
     432            END DO 
     433            ! 
     434            DEALLOCATE( zrnf ) 
     435            ! 
     436            DO jj = 1, jpj                                ! set the associated depth 
     437               DO ji = 1, jpi 
     438                  h_rnf(ji,jj) = 0._wp 
     439                  DO jk = 1, nk_rnf(ji,jj) 
     440                     h_rnf(ji,jj) = h_rnf(ji,jj) + fse3t(ji,jj,jk) 
     441                  END DO 
     442               END DO 
     443            END DO 
     444            ! 
     445            IF( nn_rnf_depth_file == 1 ) THEN      !  save  output nb levels for runoff 
     446               IF(lwp) WRITE(numout,*) '              create runoff depht file' 
     447               CALL iom_open  ( TRIM( sn_dep_rnf%clname ), inum, ldwrt = .TRUE., kiolib = jprstlib ) 
     448               CALL iom_rstput( 0, 0, inum, 'rodepth', h_rnf ) 
     449               CALL iom_close ( inum ) 
     450            ENDIF 
    374451         ELSE                                       ! runoffs applied at the surface 
    375452            nk_rnf(:,:) = 1 
Note: See TracChangeset for help on using the changeset viewer.