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 15227 for NEMO/branches/UKMO/NEMO_4.0.4_generic_obs – NEMO

Ignore:
Timestamp:
2021-09-03T16:02:35+02:00 (3 years ago)
Author:
dford
Message:

Implement FBD/SIT (compiles but otherwise not tested).

Location:
NEMO/branches/UKMO/NEMO_4.0.4_generic_obs/src/OCE/OBS
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/UKMO/NEMO_4.0.4_generic_obs/src/OCE/OBS/diaobs.F90

    r15226 r15227  
    2626   !!   fin_date      : Compute the final date YYYYMMDD.HHMMSS 
    2727   !!---------------------------------------------------------------------- 
    28    USE par_kind       ! Precision variables 
    29    USE in_out_manager ! I/O manager 
    30    USE timing         ! Timing 
    31    USE par_oce        ! ocean parameter 
    32    USE dom_oce        ! Ocean space and time domain variables 
    33    USE sbc_oce        ! Sea-ice fraction 
     28   USE par_kind          ! Precision variables 
     29   USE in_out_manager    ! I/O manager 
     30   USE timing            ! Timing 
     31   USE par_oce           ! ocean parameter 
     32   USE dom_oce           ! Ocean space and time domain variables 
     33   USE sbc_oce           ! Sea-ice fraction 
    3434   ! 
    35    USE obs_read_prof  ! Reading and allocation of profile obs 
    36    USE obs_read_surf  ! Reading and allocation of surface obs 
    37    USE obs_bias       ! Bias correction routine 
    38    USE obs_readmdt    ! Reading and allocation of MDT for SLA. 
    39    USE obs_prep       ! Preparation of obs. (grid search etc). 
    40    USE obs_oper       ! Observation operators 
    41    USE obs_write      ! Writing of observation related diagnostics 
    42    USE obs_grid       ! Grid searching 
    43    USE obs_read_altbias ! Bias treatment for altimeter 
    44    USE obs_profiles_def ! Profile data definitions 
    45    USE obs_surf_def   ! Surface data definitions 
    46    USE obs_types      ! Definitions for observation types 
    47    USE obs_field      ! Definitions for observation types 
     35   USE obs_read_prof     ! Reading and allocation of profile obs 
     36   USE obs_read_surf     ! Reading and allocation of surface obs 
     37   USE obs_bias          ! Bias correction routine 
     38   USE obs_readmdt       ! Reading and allocation of MDT for SLA. 
     39   USE obs_readsnowdepth ! Get model snow depth for conversion of freeboard to ice thickness 
     40   USE obs_prep          ! Preparation of obs. (grid search etc). 
     41   USE obs_oper          ! Observation operators 
     42   USE obs_write         ! Writing of observation related diagnostics 
     43   USE obs_grid          ! Grid searching 
     44   USE obs_read_altbias  ! Bias treatment for altimeter 
     45   USE obs_profiles_def  ! Profile data definitions 
     46   USE obs_surf_def      ! Surface data definitions 
     47   USE obs_types         ! Definitions for observation types 
     48   USE obs_field         ! Definitions for observation types 
    4849   ! 
    49    USE mpp_map        ! MPP mapping 
    50    USE lib_mpp        ! For ctl_warn/stop 
     50   USE mpp_map           ! MPP mapping 
     51   USE lib_mpp           ! For ctl_warn/stop 
    5152 
    5253   IMPLICIT NONE 
     
    8283      !! 
    8384      !!---------------------------------------------------------------------- 
     85#if defined key_si3 
     86   USE ice, ONLY : &     ! Sea ice variables 
     87      & hm_s             ! Snow depth for freeboard conversion 
     88#elif defined key_cice 
     89   USE sbc_oce, ONLY : & ! Sea ice variables 
     90      & thick_s          ! Snow depth for freeboard conversion 
     91#endif 
     92 
     93      IMPLICIT NONE 
     94 
    8495      INTEGER, PARAMETER ::   jpmaxngroups = 1000    ! Maximum number of obs groups 
    8596      INTEGER :: ios             ! Local integer output status for namelist read 
     
    260271                     sobsgroups(jgroup)%ssurfdata%caddlong(sobsgroups(jgroup)%nadd_ssh,jvar) = 'Model Sea surface height' 
    261272                     sobsgroups(jgroup)%ssurfdata%caddunit(sobsgroups(jgroup)%nadd_ssh,jvar) = 'Metres' 
     273                  END DO 
     274               ENDIF 
     275               ! 
     276               IF( sobsgroups(jgroup)%lfbd ) THEN 
     277                  sobsgroups(jgroup)%ssurfdata%cextvars(sobsgroups(jgroup)%next_snow) = 'SNOW' 
     278                  sobsgroups(jgroup)%ssurfdata%cextlong(sobsgroups(jgroup)%next_snow) = 'Snow thickness' 
     279                  sobsgroups(jgroup)%ssurfdata%cextunit(sobsgroups(jgroup)%next_snow) = 'Metres' 
     280                  sobsgroups(jgroup)%ssurfdata%caddvars(sobsgroups(jgroup)%nadd_fbd)  = 'FBD' 
     281                  DO jvar = 1, sobsgroups(jgroup)%nobstypes 
     282                     sobsgroups(jgroup)%ssurfdata%caddlong(sobsgroups(jgroup)%nadd_fbd,jvar) = 'Freeboard' 
     283                     sobsgroups(jgroup)%ssurfdata%caddunit(sobsgroups(jgroup)%nadd_fbd,jvar) = 'Metres' 
    262284                  END DO 
    263285               ENDIF 
     
    290312               ENDIF 
    291313               ! 
     314#if defined key_si3 
     315               IF( sobsgroups(jgroup)%lfbd ) THEN 
     316                  CALL obs_rea_snowdepth( sobsgroups(jgroup)%ssurfdataqc, & 
     317                     &                    sobsgroups(jgroup)%n2dint,      & 
     318                     &                    sobsgroups(jgroup)%next_snow,   & 
     319                     &                    hm_s(:,:) ) 
     320               ENDIF 
     321#elif defined key_cice 
     322               IF( sobsgroups(jgroup)%lfbd ) THEN 
     323                  CALL obs_rea_snowdepth( sobsgroups(jgroup)%ssurfdataqc, & 
     324                     &                    sobsgroups(jgroup)%n2dint,      & 
     325                     &                    sobsgroups(jgroup)%next_snow,   & 
     326                     &                    thick_s(:,:) ) 
     327               ENDIF 
     328#endif 
     329               ! 
    292330               IF( sobsgroups(jgroup)%lobsbias ) THEN 
    293331                  CALL obs_app_bias( sobsgroups(jgroup)%ssurfdataqc,   & 
     
    323361      USE oce    , ONLY : tsn, un, vn, sshn   ! Ocean dynamics and tracers variables 
    324362      USE phycst , ONLY : rday                ! Physical constants 
    325 #if defined  key_si3 
    326       USE ice    , ONLY : at_i                ! SI3 Ice model variables 
    327 #endif 
    328 #if defined key_cice 
    329       USE sbc_oce, ONLY : fr_i     ! ice fraction 
     363#if defined key_si3 
     364      USE ice    , ONLY : at_i, hm_i          ! SI3 Ice model variables 
     365#elif defined key_cice 
     366      USE sbc_oce, ONLY : fr_i, thick_i       ! CICE Ice model variables 
    330367#endif 
    331368 
     
    423460                        lstp0 = .TRUE. 
    424461                     ELSE 
    425 #if defined key_cice || defined key_si3 
     462#if defined key_si3 
     463                        zsurfvar(:,:) = at_i(:,:) 
     464#elif defined key_cice 
    426465                        zsurfvar(:,:) = fr_i(:,:) 
     466#else 
     467                        CALL ctl_stop( ' Trying to run sea-ice observation operator', & 
     468                           &           ' but no sea-ice model appears to have been defined' ) 
     469#endif 
     470                     ENDIF 
     471                  CASE('SIT','FBD') 
     472                     IF ( kstp == 0 ) THEN 
     473                        lstp0 = .TRUE. 
     474                     ELSE 
     475#if defined key_si3 
     476                        zsurfvar(:,:) = hm_i(:,:) 
     477#elif defined key_cice 
     478                        zsurfvar(:,:) = thick_i(:,:) 
    427479#else 
    428480                        CALL ctl_stop( ' Trying to run sea-ice observation operator', & 
     
    463515                        &               sobsgroups(jgroup)%lfp_indegs,        & 
    464516                        &               kssh=sobsgroups(jgroup)%nadd_ssh,     & 
    465                         &               kmdt=sobsgroups(jgroup)%next_mdt ) 
     517                        &               kmdt=sobsgroups(jgroup)%next_mdt,     & 
     518                        &               kfbd=sobsgroups(jgroup)%nadd_fbd,     & 
     519                        &               ksnow=sobsgroups(jgroup)%next_snow ) 
    466520                  ENDIF 
    467521 
     
    687741                  &                      sobsgroups(jgroup)%ssurfdata, .TRUE., numout ) 
    688742 
     743               IF (sobsgroups(jgroup)%lfbd) THEN 
     744                  ! Input observations were freeboard, but we're putputting ice thickness 
     745                  DO jvar = 1, sobsgroups(jgroup)%nobstypes 
     746                     IF ( sobsgroups(jgroup)%cobstypes(jvar) == cobsname_fbd ) THEN 
     747                        sobsgroups(jgroup)%ssurfdata%cvars(jvar) = 'SIT' 
     748                        sobsgroups(jgroup)%ssurfdata%clong(jvar) = 'Sea ice thickness' 
     749                        sobsgroups(jgroup)%ssurfdata%cunit(jvar) = 'm' 
     750                        EXIT 
     751                     ENDIF 
     752                  END DO 
     753               ENDIF 
     754 
    689755               ! Put additional and extra variable information into obswriinfo structure 
    690756               ! used by obs_write. 
  • NEMO/branches/UKMO/NEMO_4.0.4_generic_obs/src/OCE/OBS/obs_field.F90

    r15225 r15227  
    1515   USE par_kind, ONLY : & ! Precision variables 
    1616      & wp 
    17    USE obs_oper, ONLY : & ! Max number of daily avgd obs types 
    18       & imaxavtypes 
    1917   USE obs_surf_def       ! Surface data definitions 
    2018   USE obs_profiles_def   ! Profile data definitions 
     
    3533   INTEGER, PARAMETER :: jpmaxntypes = 1000   ! Maximum number of obs types for each obs group 
    3634   INTEGER, PARAMETER :: jpmaxnfiles = 1000   ! Maximum number of files for each obs group 
     35 
     36   INTEGER, PARAMETER, PUBLIC :: imaxavtypes = 20   !: Max number of daily avgd obs types 
    3737    
    3838   ! Expected names for observation types with special behaviours (not needed for all observation types) 
    3939   CHARACTER(LEN=8), PUBLIC :: cobsname_uvel = 'UVEL' ! Expected variable name for U velocity (2D or 3D) 
    4040   CHARACTER(LEN=8), PUBLIC :: cobsname_vvel = 'VVEL' ! Expected variable name for V velocity (2D or 3D) 
    41    CHARACTER(LEN=8), PUBLIC :: cobsname_sla  = 'SLA'  ! Expected variable name for SLA 
     41   CHARACTER(LEN=8), PUBLIC :: cobsname_sla  = 'SLA'  ! Expected variable name for sea level anomaly 
     42   CHARACTER(LEN=8), PUBLIC :: cobsname_fbd  = 'FBD'  ! Expected variable name for sea ice freeboard 
    4243 
    4344   !! * Type definition for observation groups 
     
    6566      INTEGER  :: nadd_ssh           !: Index of additional variable representing SSH 
    6667      INTEGER  :: next_mdt           !: Index of extra variable representing MDT 
     68      INTEGER  :: nadd_fbd           !: Index of additional variable representing ice freeboard 
     69      INTEGER  :: next_snow          !: Index of extra variable representing snow thickness 
    6770      ! 
    6871      LOGICAL  :: lenabled           !: Logical switch for group being processed and not ignored 
     
    7174      LOGICAL  :: lvel               !: Logical switch for velocity data 
    7275      LOGICAL  :: lsla               !: Logical switch for SLA data 
     76      LOGICAL  :: lfbd               !: Logical switch for ice freeboard data 
    7377      LOGICAL  :: laltbias           !: Logical switch for altimeter bias correction 
    7478      LOGICAL  :: lobsbias           !: Logical switch for bias correction 
     
    233237         sdobsgroup%lvel          = .false. 
    234238         sdobsgroup%lsla          = .false. 
     239         sdobsgroup%lfbd          = .false. 
    235240         sdobsgroup%nadd_ssh      = 0 
    236241         sdobsgroup%next_mdt      = 0 
     242         sdobsgroup%nadd_fbd      = 0 
     243         sdobsgroup%next_snow     = 0 
    237244 
    238245         DO jtype = 1, jpmaxntypes 
     
    274281                  sdobsgroup%nadd_ssh = sdobsgroup%naddvars 
    275282                  sdobsgroup%next_mdt = sdobsgroup%nextvars 
    276 ! DO THIS FOR FBD TOO 
     283               ELSEIF ( TRIM(sdobsgroup%cobstypes(itype)) == cobsname_fbd ) THEN 
     284                  sdobsgroup%lfbd = .true. 
     285                  ! freeboard=additional, snow thickness=extra 
     286                  sdobsgroup%naddvars  = sdobsgroup%naddvars + 1 
     287                  sdobsgroup%nextvars  = sdobsgroup%nextvars + 1 
     288                  sdobsgroup%nadd_fbd  = sdobsgroup%naddvars 
     289                  sdobsgroup%next_snow = sdobsgroup%nextvars 
    277290               ENDIF 
    278291               ! 
  • NEMO/branches/UKMO/NEMO_4.0.4_generic_obs/src/OCE/OBS/obs_oper.F90

    r15226 r15227  
    1818   USE lib_mpp,       ONLY :   ctl_warn, ctl_stop           ! Warning and stopping routines 
    1919   USE sbcdcy,        ONLY :   sbc_dcy, nday_qsr            ! For calculation of where it is night-time 
    20    USE obs_grid,      ONLY :   obs_level_search      
     20   USE obs_grid,      ONLY :   obs_level_search 
     21   USE obs_field,     ONLY : cobsname_sla, cobsname_fbd, imaxavtypes 
     22#if defined key_si3 || defined key_cice 
     23   USE phycst,        ONLY : rhos, rhoi, rhow               ! For conversion from sea ice freeboard to thickness 
     24#endif 
    2125   ! 
    2226   USE par_kind     , ONLY :   wp   ! Precision variables 
     
    2832   PUBLIC   obs_prof_opt   !: Compute the model counterpart of profile obs 
    2933   PUBLIC   obs_surf_opt   !: Compute the model counterpart of surface obs 
    30  
    31    INTEGER, PARAMETER, PUBLIC ::   imaxavtypes = 20   !: Max number of daily avgd obs types 
    3234 
    3335   !!---------------------------------------------------------------------- 
     
    453455      &                     kit000, kdaystp, kvar, psurf, psurfmask, & 
    454456      &                     k2dint, ldnightav, plamscl, pphiscl,     & 
    455       &                     lindegrees, kssh, kmdt ) 
     457      &                     lindegrees, kssh, kmdt, kfbd, ksnow ) 
    456458 
    457459      !!----------------------------------------------------------------------- 
     
    514516      INTEGER, OPTIONAL, INTENT(IN) :: & 
    515517         & kmdt                        ! Index of extra variable representing MDT 
     518      INTEGER, OPTIONAL, INTENT(IN) :: & 
     519         & kfbd                        ! Index of additional variable representing ice freeboard 
     520      INTEGER, OPTIONAL, INTENT(IN) :: & 
     521         & ksnow                       ! Index of extra variable representing ice snow thickness 
    516522 
    517523      !! * Local declarations 
     
    756762         ENDIF 
    757763 
    758          IF ( TRIM(surfdataqc%cvars(kvar)) == 'SLA' .AND. PRESENT(kssh) .AND. PRESENT(kmdt) ) THEN 
     764         IF ( TRIM(surfdataqc%cvars(kvar)) == cobsname_sla .AND. PRESENT(kssh) .AND. PRESENT(kmdt) ) THEN 
    759765            ! ... Remove the MDT from the SSH at the observation point to get the SLA 
    760766            surfdataqc%radd(jobs,kssh,kvar) = zext(1) 
    761767            surfdataqc%rmod(jobs,kvar) = surfdataqc%radd(jobs,kssh,kvar) - surfdataqc%rext(jobs,kmdt) 
     768#if defined key_si3 || defined key_cice 
     769         ELSE IF ( TRIM(surfdataqc%cvars(kvar)) == cobsname_fbd .AND. PRESENT(kfbd) .AND. PRESENT(ksnow) ) THEN 
     770            ! Convert radar freeboard to true freeboard 
     771            ! (add 1/4 snow depth; 1/4 based on ratio of speed of light in vacuum 
     772            !  compared to snow (3.0e8 vs 2.4e8 m/s)) 
     773            surfdataqc%radd(jobs,kfbd,kvar) = surfdataqc%robs(jobs,kvar) 
     774            surfdataqc%robs(jobs,kvar) = surfdataqc%radd(jobs,kfbd,kvar) + 0.25*surfdataqc%rext(jobs,ksnow) 
     775            ! If the corrected freeboard observation is outside -0.3 to 3.0 m (CPOM) then set the QC flag to bad 
     776            IF ((surfdataqc%robs(jobs,kvar) < -0.3) .OR. (surfdataqc%robs(jobs,kvar) > 3.0)) THEN 
     777               surfdataqc%nqc(jobs) = 4 
     778            ENDIF            
     779            ! Convert corrected freeboard to ice thickness following Tilling et al. (2016) 
     780            surfdataqc%robs(jobs,kvar) = (surfdataqc%robs(jobs,kvar)*rhow + surfdataqc%rext(jobs,ksnow)*rhos)/ & 
     781               &                         (rhow - rhoi) 
     782#endif 
    762783         ELSE 
    763784            surfdataqc%rmod(jobs,kvar) = zext(1) 
    764785         ENDIF 
    765 ! DO THIS FOR FBD TOO 
    766786 
    767787         IF ( zext(1) == obfillflt ) THEN 
  • NEMO/branches/UKMO/NEMO_4.0.4_generic_obs/src/OCE/OBS/obs_prep.F90

    r15225 r15227  
    2424   USE obs_field, ONLY : &  ! Velocity variable names 
    2525      & cobsname_uvel, & 
    26       & cobsname_vvel 
     26      & cobsname_vvel, & 
     27      & imaxavtypes 
    2728   USE lib_mpp, ONLY :   ctl_warn, ctl_stop 
    2829   USE bdy_oce, ONLY : &        ! Boundary information 
  • NEMO/branches/UKMO/NEMO_4.0.4_generic_obs/src/OCE/OBS/obs_read_prof.F90

    r15225 r15227  
    2929   USE obs_field, ONLY : &      ! Velocity variable names 
    3030      & cobsname_uvel,   & 
    31       & cobsname_vvel 
     31      & cobsname_vvel,   & 
     32      & imaxavtypes 
    3233 
    3334   IMPLICIT NONE 
Note: See TracChangeset for help on using the changeset viewer.