Changeset 15356 for branches/UKMO/dev_r5518_obs_oper_update_DepthBug/NEMOGCM/NEMO/OPA_SRC/OBS/obsinter_z1d.h90
 Timestamp:
 20211012T15:52:10+02:00 (2 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

branches/UKMO/dev_r5518_obs_oper_update_DepthBug/NEMOGCM/NEMO/OPA_SRC/OBS/obsinter_z1d.h90
r7960 r15356 62 62 z1dm = ( pdep(kkco(jdep))  pobsdep(jdep) ) 63 63 z1dp = ( pobsdep(jdep)  pdep(kkco(jdep)1) ) 64 65 ! Where ob is at or above top model Tpoint, use model top rather than extrapolate 66 IF ( pobsdep(jdep) <= pdep(kkco(jdep)1) ) z1dp = 0.0_wp 67 68 ! Where ob is at or below bottom model Tpoint, use model bottom rather than extrapolate 69 IF ( pobsdep(jdep) >= pdep(kkco(jdep)) ) z1dm = 0.0_wp 70 71 ! Where deeper level is masked, only use higher level 64 72 IF ( pobsmask(kkco(jdep)) == 0.0_wp ) z1dp = 0.0_wp 65 73 66 74 zsum = z1dm + z1dp 67 75 68 IF ( k1dint == 0 ) THEN 69 70 ! 71 ! Linear interpolation 72 ! 73 pobs(jdep) = ( z1dm * pobsk(kkco(jdep)1) & 74 & + z1dp * pobsk(kkco(jdep) ) ) / zsum 75 76 ELSEIF ( k1dint == 1 ) THEN 77 78 ! 79 ! Cubic spline interpolation 80 ! 81 zsum2 = zsum * zsum 82 pobs(jdep) = ( z1dm * pobsk (kkco(jdep)1) & 83 & + z1dp * pobsk (kkco(jdep) ) & 84 & + ( z1dm * ( z1dm * z1dm  zsum2 ) * pobs2k(kkco(jdep)1) & 85 & + z1dp * ( z1dp * z1dp  zsum2 ) * pobs2k(kkco(jdep) ) & 86 & ) / 6.0_wp & 87 & ) / zsum 88 76 IF ( zsum > 0.0_wp ) THEN 77 IF ( k1dint == 0 ) THEN 78 79 ! 80 ! Linear interpolation 81 ! 82 pobs(jdep) = ( z1dm * pobsk(kkco(jdep)1) & 83 & + z1dp * pobsk(kkco(jdep) ) ) / zsum 84 85 ELSEIF ( k1dint == 1 ) THEN 86 87 ! 88 ! Cubic spline interpolation 89 ! 90 zsum2 = zsum * zsum 91 pobs(jdep) = ( z1dm * pobsk (kkco(jdep)1) & 92 & + z1dp * pobsk (kkco(jdep) ) & 93 & + ( z1dm * ( z1dm * z1dm  zsum2 ) * pobs2k(kkco(jdep)1) & 94 & + z1dp * ( z1dp * z1dp  zsum2 ) * pobs2k(kkco(jdep) ) & 95 & ) / 6.0_wp & 96 & ) / zsum 97 98 ENDIF 99 ELSE ! take value directly from the higher model level 100 pobs(jdep) = pobsk(kkco(jdep)1) 89 101 ENDIF 90 102 END DO
Note: See TracChangeset
for help on using the changeset viewer.