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 12706 for NEMO/branches/UKMO/NEMO_4.0.2_ENHANCE-02_ISF_nemo/src/OCE/SBC/sbcrnf.F90 – NEMO

Ignore:
Timestamp:
2020-04-07T18:34:56+02:00 (4 years ago)
Author:
mathiot
Message:

NEMO_4.0.2_ENHANCE-02_ISF_nemo: in sync with trunk right before release_4.0-HEAD was created (svn merge -r 12072:12367 /NEMO/trunk)

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  
    2020   USE sbc_oce        ! surface boundary condition variables 
    2121   USE eosbn2         ! Equation Of State 
    22    USE closea        ! closed seas 
     22   USE closea, ONLY: l_clo_rnf, clo_rnf ! closed seas 
    2323   ! 
    2424   USE in_out_manager ! I/O manager 
     
    4242   REAL(wp)                   ::      rn_dep_max        !: depth over which runoffs is spread       (ln_rnf_depth_ini =T) 
    4343   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 
    4445   LOGICAL                    ::   ln_rnf_tem        !: temperature river runoffs attribute specified in a file 
    4546   LOGICAL           , PUBLIC ::   ln_rnf_sal        !: salinity    river runoffs attribute specified in a file 
    4647   TYPE(FLD_N)       , PUBLIC ::   sn_rnf            !: information about the runoff file to be read 
    4748   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 
    4850   TYPE(FLD_N)                ::   sn_s_rnf          !: information about the salinities of runoff file to be read 
    4951   TYPE(FLD_N)                ::   sn_t_rnf          !: information about the temperatures of runoff file to be read 
     
    6466 
    6567   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) 
    6669   TYPE(FLD),        ALLOCATABLE, DIMENSION(:) ::   sf_s_rnf     ! structure: river runoff salinity (file information, fields read)   
    6770   TYPE(FLD),        ALLOCATABLE, DIMENSION(:) ::   sf_t_rnf     ! structure: river runoff temperature (file information, fields read)   
     
    111114      !                                            !-------------------! 
    112115      ! 
    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 
    114121      IF(   ln_rnf_tem   )   CALL fld_read ( kt, nn_fsbc, sf_t_rnf )    ! idem for runoffs temperature if required 
    115122      IF(   ln_rnf_sal   )   CALL fld_read ( kt, nn_fsbc, sf_s_rnf )    ! idem for runoffs salinity    if required 
     
    117124      IF( MOD( kt - 1, nn_fsbc ) == 0 ) THEN 
    118125         ! 
    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 
    120134         ! 
    121135         !                                                           ! set temperature & salinity content of runoffs 
     
    128142         ELSE                                                        ! use SST as runoffs temperature 
    129143            !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_rau0 
     144            rnf_tsc(:,:,jp_tem) = MAX( sst_m(:,:), 0.0_wp ) * rnf(:,:) * r1_rau0 
    131145         ENDIF 
    132146         !                                                           ! use runoffs salinity data 
    133147         IF( ln_rnf_sal )   rnf_tsc(:,:,jp_sal) = ( sf_s_rnf(1)%fnow(:,:,1) ) * rnf(:,:) * r1_rau0 
    134148         !                                                           ! 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 flux 
     149                                         CALL iom_put( 'runoffs'     , rnf(:,:)                         )   ! output runoff mass flux 
    136150         IF( iom_use('hflx_rnf_cea') )   CALL iom_put( 'hflx_rnf_cea', rnf_tsc(:,:,jp_tem) * rau0 * rcp )   ! output runoff sensible heat (W/m2) 
    137151      ENDIF 
     
    238252      REAL(wp), DIMENSION(jpi,jpj,2) :: zrnfcl     
    239253      !! 
    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,   & 
    242256         &                 ln_rnf_mouth      , rn_hrnf     , rn_avt_rnf, rn_rfact,     & 
    243257         &                 ln_rnf_depth_ini  , rn_dep_max  , rn_rnf_max, nn_rnf_depth_file 
     
    261275      !                                   ! ============ 
    262276      ! 
    263       REWIND( numnam_ref )              ! Namelist namsbc_rnf in reference namelist : Runoffs  
     277      REWIND( numnam_ref ) 
    264278      READ  ( numnam_ref, namsbc_rnf, IOSTAT = ios, ERR = 901) 
    265279901   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namsbc_rnf in reference namelist' ) 
    266280 
    267       REWIND( numnam_cfg )              ! Namelist namsbc_rnf in configuration namelist : Runoffs 
     281      REWIND( numnam_cfg ) 
    268282      READ  ( numnam_cfg, namsbc_rnf, IOSTAT = ios, ERR = 902 ) 
    269283902   IF( ios >  0 )   CALL ctl_nam ( ios , 'namsbc_rnf in configuration namelist' ) 
     
    295309         IF( sn_rnf%ln_tint ) ALLOCATE( sf_rnf(1)%fdta(jpi,jpj,1,2) ) 
    296310         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 
    297326      ENDIF 
    298327      ! 
     
    337366               IF( h_rnf(ji,jj) > 0._wp ) THEN 
    338367                  jk = 2 
    339                   DO WHILE ( jk /= mbkt(ji,jj) .AND. gdept_0(ji,jj,jk) < h_rnf(ji,jj) ) ;  jk = jk + 1 
     368                  DO WHILE ( jk < mbkt(ji,jj) .AND. gdept_0(ji,jj,jk) < h_rnf(ji,jj) ) ;  jk = jk + 1 
    340369                  END DO 
    341370                  nk_rnf(ji,jj) = jk 
     
    394423               IF( zrnfcl(ji,jj,1) > 0._wp ) THEN 
    395424                  jk = 2 
    396                   DO WHILE ( jk /= mbkt(ji,jj) .AND. gdept_0(ji,jj,jk) < h_rnf(ji,jj) ) ;  jk = jk + 1 
     425                  DO WHILE ( jk < mbkt(ji,jj) .AND. gdept_0(ji,jj,jk) < h_rnf(ji,jj) ) ;  jk = jk + 1 
    397426                  END DO 
    398427                  nk_rnf(ji,jj) = jk 
     
    435464         !                                      !    - mixed upstream-centered (ln_traadv_cen2=T) 
    436465         ! 
    437          IF ( ln_rnf_depth )   CALL ctl_warn( 'sbc_rnf_init: increased mixing turned on but effects may already',   & 
     466         IF( ln_rnf_depth )   CALL ctl_warn( 'sbc_rnf_init: increased mixing turned on but effects may already',   & 
    438467            &                                              'be spread through depth by ln_rnf_depth'               ) 
    439468         ! 
Note: See TracChangeset for help on using the changeset viewer.