Changeset 15356
 Timestamp:
 20211012T15:52:10+02:00 (3 years ago)
 Location:
 branches/UKMO/dev_r5518_obs_oper_update_DepthBug/NEMOGCM/NEMO/OPA_SRC/OBS
 Files:

 3 edited
Legend:
 Unmodified
 Added
 Removed

branches/UKMO/dev_r5518_obs_oper_update_DepthBug/NEMOGCM/NEMO/OPA_SRC/OBS/obs_level_search.h90
r12506 r15356 47 47 kobsk(ji) = 1 48 48 depk: DO jk = 2, kgrd1 49 IF ( pgrddep(jk) > =pobsdep(ji) ) EXIT depk49 IF ( pgrddep(jk) > pobsdep(ji) ) EXIT depk 50 50 END DO depk 51 51 kobsk(ji) = jk 
branches/UKMO/dev_r5518_obs_oper_update_DepthBug/NEMOGCM/NEMO/OPA_SRC/OBS/obs_prep.F90
r15255 r15356 1224 1224 INTEGER :: iig, ijg ! i,j of observation on model grid point. 1225 1225 INTEGER :: jobs, jobsp, jk, ji, jj 1226 REAL(KIND=wp) :: maxdep t, maxdepw1226 REAL(KIND=wp) :: maxdepw 1227 1227 1228 1228 ! Get grid point indices … … 1317 1317 1318 1318 ! Calculate max T and W depths of 2x2 grid 1319 maxdept=zgdept(1,1,NINT(zbathy(1,1,jobs)),jobs)1320 1319 maxdepw=zgdepw(1,1,NINT(zbathy(1,1,jobs))+1,jobs) 1321 1320 DO jj = 1, 2 1322 1321 DO ji = 1, 2 1323 IF ( zgdept(ji,jj,NINT(zbathy(ji,jj,jobs)),jobs) > maxdept ) THEN1324 maxdept = zgdept(ji,jj,NINT(zbathy(ji,jj,jobs)),jobs)1325 END IF1326 1322 IF ( zgdepw(ji,jj,NINT(zbathy(ji,jj,jobs))+1,jobs) > maxdepw ) THEN 1327 1323 maxdepw = zgdepw(ji,jj,NINT(zbathy(ji,jj,jobs))+1,jobs) … … 1398 1394 ENDIF 1399 1395 ENDIF 1400 1401 ! Set observation depth equal to that of the first model depth 1402 IF ( pobsdep(jobsp) < MINVAL(zgdept(1:2,1:2,1,jobs) ) ) THEN 1403 pobsdep(jobsp) = MINVAL(zgdept(1:2,1:2,1,jobs)) 1404 ENDIF 1405 1406 ! Set observation depth equal to that of the last wet Tpoint 1407 IF ( ( pobsdep(jobsp) > maxdept ) .AND. & 1408 & ( pobsdep(jobsp) < maxdepw ) ) THEN 1409 pobsdep(jobsp) = maxdept 1410 END IF 1411 1396 1412 1397 #if defined key_bdy 1413 1398 ! Flag if the observation falls close to the boundary rim 
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.