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 15799 for NEMO/branches/UKMO/NEMO_4.0.4_FOAM_package/src/OCE/OBS/obs_readmdt.F90 – NEMO

Ignore:
Timestamp:
2022-04-25T17:15:21+02:00 (2 years ago)
Author:
dford
Message:

More generic interface and structure for OBS code. See Met Office utils tickets 471 and 530.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/UKMO/NEMO_4.0.4_FOAM_package/src/OCE/OBS/obs_readmdt.F90

    r14075 r15799  
    3131    
    3232   PUBLIC   obs_rea_mdt     ! called by dia_obs_init 
    33    PUBLIC   obs_offset_mdt  ! called by obs_rea_mdt 
    34  
    35    INTEGER , PUBLIC :: nn_msshc    = 1         ! MDT correction scheme 
    36    REAL(wp), PUBLIC :: rn_mdtcorr   = 1.61_wp  ! User specified MDT correction 
    37    REAL(wp), PUBLIC :: rn_mdtcutoff = 65.0_wp  ! MDT cutoff for computed correction 
    3833 
    3934   !!---------------------------------------------------------------------- 
     
    4439CONTAINS 
    4540 
    46    SUBROUTINE obs_rea_mdt( sladata, k2dint ) 
     41   SUBROUTINE obs_rea_mdt( sladata, k2dint, kmdt, nn_msshc, rn_mdtcorr, & 
     42                           rn_mdtcutoff ) 
    4743      !!--------------------------------------------------------------------- 
    4844      !! 
     
    5753      USE iom 
    5854      ! 
    59       TYPE(obs_surf), INTENT(inout) ::   sladata   ! SLA data 
    60       INTEGER       , INTENT(in)    ::   k2dint    ! ? 
     55      TYPE(obs_surf), INTENT(inout) :: sladata      ! SLA data 
     56      INTEGER       , INTENT(in)    :: k2dint       ! Interpolation type 
     57      INTEGER       , INTENT(in)    :: kmdt         ! Index of MDT extra var 
     58      INTEGER       , INTENT(in)    :: nn_msshc     ! MDT correction scheme 
     59      REAL(wp)      , INTENT(in)    :: rn_mdtcorr   ! User specified MDT correction 
     60      REAL(wp)      , INTENT(in)    :: rn_mdtcutoff ! MDT cutoff for computed correction 
    6161      ! 
    6262      CHARACTER(LEN=12), PARAMETER ::   cpname  = 'obs_rea_mdt' 
     
    105105 
    106106      ! Remove the offset between the MDT used with the sla and the model MDT 
    107       IF( nn_msshc == 1 .OR. nn_msshc == 2 ) & 
    108          & CALL obs_offset_mdt( jpi, jpj, z_mdt, zfill ) 
    109  
    110       ! Intepolate the MDT already on the model grid at the observation point 
    111    
     107      IF( nn_msshc == 1 .OR. nn_msshc == 2 ) THEN 
     108         CALL obs_offset_mdt( jpi, jpj, z_mdt, zfill, nn_msshc, & 
     109            &                 rn_mdtcorr, rn_mdtcutoff ) 
     110      ENDIF 
     111 
     112      ! Interpolate the MDT already on the model grid at the observation point 
     113 
    112114      ALLOCATE( & 
    113115         & igrdi(2,2,sladata%nsurf), & 
     
    118120         & zmdtl(2,2,sladata%nsurf)  & 
    119121         & ) 
    120           
     122 
    121123      DO jobs = 1, sladata%nsurf 
    122124 
     
    147149             
    148150         CALL obs_int_h2d( 1, 1, zweig, zmdtl(:,:,jobs),  zext ) 
    149   
    150          sladata%rext(jobs,2) = zext(1) 
     151 
     152         sladata%rext(jobs,kmdt) = zext(1) 
    151153 
    152154! mark any masked data with a QC flag 
    153155         IF( zobsmask(1) == 0 )   sladata%nqc(jobs) = IBSET(sladata%nqc(jobs),15) 
    154156 
    155          END DO 
    156           
     157      END DO 
     158 
    157159      DEALLOCATE( & 
    158160         & igrdi, & 
     
    169171 
    170172 
    171    SUBROUTINE obs_offset_mdt( kpi, kpj, mdt, zfill ) 
     173   SUBROUTINE obs_offset_mdt( kpi, kpj, mdt, zfill, nn_msshc, rn_mdtcorr, & 
     174                              rn_mdtcutoff ) 
    172175      !!--------------------------------------------------------------------- 
    173176      !! 
     
    183186      !!---------------------------------------------------------------------- 
    184187      INTEGER, INTENT(IN) ::  kpi, kpj 
    185       REAL(wp), DIMENSION(kpi,kpj), INTENT(INOUT) ::   mdt     ! MDT used on the model grid 
    186       REAL(wp)                    , INTENT(IN   ) ::   zfill  
     188      REAL(wp), DIMENSION(kpi,kpj), INTENT(INOUT) :: mdt          ! MDT used on the model grid 
     189      REAL(wp)                    , INTENT(IN   ) :: zfill        ! Fill value 
     190      INTEGER                     , INTENT(IN   ) :: nn_msshc     ! MDT correction scheme 
     191      REAL(wp)                    , INTENT(IN   ) :: rn_mdtcorr   ! User specified MDT correction 
     192      REAL(wp)                    , INTENT(IN   ) :: rn_mdtcutoff ! MDT cutoff for computed correction 
    187193      !  
    188194      INTEGER  :: ji, jj 
     
    246252         WRITE(numout,*) '               zcorr         = ', zcorr 
    247253         WRITE(numout,*) '               nn_msshc        = ', nn_msshc 
     254 
     255         IF ( nn_msshc == 0 ) WRITE(numout,*) '           MSSH correction is not applied' 
     256         IF ( nn_msshc == 1 ) WRITE(numout,*) '           MSSH correction is applied' 
     257         IF ( nn_msshc == 2 ) WRITE(numout,*) '           User defined MSSH correction'  
    248258      ENDIF 
    249  
    250       IF ( nn_msshc == 0 ) WRITE(numout,*) '           MSSH correction is not applied' 
    251       IF ( nn_msshc == 1 ) WRITE(numout,*) '           MSSH correction is applied' 
    252       IF ( nn_msshc == 2 ) WRITE(numout,*) '           User defined MSSH correction'  
    253259 
    254260      ! 
Note: See TracChangeset for help on using the changeset viewer.