Changeset 7375
 Timestamp:
 20161129T18:18:55+01:00 (7 years ago)
 Location:
 branches/UKMO/dev_r4650_general_vert_coord_obsoper_removetides/NEMOGCM/NEMO/OPA_SRC/OBS
 Files:

 3 edited
Legend:
 Unmodified
 Added
 Removed

branches/UKMO/dev_r4650_general_vert_coord_obsoper_removetides/NEMOGCM/NEMO/OPA_SRC/OBS/diaobs.F90
r6990 r7375 93 93 REAL(KIND=dp), PUBLIC :: dobsend !: Observation window end date YYYYMMDD.HHMMSS 94 94 95 REAL(KIND=wp), PUBLIC :: & 96 SLAMeanPeriodHours = 24. + (5./6.) !: Meaning period for SLA data. 97 95 98 INTEGER, PUBLIC :: n1dint !: Vertical interpolation method 96 99 INTEGER, PUBLIC :: n2dint !: Horizontal interpolation method … … 674 677 & slafilesact(1:jnumslaact), & 675 678 & nslavars, nslaextr, nitendnit000+2, & 676 & dobsini, dobsend, ln_ignmis, .FALSE. )679 & dobsini, dobsend, ln_ignmis, .FALSE., SLAMeanPeriodHours ) 677 680 CALL obs_pre_sla( sladata(nslasets), sladatqc(nslasets), & 678 681 & ln_sla, ln_nea ) … … 685 688 & slafilespas(1:jnumslapas), & 686 689 & nslavars, nslaextr, nitendnit000+2, & 687 & dobsini, dobsend, ln_ignmis, .FALSE. )690 & dobsini, dobsend, ln_ignmis, .FALSE., SLAMeanPeriodHours ) 688 691 689 692 CALL obs_pre_sla( sladata(nslasets), sladatqc(nslasets), & … … 703 706 & slafbfiles(jset:jset), & 704 707 & nslavars, nslaextr, nitendnit000+2, & 705 & dobsini, dobsend, ln_ignmis, .FALSE. )708 & dobsini, dobsend, ln_ignmis, .FALSE., SLAMeanPeriodHours ) 706 709 CALL obs_pre_sla( sladata(nslasets), sladatqc(nslasets), & 707 710 & ln_sla, ln_nea ) … … 1062 1065 !! * Local declarations 1063 1066 INTEGER :: idaystp ! Number of timesteps per day 1067 INTEGER :: imeanstp ! Number of timesteps for sla averaging 1064 1068 INTEGER :: jprofset ! Profile data set loop variable 1065 1069 INTEGER :: jslaset ! SLA data set loop variable … … 1138 1142 !  Sea surface anomaly 1139 1143 IF ( ln_sla ) THEN 1144 !Number of timesteps in meaning period 1145 imeanstp = NINT( ( SLAMeanPeriodHours * 60. * 60. ) / rdt ) 1140 1146 DO jslaset = 1, nslasets 1141 1147 CALL obs_sla_opt( sladatqc(jslaset), & 1142 1148 & kstp, jpi, jpj, nit000, sshn, & 1143 & tmask(:,:,1), n2dint )1149 & tmask(:,:,1), n2dint, kmeanstp = imeanstp ) 1144 1150 END DO 1145 1151 ENDIF 
branches/UKMO/dev_r4650_general_vert_coord_obsoper_removetides/NEMOGCM/NEMO/OPA_SRC/OBS/obs_oper.F90
r6301 r7375 1063 1063 1064 1064 SUBROUTINE obs_sla_opt( sladatqc, kt, kpi, kpj, kit000, & 1065 & psshn, psshmask, k2dint )1065 & psshn, psshmask, k2dint, kmeanstp ) 1066 1066 !! 1067 1067 !! … … 1100 1100 !! * Arguments 1101 1101 TYPE(obs_surf), INTENT(INOUT) :: sladatqc ! Subset of surface data not failing screening 1102 INTEGER, INTENT(IN) :: kt ! Time step1103 INTEGER, INTENT(IN) :: kpi ! Model grid parameters1102 INTEGER, INTENT(IN) :: kt ! Time step 1103 INTEGER, INTENT(IN) :: kpi ! Model grid parameters 1104 1104 INTEGER, INTENT(IN) :: kpj 1105 1105 INTEGER, INTENT(IN) :: kit000 ! Number of the first time step 1106 1106 ! (kit0001 = restart time) 1107 1107 INTEGER, INTENT(IN) :: k2dint ! Horizontal interpolation type (see header) 1108 INTEGER, INTENT(IN), OPTIONAL :: & 1109 kmeanstp ! Number of time steps for the time meaning 1110 ! Averaging is triggered if present and greater than one 1108 1111 REAL(KIND=wp), INTENT(IN), DIMENSION(kpi,kpj) :: & 1109 1112 & psshn, & ! Model SSH field … … 1117 1120 INTEGER :: isla 1118 1121 INTEGER :: iobs 1122 INTEGER :: imeanend 1119 1123 REAL(KIND=wp) :: zlam 1120 1124 REAL(KIND=wp) :: zphi 1121 1125 REAL(KIND=wp) :: zext(1), zobsmask(1) 1126 REAL(KIND=wp) :: zmeanstp 1122 1127 REAL(kind=wp), DIMENSION(2,2,1) :: & 1123 1128 & zweig … … 1126 1131 & zsshl, & 1127 1132 & zglam, & 1128 & zgphi 1133 & zgphi, & 1134 & zssh_tmean 1129 1135 INTEGER, DIMENSION(:,:,:), ALLOCATABLE :: & 1130 1136 & igrdi, & 1131 1137 & igrdj 1138 1139 LOGICAL :: l_sla_timemean 1132 1140 1133 1141 ! … … 1137 1145 inrc = kt  kit000 + 2 1138 1146 isla = sladatqc%nsstp(inrc) 1147 1148 l_sla_timemean = .FALSE. 1149 IF ( PRESENT( kmeanstp ) ) THEN 1150 IF ( kmeanstp > 1 ) l_sla_timemean = .TRUE. 1151 ENDIF 1152 1153 IF ( l_sla_timemean ) THEN 1154 ! Initialize time mean for first timestep 1155 imeanend = MOD( kt  kit000 + 1, kmeanstp ) 1156 IF (lwp) WRITE(numout,*) 'SLA time mean ', kt, kit000, kmeanstp, imeanend 1157 1158 ! Added kt == 0 test to catch restart case 1159 IF ( ( imeanend == 1 ) .OR. ( kt == 0 ) ) THEN 1160 IF (lwp) WRITE(numout,*) 'Reset sladatqc%vdmean on timestep: ',kt 1161 DO jj = 1, jpj 1162 DO ji = 1, jpi 1163 sladatqc%vdmean(ji,jj) = 0.0 1164 END DO 1165 END DO 1166 ENDIF 1167 1168 ! On each timestep, increment the SLA field for computing time mean 1169 IF (lwp) WRITE(numout,*)'Accumulating sladataqc%vdmean on timestep: ',kt 1170 DO jj = 1, jpj 1171 DO ji = 1, jpi 1172 sladatqc%vdmean(ji,jj) = sladatqc%vdmean(ji,jj) & 1173 & + psshn(ji,jj) 1174 END DO 1175 END DO 1176 1177 ! Compute the time mean at the end of time period 1178 IF ( imeanend == 0 ) THEN 1179 zmeanstp = 1.0 / REAL( kmeanstp ) 1180 IF (lwp) WRITE(numout,*)'Calculating sladataqc%vdmean time mean on timestep: ',kt,' with weight: ',zmeanstp 1181 DO jj = 1, jpj 1182 DO ji = 1, jpi 1183 sladatqc%vdmean(ji,jj) = sladatqc%vdmean(ji,jj) & 1184 & * zmeanstp 1185 END DO 1186 END DO 1187 ENDIF 1188 ENDIF !l_sla_timemean 1189 1139 1190 1140 1191 ! Get the data for interpolation … … 1167 1218 CALL obs_int_comm_2d( 2, 2, isla, & 1168 1219 & igrdi, igrdj, psshmask, zmask ) 1169 CALL obs_int_comm_2d( 2, 2, isla, & 1170 & igrdi, igrdj, psshn, zsshl ) 1220 1221 ! At the end of the averaging period get interpolated means 1222 IF ( l_sla_timemean ) THEN 1223 IF ( imeanend == 0 ) THEN 1224 1225 ALLOCATE( zssh_tmean(2,2,isla) ) 1226 IF (lwp) WRITE(numout,*)' Interpolating the time mean values on time step: ',kt 1227 CALL obs_int_comm_2d( 2, 2, isla, & 1228 & igrdi, igrdj, sladatqc%vdmean(:,:), zssh_tmean ) 1229 ENDIF 1230 ELSE 1231 CALL obs_int_comm_2d( 2, 2, isla, & 1232 & igrdi, igrdj, psshn, zsshl ) 1233 1234 ENDIF 1171 1235 1172 1236 ! Loop over observations … … 1194 1258 ENDIF 1195 1259 1196 zlam = sladatqc%rlam(jobs)1197 zphi = sladatqc%rphi(jobs)1198 1199 ! Get weights to interpolate the model SSH to the observation point1200 CALL obs_int_h2d_init( 1, 1, k2dint, zlam, zphi, &1201 & zglam(:,:,iobs), zgphi(:,:,iobs), &1202 & zmask(:,:,iobs), zweig, zobsmask )1203 1260 1204 1261 1205 1262 ! Interpolate the model SSH to the observation point 1206 CALL obs_int_h2d( 1, 1, & 1207 & zweig, zsshl(:,:,iobs), zext ) 1208 1209 sladatqc%rext(jobs,1) = zext(1) 1210 ! ... Remove the MDT at the observation point 1211 sladatqc%rmod(jobs,1) = sladatqc%rext(jobs,1)  sladatqc%rext(jobs,2) 1263 IF ( l_sla_timemean ) THEN 1264 IF ( imeanend == 0 ) THEN 1265 zlam = sladatqc%rlam(jobs) 1266 zphi = sladatqc%rphi(jobs) 1267 ! Get weights to interpolate the model SSH to the observation point 1268 CALL obs_int_h2d_init( 1, 1, k2dint, zlam, zphi, & 1269 & zglam(:,:,iobs), zgphi(:,:,iobs), & 1270 & zmask(:,:,iobs), zweig, zobsmask ) 1271 CALL obs_int_h2d( 1, 1, & 1272 & zweig, zssh_tmean(:,:,iobs), zext ) 1273 sladatqc%rext(jobs,1) = zext(1) 1274 ! ... Remove the MDT at the observation point 1275 sladatqc%rmod(jobs,1) = sladatqc%rext(jobs,1)  sladatqc%rext(jobs,2) 1276 1277 ENDIF 1278 ELSE 1279 zlam = sladatqc%rlam(jobs) 1280 zphi = sladatqc%rphi(jobs) 1281 ! Get weights to interpolate the model SSH to the observation point 1282 CALL obs_int_h2d_init( 1, 1, k2dint, zlam, zphi, & 1283 & zglam(:,:,iobs), zgphi(:,:,iobs), & 1284 & zmask(:,:,iobs), zweig, zobsmask ) 1285 CALL obs_int_h2d( 1, 1, & 1286 & zweig, zsshl(:,:,iobs), zext ) 1287 sladatqc%rext(jobs,1) = zext(1) 1288 ! ... Remove the MDT at the observation point 1289 sladatqc%rmod(jobs,1) = sladatqc%rext(jobs,1)  sladatqc%rext(jobs,2) 1290 ENDIF 1291 1212 1292 1213 1293 END DO … … 1222 1302 & zsshl & 1223 1303 & ) 1304 1305 ! At the end of the averaging period also deallocate interpolated time means 1306 IF ( ( l_sla_timemean ) .AND. ( imeanend == 0 ) ) THEN 1307 DEALLOCATE( zssh_tmean ) 1308 ENDIF 1224 1309 1225 1310 sladatqc%nsurfup = sladatqc%nsurfup + isla 
branches/UKMO/dev_r4650_general_vert_coord_obsoper_removetides/NEMOGCM/NEMO/OPA_SRC/OBS/obs_read_sla.F90
r5838 r7375 43 43 & sladata, knumfiles, cfilenames, & 44 44 & kvars, kextr, kstp, ddobsini, ddobsend, & 45 & ldignmis, ldmod, ldobstd )45 & ldignmis, ldmod, MeanPeriodHours, ldobstd ) 46 46 !! 47 47 !! … … 78 78 REAL(KIND=dp), INTENT(IN) :: ddobsini ! Obs. ini time in YYYYMMDD.HHMMSS 79 79 REAL(KIND=dp), INTENT(IN) :: ddobsend ! Obs. end time in YYYYMMDD.HHMMSS 80 REAL(KIND=wp), INTENT(IN) :: MeanPeriodHours ! Averaging period in hours 80 81 81 82 !! * Local declarations … … 267 268 inpfiles(jj)%iobsj = 1 268 269 ENDIF 270 271 !If the observations are representing a time mean then set the time 272 !of the obs to the end of that meaning period relative to the start of the run 273 IF ( MeanPeriodHours > 0._wp ) THEN 274 IF (lwp) WRITE(numout,*)'Adjusting time of sla obs to end of meaning period: ', djulini(jj) + (MeanPeriodHours/24.) 275 DO ji = 1, inpfiles(jj)%nobs 276 inpfiles(jj)%ptim(ji) = & 277 & djulini(jj) + (MeanPeriodHours/24.) 278 END DO 279 ENDIF 280 269 281 inowin = 0 270 282 DO ji = 1, inpfiles(jj)%nobs
Note: See TracChangeset
for help on using the changeset viewer.