Changeset 12064


Ignore:
Timestamp:
2019-12-05T11:59:14+01:00 (6 weeks ago)
Author:
laurent
Message:

Added sanity/consistence check on air humidity.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2019/dev_r11085_ASINTER-05_Brodeau_Advanced_Bulk/src/OCE/SBC/sbcblk.F90

    r12058 r12064  
    107107   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   cdn_oce, chn_oce, cen_oce ! needed by Lupkes 2015 bulk scheme 
    108108 
    109    !LB: 
    110109   LOGICAL  ::   ln_skin_cs     ! use the cool-skin (only available in ECMWF and COARE algorithms) !LB 
    111110   LOGICAL  ::   ln_skin_wl     ! use the warm-layer parameterization (only available in ECMWF and COARE algorithms) !LB 
     
    119118   INTEGER, PARAMETER :: np_humi_dpt = 2 
    120119   INTEGER, PARAMETER :: np_humi_rlh = 3 
    121    !LB. 
    122120 
    123121   INTEGER  ::   nblk           ! choice of the bulk algorithm 
     
    216214            & CALL ctl_stop( 'sbc_blk_init: Please set "nn_fsbc" to 1 when using cool-skin/warm-layer param.') 
    217215      END IF 
    218        
     216 
    219217      IF( ln_skin_wl ) THEN 
    220218         !! Check if the frequency of downwelling solar flux input makes sense and if ln_dm2dc=T if it is daily! 
     
    224222            & CALL ctl_stop( 'sbc_blk_init: Please set ln_dm2dc=T for warm-layer param. (ln_skin_wl) to work properly' ) 
    225223      END IF 
    226        
     224 
    227225      ioptio = 0 
    228226      IF( ln_humi_sph ) THEN 
     
    369367      INTEGER, INTENT(in) ::   kt   ! ocean time step 
    370368      !!--------------------------------------------------------------------- 
     369      REAL(wp) :: ztmp 
     370      !!--------------------------------------------------------------------- 
    371371      ! 
    372372      CALL fld_read( kt, nn_fsbc, sf )             ! input fields provided at the current time-step 
    373       ! 
     373 
     374      ! Sanity/consistence test on humidity at first time step to detect potential screw-up: 
     375      IF( kt == nit000 ) THEN 
     376         WRITE(numout,*) '' 
     377         ztmp = SUM(tmask(:,:,1)) ! number of ocean points on local proc domain 
     378         IF( ztmp > 8._wp ) THEN ! test only on proc domains with at least 8 ocean points! 
     379            ztmp = SUM(sf(jp_humi)%fnow(:,:,1)*tmask(:,:,1))/ztmp ! mean humidity over ocean on proc 
     380            SELECT CASE( nhumi ) 
     381            CASE( np_humi_sph ) ! specific humidity => expect: 0. <= something < 0.065 [kg/kg] (0.061 is saturation at 45degC !!!) 
     382               IF(  (ztmp < 0._wp) .OR. (ztmp > 0.065)  ) ztmp = -1._wp 
     383            CASE( np_humi_dpt ) ! dew-point temperature => expect: 110. <= something < 320. [K] 
     384               IF( (ztmp < 110._wp).OR.(ztmp > 320._wp) ) ztmp = -1._wp 
     385            CASE( np_humi_rlh ) ! relative humidity => expect: 0. <= something < 100. [%] 
     386               IF(  (ztmp < 0._wp) .OR.(ztmp > 100._wp) ) ztmp = -1._wp 
     387            END SELECT 
     388            IF(ztmp < 0._wp) THEN 
     389               WRITE(numout,'("   Mean humidity value found on proc #",i5.5," is: ",f)'), narea, ztmp 
     390               CALL ctl_stop( 'STOP', 'Something is wrong with air humidity!!!', & 
     391                  &   ' ==> check the unit in your input files'       , & 
     392                  &   ' ==> check consistence of namelist choice: specific? relative? dew-point?', & 
     393                  &   ' ==> ln_humi_sph -> [kg/kg] | ln_humi_rlh -> [%] | ln_humi_dpt -> [K] !!!' ) 
     394            END IF 
     395         END IF 
     396         WRITE(numout,*) ' === Sanity/consistence test on air humidity sucessfuly passed! ===' 
     397         WRITE(numout,*) '' 
     398      END IF !IF( kt == nit000 ) 
     399 
    374400      !                                            ! compute the surface ocean fluxes using bulk formulea 
    375401      IF( MOD( kt - 1, nn_fsbc ) == 0 )   CALL blk_oce( kt, sf, sst_m, ssu_m, ssv_m ) 
     
    522548      END DO 
    523549 
    524        
     550 
    525551      !! Time to call the user-selected bulk parameterization for 
    526552      !!  ==  transfer coefficients  ==!   Cd, Ch, Ce at T-point, and more... 
     
    592618      zwnd_i(:,:) = Cd_atm(:,:) * zwnd_i(:,:) 
    593619      zwnd_j(:,:) = Cd_atm(:,:) * zwnd_j(:,:) 
    594        
     620 
    595621      !                          ! add the HF tau contribution to the wind stress module 
    596622      IF( lhftau )   taum(:,:) = taum(:,:) + sf(jp_tdif)%fnow(:,:,1) 
     
    664690      CALL iom_put( 'precip' , tprecip )                 ! Total precipitation 
    665691      ! 
    666       IF ( nn_ice == 0 ) THEN 
     692      IF( nn_ice == 0 ) THEN 
    667693         CALL iom_put( "qemp_oce" ,   qns-zqlw-zqsb-zqla )   ! output downward heat content of E-P over the ocean 
    668694         CALL iom_put( "qns_oce"  ,   qns  )                 ! output downward non solar heat over the ocean 
     
    735761      ! 
    736762      ! Make ice-atm. drag dependent on ice concentration 
    737       IF    ( ln_Cd_L12 ) THEN   ! calculate new drag from Lupkes(2012) equations 
     763      IF( ln_Cd_L12 ) THEN   ! calculate new drag from Lupkes(2012) equations 
    738764         CALL Cdn10_Lupkes2012( Cd_atm ) 
    739765         Ch_atm(:,:) = Cd_atm(:,:)       ! momentum and heat transfer coef. are considered identical 
Note: See TracChangeset for help on using the changeset viewer.