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 12074 for NEMO/branches/2019/dev_ASINTER-01-05_merged/src/OCE/SBC/sbcblk.F90 – NEMO

Ignore:
Timestamp:
2019-12-05T17:54:17+01:00 (4 years ago)
Author:
laurent
Message:

Fixed namelist hphi/hpgj issue + added sanity check for air humidity.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2019/dev_ASINTER-01-05_merged/src/OCE/SBC/sbcblk.F90

    r12063 r12074  
    392392      !!---------------------------------------------------------------------- 
    393393      INTEGER, INTENT(in) ::   kt   ! ocean time step 
    394       !! 
     394      !!---------------------------------------------------------------------- 
    395395      REAL(wp), DIMENSION(jpi,jpj) ::   zssq, zcd_du, zsen, zevp 
    396       !!--------------------------------------------------------------------- 
     396      REAL(wp) :: ztmp 
     397      !!---------------------------------------------------------------------- 
    397398      ! 
    398399      CALL fld_read( kt, nn_fsbc, sf )             ! input fields provided at the current time-step 
    399       ! 
     400 
     401      ! Sanity/consistence test on humidity at first time step to detect potential screw-up: 
     402      IF( kt == nit000 ) THEN 
     403         WRITE(numout,*) '' 
     404         ztmp = SUM(tmask(:,:,1)) ! number of ocean points on local proc domain 
     405         IF( ztmp > 8._wp ) THEN ! test only on proc domains with at least 8 ocean points! 
     406            ztmp = SUM(sf(jp_humi)%fnow(:,:,1)*tmask(:,:,1))/ztmp ! mean humidity over ocean on proc 
     407            SELECT CASE( nhumi ) 
     408            CASE( np_humi_sph ) ! specific humidity => expect: 0. <= something < 0.065 [kg/kg] (0.061 is saturation at 45degC !!!) 
     409               IF(  (ztmp < 0._wp) .OR. (ztmp > 0.065)  ) ztmp = -1._wp 
     410            CASE( np_humi_dpt ) ! dew-point temperature => expect: 110. <= something < 320. [K] 
     411               IF( (ztmp < 110._wp).OR.(ztmp > 320._wp) ) ztmp = -1._wp 
     412            CASE( np_humi_rlh ) ! relative humidity => expect: 0. <= something < 100. [%] 
     413               IF(  (ztmp < 0._wp) .OR.(ztmp > 100._wp) ) ztmp = -1._wp 
     414            END SELECT 
     415            IF(ztmp < 0._wp) THEN 
     416               WRITE(numout,'("   Mean humidity value found on proc #",i5.5," is: ",f)'), narea, ztmp 
     417               CALL ctl_stop( 'STOP', 'Something is wrong with air humidity!!!', & 
     418                  &   ' ==> check the unit in your input files'       , & 
     419                  &   ' ==> check consistence of namelist choice: specific? relative? dew-point?', & 
     420                  &   ' ==> ln_humi_sph -> [kg/kg] | ln_humi_rlh -> [%] | ln_humi_dpt -> [K] !!!' ) 
     421            END IF 
     422         END IF 
     423         WRITE(numout,*) ' === Sanity/consistence test on air humidity sucessfuly passed! ===' 
     424         WRITE(numout,*) '' 
     425      END IF !IF( kt == nit000 ) 
     426 
    400427      !                                            ! compute the surface ocean fluxes using bulk formulea 
    401428      IF( MOD( kt - 1, nn_fsbc ) == 0 ) THEN 
Note: See TracChangeset for help on using the changeset viewer.